Enlightenment CVS committal

Author  : kwo
Project : e16
Module  : e

Dir     : e16/e/src


Modified Files:
        ewins.h ewmh.c ipc.c size.c 


Log Message:
Only one maximisation function.

===================================================================
RCS file: /cvs/e/e16/e/src/ewins.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -3 -r1.87 -r1.88
--- ewins.h     5 Jun 2008 17:59:51 -0000       1.87
+++ ewins.h     22 Jun 2008 22:23:24 -0000      1.88
@@ -458,9 +458,8 @@
 int                 ActionsEnd(EWin * ewin);
 
 /* size.c */
-void                MaxSize(EWin * ewin, const char *resize_type);
-void                MaxWidth(EWin * ewin, const char *resize_type);
-void                MaxHeight(EWin * ewin, const char *resize_type);
+void                MaxSizeHV(EWin * ewin, const char *resize_type,
+                             int hor, int ver);
 
 /* stacking.c */
 EWin               *const *EwinListStackGet(int *num);
===================================================================
RCS file: /cvs/e/e16/e/src/ewmh.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -3 -r1.124 -r1.125
--- ewmh.c      24 Mar 2008 11:12:40 -0000      1.124
+++ ewmh.c      22 Jun 2008 22:23:24 -0000      1.125
@@ -936,8 +936,7 @@
        else if (atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT ||
                 atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
          {
-            void                (*func) (EWin *, const char *);
-            unsigned int        maxh, maxv;
+            int                 maxh, maxv;
 
             maxh = ewin->state.maximized_horz;
             maxv = ewin->state.maximized_vert;
@@ -945,25 +944,22 @@
                 atom2 == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_HORZ)
               {
                  /* (ok - ok) */
-                 func = MaxSize;
                  maxh = do_set(maxh, action);
                  maxv = do_set(maxv, action);
               }
             else if (atom == ECORE_X_ATOM_NET_WM_STATE_MAXIMIZED_VERT)
               {
-                 func = MaxHeight;
                  maxv = do_set(maxv, action);
               }
             else
               {
-                 func = MaxWidth;
                  maxh = do_set(maxh, action);
               }
 
             if ((ewin->state.maximized_horz != maxh) ||
                 (ewin->state.maximized_vert != maxv))
               {
-                 func(ewin, "available");
+                 MaxSizeHV(ewin, "available", maxh, maxv);
                  EWMH_SetWindowState(ewin);
               }
          }
===================================================================
RCS file: /cvs/e/e16/e/src/ipc.c,v
retrieving revision 1.313
retrieving revision 1.314
diff -u -3 -r1.313 -r1.314
--- ipc.c       24 May 2008 18:13:17 -0000      1.313
+++ ipc.c       22 Jun 2008 22:23:24 -0000      1.314
@@ -632,15 +632,15 @@
        break;
 
      case EWIN_OP_MAX_WIDTH:
-       MaxWidth(ewin, param1);
+       MaxSizeHV(ewin, param1, 1, 0);
        break;
 
      case EWIN_OP_MAX_HEIGHT:
-       MaxHeight(ewin, param1);
+       MaxSizeHV(ewin, param1, 0, 1);
        break;
 
      case EWIN_OP_MAX_SIZE:
-       MaxSize(ewin, param1);
+       MaxSizeHV(ewin, param1, 1, 1);
        break;
 
      case EWIN_OP_FULLSCREEN:
===================================================================
RCS file: /cvs/e/e16/e/src/size.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -3 -r1.57 -r1.58
--- size.c      24 Mar 2008 11:12:40 -0000      1.57
+++ size.c      22 Jun 2008 22:23:24 -0000      1.58
@@ -26,16 +26,13 @@
 #include "hints.h"
 #include "screen.h"
 
-#define MAX_HOR 0x1
-#define MAX_VER 0x2
-
 #define MAX_ABSOLUTE     0     /* Fill screen */
 #define MAX_AVAILABLE    1     /* Expand until don't cover */
 #define MAX_CONSERVATIVE 2     /* Expand until something */
 #define MAX_XINERAMA     3     /* Fill Xinerama screen */
 
-static void
-MaxSizeHV(EWin * ewin, const char *resize_type, int direction)
+void
+MaxSizeHV(EWin * ewin, const char *resize_type, int hor, int ver)
 {
    int                 x, y, w, h, x1, x2, y1, y2, type, bl, br, bt, bb;
    EWin               *const *lst, *pe;
@@ -44,9 +41,9 @@
    if (!ewin)
       return;
 
-   if (ewin->state.inhibit_max_hor && (direction & MAX_HOR))
+   if (ewin->state.inhibit_max_hor && hor)
       return;
-   if (ewin->state.inhibit_max_ver && (direction & MAX_VER))
+   if (ewin->state.inhibit_max_ver && ver)
       return;
 
    if (ewin->state.maximized_horz || ewin->state.maximized_vert)
@@ -83,13 +80,13 @@
    switch (type)
      {
      case MAX_XINERAMA:
-       if (direction & MAX_HOR)
+       if (hor)
          {
             x = 0;
             w = WinGetW(VROOT);
             ewin->state.maximized_horz = 1;
          }
-       if (direction & MAX_VER)
+       if (ver)
          {
             y = 0;
             h = WinGetH(VROOT);
@@ -116,7 +113,7 @@
             lst = EwinListGetAll(&num);
          }
 
-       if (direction & MAX_VER)
+       if (ver)
          {
             for (i = 0; i < num; i++)
               {
@@ -142,7 +139,7 @@
             ewin->state.maximized_vert = 1;
          }
 
-       if (direction & MAX_HOR)
+       if (hor)
          {
             for (i = 0; i < num; i++)
               {
@@ -189,22 +186,4 @@
    ewin->state.maximizing = 0;
  done:
    HintsSetWindowState(ewin);
-}
-
-void
-MaxWidth(EWin * ewin, const char *resize_type)
-{
-   MaxSizeHV(ewin, resize_type, MAX_HOR);
-}
-
-void
-MaxHeight(EWin * ewin, const char *resize_type)
-{
-   MaxSizeHV(ewin, resize_type, MAX_VER);
-}
-
-void
-MaxSize(EWin * ewin, const char *resize_type)
-{
-   MaxSizeHV(ewin, resize_type, MAX_HOR | MAX_VER);
 }



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to