Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h Makefile.am arrange.c buttons.c config.c desktops.c eobj.h
ewins.c ewins.h menus.c slideout.c
Added Files:
buttons.h
Log Message:
Button related cleanups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.485
retrieving revision 1.486
diff -u -3 -r1.485 -r1.486
--- E.h 20 Aug 2005 17:43:33 -0000 1.485
+++ E.h 21 Aug 2005 13:21:47 -0000 1.486
@@ -333,7 +333,6 @@
typedef struct _ditem DItem;
typedef struct _snapshot Snapshot;
typedef struct _group Group;
-typedef struct _button Button;
typedef struct _background Background;
typedef struct _ecursor ECursor;
typedef struct _efont Efont;
@@ -485,6 +484,7 @@
unsigned int ref_count;
};
+struct _button;
typedef struct
{
EObj o;
@@ -492,7 +492,7 @@
char viewable;
char dirty_stack;
Background *bg;
- Button *tag;
+ struct _button *tag;
int current_area_x;
int current_area_y;
long event_mask;
@@ -1035,39 +1035,6 @@
int bottom);
void BordersSetupFallback(void);
-/* buttons.c */
-int ButtonsConfigLoad(FILE * fs);
-Button *ButtonCreate(const char *name, int id, ImageClass * ic,
- ActionClass * aclass, TextClass * tclass,
- const char *label, char ontop, int flags,
- int minw, int maxw, int minh, int maxh, int xo,
- int yo, int xa, int xr, int ya, int yr,
- int xsr, int xsa, int ysr, int ysa, char simg,
- int desk, char sticky);
-void ButtonDestroy(Button * b);
-void ButtonShow(Button * b);
-void ButtonHide(Button * b);
-void ButtonToggle(Button * b);
-void ButtonDraw(Button * b);
-void ButtonDrawWithState(Button * b, int state);
-void ButtonMoveToDesktop(Button * b, int desk);
-void ButtonMoveToCoord(Button * b, int x, int y);
-void ButtonMoveRelative(Button * b, int dx, int dy);
-void ButtonIncRefcount(Button * b);
-void ButtonDecRefcount(Button * b);
-void ButtonSwallowInto(Button * bi, EObj * eo);
-int ButtonGetRefcount(const Button * b);
-int ButtonGetDesk(const Button * b);
-int ButtonGetInfo(const Button * b, RectBox * r, int desk);
-Window ButtonGetWin(const Button * b);
-int ButtonGetWidth(const Button * b);
-int ButtonGetHeight(const Button * b);
-int ButtonIsFixed(const Button * b);
-int ButtonIsInternal(const Button * b);
-int ButtonDoShowDefault(const Button * b);
-int ButtonEmbedWindow(Button * ButtonToUse,
- Window WindowToEmbed);
-
/* cmclass.c */
#if ENABLE_COLOR_MODIFIERS
void CreateCurve(ModCurve * c);
@@ -1558,7 +1525,6 @@
/* ipc.c */
void __PRINTF__ IpcPrintf(const char *fmt, ...);
int HandleIPC(const char *params, Client * c);
-void ButtonIPC(int val, void *data);
int EFunc(EWin * ewin, const char *params);
/* lang.c */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Makefile.am,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- Makefile.am 20 Aug 2005 13:55:50 -0000 1.52
+++ Makefile.am 21 Aug 2005 13:21:47 -0000 1.53
@@ -26,6 +26,7 @@
backgrounds.c \
borders.c \
buttons.c \
+ buttons.h \
cmclass.c \
comms.c \
conf.h \
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/arrange.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -u -3 -r1.79 -r1.80
--- arrange.c 7 Aug 2005 14:06:50 -0000 1.79
+++ arrange.c 21 Aug 2005 13:21:47 -0000 1.80
@@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
+#include "buttons.h"
#include "ewins.h"
static int
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -3 -r1.73 -r1.74
--- buttons.c 20 Aug 2005 17:43:33 -0000 1.73
+++ buttons.c 21 Aug 2005 13:21:47 -0000 1.74
@@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
+#include "buttons.h"
#include "emodule.h"
#include "tooltips.h"
#include "xwin.h"
@@ -74,6 +75,30 @@
static void ButtonHandleEvents(XEvent * ev, void *btn);
+void
+ButtonIncRefcount(Button * b)
+{
+ b->ref_count++;
+}
+
+void
+ButtonDecRefcount(Button * b)
+{
+ b->ref_count--;
+}
+
+static int
+ButtonIsFixed(const Button * b)
+{
+ return b->flags & FLAG_FIXED;
+}
+
+static int
+ButtonIsInternal(const Button * b)
+{
+ return b->internal;
+}
+
Button *
ButtonCreate(const char *name, int id, ImageClass * iclass,
ActionClass * aclass, TextClass * tclass, const char *label,
@@ -229,6 +254,22 @@
EoMoveResize(b, x, y, w, h);
}
+static void
+ButtonDraw(Button * b)
+{
+ ITApply(EoGetWin(b), b->iclass, NULL, EoGetW(b), EoGetH(b),
+ b->state, 0, 0, 0, ST_BUTTON, b->tclass, NULL, b->label);
+}
+
+#if 0 /* Unused */
+void
+ButtonDrawWithState(Button * b, int state)
+{
+ b->state = state;
+ ButtonDraw(b);
+}
+#endif
+
void
ButtonShow(Button * b)
{
@@ -251,7 +292,7 @@
EMapWindow(EoGetWin(b));
}
-void
+static void
ButtonMoveToDesktop(Button * b, int desk)
{
Desk *d;
@@ -273,7 +314,7 @@
EoUnmap(b);
}
-void
+static void
ButtonToggle(Button * b)
{
if (b->internal)
@@ -286,25 +327,11 @@
}
void
-ButtonDraw(Button * b)
-{
- ITApply(EoGetWin(b), b->iclass, NULL, EoGetW(b), EoGetH(b),
- b->state, 0, 0, 0, ST_BUTTON, b->tclass, NULL, b->label);
-}
-
-void
-ButtonDrawWithState(Button * b, int state)
-{
- b->state = state;
- ButtonDraw(b);
-}
-
-void
ButtonMoveToCoord(Button * b, int x, int y)
{
int rx, ry, relx, rely, absx, absy;
- if (b->flags & FLAG_FIXED)
+ if (ButtonIsFixed(b))
return;
if ((x + (EoGetW(b) >> 1)) < (VRoot.w / 3))
@@ -345,40 +372,10 @@
ButtonMoveToCoord(b, EoGetX(b) + dx, EoGetY(b) + dy);
}
-void
-ButtonIncRefcount(Button * b)
-{
- b->ref_count++;
-}
-
-void
-ButtonDecRefcount(Button * b)
-{
- b->ref_count--;
-}
-
-static const char *
-ButtonGetName(const Button * b)
-{
- return EoGetName(b);
-}
-
-int
-ButtonGetRefcount(const Button * b)
-{
- return b->ref_count;
-}
-
-int
-ButtonGetDesk(const Button * b)
-{
- return EoGetDesk(b);
-}
-
int
ButtonGetInfo(const Button * b, RectBox * r, int desk)
{
- if (!EoIsShown(b) || b->internal)
+ if (!EoIsShown(b) || ButtonIsInternal(b))
return -1;
if (!EoIsSticky(b) && EoGetDesk(b) != desk)
return -1;
@@ -393,36 +390,6 @@
return 0;
}
-Window
-ButtonGetWin(const Button * b)
-{
- return EoGetWin(b);
-}
-
-int
-ButtonGetWidth(const Button * b)
-{
- return EoGetW(b);
-}
-
-int
-ButtonGetHeight(const Button * b)
-{
- return EoGetH(b);
-}
-
-int
-ButtonIsFixed(const Button * b)
-{
- return b->flags & FLAG_FIXED;
-}
-
-int
-ButtonIsInternal(const Button * b)
-{
- return b->internal;
-}
-
int
ButtonDoShowDefault(const Button * b)
{
@@ -487,6 +454,25 @@
autosave();
}
+void
+ButtonsMoveStickyToDesk(int desk)
+{
+ Button **lst, *btn;
+ int i, num;
+
+ lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
+ for (i = 0; i < num; i++)
+ {
+ btn = lst[i];
+ if (!EoIsSticky(btn) || ButtonIsInternal(btn))
+ continue;
+
+ ButtonMoveToDesktop(btn, desk);
+ }
+ if (lst)
+ Efree(lst);
+}
+
/*
* Button event handlers
*/
@@ -519,7 +505,7 @@
b->state = STATE_CLICKED;
ButtonDraw(b);
- if (!b->internal)
+ if (!ButtonIsInternal(b))
{
ActionClass *ac;
@@ -1062,9 +1048,9 @@
lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
for (i = 0; i < num; i++)
{
- if (matchregexp(ss, ButtonGetName(lst[i])))
+ if (matchregexp(ss, EoGetName(lst[i])))
{
- if (strcmp(ButtonGetName(lst[i]),
+ if (strcmp(EoGetName(lst[i]),
"_DESKTOP_DESKRAY_DRAG_CONTROL"))
ButtonToggle(lst[i]);
}
@@ -1081,9 +1067,9 @@
lst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, 0);
for (i = 0; i < num; i++)
{
- if (!matchregexp(ss, ButtonGetName(lst[i])))
+ if (!matchregexp(ss, EoGetName(lst[i])))
{
- if (strcmp(ButtonGetName(lst[i]),
+ if (strcmp(EoGetName(lst[i]),
"_DESKTOP_DESKRAY_DRAG_CONTROL"))
ButtonToggle(lst[i]);
}
@@ -1096,7 +1082,7 @@
lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
for (i = 0; i < num; i++)
{
- if (strcmp(ButtonGetName(lst[i]), "_DESKTOP_DESKRAY_DRAG_CONTROL"))
+ if (strcmp(EoGetName(lst[i]), "_DESKTOP_DESKRAY_DRAG_CONTROL"))
ButtonToggle(lst[i]);
}
if (lst)
@@ -1138,7 +1124,7 @@
IpcPrintf("%#lx %2d %2d %2d %5d+%5d %5dx%5d %s\n",
EoGetWin(b), EoGetDesk(b), EoIsSticky(b), EoGetLayer(b),
EoGetX(b), EoGetY(b), EoGetW(b), EoGetH(b),
- ButtonGetName(lst[i]));
+ EoGetName(lst[i]));
}
if (lst)
Efree(lst);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -3 -r1.135 -r1.136
--- config.c 20 Aug 2005 13:55:50 -0000 1.135
+++ config.c 21 Aug 2005 13:21:47 -0000 1.136
@@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
+#include "buttons.h"
#include "conf.h"
#include "tooltips.h"
#include <ctype.h>
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.170
retrieving revision 1.171
diff -u -3 -r1.170 -r1.171
--- desktops.c 20 Aug 2005 19:48:50 -0000 1.170
+++ desktops.c 21 Aug 2005 13:21:48 -0000 1.171
@@ -22,11 +22,12 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
-#include <time.h>
+#include "buttons.h"
#include "emodule.h"
#include "ewins.h"
#include "tooltips.h"
#include "xwin.h"
+#include <time.h>
#define EDESK_EVENT_MASK \
(ButtonPressMask | ButtonReleaseMask | \
@@ -308,35 +309,35 @@
}
static void
-DeskControlsDestroy(Desk * d)
+DeskControlsDestroy(Desk * d, int id)
{
Button **blst;
int num, i;
- blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, 1);
- if (blst)
- {
- for (i = 0; i < num; i++)
- if (ButtonGetDesk(blst[i]) == d->num)
- ButtonDestroy(blst[i]);
- Efree(blst);
- }
+ blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, id);
+ if (!blst)
+ return;
+
+ for (i = 0; i < num; i++)
+ if (EobjGetDesk((EObj *) (blst[i])) == d->num)
+ ButtonDestroy(blst[i]);
+ Efree(blst);
}
static void
-DeskControlsShow(Desk * d)
+DeskControlsShow(Desk * d, int id)
{
Button **blst;
int num, i;
- blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, 1);
- if (blst)
- {
- for (i = 0; i < num; i++)
- if (ButtonGetDesk(blst[i]) == d->num)
- ButtonShow(blst[i]);
- Efree(blst);
- }
+ blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, id);
+ if (!blst)
+ return;
+
+ for (i = 0; i < num; i++)
+ if (EobjGetDesk((EObj *) (blst[i])) == d->num)
+ ButtonShow(blst[i]);
+ Efree(blst);
}
static void
@@ -372,7 +373,7 @@
unsigned int rnd;
DeskControlsCreate(d);
- DeskControlsShow(d);
+ DeskControlsShow(d, 1);
bg = desks.bg[d->num];
if (bg)
@@ -443,33 +444,12 @@
static void
DeskDestroy(Desk * d)
{
- Button **blst;
- int num, i;
-
- if (d->num <= 0)
- return;
-
ModulesSignal(ESIGNAL_DESK_REMOVED, ((void *)(long)(d->num)));
EventCallbackUnregister(EoGetWin(d), 0, DesktopHandleEvents, d);
- blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, 1);
- for (i = 0; i < num; i++)
- {
- if (ButtonGetDesk(blst[i]) == d->num)
- ButtonDestroy(blst[i]);
- }
- if (blst)
- Efree(blst);
-
- blst = (Button **) ListItemTypeID(&num, LIST_TYPE_BUTTON, 2);
- for (i = 0; i < num; i++)
- {
- if (ButtonGetDesk(blst[i]) == d->num)
- ButtonDestroy(blst[i]);
- }
- if (blst)
- Efree(blst);
+ DeskControlsDestroy(d, 1);
+ DeskControlsDestroy(d, 2);
if (d->bg)
BackgroundDecRefcount(d->bg);
@@ -500,9 +480,9 @@
}
BackgroundPixmapFree(d->bg);
DeskRefresh(d->num);
- DeskControlsDestroy(d);
+ DeskControlsDestroy(d, 1);
DeskControlsCreate(d);
- DeskControlsShow(d);
+ DeskControlsShow(d, 1);
}
Desk *
@@ -712,7 +692,7 @@
int i;
for (i = 0; i < Conf.desks.num; i++)
- DeskControlsDestroy(_DeskGet(i));
+ DeskControlsDestroy(_DeskGet(i), 1);
}
static void
@@ -721,7 +701,7 @@
int i;
for (i = 0; i < Conf.desks.num; i++)
- DeskControlsShow(_DeskGet(i));
+ DeskControlsShow(_DeskGet(i), 1);
}
static void
@@ -921,48 +901,6 @@
}
static void
-MoveStickyWindowsToCurrentDesk(void)
-{
- Desk *d;
- EWin *const *lst, *ewin;
- int i, num, desk;
-
- desk = DesksGetCurrent();
- d = _DeskGet(desk);
-
- lst = EwinListStackGet(&num);
- for (i = 0; i < num; i++)
- {
- ewin = lst[i];
- if (!EoIsSticky(ewin) && !EoIsFloating(ewin))
- continue;
- if (EwinIsTransientChild(ewin))
- continue;
-
- EwinMoveToDesktop(ewin, desk);
- }
-}
-
-static void
-MoveStickyButtonsToCurrentDesk(void)
-{
- Button **lst, *btn;
- int i, num;
-
- lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
- for (i = 0; i < num; i++)
- {
- btn = lst[i];
- if (ButtonIsInternal(btn) || !EoIsSticky((EWin *) btn))
- continue;
-
- ButtonMoveToDesktop(btn, desks.current);
- }
- if (lst)
- Efree(lst);
-}
-
-static void
DesksStackingCheck(void)
{
Desk *d;
@@ -1071,8 +1009,8 @@
DeskHide(desks.order[i]);
}
- MoveStickyWindowsToCurrentDesk();
- MoveStickyButtonsToCurrentDesk();
+ EwinsMoveStickyToDesk(d->num);
+ ButtonsMoveStickyToDesk(d->num);
DesksStackingCheck();
HintsSetCurrentDesktop();
@@ -1215,8 +1153,8 @@
UncoverDesktop(desks.order[0]);
DeskHide(desk);
- MoveStickyWindowsToCurrentDesk();
- MoveStickyButtonsToCurrentDesk();
+ EwinsMoveStickyToDesk(desks.current);
+ ButtonsMoveStickyToDesk(desks.current);
DesksStackingCheck();
FocusNewDesk();
if (Mode.mode == MODE_NONE)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/eobj.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- eobj.h 20 Aug 2005 13:55:50 -0000 1.5
+++ eobj.h 21 Aug 2005 13:21:48 -0000 1.6
@@ -55,6 +55,13 @@
#define EOBJ_TYPE_EVENT 4
#define EOBJ_TYPE_EXT 5
+#define EobjGetWin(eo) ((eo)->win)
+#define EobjGetDesk(eo) ((eo)->desk)
+#define EobjGetX(eo) ((eo)->x)
+#define EobjGetY(eo) ((eo)->y)
+#define EobjGetW(eo) ((eo)->w)
+#define EobjGetH(eo) ((eo)->h)
+
#define EoObj(eo) (&((eo)->o))
#define EoGetWin(eo) ((eo)->o.win)
#define EoGetName(eo) ((eo)->o.name)
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -3 -r1.98 -r1.99
--- ewins.c 20 Aug 2005 13:55:50 -0000 1.98
+++ ewins.c 21 Aug 2005 13:21:48 -0000 1.99
@@ -1620,6 +1620,25 @@
}
void
+EwinsMoveStickyToDesk(int desk)
+{
+ EWin *const *lst, *ewin;
+ int i, num;
+
+ lst = EwinListStackGet(&num);
+ for (i = 0; i < num; i++)
+ {
+ ewin = lst[num - 1 - i];
+ if (!EoIsSticky(ewin) && !EoIsFloating(ewin))
+ continue;
+ if (EwinIsTransientChild(ewin))
+ continue;
+
+ EwinMoveToDesktop(ewin, desk);
+ }
+}
+
+void
EwinsSetFree(void)
{
int i, num;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- ewins.h 20 Aug 2005 13:55:50 -0000 1.8
+++ ewins.h 21 Aug 2005 13:21:48 -0000 1.9
@@ -263,6 +263,7 @@
void EwinsEventsConfigure(int mode);
void EwinsSetFree(void);
void EwinsShowDesktop(int on);
+void EwinsMoveStickyToDesk(int desk);
/* ewin-ops.c */
void SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/menus.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -3 -r1.210 -r1.211
--- menus.c 20 Aug 2005 13:55:51 -0000 1.210
+++ menus.c 21 Aug 2005 13:21:48 -0000 1.211
@@ -217,13 +217,6 @@
ewin = m->ewin;
if (ewin)
{
-#if 0 /* FIXME - Why? */
- if ((Mode.button) &&
- FindItem(Mode.button, 0, LIST_FINDBY_POINTER, LIST_TYPE_BUTTON))
- {
- ButtonDrawWithState(Mode.button, STATE_NORMAL);
- }
-#endif
#if 0 /* ??? */
RaiseEwin(ewin);
ShowEwin(ewin);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/slideout.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- slideout.c 20 Aug 2005 17:43:33 -0000 1.39
+++ slideout.c 21 Aug 2005 13:21:48 -0000 1.40
@@ -22,6 +22,7 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
+#include "buttons.h"
#include "emodule.h"
#include "ewins.h"
#include "xwin.h"
@@ -35,8 +36,8 @@
{
EObj o;
char direction;
- int num_buttons;
- Button **button;
+ int num_objs;
+ EObj **objs;
unsigned int ref_count;
EWin *context_ewin;
} Slideout;
@@ -170,9 +171,8 @@
att.win_gravity = SouthEastGravity;
EChangeWindowAttributes(EoGetWin(s), CWWinGravity, &att);
att.win_gravity = NorthWestGravity;
- for (i = 0; i < s->num_buttons; i++)
- EChangeWindowAttributes(ButtonGetWin(s->button[i]),
- CWWinGravity, &att);
+ for (i = 0; i < s->num_objs; i++)
+ EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1);
ESync();
EoMap(s, 2);
@@ -183,9 +183,8 @@
att.win_gravity = NorthWestGravity;
EChangeWindowAttributes(EoGetWin(s), CWWinGravity, &att);
att.win_gravity = SouthEastGravity;
- for (i = 0; i < s->num_buttons; i++)
- EChangeWindowAttributes(ButtonGetWin(s->button[i]),
- CWWinGravity, &att);
+ for (i = 0; i < s->num_objs; i++)
+ EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1);
ESync();
EoMap(s, 2);
@@ -196,9 +195,8 @@
att.win_gravity = SouthEastGravity;
EChangeWindowAttributes(EoGetWin(s), CWWinGravity, &att);
att.win_gravity = NorthWestGravity;
- for (i = 0; i < s->num_buttons; i++)
- EChangeWindowAttributes(ButtonGetWin(s->button[i]),
- CWWinGravity, &att);
+ for (i = 0; i < s->num_objs; i++)
+ EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1);
ESync();
EoMap(s, 2);
@@ -209,9 +207,8 @@
att.win_gravity = NorthWestGravity;
EChangeWindowAttributes(EoGetWin(s), CWWinGravity, &att);
att.win_gravity = SouthEastGravity;
- for (i = 0; i < s->num_buttons; i++)
- EChangeWindowAttributes(ButtonGetWin(s->button[i]),
- CWWinGravity, &att);
+ for (i = 0; i < s->num_objs; i++)
+ EChangeWindowAttributes(EobjGetWin(s->objs[i]), CWWinGravity, &att);
EoMoveResize(s, xx, yy, 1, 1);
ESync();
EoMap(s, 2);
@@ -255,10 +252,10 @@
sh = 0;
x = 0;
y = 0;
- for (i = 0; i < s->num_buttons; i++)
+ for (i = 0; i < s->num_objs; i++)
{
- bw = ButtonGetWidth(s->button[i]);
- bh = ButtonGetHeight(s->button[i]);
+ bw = EobjGetW(s->objs[i]);
+ bh = EobjGetH(s->objs[i]);
switch (s->direction)
{
@@ -281,27 +278,27 @@
EoResize(s, sw, sh);
- for (i = 0; i < s->num_buttons; i++)
+ for (i = 0; i < s->num_objs; i++)
{
- bw = ButtonGetWidth(s->button[i]);
- bh = ButtonGetHeight(s->button[i]);
+ bw = EobjGetW(s->objs[i]);
+ bh = EobjGetH(s->objs[i]);
switch (s->direction)
{
case 2:
y += bh;
- EMoveWindow(ButtonGetWin(s->button[i]), (sw - bw) >> 1, sh - y);
+ EMoveWindow(EobjGetWin(s->objs[i]), (sw - bw) >> 1, sh - y);
break;
case 3:
- EMoveWindow(ButtonGetWin(s->button[i]), (sw - bw) >> 1, y);
+ EMoveWindow(EobjGetWin(s->objs[i]), (sw - bw) >> 1, y);
y += bh;
break;
case 0:
x += bw;
- EMoveWindow(ButtonGetWin(s->button[i]), sw - x, (sh - bh) >> 1);
+ EMoveWindow(EobjGetWin(s->objs[i]), sw - x, (sh - bh) >> 1);
break;
case 1:
- EMoveWindow(ButtonGetWin(s->button[i]), x, (sh - bh) >> 1);
+ EMoveWindow(EobjGetWin(s->objs[i]), x, (sh - bh) >> 1);
x += bw;
default:
break;
@@ -313,14 +310,16 @@
static void
SlideoutAddButton(Slideout * s, Button * b)
{
+ EObj *eob = (EObj *) b;
+
if (!b)
return;
if (!s)
return;
- s->num_buttons++;
- s->button = Erealloc(s->button, sizeof(Button *) * s->num_buttons);
- s->button[s->num_buttons - 1] = b;
+ s->num_objs++;
+ s->objs = Erealloc(s->objs, sizeof(EObj *) * s->num_objs);
+ s->objs[s->num_objs - 1] = eob;
ButtonSwallowInto(b, EoObj(s));
SlideoutCalcSize(s);
}
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs