Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        actions.c iclass.c ipc.c mod-desks.c tclass.c 


Log Message:
Shuffle around some more.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.174.2.16
retrieving revision 1.174.2.17
diff -u -3 -r1.174.2.16 -r1.174.2.17
--- actions.c   19 Sep 2004 08:02:14 -0000      1.174.2.16
+++ actions.c   24 Sep 2004 22:40:30 -0000      1.174.2.17
@@ -953,77 +953,6 @@
 /* Desktop actions */
 
 static int
-DoGotoDesktop(EWin * edummy __UNUSED__, const char *params, int num)
-{
-   int                 pd;
-
-   pd = desks.current;
-
-   if (params)
-      sscanf(params, "%i", &num);
-   GotoDesktop(num);
-
-   if (desks.current != pd)
-      SoundPlay("SOUND_DESKTOP_SHUT");
-
-   return 0;
-}
-
-static int
-doNextDesktop(EWin * edummy, const char *params __UNUSED__)
-{
-   return DoGotoDesktop(edummy, NULL, desks.current + 1);
-}
-
-static int
-doPrevDesktop(EWin * edummy, const char *params __UNUSED__)
-{
-   return DoGotoDesktop(edummy, NULL, desks.current - 1);
-}
-
-static int
-doGotoDesktop(EWin * edummy, const char *params)
-{
-   return DoGotoDesktop(edummy, params, desks.current);
-}
-
-static int
-doInplaceDesktop(EWin * edummy, const char *params)
-{
-   return DoGotoDesktop(edummy, params, desks.current);
-}
-
-static int
-doRaiseDesktop(EWin * edummy __UNUSED__, const char *params)
-{
-   int                 d = 0;
-
-   if (!params)
-      d = desks.current;
-   else
-      d = atoi(params);
-   SoundPlay("SOUND_DESKTOP_RAISE");
-   RaiseDesktop(d);
-
-   return 0;
-}
-
-static int
-doLowerDesktop(EWin * edummy __UNUSED__, const char *params)
-{
-   int                 d = 0;
-
-   if (!params)
-      d = desks.current;
-   else
-      d = atoi(params);
-   SoundPlay("SOUND_DESKTOP_LOWER");
-   LowerDesktop(d);
-
-   return 0;
-}
-
-static int
 doDragDesktop(EWin * edummy __UNUSED__, const char *params)
 {
    int                 d = 0;
@@ -1742,6 +1671,7 @@
 
 /* Area actions */
 
+#if 0
 static int
 doAreaSet(EWin * edummy __UNUSED__, const char *params)
 {
@@ -1794,6 +1724,7 @@
      }
    return 0;
 }
+#endif
 
 static int
 doWarpPointer(EWin * edummy __UNUSED__, const char *params)
@@ -2276,13 +2207,13 @@
    ACTION_ITEM(1, 0, 0, 1, doResizeV), /* ACTION_RESIZE_V */
    ACTION_ITEM(1, 0, 0, 0, doKill),    /* ACTION_KILL */
    ACTION_ITEM(1, 0, 0, 0, doKillNasty),       /* ACTION_KILL_NASTY */
-   ACTION_ITEM(0, 0, 1, 0, doNextDesktop),     /* ACTION_DESKTOP_NEXT */
-   ACTION_ITEM(0, 0, 1, 0, doPrevDesktop),     /* ACTION_DESKTOP_PREV */
-   ACTION_ITEM(0, 0, 0, 0, doRaiseDesktop),    /* ACTION_DESKTOP_RAISE */
-   ACTION_ITEM(0, 0, 0, 0, doLowerDesktop),    /* ACTION_DESKTOP_LOWER */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_DESKTOP_NEXT */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_DESKTOP_PREV */
+   ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_DESKTOP_RAISE */
+   ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_DESKTOP_LOWER */
    ACTION_ITEM(0, 0, 0, 0, doDragDesktop),     /* ACTION_DESKTOP_DRAG */
    ACTION_ITEM(1, 0, 0, 0, doStick),   /* ACTION_STICK */
-   ACTION_ITEM(0, 0, 0, 0, doInplaceDesktop),  /* ACTION_DESKTOP_INPLACE */
+   ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_DESKTOP_INPLACE */
    ACTION_ITEM(0, 0, 0, 0, doDragButtonStart), /* ACTION_DRAG_BUTTON */
    ACTION_ITEM(0, 0, 0, 0, doFocusModeSet),    /* ACTION_FOCUSMODE_SET @@ */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_MOVEMODE_SET @@ */
@@ -2303,7 +2234,7 @@
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_DESKSLIDE_SPEED_SET @@ */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_HIQUALITYBG_SET @@ */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_PLAYSOUNDCLASS */
-   ACTION_ITEM(0, 0, 1, 0, doGotoDesktop),     /* ACTION_GOTO_DESK */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_GOTO_DESK */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_DESKRAY @@ */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_AUTOSAVE_SET @@ */
    ACTION_ITEM(0, 0, 0, 0, doHideShowButton),  /* ACTION_HIDESHOW_BUTTON */
@@ -2323,16 +2254,16 @@
    ACTION_ITEM(0, 0, 0, 0, doFocusPrev),       /* ACTION_FOCUS_PREV */
    ACTION_ITEM(1, 0, 0, 0, doFocusSet),        /* ACTION_FOCUS_SET */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_BACKGROUND_SET */
-   ACTION_ITEM(0, 0, 1, 0, doAreaSet), /* ACTION_AREA_SET */
-   ACTION_ITEM(0, 0, 1, 0, doAreaMoveBy),      /* ACTION_MOVE_BY */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_AREA_SET */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_MOVE_BY */
    ACTION_ITEM(0, 0, 0, 0, doToggleFixedPos),  /* ACTION_TOGGLE_FIXED */
    ACTION_ITEM(1, 0, 0, 0, doSetLayer),        /* ACTION_SET_LAYER */
    ACTION_ITEM(0, 0, 0, 0, doWarpPointer),     /* ACTION_WARP_POINTER */
    ACTION_ITEM(1, 0, 0, 0, doMoveWinToArea),   /* ACTION_MOVE_WINDOW_TO_AREA */
    ACTION_ITEM(1, 0, 0, 0, doMoveWinByArea),   /* ACTION_MOVE_WINDOW_BY_AREA */
    ACTION_ITEM(1, 0, 0, 0, doSetWinBorder),    /* ACTION_SET_WINDOW_BORDER */
-   ACTION_ITEM(0, 0, 1, 0, doLinearAreaSet),   /* ACTION_LINEAR_AREA_SET */
-   ACTION_ITEM(0, 0, 1, 0, doLinearAreaMoveBy),        /* ACTION_LINEAR_MOVE_BY */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_LINEAR_AREA_SET */
+   ACTION_ITEM(0, 0, 1, 0, NULL),      /* ACTION_LINEAR_MOVE_BY */
    ACTION_ITEM(0, 0, 0, 0, doAbout),   /* ACTION_ABOUT */
    ACTION_ITEM(0, 0, 0, 0, NULL),      /* ACTION_FX */
    ACTION_ITEM(1, 0, 0, 0, doMoveWinToLinearArea),     /* 
ACTION_MOVE_WINDOW_TO_LINEAR_AREA */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iclass.c,v
retrieving revision 1.46.2.7
retrieving revision 1.46.2.8
diff -u -3 -r1.46.2.7 -r1.46.2.8
--- iclass.c    18 Sep 2004 13:32:27 -0000      1.46.2.7
+++ iclass.c    24 Sep 2004 22:40:32 -0000      1.46.2.8
@@ -1294,206 +1294,177 @@
 }
 
 static void
