Enlightenment CVS committal Author : kwo Project : e16 Module : e
Dir : e16/e/src Modified Files: backgrounds.c desktops.c ipc.c Log Message: IPC - backward compatibility stuff, warp command. =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/backgrounds.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- backgrounds.c 29 Jan 2005 00:07:20 -0000 1.12 +++ backgrounds.c 1 Feb 2005 20:35:32 -0000 1.13 @@ -2453,6 +2453,7 @@ { IpcPrintf("Error: unknown background value type '%s'.", type); } + autosave(); } static void @@ -2572,7 +2573,7 @@ bg = BrackgroundCreateFromImage(prm, p, NULL, 0); } } - else if (!strncmp(cmd, "xset", 2)) + else if (!strncmp(cmd, "set", 2)) { BackgroundSet1(prm, p); } @@ -2616,6 +2617,36 @@ { BackgroundSet2(prm, p); } + else + { + /* Compatibility with pre- 0.16.8 clients */ + BackgroundSet1(cmd, atword(params, 2)); + } +} + +static void +IPC_BackgroundUse(const char *params, Client * c __UNUSED__) +{ + char param1[FILEPATH_LEN_MAX], w[FILEPATH_LEN_MAX]; + Background *bg; + int i, wd; + + word(params, 1, param1); + + bg = FindItem(param1, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); + if (!bg) + return; + + for (wd = 2;; wd++) + { + w[0] = 0; + word(params, wd++, w); + if (!w[0]) + break; + i = atoi(w); + DesktopSetBg(i, bg, 1); + } + autosave(); } #if 0 /* I doubt this is used */ @@ -2692,6 +2723,9 @@ " background xget <name> Special show background parameters\n" " background xset <name> ... Special set background parameters\n"} , + { + IPC_BackgroundUse, "use_bg", NULL, "Deprecated - do not use", NULL} + , #if 0 /* I doubt this is used */ {IPC_BackgroundColormodifierSet, "set_bg_colmod", NULL, "TBD", NULL} , =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -3 -r1.119 -r1.120 --- desktops.c 31 Jan 2005 18:52:15 -0000 1.119 +++ desktops.c 1 Feb 2005 20:35:35 -0000 1.120 @@ -2208,7 +2208,7 @@ if (!p || cmd[0] == '?') { - IpcPrintf("Current Desktop: %d\n", desk); + IpcPrintf("Current Desktop: %d/%d\n", desk, Conf.desks.num); } else if (!strncmp(cmd, "cfg", 3)) { @@ -2319,6 +2319,18 @@ } } +static void +IPC_NumDesks(const char *params, Client * c __UNUSED__) +{ + if (!params) + return; + + if (!strcmp(params, "?")) + { + IpcPrintf("Number of Desks: %d\n", Conf.desks.num); + } +} + IpcItem DesktopsIpcArray[] = { { DesktopsIpcDesk, @@ -2349,6 +2361,9 @@ " area lgoto <al> Goto specified linear area\n" " area lmove <dl> Move relative to current linear area\n"} , + { + IPC_NumDesks, "num_desks", NULL, "Deprecated - do not use", NULL} + , }; #define N_IPC_FUNCS (sizeof(DesktopsIpcArray)/sizeof(IpcItem)) =================================================================== RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v retrieving revision 1.195 retrieving revision 1.196 diff -u -3 -r1.195 -r1.196 --- ipc.c 29 Jan 2005 07:11:57 -0000 1.195 +++ ipc.c 1 Feb 2005 20:35:59 -0000 1.196 @@ -1013,13 +1013,13 @@ e_wm_version, E_CHECKOUT_DATE); } +#if !USE_LIBC_MALLOC static void IPC_MemDebug(const char *params __UNUSED__, Client * c __UNUSED__) { -#if !USE_LIBC_MALLOC EDisplayMemUse(); -#endif } +#endif static void IPC_Hints(const char *params, Client * c __UNUSED__) @@ -1072,7 +1072,14 @@ l = 0; sscanf(p, "%1000s %n", param, &l); p += l; - if (!strncmp(param, "allow", 2)) + + if (!strcmp(param, "?")) + { + IpcPrintf("Pointer grab on=%d win=%#lx\n", + Mode.grabs.pointer_grab_active, + Mode.grabs.pointer_grab_window); + } + else if (!strncmp(param, "allow", 2)) { l = 0; sscanf(p, "%d", &l); @@ -1368,18 +1375,6 @@ } static void -IPC_MiscInfo(const char *params __UNUSED__, Client * c __UNUSED__) -{ - IpcPrintf("stuff:\n"); - - if (Mode.focuswin) - IpcPrintf("Focus - win=%#lx\n", Mode.focuswin->client.win); - - IpcPrintf("Pointer grab on=%d win=%#lx\n", - Mode.grabs.pointer_grab_active, Mode.grabs.pointer_grab_window); -} - -static void IPC_Reparent(const char *params, Client * c __UNUSED__) { char param1[FILEPATH_LEN_MAX]; @@ -1415,21 +1410,36 @@ } } -#if 0 -static int -doWarpPointer(EWin * edummy __UNUSED__, const char *params) +static void +IPC_Warp(const char *params, Client * c __UNUSED__) { - int dx, dy; + int x, y; + + if (!params) + return; - if (params) + x = y = 0; + if (!strcmp(params, "?")) { - sscanf(params, "%i %i", &dx, &dy); - XWarpPointer(disp, None, None, 0, 0, 0, 0, dx, dy); + PointerAt(&x, &y); + IpcPrintf("Pointer location: %d %d\n", x, y); + } + else if (!strncmp(params, "abs", 3)) + { + sscanf(params, "%*s %i %i", &x, &y); + XWarpPointer(disp, None, VRoot.win, 0, 0, 0, 0, x, y); + } + else if (!strncmp(params, "rel", 3)) + { + sscanf(params, "%*s %i %i", &x, &y); + XWarpPointer(disp, None, None, 0, 0, 0, 0, x, y); + } + else + { + sscanf(params, "%i %i", &x, &y); + XWarpPointer(disp, None, None, 0, 0, 0, 0, x, y); } - - return 0; } -#endif /* the IPC Array */ @@ -1597,6 +1607,7 @@ "Retrieve some general information", "use \"general_info <info>\" to retrieve information\n" "available info is: screen_size\n"}, +#if !USE_LIBC_MALLOC { IPC_MemDebug, "dump_mem_debug", NULL, @@ -1608,6 +1619,7 @@ "very easily with all pointers allocated stamped with a time, call\n" "tree that led to that allocation, file and line, " "and the chunk size.\n"}, +#endif { IPC_Xinerama, "xinerama", NULL, @@ -1622,12 +1634,12 @@ IPC_Hints, "hints", NULL, "Set hint options", - "usage:\n" " hints xroot <normal/root>\n"}, + " hints xroot <normal/root>\n"}, { IPC_Debug, "debug", NULL, "Set debug options", - "usage:\n" " debug events <EvNo>:<EvNo>...\n"}, + " debug events <EvNo>:<EvNo>...\n"}, { IPC_Set, "set", NULL, "Set configuration parameter", NULL}, { @@ -1639,12 +1651,10 @@ { IPC_EwinInfo2, "win_info", "wi", "Show client window info", NULL}, { - IPC_MiscInfo, "dump_info", NULL, "TBD", NULL}, - { IPC_Reparent, "reparent", "rep", "Reparent window", - "usage:\n" " reparent <windowid> <new parent>\n"}, + " reparent <windowid> <new parent>\n"}, { IPC_Slideout, "slideout", NULL, "Show slideout", NULL}, { @@ -1654,6 +1664,14 @@ " remember <windowid> <parameter>...\n" "For compatibility with epplets only. In stead use\n" " wop <windowid> snap <parameter>...\n"}, + { + IPC_Warp, + "warp", NULL, + "Warp/query pointer", + " warp ? Get pointer position\n" + " warp abs <x> <y> Set pointer position\n" + " warp rel <x> <y> Move pointer relative to current position\n" + " warp <x> <y> Same as \"warp rel\"\n"}, }; static int ipc_item_count = 0; @@ -1743,7 +1761,6 @@ static void IPC_Help(const char *params, Client * c __UNUSED__) { - char buf[FILEPATH_LEN_MAX]; int i, num; const IpcItem **lst, *ipc; const char *nick; @@ -1810,13 +1827,10 @@ (ipc->nick == NULL || strcmp(params, ipc->nick))) continue; - if (ipc->nick) - sprintf(buf, " (%s)", ipc->nick); - else - buf[0] = '\0'; - - IpcPrintf(" : %s%s\n--------------------------------\n%s\n", - ipc->name, buf, ipc->help_text); + nick = (ipc->nick) ? ipc->nick : ""; + IpcPrintf("----------------------------------------\n"); + IpcPrintf("%18s %4s: %s\n", ipc->name, nick, ipc->help_text); + IpcPrintf("----------------------------------------\n"); if (ipc->extended_help_text) IpcPrintf(ipc->extended_help_text); } ------------------------------------------------------- This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting Tool for open source databases. Create drag-&-drop reports. Save time by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. Download a FREE copy at http://www.intelliview.com/go/osdn_nl _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs