Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        E.h actions.c borders.c config.c events.c evhandlers.c icccm.c 
        iconify.c settings.c snaps.c 


Log Message:
Attempt to fix "walking" iconboxes in certain themes when not anchored
left or top.
Re-enable iconifying by dragging from pager to iconbox.
Iconbox namespace and code shuffling.

===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -3 -r1.150 -r1.151
--- E.h 22 Nov 2003 16:18:57 -0000      1.150
+++ E.h 24 Nov 2003 17:07:23 -0000      1.151
@@ -1551,6 +1551,7 @@
 }
 Clone;
 
+#ifdef DECLARE_STRUCT_ICONBOX
 struct _iconbox
 {
    /* user settings */
@@ -1573,7 +1574,8 @@
    /* internally set stuff */
    int                 w, h;
    int                 pos;
-   int                 max;
+   int                 max, max_min;
+   char                force_update;
    char                arrow1_hilited;
    char                arrow1_clicked;
    char                arrow2_hilited;
@@ -1605,6 +1607,7 @@
    int                 knob_length;
 
 };
+#endif /* DECLARE_STRUCT_ICONBOX */
 
 #ifdef DECLARE_STRUCT_PAGER
 struct _pager
@@ -1625,7 +1628,7 @@
    Window              hi_win;
    EWin               *hi_ewin;
 };
-#endif
+#endif /* DECLARE_STRUCT_PAGER */
 
 typedef struct _drawqueue
 {
@@ -2318,19 +2321,23 @@
 void                IconifyEwin(EWin * ewin);
 void                DeIconifyEwin(EWin * ewin);
 void                RemoveMiniIcon(EWin * ewin);
-void                MakeIcon(EWin * ewin);
 void                DockIt(EWin * ewin);
 void                DockDestroy(EWin * ewin);
-Iconbox            *CreateIconbox(char *name);
-void                FreeIconbox(Iconbox * ib);
-void                ShowIconbox(Iconbox * ib);
-void                HideIconbox(Iconbox * ib);
-void                AddEwinToIconbox(Iconbox * ib, EWin * ewin);
-void                DelEwinFromIconbox(Iconbox * ib, EWin * ewin);
-void                RedrawIconbox(Iconbox * ib);
-void                IconboxHandleEvent(XEvent * ev);
-void                UpdateAppIcon(EWin * ewin, int imode);
+Iconbox            *IconboxCreate(char *name);
+void                IconboxDestroy(Iconbox * ib);
+Window              IconboxGetWin(Iconbox * ib);
+void                IconboxShow(Iconbox * ib);
+void                IconboxHide(Iconbox * ib);
+void                IconboxIconifyEwin(Iconbox * ib, EWin * ewin);
+void                IconboxAddEwin(Iconbox * ib, EWin * ewin);
+void                IconboxDelEwin(Iconbox * ib, EWin * ewin);
+void                IconboxRedraw(Iconbox * ib);
 void                IconboxResize(Iconbox * ib, int w, int h);
+void                IconboxUpdateEwinIcon(Iconbox * ib, EWin * ewin,
+                                         int icon_mode);
+void                IconboxesUpdateEwinIcon(EWin * ewin, int icon_mode);
+void                IconboxesHandleEvent(XEvent * ev);
+void                UpdateAppIcon(EWin * ewin, int imode);
 void                IB_CompleteRedraw(Iconbox * ib);
 void                IB_Setup(void);
 Iconbox           **ListAllIconboxes(int *num);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/actions.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -3 -r1.114 -r1.115
--- actions.c   15 Nov 2003 22:27:16 -0000      1.114
+++ actions.c   24 Nov 2003 17:07:23 -0000      1.115
@@ -3602,8 +3602,8 @@
        Iconbox            *ib;
 
        AUDIO_PLAY("SOUND_NEW_ICONBOX");
-       ib = CreateIconbox(params);
-       ShowIconbox(ib);
+       ib = IconboxCreate(params);
+       IconboxShow(ib);
      }
    else
      {
@@ -3616,8 +3616,8 @@
           Efree(ibl);
        Esnprintf(s, sizeof(s), "_IB_%i", num);
        AUDIO_PLAY("SOUND_NEW_ICONBOX");
-       ib = CreateIconbox(s);
-       ShowIconbox(ib);
+       ib = IconboxCreate(s);
+       IconboxShow(ib);
      }
    autosave();
    EDBUG_RETURN(0);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -3 -r1.104 -r1.105
--- borders.c   15 Nov 2003 22:27:16 -0000      1.104
+++ borders.c   24 Nov 2003 17:07:23 -0000      1.105
@@ -1598,7 +1598,7 @@
    if (ewin->pager)
       PagerKill(ewin->pager);
    if (ewin->ibox)
-      FreeIconbox(ewin->ibox);
+      IconboxDestroy(ewin->ibox);
 
    /* May be an overkill but cannot hurt... */
    DELETE_EWIN_REFERENCE(ewin, mode.ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- config.c    22 Nov 2003 00:15:39 -0000      1.73
+++ config.c    24 Nov 2003 17:07:23 -0000      1.74
@@ -20,6 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#define DECLARE_STRUCT_ICONBOX
 #include "E.h"
 #include "conf.h"
 #include <ctype.h>
@@ -2982,7 +2983,7 @@
        switch (i1)
          {
          case CONFIG_CLASSNAME:        /* __NAME %s */
-            ib = CreateIconbox(s2);
+            ib = IconboxCreate(s2);
             break;
          case TEXT_ORIENTATION:        /* __ORIENTATION [ __HORIZONTAL | __VERTICAL ] 
*/
             if (ib)
@@ -3068,7 +3069,7 @@
    if (ib)
      {
        for (i = 0; i < num; i++)
-          FreeIconbox(ib[i]);
+          IconboxDestroy(ib[i]);
        Efree(ib);
      }
    while (GetLine(s, sizeof(s), ConfigFile))
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/events.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- events.c    9 Nov 2003 23:17:15 -0000       1.37
+++ events.c    24 Nov 2003 17:07:23 -0000      1.38
@@ -692,7 +692,7 @@
    if (ev->type <= 35)
       HArray[ev->type].func(ev);
 
-   IconboxHandleEvent(ev);
+   IconboxesHandleEvent(ev);
 
    if (diddeskaccount)
      {
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/evhandlers.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -3 -r1.124 -r1.125
--- evhandlers.c        15 Nov 2003 22:27:17 -0000      1.124
+++ evhandlers.c        24 Nov 2003 17:07:23 -0000      1.125
@@ -1053,30 +1053,8 @@
             }
 
        if ((ewin->iconified) && (pm != ewin->client.icon_pmap))
-         {
-            Iconbox           **ib;
-            int                 i, j, num;
+          IconboxesUpdateEwinIcon(ewin, 1);
 
-            ib = (Iconbox **) ListItemType(&num, LIST_TYPE_ICONBOX);
-            if (ib)
-              {
-                 for (i = 0; i < num; i++)
-                   {
-                      for (j = 0; j < ib[i]->num_icons; j++)
-                        {
-                           if (ib[i]->icons[j] == ewin)
-                             {
-                                if (ib[i]->icon_mode == 1)
-                                  {
-                                     UpdateAppIcon(ewin, ib[i]->icon_mode);
-                                     RedrawIconbox(ib[i]);
-                                  }
-                             }
-                        }
-                   }
-                 Efree(ib);
-              }
-         }
        UngrabX();
      }
    else if (win == root.win)
@@ -2121,6 +2099,7 @@
             mode.borderpartpress = 0;
          }
      }
+
    if (!wasmovres)
      {
        Pager              *p;
@@ -2247,16 +2226,10 @@
                               Efree(gwins);
                         }
                    }
-                 else if ((ewin) && (ewin->ibox)
-                          &&
-                          (!((p->hi_ewin->ibox) || ((ewin->client.need_input)
-                                                    && ((ewin->skiptask)
-                                                        ||
-                                                        (ewin->
-                                                         skipwinlist))))))
+                 else if ((ewin) && (ewin->ibox) && (!((p->hi_ewin->ibox)
+                                                       /* || 
((ewin->client.need_input) && ((ewin->skiptask) || (ewin->skipwinlist))) */
+                                                     )))
                    {
-                      char                was_shaded;
-
                       gwins =
                          ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
                                                     mode.nogroup, &num);
@@ -2265,32 +2238,7 @@
                            if (!gwins[i]->pager)
                              {
                                 MoveEwin(gwins[i], gwin_px[i], gwin_py[i]);
-                                ICCCM_Configure(gwins[i]);
-                                was_shaded = gwins[i]->shaded;
-                                if (ewin->ibox)
-                                  {
-                                     if (ewin->ibox->animate)
-                                        IB_Animate(1, gwins[i],
-                                                   ewin->ibox->ewin);
-                                     UpdateAppIcon(gwins[i],
-                                                   ewin->ibox->icon_mode);
-                                  }
-                                HideEwin(gwins[i]);
-                                MoveEwin(gwins[i],
-                                         gwin_px[i] +
-                                         ((desks.desk
-                                           [gwins[i]->
-                                            desktop].current_area_x) -
-                                          p->hi_ewin->area_x) * root.w,
-                                         gwin_py[i] +
-                                         ((desks.desk
-                                           [gwins[i]->
-                                            desktop].current_area_y) -
-                                          p->hi_ewin->area_y) * root.h);
-                                if (was_shaded != gwins[i]->shaded)
-                                   InstantShadeEwin(gwins[i]);
-                                AddEwinToIconbox(ewin->ibox, gwins[i]);
-                                ICCCM_Iconify(gwins[i]);
+                                IconboxIconifyEwin(ewin->ibox, gwins[i]);
                              }
                         }
                       if (gwins)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/icccm.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -3 -r1.41 -r1.42
--- icccm.c     8 Nov 2003 23:57:49 -0000       1.41
+++ icccm.c     24 Nov 2003 17:07:23 -0000      1.42
@@ -173,7 +173,7 @@
        if (ewin->ibox)
          {
             HideEwin(ewin);
-            ev.xunmap.window = ewin->ibox->win;
+            ev.xunmap.window = IconboxGetWin(ewin->ibox);
             HandleUnmap(&ev);
          }
        if (ewin->dialog)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -3 -r1.72 -r1.73
--- iconify.c   22 Nov 2003 16:18:57 -0000      1.72
+++ iconify.c   24 Nov 2003 17:07:23 -0000      1.73
@@ -20,6 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#define DECLARE_STRUCT_ICONBOX
 #include "E.h"
 #include <math.h>
 
@@ -195,7 +196,7 @@
 }
 
 void
-IconifyEwin(EWin * ewin)
+IconboxIconifyEwin(Iconbox * ib, EWin * ewin)
 {
    static int          call_depth = 0;
    char                was_shaded;
@@ -215,9 +216,6 @@
      }
    if (!ewin->iconified)
      {
-       Iconbox            *ib;
-
-       ib = SelectIconboxForEwin(ewin);
        was_shaded = ewin->shaded;
        AUDIO_PLAY("SOUND_ICONIFY");
        if (ib)
@@ -225,11 +223,11 @@
             if (ib->animate)
                IB_Animate(1, ewin, ib->ewin);
             UpdateAppIcon(ewin, ib->icon_mode);
+            IconboxAddEwin(ib, ewin);
          }
        HideEwin(ewin);
        if (was_shaded != ewin->shaded)
           InstantShadeEwin(ewin);
-       MakeIcon(ewin);
        ICCCM_Iconify(ewin);
        if (ewin == mode.focuswin)
          {
@@ -270,6 +268,12 @@
 }
 
 void
+IconifyEwin(EWin * ewin)
+{
+   IconboxIconifyEwin(SelectIconboxForEwin(ewin), ewin);
+}
+
+void
 DeIconifyEwin(EWin * ewin)
 {
    static int          call_depth = 0;
@@ -360,7 +364,7 @@
 
    ib = SelectIconboxForEwin(ewin);
    if (ib)
-      AddEwinToIconbox(ib, ewin);
+      IconboxAddEwin(ib, ewin);
 }
 
 void
@@ -370,11 +374,11 @@
 
    ib = SelectIconboxForEwin(ewin);
    if (ib)
-      DelEwinFromIconbox(ib, ewin);
+      IconboxDelEwin(ib, ewin);
 }
 
 Iconbox            *
-CreateIconbox(char *name)
+IconboxCreate(char *name)
 {
    Iconbox            *ib;
 
@@ -403,6 +407,7 @@
    ib->h = 0;
    ib->pos = 0;
    ib->max = 1;
+   ib->force_update = 1;
    ib->arrow1_hilited = 0;
    ib->arrow1_clicked = 0;
    ib->arrow2_hilited = 0;
@@ -452,7 +457,7 @@
 }
 
 void
-FreeIconbox(Iconbox * ib)
+IconboxDestroy(Iconbox * ib)
 {
    int                 i;
 
@@ -470,8 +475,56 @@
    autosave();
 }
 
+Window
+IconboxGetWin(Iconbox * ib)
+{
+   return ib->win;
+}
+
+static void
+IB_Reconfigure(Iconbox * ib)
+{
+   ImageClass         *ic;
+   EWin               *ewin;
+   int                 extra = 0;
+
+   ewin = ib->ewin;
+   ib->force_update = 1;
+   ewin->client.width.min = 8;
+   ewin->client.height.min = 8;
+   ewin->client.width.max = 16384;
+   ewin->client.height.max = 16384;
+   ewin->client.no_resize_h = 0;
+   ewin->client.no_resize_v = 0;
+
+   if (ib->orientation)
+     {
+       ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME,
+                     LIST_TYPE_ICLASS);
+       if (ic)
+          extra = ic->padding.left + ic->padding.right;
+       ewin->client.width.max = ewin->client.width.min =
+          ib->iconsize + ib->scroll_thickness + extra;
+       ewin->client.no_resize_h = 1;
+       ib->max_min = ewin->client.height.min;
+     }
+   else
+     {
+       ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME,
+                     LIST_TYPE_ICLASS);
+       if (ic)
+          extra = ic->padding.left + ic->padding.right;
+       ewin->client.height.max = ewin->client.height.min =
+          ib->iconsize + ib->scroll_thickness + extra;
+       ewin->client.no_resize_v = 1;
+       ib->max_min = ewin->client.width.min;
+     }
+
+   ICCCM_MatchSize(ewin);
+}
+
 void
-ShowIconbox(Iconbox * ib)
+IconboxShow(Iconbox * ib)
 {
    EWin               *ewin = NULL;
    XClassHint         *xch;
@@ -492,76 +545,39 @@
    XFree(xch);
    MatchToSnapInfoIconbox(ib);
    ewin = AddInternalToFamily(ib->win, 1, "ICONBOX", EWIN_TYPE_ICONBOX, ib);
+
    if (ewin)
      {
        Snapshot           *sn;
 
        ib->ewin = ewin;
-       ewin->client.width.min = 8;
-       ewin->client.height.min = 8;
-       ewin->client.width.max = 16384;
-       ewin->client.height.max = 16384;
-       ewin->client.no_resize_h = 0;
-       ewin->client.no_resize_v = 0;
-       if (ib->orientation)
-         {
-            ImageClass         *ic;
-            int                 extra = 0;
-
-            ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME,
-                          LIST_TYPE_ICLASS);
-            if (ic)
-               extra = ic->padding.left + ic->padding.right;
-            ib->ewin->client.width.max = ib->ewin->client.width.min =
-               ib->iconsize + ib->scroll_thickness + extra;
-            ewin->client.no_resize_h = 1;
-         }
-       else
-         {
-            ImageClass         *ic;
-            int                 extra = 0;
-
-            ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME,
-                          LIST_TYPE_ICLASS);
-            if (ic)
-               extra = ic->padding.left + ic->padding.right;
-            ib->ewin->client.height.max = ib->ewin->client.height.min =
-               ib->iconsize + ib->scroll_thickness + extra;
-            ewin->client.no_resize_v = 1;
-         }
        ewin->ibox = ib;
+       IB_Reconfigure(ib);
        sn = FindSnapshot(ewin);
-       /* get the size right damnit! */
+       ConformEwinToDesktop(ewin);
+       ShowEwin(ewin);
        if (sn)
          {
-            if (sn->use_wh)
-               IconboxResize(ib, sn->w, sn->h);
+            ResizeEwin(ewin, ewin->client.w, ewin->client.h);
          }
        else
          {
-            ResizeEwin(ewin, 160, 160);
-            MoveEwin(ewin, root.w - (ewin->w), root.h - (ewin->h));
+            MakeWindowSticky(ewin);
+            MoveResizeEwin(ewin, root.w - 160, root.h - 160, 160, 160);
          }
-       ConformEwinToDesktop(ewin);
-       ShowEwin(ewin);
-       if (((sn) && (sn->use_sticky) && (sn->sticky)) || (!sn))
-          MakeWindowSticky(ewin);
-
-       RememberImportantInfoForEwin(ewin);
      }
-   IconboxResize(ib, ib->ewin->client.w, ib->ewin->client.h);
    queue_up = pq;
 }
 
 void
-HideIconbox(Iconbox * ib)
+IconboxHide(Iconbox * ib)
 {
    if (ib->ewin)
       HideEwin(ib->ewin);
 }
 
 void
-AddEwinToIconbox(Iconbox * ib, EWin * ewin)
+IconboxAddEwin(Iconbox * ib, EWin * ewin)
 {
    int                 i;
 
@@ -574,11 +590,11 @@
    ib->num_icons++;
    ib->icons = Erealloc(ib->icons, sizeof(EWin *) * ib->num_icons);
    ib->icons[ib->num_icons - 1] = ewin;
-   RedrawIconbox(ib);
+   IconboxRedraw(ib);
 }
 
 void
-DelEwinFromIconbox(Iconbox * ib, EWin * ewin)
+IconboxDelEwin(Iconbox * ib, EWin * ewin)
 {
    int                 i, j;
 
@@ -596,7 +612,7 @@
                  Efree(ib->icons);
                  ib->icons = NULL;
               }
-            RedrawIconbox(ib);
+            IconboxRedraw(ib);
             return;
          }
      }
@@ -1145,6 +1161,39 @@
 }
 
 void
+IconboxUpdateEwinIcon(Iconbox * ib, EWin * ewin, int icon_mode)
+{
+   int                 i;
+
+   if (ib->icon_mode != icon_mode)
+      return;
+
+   for (i = 0; i < ib->num_icons; i++)
+     {
+       if (ib->icons[i] != ewin)
+          continue;
+       UpdateAppIcon(ewin, icon_mode);
+       IconboxRedraw(ib);
+       break;
+     }
+}
+
+void
+IconboxesUpdateEwinIcon(EWin * ewin, int icon_mode)
+{
+   Iconbox           **ib;
+   int                 i, num = 0;
+
+   ib = ListAllIconboxes(&num);
+   if (ib)
+     {
+       for (i = 0; i < num; i++)
+          IconboxUpdateEwinIcon(ib[i], ewin, icon_mode);
+       Efree(ib);
+     }
+}
+
+void
 UpdateAppIcon(EWin * ewin, int imode)
 {
    /* free whatever we had before */
@@ -1234,8 +1283,9 @@
       ib->max = y - 2;
    else
       ib->max = x - 2;
-   if (ib->max < 1)
-      ib->max = 1;
+
+   if (ib->max < ib->max_min)
+      ib->max = ib->max_min;
 }
 
 static EWin        *
@@ -1854,7 +1904,7 @@
 }
 
 void
-RedrawIconbox(Iconbox * ib)
+IconboxRedraw(Iconbox * ib)
 {
    Pixmap              m = 0;
    char                pq;
@@ -1865,6 +1915,8 @@
 
    if (!ib)
       return;
+   if (!ib->ewin)
+      return;
 
    if (ib->orientation)
      {
@@ -1877,98 +1929,21 @@
                             LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
      }
 
-   if ((ib->auto_resize) && (ib->ewin))
+   x = ib->ewin->x;
+   y = ib->ewin->y;
+   w = ib->w;
+   h = ib->h;
+
+   if (ib->auto_resize)
      {
        int                 add = 0;
-       int                 px, py, pw, ph;
 
        if (ib->ewin->shaded)
          {
             was_shaded = 1;
             UnShadeEwin(ib->ewin);
          }
-       x = ib->ewin->x;
-       y = ib->ewin->y;
-       w = ib->ewin->client.w;
-       h = ib->ewin->client.h;
-       if (ib->orientation)
-         {
-            if (ib_ic_box)
-               add = ib_ic_box->padding.top + ib_ic_box->padding.bottom;
-            if (ib->ewin->border)
-              {
-                 if ((ib->ewin->border->border.top +
-                      ib->ewin->border->border.bottom + add) > root.h)
-                    add =
-                       root.h - (ib->ewin->border->border.top +
-                                 ib->ewin->border->border.bottom);
-              }
-            x = ib->ewin->x;
-            y = ib->ewin->y +
-               (((ib->ewin->client.h - add) * ib->auto_resize_anchor) >> 10);
-            w = ib->ewin->client.w;
-            h = add;
-            if (ib->ewin->border)
-              {
-                 if ((ib->ewin->y + ib->ewin->border->border.top +
-                      ib->ewin->border->border.bottom + add) > root.h)
-                   {
-                      x = ib->ewin->x;
-                      y = root.h - (ib->ewin->border->border.top +
-                                    ib->ewin->border->border.bottom + add);
-                      w = ib->ewin->client.w;
-                      h = add;
-                   }
-              }
-         }
-       else
-         {
-            if (ib_ic_box)
-               add = ib_ic_box->padding.left + ib_ic_box->padding.right;
-            if (ib->ewin->border)
-              {
-                 if ((ib->ewin->border->border.left +
-                      ib->ewin->border->border.right + add) > root.w)
-                    add =
-                       root.w - (ib->ewin->border->border.left +
-                                 ib->ewin->border->border.right);
-              }
-            x = ib->ewin->x +
-               (((ib->ewin->client.w - add) * ib->auto_resize_anchor) >> 10);
-            y = ib->ewin->y;
-            w = add;
-            h = ib->ewin->client.h;
-            if (ib->ewin->border)
-              {
-                 if ((ib->ewin->x + ib->ewin->border->border.left +
-                      ib->ewin->border->border.right + add) > root.w)
-                   {
-                      x = root.w - (ib->ewin->border->border.left +
-                                    ib->ewin->border->border.right + add);
-                      y = ib->ewin->y;
-                      w = add;
-                      h = ib->ewin->client.h;
-                   }
-              }
-         }
-       px = ib->ewin->x;
-       py = ib->ewin->y;
-       pw = ib->ewin->client.w;
-       ph = ib->ewin->client.h;
-       ib->ewin->x = x;
-       ib->ewin->y = y;
-       ib->ewin->client.w = w;
-       ib->ewin->client.h = h;
-       RememberImportantInfoForEwins(ib->ewin);
-       ib->ewin->x = px;
-       ib->ewin->y = py;
-       ib->ewin->client.w = pw;
-       ib->ewin->client.h = ph;
-
-       x = ib->ewin->x;
-       y = ib->ewin->y;
-       w = ib->ewin->client.w;
-       h = ib->ewin->client.h;
+
        IB_CalcMax(ib);
        if (ib->orientation)
          {
@@ -1983,22 +1958,14 @@
                        root.h - (ib->ewin->border->border.top +
                                  ib->ewin->border->border.bottom);
               }
-            x = ib->ewin->x;
-            y = ib->ewin->y +
-               (((ib->ewin->client.h - add) * ib->auto_resize_anchor) >> 10);
-            w = ib->ewin->client.w;
+            y += (((ib->ewin->client.h - add) * ib->auto_resize_anchor) >> 10);
             h = add;
             if (ib->ewin->border)
               {
                  if ((ib->ewin->y + ib->ewin->border->border.top +
                       ib->ewin->border->border.bottom + add) > root.h)
-                   {
-                      x = ib->ewin->x;
-                      y = root.h - (ib->ewin->border->border.top +
-                                    ib->ewin->border->border.bottom + add);
-                      w = ib->ewin->client.w;
-                      h = add;
-                   }
+                    y = root.h - (ib->ewin->border->border.top +
+                                  ib->ewin->border->border.bottom + add);
               }
          }
        else
@@ -2014,38 +1981,32 @@
                        root.w - (ib->ewin->border->border.left +
                                  ib->ewin->border->border.right);
               }
-            x = ib->ewin->x +
-               (((ib->ewin->client.w - add) * ib->auto_resize_anchor) >> 10);
-            y = ib->ewin->y;
+            x += (((ib->ewin->client.w - add) * ib->auto_resize_anchor) >> 10);
             w = add;
-            h = ib->ewin->client.h;
             if (ib->ewin->border)
               {
                  if ((ib->ewin->x + ib->ewin->border->border.left +
                       ib->ewin->border->border.right + add) > root.w)
-                   {
-                      x = root.w - (ib->ewin->border->border.left +
-                                    ib->ewin->border->border.right + add);
-                      y = ib->ewin->y;
-                      w = add;
-                      h = ib->ewin->client.h;
-                   }
+                    x = root.w - (ib->ewin->border->border.left +
+                                  ib->ewin->border->border.right + add);
               }
          }
+     }
 
-       if ((x != ib->ewin->x) || (y != ib->ewin->y)
-           || (w != ib->ewin->client.w) || (h != ib->ewin->client.h))
-         {
-            MoveResizeEwin(ib->ewin, x, y, w, h);
-            EResizeWindow(disp, ib->win, w, h);
-            ICCCM_Configure(ib->ewin);
-            EFreePixmap(disp, ib->pmap);
-            ib->pmap = ECreatePixmap(disp, ib->icon_win, w, h, root.depth);
-         }
+   if (ib->force_update || (x != ib->ewin->x) || (y != ib->ewin->y)
+       || (w != ib->ewin->client.w) || (h != ib->ewin->client.h))
+     {
        ib->w = w;
        ib->h = h;
+       MoveResizeEwin(ib->ewin, x, y, w, h);
+       EResizeWindow(disp, ib->win, w, h);
+       EFreePixmap(disp, ib->pmap);
+       ib->pmap = ECreatePixmap(disp, ib->icon_win, w, h, root.depth);
+       RememberImportantInfoForEwins(ib->ewin);
+       ib->force_update = 0;
      }
-   if ((was_shaded) && (ib->ewin))
+
+   if (was_shaded)
       ShadeEwin(ib->ewin);
 
    pq = queue_up;
@@ -2194,13 +2155,10 @@
      }
    ESetWindowBackgroundPixmap(disp, ib->icon_win, ib->pmap);
    XClearWindow(disp, ib->icon_win);
-   PropagateShapes(ib->win);
 
-   if (ib->ewin)
-     {
-       ICCCM_GetShapeInfo(ib->ewin);
-       PropagateShapes(ib->ewin->win);
-     }
+   PropagateShapes(ib->win);
+   ICCCM_GetShapeInfo(ib->ewin);
+   PropagateShapes(ib->ewin->win);
 
    queue_up = pq;
 }
@@ -2210,12 +2168,11 @@
 {
    if ((ib->w == w) && (ib->h == h))
       return;
-   EResizeWindow(disp, ib->win, w, h);
-   EFreePixmap(disp, ib->pmap);
-   ib->pmap = ECreatePixmap(disp, ib->icon_win, w, h, root.depth);
+
    ib->w = w;
    ib->h = h;
-   RedrawIconbox(ib);
+   ib->force_update = 1;
+   IconboxRedraw(ib);
 }
 
 static void
@@ -2223,7 +2180,7 @@
 {
    ib->pos += dir;
    IB_FixPos(ib);
-   RedrawIconbox(ib);
+   IconboxRedraw(ib);
 }
 
 static void
@@ -2260,49 +2217,8 @@
 void
 IB_CompleteRedraw(Iconbox * ib)
 {
-   ib->ewin->client.width.min = 8;
-   ib->ewin->client.height.min = 8;
-   ib->ewin->client.width.max = 16384;
-   ib->ewin->client.height.max = 16384;
-   ib->ewin->client.no_resize_h = 0;
-   ib->ewin->client.no_resize_v = 0;
-   if (ib->orientation)
-     {
-       ImageClass         *ic;
-       int                 extra = 0;
-
-       ic = FindItem("ICONBOX_VERTICAL", 0, LIST_FINDBY_NAME,
-                     LIST_TYPE_ICLASS);
-       if (ic)
-          extra = ic->padding.left + ic->padding.right;
-       ib->ewin->client.width.max = ib->ewin->client.width.min =
-          ib->iconsize + ib->scroll_thickness + extra;
-       ib->ewin->client.no_resize_h = 1;
-     }
-   else
-     {
-       ImageClass         *ic;
-       int                 extra = 0;
-
-       ic = FindItem("ICONBOX_HORIZONTAL", 0, LIST_FINDBY_NAME,
-                     LIST_TYPE_ICLASS);
-       if (ic)
-          extra = ic->padding.left + ic->padding.right;
-       ib->ewin->client.height.max = ib->ewin->client.height.min =
-          ib->iconsize + ib->scroll_thickness + extra;
-       ib->ewin->client.no_resize_v = 1;
-     }
-   RedrawIconbox(ib);
-   ResizeEwin(ib->ewin, ib->ewin->client.w, ib->ewin->client.h);
-   RememberImportantInfoForEwins(ib->ewin);
-
-   SnapshotEwinBorder(ib->ewin);
-   SnapshotEwinDesktop(ib->ewin);
-   SnapshotEwinSize(ib->ewin);
-   SnapshotEwinLocation(ib->ewin);
-   SnapshotEwinLayer(ib->ewin);
-   SnapshotEwinSticky(ib->ewin);
-   SnapshotEwinShade(ib->ewin);
+   IB_Reconfigure(ib);
+   IconboxRedraw(ib);
 }
 
 void
@@ -2317,7 +2233,7 @@
    if (ibl)
      {
        for (i = 0; i < num; i++)
-          ShowIconbox(ibl[i]);
+          IconboxShow(ibl[i]);
        Efree(ibl);
      }
    lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
@@ -2333,16 +2249,18 @@
 }
 
 void
