Re: [E-devel] Binding clearing actions

2006-09-07 Thread R . Ramkumar
Hi!

 for now i don't think it's wise to accept this. as per previous emails - i 
 have
 the ipc config in my sights to nuke because once we have a complete gui for
 all the config - there is no need to keep a very big lump of code for doing
 this via ipc (not to mention that it is incomplete and lets you shoot yourself
 in the foot etc. etc.)

Ah.. Well... I got this in for the same reason as the temporary
problem that was mentioned in the remove ipc thread... Using scripts
to restore bindings on config nuking Anyway, as you say, it may be
better not to add to the huge bloat... May be people using such
scripts will find it useful to patch this to their local tree still :)

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

-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


[E-devel] Binding clearing actions

2006-09-06 Thread R . Ramkumar

Hi!

Here's a patch to include ipc handlers for clearing all
Mouse/Key/Signal/Wheel bindings in E. Though it is theoretically
possible for an external program to read through the existing
keybindings and erase them one after the other, this offers a faster
and cleaner solution. This is useful when an external script is used
to fully configure the keybindings from scratch, ignoring the default
keybindings of E.

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
ProxyChains-3.1 (http://proxychains.sf.net)
Index: e_bindings.c
===
RCS file: /cvs/e/e17/apps/e/src/bin/e_bindings.c,v
retrieving revision 1.33
diff -u -r1.33 e_bindings.c
--- e_bindings.c23 Aug 2006 00:34:33 -  1.33
+++ e_bindings.c6 Sep 2006 13:44:36 -
@@ -81,38 +81,10 @@
 EAPI int
 e_bindings_shutdown(void)
 {
-   while (mouse_bindings)
- {
-   E_Binding_Mouse *bind;
-   
-   bind = mouse_bindings-data;
-   mouse_bindings  = evas_list_remove_list(mouse_bindings, mouse_bindings);
-   _e_bindings_mouse_free(bind);
- }
-   while (key_bindings)
- {
-   E_Binding_Key *bind;
-   
-   bind = key_bindings-data;
-   key_bindings  = evas_list_remove_list(key_bindings, key_bindings);
-   _e_bindings_key_free(bind);
- }
-   while (signal_bindings)
- {
-   E_Binding_Signal *bind;
-   
-   bind = signal_bindings-data;
-   signal_bindings  = evas_list_remove_list(signal_bindings, 
signal_bindings);
-   _e_bindings_signal_free(bind);
- }
-   while (wheel_bindings)
- {
-   E_Binding_Wheel *bind;
-   
-   bind = wheel_bindings-data;
-   wheel_bindings  = evas_list_remove_list(wheel_bindings, wheel_bindings);
-   _e_bindings_wheel_free(bind);
- }
+   e_bindings_mouse_clear();
+   e_bindings_key_clear();
+   e_bindings_signal_clear();
+   e_bindings_wheel_clear();
return 1;
 }
 
@@ -158,6 +130,19 @@
 }
 
 EAPI void
+e_bindings_mouse_clear()
+{
+   while (mouse_bindings)
+ {
+   E_Binding_Mouse *bind;
+
+   bind = mouse_bindings-data;
+   mouse_bindings  = evas_list_remove_list(mouse_bindings, mouse_bindings);
+   _e_bindings_mouse_free(bind);
+ }
+}
+
+EAPI void
 e_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window win)
 {
Evas_List *l;
@@ -350,6 +335,19 @@
 }
 
 EAPI void
+e_bindings_key_clear()
+{
+   while (key_bindings)
+ {
+   E_Binding_Key *bind;
+
+   bind = key_bindings-data;
+   key_bindings  = evas_list_remove_list(key_bindings, key_bindings);
+   _e_bindings_key_free(bind);
+ }
+}
+
+EAPI void
 e_bindings_key_grab(E_Binding_Context ctxt, Ecore_X_Window win)
 {
Evas_List *l;
@@ -520,6 +518,19 @@
  }
 }
 
+EAPI void
+e_bindings_signal_clear()
+{
+   while (signal_bindings)
+ {
+   E_Binding_Signal *bind;
+
+   bind = signal_bindings-data;
+   signal_bindings  = evas_list_remove_list(signal_bindings, 
signal_bindings);
+   _e_bindings_signal_free(bind);
+ }
+}
+
 EAPI E_Action  *
 e_bindings_signal_find(E_Binding_Context ctxt, E_Object *obj, const char *sig, 
const char *src, E_Binding_Signal **bind_ret)
 {
@@ -612,6 +623,19 @@
 wheel_bindings = evas_list_remove_list(wheel_bindings, l);
 break;
  }
+ }
+}
+
+EAPI void
+e_bindings_wheel_clear()
+{
+   while (wheel_bindings)
+ {
+   E_Binding_Wheel *bind;
+
+   bind = wheel_bindings-data;
+   wheel_bindings  = evas_list_remove_list(wheel_bindings, wheel_bindings);
+   _e_bindings_wheel_free(bind);
  }
 }
 
Index: e_bindings.h
===
RCS file: /cvs/e/e17/apps/e/src/bin/e_bindings.h,v
retrieving revision 1.14
diff -u -r1.14 e_bindings.h
--- e_bindings.h21 Aug 2006 16:25:57 -  1.14
+++ e_bindings.h6 Sep 2006 13:44:36 -
@@ -86,6 +86,7 @@
 
 EAPI voide_bindings_mouse_add(E_Binding_Context ctxt, int button, 
E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
 EAPI voide_bindings_mouse_del(E_Binding_Context ctxt, int button, 
E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
+EAPI voide_bindings_mouse_clear(void);
 EAPI voide_bindings_mouse_grab(E_Binding_Context ctxt, Ecore_X_Window 
win);
 EAPI voide_bindings_mouse_ungrab(E_Binding_Context ctxt, 
Ecore_X_Window win);
 EAPI E_Action   *e_bindings_mouse_down_find(E_Binding_Context ctxt, E_Object 
*obj, Ecore_X_Event_Mouse_Button_Down *ev, E_Binding_Mouse **bind_ret);
@@ -95,6 +96,7 @@
 
 EAPI voide_bindings_key_add(E_Binding_Context ctxt, const char *key, 
E_Binding_Modifier mod, int any_mod, const char *action, const char *params);
 EAPI voide_bindings_key_del(E_Binding_Context 

Re: [E-devel] Actions for window fullscreen

2006-07-02 Thread R . Ramkumar
Hi!1. you aren't using handy existing socket api's like ecore_con.2. as a result of this and lack of other infrastructure code - this action can
block/lock e if the other end of the socket doesn't listen or is hung and/orthe buffer fills up. the wm hanging like this is REALLY bad. this socket datadump should be asynchronous and/or done in the background without the wm
hanging waiting for the data to write.Yeah... I kind of realised that. If you think it is a feature worth getting up upstream, I will change it. Otherwise, I just need it for sending data to localhost and that doesn't generally hang :)
Ramkumar.-- April 1: This is the day upon which we are reminded ofwhat we are on the other three hundred and sixty-four.-- Mark Twain, Pudd'nhead Wilson's Calendar
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


Re: [E-devel] Actions for window fullscreen

2006-07-02 Thread R . Ramkumar
Hi!should not have to resort to them). anyway - yes. it's a decent feature. but it
is too dangerous to let in. if you do it right make it async and non-blocking,then we are in business :)Fine... Will change it when I get time :)Ramkumar.
-- April 1: This is the day upon which we are reminded ofwhat we are on the other three hundred and sixty-four.-- Mark Twain, Pudd'nhead Wilson's Calendar
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel


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] Actions for window fullscreen

2006-06-19 Thread R . Ramkumar
Hi!

This patch had been sitting with me for quite some time. If you guys
are ok with it, I could commit it. Basically adds an action for
toggling/fullscreen'ing of a window. Actually I once wrote an action
to send data over a socket, making it easy for writing shortcuts for
music player ipc's around. I know that this could be achieved by an
exec nc ..., but I was a bit unsatisfied with the delay :) I'm not
convinced myself as to whether this should go in, but I just included
it in case any one felt it was worthy enough.. Feel free to reject it
:)

Index: e_actions.c
===
RCS file: /cvs/e/e17/apps/e/src/bin/e_actions.c,v
retrieving revision 1.70
diff -r1.70 e_actions.c
355a356,416
 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);
  }
 }
  }
 }

 /***/
1203a1265,1355
 #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 (addr, ptr-ai_addr, addrlen);
   }
 break;
   }
   }
 freeaddrinfo (caddr);
 if (! ptr) goto final;
   }
   

Re: [E-devel] Taskbar Module

2006-05-30 Thread R . Ramkumar
 Hey.. you weren't supposed to touch that! But I guess now I can make it
 public.
 Available here:
 http://war.interhact.net/~iamsthitha/junk/taskbar-0.0.2.tar.gz

Just going through the code...

in _taskbar_inst_cb_drop

   if (!strcmp(type, enlightenment/border))
 {
bd = ev-data;
if (!bd) return;
 }

should be changed to:

   if (!strcmp(type, enlightenment/border))
 {
bd = ev-data;
 }
   if (!bd) return;

(sorry, don't have diff tools on this machine I am checking mail on :) )

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


___
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel