Re: [E-devel] Actions for window fullscreen
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=lnk&kid=120709&bid=263057&dat=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
On Sun, 2 Jul 2006 18:26:04 +0530 "R.Ramkumar" <[EMAIL PROTECTED]> babbled: > 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/or > > the buffer fills up. the wm hanging like this is REALLY bad. this socket > > data > > dump 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 :) i noticed - BUT it CAN hang. if i ctrl-z (stop) the app listening on the socket, or it gets hung in an infinite loop etc. etc. and doesnt empty the buffer the buffer can fill up and then e get blocked from writing and now e is hung and cant do anything either. it escalates from there as now u cant change focus to another app to kill e or the stuck app listening on the socket... not without a text console (and that's not a valid answer to this problem - one 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 :) -- - Codito, ergo sum - "I code, therefore I am" -- The Rasterman (Carsten Haitzler)[EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本) 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=lnk&kid=120709&bid=263057&dat=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
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=lnk&kid=120709&bid=263057&dat=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
On Tue, 20 Jun 2006 21:07:29 +0530 "R.Ramkumar" <[EMAIL PROTECTED]> babbled: > 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.. ok - thanks. half the patch is in (the fullscreen toggle). i can't accept the sock action patch as is 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/or the buffer fills up. the wm hanging like this is REALLY bad. this socket data dump should be asynchronous and/or done in the background without the wm hanging waiting for the data to write. -- - Codito, ergo sum - "I code, therefore I am" -- The Rasterman (Carsten Haitzler)[EMAIL PROTECTED] 裸好多 Tokyo, Japan (東京 日本) 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=lnk&kid=120709&bid=263057&dat=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
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 +#include + +#define UNIX_PATH_MAX 108 + +#include +#include + +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); +
Re: [E-devel] Actions for window fullscreen
On Mon, 19 Jun 2006 22:41:40 +0530 "R.Ramkumar" <[EMAIL PROTECTED]> babbled: > 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 > :) 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 :) > 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 > > #include > > > > #define UNIX_PATH_MAX 108 > > > > #include > > #include > > > > 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 (pt
[E-devel] Actions for window fullscreen
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 > #include > > #define UNIX_PATH_MAX 108 > > #include > #include > > 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); >