Re: [E-devel] Actions for window fullscreen

2006-06-20 Thread R . Ramkumar

Hi!


well it's not a unified diff - so it'll have to be rejected (ie  a diff with the
+'s and -'s at the start of lines). also please attach diffs to mails - not
inline them :)


Took the liberty of an inline cvs diff as it was meant only for
viewing :) Sorry anyway... Here's the diff -Naur for e_actions.c
against v1.70 attached..

Regards,
Ramkumar.

--
April 1: This is the day upon which we are reminded of
what we are on the other three hundred and sixty-four.
 -- Mark Twain, Pudd'nhead Wilson's Calendar
--- e_actions.c.orig2006-06-20 20:59:49.791174768 +0530
+++ e_actions.c 2006-06-19 22:10:52.583990632 +0530
@@ -353,6 +353,67 @@
 }
 
 /***/
+ACT_FN_GO(window_fullscreen_toggle)
+{
+   if (!obj) obj = E_OBJECT(e_border_focused_get());
+   if (!obj) return;
+   if (obj-type != E_BORDER_TYPE)
+ {
+   obj = E_OBJECT(e_border_focused_get());
+   if (!obj) return;
+ }
+   if (!((E_Border *)obj)-lock_user_fullscreen)
+ {
+   E_Border *bd;
+   bd = (E_Border *)obj;
+   if (bd-fullscreen)
+ e_border_unfullscreen(bd);
+   else if (params == 0 || *params == '\0')
+ e_border_fullscreen(bd, e_config-fullscreen_policy);
+   else if (! strcmp(params, resize))
+ e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
+   else if (! strcmp(params, zoom))
+ e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
+ }
+}
+
+/***/
+ACT_FN_GO(window_fullscreen)
+{
+   if (!obj) obj = E_OBJECT(e_border_focused_get());
+   if (!obj) return;
+   if (obj-type != E_BORDER_TYPE)
+ {
+   obj = E_OBJECT(e_border_focused_get());
+   if (!obj) return;
+ }
+   if (!((E_Border *)obj)-lock_user_fullscreen)
+ {
+   E_Border *bd;
+   bd = (E_Border *)obj;
+   if (params)
+ {
+int v;
+char buf[32];
+if (sscanf(params, %i %20s, v, buf) == 2)
+  {
+ if (v == 1)
+   {
+ if (buf == 0 || *buf == '\0')
+   e_border_fullscreen(bd, e_config-fullscreen_policy);
+ else if (! strcmp(buf, resize))
+   e_border_fullscreen(bd, E_FULLSCREEN_RESIZE);
+ else if (! strcmp(buf, zoom))
+   e_border_fullscreen(bd, E_FULLSCREEN_ZOOM);
+   }
+ else if (v == 0)
+   e_border_unfullscreen(bd);
+  }
+ }
+ }
+}
+
+/***/
 ACT_FN_GO(window_maximized_toggle)
 {
if (!obj) obj = E_OBJECT(e_border_focused_get());
@@ -1201,6 +1262,97 @@
  }
 }
 
+#include sys/socket.h
+#include sys/un.h
+
+#define UNIX_PATH_MAX 108
+
+#include netinet/in.h
+#include netdb.h
+
+ACT_FN_GO(sock)
+{
+  if (params)
+{
+  struct sockaddr* addr = NULL;
+  char *buf, *token, *type;
+  int fd, addrlen, flag = 0;
+  buf = strdup (params);
+  if (! (token = strtok (buf,  ))) goto final;
+  type = token;
+  if (! (token = strtok (NULL,  ))) goto final;
+  if ((! strncmp (type, unix, 4)  (flag = 1)) ||
+ (! strncmp (type, unix-abs, 4)  (flag = 2)))
+   {
+ struct sockaddr_un *caddr;
+ if ((fd = socket (AF_UNIX, SOCK_DGRAM, 0))  0) goto final;
+ caddr = (struct sockaddr_un*) malloc (sizeof (struct sockaddr_un));
+ caddr-sun_family = AF_UNIX;
+ if (flag == 1)
+ strncpy (caddr-sun_path, token, UNIX_PATH_MAX);
+ else
+   {
+ *(caddr-sun_path) = '\0';
+ strncpy (caddr-sun_path + 1, token, UNIX_PATH_MAX - 1);
+   }
+ addr = (struct sockaddr*) caddr;
+ addrlen = sizeof (struct sockaddr_un);
+   }
+  else if ((! strcmp (type, udp)  (flag = 3)) ||
+  (! strcmp (type, tcp)  (flag = 4)))
+   {
+ struct addrinfo hints;
+ struct addrinfo* caddr, *ptr;
+ char *colon;
+ if (! (colon = strchr (token, ':'))) goto final;
+ *colon = '\0';
+ memset (hints, 0, sizeof (struct addrinfo));
+ hints.ai_family = AF_INET;
+ hints.ai_socktype = ((flag == 3) ? SOCK_DGRAM : SOCK_STREAM);
+ if (getaddrinfo (token, colon + 1, hints, caddr)) goto final;
+ for (ptr = caddr; ptr; ptr = ptr-ai_next)
+   {
+ if (ptr-ai_family == hints.ai_family 
+ ptr-ai_socktype == hints.ai_socktype)
+   {
+ if ((fd = socket (ptr-ai_family, ptr-ai_socktype,
+   ptr-ai_protocol))  0)
+   ptr = NULL;
+ else
+   {
+ addrlen = ptr-ai_addrlen;
+ addr = (struct sockaddr*) malloc (addrlen);
+ memcpy 

[E-devel] e_modules/net bug

2006-06-20 Thread Tobias
Hello

I think there's a bug in the net-module, if I set the polltime to 1 it
displays sane values, but increasing the polltime increases the Rx and
Tx values.

Dividing the in/out values with the polltime seems to be one solution.

/Regards
Tobias Glenstrup
--- e_mod_main.c.orig	2006-06-21 05:35:40.0 +0200
+++ e_mod_main.c	2006-06-21 05:48:19.0 +0200
@@ -472,6 +472,8 @@
 
bytes_in = in - inst-old_in;
bytes_out = out - inst-old_out;
+   bytes_in = bytes_in / ci-poll_time;
+   bytes_out = bytes_out / ci-poll_time;
if (bytes_in  0) bytes_in = 0;
if (bytes_out  0) bytes_out = 0;
 
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel