Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h ewins.c hints.c icccm.c lists.c main.c session.c 


Log Message:
Trivial stuff.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.346
retrieving revision 1.347
diff -u -3 -r1.346 -r1.347
--- E.h 21 Jan 2005 20:12:05 -0000      1.346
+++ E.h 22 Jan 2005 11:32:57 -0000      1.347
@@ -393,6 +393,7 @@
 typedef struct _textclass TextClass;
 typedef struct _action Action;
 typedef struct _actionclass ActionClass;
+typedef struct _list List;
 
 typedef struct
 {
@@ -402,16 +403,6 @@
 }
 PmapMask;
 
-typedef struct _list
-{
-   char               *name;
-   int                 id;
-   void               *item;
-
-   struct _list       *next;
-}
-List;
-
 typedef struct _client Client;
 
 typedef struct
@@ -1879,33 +1870,34 @@
 void                HintsProcessClientMessage(XClientMessageEvent * event);
 void                HintsSetRootInfo(Window win, Pixmap pmap, int color);
 
+void                EHintsSetInfo(const EWin * ewin);
+int                 EHintsGetInfo(EWin * ewin);
+void                EHintsSetMainInfo(void);
+void                EHintsGetMainInfo(void);
+void                EHintsSetInfoOnAll(void);
+
 /* icccm.c */
 void                ICCCM_Init(void);
 void                ICCCM_ProcessClientMessage(XClientMessageEvent * event);
 void                ICCCM_GetTitle(EWin * ewin, Atom atom_change);
 void                ICCCM_GetColormap(EWin * ewin);
-void                ICCCM_Delete(EWin * ewin);
-void                ICCCM_Save(EWin * ewin);
-void                ICCCM_Iconify(EWin * ewin);
-void                ICCCM_DeIconify(EWin * ewin);
+void                ICCCM_Delete(const EWin * ewin);
+void                ICCCM_Save(const EWin * ewin);
+void                ICCCM_Iconify(const EWin * ewin);
+void                ICCCM_DeIconify(const EWin * ewin);
 void                ICCCM_MatchSize(EWin * ewin);
-void                ICCCM_Configure(EWin * ewin);
-void                ICCCM_AdoptStart(EWin * ewin);
-void                ICCCM_Adopt(EWin * ewin);
-void                ICCCM_Withdraw(EWin * ewin);
+void                ICCCM_Configure(const EWin * ewin);
+void                ICCCM_AdoptStart(const EWin * ewin);
+void                ICCCM_Adopt(const EWin * ewin);
+void                ICCCM_Withdraw(const EWin * ewin);
 void                ICCCM_Cmap(EWin * ewin);
-void                ICCCM_Focus(EWin * ewin);
+void                ICCCM_Focus(const EWin * ewin);
 void                ICCCM_GetGeoms(EWin * ewin, Atom atom_change);
 void                ICCCM_GetInfo(EWin * ewin, Atom atom_change);
 void                ICCCM_GetHints(EWin * ewin, Atom atom_change);
 void                ICCCM_GetShapeInfo(EWin * ewin);
 void                ICCCM_SetIconSizes(void);
 void                ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change);
-void                ICCCM_SetEInfo(EWin * ewin);
-int                 ICCCM_GetEInfo(EWin * ewin);
-void                ICCCM_SetMainEInfo(void);
-void                ICCCM_GetMainEInfo(void);
-void                ICCCM_SetEInfoOnAll(void);
 char               *e16_icccm_name_get(Window win);
 
 /* iclass.c */
@@ -1942,18 +1934,21 @@
 void                EstrInt2EncFree(const char *str, int want_utf8);
 
 /* lists.c */
+void                ListsInit(int num);
 void               *FindItem(const char *name, int id, int find_by, int type);
-void                AddItem(void *item, const char *name, int id, int type);
-void                AddItemEnd(void *item, const char *name, int id, int type);
+void                AddItem(const void *item, const char *name, int id,
+                           int type);
+void                AddItemEnd(const void *item, const char *name, int id,
+                              int type);
 void               *RemoveItem(const char *name, int id, int find_by, int 
type);
-void               *RemoveItemByPtr(void *ptritem, int type);
+void               *RemoveItemByPtr(const void *ptritem, int type);
 void              **ListItemType(int *num, int type);
 char              **ListItems(int *num, int type);
 void              **ListItemTypeID(int *num, int type, int id);
 void              **ListItemTypeName(int *num, int type, const char *name);
-void                MoveItemToListTop(void *item, int type);
+void                MoveItemToListTop(const void *item, int type);
+void                MoveItemToListBottom(const void *item, int type);
 void                ListChangeItemID(int type, void *ptr, int id);
-void                MoveItemToListBottom(void *item, int type);
 
 /* main.c */
 void                EExit(int exitcode);
@@ -2355,7 +2350,6 @@
 extern const char   e_wm_name[];
 extern const char   e_wm_version[];
 extern Display     *disp;
-extern List        *lists;
 extern RealRoot     RRoot;
 extern VirtRoot     VRoot;
 extern EConf        Conf;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- ewins.c     9 Jan 2005 22:36:00 -0000       1.9
+++ ewins.c     22 Jan 2005 11:32:57 -0000      1.10
@@ -533,7 +533,7 @@
 #endif
    MatchEwinToSnapInfo(ewin);
    if (Mode.wm.startup)
-      ICCCM_GetEInfo(ewin);
+      EHintsGetInfo(ewin);
    ICCCM_MatchSize(ewin);
 
    EwinAdopt(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/hints.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -3 -r1.28 -r1.29
--- hints.c     28 Dec 2004 23:46:45 -0000      1.28
+++ hints.c     22 Jan 2005 11:32:58 -0000      1.29
@@ -35,12 +35,10 @@
    Atom                atom;
    Window              win;
 
-   EDBUG(6, "HintsInit");
-
    win = ECreateWindow(VRoot.win, -200, -200, 5, 5, 0);
 
    /* retreive stuff from last time we were loaded if we're restarting */
-   ICCCM_GetMainEInfo();
+   EHintsGetMainInfo();
 
    ICCCM_Init();
 #if ENABLE_GNOME
@@ -52,14 +50,11 @@
    atom = XInternAtom(disp, "ENLIGHTENMENT_VERSION", False);
    XChangeProperty(disp, VRoot.win, atom, XA_STRING, 8, PropModeReplace,
                   (unsigned char *)e_wm_version, strlen(e_wm_version));
-
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetClientList(void)
 {
-   EDBUG(6, "HintsSetClientList");
 #if ENABLE_GNOME
    GNOME_SetClientList();
 #endif
@@ -67,23 +62,19 @@
    EWMH_SetClientList();
    EWMH_SetClientStacking();
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetClientStacking(void)
 {
-   EDBUG(6, "HintsSetClientStacking");
 #if ENABLE_EWMH
    EWMH_SetClientStacking();
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetDesktopConfig(void)
 {
-   EDBUG(6, "HintsSetDesktopConfig");
 #if ENABLE_GNOME
    GNOME_SetDeskCount();
    GNOME_SetDeskNames();
@@ -94,26 +85,22 @@
    EWMH_SetDesktopNames();
    EWMH_SetWorkArea();
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetViewportConfig(void)
 {
-   EDBUG(6, "HintsSetViewportConfig");
 #if ENABLE_GNOME
    GNOME_SetAreaCount();
 #endif
 #if ENABLE_EWMH
    EWMH_SetDesktopSize();
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetCurrentDesktop(void)
 {
-   EDBUG(6, "HintsSetCurrentDesktop");
 #if ENABLE_GNOME
    GNOME_SetCurrentDesk();
 #endif
@@ -121,30 +108,25 @@
    EWMH_SetCurrentDesktop();
 #endif
    HintsSetDesktopViewport();
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetDesktopViewport(void)
 {
-   EDBUG(6, "HintsSetDesktopViewport");
 #if ENABLE_GNOME
    GNOME_SetCurrentArea();
 #endif
 #if ENABLE_EWMH
    EWMH_SetDesktopViewport();
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetActiveWindow(Window win)
 {
-   EDBUG(6, "HintsSetActiveWindow");
 #if ENABLE_EWMH
    EWMH_SetActiveWindow(win);
 #endif
-   EDBUG_RETURN_;
 }
 
 void
@@ -152,8 +134,6 @@
 {
    XTextProperty       xtp;
 
-   EDBUG(6, "HintsSetWindowName");
-
    xtp.encoding = XA_STRING;
    xtp.format = 8;
    xtp.value = (unsigned char *)name;
@@ -163,7 +143,6 @@
 #if ENABLE_EWMH
    EWMH_SetWindowName(win, name);
 #endif
-   EDBUG_RETURN_;
 }
 
 void
@@ -171,21 +150,16 @@
 {
    XClassHint         *xch;
 
-   EDBUG(6, "HintsSetWindowClass");
-
    xch = XAllocClassHint();
    xch->res_name = (char *)name;
    xch->res_class = (char *)clss;
    XSetClassHint(disp, win, xch);
    XFree(xch);
-
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetWindowDesktop(EWin * ewin)
 {
-   EDBUG(6, "HintsSetWindowDesktop");
 #if ENABLE_GNOME
    GNOME_SetEwinDesk(ewin);
 #endif
@@ -193,24 +167,19 @@
    if (ewin->type != EWIN_TYPE_MENU)
       EWMH_SetWindowDesktop(ewin);
 #endif
-   EDBUG_RETURN_;
 }
 
 void
-HintsSetWindowArea(EWin * ewin)
+HintsSetWindowArea(EWin * ewin __UNUSED__)
 {
-   EDBUG(6, "HintsSetWindowArea");
 #if ENABLE_GNOME
    GNOME_SetEwinArea(ewin);
 #endif
-   EDBUG_RETURN_;
-   ewin = NULL;
 }
 
 void
 HintsSetWindowState(EWin * ewin)
 {
-   EDBUG(6, "HintsSetWindowState");
 #if ENABLE_GNOME
    GNOME_SetHint(ewin);
 #endif
@@ -218,26 +187,21 @@
    if (ewin->type != EWIN_TYPE_MENU)
       EWMH_SetWindowState(ewin);
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetWindowOpacity(EWin * ewin, unsigned int opacity)
 {
-   EDBUG(6, "HintsSetWindowOpacity");
 #if ENABLE_EWMH
    EWMH_SetWindowOpacity(ewin, opacity);
 #endif
-   EDBUG_RETURN_;
 }
 
 void
 HintsSetWindowHints(EWin * ewin)
 {
-   EDBUG(6, "HintsSetWindowHints");
    HintsSetWindowDesktop(ewin);
    HintsSetWindowState(ewin);
-   EDBUG_RETURN_;
 }
 
 void
@@ -270,14 +234,12 @@
 void
 HintsGetWindowHints(EWin * ewin)
 {
-   EDBUG(6, "HintsGetWindowHints");
 #if ENABLE_GNOME
    GNOME_GetHints(ewin, 0);
 #endif
 #if ENABLE_EWMH
    EWMH_GetWindowHints(ewin);
 #endif
-   EDBUG_RETURN_;
 }
 
 /*
@@ -287,14 +249,12 @@
 void
 HintsDelWindowHints(EWin * ewin)
 {
-   EDBUG(6, "HintsDelWindowHints");
 #if ENABLE_GNOME
    GNOME_DelHints(ewin);
 #endif
 #if ENABLE_EWMH
    EWMH_DelWindowHints(ewin);
 #endif
-   EDBUG_RETURN_;
 }
 
 /*
@@ -306,11 +266,9 @@
 {
    char               *name;
 
-   EDBUG(6, "HintsHandlePropertyChange");
-
    name = XGetAtomName(disp, atom_change);
    if (name == NULL)
-      EDBUG_RETURN_;
+      return;
 
    if (!memcmp(name, "WM_", 3))
       ICCCM_ProcessPropertyChange(ewin, atom_change);
@@ -323,7 +281,6 @@
       GNOME_GetHints(ewin, atom_change);
 #endif
    XFree(name);
-   EDBUG_RETURN_;
 }
 
 void
@@ -331,11 +288,9 @@
 {
    char               *name;
 
-   EDBUG(6, "HintsHandleClientMessage");
-
    name = XGetAtomName(disp, event->message_type);
    if (name == NULL)
-      EDBUG_RETURN_;
+      return;
 
    if (!memcmp(name, "WM_", 3))
       ICCCM_ProcessClientMessage(event);
@@ -348,7 +303,6 @@
       GNOME_ProcessClientMessage(event);
 #endif
    XFree(name);
-   EDBUG_RETURN_;
 }
 
 void
@@ -356,8 +310,6 @@
 {
    static Atom         a = 0, aa = 0;
 
-   EDBUG(6, "HintsSetRootInfo");
-
    if (!a)
      {
        a = XInternAtom(disp, "_XROOTPMAP_ID", False);
@@ -372,5 +324,188 @@
    XChangeProperty(disp, win, aa, XA_CARDINAL, 32, PropModeReplace,
                   (unsigned char *)&color, 1);
 
-   EDBUG_RETURN_;
+}
+
+void
+EHintsSetInfo(const EWin * ewin)
+{
+   static Atom         a = 0, aa = 0;
+   CARD32              c[8];
+
+   if (EwinIsInternal(ewin))
+      return;
+
+   if (!a)
+      a = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
+   if (!aa)
+      aa = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
+
+   c[0] = EoGetDesk(ewin);
+   c[1] = EoIsSticky(ewin);
+   c[2] = EoGetX(ewin);
+   c[3] = EoGetY(ewin);
+   c[4] = ewin->iconified;
+   if (ewin->iconified)
+      ICCCM_DeIconify(ewin);
+   c[5] = ewin->shaded;
+   c[6] = ewin->client.w;
+   c[7] = ewin->client.h;
+
+   XChangeProperty(disp, ewin->client.win, a, XA_CARDINAL, 32, PropModeReplace,
+                  (unsigned char *)c, 8);
+   XChangeProperty(disp, ewin->client.win, aa, XA_STRING, 8, PropModeReplace,
+                  (unsigned char *)ewin->normal_border->name,
+                  strlen(ewin->normal_border->name) + 1);
+
+   if (EventDebug(EDBUG_TYPE_SNAPS))
+      Eprintf("Snap set einf  %#lx: %4d+%4d %4dx%4d: %s\n",
+             ewin->client.win, ewin->client.x, ewin->client.y,
+             ewin->client.w, ewin->client.h, EwinGetName(ewin));
+}
+
+int
+EHintsGetInfo(EWin * ewin)
+{
+   static Atom         a = 0, aa = 0;
+   Atom                a2;
+   CARD32             *c;
+   char               *str;
+   unsigned long       lnum, ldummy;
+   int                 num, dummy;
+   unsigned char      *puc;
+
+   if (EwinIsInternal(ewin))
+      return 0;
+
+   if (!a)
+      a = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
+   if (!aa)
+      aa = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
+
+   puc = NULL;
+   XGetWindowProperty(disp, ewin->client.win, a, 0, 10, True, XA_CARDINAL, &a2,
+                     &dummy, &lnum, &ldummy, &puc);
+   c = (CARD32 *) puc;
+   num = (int)lnum;
+   if ((num >= 8) && (c))
+     {
+       EoSetSticky(ewin, c[1]);
+       EoSetDesk(ewin, c[0]);
+       ewin->client.x = c[2];
+       ewin->client.y = c[3];
+       ewin->client.grav = NorthWestGravity;
+       ewin->iconified = c[4];
+       ewin->shaded = c[5];
+       if (ewin->iconified)
+         {
+            ewin->client.start_iconified = 1;
+            ewin->iconified = 0;
+         }
+       ewin->client.already_placed = 1;
+       ewin->client.w = c[6];
+       ewin->client.h = c[7];
+       XFree(c);
+
+       puc = NULL;
+       XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True,
+                          XA_STRING, &a2, &dummy, &lnum, &ldummy, &puc);
+       str = (char *)puc;
+       num = (int)lnum;
+       if ((num > 0) && (str))
+          EwinSetBorderByName(ewin, str, 0);
+       XFree(str);
+       if (EventDebug(EDBUG_TYPE_SNAPS))
+          Eprintf("Snap get einf  %#lx: %4d+%4d %4dx%4d: %s\n",
+                  ewin->client.win, ewin->client.x, ewin->client.y,
+                  ewin->client.w, ewin->client.h, EwinGetName(ewin));
+     }
+   return 0;
+}
+
+void
+EHintsSetMainInfo(void)
+{
+   Atom                a;
+   int                 i, ax, ay, n_desks;
+   CARD32             *cc;
+
+   n_desks = DesksGetNumber();
+   cc = Emalloc(2 * n_desks * sizeof(CARD32));
+   if (!cc)
+      return;
+
+   for (i = 0; i < n_desks; i++)
+     {
+       DeskGetArea(i, &ax, &ay);
+       cc[(i * 2)] = ax;
+       cc[(i * 2) + 1] = ay;
+     }
+
+   a = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
+   XChangeProperty(disp, VRoot.win, a, XA_CARDINAL, 32, PropModeReplace,
+                  (unsigned char *)cc, n_desks * 2);
+
+   a = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
+   cc[0] = DesksGetCurrent();
+   XChangeProperty(disp, VRoot.win, a, XA_CARDINAL, 32, PropModeReplace,
+                  (unsigned char *)cc, 1);
+
+   Efree(cc);
+}
+
+void
+EHintsGetMainInfo(void)
+{
+   Atom                a, a2;
+   CARD32             *c;
+   unsigned long       lnum, ldummy;
+   int                 num, dummy, i, n_desks;
+   unsigned char      *puc;
+
+   n_desks = DesksGetNumber();
+
+   a = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
+   puc = NULL;
+   XGetWindowProperty(disp, VRoot.win, a, 0, 0xffff, False, XA_CARDINAL, &a2,
+                     &dummy, &lnum, &ldummy, &puc);
+   c = (CARD32 *) puc;
+   num = (int)lnum;
+   if ((num > 0) && (c))
+     {
+       for (i = 0; i < (num / 2); i++)
+         {
+            if (i < n_desks)
+               DeskSetArea(i, c[(i * 2)], c[(i * 2) + 1]);
+         }
+       XFree(c);
+     }
+
+   a = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
+   puc = NULL;
+   XGetWindowProperty(disp, VRoot.win, a, 0, 1, False, XA_CARDINAL, &a2,
+                     &dummy, &lnum, &ldummy, &puc);
+   c = (CARD32 *) puc;
+   num = (int)lnum;
+   if ((num > 0) && (c))
+     {
+       DesksSetCurrent(*c);
+       XFree(c);
+     }
+}
+
+void
+EHintsSetInfoOnAll(void)
+{
+   int                 i, num;
+   EWin               *const *lst;
+
+   if (EventDebug(EDBUG_TYPE_SESSION))
+      Eprintf("SetEInfoOnAll\n");
+
+   lst = EwinListGetAll(&num);
+   for (i = 0; i < num; i++)
+      if (!EwinIsInternal(lst[i]))
+        EHintsSetInfo(lst[i]);
+
+   EHintsSetMainInfo();
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -3 -r1.81 -r1.82
--- icccm.c     9 Jan 2005 22:36:01 -0000       1.81
+++ icccm.c     22 Jan 2005 11:32:58 -0000      1.82
@@ -139,18 +139,14 @@
 void
 ICCCM_GetTitle(EWin * ewin, Atom atom_change)
 {
-   EDBUG(6, "ICCCM_GetTitle");
-
    if (atom_change && atom_change != E_XA_WM_NAME)
-      EDBUG_RETURN_;
+      return;
 
    _EFREE(ewin->icccm.wm_name);
 
    ewin->icccm.wm_name = e16_icccm_name_get(ewin->client.win);
 
    EwinChange(ewin, EWIN_CHANGE_NAME);
-
-   EDBUG_RETURN_;
 }
 
 void
@@ -160,10 +156,8 @@
    Window              win, *wlist;
    int                 num;
 
-   EDBUG(6, "ICCCM_GetColormap");
-
    if (EwinIsInternal(ewin))
-      EDBUG_RETURN_;
+      return;
 
    win = ewin->client.win;
    wlist = AtomGet(win, E_XA_WM_COLORMAP_WINDOWS, XA_WINDOW, &num);
@@ -176,12 +170,10 @@
    ewin->client.cmap = 0;
    if (XGetWindowAttributes(disp, ewin->client.win, &xwa) && xwa.colormap)
       ewin->client.cmap = xwa.colormap;
-
-   EDBUG_RETURN_;
 }
 
 void
-ICCCM_Delete(EWin * ewin)
+ICCCM_Delete(const EWin * ewin)
 {
    if (EwinIsInternal(ewin))
      {
@@ -197,7 +189,7 @@
 
 #if 0                          /* Deprecated */
 void
-ICCCM_Save(EWin * ewin)
+ICCCM_Save(const EWin * ewin)
 {
    if (EwinIsInternal(ewin))
       return;
@@ -207,7 +199,7 @@
 #endif
 
 void
-ICCCM_Iconify(EWin * ewin)
+ICCCM_Iconify(const EWin * ewin)
 {
    EUnmapWindow(disp, ewin->client.win);
    ecore_x_icccm_state_set_iconic(ewin->client.win);
@@ -215,7 +207,7 @@
 }
 
 void
-ICCCM_DeIconify(EWin * ewin)
+ICCCM_DeIconify(const EWin * ewin)
 {
    EMapWindow(disp, ewin->client.win);
    ecore_x_icccm_state_set_normal(ewin->client.win);
@@ -223,7 +215,7 @@
 }
 
 void
-ICCCM_Withdraw(EWin * ewin)
+ICCCM_Withdraw(const EWin * ewin)
 {
    /* We have a choice of deleting the WM_STATE property
     * or changing the value to Withdrawn. Since twm/fvwm does
@@ -241,8 +233,6 @@
    int                 i, j;
    double              aspect;
 
-   EDBUG(6, "ICCCM_MatchSize");
-
    w = ewin->client.w;
    h = ewin->client.h;
 
@@ -292,21 +282,17 @@
      }
    ewin->client.w = w;
    ewin->client.h = h;
-
-   EDBUG_RETURN_;
 }
 
 void
-ICCCM_Configure(EWin * ewin)
+ICCCM_Configure(const EWin * ewin)
 {
    XEvent              ev;
    int                 d;
    Window              child;
 
-   EDBUG(6, "ICCCM_Configure");
-
    if (EwinIsInternal(ewin))
-      EDBUG_RETURN_;
+      return;
 
    XMoveResizeWindow(disp, ewin->client.win, 0, 0,
                     ewin->client.w, ewin->client.h);
@@ -328,12 +314,10 @@
    ev.xconfigure.above = EoGetWin(ewin);
    ev.xconfigure.override_redirect = False;
    XSendEvent(disp, ewin->client.win, False, StructureNotifyMask, &ev);
-
-   EDBUG_RETURN_;
 }
 
 void
-ICCCM_AdoptStart(EWin * ewin)
+ICCCM_AdoptStart(const EWin * ewin)
 {
    Window              win = ewin->client.win;
 
@@ -342,7 +326,7 @@
 }
 
 void
-ICCCM_Adopt(EWin * ewin)
+ICCCM_Adopt(const EWin * ewin)
 {
    Window              win = ewin->client.win;
 
@@ -359,8 +343,6 @@
    Window             *wlist = NULL;
    int                 i, num;
 
-   EDBUG(6, "ICCCM_Cmap");
-
    if (!ewin)
      {
        if (Mode.current_cmap)
@@ -368,16 +350,16 @@
             XUninstallColormap(disp, Mode.current_cmap);
             Mode.current_cmap = 0;
          }
-       EDBUG_RETURN_;
+       return;
      }
 
    if (MenusActive())
-      EDBUG_RETURN_;
+      return;
 
    ICCCM_GetColormap(ewin);
 
    if (EwinIsInternal(ewin))
-      EDBUG_RETURN_;
+      return;
 
    if ((ewin->client.cmap) && (Mode.current_cmap != ewin->client.cmap))
      {
@@ -397,20 +379,16 @@
                    }
               }
             Efree(wlist);
-            EDBUG_RETURN_;
+            return;
          }
        XInstallColormap(disp, ewin->client.cmap);
        Mode.current_cmap = ewin->client.cmap;
      }
-
-   EDBUG_RETURN_;
 }
 
 void
-ICCCM_Focus(EWin * ewin)
+ICCCM_Focus(const EWin * ewin)
 {
-   EDBUG(6, "ICCCM_Focus");
-
    if (EventDebug(EDBUG_TYPE_FOCUS))
      {
        if (ewin)
@@ -424,7 +402,7 @@
      {
        XSetInputFocus(disp, VRoot.win, RevertToPointerRoot, CurrentTime);
        HintsSetActiveWindow(None);
-       EDBUG_RETURN_;
+       return;
      }
 
    if (ewin->client.take_focus)
@@ -435,8 +413,6 @@
    XSetInputFocus(disp, ewin->client.win, RevertToPointerRoot, CurrentTime);
 
    HintsSetActiveWindow(ewin->client.win);
-
-   EDBUG_RETURN_;
 }
 
 void
@@ -448,10 +424,8 @@
    unsigned int        dummy, w, h, bw;
    int                 x, y;
 
-   EDBUG(6, "ICCCM_GetGeoms");
-
    if (atom_change && atom_change != E_XA_WM_NORMAL_HINTS)
-      EDBUG_RETURN_;
+      return;
 
    x = ewin->client.x;
    y = ewin->client.y;
@@ -613,8 +587,6 @@
       Eprintf("Snap get icccm %#lx: %4d+%4d %4dx%4d: %s\n",
              ewin->client.win, ewin->client.x, ewin->client.y,
              ewin->client.w, ewin->client.h, EwinGetName(ewin));
-
-   EDBUG_RETURN_;
 }
 
 static char        *
@@ -653,8 +625,6 @@
    int                 size;
    char               *s;
 
-   EDBUG(6, "ICCCM_GetInfo");
-
    if (atom_change == 0 || atom_change == E_XA_WM_CLASS)
      {
        FREE_AND_CLEAR(ewin->icccm.wm_res_name);
@@ -733,8 +703,6 @@
             Efree(s);
          }
      }
-
-   EDBUG_RETURN_;
 }
 
 void
@@ -746,10 +714,8 @@
    Window             *cleader;
    int                 i, num;
 
-   EDBUG(6, "ICCCM_GetHints");
-
    if (EwinIsInternal(ewin))
-      EDBUG_RETURN_;
+      return;
 
    MWM_GetHints(ewin, atom_change);
 
@@ -897,8 +863,6 @@
             Efree(cleader);
          }
      }
-
-   EDBUG_RETURN_;
 }
 
 void
@@ -910,8 +874,6 @@
    unsigned int        w, h, d;
    Window              rt;
 
-   EDBUG(6, "ICCCM_GetShapeInfo");
-
    ecore_x_grab();
    EGetGeometry(disp, ewin->client.win, &rt, &x, &y, &w, &h, &d, &d);
    rl = EShapeGetRectangles(disp, ewin->client.win, ShapeBounding, &rn, &ord);
@@ -947,16 +909,13 @@
      }
    if (rl)
       XFree(rl);
-
-   EDBUG_RETURN_;
 }
 
 void
-ICCCM_SetIconSizes()
+ICCCM_SetIconSizes(void)
 {
    XIconSize          *is;
 
-   EDBUG(6, "ICCCM_SetIconSizes");
    is = XAllocIconSize();
    is->min_width = 8;
    is->min_height = 8;
@@ -966,7 +925,6 @@
    is->height_inc = 1;
    XSetIconSizes(disp, VRoot.win, is, 1);
    XFree(is);
-   EDBUG_RETURN_;
 }
 
 /*
@@ -975,202 +933,9 @@
 void
 ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change)
 {
-   EDBUG(6, "ICCCM_ProcessPropertyChange");
-
    ICCCM_GetTitle(ewin, atom_change);
    ICCCM_GetHints(ewin, atom_change);
    ICCCM_GetInfo(ewin, atom_change);
    ICCCM_Cmap(ewin);
    ICCCM_GetGeoms(ewin, atom_change);
-
-   EDBUG_RETURN_;
-}
-
-void
-ICCCM_SetEInfo(EWin * ewin)
-{
-   static Atom         a = 0, aa = 0;
-   CARD32              c[8];
-
-   EDBUG(6, "ICCCM_SetEInfo");
-
-   if (EwinIsInternal(ewin))
-      EDBUG_RETURN_;
-
-   if (!a)
-      a = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
-   if (!aa)
-      aa = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
-   c[0] = EoGetDesk(ewin);
-   c[1] = EoIsSticky(ewin);
-   c[2] = EoGetX(ewin);
-   c[3] = EoGetY(ewin);
-   c[4] = ewin->iconified;
-   if (ewin->iconified)
-      ICCCM_DeIconify(ewin);
-   c[5] = ewin->shaded;
-   c[6] = ewin->client.w;
-   c[7] = ewin->client.h;
-   XChangeProperty(disp, ewin->client.win, a, XA_CARDINAL, 32, PropModeReplace,
-                  (unsigned char *)c, 8);
-   XChangeProperty(disp, ewin->client.win, aa, XA_STRING, 8, PropModeReplace,
-                  (unsigned char *)ewin->normal_border->name,
-                  strlen(ewin->normal_border->name) + 1);
-   if (EventDebug(EDBUG_TYPE_SNAPS))
-      Eprintf("Snap set einf  %#lx: %4d+%4d %4dx%4d: %s\n",
-             ewin->client.win, ewin->client.x, ewin->client.y,
-             ewin->client.w, ewin->client.h, EwinGetName(ewin));
-   EDBUG_RETURN_;
-}
-
-void
-ICCCM_SetMainEInfo(void)
-{
-   Atom                a;
-   int                 i, ax, ay, n_desks;
-   CARD32             *cc;
-
-   n_desks = DesksGetNumber();
-   cc = Emalloc(2 * n_desks * sizeof(CARD32));
-   if (!cc)
-      return;
-
-   for (i = 0; i < n_desks; i++)
-     {
-       DeskGetArea(i, &ax, &ay);
-       cc[(i * 2)] = ax;
-       cc[(i * 2) + 1] = ay;
-     }
-   a = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
-   XChangeProperty(disp, VRoot.win, a, XA_CARDINAL, 32, PropModeReplace,
-                  (unsigned char *)cc, n_desks * 2);
-
-   a = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
-   cc[0] = DesksGetCurrent();
-   XChangeProperty(disp, VRoot.win, a, XA_CARDINAL, 32, PropModeReplace,
-                  (unsigned char *)cc, 1);
-
-   Efree(cc);
-}
-
-void
-ICCCM_GetMainEInfo(void)
-{
-   Atom                a, a2;
-   CARD32             *c;
-   unsigned long       lnum, ldummy;
-   int                 num, dummy, i, n_desks;
-   unsigned char      *puc;
-
-   n_desks = DesksGetNumber();
-
-   a = XInternAtom(disp, "ENL_INTERNAL_AREA_DATA", False);
-   puc = NULL;
-   XGetWindowProperty(disp, VRoot.win, a, 0, 0xffff, False, XA_CARDINAL, &a2,
-                     &dummy, &lnum, &ldummy, &puc);
-   c = (CARD32 *) puc;
-   num = (int)lnum;
-   if ((num > 0) && (c))
-     {
-       for (i = 0; i < (num / 2); i++)
-         {
-            if (i < n_desks)
-               DeskSetArea(i, c[(i * 2)], c[(i * 2) + 1]);
-         }
-       XFree(c);
-     }
-
-   a = XInternAtom(disp, "ENL_INTERNAL_DESK_DATA", False);
-   puc = NULL;
-   XGetWindowProperty(disp, VRoot.win, a, 0, 1, False, XA_CARDINAL, &a2,
-                     &dummy, &lnum, &ldummy, &puc);
-   c = (CARD32 *) puc;
-   num = (int)lnum;
-   if ((num > 0) && (c))
-     {
-       DesksSetCurrent(*c);
-       XFree(c);
-     }
-}
-
-int
-ICCCM_GetEInfo(EWin * ewin)
-{
-   static Atom         a = 0, aa = 0;
-   Atom                a2;
-   CARD32             *c;
-   char               *str;
-   unsigned long       lnum, ldummy;
-   int                 num, dummy;
-   unsigned char      *puc;
-
-   EDBUG(6, "ICCCM_GetEInfo");
-
-   if (EwinIsInternal(ewin))
-      EDBUG_RETURN(0);
-
-   if (!a)
-      a = XInternAtom(disp, "ENL_INTERNAL_DATA", False);
-   if (!aa)
-      aa = XInternAtom(disp, "ENL_INTERNAL_DATA_BORDER", False);
-
-   puc = NULL;
-   XGetWindowProperty(disp, ewin->client.win, a, 0, 10, True, XA_CARDINAL, &a2,
-                     &dummy, &lnum, &ldummy, &puc);
-   c = (CARD32 *) puc;
-   num = (int)lnum;
-   if ((num >= 8) && (c))
-     {
-       EoSetSticky(ewin, c[1]);
-       EoSetDesk(ewin, c[0]);
-       ewin->client.x = c[2];
-       ewin->client.y = c[3];
-       ewin->client.grav = NorthWestGravity;
-       ewin->iconified = c[4];
-       ewin->shaded = c[5];
-       if (ewin->iconified)
-         {
-            ewin->client.start_iconified = 1;
-            ewin->iconified = 0;
-         }
-       ewin->client.already_placed = 1;
-       ewin->client.w = c[6];
-       ewin->client.h = c[7];
-       XFree(c);
-
-       puc = NULL;
-       XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True,
-                          XA_STRING, &a2, &dummy, &lnum, &ldummy, &puc);
-       str = (char *)puc;
-       num = (int)lnum;
-       if ((num > 0) && (str))
-          EwinSetBorderByName(ewin, str, 0);
-       XFree(str);
-       if (EventDebug(EDBUG_TYPE_SNAPS))
-          Eprintf("Snap get einf  %#lx: %4d+%4d %4dx%4d: %s\n",
-                  ewin->client.win, ewin->client.x, ewin->client.y,
-                  ewin->client.w, ewin->client.h, EwinGetName(ewin));
-     }
-   EDBUG_RETURN(0);
-}
-
-void
-ICCCM_SetEInfoOnAll(void)
-{
-   int                 i, num;
-   EWin               *const *lst;
-
-   EDBUG(5, "SetEInfoOnAll");
-
-   if (EventDebug(EDBUG_TYPE_SESSION))
-      Eprintf("SetEInfoOnAll\n");
-
-   lst = EwinListGetAll(&num);
-   for (i = 0; i < num; i++)
-      if (!EwinIsInternal(lst[i]))
-        ICCCM_SetEInfo(lst[i]);
-
-   ICCCM_SetMainEInfo();
-
-   EDBUG_RETURN_;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/lists.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -3 -r1.14 -r1.15
--- lists.c     9 Jan 2005 10:06:07 -0000       1.14
+++ lists.c     22 Jan 2005 11:32:58 -0000      1.15
@@ -22,6 +22,23 @@
  */
 #include "E.h"
 
+struct _list
+{
+   char               *name;
+   int                 id;
+   void               *item;
+
+   struct _list       *next;
+};
+
+static List        *lists;
+
+void
+ListsInit(int num)
+{
+   lists = Ecalloc(num, sizeof(List));
+}
+
 void               *
 FindItem(const char *name, int id, int find_by, int type)
 {
@@ -76,7 +93,7 @@
 }
 
 void
-AddItem(void *item, const char *name, int id, int type)
+AddItem(const void *item, const char *name, int id, int type)
 {
    List               *ptr;
 
@@ -84,7 +101,7 @@
    ptr = Emalloc(sizeof(List));
    if (!ptr)
       EDBUG_RETURN_;
-   ptr->item = item;
+   ptr->item = (void *)item;
    ptr->name = Estrdup(name);
    ptr->id = id;
    ptr->next = lists[type].next;
@@ -93,7 +110,7 @@
 }
 
 void
-AddItemEnd(void *item, const char *name, int id, int type)
+AddItemEnd(const void *item, const char *name, int id, int type)
 {
    List               *ptr, *p;
 
@@ -101,7 +118,7 @@
    ptr = Emalloc(sizeof(List));
    if (!ptr)
       EDBUG_RETURN_;
-   ptr->item = item;
+   ptr->item = (void *)item;
    ptr->name = Estrdup(name);
    ptr->id = id;
    ptr->next = NULL;
@@ -124,7 +141,7 @@
 }
 
 void
-MoveItemToListTop(void *item, int type)
+MoveItemToListTop(const void *item, int type)
 {
    List               *ptr, *pptr;
 
@@ -158,7 +175,7 @@
 }
 
 void
-MoveItemToListBottom(void *item, int type)
+MoveItemToListBottom(const void *item, int type)
 {
    List               *ptr, *pptr, *nptr;
 
@@ -307,7 +324,7 @@
 }
 
 void               *
-RemoveItemByPtr(void *ptritem, int type)
+RemoveItemByPtr(const void *ptritem, int type)
 {
    List               *ptr, *pptr;
    void               *p;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -3 -r1.106 -r1.107
--- main.c      10 Jan 2005 20:21:57 -0000      1.106
+++ main.c      22 Jan 2005 11:32:58 -0000      1.107
@@ -37,7 +37,6 @@
    "enlightenment-" ENLIGHTENMENT_VERSION;
 #endif
 Display            *disp;
-List               *lists;
 RealRoot            RRoot;
 VirtRoot            VRoot;
 EConf               Conf;
@@ -95,10 +94,8 @@
       EDirUserCacheSet(str);
 #endif
 
-   /* go head and set up the internal data lists that enlightenment
-    * uses for finding everything
-    */
-   lists = Ecalloc(LIST_TYPE_COUNT, sizeof(List));
+   /* Set up the internal data lists used to find everything */
+   ListsInit(LIST_TYPE_COUNT);
 
    srand(time(NULL));
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- session.c   9 Jan 2005 22:36:01 -0000       1.83
+++ session.c   22 Jan 2005 11:32:58 -0000      1.84
@@ -875,7 +875,7 @@
 #endif
    if (!params)
       SessionSave(1);
-   ICCCM_SetEInfoOnAll();
+   EHintsSetInfoOnAll();
    EwinsSetFree();
    if (Mode.wm.startup && Mode.wm.exiting)
       MapUnmap(1);




-------------------------------------------------------
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

Reply via email to