Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
      Tag: branch-exp
        E.h borders.c buttons.c conf.h dock.c ewin-ops.c ewins.c 
        iconify.c menus.c mod-menus.c 


Log Message:
Merge.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.33
retrieving revision 1.314.2.34
diff -u -3 -r1.314.2.33 -r1.314.2.34
--- E.h 29 Aug 2004 14:06:27 -0000      1.314.2.33
+++ E.h 31 Aug 2004 18:42:49 -0000      1.314.2.34
@@ -1020,6 +1020,10 @@
       char                slide;
       char                onscreen;
       char                warp;
+      struct
+      {
+        KeySym              left, right, up, down, escape, ret;
+      } key;
    } menus;
    struct
    {
@@ -1475,8 +1479,6 @@
 int                 ButtonDoShowDefault(const Button * b);
 int                 ButtonEmbedWindow(Button * ButtonToUse,
                                      Window WindowToEmbed);
-void                ButtonFindEmptySpotFor(Button * bt, const char *listname,
-                                          char dirtomove);
 int                 ButtonsConfigLoad(FILE * fs);
 int                 ButtonsConfigSave(FILE * fs);
 
@@ -1737,6 +1739,7 @@
 EWin               *GetFocusEwin(void);
 EWin               *GetContextEwin(void);
 void                EwinDetermineArea(EWin * ewin);
+void                EwinPropagateShapes(EWin * ewin);
 void                AddToFamily(Window win);
 EWin               *AddInternalToFamily(Window win, const char *bname, int type,
                                        void *ptr,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/borders.c,v
retrieving revision 1.221.2.10
retrieving revision 1.221.2.11
diff -u -3 -r1.221.2.10 -r1.221.2.11
--- borders.c   22 Aug 2004 20:03:48 -0000      1.221.2.10
+++ borders.c   31 Aug 2004 18:42:52 -0000      1.221.2.11
@@ -159,7 +159,7 @@
    BorderWinpartITclassApply(ewin, i, force);
 
    if (!ewin->shapedone || ewin->border->changes_shape)
-      PropagateShapes(ewin->win);
+      EwinPropagateShapes(ewin);
    ewin->shapedone = 1;
 
    EDBUG_RETURN_;
@@ -183,7 +183,7 @@
       BorderWinpartITclassApply(ewin, i, do_shape);
 
    if (do_shape || !ewin->shapedone || ewin->border->changes_shape)
-      PropagateShapes(ewin->win);
+      EwinPropagateShapes(ewin);
    ewin->shapedone = 1;
 
    if (queue_off)
@@ -418,11 +418,11 @@
 
             pq = Mode.queue_up;
             Mode.queue_up = 0;
-            PropagateShapes(ewin->win);
+            EwinPropagateShapes(ewin);
             Mode.queue_up = pq;
          }
        else
-          PropagateShapes(ewin->win);
+          EwinPropagateShapes(ewin);
        ewin->shapedone = 1;
      }
 
@@ -455,12 +455,12 @@
                  ewin->shapedone = 0;
                  if (!ewin->shapedone)
                    {
-                      PropagateShapes(ewin->win);
+                      EwinPropagateShapes(ewin);
                    }
                  else
                    {
                       if (ewin->border->changes_shape)
-                         PropagateShapes(ewin->win);
+                         EwinPropagateShapes(ewin);
                    }
                  ewin->shapedone = 1;
               }
@@ -632,7 +632,7 @@
       EMoveWindow(disp, ewin->win_container, b->border.left, b->border.top);
 
    EwinBorderCalcSizes(ewin);
-   PropagateShapes(ewin->win);
+   EwinPropagateShapes(ewin);
 
    EDBUG_RETURN_;
 }
@@ -951,7 +951,7 @@
    wbit->no_expose = 0;
    wbit->expose = 1;
    if (BorderWinpartDraw(ewin, part) && IsPropagateEwinOnQueue(ewin))
-      PropagateShapes(ewin->win);
+      EwinPropagateShapes(ewin);
 }
 
 static void
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -u -3 -r1.36.2.4 -r1.36.2.5
--- buttons.c   22 Aug 2004 20:03:49 -0000      1.36.2.4
+++ buttons.c   31 Aug 2004 18:42:55 -0000      1.36.2.5
@@ -574,53 +574,6 @@
    EDBUG_RETURN(0);
 }
 
-void
-ButtonFindEmptySpotFor(Button * bt, const char *listname, char dirtomove)
-{
-
-   Button            **blst;
-   int                 num = 0, i = 0, j = 0, done = 0;
-
-   blst = (Button **) ListItemTypeName(&num, LIST_TYPE_BUTTON, listname);
-   if (blst)
-     {
-       for (i = 0; i < num; i++)
-         {
-            for (j = 0; j < num; j++)
-              {
-                 if ((bt->x + bt->w) <= blst[j]->x
-                     || bt->x >= (blst[j]->x + blst[j]->w))
-                   {
-                      done = 1;
-                   }
-                 else
-                   {
-                      if ((bt->y + bt->h) <= blst[j]->y
-                          || bt->y > (blst[j]->y + blst[j]->h))
-                         done = 1;
-                      else
-                         done = 0;
-                   }
-                 if (!done)
-                   {
-                      if (dirtomove == ICON_RIGHT)
-                         bt->x = blst[j]->w + blst[j]->x;
-                      else if (dirtomove == ICON_LEFT)
-                         bt->x = blst[j]->x - bt->w;
-                      else if (dirtomove == ICON_DOWN)
-                         bt->y = blst[j]->h + blst[j]->y;
-                      else if (dirtomove == ICON_UP)
-                         bt->y = blst[j]->y - bt->h;
-                   }
-              }
-         }
-       Efree(blst);
-     }
-   ButtonMoveToCoord(bt, bt->x, bt->y);
-
-   EDBUG_RETURN_;
-}
-
 /*
  * Functions operating on all buttons
  */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/conf.h,v
retrieving revision 1.34
retrieving revision 1.34.2.1
diff -u -3 -r1.34 -r1.34.2.1
--- conf.h      3 Jul 2004 00:58:19 -0000       1.34
+++ conf.h      31 Aug 2004 18:42:56 -0000      1.34.2.1
@@ -155,6 +155,8 @@
 #define CONTROL_ST_PAGER 1383
 #define CONTROL_ST_WARPLIST 1384
 
+#define CONTROL_MENU_NAVIGATION_KEYS 1390
+
 #define ICLASS_NAME 350
 #define ICLASS_NORMAL 351
 #define ICLASS_CLICKED 352
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/dock.c,v
retrieving revision 1.18.2.2
retrieving revision 1.18.2.3
diff -u -3 -r1.18.2.2 -r1.18.2.3
--- dock.c      22 Aug 2004 20:03:49 -0000      1.18.2.2
+++ dock.c      31 Aug 2004 18:42:56 -0000      1.18.2.3
@@ -22,57 +22,121 @@
  */
 #include "E.h"
 
