Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        container.c dialog.c ewin-ops.c ewins.c ewins.h menus.c 
        pager.c 


Log Message:
Minor reorganisation of some ewin internals.

===================================================================
RCS file: /cvs/e/e16/e/src/container.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- container.c 24 Dec 2006 15:00:48 -0000      1.3
+++ container.c 27 Dec 2006 16:17:26 -0000      1.4
@@ -272,14 +272,17 @@
    ewin->data = NULL;
 }
 
+static const EWinOps ContainerEwinOps = {
+   ContainerEwinLayout,
+   ContainerEwinMoveResize,
+   ContainerEwinClose,
+};
+
 static void
 ContainerEwinInit(EWin * ewin, void *ptr)
 {
    ewin->data = (Container *) ptr;
-
-   ewin->Layout = ContainerEwinLayout;
-   ewin->MoveResize = ContainerEwinMoveResize;
-   ewin->Close = ContainerEwinClose;
+   ewin->ops = &ContainerEwinOps;
 
    ewin->props.skip_ext_task = 1;
    ewin->props.skip_ext_pager = 1;
@@ -305,10 +308,9 @@
 
    ewin = AddInternalToFamily(ct->win, "ICONBOX", EWIN_TYPE_ICONBOX, ct,
                              ContainerEwinInit);
+   ct->ewin = ewin;
    if (!ewin)
       return;
-
-   ct->ewin = ewin;
 
    ContainerReconfigure(ct);
 
===================================================================
RCS file: /cvs/e/e16/e/src/dialog.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -3 -r1.177 -r1.178
--- dialog.c    3 Dec 2006 18:36:56 -0000       1.177
+++ dialog.c    27 Dec 2006 16:17:26 -0000      1.178
@@ -171,14 +171,14 @@
 struct _dialog
 {
    EWin               *ewin;
-   char               *name;
-   char               *title;
    Win                 win;
    Pixmap              pmap;
+   int                 w, h;
+   char               *name;
+   char               *title;
    PmapMask            pmm_bg;
    TextClass          *tclass;
    ImageClass         *iclass;
-   int                 w, h;
    DItem              *item;
    DialogCallbackFunc *exit_func;
    int                 exit_val;
@@ -526,19 +526,20 @@
    ewin->data = NULL;
 }
 
+static const EWinOps DialogEwinOps = {
+   NULL,
+   DialogEwinMoveResize,
+   DialogEwinClose,
+};
+
 static void
 DialogEwinInit(EWin * ewin, void *ptr)
 {
-   Dialog             *d = ptr;
-
    ewin->data = ptr;
-   d->ewin = ewin;
+   ewin->ops = &DialogEwinOps;
 
    ewin->props.focus_when_mapped = 1;
 
-   ewin->MoveResize = DialogEwinMoveResize;
-   ewin->Close = DialogEwinClose;
-
    EoSetLayer(ewin, 10);
 }
 
@@ -585,6 +586,7 @@
 
    ewin = AddInternalToFamily(d->win, "DIALOG", EWIN_TYPE_DIALOG, d,
                              DialogEwinInit);
+   d->ewin = ewin;
    if (!ewin)
       return;
 
===================================================================
RCS file: /cvs/e/e16/e/src/ewin-ops.c,v
retrieving revision 1.107
retrieving revision 1.108
diff -u -3 -r1.107 -r1.108
--- ewin-ops.c  26 Nov 2006 11:30:58 -0000      1.107
+++ ewin-ops.c  27 Dec 2006 16:17:27 -0000      1.108
@@ -415,9 +415,9 @@
      }
    else
      {
-       if (ewin->Layout)
+       if (ewin->ops && ewin->ops->Layout)
          {
-            ewin->Layout(ewin, &x, &y, &w, &h);
+            ewin->ops->Layout(ewin, &x, &y, &w, &h);
          }
        else
          {
@@ -537,8 +537,8 @@
    if (Mode.op_source == OPSRC_USER)
       EwinSetPlacementGravity(ewin, x, y);
 
-   if (ewin->MoveResize)
-      ewin->MoveResize(ewin, resize);
+   if (ewin->ops && ewin->ops->MoveResize)
+      ewin->ops->MoveResize(ewin, resize);
 
    if (Mode.mode == MODE_NONE)
      {
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.c,v
retrieving revision 1.184
retrieving revision 1.185
diff -u -3 -r1.184 -r1.185
--- ewins.c     26 Nov 2006 17:10:40 -0000      1.184
+++ ewins.c     27 Dec 2006 16:17:27 -0000      1.185
@@ -1470,8 +1470,8 @@
    if (!EwinIsInternal(ewin) || ewin->state.iconified)
       return;
 
-   if (ewin->Close)
-      ewin->Close(ewin);
+   if (ewin->ops && ewin->ops->Close)
+      ewin->ops->Close(ewin);
 
    EwinDestroy(ewin);
 }
===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -3 -r1.62 -r1.63
--- ewins.h     26 Nov 2006 14:40:05 -0000      1.62
+++ ewins.h     27 Dec 2006 16:17:27 -0000      1.63
@@ -56,6 +56,14 @@
 #define EwinInhGetWM(ewin, item)       (ewin->inh_wm.b.item)
 #define EwinInhSetWM(ewin, item, on)   ewin->inh_wm.b.item = (on)
 
+typedef struct
+{
+   void                (*Layout) (EWin * ewin, int *px, int *py, int *pw,
+                                 int *ph);
+   void                (*MoveResize) (EWin * ewin, int resize);
+   void                (*Close) (EWin * ewin);
+} EWinOps;
+
 struct _ewin
 {
    EObj                o;
@@ -253,10 +261,7 @@
    int                 ll;     /* Last layer */
 
    void               *data;   /* Data hook for internal windows */
-   void                (*Layout) (EWin * ewin, int *px, int *py, int *pw,
-                                 int *ph);
-   void                (*MoveResize) (EWin * ewin, int resize);
-   void                (*Close) (EWin * ewin);
+   const EWinOps      *ops;
 };
 
 #define EWIN_STATE_NEW          0      /* New */
===================================================================
RCS file: /cvs/e/e16/e/src/menus.c,v
retrieving revision 1.264
retrieving revision 1.265
diff -u -3 -r1.264 -r1.265
--- menus.c     9 Dec 2006 21:32:03 -0000       1.264
+++ menus.c     27 Dec 2006 16:17:27 -0000      1.265
@@ -91,17 +91,17 @@
 
 struct _menu
 {
+   EWin               *ewin;
+   Win                 win;
+   PmapMask            pmm;
+   int                 w, h;
    char               *name;
-   char               *alias;
    char               *title;
+   char               *alias;
    MenuStyle          *style;
    MenuLoader         *loader;
-   EWin               *ewin;
-   int                 w, h;
    int                 num;
    MenuItem          **items;
-   Win                 win;
-   PmapMask            pmm;
    int                 icon_size;
    char                internal;       /* Don't destroy when reloading */
    char                dynamic;        /* May be emptied on close */
@@ -224,15 +224,19 @@
    ewin->data = NULL;
 }
 
+static const EWinOps MenuEwinOps = {
+   NULL,
+   MenuEwinMoveResize,
+   MenuEwinClose,
+};
+
 static void
 MenuEwinInit(EWin * ewin, void *ptr)
 {
-   Menu               *m = ptr;
+   Menu               *m = (Menu *) ptr;
 
    ewin->data = ptr;
-
-   ewin->MoveResize = MenuEwinMoveResize;
-   ewin->Close = MenuEwinClose;
+   ewin->ops = &MenuEwinOps;
 
    ewin->props.skip_ext_task = 1;
    ewin->props.skip_ext_pager = 1;
===================================================================
RCS file: /cvs/e/e16/e/src/pager.c,v
retrieving revision 1.234
retrieving revision 1.235
diff -u -3 -r1.234 -r1.235
--- pager.c     26 Nov 2006 11:30:59 -0000      1.234
+++ pager.c     27 Dec 2006 16:17:27 -0000      1.235
@@ -78,16 +78,16 @@
 
 typedef struct
 {
-   char               *name;
+   EWin               *ewin;
    Win                 win;
    Pixmap              pmap;
+   int                 w, h;
+   char               *name;
    Pixmap              bgpmap;
    Desk               *dsk;
-   int                 w, h;
    int                 dw, dh;
    int                 screen_w, screen_h;
    int                 update_phase;
-   EWin               *ewin;
    Win                 sel_win;
 
    /* State flags */
@@ -691,13 +691,17 @@
    ewin->data = NULL;
 }
 
+static const EWinOps PagerEwinOps = {
+   NULL,
+   PagerEwinMoveResize,
+   PagerEwinClose,
+};
+
 static void
 PagerEwinInit(EWin * ewin, void *ptr)
 {
    ewin->data = ptr;
-
-   ewin->MoveResize = PagerEwinMoveResize;
-   ewin->Close = PagerEwinClose;
+   ewin->ops = &PagerEwinOps;
 
    ewin->props.skip_ext_task = 1;
    ewin->props.skip_ext_pager = 1;
@@ -732,10 +736,10 @@
 
    ewin =
       AddInternalToFamily(p->win, "PAGER", EWIN_TYPE_PAGER, p, PagerEwinInit);
+   p->ewin = ewin;
    if (!ewin)
       return;
 
-   p->ewin = ewin;
    p->screen_w = VRoot.w;
    p->screen_h = VRoot.h;
 



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to