-IconboxHandleEvent(XEvent * ev)
+IconboxesHandleEvent(XEvent * ev)
 {
    Iconbox           **ib;
    int                 i, num;
 
    if (mode.mode != MODE_NONE)
       return;
+
    ib = ListAllIconboxes(&num);
    if (!ib)
       return;
+
    for (i = 0; i < num; i++)
      {
        if (ev->xany.window == ib[i]->scroll_win)
@@ -2414,7 +2332,7 @@
                          bs = 1;
                       ib[i]->pos = ((y + dy + 1) * ib[i]->max) / bs;
                       IB_FixPos(ib[i]);
-                      RedrawIconbox(ib[i]);
+                      IconboxRedraw(ib[i]);
                    }
                  else
                    {
@@ -2431,7 +2349,7 @@
                          bs = 1;
                       ib[i]->pos = ((x + dx + 1) * ib[i]->max) / bs;
                       IB_FixPos(ib[i]);
-                      RedrawIconbox(ib[i]);
+                      IconboxRedraw(ib[i]);
                    }
               }
             IB_DrawScroll(ib[i]);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/settings.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -3 -r1.80 -r1.81
--- settings.c  22 Nov 2003 00:15:40 -0000      1.80
+++ settings.c  24 Nov 2003 17:07:23 -0000      1.81
@@ -20,6 +20,7 @@
  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
+#define DECLARE_STRUCT_ICONBOX
 #include "E.h"
 
 static void         CB_SettingsEscape(int val, void *data);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/snaps.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- snaps.c     8 Nov 2003 23:57:49 -0000       1.50
+++ snaps.c     24 Nov 2003 17:07:23 -0000      1.51
@@ -1,4 +1,3 @@
-
 /*
  * Copyright (C) 2000-2003 Carsten Haitzler, Geoff Harrison and various contributors
  *
@@ -1234,9 +1233,11 @@
    XClassHint          hint;
    char                buf[1024];
    Snapshot           *sn = NULL;
+   Window              win = PagerGetWin(p);
 
-   if ((!XGetClassHint(disp, PagerGetWin(p), &hint)))
+   if ((!XGetClassHint(disp, win, &hint)))
       return;
+
    if ((hint.res_name) && (hint.res_class))
      {
        Esnprintf(buf, sizeof(buf), "%s.%s", hint.res_name, hint.res_class);
@@ -1249,7 +1250,7 @@
    if (!sn)
       return;
    if (sn->use_xy)
-      EMoveWindow(disp, PagerGetWin(p), sn->x, sn->y);
+      EMoveWindow(disp, win, sn->x, sn->y);
    if (sn->use_wh)
       PagerResize(p, sn->w, sn->h);
 }
@@ -1260,9 +1261,11 @@
    XClassHint          hint;
    char                buf[1024];
    Snapshot           *sn = NULL;
+   Window              win = IconboxGetWin(ib);
 
-   if ((!XGetClassHint(disp, ib->win, &hint)))
+   if ((!XGetClassHint(disp, win, &hint)))
       return;
+
    if ((hint.res_name) && (hint.res_class))
      {
        Esnprintf(buf, sizeof(buf), "%s.%s", hint.res_name, hint.res_class);
@@ -1275,9 +1278,9 @@
    if (!sn)
       return;
    if (sn->use_xy)
-      EMoveWindow(disp, ib->win, sn->x, sn->y);
+      EMoveWindow(disp, win, sn->x, sn->y);
    if (sn->use_wh)
-      IconboxResize(ib, sn->w, sn->h);
+      EResizeWindow(disp, win, sn->w, sn->h);
 }
 
 void
@@ -1430,22 +1433,7 @@
    if (gwins)
      {
        for (i = 0; i < num; i++)
-         {
-            if ((gwins[i]->pager) || (gwins[i]->ibox))
-              {
-                 SnapshotEwinBorder(gwins[i]);
-                 SnapshotEwinDesktop(gwins[i]);
-                 SnapshotEwinSize(gwins[i]);
-                 SnapshotEwinLocation(gwins[i]);
-                 SnapshotEwinLayer(gwins[i]);
-                 SnapshotEwinSticky(gwins[i]);
-                 SnapshotEwinShade(gwins[i]);
-                 SnapshotEwinGroups(gwins[i], gwins[i]->num_groups);
-                 SnapshotEwinSkipLists(gwins[i]);
-                 SnapshotEwinNeverFocus(gwins[i]);
-                 SaveSnapInfo();
-              }
-         }
+          RememberImportantInfoForEwin(gwins[i]);
        Efree(gwins);
      }
 }




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to