-void
-DockIt(EWin * ewin)
+static void
+DockappFindEmptySpotFor(EWin * eapp)
 {
-   ActionClass        *ac;
-   ImageClass         *ic;
-   Button             *bt;
-   char                id[32];
-
-   EDBUG(3, "DockIt");
-   Esnprintf(id, sizeof(id), "%i", (unsigned)ewin->client.win);
-   ac = 0;
-   ic = ImageclassFind("DEFAULT_DOCK_BUTTON", 0);
-   if (Conf.dock.startx >= 0)
-     {
-       bt = ButtonCreate(id, ewin->client.win, ic, ac, NULL, NULL, 1, 0,
-                         ewin->w, ewin->w, ewin->h, ewin->h,
-                         0, 0, Conf.dock.startx, 0, Conf.dock.starty, 0,
-                         0, 0, 0, 0, 1, 0, 1);
-     }
-   else
+   EWin              **lst, *ewin;
+   int                 num, i, j, x, y, w, h, done;
+   int                 step_right, step_down;
+
+   x = eapp->x;
+   y = eapp->y;
+   w = eapp->client.w;
+   h = eapp->client.h;
+   if (!eapp->client.already_placed)
      {
-       bt = ButtonCreate(id, ewin->client.win, ic, ac, NULL, NULL, 1, 0,
-                         ewin->w, ewin->w, ewin->h, ewin->h,
-                         0, 2046, 0, 0, 0, 1023, 0, 0, 0, 0, 1, 0, 1);
+       x = Conf.dock.startx;
+       if (x < 0)
+          x = 0;
+       else if (x > VRoot.w - eapp->w)
+          x = VRoot.w - eapp->w;
+
+       y = Conf.dock.starty;
+       if (y < 0)
+          y = 0;
+       else if (y > VRoot.h - eapp->h)
+          y = VRoot.h - eapp->h;
      }
-   UngrabX();
 
-   if (!bt)
-      EDBUG_RETURN_;
+   step_right = Conf.dock.startx < VRoot.w;
+   step_down = Conf.dock.starty < VRoot.h;
 
-   ButtonShow(bt);
-   ButtonFindEmptySpotFor(bt, "DOCK_APP_BUTTON", Conf.dock.dirmode);
+   lst = (EWin **) ListItemType(&num, LIST_TYPE_EWIN);
+   for (j = 0; j < num; j++)
+      for (i = 0; i < num; i++)
+       {
+          ewin = lst[i];
+
+          /* Skip self and non-dockapps */
+          if (ewin == eapp || !ewin->docked)
+             continue;
+
+          if ((x + w) <= ewin->x || x >= (ewin->x + ewin->w))
+             done = 1;
+          else if ((y + h) <= ewin->y || y > (ewin->y + ewin->h))
+             done = 1;
+          else
+             done = 0;
+
+          if (!done)
+            {
+               switch (Conf.dock.dirmode)
+                 {
+                 case DOCK_RIGHT:
+                    x = ewin->x + ewin->w;
+                    if (x + w >= VRoot.w)
+                      {
+                         x = Conf.dock.startx;
+                         y += (step_down) ? h : -h;
+                      }
+                    break;
+                 case DOCK_LEFT:
+                    x = ewin->x - w;
+                    if (x < 0)
+                      {
+                         x = Conf.dock.startx - w;
+                         y += (step_down) ? h : -h;
+                      }
+                    break;
+                 case DOCK_DOWN:
+                    y = ewin->y + ewin->h;
+                    if (y + h >= VRoot.h)
+                      {
+                         y = Conf.dock.starty;
+                         x += (step_right) ? w : -w;
+                      }
+                    break;
+                 case DOCK_UP:
+                    y = ewin->y - h;
+                    if (y < 0)
+                      {
+                         y = VRoot.h - h;
+                         x += (step_right) ? w : -w;
+                      }
+                    break;
+                 }
+            }
+       }
+   if (lst)
+      Efree(lst);
 
-   ButtonEmbedWindow(bt, ewin->win);
-   EMoveResizeWindow(disp, ewin->win, 0, 0, ewin->w, ewin->h);
-   ewin->fixedpos = 1;
-   ShowEwin(ewin);
+   if (x < 0 || y < 0 || x + w >= VRoot.w || y + h >= VRoot.h)
+     {
+       x = VRoot.w - w / 2;
+       y = VRoot.h - h / 2;
+     }
 
-   EDBUG_RETURN_;
+   eapp->x = x;
+   eapp->y = y;
 }
 
 void
-DockDestroy(EWin * ewin)
+DockIt(EWin * ewin)
 {
+   ImageClass         *ic;
+   char                id[32];
+
+   Esnprintf(id, sizeof(id), "%i", (unsigned)ewin->client.win);
+   ic = FindItem("DEFAULT_DOCK_BUTTON", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
+
+   UngrabX();
+
+   DockappFindEmptySpotFor(ewin);
+   ewin->client.already_placed = 1;
 
-   Button             *bt;
+   if (ewin->client.icon_win)
+      EMapWindow(disp, ewin->client.icon_win);
 
-   EDBUG(3, "DockDestroy");
-   bt = FindItem(NULL, ewin->client.win, LIST_FINDBY_ID, LIST_TYPE_BUTTON);
-   if (bt)
-      ButtonDestroy(RemoveItem
-                   (NULL, ewin->client.win, LIST_FINDBY_ID, LIST_TYPE_BUTTON));
-   EDBUG_RETURN_;
+   ImageclassApply(ic, ewin->win, ewin->client.w, ewin->client.h,
+                  0, 0, STATE_NORMAL, 0, ST_BUTTON);
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewin-ops.c,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -3 -r1.1.2.4 -r1.1.2.5
--- ewin-ops.c  29 Aug 2004 14:06:47 -0000      1.1.2.4
+++ ewin-ops.c  31 Aug 2004 18:42:56 -0000      1.1.2.5
@@ -599,7 +599,7 @@
      default:
        break;
      }
-   PropagateShapes(ewin->win);
+   EwinPropagateShapes(ewin);
    Mode.queue_up = pq;
    HintsSetWindowState(ewin);
    ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
@@ -672,7 +672,7 @@
      default:
        break;
      }
-   PropagateShapes(ewin->win);
+   EwinPropagateShapes(ewin);
    Mode.queue_up = pq;
    HintsSetWindowState(ewin);
    ModulesSignal(ESIGNAL_EWIN_CHANGE, ewin);
@@ -743,7 +743,7 @@
                                      ShapeBounding, -(ewin->client.w - ww),
                                      0, ewin->client.win, ShapeBounding,
                                      ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -796,7 +796,7 @@
                   EShapeCombineShape(disp, ewin->win_container,
                                      ShapeBounding, 0, 0, ewin->client.win,
                                      ShapeBounding, ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -849,7 +849,7 @@
                                      -(ewin->client.h - hh),
                                      ewin->client.win, ShapeBounding,
                                      ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -903,7 +903,7 @@
                   EShapeCombineShape(disp, ewin->win_container,
                                      ShapeBounding, 0, 0, ewin->client.win,
                                      ShapeBounding, ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -934,7 +934,7 @@
    if (ewin->client.shaped)
       EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, 0,
                         ewin->client.win, ShapeBounding, ShapeSet);
-   PropagateShapes(ewin->win);
+   EwinPropagateShapes(ewin);
 
    Mode.queue_up = pq;
 
@@ -1008,7 +1008,7 @@
                                         ewin->border->border.right)), 0,
                                      ewin->client.win, ShapeBounding,
                                      ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -1063,7 +1063,7 @@
                   EShapeCombineShape(disp, ewin->win_container,
                                      ShapeBounding, 0, 0, ewin->client.win,
                                      ShapeBounding, ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -1118,7 +1118,7 @@
                                         ewin->border->border.bottom)),
                                      ewin->client.win, ShapeBounding,
                                      ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -1173,7 +1173,7 @@
                   EShapeCombineShape(disp, ewin->win_container,
                                      ShapeBounding, 0, 0, ewin->client.win,
                                      ShapeBounding, ShapeSet);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
                gettimeofday(&timev2, NULL);
                dsec = timev2.tv_sec - timev1.tv_sec;
                dusec = timev2.tv_usec - timev1.tv_usec;
@@ -1201,7 +1201,7 @@
    if (ewin->client.shaped)
       EShapeCombineShape(disp, ewin->win_container, ShapeBounding, 0, 0,
                         ewin->client.win, ShapeBounding, ShapeSet);
-   PropagateShapes(ewin->win);
+   EwinPropagateShapes(ewin);
 
    Mode.queue_up = pq;
 
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/ewins.c,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -3 -r1.1.2.9 -r1.1.2.10
--- ewins.c     29 Aug 2004 14:06:47 -0000      1.1.2.9
+++ ewins.c     31 Aug 2004 18:42:59 -0000      1.1.2.10
@@ -455,6 +455,13 @@
       ewin->border->border.top + ewin->border->border.bottom;
 }
 
+void
+EwinPropagateShapes(EWin * ewin)
+{
+   if (!ewin->docked)
+      PropagateShapes(ewin->win);
+}
+
 static EWin        *
 Adopt(Window win)
 {
@@ -1005,9 +1012,6 @@
 
    ActionsEnd(ewin);
 
-   if (Conf.dockapp_support && ewin->docked)
-      DockDestroy(ewin);
-
    if (ewin == GetContextEwin())
       SlideoutsHide();
 
@@ -1129,7 +1133,7 @@
           if (pshaped != ewin->client.shaped)
             {
                SyncBorderToEwin(ewin);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
             }
        }
        ReZoom(ewin);