-ImageclassIpc(const char *params, Client * c)
+ImageclassIpc(const char *params, Client * c __UNUSED__)
 {
+   char                param1[FILEPATH_LEN_MAX];
+   char                param2[FILEPATH_LEN_MAX];
+   char                param3[FILEPATH_LEN_MAX];
    char                pq;
-   char                buf[FILEPATH_LEN_MAX];
    ImageClass         *ic;
 
-   buf[0] = 0;
-
    if (params)
      {
-       char                param1[FILEPATH_LEN_MAX];
-       char                param2[FILEPATH_LEN_MAX];
-       char                param3[FILEPATH_LEN_MAX];
-
-       param1[0] = 0;
-       param2[0] = 0;
-       param3[0] = 0;
-
-       word(params, 1, param1);
-       word(params, 2, param2);
-       if (param2[0])
+       IpcPrintf("Please specify...\n");
+       return;
+     }
+
+   param1[0] = 0;
+   param2[0] = 0;
+   param3[0] = 0;
+
+   word(params, 1, param1);
+   word(params, 2, param2);
+
+   if (!strcmp(param2, "create"))
+     {
+     }
+   else if (!strcmp(param2, "delete"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+          ImageclassDestroy(ic);
+     }
+   else if (!strcmp(param2, "modify"))
+     {
+     }
+   else if (!strcmp(param2, "free_pixmap"))
+     {
+       Pixmap              p;
+
+       word(params, 3, param3);
+       p = (Pixmap) strtol(param3, (char **)NULL, 0);
+       imlib_free_pixmap_and_mask(p);
+     }
+   else if (!strcmp(param2, "get_padding"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+          IpcPrintf("%i %i %i %i\n",
+                    ic->padding.left, ic->padding.right,
+                    ic->padding.top, ic->padding.bottom);
+       else
+          IpcPrintf("Error: Imageclass does not exist\n");
+     }
+   else if (!strcmp(param2, "get_image_size"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
          {
-            if (!strcmp(param1, "create"))
-              {
-              }
-            else if (!strcmp(param2, "delete"))
-              {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                    ImageclassDestroy(ic);
-              }
-            else if (!strcmp(param2, "modify"))
-              {
-              }
-            else if (!strcmp(param2, "free_pixmap"))
-              {
-                 Pixmap              p;
+            Imlib_Image        *im = NULL;
 
-                 word(params, 3, param3);
-                 p = (Pixmap) strtol(param3, (char **)NULL, 0);
-                 imlib_free_pixmap_and_mask(p);
-              }
-            else if (!strcmp(param2, "get_padding"))
-              {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                    Esnprintf(buf, sizeof(buf), "%i %i %i %i",
-                              ic->padding.left, ic->padding.right,
-                              ic->padding.top, ic->padding.bottom);
-                 else
-                    Esnprintf(buf, sizeof(buf),
-                              "Error: Imageclass does not exist");
-              }
-            else if (!strcmp(param2, "get_image_size"))
+            if (ic->norm.normal->im_file)
               {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
+                 if (!ic->norm.normal->real_file)
+                    ic->norm.normal->real_file =
+                       ThemeFileFind(ic->norm.normal->im_file);
+                 if (ic->norm.normal->real_file)
+                    im = imlib_load_image(ic->norm.normal->real_file);
+                 if (im)
                    {
-                      Imlib_Image        *im = NULL;
-
-                      if (ic->norm.normal->im_file)
-                        {
-                           if (!ic->norm.normal->real_file)
-                              ic->norm.normal->real_file =
-                                 ThemeFileFind(ic->norm.normal->im_file);
-                           if (ic->norm.normal->real_file)
-                              im =
-                                 imlib_load_image(ic->norm.normal->real_file);
-                           if (im)
-                             {
-                                imlib_context_set_image(im);
-                                Esnprintf(buf, sizeof(buf), "%i %i",
-                                          imlib_image_get_width(),
-                                          imlib_image_get_height());
-                                imlib_free_image();
-                             }
-                           else
-                              Esnprintf(buf, sizeof(buf),
-                                        "Error: Image does not exist");
-                        }
-                      else
-                         Esnprintf(buf, sizeof(buf),
-                                   "Error: Image does not exist");
+                      imlib_context_set_image(im);
+                      IpcPrintf("%i %i\n", imlib_image_get_width(),
+                                imlib_image_get_height());
+                      imlib_free_image();
                    }
                  else
-                    Esnprintf(buf, sizeof(buf),
-                              "Error: Imageclass does not exist");
+                    IpcPrintf("Error: Image does not exist\n");
               }
-            else if (!strcmp(param2, "apply"))
-              {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                   {
-                      Window              win;
-                      char                state[20];
-                      const char         *winptr, *hptr;
-                      int                 st, w = -1, h = -1;
-
-                      winptr = atword(params, 3);
-                      word(params, 4, state);
-                      win = (Window) strtol(winptr, (char **)NULL, 0);
-                      if (!strcmp(state, "hilited"))
-                         st = STATE_HILITED;
-                      else if (!strcmp(state, "clicked"))
-                         st = STATE_CLICKED;
-                      else if (!strcmp(state, "disabled"))
-                         st = STATE_DISABLED;
-                      else
-                         st = STATE_NORMAL;
-                      if ((hptr = atword(params, 6)))
-                        {
-                           w = (int)strtol(atword(params, 5), (char **)NULL,
-                                           0);
-                           h = (int)strtol(hptr, (char **)NULL, 0);
-                        }
-                      pq = Mode.queue_up;
-                      Mode.queue_up = 0;
-                      ImageclassApply(ic, win, w, h, 0, 0, st, 0, ST_UNKNWN);
-                      Mode.queue_up = pq;
-                   }
-              }
-            else if (!strcmp(param2, "apply_copy"))
-              {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                   {
-                      Window              win;
-                      char                state[20];
-                      const char         *winptr, *hptr;
-                      int                 st, w = -1, h = -1;
-
-                      winptr = atword(params, 3);
-                      word(params, 4, state);
-                      win = (Window) strtol(winptr, (char **)NULL, 0);
-                      if (!strcmp(state, "hilited"))
-                         st = STATE_HILITED;
-                      else if (!strcmp(state, "clicked"))
-                         st = STATE_CLICKED;
-                      else if (!strcmp(state, "disabled"))
-                         st = STATE_DISABLED;
-                      else
-                         st = STATE_NORMAL;
-                      if (!(hptr = atword(params, 6)))
-                         Esnprintf(buf, sizeof(buf),
-                                   "Error:  missing width and/or height");
-                      else
-                        {
-                           PmapMask            pmm;
-
-                           w = (int)strtol(atword(params, 5), (char **)NULL,
-                                           0);
-                           h = (int)strtol(hptr, (char **)NULL, 0);
-                           pq = Mode.queue_up;
-                           Mode.queue_up = 0;
-                           ImageclassApplyCopy(ic, win, w, h, 0, 0, st,
-                                               &pmm, 1, ST_UNKNWN);
-                           Mode.queue_up = pq;
-                           Eprintf("-pmm: %#lx - %#lx %#lx\n", win, pmm.pmap,
-                                   pmm.mask);
-                           Esnprintf(buf, sizeof(buf), "0x%08x 0x%08x",
-                                     (unsigned)pmm.pmap, (unsigned)pmm.mask);
-/*                         FreePmapMask(&pmm);         ??? */
-                        }
-                   }
-              }
-            else if (!strcmp(param2, "ref_count"))
+            else
+               IpcPrintf("Error: Image does not exist\n");
+         }
+       else
+          IpcPrintf("Error: Imageclass does not exist\n");
+     }
+   else if (!strcmp(param2, "apply"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+         {
+            Window              win;
+            char                state[20];
+            const char         *winptr, *hptr;
+            int                 st, w = -1, h = -1;
+
+            winptr = atword(params, 3);
+            word(params, 4, state);
+            win = (Window) strtol(winptr, (char **)NULL, 0);
+            if (!strcmp(state, "hilited"))
+               st = STATE_HILITED;
+            else if (!strcmp(state, "clicked"))
+               st = STATE_CLICKED;
+            else if (!strcmp(state, "disabled"))
+               st = STATE_DISABLED;
+            else
+               st = STATE_NORMAL;
+            if ((hptr = atword(params, 6)))
               {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                    Esnprintf(buf, sizeof(buf), "%u references remain",
-                              ic->ref_count);
-              }
-            else if (!strcmp(param2, "query"))
-              {
-                 ic = ImageclassFind(param1, 0);
-                 if (ic)
-                    Esnprintf(buf, sizeof(buf), "ImageClass %s found",
-                              ic->name);
-                 else
-                    Esnprintf(buf, sizeof(buf), "ImageClass %s not found",
-                              param1);
+                 w = (int)strtol(atword(params, 5), (char **)NULL, 0);
+                 h = (int)strtol(hptr, (char **)NULL, 0);
               }
+            pq = Mode.queue_up;
+            Mode.queue_up = 0;
+            ImageclassApply(ic, win, w, h, 0, 0, st, 0, ST_UNKNWN);
+            Mode.queue_up = pq;
+         }
+     }
+   else if (!strcmp(param2, "apply_copy"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+         {
+            Window              win;
+            char                state[20];
+            const char         *winptr, *hptr;
+            int                 st, w = -1, h = -1;
+
+            winptr = atword(params, 3);
+            word(params, 4, state);
+            win = (Window) strtol(winptr, (char **)NULL, 0);
+            if (!strcmp(state, "hilited"))
+               st = STATE_HILITED;
+            else if (!strcmp(state, "clicked"))
+               st = STATE_CLICKED;
+            else if (!strcmp(state, "disabled"))
+               st = STATE_DISABLED;
+            else
+               st = STATE_NORMAL;
+            if (!(hptr = atword(params, 6)))
+               IpcPrintf("Error:  missing width and/or height\n");
             else
               {
-                 Esnprintf(buf, sizeof(buf),
-                           "Error: unknown operation specified");
+                 PmapMask            pmm;
+
+                 w = (int)strtol(atword(params, 5), (char **)NULL, 0);
+                 h = (int)strtol(hptr, (char **)NULL, 0);
+                 pq = Mode.queue_up;
+                 Mode.queue_up = 0;
+                 ImageclassApplyCopy(ic, win, w, h, 0, 0, st,
+                                     &pmm, 1, ST_UNKNWN);
+                 Mode.queue_up = pq;
+                 IpcPrintf("0x%08x 0x%08x\n",
+                           (unsigned)pmm.pmap, (unsigned)pmm.mask);
+/*                         FreePmapMask(&pmm);         ??? */
               }
          }
+     }
+   else if (!strcmp(param2, "ref_count"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+          IpcPrintf("%u references remain\n", ic->ref_count);
+     }
+   else if (!strcmp(param2, "query"))
+     {
+       ic = ImageclassFind(param1, 0);
+       if (ic)
+          IpcPrintf("ImageClass %s found\n", ic->name);
        else
-         {
-            Esnprintf(buf, sizeof(buf), "Error: no class specified");
-         }
+          IpcPrintf("ImageClass %s not found\n", param1);
      }
    else
      {
-       Esnprintf(buf, sizeof(buf), "Error: no operation specified");
+       IpcPrintf("Error: unknown operation specified\n");
      }
-
-   if (buf[0])
-      CommsSend(c, buf);
 }
 
 IpcItem             ImageclassIpcArray[] = {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.24
retrieving revision 1.174.2.25
diff -u -3 -r1.174.2.24 -r1.174.2.25
--- ipc.c       19 Sep 2004 08:02:15 -0000      1.174.2.24
+++ ipc.c       24 Sep 2004 22:40:32 -0000      1.174.2.25
@@ -259,137 +259,6 @@
 }
 
 static void
-IPC_Button(const char *params, Client * c)
-{
-
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-
-   if (params)
-     {
-       char                param1[FILEPATH_LEN_MAX];
-       char                param2[FILEPATH_LEN_MAX];
-       char                param3[FILEPATH_LEN_MAX];
-
-       param1[0] = 0;
-       param2[0] = 0;
-       param3[0] = 0;
-
-       word(params, 1, param1);
-       word(params, 2, param2);
-       if (param2[0])
-         {
-            if (!strcmp(param2, "create"))
-              {
-              }
-            else if (!strcmp(param2, "delete"))
-              {
-                 Button             *b;
-
-                 b = (Button *) FindItem(param1, 0, LIST_FINDBY_NAME,
-                                         LIST_TYPE_BUTTON);
-                 if (b)
-                    ButtonDestroy(b);
-              }
-            else if (!strcmp(param2, "modify"))
-              {
-              }
-            else if (!strcmp(param2, "ref_count"))
-              {
-                 Button             *b;
-
-                 b = (Button *) FindItem(param1, 0, LIST_FINDBY_NAME,
-                                         LIST_TYPE_BUTTON);
-                 if (b)
-                    Esnprintf(buf, sizeof(buf), "%u references remain",
-                              ButtonGetRefcount(b));
-              }
-            else
-              {
-                 Esnprintf(buf, sizeof(buf), "Error: no cursor specified");
-              }
-         }
-       else
-         {
-            Esnprintf(buf, sizeof(buf), "Error: unknown operation specified");
-         }
-     }
-   else
-     {
-       Esnprintf(buf, sizeof(buf), "Error: no operation specified");
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
-IPC_Border(const char *params, Client * c)
-{
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-
-   if (params)
-     {
-       char                param1[FILEPATH_LEN_MAX];
-       char                param2[FILEPATH_LEN_MAX];
-       char                param3[FILEPATH_LEN_MAX];
-
-       param1[0] = 0;
-       param2[0] = 0;
-       param3[0] = 0;
-
-       word(params, 1, param1);
-       word(params, 2, param2);
-       if (param2[0])
-         {
-            if (!strcmp(param2, "create"))
-              {
-              }
-            else if (!strcmp(param2, "delete"))
-              {
-                 Border             *b;
-
-                 b = (Border *) FindItem(param1, 0, LIST_FINDBY_NAME,
-                                         LIST_TYPE_BORDER);
-                 if (b)
-                    BorderDestroy(b);
-              }
-            else if (!strcmp(param2, "modify"))
-              {
-              }
-            else if (!strcmp(param2, "ref_count"))
-              {
-                 Border             *b;
-
-                 b = (Border *) FindItem(param1, 0, LIST_FINDBY_NAME,
-                                         LIST_TYPE_BORDER);
-                 if (b)
-                    Esnprintf(buf, sizeof(buf), "%u references remain",
-                              b->ref_count);
-              }
-            else
-              {
-                 Esnprintf(buf, sizeof(buf), "Error: no cursor specified");
-              }
-         }
-       else
-         {
-            Esnprintf(buf, sizeof(buf), "Error: unknown operation specified");
-         }
-     }
-   else
-     {
-       Esnprintf(buf, sizeof(buf), "Error: no operation specified");
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
 IPC_ColorModifierClass(const char *params, Client * c)
 {
    char                buf[FILEPATH_LEN_MAX];
@@ -851,80 +720,6 @@
 }
 
 static void
-IPC_GotoArea(const char *params, Client * c)
-{
-   char                buf[FILEPATH_LEN_MAX];
-   char                param1[FILEPATH_LEN_MAX];
-   char                param2[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-   param1[0] = 0;
-   param2[0] = 0;
-
-   if (!params)
-     {
-       Esnprintf(buf, sizeof(buf), "Error: no area specified");
-     }
-   else
-     {
-       int                 a, b;
-
-       word(params, 1, param1);
-       if (!strcmp(param1, "next"))
-         {
-            GetCurrentArea(&a, &b);
-            word(params, 2, param2);
-            if ((param2[0]) && (!strcmp(param2, "horiz")))
-              {
-                 a++;
-              }
-            else if ((param2[0]) && (!strcmp(param2, "vert")))
-              {
-                 b++;
-              }
-            else
-              {
-                 a++;
-                 b++;
-              }
-            SetCurrentArea(a, b);
-         }
-       else if (!strcmp(param1, "prev"))
-         {
-            GetCurrentArea(&a, &b);
-            word(params, 2, param2);
-            if ((param2[0]) && (!strcmp(param2, "horiz")))
-              {
-                 a--;
-              }
-            else if ((param2[0]) && (!strcmp(param2, "vert")))
-              {
-                 b--;
-              }
-            else
-              {
-                 a--;
-                 b--;
-              }
-            SetCurrentArea(a, b);
-         }
-       else if (!strcmp(param1, "?"))
-         {
-            GetCurrentArea(&a, &b);
-            Esnprintf(buf, sizeof(buf), "Current Area: %d %d", a, b);
-         }
-       else
-         {
-            sscanf(params, "%i %i", &a, &b);
-            SetCurrentArea(a, b);
-         }
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
 IPC_WinOps(const char *params, Client * c)
 {
    char                buf[FILEPATH_LEN_MAX];
@@ -1305,65 +1100,6 @@
 }
 
 static void
-IPC_NumAreas(const char *params, Client * c)
-{
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-   if (params)
-     {
-       if (!strcmp(params, "?"))
-         {
-            int                 ax, ay;
-
-            GetAreaSize(&ax, &ay);
-            Esnprintf(buf, sizeof(buf), "Number of Areas: %d %d", ax, ay);
-         }
-       else
-         {
-            char                ax[128], ay[128];
-
-            word(params, 1, ax);
-            word(params, 2, ay);
-            SetNewAreaSize(atoi(ax), atoi(ay));
-         }
-     }
-   else
-     {
-       Esnprintf(buf, sizeof(buf), "Error: number of areas not given");
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
-IPC_NumDesks(const char *params, Client * c)
-{
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-   if (params)
-     {
-       if (!strcmp(params, "?"))
-         {
-            Esnprintf(buf, sizeof(buf), "Number of Desks: %d", Conf.desks.num);
-         }
-       else
-         {
-            ChangeNumberOfDesktops(atoi(params));
-         }
-     }
-   else
-     {
-       Esnprintf(buf, sizeof(buf), "Error: number of desks not given");
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
 IPC_FocusMode(const char *params, Client * c)
 {
    char                buf[FILEPATH_LEN_MAX];
@@ -1431,40 +1167,6 @@
 }
 
 static void
-IPC_GotoDesktop(const char *params, Client * c)
-{
-   char                buf[FILEPATH_LEN_MAX];
-
-   buf[0] = 0;
-   if (!params)
-     {
-       Esnprintf(buf, sizeof(buf), "Error: no desktop selected");
-     }
-   else
-     {
-       if (!strcmp(params, "next"))
-         {
-            ActionsCall(ACTION_DESKTOP_NEXT, NULL, NULL);
-         }
-       else if (!strcmp(params, "prev"))
-         {
-            ActionsCall(ACTION_DESKTOP_PREV, NULL, NULL);
-         }
-       else if (!strcmp(params, "?"))
-         {
-            Esnprintf(buf, sizeof(buf), "Current Desktop: %d", desks.current);
-         }
-       else
-         {
-            ActionsCall(ACTION_GOTO_DESK, NULL, params);
-         }
-     }
-
-   if (buf[0])
-      CommsSend(c, buf);
-}
-
-static void
 IPC_ForceSave(const char *params __UNUSED__, Client * c __UNUSED__)
 {
    autosave();
@@ -2639,23 +2341,6 @@
     "Force Enlightenment to save settings now",
     NULL},
    {
-    IPC_GotoDesktop,
-    "goto_desktop", "sd",
-    "Change currently active destkop",
-    "Use \"goto_desktop num\" to go to a specific desktop.\n"
-    "Use \"goto_desktop next\" and \"goto_desktop prev\" to go to "
-    "the next and\n     previous desktop\n"
-    "Use \"goto_desktop ?\" to find out what desktop you are " "currently on"},
-   {
-    IPC_GotoArea,
-    "goto_area", "sa",
-    "Change currently active area",
-    "Use \"goto_area <horiz> <vert>\" to go to a specific desktop.\n"
-    "Use \"goto_desktop next <vert/horiz>\" and \"goto_desktop "
-    "prev <vert/horiz>\" to go to the next and\n     "
-    "previous areas\nUse \"goto_area ?\" to find out what area "
-    "you are currently on"},
-   {
     IPC_FocusMode,
     "focus_mode", "sf",
     "Change the current focus mode setting",
@@ -2670,19 +2355,6 @@
     "but when over\n    "
     "the desktop background the last window does not lose the focus"},
    {
-    IPC_NumDesks,
-    "num_desks", "snd",
-    "Change the number of available desktops",
-    "Use \"num_desks <num>\" to change the available number of desktops.\n"
-    "Use \"num_desks ?\" to retrieve the current setting"},
-   {
-    IPC_NumAreas,
-    "num_areas", "sna",
-    "Change the size of the virtual desktop",
-    "Use \"num_areas <width> <height>\" to change the size of the "
-    "virtual desktop.\nExample: \"num_areas 2 2\" makes 2x2 "
-    "virtual destkops\nUse \"num_areas ?\" to retrieve the " "current setting"},
-   {
     IPC_WinOps,
     "win_op", "wop",
     "Change a property of a specific window",
@@ -2797,16 +2469,6 @@
     "Create/Delete/Modify a ColorModifierClass",
     "This doesn't do anything yet."},
    {
-    IPC_Border,
-    "border", NULL,
-    "Create/Delete/Modify a Border",
-    "This doesn't do anything yet."},
-   {
-    IPC_Button,
-    "button", NULL,
-    "Create/Delete/Modify a Button",
-    "This doesn't do anything yet."},
-   {
     IPC_GeneralInfo,
     "general_info", NULL,
     "Retrieve some general information",
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-desks.c,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -3 -r1.1.2.7 -r1.1.2.8
--- mod-desks.c 5 Sep 2004 11:46:46 -0000       1.1.2.7
+++ mod-desks.c 24 Sep 2004 22:40:33 -0000      1.1.2.8
@@ -484,12 +484,94 @@
    CB_AreaDisplayRedraw(1, area);
 }
 
+/*
+ * IPC functions
+ */
+
+static void
+DoGotoDesktop(int desk)
+{
+   int                 pd = desks.current;
+
+   GotoDesktop(desk);
+
+   if (desks.current != pd)
+      SoundPlay("SOUND_DESKTOP_SHUT");
+}
+
+static void
+DesktopsIpcDesk(const char *params, Client * c __UNUSED__)
+{
+   const char         *p;
+   char                cmd[128], prm[128];
+   int                 len;
+   int                 desk;
+
+   p = NULL;
+   if (params)
+     {
+       p = params;
+       len = 0;
+       cmd[0] = prm[0] = '\0';
+       sscanf(p, "%100s %100s %n", cmd, prm, &len);
+       p += len;
+     }
+
+   desk = desks.current;
+
+   if (!p || cmd[0] == '?')
+     {
+       IpcPrintf("Current Desktop: %d\n", desks.current);
+     }
+   else if (!strncmp(cmd, "cfg", 3))
+     {
+       SettingsDesktops();
+     }
+   else if (!strncmp(cmd, "set", 3))
+     {
+       sscanf(prm, "%i", &desk);
+       ChangeNumberOfDesktops(desk);
+     }
+   else if (!strncmp(cmd, "goto", 2))
+     {
+       sscanf(prm, "%i", &desk);
+       DoGotoDesktop(desk);
+     }
+   else if (!strncmp(cmd, "next", 2))
+     {
+       DoGotoDesktop(desks.current + 1);
+     }
+   else if (!strncmp(cmd, "prev", 2))
+     {
+       DoGotoDesktop(desks.current - 1);
+     }
+   else if (!strncmp(cmd, "this", 2))
+     {
+       DoGotoDesktop(desks.current);
+     }
+   else if (!strncmp(cmd, "raise", 2))
+     {
+       desk = desks.current;
+       sscanf(prm, "%i", &desk);
+       SoundPlay("SOUND_DESKTOP_RAISE");
+       RaiseDesktop(desk);
+     }
+   else if (!strncmp(cmd, "lower", 2))
+     {
+       desk = desks.current;
+       sscanf(prm, "%i", &desk);
+       SoundPlay("SOUND_DESKTOP_LOWER");
+       LowerDesktop(desk);
+     }
+}
+
 static void
-DesktopsIpc(const char *params, Client * c __UNUSED__)
+DesktopsIpcArea(const char *params, Client * c __UNUSED__)
 {
    const char         *p;
    char                cmd[128], prm[128];
    int                 len;
+   int                 ax, ay, dx, dy;
 
    p = NULL;
    if (params)
@@ -501,25 +583,72 @@
        p += len;
      }
 
+   GetCurrentArea(&ax, &ay);
+
    if (!p || cmd[0] == '?')
      {
-       /* Show info */
+       IpcPrintf("Current Area: %d %d\n", ax, ay);
      }
    else if (!strncmp(cmd, "cfg", 3))
      {
-       if (!strcmp(prm, "area"))
-          SettingsArea();
-       else
-          SettingsDesktops();
+       SettingsArea();
+     }
+   else if (!strncmp(cmd, "set", 3))
+     {
+       sscanf(params, "%*s %i %i", &ax, &ay);
+       SetNewAreaSize(ax, ay);
+     }
+   else if (!strncmp(cmd, "goto", 2))
+     {
+       sscanf(params, "%*s %i %i", &ax, &ay);
+       SetCurrentArea(ax, ay);
+     }
+   else if (!strncmp(cmd, "move", 2))
+     {
+       dx = dy = 0;
+       sscanf(params, "%*s %i %i", &dx, &dy);
+       MoveCurrentAreaBy(dx, dy);
+     }
+   else if (!strncmp(cmd, "lgoto", 2))
+     {
+       sscanf(params, "%*s %i", &ax);
+       SetCurrentLinearArea(ax);
+     }
+   else if (!strncmp(cmd, "lmove", 2))
+     {
+       dx = 0;
+       sscanf(params, "%*s %i", &dx);
+       MoveCurrentLinearAreaBy(dx);
      }
 }
 
 IpcItem             DesktopsIpcArray[] = {
    {
-    DesktopsIpc,
-    "desktop", "desk",
+    DesktopsIpcDesk,
+    "desk", NULL,
     "Desktop functions",
-    "  desktop cfg          Configure desktops"}
+    "  desk ?               Desktop info"
+    "  desk cfg             Configure desktops"
+    "  desk set <nd>        Set number of desktops"
+    "  desk goto <d>        Goto specified desktop"
+    "  desk next            Goto next desktop"
+    "  desk prev            Goto previous desktop"
+    "  desk this            Goto this desktop"
+    "  desk lower <d>       Lower desktop"
+    "  desk raise <d>       Raise desktop"}
+   ,
+   {
+    DesktopsIpcArea,
+    "area", NULL,
+    "Area functions",
+    "  area ?               Area info"
+    "  area cfg             Configure areas"
+    "  area set <nx> <ny>   Set area size"
+    "  area goto <ax> <ay>  Goto specified area"
+    "  area move <dx> <dy>  Move relative to current area"
+    "  area lgoto <al>      Goto specified linear area"
+    "  area lmove <dl>      Move relative to current linear area"}
+   ,
 };
 #define N_IPC_FUNCS (sizeof(DesktopsIpcArray)/sizeof(IpcItem))
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/tclass.c,v
retrieving revision 1.27.2.3
retrieving revision 1.27.2.4
diff -u -3 -r1.27.2.3 -r1.27.2.4
--- tclass.c    1 Sep 2004 23:37:20 -0000       1.27.2.3
+++ tclass.c    24 Sep 2004 22:40:33 -0000      1.27.2.4
@@ -505,131 +505,112 @@
 }
 
 static void
-TextclassIpc(const char *params, Client * c)
+TextclassIpc(const char *params, Client * c __UNUSED__)
 {
    char                pq;
-   char                buf[FILEPATH_LEN_MAX];
+   char                param1[FILEPATH_LEN_MAX];
+   char                param2[FILEPATH_LEN_MAX];
+   char                param3[FILEPATH_LEN_MAX];
    TextClass          *tc;
 
-   buf[0] = 0;
+   if (!params)
+     {
+       IpcPrintf("Please specify...\n");
+       return;
+     }
+
+   param1[0] = 0;
+   param2[0] = 0;
+   param3[0] = 0;
 
-   if (params)
+   word(params, 1, param1);
+   word(params, 2, param2);
+
+   if (!param1[0])
      {
-       char                param1[FILEPATH_LEN_MAX];
-       char                param2[FILEPATH_LEN_MAX];
-       char                param3[FILEPATH_LEN_MAX];
+       IpcPrintf("TextClass not specified\n");
+       return;
+     }
 
-       param1[0] = 0;
-       param2[0] = 0;
-       param3[0] = 0;
+   tc = TextclassFind(param1, 0);
+   if (!tc)
+     {
+       IpcPrintf("TextClass not found: %s\n", param1);
+       return;
+     }
 
-       word(params, 1, param1);
-       word(params, 2, param2);
-       if (param2[0])
+   if (!strcmp(param2, "create"))
+     {
+     }
+   else if (!strcmp(param2, "delete"))
+     {
+       if (tc)
+          TextclassDestroy(tc);
+     }
+   else if (!strcmp(param2, "modify"))
+     {
+     }
+   else if (!strcmp(param2, "apply"))
+     {
+       if (tc)
          {
-            if (!strcmp(param2, "create"))
-              {
-              }
-            else if (!strcmp(param2, "delete"))
-              {
-                 tc = TextclassFind(param1, 0);
-                 if (tc)
-                    TextclassDestroy(tc);
-              }
-            else if (!strcmp(param2, "modify"))
-              {
-              }
-            else if (!strcmp(param2, "apply"))
-              {
-                 tc = TextclassFind(param1, 0);
-                 if (tc)
-                   {
-                      int                 state;
-                      int                 x, y;
-                      const char         *txt;
-                      Window              win;
-
-                      word(params, 3, param3);
-                      win = (Window) strtol(param3, (char **)NULL, 0);
-                      word(params, 4, param3);
-                      x = atoi(param3);
-                      word(params, 5, param3);
-                      y = atoi(param3);
-                      word(params, 6, param3);
-                      state = STATE_NORMAL;
-                      if (!strcmp(param3, "normal"))
-                         state = STATE_NORMAL;
-                      else if (!strcmp(param3, "hilited"))
-                         state = STATE_HILITED;
-                      else if (!strcmp(param3, "clicked"))
-                         state = STATE_CLICKED;
-                      else if (!strcmp(param3, "disabled"))
-                         state = STATE_DISABLED;
-                      txt = atword(params, 7);
-                      pq = Mode.queue_up;
-                      Mode.queue_up = 0;
-                      if (txt)
-                         TextDraw(tc, win, 0, 0, state, txt, x, y, 99999,
-                                  99999, 17, 0);
-                      Mode.queue_up = pq;
-                   }
-              }
-            else if (!strcmp(param2, "query_size"))
-              {
-                 tc = TextclassFind(param1, 0);
-                 if (tc)
-                   {
-                      int                 w, h;
-                      const char         *txt;
-
-                      txt = atword(params, 3);
-                      if (txt)
-                        {
-                           TextSize(tc, 0, 0, STATE_NORMAL, txt, &w, &h, 17);
-                           Esnprintf(buf, sizeof(buf), "%i %i", w, h);
-                        }
-                      else
-                         Esnprintf(buf, sizeof(buf), "0 0");
-                   }
-                 else
-                    Esnprintf(buf, sizeof(buf), "TextClass %s not found",
-                              param1);
-              }
-            else if (!strcmp(param2, "query"))
-              {
-                 tc = TextclassFind(param1, 0);
-                 if (tc)
-                    Esnprintf(buf, sizeof(buf), "TextClass %s found",
-                              tc->name);
-                 else
-                    Esnprintf(buf, sizeof(buf), "TextClass %s not found",
-                              param1);
-              }
-            else if (!strcmp(param2, "ref_count"))
-              {
-                 tc = TextclassFind(param1, 0);
-                 if (tc)
-                    Esnprintf(buf, sizeof(buf), "%u references remain.",
-                              tc->ref_count);
-              }
-            else
-              {
-                 Esnprintf(buf, sizeof(buf),
-                           "Error: unknown operation specified");
-              }
+            int                 state;
+            int                 x, y;
+            const char         *txt;
+            Window              win;
+
+            word(params, 3, param3);
+            win = (Window) strtol(param3, (char **)NULL, 0);
+            word(params, 4, param3);
+            x = atoi(param3);
+            word(params, 5, param3);
+            y = atoi(param3);
+            word(params, 6, param3);
+            state = STATE_NORMAL;
+            if (!strcmp(param3, "normal"))
+               state = STATE_NORMAL;
+            else if (!strcmp(param3, "hilited"))
+               state = STATE_HILITED;
+            else if (!strcmp(param3, "clicked"))
+               state = STATE_CLICKED;
+            else if (!strcmp(param3, "disabled"))
+               state = STATE_DISABLED;
+            txt = atword(params, 7);
+            pq = Mode.queue_up;
+            Mode.queue_up = 0;
+            if (txt)
+               TextDraw(tc, win, 0, 0, state, txt, x, y, 99999, 99999, 17, 0);
+            Mode.queue_up = pq;
          }
-       else
+     }
+   else if (!strcmp(param2, "query_size"))
+     {
+       if (tc)
          {
-            Esnprintf(buf, sizeof(buf), "Error: no class specified");
+            int                 w, h;
+            const char         *txt;
+
+            w = h = 0;
+            txt = atword(params, 3);
+            if (txt)
+               TextSize(tc, 0, 0, STATE_NORMAL, txt, &w, &h, 17);
+            IpcPrintf("%i %i\n", w, h);
          }
      }
+   else if (!strcmp(param2, "query"))
+     {
+       if (tc)
+          IpcPrintf("TextClass %s found\n", tc->name);
+     }
+   else if (!strcmp(param2, "ref_count"))
+     {
+       if (tc)
+          IpcPrintf("%u references remain.\n", tc->ref_count);
+     }
    else
      {
-       Esnprintf(buf, sizeof(buf), "Error: no operation specified");
+       IpcPrintf("Error: Unknown operation specified\n");
      }
-
-   if (buf[0])
-      CommsSend(c, buf);
 }
 
 IpcItem             TextclassIpcArray[] = {




-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to