Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
E.h buttons.c desktops.c ewins.c ewins.h finders.c tooltips.c
Log Message:
Tooltip related cleanups.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.482
retrieving revision 1.483
diff -u -3 -r1.482 -r1.483
--- E.h 15 Aug 2005 17:15:18 -0000 1.482
+++ E.h 20 Aug 2005 08:17:22 -0000 1.483
@@ -1059,7 +1059,6 @@
int ButtonGetRefcount(const Button * b);
int ButtonGetDesk(const Button * b);
int ButtonGetInfo(const Button * b, RectBox * r, int desk);
-ActionClass *ButtonGetAClass(const Button * b);
Window ButtonGetWin(const Button * b);
int ButtonGetWidth(const Button * b);
int ButtonGetHeight(const Button * b);
@@ -1070,6 +1069,8 @@
int ButtonEmbedWindow(Button * ButtonToUse,
Window WindowToEmbed);
+int ButtonsCheckAclass(Window win, ActionClass ** pac);
+
/* cmclass.c */
#if ENABLE_COLOR_MODIFIERS
void CreateCurve(ModCurve * c);
@@ -1159,6 +1160,7 @@
int DesksGetNumber(void);
int DesksGetCurrent(void);
void DesksSetCurrent(int desk);
+int DesksCheckAclass(Window win, ActionClass ** pac);
void DesksClear(void);
void DesksResize(int w, int h);
void DesksEventsConfigure(int mode);
@@ -1380,8 +1382,6 @@
EWin *EwinFindByChildren(Window win);
EWin *EwinFindByString(const char *win, int type);
-Button *FindButton(Window win);
-ActionClass *FindActionClass(Window win);
Group **ListWinGroups(EWin * ewin, char group_select, int *num);
EWin **ListWinGroupMembersForEwin(EWin * ewin, int action,
char nogroup, int *num);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/buttons.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -3 -r1.70 -r1.71
--- buttons.c 15 Aug 2005 16:57:13 -0000 1.70
+++ buttons.c 20 Aug 2005 08:17:22 -0000 1.71
@@ -397,12 +397,6 @@
return 0;
}
-ActionClass *
-ButtonGetAClass(const Button * b)
-{
- return b->aclass;
-}
-
Window
ButtonGetWin(const Button * b)
{
@@ -505,34 +499,6 @@
}
/*
- * Functions operating on all buttons
- */
-
-Button *
-FindButton(Window win)
-{
- Button *b;
- Button **buttons;
- int i, num;
-
- buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
- for (i = 0; i < num; i++)
- {
- if ((win == EoGetWin(buttons[i])) || (win == buttons[i]->inside_win)
- || (win == buttons[i]->event_win))
- {
- b = buttons[i];
- Efree(buttons);
- return b;
- }
- }
- if (buttons)
- Efree(buttons);
-
- return NULL;
-}
-
-/*
* Button event handlers
*/
@@ -701,6 +667,35 @@
}
/*
+ * Functions operating on all buttons
+ */
+
+int
+ButtonsCheckAclass(Window win, ActionClass ** pac)
+{
+ ActionClass *ac;
+ Button *b, **lst;
+ int i, num;
+
+ ac = NULL;
+ lst = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
+ for (i = 0; i < num; i++)
+ {
+ b = lst[i];
+ if (win == EoGetWin(b) || win == b->inside_win || win == b->event_win)
+ {
+ ac = b->aclass;
+ break;
+ }
+ }
+ if (lst)
+ Efree(lst);
+
+ *pac = ac;
+ return ac != NULL;
+}
+
+/*
* Configuration load/save
*/
#include "conf.h"
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/desktops.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -3 -r1.167 -r1.168
--- desktops.c 15 Aug 2005 16:57:13 -0000 1.167
+++ desktops.c 20 Aug 2005 08:17:22 -0000 1.168
@@ -615,6 +615,24 @@
desks.current = desk;
}
+int
+DesksCheckAclass(Window win, ActionClass ** pac)
+{
+ Desk *d;
+ int i;
+
+ for (i = 0; i < Conf.desks.num; i++)
+ {
+ d = _DeskGet(i);
+ if (win != EoGetWin(d))
+ continue;
+ *pac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
+ return 1;
+ }
+
+ return 0;
+}
+
void
DesksClear(void)
{
@@ -969,7 +987,7 @@
for (i = 0; i < Conf.desks.num; i++)
{
- d = DeskGet(i);
+ d = _DeskGet(i);
if (i && !d->viewable)
continue;
if (!d->dirty_stack)
@@ -1272,7 +1290,7 @@
void
StackDesktop(int desk)
{
- Desk *d = DeskGet(desk);
+ Desk *d = _DeskGet(desk);
Window *wl;
int i, num, tot;
EObj *const *lst, *eo;
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.c,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -3 -r1.96 -r1.97
--- ewins.c 15 Aug 2005 16:57:13 -0000 1.96
+++ ewins.c 20 Aug 2005 08:17:22 -0000 1.97
@@ -1581,6 +1581,28 @@
EWinChanges.flags = 0;
}
+int
+EwinsCheckAclass(Window win, ActionClass ** pac)
+{
+ EWin *ewin, *const *lst;
+ int i, j, num;
+
+ lst = EwinListGetAll(&num);
+ for (i = 0; i < num; i++)
+ {
+ ewin = lst[i];
+ for (j = 0; j < ewin->border->num_winparts; j++)
+ {
+ if (win != ewin->bits[j].win)
+ continue;
+ *pac = ewin->border->part[j].aclass;
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
void
EwinsEventsConfigure(int mode)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ewins.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- ewins.h 15 Aug 2005 16:57:13 -0000 1.6
+++ ewins.h 20 Aug 2005 08:17:22 -0000 1.7
@@ -260,6 +260,7 @@
void EwinChange(EWin * ewin, unsigned int flag);
+int EwinsCheckAclass(Window win, ActionClass ** pac);
void EwinsEventsConfigure(int mode);
void EwinsSetFree(void);
void EwinsShowDesktop(int on);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/finders.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -3 -r1.39 -r1.40
--- finders.c 4 Aug 2005 16:01:54 -0000 1.39
+++ finders.c 20 Aug 2005 08:17:22 -0000 1.40
@@ -140,59 +140,6 @@
return ewin;
}
-static EWin *
-FindEwinByDecoration(Window win)
-{
- EWin *const *ewins;
- int i, j, num;
-
- ewins = EwinListGetAll(&num);
- for (i = 0; i < num; i++)
- {
- for (j = 0; j < ewins[i]->border->num_winparts; j++)
- {
- if (win == ewins[i]->bits[j].win)
- return ewins[i];
- }
- }
-
- return NULL;
-}
-
-ActionClass *
-FindActionClass(Window win)
-{
- Button *b;
- EWin *ewin;
- int i;
-
- b = FindButton(win);
- if (b)
- return ButtonGetAClass(b);
-
- ewin = FindEwinByDecoration(win);
- if (ewin)
- {
- for (i = 0; i < ewin->border->num_winparts; i++)
- if (win == ewin->bits[i].win)
- return ewin->border->part[i].aclass;
- }
-
- for (i = 0; i < Conf.desks.num; i++)
- {
- ActionClass *ac;
-
- if (win == DeskGetWin(i))
- {
- ac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME,
- LIST_TYPE_ACLASS);
- return ac;
- }
- }
-
- return NULL;
-}
-
Group **
ListWinGroups(EWin * ewin, char group_select, int *num)
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/tooltips.c,v
retrieving revision 1.82
retrieving revision 1.83
diff -u -3 -r1.82 -r1.83
--- tooltips.c 14 Aug 2005 21:25:46 -0000 1.82
+++ tooltips.c 20 Aug 2005 08:17:22 -0000 1.83
@@ -710,6 +710,30 @@
static ToolTip *ttip = NULL;
+static ActionClass *
+FindActionClass(Window win, int root_ok)
+{
+ ActionClass *ac;
+ int found;
+
+ found = ButtonsCheckAclass(win, &ac);
+ if (found)
+ return ac;
+
+ found = EwinsCheckAclass(win, &ac);
+ if (found)
+ return ac;
+
+ if (!root_ok)
+ return NULL;
+
+ found = DesksCheckAclass(win, &ac);
+ if (found)
+ return ac;
+
+ return NULL;
+}
+
static void
ToolTipTimeout(int val __UNUSED__, void *data __UNUSED__)
{
@@ -719,6 +743,11 @@
ActionClass *ac;
const char *tts;
+ if (!ttip)
+ ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
+ if (!ttip)
+ return;
+
/* In the case of multiple screens, check to make sure
* the root window is still where the mouse is... */
if (!EQueryPointer(VRoot.win, &x, &y, NULL, &mask))
@@ -734,36 +763,15 @@
return;
win = WindowAtXY(x, y);
- ac = FindActionClass(win);
+ ac = FindActionClass(win, Conf_tooltips.showroottooltip);
if (!ac)
return;
- if (!ttip)
- ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
-
tts = ActionclassGetTooltipString(ac);
- if (tts)
- {
- tts = _(tts);
+ if (!tts)
+ return;
- if (Conf_tooltips.showroottooltip)
- {
- TooltipShow(ttip, tts, ac, x, y);
- }
- else
- {
- int i;
- int show = 1;
-
- for (i = 0; i < Conf.desks.num; i++)
- {
- if (win == DeskGetWin(i))
- show = 0;
- }
- if (show)
- TooltipShow(ttip, tts, ac, x, y);
- }
- }
+ TooltipShow(ttip, _(tts), ac, x, y);
}
/*
-------------------------------------------------------
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