@@ -1168,7 +1172,7 @@
           if (pshaped != ewin->client.shaped)
             {
                SyncBorderToEwin(ewin);
-               PropagateShapes(ewin->win);
+               EwinPropagateShapes(ewin);
             }
        }
        ReZoom(ewin);
@@ -1225,7 +1229,7 @@
    b = ewin->border;
    SyncBorderToEwin(ewin);
    if (ewin->border == b)
-      PropagateShapes(ewin->win);
+      EwinPropagateShapes(ewin);
 }
 
 #if 0
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.116.2.13
retrieving revision 1.116.2.14
diff -u -3 -r1.116.2.13 -r1.116.2.14
--- iconify.c   27 Aug 2004 21:31:53 -0000      1.116.2.13
+++ iconify.c   31 Aug 2004 18:42:59 -0000      1.116.2.14
@@ -1872,7 +1872,7 @@
        b = ib->ewin->border;
        SyncBorderToEwin(ib->ewin);
        if (ib->ewin->border == b)
-          PropagateShapes(ib->ewin->win);
+          EwinPropagateShapes(ib->ewin);
      }
 }
 
@@ -2158,7 +2158,7 @@
 
    PropagateShapes(ib->win);
    ICCCM_GetShapeInfo(ib->ewin);
-   PropagateShapes(ib->ewin->win);
+   EwinPropagateShapes(ib->ewin);
 
    Mode.queue_up = pq;
 }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.147.2.11
retrieving revision 1.147.2.12
diff -u -3 -r1.147.2.11 -r1.147.2.12
--- menus.c     29 Aug 2004 14:06:50 -0000      1.147.2.11
+++ menus.c     31 Aug 2004 18:43:00 -0000      1.147.2.12
@@ -1334,6 +1334,27 @@
    return FindEwinSpawningMenu(m);
 }
 
+static              KeySym
+MenuKeyPressConversion(KeySym key)
+{
+   if (key == Conf.menus.key.left)
+      return XK_Left;
+   if (key == Conf.menus.key.right)
+      return XK_Right;
+   if (key == Conf.menus.key.up)
+      return XK_Up;
+   if (key == Conf.menus.key.down)
+      return XK_Down;
+   if (key == Conf.menus.key.escape)
+      return XK_Escape;
+   if (key == Conf.menus.key.ret)
+      return XK_Return;
+
+   /* The key does not correspond to any set, use the default behavior 
+    * associated to the key */
+   return key;
+}
+
 static void
 MenuEventKeyPress(Menu * m, XEvent * ev)
 {
@@ -1351,7 +1372,7 @@
    /* NB! m != NULL */
 
    key = XLookupKeysym(&ev->xkey, 0);
-   switch (key)
+   switch (MenuKeyPressConversion(key))
      {
      case XK_Escape:
        MenusHide();
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-menus.c,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -3 -r1.1.2.5 -r1.1.2.6
--- mod-menus.c 27 Aug 2004 21:31:54 -0000      1.1.2.5
+++ mod-menus.c 31 Aug 2004 18:43:00 -0000      1.1.2.6
@@ -22,6 +22,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 #include "E.h"
+#include <X11/keysym.h>
 
 /*
  * Menus Module
@@ -43,6 +44,12 @@
    CFG_ITEM_BOOL(Conf.menus, slide, 0),
    CFG_ITEM_BOOL(Conf.menus, onscreen, 1),
    CFG_ITEM_BOOL(Conf.menus, warp, 1),
+   CFG_ITEM_INT(Conf.menus, key.left, XK_Left),
+   CFG_ITEM_INT(Conf.menus, key.right, XK_Right),
+   CFG_ITEM_INT(Conf.menus, key.up, XK_Up),
+   CFG_ITEM_INT(Conf.menus, key.down, XK_Down),
+   CFG_ITEM_INT(Conf.menus, key.escape, XK_Escape),
+   CFG_ITEM_INT(Conf.menus, key.ret, XK_Return),
 };
 #define N_CFG_ITEMS (sizeof(MenusCfgItems)/sizeof(CfgItem))
 




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to