forked from e16/e16
1
0
Fork 0

Mon Dec 6 14:52:40 PST 1999

(Raster)

gettext internationalisation support & patch
fix to allow setting of which mouse button do what on the pager
fix to border width handlign in icccm
fix to warp foucs
some other stuff i probabyl forgot about...


SVN revision: 1507
This commit is contained in:
Carsten Haitzler 1999-12-06 17:12:20 +00:00
parent eb06b4f29d
commit 92ff0dd54b
67 changed files with 5344 additions and 4486 deletions

View File

@ -3995,3 +3995,14 @@ Mon Nov 22 12:42:56 PST 1999
(Mandrake) (Mandrake)
added "current" option to win_op ipc command for walt :) added "current" option to win_op ipc command for walt :)
-------------------------------------------------------------------------------
Mon Dec 6 14:52:40 PST 1999
(Raster)
gettext internationalisation support & patch
fix to allow setting of which mouse button do what on the pager
fix to border width handlign in icccm
fix to warp foucs
some other stuff i probabyl forgot about...

1999
src/E.h

File diff suppressed because it is too large Load Diff

View File

@ -93,6 +93,7 @@ enlightenment_SOURCES = \
zoom.c zoom.c
LDADD = \ LDADD = \
@INTLLIBS@ \
$(FNLIB_LIBS) \ $(FNLIB_LIBS) \
$(TTF_LIBS) \ $(TTF_LIBS) \
$(ESD_LIBS) \ $(ESD_LIBS) \
@ -103,7 +104,7 @@ LDADD = \
$(DL_LIBS) \ $(DL_LIBS) \
-lm -lm
INCLUDES=-I$(top_srcdir) $(ESD_CFLAGS) $(IMLIB_CFLAGS) -I$(includedir) -I.. INCLUDES=-I$(top_srcdir) $(ESD_CFLAGS) $(IMLIB_CFLAGS) -I$(includedir) -I.. -I../intl -I$(top_srcdir)/intl
DEFS=-DENLIGHTENMENT_ROOT=\"@ENLIGHTENMENT_ROOT@\" -DENLIGHTENMENT_BIN=\"@ENLIGHTENMENT_BIN@\" DEFS=-DENLIGHTENMENT_ROOT=\"@ENLIGHTENMENT_ROOT@\" -DENLIGHTENMENT_BIN=\"@ENLIGHTENMENT_BIN@\"

View File

@ -71,8 +71,7 @@ GrabButtonGrabs(EWin * ewin)
Action *a; Action *a;
ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0,
LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
LIST_TYPE_ACLASS);
if (ac) if (ac)
{ {
@ -119,7 +118,8 @@ GrabButtonGrabs(EWin * ewin)
None, None); None, None);
XGrabButton(disp, button, mod | mask_mod_combos[i], XGrabButton(disp, button, mod | mask_mod_combos[i],
ewin->win, False, mask, ewin->win, False, mask,
GrabModeSync, GrabModeAsync, None, None); GrabModeSync, GrabModeAsync, None,
None);
} }
} }
} }
@ -135,8 +135,7 @@ UnGrabButtonGrabs(EWin * ewin)
Action *a; Action *a;
ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0,
LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
LIST_TYPE_ACLASS);
if (ac) if (ac)
{ {
@ -177,8 +176,7 @@ UnGrabButtonGrabs(EWin * ewin)
mod | mask_mod_combos[i], mod | mask_mod_combos[i],
ewin->pager->hi_win); ewin->pager->hi_win);
XUngrabButton(disp, button, XUngrabButton(disp, button,
mod | mask_mod_combos[i], mod | mask_mod_combos[i], ewin->win);
ewin->win);
} }
} }
} }
@ -539,9 +537,10 @@ spawnMenu(void *params)
{ {
if ((ewin) && (ewin->win != mode.context_win) && (mode.context_win)) if ((ewin) && (ewin->win != mode.context_win) && (mode.context_win))
{ {
EGetGeometry(disp, mode.context_win, &dw, &di, &di, &w, &h, &d, &d); EGetGeometry(disp, mode.context_win, &dw, &di, &di, &w, &h, &d,
XTranslateCoordinates(disp, mode.context_win, root.win, &d);
0, 0, &x, &y, &dw); XTranslateCoordinates(disp, mode.context_win, root.win, 0, 0, &x,
&y, &dw);
if (w >= h) if (w >= h)
mode.y = -(y + h); mode.y = -(y + h);
@ -593,8 +592,7 @@ spawnMenu(void *params)
if (((ewin) && (ewin->win == mode.context_win)) || if (((ewin) && (ewin->win == mode.context_win)) ||
(ewin = FindEwinByChildren(mode.context_win))) (ewin = FindEwinByChildren(mode.context_win)))
{ {
if ((ewin) && (mode.cur_menu_depth > 0) && if ((ewin) && (mode.cur_menu_depth > 0) && (mode.cur_menu[0]))
(mode.cur_menu[0]))
ewin->shownmenu = mode.cur_menu[0]->win; ewin->shownmenu = mode.cur_menu[0]->win;
} }
params = NULL; params = NULL;
@ -662,26 +660,25 @@ runApp(char *exe, char *params)
#else #else
if (_fnisabs((char *)exe)) if (_fnisabs((char *)exe))
#endif #endif
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"This is because the file does not exist.\n", "This program could not be executed.\n"
"This is because the file does not exist.\n"),
(char *)exe); (char *)exe);
/* relative path */ /* relative path */
else else
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"This is most probably because this program " "This program could not be executed.\n"
"is not in the\n" "This is most probably because this program "
"path for your shell which is %s. I suggest " "is not in the\n"
"you read " "path for your shell which is %s. I suggest "
"the manual\n" "you read " "the manual\n"
"page for that shell and read up how to " "page for that shell and read up how to "
"change or add " "change or add " "to your\n"
"to your\n" "execution path.\n"), (char *)exe, sh);
"execution path.\n",
(char *)exe, sh);
} }
else else
/* it is a node on the filing sys */ /* it is a node on the filing sys */
@ -691,28 +688,26 @@ runApp(char *exe, char *params)
{ {
/* can execute it */ /* can execute it */
if (canexec((char *)path)) if (canexec((char *)path))
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"I am unsure as to why you could not " "This program could not be executed.\n"
"do this. " "I am unsure as to why you could not "
"The file exists,\n" "do this. " "The file exists,\n"
"is a file, and you are allowed to " "is a file, and you are allowed to "
"execute it. I " "execute it. I " "suggest you look\n"
"suggest you look\n" "into this.\n"), (char *)path);
"into this.\n",
(char *)path);
/* not executable file */ /* not executable file */
else else
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"This is because the file exists, is a" "This program could not be executed.\n"
" file, but " "This is because the file exists, is a"
"you are unable\n" " file, but " "you are unable\n"
"to execute it because you do not " "to execute it because you do not "
"have execute " "have execute "
"access to this file.\n", "access to this file.\n"),
(char *)path); (char *)path);
} }
/* it's not a file */ /* it's not a file */
@ -720,20 +715,20 @@ runApp(char *exe, char *params)
{ {
/* its a dir */ /* its a dir */
if (isdir((char *)path)) if (isdir((char *)path))
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"This is because the file is infact " "This program could not be executed.\n"
"a directory.\n", "This is because the file is infact "
(char *)path); "a directory.\n"), (char *)path);
/* its not a file or a dir */ /* its not a file or a dir */
else else
DialogAlertOK("There was an error running the program:\n" DialogAlertOK(gettext
"%s\n" ("There was an error running the program:\n"
"This program could not be executed.\n" "%s\n"
"This is because the file is not a " "This program could not be executed.\n"
"regular file.\n", "This is because the file is not a "
(char *)path); "regular file.\n"), (char *)path);
} }
if (path) if (path)
Efree(path); Efree(path);
@ -1097,7 +1092,8 @@ doMoveImpl(void *params, char constrained)
FloatEwinAt(gwins[i], gwins[i]->x, gwins[i]->y); FloatEwinAt(gwins[i], gwins[i]->x, gwins[i]->y);
if (!mode.moveresize_pending_ewin) if (!mode.moveresize_pending_ewin)
DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y,
gwins[i]->client.w, gwins[i]->client.h, mode.firstlast); gwins[i]->client.w, gwins[i]->client.h,
mode.firstlast);
} }
Efree(gwins); Efree(gwins);
mode.firstlast = 1; mode.firstlast = 1;
@ -1166,8 +1162,9 @@ doMoveEnd(void *params)
{ {
wasresize = 1; wasresize = 1;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, gwins[i]->client.w, DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y,
gwins[i]->client.h, mode.firstlast); gwins[i]->client.w, gwins[i]->client.h,
mode.firstlast);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
MoveEwin(gwins[i], gwins[i]->x, gwins[i]->y); MoveEwin(gwins[i], gwins[i]->x, gwins[i]->y);
} }
@ -1179,9 +1176,11 @@ doMoveEnd(void *params)
if (gwins[i]->floating) if (gwins[i]->floating)
MoveEwinToDesktopAt(gwins[i], d, MoveEwinToDesktopAt(gwins[i], d,
gwins[i]->x - (desks.desk[d].x - gwins[i]->x - (desks.desk[d].x -
desks.desk[gwins[i]->desktop].x), desks.desk[gwins[i]->
desktop].x),
gwins[i]->y - (desks.desk[d].y - gwins[i]->y - (desks.desk[d].y -
desks.desk[gwins[i]->desktop].y)); desks.desk[gwins[i]->
desktop].y));
else else
MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y); MoveEwinToDesktopAt(gwins[i], d, gwins[i]->x, gwins[i]->y);
gwins[i]->floating = 0; gwins[i]->floating = 0;
@ -1350,15 +1349,14 @@ doCleanup(void *params)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if ((((EWin *) lst[i])->desktop == desks.current) && if ((((EWin *) lst[i])->desktop == desks.current) &&
(!((EWin *) lst[i])->sticky) && (!((EWin *) lst[i])->floating) && (!((EWin *) lst[i])->sticky) && (!((EWin *) lst[i])->floating)
(!((EWin *) lst[i])->iconified) && && (!((EWin *) lst[i])->iconified)
(!((EWin *) lst[i])->ignorearrange) && && (!((EWin *) lst[i])->ignorearrange)
(!((EWin *) lst[i])->menu) && && (!((EWin *) lst[i])->menu)
(((EWin *) lst[i])->area_x == && (((EWin *) lst[i])->area_x ==
desks.desk[((EWin *) lst[i])->desktop].current_area_x) && desks.desk[((EWin *) lst[i])->desktop].current_area_x)
(((EWin *) lst[i])->area_y == && (((EWin *) lst[i])->area_y ==
desks.desk[((EWin *) lst[i])->desktop].current_area_y) desks.desk[((EWin *) lst[i])->desktop].current_area_y))
)
{ {
floating[j].data = lst[i]; floating[j].data = lst[i];
floating[j].x = ((EWin *) lst[i])->x; floating[j].x = ((EWin *) lst[i])->x;
@ -1368,14 +1366,11 @@ doCleanup(void *params)
floating[j++].h = ((EWin *) lst[i])->h; floating[j++].h = ((EWin *) lst[i])->h;
} }
else if ( else if (
( (
(((EWin *) lst[i])->desktop == desks.current) || (((EWin *) lst[i])->desktop == desks.current) ||
(((EWin *) lst[i])->sticky) (((EWin *) lst[i])->sticky)) &&
) && (((EWin *) lst[i])->layer != 4) &&
(((EWin *) lst[i])->layer != 4) && (((EWin *) lst[i])->layer != 0) && (!((EWin *) lst[i])->menu))
(((EWin *) lst[i])->layer != 0) &&
(!((EWin *) lst[i])->menu)
)
{ {
fixed = Erealloc(fixed, sizeof(RectBox) * (k + 1)); fixed = Erealloc(fixed, sizeof(RectBox) * (k + 1));
fixed[k].data = lst[i]; fixed[k].data = lst[i];
@ -1521,7 +1516,8 @@ doCleanup(void *params)
if (ewin) if (ewin)
{ {
if ((ewin->x != ret[i].x) || (ewin->y != ret[i].y)) if ((ewin->x != ret[i].x) || (ewin->y != ret[i].y))
MoveEwin((EWin *) ret[i].data, ret[i].x, ret[i].y); MoveEwin((EWin *) ret[i].data, ret[i].x,
ret[i].y);
} }
} }
} }
@ -1724,9 +1720,11 @@ doStick(void *params)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
curr_group = EwinsInGroup(ewin, gwins[i]); curr_group = EwinsInGroup(ewin, gwins[i]);
if (gwins[i]->sticky && ((curr_group && !curr_group->cfg.mirror) || sticky)) if (gwins[i]->sticky
&& ((curr_group && !curr_group->cfg.mirror) || sticky))
MakeWindowUnSticky(gwins[i]); MakeWindowUnSticky(gwins[i]);
else if (!gwins[i]->sticky && ((curr_group && !curr_group->cfg.mirror) || !sticky)) else if (!gwins[i]->sticky
&& ((curr_group && !curr_group->cfg.mirror) || !sticky))
MakeWindowSticky(gwins[i]); MakeWindowSticky(gwins[i]);
params = NULL; params = NULL;
GNOME_SetHint(gwins[i]); GNOME_SetHint(gwins[i]);
@ -2204,8 +2202,7 @@ doPlaySoundClass(void *params)
if (!params) if (!params)
EDBUG_RETURN(0); EDBUG_RETURN(0);
ApplySclass(FindItem((char *)params, 0, LIST_FINDBY_NAME, ApplySclass(FindItem((char *)params, 0, LIST_FINDBY_NAME, LIST_TYPE_SCLASS));
LIST_TYPE_SCLASS));
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }
@ -2331,7 +2328,7 @@ doHideShowButton(void *params)
if (matchregexp(ss, lst[i]->name)) if (matchregexp(ss, lst[i]->name))
{ {
if ((strcmp(lst[i]->name, if ((strcmp(lst[i]->name,
"_DESKTOP_DESKRAY_DRAG_CONTROL") && "_DESKTOP_DESKRAY_DRAG_CONTROL") &&
(!lst[i]->used))) (!lst[i]->used)))
{ {
if (!(lst[i]->visible)) if (!(lst[i]->visible))
@ -2361,7 +2358,7 @@ doHideShowButton(void *params)
if (!matchregexp(ss, lst[i]->name)) if (!matchregexp(ss, lst[i]->name))
{ {
if ((strcmp(lst[i]->name, if ((strcmp(lst[i]->name,
"_DESKTOP_DESKRAY_DRAG_CONTROL") && "_DESKTOP_DESKRAY_DRAG_CONTROL") &&
(!lst[i]->used))) (!lst[i]->used)))
{ {
if (!(lst[i]->visible)) if (!(lst[i]->visible))
@ -2461,11 +2458,13 @@ doIconifyWindow(void *params)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
curr_group = EwinsInGroup(ewin, gwins[i]); curr_group = EwinsInGroup(ewin, gwins[i]);
if (gwins[i]->iconified && ((curr_group && !curr_group->cfg.mirror) || iconified)) if (gwins[i]->iconified
&& ((curr_group && !curr_group->cfg.mirror) || iconified))
{ {
DeIconifyEwin(gwins[i]); DeIconifyEwin(gwins[i]);
} }
else if (!gwins[i]->iconified && ((curr_group && !curr_group->cfg.mirror) || !iconified)) else if (!gwins[i]->iconified
&& ((curr_group && !curr_group->cfg.mirror) || !iconified))
{ {
IconifyEwin(gwins[i]); IconifyEwin(gwins[i]);
} }
@ -2568,12 +2567,14 @@ doShade(void *params)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
curr_group = EwinsInGroup(ewin, gwins[i]); curr_group = EwinsInGroup(ewin, gwins[i]);
if (gwins[i]->shaded && ((curr_group && !curr_group->cfg.mirror) || shaded)) if (gwins[i]->shaded
&& ((curr_group && !curr_group->cfg.mirror) || shaded))
{ {
AUDIO_PLAY("SOUND_UNSHADE"); AUDIO_PLAY("SOUND_UNSHADE");
UnShadeEwin(gwins[i]); UnShadeEwin(gwins[i]);
} }
else if (!gwins[i]->shaded && ((curr_group && !curr_group->cfg.mirror) || !shaded)) else if (!gwins[i]->shaded
&& ((curr_group && !curr_group->cfg.mirror) || !shaded))
{ {
AUDIO_PLAY("SOUND_SHADE"); AUDIO_PLAY("SOUND_SHADE");
ShadeEwin(gwins[i]); ShadeEwin(gwins[i]);
@ -3019,7 +3020,9 @@ doSetWinBorder(void *params)
if (!params) if (!params)
EDBUG_RETURN(0); EDBUG_RETURN(0);
gwins = ListWinGroupMembersForEwin(ewin, ACTION_SET_WINDOW_BORDER, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(ewin, ACTION_SET_WINDOW_BORDER, mode.nogroup,
&num);
sscanf((char *)params, "%1000s", buf); sscanf((char *)params, "%1000s", buf);
b = (Border *) FindItem(buf, 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER); b = (Border *) FindItem(buf, 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
@ -3038,8 +3041,7 @@ doSetWinBorder(void *params)
{ {
if ((b->border.left == 0) && if ((b->border.left == 0) &&
(b->border.right == 0) && (b->border.right == 0) &&
(b->border.top == 0) && (b->border.top == 0) && (b->border.bottom == 0))
(b->border.bottom == 0))
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
@ -3058,8 +3060,8 @@ doSetWinBorder(void *params)
if (shadechange) if (shadechange)
InstantShadeEwin(gwins[i]); InstantShadeEwin(gwins[i]);
ICCCM_MatchSize(gwins[i]); ICCCM_MatchSize(gwins[i]);
MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w, MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y,
gwins[i]->client.h); gwins[i]->client.w, gwins[i]->client.h);
} }
RememberImportantInfoForEwin(gwins[i]); RememberImportantInfoForEwin(gwins[i]);
} }
@ -3129,7 +3131,7 @@ doAbout(void *params)
{ {
char stuff[255]; char stuff[255];
Esnprintf(stuff, sizeof(stuff), "About Enlightenment %s", Esnprintf(stuff, sizeof(stuff), gettext("About Enlightenment %s"),
ENLIGHTENMENT_VERSION); ENLIGHTENMENT_VERSION);
DialogSetTitle(d, stuff); DialogSetTitle(d, stuff);
} }
@ -3145,29 +3147,29 @@ doAbout(void *params)
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemTextSetText(di, DialogItemTextSetText(di,
"Welcome to the " gettext("Welcome to the "
ENLIGHTENMENT_VERSION ENLIGHTENMENT_VERSION
" version\n" " version\n"
"of the Enlightenment " "of the Enlightenment "
"window manager.\n Enlightenment is still under " "window manager.\n Enlightenment is still under "
"development, but\n" "development, but\n"
"we have tried to iron out all the bugs " "we have tried to iron out all the bugs "
"that\nwe can find. If " "that\nwe can find. If "
"you find a bug in the software,\n please do " "you find a bug in the software,\n please do "
"not hesitate to send " "not hesitate to send "
"in a bug report.\nSee \"Help\" for information " "in a bug report.\nSee \"Help\" for information "
"on joining the\n" "on joining the\n"
"mailing list.\n" "mailing list.\n"
"\n" "\n"
"This code last updated on:\n" "This code last updated on:\n"
E_CHECKOUT_DATE "\n" E_CHECKOUT_DATE "\n"
"\n" "\n"
"Good luck. We hope you enjoy the software.\n" "Good luck. We hope you enjoy the software.\n"
"\n" "\n"
"The Rasterman - raster@rasterman.com\n" "The Rasterman - raster@rasterman.com\n"
"Mandrake - mandrake@mandrake.net\n"); "Mandrake - mandrake@mandrake.net\n"));
DialogAddButton(d, "OK", NULL, 1); DialogAddButton(d, gettext("OK"), NULL, 1);
ShowDialog(d); ShowDialog(d);
params = NULL; params = NULL;
@ -3320,7 +3322,8 @@ doConfigure(void *params)
if (ewin) if (ewin)
{ {
ChooseGroupDialog(ewin, ChooseGroupDialog(ewin,
" Pick the group the window will belong to: \n", gettext
(" Pick the group the window will belong to: \n"),
GROUP_SELECT_ALL_EXCEPT_EWIN, GROUP_SELECT_ALL_EXCEPT_EWIN,
ACTION_ADD_TO_GROUP); ACTION_ADD_TO_GROUP);
} }
@ -3339,8 +3342,7 @@ struct _keyset
int int
doInsertKeys(void *params) doInsertKeys(void *params)
{ {
const struct _keyset ks[] = const struct _keyset ks[] = {
{
{"a", 0, "a"}, {"a", 0, "a"},
{"b", 0, "b"}, {"b", 0, "b"},
{"c", 0, "c"}, {"c", 0, "c"},
@ -3462,14 +3464,17 @@ doInsertKeys(void *params)
ev.y = mode.y; ev.y = mode.y;
ev.x_root = mode.x; ev.x_root = mode.x;
ev.y_root = mode.y; ev.y_root = mode.y;
for (j = 0; j < (int)(sizeof(ks) / sizeof(struct _keyset)); j++) for (j = 0; j < (int)(sizeof(ks) / sizeof(struct _keyset));
j++)
{ {
if (!strncmp(ks[j].ch, &(s[i]), strlen(ks[j].ch))) if (!strncmp(ks[j].ch, &(s[i]), strlen(ks[j].ch)))
{ {
i += (strlen(ks[j].ch) - 1); i += (strlen(ks[j].ch) - 1);
ev.keycode = ev.keycode =
XKeysymToKeycode(disp, XStringToKeysym(ks[j].sym)); XKeysymToKeycode(disp,
XStringToKeysym(ks[j].sym));
ev.state = ks[j].state; ev.state = ks[j].state;
ev.type = KeyPress; ev.type = KeyPress;
XSendEvent(disp, win, False, 0, (XEvent *) & ev); XSendEvent(disp, win, False, 0, (XEvent *) & ev);
@ -3551,7 +3556,8 @@ doRaiseLower(void *params)
if (!ewin) if (!ewin)
EDBUG_RETURN(0); EDBUG_RETURN(0);
gwins = ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(ewin, ACTION_RAISE_LOWER, mode.nogroup, &num);
for (j = 0; j < num; j++) for (j = 0; j < num; j++)
{ {
ewin = gwins[j]; ewin = gwins[j];
@ -3561,7 +3567,8 @@ doRaiseLower(void *params)
{ {
if (desks.desk[ewin->desktop].list[i]->layer == ewin->layer && if (desks.desk[ewin->desktop].list[i]->layer == ewin->layer &&
(desks.desk[ewin->desktop].list[i] == ewin || (desks.desk[ewin->desktop].list[i] == ewin ||
!FindEwinInList(desks.desk[ewin->desktop].list[i], gwins, num))) !FindEwinInList(desks.desk[ewin->desktop].list[i], gwins,
num)))
{ {
if (desks.desk[ewin->desktop].list[i] != ewin) if (desks.desk[ewin->desktop].list[i] != ewin)
raise = 1; raise = 1;
@ -3665,13 +3672,13 @@ doAddToGroup(void *params)
if (!current_group) if (!current_group)
{ {
ChooseGroupDialog(ewin, ChooseGroupDialog(ewin,
"\n There's no current group at the moment. \n" gettext
" The current group is the last one you created, \n" ("\n There's no current group at the moment. \n"
" and it exists until you create a new one or break \n" " The current group is the last one you created, \n"
" the latest one. \n\n" " and it exists until you create a new one or break \n"
" Pick another group that the window will belong to here: \n\n", " the latest one. \n\n"
GROUP_SELECT_ALL_EXCEPT_EWIN, " Pick another group that the window will belong to here: \n\n"),
ACTION_ADD_TO_GROUP); GROUP_SELECT_ALL_EXCEPT_EWIN, ACTION_ADD_TO_GROUP);
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }
else else
@ -3699,9 +3706,9 @@ doRemoveFromGroup(void *params)
EDBUG_RETURN(0); EDBUG_RETURN(0);
ChooseGroupDialog(ewin, ChooseGroupDialog(ewin,
" Select the group to remove the window from. ", gettext
GROUP_SELECT_EWIN_ONLY, (" Select the group to remove the window from. "),
ACTION_REMOVE_FROM_GROUP); GROUP_SELECT_EWIN_ONLY, ACTION_REMOVE_FROM_GROUP);
SaveGroups(); SaveGroups();
EDBUG_RETURN(0); EDBUG_RETURN(0);
@ -3725,9 +3732,8 @@ doBreakGroup(void *params)
EDBUG_RETURN(0); EDBUG_RETURN(0);
ChooseGroupDialog(ewin, ChooseGroupDialog(ewin,
" Select the group to break ", gettext(" Select the group to break "),
GROUP_SELECT_EWIN_ONLY, GROUP_SELECT_EWIN_ONLY, ACTION_BREAK_GROUP);
ACTION_BREAK_GROUP);
SaveGroups(); SaveGroups();
EDBUG_RETURN(0); EDBUG_RETURN(0);
@ -3752,22 +3758,23 @@ doZoom(void *params)
f = fopen(s, "w"); f = fopen(s, "w");
if (f) if (f)
{ {
fprintf(f, "You have been warned abotu the dangers of Zoom mode\n"); fprintf(f,
gettext
("You have been warned about the dangers of Zoom mode\n"));
fclose(f); fclose(f);
} }
DIALOG_OK("Warning !!!", DIALOG_OK(gettext("Warning !!!"),
"This feature is heavily reliant on a feature of your\n" gettext
"X Server called the Vid Mode Extension. This feature exists\n" ("This feature is heavily reliant on a feature of your\n"
"in XFree86 Servers, but is not a heavily used part of the\n" "X Server called the Vid Mode Extension. This feature exists\n"
"Server and thus isn't tested much.\n" "in XFree86 Servers, but is not a heavily used part of the\n"
"\n" "Server and thus isn't tested much.\n" "\n"
"It is possible your X Server does not deal well with being\n" "It is possible your X Server does not deal well with being\n"
"asked to switch modes quickly and it may hang, glitch,\n" "asked to switch modes quickly and it may hang, glitch,\n"
"display artifacts or perhaps simply refuse to work.\n" "display artifacts or perhaps simply refuse to work.\n" "\n"
"\n" "This is a warning and will only be displayed this one time.\n"
"This is a warning and will only be displayed this one time.\n" "If your Server does not behave well then you will probably\n"
"If your Server does not behave well then you will probably\n" "have to avoid using this feature.\n"));
"have to avoid using this feature.\n");
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }
ewin = GetFocusEwin(); ewin = GetFocusEwin();
@ -3807,31 +3814,43 @@ initFunctionArray(void)
ActionFunctions[ACTION_DESKTOP_LOWER] = (int (*)(void *))(doLowerDesktop); ActionFunctions[ACTION_DESKTOP_LOWER] = (int (*)(void *))(doLowerDesktop);
ActionFunctions[ACTION_DESKTOP_DRAG] = (int (*)(void *))(doDragDesktop); ActionFunctions[ACTION_DESKTOP_DRAG] = (int (*)(void *))(doDragDesktop);
ActionFunctions[ACTION_STICK] = (int (*)(void *))(doStick); ActionFunctions[ACTION_STICK] = (int (*)(void *))(doStick);
ActionFunctions[ACTION_DESKTOP_INPLACE] = (int (*)(void *))(doInplaceDesktop); ActionFunctions[ACTION_DESKTOP_INPLACE] =
(int (*)(void *))(doInplaceDesktop);
ActionFunctions[ACTION_DRAG_BUTTON] = (int (*)(void *))(doDragButtonStart); ActionFunctions[ACTION_DRAG_BUTTON] = (int (*)(void *))(doDragButtonStart);
ActionFunctions[ACTION_FOCUSMODE_SET] = (int (*)(void *))(doFocusModeSet); ActionFunctions[ACTION_FOCUSMODE_SET] = (int (*)(void *))(doFocusModeSet);
ActionFunctions[ACTION_MOVEMODE_SET] = (int (*)(void *))(doMoveModeSet); ActionFunctions[ACTION_MOVEMODE_SET] = (int (*)(void *))(doMoveModeSet);
ActionFunctions[ACTION_RESIZEMODE_SET] = (int (*)(void *))(doResizeModeSet); ActionFunctions[ACTION_RESIZEMODE_SET] = (int (*)(void *))(doResizeModeSet);
ActionFunctions[ACTION_SLIDEMODE_SET] = (int (*)(void *))(doSlideModeSet); ActionFunctions[ACTION_SLIDEMODE_SET] = (int (*)(void *))(doSlideModeSet);
ActionFunctions[ACTION_CLEANUPSILDE_SET] = (int (*)(void *))(doCleanupSlideSet); ActionFunctions[ACTION_CLEANUPSILDE_SET] =
(int (*)(void *))(doCleanupSlideSet);
ActionFunctions[ACTION_MAPSLIDE_SET] = (int (*)(void *))(doMapSlideSet); ActionFunctions[ACTION_MAPSLIDE_SET] = (int (*)(void *))(doMapSlideSet);
ActionFunctions[ACTION_SOUND_SET] = (int (*)(void *))(doSoundSet); ActionFunctions[ACTION_SOUND_SET] = (int (*)(void *))(doSoundSet);
ActionFunctions[ACTION_BUTTONMOVE_RESIST_SET] = (int (*)(void *))(doButtonMoveResistSet); ActionFunctions[ACTION_BUTTONMOVE_RESIST_SET] =
ActionFunctions[ACTION_DESKTOPBG_TIMEOUT_SET] = (int (*)(void *))(doDesktopBgTimeoutSet); (int (*)(void *))(doButtonMoveResistSet);
ActionFunctions[ACTION_MAPSLIDE_SPEED_SET] = (int (*)(void *))(doMapSlideSpeedSet); ActionFunctions[ACTION_DESKTOPBG_TIMEOUT_SET] =
ActionFunctions[ACTION_CLEANUPSLIDE_SPEED_SET] = (int (*)(void *))(doCleanupSlideSpeedSet); (int (*)(void *))(doDesktopBgTimeoutSet);
ActionFunctions[ACTION_MAPSLIDE_SPEED_SET] =
(int (*)(void *))(doMapSlideSpeedSet);
ActionFunctions[ACTION_CLEANUPSLIDE_SPEED_SET] =
(int (*)(void *))(doCleanupSlideSpeedSet);
ActionFunctions[ACTION_DRAGDIR_SET] = (int (*)(void *))(doDragdirSet); ActionFunctions[ACTION_DRAGDIR_SET] = (int (*)(void *))(doDragdirSet);
ActionFunctions[ACTION_DRAGBAR_ORDER_SET] = (int (*)(void *))(doDragbarOrderSet); ActionFunctions[ACTION_DRAGBAR_ORDER_SET] =
ActionFunctions[ACTION_DRAGBAR_WIDTH_SET] = (int (*)(void *))(doDragbarWidthSet); (int (*)(void *))(doDragbarOrderSet);
ActionFunctions[ACTION_DRAGBAR_LENGTH_SET] = (int (*)(void *))(doDragbarLengthSet); ActionFunctions[ACTION_DRAGBAR_WIDTH_SET] =
(int (*)(void *))(doDragbarWidthSet);
ActionFunctions[ACTION_DRAGBAR_LENGTH_SET] =
(int (*)(void *))(doDragbarLengthSet);
ActionFunctions[ACTION_DESKSLIDE_SET] = (int (*)(void *))(doDeskSlideSet); ActionFunctions[ACTION_DESKSLIDE_SET] = (int (*)(void *))(doDeskSlideSet);
ActionFunctions[ACTION_DESKSLIDE_SPEED_SET] = (int (*)(void *))(doDeskSlideSpeedSet); ActionFunctions[ACTION_DESKSLIDE_SPEED_SET] =
ActionFunctions[ACTION_HIQUALITYBG_SET] = (int (*)(void *))(doHiQualityBgSet); (int (*)(void *))(doDeskSlideSpeedSet);
ActionFunctions[ACTION_HIQUALITYBG_SET] =
(int (*)(void *))(doHiQualityBgSet);
ActionFunctions[ACTION_PLAYSOUNDCLASS] = (int (*)(void *))(doPlaySoundClass); ActionFunctions[ACTION_PLAYSOUNDCLASS] = (int (*)(void *))(doPlaySoundClass);
ActionFunctions[ACTION_GOTO_DESK] = (int (*)(void *))(doGotoDesktop); ActionFunctions[ACTION_GOTO_DESK] = (int (*)(void *))(doGotoDesktop);
ActionFunctions[ACTION_DESKRAY] = (int (*)(void *))(doDeskray); ActionFunctions[ACTION_DESKRAY] = (int (*)(void *))(doDeskray);
ActionFunctions[ACTION_AUTOSAVE_SET] = (int (*)(void *))(doAutosaveSet); ActionFunctions[ACTION_AUTOSAVE_SET] = (int (*)(void *))(doAutosaveSet);
ActionFunctions[ACTION_HIDESHOW_BUTTON] = (int (*)(void *))(doHideShowButton); ActionFunctions[ACTION_HIDESHOW_BUTTON] =
(int (*)(void *))(doHideShowButton);
ActionFunctions[ACTION_ICONIFY] = (int (*)(void *))(doIconifyWindow); ActionFunctions[ACTION_ICONIFY] = (int (*)(void *))(doIconifyWindow);
ActionFunctions[ACTION_SLIDEOUT] = (int (*)(void *))(doSlideout); ActionFunctions[ACTION_SLIDEOUT] = (int (*)(void *))(doSlideout);
ActionFunctions[ACTION_SCROLL_WINDOWS] = (int (*)(void *))(doScrollWindows); ActionFunctions[ACTION_SCROLL_WINDOWS] = (int (*)(void *))(doScrollWindows);
@ -3839,10 +3858,13 @@ initFunctionArray(void)
ActionFunctions[ACTION_MAX_HEIGHT] = (int (*)(void *))(doMaxH); ActionFunctions[ACTION_MAX_HEIGHT] = (int (*)(void *))(doMaxH);
ActionFunctions[ACTION_MAX_WIDTH] = (int (*)(void *))(doMaxW); ActionFunctions[ACTION_MAX_WIDTH] = (int (*)(void *))(doMaxW);
ActionFunctions[ACTION_MAX_SIZE] = (int (*)(void *))(doMax); ActionFunctions[ACTION_MAX_SIZE] = (int (*)(void *))(doMax);
ActionFunctions[ACTION_SEND_TO_NEXT_DESK] = (int (*)(void *))(doSendToNextDesk); ActionFunctions[ACTION_SEND_TO_NEXT_DESK] =
ActionFunctions[ACTION_SEND_TO_PREV_DESK] = (int (*)(void *))(doSendToPrevDesk); (int (*)(void *))(doSendToNextDesk);
ActionFunctions[ACTION_SEND_TO_PREV_DESK] =
(int (*)(void *))(doSendToPrevDesk);
ActionFunctions[ACTION_SNAPSHOT] = (int (*)(void *))(doSnapshot); ActionFunctions[ACTION_SNAPSHOT] = (int (*)(void *))(doSnapshot);
ActionFunctions[ACTION_SCROLL_CONTAINER] = (int (*)(void *))(doScrollContainer); ActionFunctions[ACTION_SCROLL_CONTAINER] =
(int (*)(void *))(doScrollContainer);
ActionFunctions[ACTION_TOOLTIP_SET] = (int (*)(void *))(doToolTipSet); ActionFunctions[ACTION_TOOLTIP_SET] = (int (*)(void *))(doToolTipSet);
ActionFunctions[ACTION_FOCUS_NEXT] = (int (*)(void *))(doFocusNext); ActionFunctions[ACTION_FOCUS_NEXT] = (int (*)(void *))(doFocusNext);
ActionFunctions[ACTION_FOCUS_PREV] = (int (*)(void *))(doFocusPrev); ActionFunctions[ACTION_FOCUS_PREV] = (int (*)(void *))(doFocusPrev);
@ -3853,37 +3875,48 @@ initFunctionArray(void)
ActionFunctions[ACTION_TOGGLE_FIXED] = (int (*)(void *))(doToggleFixedPos); ActionFunctions[ACTION_TOGGLE_FIXED] = (int (*)(void *))(doToggleFixedPos);
ActionFunctions[ACTION_SET_LAYER] = (int (*)(void *))(doSetLayer); ActionFunctions[ACTION_SET_LAYER] = (int (*)(void *))(doSetLayer);
ActionFunctions[ACTION_WARP_POINTER] = (int (*)(void *))(doWarpPointer); ActionFunctions[ACTION_WARP_POINTER] = (int (*)(void *))(doWarpPointer);
ActionFunctions[ACTION_MOVE_WINDOW_TO_AREA] = (int (*)(void *))(doMoveWinToArea); ActionFunctions[ACTION_MOVE_WINDOW_TO_AREA] =
ActionFunctions[ACTION_MOVE_WINDOW_BY_AREA] = (int (*)(void *))(doMoveWinByArea); (int (*)(void *))(doMoveWinToArea);
ActionFunctions[ACTION_SET_WINDOW_BORDER] = (int (*)(void *))(doSetWinBorder); ActionFunctions[ACTION_MOVE_WINDOW_BY_AREA] =
(int (*)(void *))(doMoveWinByArea);
ActionFunctions[ACTION_SET_WINDOW_BORDER] =
(int (*)(void *))(doSetWinBorder);
ActionFunctions[ACTION_LINEAR_AREA_SET] = (int (*)(void *))(doLinearAreaSet); ActionFunctions[ACTION_LINEAR_AREA_SET] = (int (*)(void *))(doLinearAreaSet);
ActionFunctions[ACTION_LINEAR_MOVE_BY] = (int (*)(void *))(doLinearAreaMoveBy); ActionFunctions[ACTION_LINEAR_MOVE_BY] =
(int (*)(void *))(doLinearAreaMoveBy);
ActionFunctions[ACTION_ABOUT] = (int (*)(void *))(doAbout); ActionFunctions[ACTION_ABOUT] = (int (*)(void *))(doAbout);
ActionFunctions[ACTION_FX] = (int (*)(void *))(doFX); ActionFunctions[ACTION_FX] = (int (*)(void *))(doFX);
ActionFunctions[ACTION_MOVE_WINDOW_TO_LINEAR_AREA] = (int (*)(void *))(doMoveWinToLinearArea); ActionFunctions[ACTION_MOVE_WINDOW_TO_LINEAR_AREA] =
ActionFunctions[ACTION_MOVE_WINDOW_BY_LINEAR_AREA] = (int (*)(void *))(doMoveWinByArea); (int (*)(void *))(doMoveWinToLinearArea);
ActionFunctions[ACTION_MOVE_WINDOW_BY_LINEAR_AREA] =
(int (*)(void *))(doMoveWinByArea);
ActionFunctions[ACTION_SET_PAGER_HIQ] = (int (*)(void *))(doSetPagerHiq); ActionFunctions[ACTION_SET_PAGER_HIQ] = (int (*)(void *))(doSetPagerHiq);
ActionFunctions[ACTION_SET_PAGER_SNAP] = (int (*)(void *))(doSetPagerSnap); ActionFunctions[ACTION_SET_PAGER_SNAP] = (int (*)(void *))(doSetPagerSnap);
ActionFunctions[ACTION_CONFIG] = (int (*)(void *))(doConfigure); ActionFunctions[ACTION_CONFIG] = (int (*)(void *))(doConfigure);
ActionFunctions[ACTION_MOVE_CONSTRAINED] = (int (*)(void *))(doMoveConstrained); ActionFunctions[ACTION_MOVE_CONSTRAINED] =
(int (*)(void *))(doMoveConstrained);
ActionFunctions[ACTION_INSERT_KEYS] = (int (*)(void *))(doInsertKeys); ActionFunctions[ACTION_INSERT_KEYS] = (int (*)(void *))(doInsertKeys);
ActionFunctions[ACTION_START_GROUP] = (int (*)(void *))(doStartGroup); ActionFunctions[ACTION_START_GROUP] = (int (*)(void *))(doStartGroup);
ActionFunctions[ACTION_ADD_TO_GROUP] = (int (*)(void *))(doAddToGroup); ActionFunctions[ACTION_ADD_TO_GROUP] = (int (*)(void *))(doAddToGroup);
ActionFunctions[ACTION_REMOVE_FROM_GROUP] = (int (*)(void *))(doRemoveFromGroup); ActionFunctions[ACTION_REMOVE_FROM_GROUP] =
(int (*)(void *))(doRemoveFromGroup);
ActionFunctions[ACTION_BREAK_GROUP] = (int (*)(void *))(doBreakGroup); ActionFunctions[ACTION_BREAK_GROUP] = (int (*)(void *))(doBreakGroup);
ActionFunctions[ACTION_SHOW_HIDE_GROUP] = (int (*)(void *))(doShowHideGroup); ActionFunctions[ACTION_SHOW_HIDE_GROUP] = (int (*)(void *))(doShowHideGroup);
ActionFunctions[ACTION_CREATE_ICONBOX] = (int (*)(void *))(doCreateIconbox); ActionFunctions[ACTION_CREATE_ICONBOX] = (int (*)(void *))(doCreateIconbox);
ActionFunctions[ACTION_RAISE_LOWER] = (int (*)(void *))(doRaiseLower); ActionFunctions[ACTION_RAISE_LOWER] = (int (*)(void *))(doRaiseLower);
ActionFunctions[ACTION_ZOOM] = (int (*)(void *))(doZoom); ActionFunctions[ACTION_ZOOM] = (int (*)(void *))(doZoom);
ActionFunctions[ACTION_SET_WINDOW_BORDER_NG] = (int (*)(void *))(doSetWinBorderNoGroup); ActionFunctions[ACTION_SET_WINDOW_BORDER_NG] =
ActionFunctions[ACTION_ICONIFY_NG] = (int (*)(void *))(doIconifyWindowNoGroup); (int (*)(void *))(doSetWinBorderNoGroup);
ActionFunctions[ACTION_ICONIFY_NG] =
(int (*)(void *))(doIconifyWindowNoGroup);
ActionFunctions[ACTION_KILL_NG] = (int (*)(void *))(doKillNoGroup); ActionFunctions[ACTION_KILL_NG] = (int (*)(void *))(doKillNoGroup);
ActionFunctions[ACTION_MOVE_NG] = (int (*)(void *))(doMoveNoGroup); ActionFunctions[ACTION_MOVE_NG] = (int (*)(void *))(doMoveNoGroup);
ActionFunctions[ACTION_RAISE_NG] = (int (*)(void *))(doRaiseNoGroup); ActionFunctions[ACTION_RAISE_NG] = (int (*)(void *))(doRaiseNoGroup);
ActionFunctions[ACTION_LOWER_NG] = (int (*)(void *))(doLowerNoGroup); ActionFunctions[ACTION_LOWER_NG] = (int (*)(void *))(doLowerNoGroup);
ActionFunctions[ACTION_STICK_NG] = (int (*)(void *))(doStickNoGroup); ActionFunctions[ACTION_STICK_NG] = (int (*)(void *))(doStickNoGroup);
ActionFunctions[ACTION_SHADE_NG] = (int (*)(void *))(doShadeNoGroup); ActionFunctions[ACTION_SHADE_NG] = (int (*)(void *))(doShadeNoGroup);
ActionFunctions[ACTION_RAISE_LOWER_NG] = (int (*)(void *))(doRaiseLowerNoGroup); ActionFunctions[ACTION_RAISE_LOWER_NG] =
(int (*)(void *))(doRaiseLowerNoGroup);
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }

View File

@ -42,7 +42,7 @@ int debug_level;
char *call_stack[1024]; char *call_stack[1024];
void void
Alert(char *fmt,...) Alert(char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list ap;
@ -175,13 +175,13 @@ ShowAlert(char *text)
str2 = RestartText; str2 = RestartText;
str3 = ExitText; str3 = ExitText;
if (!title) if (!title)
title = "Enlightenment Error"; title = gettext("Enlightenment Error");
if (!str1) if (!str1)
str1 = "Ignore"; str1 = gettext("Ignore");
if (!str2) if (!str2)
str2 = "Restart"; str2 = gettext("Restart");
if (!str3) if (!str3)
str3 = "Exit"; str3 = gettext("Exit");
#define DRAW_BOX_OUT(mdd, mgc, mwin, mx, my, mw, mh) \ #define DRAW_BOX_OUT(mdd, mgc, mwin, mx, my, mw, mh) \
if (colorful) { \ if (colorful) { \
@ -308,7 +308,9 @@ goto CN; \
hih = DisplayHeight(dd, DefaultScreen(dd)); hih = DisplayHeight(dd, DefaultScreen(dd));
w = (wid - 600) / 2; w = (wid - 600) / 2;
h = (hih - 440) / 2; h = (hih - 440) / 2;
mask = CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder | CWBackingStore; mask =
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder |
CWBackingStore;
if (colorful) if (colorful)
att.background_pixel = cols[1]; att.background_pixel = cols[1];
else else
@ -401,21 +403,24 @@ goto CN; \
h = XTextWidth(xfs, str1, strlen(str1)); h = XTextWidth(xfs, str1, strlen(str1));
w = 10 + (((580 - mh) * 0) / 4); w = 10 + (((580 - mh) * 0) / 4);
XMoveResizeWindow(dd, b1, w - 5, 440 - 15 - fh, mh + 10, fh + 10); XMoveResizeWindow(dd, b1, w - 5, 440 - 15 - fh, mh + 10, fh + 10);
XSelectInput(dd, b1, ButtonPressMask | ButtonReleaseMask | ExposureMask); XSelectInput(dd, b1,
ButtonPressMask | ButtonReleaseMask | ExposureMask);
} }
if (sscanf(str2, "%s", line) > 0) if (sscanf(str2, "%s", line) > 0)
{ {
h = XTextWidth(xfs, str2, strlen(str2)); h = XTextWidth(xfs, str2, strlen(str2));
w = 10 + (((580 - mh) * 1) / 2); w = 10 + (((580 - mh) * 1) / 2);
XMoveResizeWindow(dd, b2, w - 5, 440 - 15 - fh, mh + 10, fh + 10); XMoveResizeWindow(dd, b2, w - 5, 440 - 15 - fh, mh + 10, fh + 10);
XSelectInput(dd, b2, ButtonPressMask | ButtonReleaseMask | ExposureMask); XSelectInput(dd, b2,
ButtonPressMask | ButtonReleaseMask | ExposureMask);
} }
if (sscanf(str3, "%s", line) > 0) if (sscanf(str3, "%s", line) > 0)
{ {
h = XTextWidth(xfs, str3, strlen(str3)); h = XTextWidth(xfs, str3, strlen(str3));
w = 10 + (((580 - mh) * 2) / 2); w = 10 + (((580 - mh) * 2) / 2);
XMoveResizeWindow(dd, b3, w - 5, 440 - 15 - fh, mh + 10, fh + 10); XMoveResizeWindow(dd, b3, w - 5, 440 - 15 - fh, mh + 10, fh + 10);
XSelectInput(dd, b3, ButtonPressMask | ButtonReleaseMask | ExposureMask); XSelectInput(dd, b3,
ButtonPressMask | ButtonReleaseMask | ExposureMask);
} }
XSync(dd, False); XSync(dd, False);
XSelectInput(dd, win, KeyPressMask | KeyReleaseMask | ExposureMask); XSelectInput(dd, win, KeyPressMask | KeyReleaseMask | ExposureMask);

View File

@ -171,9 +171,9 @@ SlideWindowsBy(Window * win, int num, int dx, int dy, int speed)
int dsec, dusec; int dsec, dusec;
double tm; double tm;
struct _xy struct _xy
{ {
int x, y; int x, y;
} }
*xy; *xy;
EDBUG(5, "SlideWindowsBy"); EDBUG(5, "SlideWindowsBy");
@ -224,8 +224,7 @@ SetCurrentArea(int ax, int ay)
EDBUG(4, "SetCurrentArea"); EDBUG(4, "SetCurrentArea");
if ((mode.mode == MODE_RESIZE) || if ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V))
(mode.mode == MODE_RESIZE_V))
EDBUG_RETURN_; EDBUG_RETURN_;
AREA_FIX(ax, ay); AREA_FIX(ax, ay);
@ -257,15 +256,15 @@ SetCurrentArea(int ax, int ay)
if ((mode.mode == MODE_MOVE) && (mode.ewin) && (mode.movemode > 0) && if ((mode.mode == MODE_MOVE) && (mode.ewin) && (mode.movemode > 0) &&
(!mode.moveresize_pending_ewin)) (!mode.moveresize_pending_ewin))
{ {
lst = ListWinGroupMembersForEwin(mode.ewin, ACTION_MOVE, mode.nogroup, &num); lst =
ListWinGroupMembersForEwin(mode.ewin, ACTION_MOVE, mode.nogroup,
&num);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
x = lst[i]->x; x = lst[i]->x;
y = lst[i]->y; y = lst[i]->y;
DrawEwinShape(lst[i], mode.movemode, DrawEwinShape(lst[i], mode.movemode,
x, y, x, y, lst[i]->client.w, lst[i]->client.h, 3);
lst[i]->client.w, lst[i]->client.h,
3);
} }
Efree(lst); Efree(lst);
} }
@ -307,8 +306,12 @@ SetCurrentArea(int ax, int ay)
if (wl) if (wl)
{ {
SlideWindowsBy(wl, wnum, SlideWindowsBy(wl, wnum,
-(root.w * (ax - desks.desk[desks.current].current_area_x)), -(root.w *
-(root.h * (ay - desks.desk[desks.current].current_area_y)), (ax -
desks.desk[desks.current].current_area_x)),
-(root.h *
(ay -
desks.desk[desks.current].current_area_y)),
desks.slidespeed); desks.slidespeed);
Efree(wl); Efree(wl);
} }
@ -331,8 +334,16 @@ SetCurrentArea(int ax, int ay)
mode.flipp = 1; mode.flipp = 1;
} }
MoveEwin(lst[i], MoveEwin(lst[i],
lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)), lst[i]->x -
lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y))); (root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
if (setflip) if (setflip)
mode.flipp = 0; mode.flipp = 0;
lst[i]->area_x = a1; lst[i]->area_x = a1;
@ -360,8 +371,16 @@ SetCurrentArea(int ax, int ay)
{ {
GetWinXY(lst[i]->win, &x, &y); GetWinXY(lst[i]->win, &x, &y);
EMoveWindow(disp, lst[i]->win, EMoveWindow(disp, lst[i]->win,
x - (root.w * (ax - desks.desk[desks.current].current_area_x)), x -
y - (root.h * (ay - desks.desk[desks.current].current_area_y))); (root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
} }
} }
/* if we're not moving it... move it across */ /* if we're not moving it... move it across */
@ -377,8 +396,16 @@ SetCurrentArea(int ax, int ay)
mode.flipp = 1; mode.flipp = 1;
} }
MoveEwin(lst[i], MoveEwin(lst[i],
lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)), lst[i]->x -
lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y))); (root.w *
(ax -
desks.desk[desks.current].
current_area_x)),
lst[i]->y -
(root.h *
(ay -
desks.desk[desks.current].
current_area_y)));
if (setflip) if (setflip)
mode.flipp = 0; mode.flipp = 0;
lst[i]->area_x = a1; lst[i]->area_x = a1;
@ -422,12 +449,12 @@ SetCurrentArea(int ax, int ay)
if (mode.movemode == 5) if (mode.movemode == 5)
DrawEwinShape(lst[i], mode.movemode, DrawEwinShape(lst[i], mode.movemode,
x, y, x, y,
lst[i]->client.w, lst[i]->client.h, lst[i]->client.w, lst[i]->client.h,
4); 4);
else else
DrawEwinShape(lst[i], mode.movemode, DrawEwinShape(lst[i], mode.movemode,
x, y, x, y,
lst[i]->client.w, lst[i]->client.h, lst[i]->client.w, lst[i]->client.h,
0); 0);
if (mode.flipp) if (mode.flipp)
{ {

View File

@ -210,11 +210,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (sorted[j].x < width) if (sorted[j].x < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x); xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x);
if ((sorted[j].x + sorted[j].w) < width) if ((sorted[j].x + sorted[j].w) < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); xsize =
ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w);
if (sorted[j].y < height) if (sorted[j].y < height)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y); ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y);
if ((sorted[j].y + sorted[j].h) < height) if ((sorted[j].y + sorted[j].h) < height)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); ysize =
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
} }
/* fill the allocation array */ /* fill the allocation array */
for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0);
@ -250,7 +252,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
{ {
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
{ {
if (filled[(y * (xsize - 1)) + x] < (sorted[j].p + 1)) if (filled[(y * (xsize - 1)) + x] <
(sorted[j].p + 1))
filled[(y * (xsize - 1)) + x] = sorted[j].p + 1; filled[(y * (xsize - 1)) + x] = sorted[j].p + 1;
} }
} }
@ -355,11 +358,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (a1 >= 0) if (a1 >= 0)
sorted[num_sorted].x = spaces[k].x; sorted[num_sorted].x = spaces[k].x;
else else
sorted[num_sorted].x = spaces[k].x + spaces[k].w - floating[i].w; sorted[num_sorted].x =
spaces[k].x + spaces[k].w - floating[i].w;
if (a2 >= 0) if (a2 >= 0)
sorted[num_sorted].y = spaces[k].y; sorted[num_sorted].y = spaces[k].y;
else else
sorted[num_sorted].y = spaces[k].y + spaces[k].h - floating[i].h; sorted[num_sorted].y =
spaces[k].y + spaces[k].h - floating[i].h;
} }
else else
{ {
@ -391,11 +396,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (sorted[j].x < width) if (sorted[j].x < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x); xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x);
if ((sorted[j].x + sorted[j].w) < width) if ((sorted[j].x + sorted[j].w) < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w); xsize =
ArrangeAddToList(&xarray, xsize, sorted[j].x + sorted[j].w);
if (sorted[j].y < height) if (sorted[j].y < height)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y); ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y);
if ((sorted[j].y + sorted[j].h) < height) if ((sorted[j].y + sorted[j].h) < height)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); ysize =
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
} }
/* fill the allocation array */ /* fill the allocation array */
for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0);
@ -431,7 +438,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
{ {
for (x = x1; x <= x2; x++) for (x = x1; x <= x2; x++)
{ {
if (filled[(y * (xsize - 1)) + x] < (sorted[j].p + 1)) if (filled[(y * (xsize - 1)) + x] <
(sorted[j].p + 1))
filled[(y * (xsize - 1)) + x] = sorted[j].p + 1; filled[(y * (xsize - 1)) + x] = sorted[j].p + 1;
} }
} }
@ -609,8 +617,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
ody = dy; ody = dy;
if (dx < 0) if (dx < 0)
{ {
if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist) if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist) && (ewin->x >= 0))
&& (ewin->x >= 0))
dx = 0 - ewin->x; dx = 0 - ewin->x;
else if (lst) else if (lst)
{ {
@ -621,12 +628,13 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
if (((ewin->desktop == lst[i]->desktop) || if (((ewin->desktop == lst[i]->desktop) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(!(lst[i]->iconified)) && (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
(!(lst[i]->ignorearrange)))
{ {
if (IN_BELOW(ewin->x + dx, lst[i]->x + lst[i]->w - 1, if (IN_BELOW
mode.edge_snap_dist) && (ewin->x + dx, lst[i]->x + lst[i]->w - 1,
SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) mode.edge_snap_dist)
&& SPANS_COMMON(ewin->y, ewin->h, lst[i]->y,
lst[i]->h)
&& (ewin->x >= (lst[i]->x + lst[i]->w))) && (ewin->x >= (lst[i]->x + lst[i]->w)))
{ {
dx = (lst[i]->x + lst[i]->w) - ewin->x; dx = (lst[i]->x + lst[i]->w) - ewin->x;
@ -653,12 +661,12 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
if (((ewin->desktop == lst[i]->desktop) || if (((ewin->desktop == lst[i]->desktop) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(!(lst[i]->iconified)) && (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
(!(lst[i]->ignorearrange)))
{ {
if (IN_ABOVE(ewin->x + ewin->w + dx - 1, lst[i]->x, if (IN_ABOVE(ewin->x + ewin->w + dx - 1, lst[i]->x,
mode.edge_snap_dist) && mode.edge_snap_dist) &&
SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h) SPANS_COMMON(ewin->y, ewin->h, lst[i]->y,
lst[i]->h)
&& ((ewin->x + ewin->w) <= lst[i]->x)) && ((ewin->x + ewin->w) <= lst[i]->x))
{ {
dx = lst[i]->x - (ewin->x + ewin->w); dx = lst[i]->x - (ewin->x + ewin->w);
@ -673,8 +681,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
} }
if (dy < 0) if (dy < 0)
{ {
if (IN_BELOW(ewin->y + dy, 0, screen_snap_dist) if (IN_BELOW(ewin->y + dy, 0, screen_snap_dist) && (ewin->y >= 0))
&& (ewin->y >= 0))
dy = 0 - ewin->y; dy = 0 - ewin->y;
else if (lst) else if (lst)
{ {
@ -685,12 +692,13 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
if (((ewin->desktop == lst[i]->desktop) || if (((ewin->desktop == lst[i]->desktop) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(!(lst[i]->iconified)) && (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
(!(lst[i]->ignorearrange)))
{ {
if (IN_BELOW(ewin->y + dy, lst[i]->y + lst[i]->h - 1, if (IN_BELOW
mode.edge_snap_dist) && (ewin->y + dy, lst[i]->y + lst[i]->h - 1,
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) mode.edge_snap_dist)
&& SPANS_COMMON(ewin->x, ewin->w, lst[i]->x,
lst[i]->w)
&& (ewin->y >= (lst[i]->y + lst[i]->h))) && (ewin->y >= (lst[i]->y + lst[i]->h)))
{ {
dy = (lst[i]->y + lst[i]->h) - ewin->y; dy = (lst[i]->y + lst[i]->h) - ewin->y;
@ -717,12 +725,12 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
if (((ewin->desktop == lst[i]->desktop) || if (((ewin->desktop == lst[i]->desktop) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(!(lst[i]->iconified)) && (!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
(!(lst[i]->ignorearrange)))
{ {
if (IN_ABOVE(ewin->y + ewin->h + dy - 1, lst[i]->y, if (IN_ABOVE(ewin->y + ewin->h + dy - 1, lst[i]->y,
mode.edge_snap_dist) && mode.edge_snap_dist) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w) SPANS_COMMON(ewin->x, ewin->w, lst[i]->x,
lst[i]->w)
&& ((ewin->y + ewin->h) <= lst[i]->y)) && ((ewin->y + ewin->h) <= lst[i]->y))
{ {
dy = lst[i]->y - (ewin->y + ewin->h); dy = lst[i]->y - (ewin->y + ewin->h);
@ -773,10 +781,11 @@ ArrangeEwin(EWin * ewin)
{ {
if ((lst[i] != ewin) && (!lst[i]->iconified) && if ((lst[i] != ewin) && (!lst[i]->iconified) &&
(!lst[i]->ignorearrange) && (lst[i]->layer != 0) && (!lst[i]->ignorearrange) && (lst[i]->layer != 0) &&
(((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) && (((lst
(lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) && [i]->area_x == desks.desk[ewin->desktop].current_area_x)
(lst[i]->desktop == ewin->desktop)) || && (lst[i]->area_y ==
(lst[i]->sticky))) desks.desk[ewin->desktop].current_area_y)
&& (lst[i]->desktop == ewin->desktop)) || (lst[i]->sticky)))
{ {
fixed[j].data = lst[i]; fixed[j].data = lst[i];
fixed[j].x = (lst[i])->x; fixed[j].x = (lst[i])->x;

View File

@ -29,11 +29,11 @@
#define ARRANGE_BY_POSITION 2 #define ARRANGE_BY_POSITION 2
typedef struct _rectbox typedef struct _rectbox
{ {
void *data; void *data;
int x, y, w, h; int x, y, w, h;
int p; int p;
} }
RectBox; RectBox;
void ArrangeRects(RectBox * fixed, int fixed_count, void ArrangeRects(RectBox * fixed, int fixed_count,

View File

@ -40,11 +40,7 @@ AtomGet(Window win, Atom to_get, Atom type, int *size)
XGetWindowProperty(disp, win, to_get, 0, XGetWindowProperty(disp, win, to_get, 0,
length, length,
False, type, False, type,
&type_ret, &type_ret, &format_ret, &num_ret, &bytes_after, &retval);
&format_ret,
&num_ret,
&bytes_after,
&retval);
if ((retval) && (num_ret > 0) && (format_ret > 0)) if ((retval) && (num_ret > 0) && (format_ret > 0))
{ {
if (format_ret == 32) if (format_ret == 32)

View File

@ -85,23 +85,20 @@ DetermineEwinFloat(EWin * ewin, int dx, int dy)
((ewin->x + dx + ewin->w <= root.w) && ((ewin->x + dx + ewin->w <= root.w) &&
((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx + ((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx +
ewin->w - 1, ewin->w - 1,
desks.desk[ewin->desktop].y) desks.desk[ewin->desktop].y) != ewin->desktop))))))
!= ewin->desktop))))))
dofloat = 1; dofloat = 1;
if ((desks.dragdir == 1) && if ((desks.dragdir == 1) &&
(((ewin->x + dx + ewin->w > root.w) || (((ewin->x + dx + ewin->w > root.w) ||
((ewin->x + dx >= 0) && ((ewin->x + dx >= 0) &&
((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx, ((DesktopAt(desks.desk[ewin->desktop].x + ewin->x + dx,
desks.desk[ewin->desktop].y) desks.desk[ewin->desktop].y) != ewin->desktop))))))
!= ewin->desktop))))))
dofloat = 1; dofloat = 1;
if ((desks.dragdir == 2) && if ((desks.dragdir == 2) &&
(((ewin->y + dy < 0) || (((ewin->y + dy < 0) ||
((ewin->y + dy + ewin->h <= root.h) && ((ewin->y + dy + ewin->h <= root.h) &&
((DesktopAt(desks.desk[ewin->desktop].x, ((DesktopAt(desks.desk[ewin->desktop].x,
desks.desk[ewin->desktop].y + ewin->y + dy + desks.desk[ewin->desktop].y + ewin->y + dy +
ewin->h - 1) ewin->h - 1) != ewin->desktop))))))
!= ewin->desktop))))))
dofloat = 1; dofloat = 1;
if ((desks.dragdir == 3) && if ((desks.dragdir == 3) &&
(((ewin->y + dy + ewin->h > root.h) || (((ewin->y + dy + ewin->h > root.h) ||
@ -239,7 +236,8 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
if (mode.slidemode == 0) if (mode.slidemode == 0)
EMoveWindow(disp, ewin->win, tmpx, tmpy); EMoveWindow(disp, ewin->win, tmpx, tmpy);
else else
DrawEwinShape(ewin, mode.slidemode, tmpx, tmpy, tmpw, tmph, firstlast); DrawEwinShape(ewin, mode.slidemode, tmpx, tmpy, tmpw, tmph,
firstlast);
if (firstlast == 0) if (firstlast == 0)
firstlast = 1; firstlast = 1;
XSync(disp, False); XSync(disp, False);
@ -256,8 +254,7 @@ SlideEwinTo(EWin * ewin, int fx, int fy, int tx, int ty, int speed)
if (spd < min) if (spd < min)
spd = min; spd = min;
} }
DrawEwinShape(ewin, mode.slidemode, x, y, ewin->client.w, DrawEwinShape(ewin, mode.slidemode, x, y, ewin->client.w, ewin->client.h, 2);
ewin->client.h, 2);
MoveEwin(ewin, tx, ty); MoveEwin(ewin, tx, ty);
mode.doingslide = 0; mode.doingslide = 0;
if (mode.slidemode > 0) if (mode.slidemode > 0)
@ -272,7 +269,7 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty,
int num_wins, int speed) int num_wins, int speed)
{ {
int k, spd, *x = NULL, *y = NULL, min, tmpx, tmpy, tmpw, int k, spd, *x = NULL, *y = NULL, min, tmpx, tmpy, tmpw,
tmph, i; tmph, i;
struct timeval timev1, timev2; struct timeval timev1, timev2;
int dsec, dusec; int dsec, dusec;
double tm; double tm;
@ -309,7 +306,8 @@ SlideEwinsTo(EWin ** ewin, int *fx, int *fy, int *tx, int *ty,
if (ewin[i]->menu) if (ewin[i]->menu)
EMoveWindow(disp, ewin[i]->win, tmpx, tmpy); EMoveWindow(disp, ewin[i]->win, tmpx, tmpy);
else else
DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph, firstlast); DrawEwinShape(ewin[i], 0, tmpx, tmpy, tmpw, tmph,
firstlast);
if (firstlast == 0) if (firstlast == 0)
firstlast = 1; firstlast = 1;
XSync(disp, False); XSync(disp, False);
@ -421,8 +419,7 @@ AddToFamily(Window win)
if (ewin2) if (ewin2)
ewin2->has_transients++; ewin2->has_transients++;
} }
if ((mode.transientsfollowleader) && if ((mode.transientsfollowleader) && (ewin->client.transient))
(ewin->client.transient))
{ {
ewin2 = FindItem(NULL, ewin->client.transient_for, LIST_FINDBY_ID, ewin2 = FindItem(NULL, ewin->client.transient_for, LIST_FINDBY_ID,
LIST_TYPE_EWIN); LIST_TYPE_EWIN);
@ -430,8 +427,7 @@ AddToFamily(Window win)
{ {
ewin->desktop = ewin2->desktop; ewin->desktop = ewin2->desktop;
if ((mode.switchfortransientmap) && if ((mode.switchfortransientmap) &&
(ewin->desktop != desks.current) && (ewin->desktop != desks.current) && (!ewin->iconified))
(!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(ewin2->area_x, ewin2->area_y); SetCurrentArea(ewin2->area_x, ewin2->area_y);
@ -445,8 +441,7 @@ AddToFamily(Window win)
{ {
ewin->desktop = ewin2->desktop; ewin->desktop = ewin2->desktop;
if ((mode.switchfortransientmap) && if ((mode.switchfortransientmap) &&
(ewin->desktop != desks.current) && (ewin->desktop != desks.current) && (!ewin->iconified))
(!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(ewin2->area_x, ewin2->area_y); SetCurrentArea(ewin2->area_x, ewin2->area_y);
@ -468,7 +463,8 @@ AddToFamily(Window win)
(!ewin->iconified)) (!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(lst[i]->area_x, lst[i]->area_y); SetCurrentArea(lst[i]->area_x,
lst[i]->area_y);
} }
i = num; i = num;
} }
@ -515,10 +511,13 @@ AddToFamily(Window win)
{ {
if ((lst[i] != ewin) && (!lst[i]->iconified) && if ((lst[i] != ewin) && (!lst[i]->iconified) &&
(!lst[i]->ignorearrange) && (lst[i]->layer != 0) && (!lst[i]->ignorearrange) && (lst[i]->layer != 0) &&
(((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) && (((lst
(lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) && [i]->area_x ==
(lst[i]->desktop == ewin->desktop)) || desks.desk[ewin->desktop].current_area_x)
(lst[i]->sticky))) && (lst[i]->area_y ==
desks.desk[ewin->desktop].current_area_y)
&& (lst[i]->desktop == ewin->desktop))
|| (lst[i]->sticky)))
{ {
fixed[j].data = lst[i]; fixed[j].data = lst[i];
fixed[j].x = (lst[i])->x; fixed[j].x = (lst[i])->x;
@ -637,35 +636,39 @@ AddToFamily(Window win)
switch (ewin->client.grav) switch (ewin->client.grav)
{ {
case NorthWestGravity: case NorthWestGravity:
x += (ewin->client.bw * 2);
y += (ewin->client.bw * 2);
break; break;
case NorthGravity: case NorthGravity:
if (ewin->border) y += (ewin->client.bw * 2);
y -= ewin->border->border.top + 2;
break; break;
case NorthEastGravity: case NorthEastGravity:
y += (ewin->client.bw * 2);
if (ewin->border) if (ewin->border)
x -= ewin->border->border.left + 2; x -= ewin->border->border.left + (ewin->client.bw * 2);
break; break;
case EastGravity: case EastGravity:
if (ewin->border) if (ewin->border)
x -= ewin->border->border.left + 2; x -= ewin->border->border.left + (ewin->client.bw * 2);
break; break;
case SouthEastGravity: case SouthEastGravity:
if (ewin->border) if (ewin->border)
{ {
x -= ewin->border->border.left + 2; x -= ewin->border->border.left + (ewin->client.bw * 2);
y -= ewin->border->border.top + 2; y -= ewin->border->border.top + (ewin->client.bw * 2);
} }
break; break;
case SouthGravity: case SouthGravity:
if (ewin->border) if (ewin->border)
y -= ewin->border->border.top + 2; y -= ewin->border->border.top + (ewin->client.bw * 2);
break; break;
case SouthWestGravity: case SouthWestGravity:
x += (ewin->client.bw * 2);
if (ewin->border) if (ewin->border)
y -= ewin->border->border.top + 2; y -= ewin->border->border.top + (ewin->client.bw * 2);
break; break;
case WestGravity: case WestGravity:
x += (ewin->client.bw * 2);
break; break;
case CenterGravity: case CenterGravity:
break; break;
@ -826,8 +829,7 @@ AddToFamily(Window win)
if (mode.all_new_windows_get_focus) if (mode.all_new_windows_get_focus)
{ {
FocusToEWin(ewin); FocusToEWin(ewin);
if ((ewin->desktop != desks.current) && if ((ewin->desktop != desks.current) && (!ewin->iconified))
(!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(ewin->area_x, ewin->area_y); SetCurrentArea(ewin->area_x, ewin->area_y);
@ -838,8 +840,7 @@ AddToFamily(Window win)
if (ewin->client.transient) if (ewin->client.transient)
{ {
FocusToEWin(ewin); FocusToEWin(ewin);
if ((ewin->desktop != desks.current) && if ((ewin->desktop != desks.current) && (!ewin->iconified))
(!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(ewin->area_x, ewin->area_y); SetCurrentArea(ewin->area_x, ewin->area_y);
@ -853,8 +854,7 @@ AddToFamily(Window win)
if ((ewin2) && (mode.focuswin == ewin2)) if ((ewin2) && (mode.focuswin == ewin2))
{ {
FocusToEWin(ewin); FocusToEWin(ewin);
if ((ewin->desktop != desks.current) && if ((ewin->desktop != desks.current) && (!ewin->iconified))
(!ewin->iconified))
{ {
GotoDesktop(ewin->desktop); GotoDesktop(ewin->desktop);
SetCurrentArea(ewin->area_x, ewin->area_y); SetCurrentArea(ewin->area_x, ewin->area_y);
@ -1030,13 +1030,13 @@ DrawEwinWinpart(EWin * ewin, int i)
{ {
state = ewin->bits[i].state; state = ewin->bits[i].state;
IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active,
ewin->bits[i].expose); ewin->sticky, state, ewin->bits[i].expose);
if (ewin->border->part[i].flags == FLAG_TITLE) if (ewin->border->part[i].flags == FLAG_TITLE)
TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, ewin->bits[i].w, ewin->bits[i].h, ewin->active,
state, ewin->bits[i].expose, ewin->border->part[i].tclass, ewin->sticky, state, ewin->bits[i].expose,
ewin->client.title); ewin->border->part[i].tclass, ewin->client.title);
ret = 1; ret = 1;
} }
if ((move) || (resize)) if ((move) || (resize))
@ -1059,12 +1059,12 @@ ChangeEwinWinpart(EWin * ewin, int i)
EDBUG(3, "ChangeEwinWinpart"); EDBUG(3, "ChangeEwinWinpart");
state = ewin->bits[i].state; state = ewin->bits[i].state;
IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky,
ewin->bits[i].expose); state, ewin->bits[i].expose);
if (ewin->border->part[i].flags == FLAG_TITLE) if (ewin->border->part[i].flags == FLAG_TITLE)
TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky,
ewin->bits[i].expose, ewin->border->part[i].tclass, state, ewin->bits[i].expose, ewin->border->part[i].tclass,
ewin->client.title); ewin->client.title);
if (ewin->bits[i].win) if (ewin->bits[i].win)
ChangeEwinWinpartContents(ewin, i); ChangeEwinWinpartContents(ewin, i);
@ -1093,13 +1093,13 @@ DrawEwin(EWin * ewin)
{ {
state = ewin->bits[i].state; state = ewin->bits[i].state;
IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, IclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active,
ewin->bits[i].expose); ewin->sticky, state, ewin->bits[i].expose);
if (ewin->border->part[i].flags == FLAG_TITLE) if (ewin->border->part[i].flags == FLAG_TITLE)
TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active,
ewin->bits[i].expose, ewin->border->part[i].tclass, ewin->sticky, state, ewin->bits[i].expose,
ewin->client.title); ewin->border->part[i].tclass, ewin->client.title);
} }
if (!ewin->shapedone) if (!ewin->shapedone)
PropagateShapes(ewin->win); PropagateShapes(ewin->win);
@ -1123,9 +1123,9 @@ ChangeEwinWinpartContents(EWin * ewin, int i)
{ {
case FLAG_TITLE: case FLAG_TITLE:
TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win, TclassApply(ewin->border->part[i].iclass, ewin->bits[i].win,
ewin->bits[i].w, ewin->bits[i].h, ewin->active, ewin->sticky, state, ewin->bits[i].w, ewin->bits[i].h, ewin->active,
ewin->bits[i].expose, ewin->border->part[i].tclass, ewin->sticky, state, ewin->bits[i].expose,
ewin->client.title); ewin->border->part[i].tclass, ewin->client.title);
break; break;
case FLAG_MINIICON: case FLAG_MINIICON:
break; break;
@ -1170,9 +1170,13 @@ CalcEwinWinpart(EWin * ewin, int i)
ox = oy = 0; ox = oy = 0;
if (bottomright == -1) if (bottomright == -1)
{ {
ox = ((ewin->border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) + ox =
((ewin->
border->part[i].geom.bottomright.x.percent * ewin->w) >> 10) +
ewin->border->part[i].geom.bottomright.x.absolute; ewin->border->part[i].geom.bottomright.x.absolute;
oy = ((ewin->border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) + oy =
((ewin->
border->part[i].geom.bottomright.y.percent * ewin->h) >> 10) +
ewin->border->part[i].geom.bottomright.y.absolute; ewin->border->part[i].geom.bottomright.y.absolute;
} }
else if (bottomright >= 0) else if (bottomright >= 0)
@ -1224,15 +1228,9 @@ CalcEwinWinpart(EWin * ewin, int i)
iclass = ewin->border->part[i].iclass; iclass = ewin->border->part[i].iclass;
tclass = ewin->border->part[i].tclass; tclass = ewin->border->part[i].tclass;
TextSize(tclass, \ TextSize(tclass, \ewin->active, \ewin->sticky, \ewin->bits[i].state,
ewin->active, \ \ewin->client.title, \&max, \&dummyheight,
ewin->sticky, \ \h - (iclass->padding.top + iclass->padding.bottom) \);
ewin->bits[i].state, \
ewin->client.title, \
&max, \
&dummyheight, \
h - (iclass->padding.top + iclass->padding.bottom) \
);
max += iclass->padding.left + iclass->padding.right; max += iclass->padding.left + iclass->padding.right;
if (w > max) if (w > max)
@ -1376,8 +1374,10 @@ AdoptInternal(Window win, Border * border, int type, void *ptr)
* else */ * else */
if (!border) if (!border)
{ {
b = MatchEwinByFunction(ewin, (void *(*)(EWin *, WindowMatch *)) b =
MatchEwinBorder); MatchEwinByFunction(ewin,
(void
*(*)(EWin *, WindowMatch *))MatchEwinBorder);
if (b) if (b)
{ {
ewin->border = b; ewin->border = b;
@ -1539,8 +1539,7 @@ CreateEwin()
EMapWindow(disp, ewin->win_container); EMapWindow(disp, ewin->win_container);
if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK)) if ((mode.clickalways) || (mode.focusmode == FOCUS_CLICK))
XGrabButton(disp, AnyButton, 0, ewin->win_container, False, XGrabButton(disp, AnyButton, 0, ewin->win_container, False,
ButtonPressMask, ButtonPressMask, GrabModeSync, GrabModeAsync, None, None);
GrabModeSync, GrabModeAsync, None, None);
att.event_mask = att.event_mask =
StructureNotifyMask | PointerMotionMask | StructureNotifyMask | PointerMotionMask |
ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask;
@ -1683,8 +1682,7 @@ SetEwinBorder(EWin * ewin)
b = (Border *) FindItem("BORDERLESS", 0, LIST_FINDBY_NAME, b = (Border *) FindItem("BORDERLESS", 0, LIST_FINDBY_NAME,
LIST_TYPE_BORDER); LIST_TYPE_BORDER);
if (!b) if (!b)
b = (Border *) FindItem("DEFAULT", 0, LIST_FINDBY_NAME, b = (Border *) FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
LIST_TYPE_BORDER);
ewin->border = b; ewin->border = b;
SetFrameProperty(ewin); SetFrameProperty(ewin);
EDBUG_RETURN_; EDBUG_RETURN_;
@ -1701,8 +1699,7 @@ SetEwinToBorder(EWin * ewin, Border * b)
EDBUG(4, "SetEwinToBorder"); EDBUG(4, "SetEwinToBorder");
if (!b) if (!b)
b = FindItem("__FALLBACK_BORDER", 0, b = FindItem("__FALLBACK_BORDER", 0, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if ((!b) || (ewin->border == b) || (!ewin->border_new)) if ((!b) || (ewin->border == b) || (!ewin->border_new))
EDBUG_RETURN_; EDBUG_RETURN_;
@ -1744,8 +1741,7 @@ SetEwinToBorder(EWin * ewin, Border * b)
if (await->iclass) if (await->iclass)
await->iclass->ref_count++; await->iclass->ref_count++;
AddItem(await, b->part[i].iclass->name, 0, AddItem(await, b->part[i].iclass->name, 0, LIST_TYPE_AWAIT_ICLASS);
LIST_TYPE_AWAIT_ICLASS);
} }
else else
{ {
@ -1775,8 +1771,7 @@ SetEwinToBorder(EWin * ewin, Border * b)
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask |
EnterWindowMask | EnterWindowMask |
LeaveWindowMask | LeaveWindowMask | PointerMotionMask);
PointerMotionMask);
} }
else else
{ {
@ -1786,8 +1781,7 @@ SetEwinToBorder(EWin * ewin, Border * b)
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask |
EnterWindowMask | EnterWindowMask |
LeaveWindowMask | LeaveWindowMask | PointerMotionMask);
PointerMotionMask);
} }
ewin->bits[i].x = -10; ewin->bits[i].x = -10;
ewin->bits[i].y = -10; ewin->bits[i].y = -10;
@ -1881,9 +1875,11 @@ DetermineEwinArea(EWin * ewin)
pax = ewin->area_x; pax = ewin->area_x;
pay = ewin->area_y; pay = ewin->area_y;
ewin->area_x = (ewin->x + (ewin->w / 2) + ewin->area_x = (ewin->x + (ewin->w / 2) +
(desks.desk[ewin->desktop].current_area_x * root.w)) / root.w; (desks.desk[ewin->desktop].current_area_x * root.w)) /
ewin->area_y = (ewin->y + (ewin->h / 2) + root.w;
(desks.desk[ewin->desktop].current_area_y * root.h)) / root.h; ewin->area_y =
(ewin->y + (ewin->h / 2) +
(desks.desk[ewin->desktop].current_area_y * root.h)) / root.h;
if ((pax != ewin->area_x) || (pay != ewin->area_y)) if ((pax != ewin->area_x) || (pay != ewin->area_y))
{ {
GNOME_SetEwinArea(ewin); GNOME_SetEwinArea(ewin);
@ -2206,8 +2202,7 @@ RestackEwin(EWin * ewin)
for (i = 0; i < bnum; i++) for (i = 0; i < bnum; i++)
{ {
if ((blst[i]->desktop == ewin->desktop) && if ((blst[i]->desktop == ewin->desktop) &&
(blst[i]->ontop == -1) && (blst[i]->ontop == -1) && (!blst[i]->sticky))
(!blst[i]->sticky))
{ {
tot++; tot++;
wl = Erealloc(wl, tot * sizeof(Window)); wl = Erealloc(wl, tot * sizeof(Window));
@ -2532,12 +2527,16 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
{ {
if (ewin->border->part[i].keep_for_shade) if (ewin->border->part[i].keep_for_shade)
{ {
if (ewin->border->border.left - ewin->bits[i].x > leftborderwidth) if (ewin->border->border.left - ewin->bits[i].x >
leftborderwidth = ewin->border->border.left - ewin->bits[i].x; leftborderwidth)
leftborderwidth =
ewin->border->border.left - ewin->bits[i].x;
if ((ewin->bits[i].x + ewin->bits[i].w) - if ((ewin->bits[i].x + ewin->bits[i].w) -
(ewin->w - ewin->border->border.right) > rightborderwidth) (ewin->w - ewin->border->border.right) > rightborderwidth)
rightborderwidth = (ewin->bits[i].x + ewin->bits[i].w) - rightborderwidth =
(ewin->w - ewin->border->border.right); (ewin->bits[i].x + ewin->bits[i].w) - (ewin->w -
ewin->border->
border.right);
} }
} }
ewin->w = rightborderwidth + leftborderwidth; ewin->w = rightborderwidth + leftborderwidth;
@ -2554,12 +2553,17 @@ MinShadeSize(EWin * ewin, int *mw, int *mh)
{ {
if (ewin->border->part[i].keep_for_shade) if (ewin->border->part[i].keep_for_shade)
{ {
if (ewin->border->border.top - ewin->bits[i].y > topborderwidth) if (ewin->border->border.top - ewin->bits[i].y >
topborderwidth = ewin->border->border.top - ewin->bits[i].y; topborderwidth)
topborderwidth =
ewin->border->border.top - ewin->bits[i].y;
if ((ewin->bits[i].y + ewin->bits[i].h) - if ((ewin->bits[i].y + ewin->bits[i].h) -
(ewin->h - ewin->border->border.bottom) > bottomborderwidth) (ewin->h - ewin->border->border.bottom) >
bottomborderwidth = (ewin->bits[i].y + ewin->bits[i].h) - bottomborderwidth)
(ewin->h - ewin->border->border.bottom); bottomborderwidth =
(ewin->bits[i].y + ewin->bits[i].h) - (ewin->h -
ewin->border->
border.bottom);
} }
} }
ewin->h = bottomborderwidth + topborderwidth; ewin->h = bottomborderwidth + topborderwidth;
@ -2584,8 +2588,7 @@ InstantShadeEwin(EWin * ewin)
if ((ewin->border->border.left == 0) && if ((ewin->border->border.left == 0) &&
(ewin->border->border.right == 0) && (ewin->border->border.right == 0) &&
(ewin->border->border.top == 0) && (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0))
(ewin->border->border.bottom == 0))
EDBUG_RETURN_; EDBUG_RETURN_;
if (GetZoomEWin() == ewin) if (GetZoomEWin() == ewin)
EDBUG_RETURN_; EDBUG_RETURN_;
@ -2601,8 +2604,7 @@ InstantShadeEwin(EWin * ewin)
MinShadeSize(ewin, &b, &d); MinShadeSize(ewin, &b, &d);
ewin->shaded = 2; ewin->shaded = 2;
ewin->w = b; ewin->w = b;
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
@ -2616,8 +2618,7 @@ InstantShadeEwin(EWin * ewin)
ewin->w = b; ewin->w = b;
ewin->x = d; ewin->x = d;
ewin->reqx = d; ewin->reqx = d;
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
@ -2629,8 +2630,7 @@ InstantShadeEwin(EWin * ewin)
b = d; b = d;
ewin->shaded = 2; ewin->shaded = 2;
ewin->h = b; ewin->h = b;
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
@ -2645,8 +2645,7 @@ InstantShadeEwin(EWin * ewin)
ewin->h = b; ewin->h = b;
ewin->y = d; ewin->y = d;
ewin->reqy = d; ewin->reqy = d;
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
@ -2688,8 +2687,7 @@ InstantUnShadeEwin(EWin * ewin)
ewin->border->border.right; ewin->border->border.right;
ewin->shaded = 0; ewin->shaded = 0;
ewin->w = b; ewin->w = b;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 1: case 1:
@ -2698,14 +2696,12 @@ InstantUnShadeEwin(EWin * ewin)
b = ewin->client.w + ewin->border->border.left + b = ewin->client.w + ewin->border->border.left +
ewin->border->border.right; ewin->border->border.right;
d = ewin->x + ewin->w - (ewin->border->border.right d = ewin->x + ewin->w - (ewin->border->border.right
+ ewin->client.w + ewin->client.w + ewin->border->border.left);
+ ewin->border->border.left);
ewin->shaded = 0; ewin->shaded = 0;
ewin->w = b; ewin->w = b;
ewin->x = d; ewin->x = d;
ewin->reqx = d; ewin->reqx = d;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 2: case 2:
@ -2715,8 +2711,7 @@ InstantUnShadeEwin(EWin * ewin)
ewin->border->border.bottom; ewin->border->border.bottom;
ewin->shaded = 0; ewin->shaded = 0;
ewin->h = b; ewin->h = b;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 3: case 3:
@ -2725,14 +2720,12 @@ InstantUnShadeEwin(EWin * ewin)
b = ewin->client.h + ewin->border->border.top + b = ewin->client.h + ewin->border->border.top +
ewin->border->border.bottom; ewin->border->border.bottom;
d = ewin->y + ewin->h - (ewin->border->border.bottom d = ewin->y + ewin->h - (ewin->border->border.bottom
+ ewin->client.h + ewin->client.h + ewin->border->border.top);
+ ewin->border->border.top);
ewin->shaded = 0; ewin->shaded = 0;
ewin->h = b; ewin->h = b;
ewin->y = d; ewin->y = d;
ewin->reqy = d; ewin->reqy = d;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
default: default:
@ -2764,8 +2757,7 @@ ShadeEwin(EWin * ewin)
if ((ewin->border->border.left == 0) && if ((ewin->border->border.left == 0) &&
(ewin->border->border.right == 0) && (ewin->border->border.right == 0) &&
(ewin->border->border.top == 0) && (ewin->border->border.top == 0) && (ewin->border->border.bottom == 0))
(ewin->border->border.bottom == 0))
EDBUG_RETURN_; EDBUG_RETURN_;
if (GetZoomEWin() == ewin) if (GetZoomEWin() == ewin)
EDBUG_RETURN_; EDBUG_RETURN_;
@ -2800,9 +2792,10 @@ ShadeEwin(EWin * ewin)
ww = 1; ww = 1;
hh = ewin->client.h; hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh); ewin->border->border.left,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->border->border.top, ww, hh);
ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
@ -2826,8 +2819,7 @@ ShadeEwin(EWin * ewin)
ewin->shaded = 2; ewin->shaded = 2;
ewin->w = b; ewin->w = b;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
break; break;
@ -2855,9 +2847,10 @@ ShadeEwin(EWin * ewin)
ww = 1; ww = 1;
hh = ewin->client.h; hh = ewin->client.h;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh); ewin->border->border.left,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->border->border.top, ww, hh);
ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
@ -2883,8 +2876,7 @@ ShadeEwin(EWin * ewin)
ewin->x = d; ewin->x = d;
ewin->reqx = d; ewin->reqx = d;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
break; break;
@ -2908,14 +2900,16 @@ ShadeEwin(EWin * ewin)
hh = 1; hh = 1;
ww = ewin->client.w; ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh); ewin->border->border.left,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->border->border.top, ww, hh);
ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, -(ewin->client.h - hh), 0, -(ewin->client.h - hh),
ewin->client.win, ShapeBounding, ShapeSet); ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win); PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL); gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec; dsec = timev2.tv_sec - timev1.tv_sec;
@ -2933,8 +2927,7 @@ ShadeEwin(EWin * ewin)
ewin->shaded = 2; ewin->shaded = 2;
ewin->h = b; ewin->h = b;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
break; break;
@ -2963,9 +2956,10 @@ ShadeEwin(EWin * ewin)
hh = 1; hh = 1;
ww = ewin->client.w; ww = ewin->client.w;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ww, hh); ewin->border->border.left,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->border->border.top, ww, hh);
ewin->w, ewin->h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
@ -2991,8 +2985,7 @@ ShadeEwin(EWin * ewin)
ewin->y = d; ewin->y = d;
ewin->reqy = d; ewin->reqy = d;
EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1); EMoveResizeWindow(disp, ewin->win_container, -30, -30, 1, 1);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
XSync(disp, False); XSync(disp, False);
break; break;
@ -3047,8 +3040,7 @@ UnShadeEwin(EWin * ewin)
ewin->shaded = 0; ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.left,
ewin->border->border.top, ewin->border->border.top, 1, ewin->client.h);
1, ewin->client.h);
EMoveResizeWindow(disp, ewin->client.win, -ewin->client.w, 0, EMoveResizeWindow(disp, ewin->client.win, -ewin->client.w, 0,
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->client.win);
@ -3060,12 +3052,12 @@ UnShadeEwin(EWin * ewin)
i = ((a * (1024 - k)) + (b * k)) >> 10; i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->w = i; ewin->w = i;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ewin->border->border.left,
ewin->border->border.top,
ewin->w - ewin->border->border.left - ewin->w - ewin->border->border.left -
ewin->border->border.right, ewin->border->border.right, ewin->client.h);
ewin->client.h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
@ -3073,7 +3065,8 @@ UnShadeEwin(EWin * ewin)
(ewin->w - ewin->border->border.left - (ewin->w - ewin->border->border.left -
ewin->border->border.right)), ewin->border->border.right)),
0, 0,
ewin->client.win, ShapeBounding, ShapeSet); ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win); PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL); gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec; dsec = timev2.tv_sec - timev1.tv_sec;
@ -3090,8 +3083,7 @@ UnShadeEwin(EWin * ewin)
} }
ewin->w = b; ewin->w = b;
queue_up = 1; queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 1: case 1:
@ -3102,13 +3094,11 @@ UnShadeEwin(EWin * ewin)
ewin->border->border.right; ewin->border->border.right;
c = ewin->x; c = ewin->x;
d = ewin->x + ewin->w - (ewin->border->border.right d = ewin->x + ewin->w - (ewin->border->border.right
+ ewin->client.w + ewin->client.w + ewin->border->border.left);
+ ewin->border->border.left);
ewin->shaded = 0; ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.left,
ewin->border->border.top, ewin->border->border.top, 1, ewin->client.h);
1, ewin->client.h);
EMoveResizeWindow(disp, ewin->client.win, 0, 0, EMoveResizeWindow(disp, ewin->client.win, 0, 0,
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->client.win);
@ -3123,18 +3113,19 @@ UnShadeEwin(EWin * ewin)
ewin->x = j; ewin->x = j;
ewin->reqx = j; ewin->reqx = j;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ewin->border->border.left,
ewin->border->border.top,
ewin->w - ewin->border->border.left - ewin->w - ewin->border->border.left -
ewin->border->border.right, ewin->border->border.right, ewin->client.h);
ewin->client.h); EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->h);
ewin->w, ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
0, 0,
0, 0,
ewin->client.win, ShapeBounding, ShapeSet); ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win); PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL); gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec; dsec = timev2.tv_sec - timev1.tv_sec;
@ -3153,8 +3144,7 @@ UnShadeEwin(EWin * ewin)
ewin->x = d; ewin->x = d;
ewin->reqx = d; ewin->reqx = d;
queue_up = 1; queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 2: case 2:
@ -3166,8 +3156,7 @@ UnShadeEwin(EWin * ewin)
ewin->shaded = 0; ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.left,
ewin->border->border.top, ewin->border->border.top, ewin->client.w, 1);
ewin->client.w, 1);
EMoveResizeWindow(disp, ewin->client.win, 0, -ewin->client.h, EMoveResizeWindow(disp, ewin->client.win, 0, -ewin->client.h,
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->client.win);
@ -3179,12 +3168,12 @@ UnShadeEwin(EWin * ewin)
i = ((a * (1024 - k)) + (b * k)) >> 10; i = ((a * (1024 - k)) + (b * k)) >> 10;
ewin->h = i; ewin->h = i;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.top, ewin->border->border.left,
ewin->client.w, ewin->border->border.top, ewin->client.w,
ewin->h - ewin->border->border.top - ewin->h - ewin->border->border.top -
ewin->border->border.bottom); ewin->border->border.bottom);
EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, EMoveResizeWindow(disp, ewin->win, ewin->x, ewin->y, ewin->w,
ewin->w, ewin->h); ewin->h);
CalcEwinSizes(ewin); CalcEwinSizes(ewin);
if (ewin->client.shaped) if (ewin->client.shaped)
EShapeCombineShape(disp, ewin->win_container, ShapeBounding, EShapeCombineShape(disp, ewin->win_container, ShapeBounding,
@ -3192,7 +3181,8 @@ UnShadeEwin(EWin * ewin)
-(ewin->client.h - -(ewin->client.h -
(ewin->h - ewin->border->border.top - (ewin->h - ewin->border->border.top -
ewin->border->border.bottom)), ewin->border->border.bottom)),
ewin->client.win, ShapeBounding, ShapeSet); ewin->client.win, ShapeBounding,
ShapeSet);
PropagateShapes(ewin->win); PropagateShapes(ewin->win);
gettimeofday(&timev2, NULL); gettimeofday(&timev2, NULL);
dsec = timev2.tv_sec - timev1.tv_sec; dsec = timev2.tv_sec - timev1.tv_sec;
@ -3209,8 +3199,7 @@ UnShadeEwin(EWin * ewin)
} }
ewin->h = b; ewin->h = b;
queue_up = 1; queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
case 3: case 3:
@ -3221,13 +3210,11 @@ UnShadeEwin(EWin * ewin)
ewin->border->border.bottom; ewin->border->border.bottom;
c = ewin->y; c = ewin->y;
d = ewin->y + ewin->h - (ewin->border->border.bottom d = ewin->y + ewin->h - (ewin->border->border.bottom
+ ewin->client.h + ewin->client.h + ewin->border->border.top);
+ ewin->border->border.top);
ewin->shaded = 0; ewin->shaded = 0;
EMoveResizeWindow(disp, ewin->win_container, EMoveResizeWindow(disp, ewin->win_container,
ewin->border->border.left, ewin->border->border.left,
ewin->border->border.top, ewin->border->border.top, ewin->client.w, 1);
ewin->client.w, 1);
EMoveResizeWindow(disp, ewin->client.win, 0, 0, EMoveResizeWindow(disp, ewin->client.win, 0, 0,
ewin->client.w, ewin->client.h); ewin->client.w, ewin->client.h);
EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->client.win);
@ -3274,8 +3261,7 @@ UnShadeEwin(EWin * ewin)
ewin->y = d; ewin->y = d;
ewin->reqy = d; ewin->reqy = d;
queue_up = 1; queue_up = 1;
MoveResizeEwin(ewin, ewin->x, ewin->y, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.w, ewin->client.h);
XSync(disp, False); XSync(disp, False);
break; break;
default: default:

View File

@ -88,12 +88,13 @@ CreateButton(char *name, ImageClass * iclass, ActionClass * aclass,
b->default_show = 1; b->default_show = 1;
b->used = 0; b->used = 0;
b->left = 0; b->left = 0;
b->win = ECreateWindow(desks.desk[desk % ENLIGHTENMENT_CONF_NUM_DESKTOPS].win, b->win =
-100, -100, 50, 50, 0); ECreateWindow(desks.desk[desk % ENLIGHTENMENT_CONF_NUM_DESKTOPS].win,
-100, -100, 50, 50, 0);
XSelectInput(disp, b->win, XSelectInput(disp, b->win,
ExposureMask | KeyPressMask | KeyReleaseMask | ExposureMask | KeyPressMask | KeyReleaseMask | ButtonPressMask |
ButtonPressMask | ButtonReleaseMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask |
EnterWindowMask | LeaveWindowMask | PointerMotionMask); PointerMotionMask);
b->x = -1; b->x = -1;
b->y = -1; b->y = -1;
b->w = -1; b->w = -1;
@ -443,13 +444,15 @@ FindEmptySpotForButton(Button * bt, char *listname, char dirtomove)
{ {
for (j = 0; j < num; j++) for (j = 0; j < num; j++)
{ {
if ((bt->x + bt->w) <= blst[j]->x || bt->x >= (blst[j]->x + blst[j]->w)) if ((bt->x + bt->w) <= blst[j]->x
|| bt->x >= (blst[j]->x + blst[j]->w))
{ {
done = 1; done = 1;
} }
else else
{ {
if ((bt->y + bt->h) <= blst[j]->y || bt->y > (blst[j]->y + blst[j]->h)) if ((bt->y + bt->h) <= blst[j]->y
|| bt->y > (blst[j]->y + blst[j]->h))
done = 1; done = 1;
else else
done = 0; done = 0;

View File

@ -53,9 +53,7 @@ CloneEwin(EWin * ewin)
InputOutput, root.vis, InputOutput, root.vis,
CWOverrideRedirect | CWSaveUnder | CWOverrideRedirect | CWSaveUnder |
CWBackingStore | CWColormap | CWBackingStore | CWColormap |
CWBackPixmap | CWBackPixel | CWBackPixmap | CWBackPixel | CWBorderPixel, &attr);
CWBorderPixel,
&attr);
pmap = XCreatePixmap(disp, c->win, ewin->w, ewin->h, root.depth); pmap = XCreatePixmap(disp, c->win, ewin->w, ewin->h, root.depth);
XSetWindowBackgroundPixmap(disp, c->win, pmap); XSetWindowBackgroundPixmap(disp, c->win, pmap);
XCopyArea(disp, ewin->win, pmap, gc, 0, 0, ewin->w, ewin->h, 0, 0); XCopyArea(disp, ewin->win, pmap, gc, 0, 0, ewin->w, ewin->h, 0, 0);

View File

@ -78,8 +78,8 @@ CommsFindCommsWindow()
if (comms_win) if (comms_win)
{ {
XGetWindowProperty(disp, comms_win, a, 0, 14, False, XGetWindowProperty(disp, comms_win, a, 0, 14, False,
AnyPropertyType, &ar, &format, &num, &after, AnyPropertyType, &ar, &format, &num,
&s); &after, &s);
if (s) if (s)
XFree(s); XFree(s);
else else
@ -382,8 +382,7 @@ void
HandleComms(XEvent * ev) HandleComms(XEvent * ev)
{ {
Client *c; Client *c;
char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1, char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1, *s2;
*s2;
char sunknown[] = "UNKNOWN"; char sunknown[] = "UNKNOWN";
int unknown; int unknown;
@ -699,7 +698,8 @@ HandleComms(XEvent * ev)
mod = 5; mod = 5;
else if (a->modifiers == (ShiftMask | Mod1Mask)) else if (a->modifiers == (ShiftMask | Mod1Mask))
mod = 6; mod = 6;
else if (a->modifiers == (ShiftMask | ControlMask | Mod1Mask)) else if (a->modifiers ==
(ShiftMask | ControlMask | Mod1Mask))
mod = 7; mod = 7;
else if (a->modifiers == (Mod2Mask)) else if (a->modifiers == (Mod2Mask))
mod = 8; mod = 8;
@ -719,13 +719,15 @@ HandleComms(XEvent * ev)
mod = 15; mod = 15;
else if (a->modifiers == (Mod4Mask | ControlMask)) else if (a->modifiers == (Mod4Mask | ControlMask))
mod = 16; mod = 16;
else if (a->modifiers == (Mod4Mask | ControlMask | ShiftMask)) else if (a->modifiers ==
(Mod4Mask | ControlMask | ShiftMask))
mod = 17; mod = 17;
else if (a->modifiers == (Mod5Mask | ShiftMask)) else if (a->modifiers == (Mod5Mask | ShiftMask))
mod = 18; mod = 18;
else if (a->modifiers == (Mod5Mask | ControlMask)) else if (a->modifiers == (Mod5Mask | ControlMask))
mod = 19; mod = 19;
else if (a->modifiers == (Mod5Mask | ControlMask | ShiftMask)) else if (a->modifiers ==
(Mod5Mask | ControlMask | ShiftMask))
mod = 20; mod = 20;
if (a->action->params) if (a->action->params)
Esnprintf(buf2, sizeof(buf2), Esnprintf(buf2, sizeof(buf2),
@ -737,7 +739,9 @@ HandleComms(XEvent * ev)
a->action->Type); a->action->Type);
if (buf) if (buf)
{ {
buf = Erealloc(buf, strlen(buf) + strlen(buf2) + 1); buf =
Erealloc(buf,
strlen(buf) + strlen(buf2) + 1);
strcat(buf, buf2); strcat(buf, buf2);
} }
else else
@ -877,8 +881,7 @@ HandleComms(XEvent * ev)
bg->pmap = 0; bg->pmap = 0;
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++) for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
{ {
if ((desks.desk[i].bg == bg) && if ((desks.desk[i].bg == bg) && (desks.desk[i].viewable))
(desks.desk[i].viewable))
RefreshDesktop(i); RefreshDesktop(i);
} }
} }
@ -1010,7 +1013,9 @@ HandleComms(XEvent * ev)
ModifyCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy); ModifyCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy);
else else
{ {
cm = CreateCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy); cm =
CreateCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx,
bpy);
AddItem(cm, cm->name, 0, LIST_TYPE_COLORMODIFIER); AddItem(cm, cm->name, 0, LIST_TYPE_COLORMODIFIER);
} }
Efree(name); Efree(name);
@ -1033,7 +1038,9 @@ HandleComms(XEvent * ev)
char buf[FILEPATH_LEN_MAX]; char buf[FILEPATH_LEN_MAX];
sscanf(s, "%*s %1000s", w); sscanf(s, "%*s %1000s", w);
bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); bg =
(Background *) FindItem(w, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
Esnprintf(buf, sizeof(buf), "(null)"); Esnprintf(buf, sizeof(buf), "(null)");
if (bg) if (bg)
{ {
@ -1043,36 +1050,40 @@ HandleComms(XEvent * ev)
bg->name, bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
bg->bg.file, bg->bg.tile, bg->bg.keep_aspect, bg->bg.file, bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->top.file, bg->top.keep_aspect, bg->top.xjust, bg->bg.yperc, bg->top.file, bg->top.keep_aspect,
bg->top.yjust, bg->top.xperc, bg->top.yperc); bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((!(bg->bg.file)) && (bg->top.file)) else if ((!(bg->bg.file)) && (bg->top.file))
Esnprintf(buf, sizeof(buf), Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name, bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
"(null)", bg->bg.tile, bg->bg.keep_aspect, "(null)", bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->top.file, bg->top.keep_aspect, bg->top.xjust, bg->bg.yperc, bg->top.file, bg->top.keep_aspect,
bg->top.yjust, bg->top.xperc, bg->top.yperc); bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((bg->bg.file) && (!(bg->top.file))) else if ((bg->bg.file) && (!(bg->top.file)))
Esnprintf(buf, sizeof(buf), Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name, bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
bg->bg.file, bg->bg.tile, bg->bg.keep_aspect, bg->bg.file, bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
"(null)", bg->top.keep_aspect, bg->top.xjust, bg->bg.yperc, "(null)", bg->top.keep_aspect,
bg->top.yjust, bg->top.xperc, bg->top.yperc); bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((!(bg->bg.file)) && (!(bg->top.file))) else if ((!(bg->bg.file)) && (!(bg->top.file)))
Esnprintf(buf, sizeof(buf), Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i", "%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name, bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b, bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
"(null)", bg->bg.tile, bg->bg.keep_aspect, "(null)", bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc, bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
"(null)", bg->top.keep_aspect, bg->top.xjust, bg->bg.yperc, "(null)", bg->top.keep_aspect,
bg->top.yjust, bg->top.xperc, bg->top.yperc); bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
} }
CommsSend(c, buf); CommsSend(c, buf);
} }
@ -1085,16 +1096,20 @@ HandleComms(XEvent * ev)
char *name = NULL, *bgf = NULL, *topf = NULL; char *name = NULL, *bgf = NULL, *topf = NULL;
int updated = 0, tile, keep_aspect, tkeep_aspect; int updated = 0, tile, keep_aspect, tkeep_aspect;
int xjust, yjust, xperc, yperc, txjust, tyjust, txperc, int xjust, yjust, xperc, yperc, txjust, tyjust, txperc,
typerc;
typerc;
sscanf(s, "%1000s %1000s", tmp, w); sscanf(s, "%1000s %1000s", tmp, w);
bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); bg =
(Background *) FindItem(w, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
icl.r = 99; icl.r = 99;
i = sscanf(s, "%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i", i =
tmp, tmp, sscanf(s,
&(icl.r), &(icl.g), &(icl.b), tmp, &tile, (int *)&keep_aspect, "%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i",
&xjust, &yjust, &xperc, &yperc, tmp, &tkeep_aspect, &txjust, tmp, tmp, &(icl.r), &(icl.g), &(icl.b), tmp, &tile,
&tyjust, &txperc, &typerc); (int *)&keep_aspect, &xjust, &yjust, &xperc, &yperc, tmp,
&tkeep_aspect, &txjust, &tyjust, &txperc, &typerc);
if (bg) if (bg)
{ {
name = duplicate(w); name = duplicate(w);
@ -1216,7 +1231,9 @@ HandleComms(XEvent * ev)
Background *bg; Background *bg;
sscanf(s, "%*s %x %1000s", (unsigned int *)&win, w); sscanf(s, "%*s %x %1000s", (unsigned int *)&win, w);
bg = (Background *) FindItem(w, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); bg =
(Background *) FindItem(w, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
if (bg) if (bg)
SetBackgroundTo(id, win, bg, 0); SetBackgroundTo(id, win, bg, 0);
CommsSend(c, "done"); CommsSend(c, "done");
@ -1503,8 +1520,10 @@ HandleComms(XEvent * ev)
{ {
Button *b; Button *b;
while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME, while (
LIST_TYPE_BUTTON))) (b =
RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME,
LIST_TYPE_BUTTON)))
DestroyButton(b); DestroyButton(b);
InitDesktopControls(); InitDesktopControls();
ShowDesktopControls(); ShowDesktopControls();
@ -1569,7 +1588,6 @@ HandleComms(XEvent * ev)
"SAVEUNDER: %i\n" "SAVEUNDER: %i\n"
"MENUSLIDE: %i\n" "MENUSLIDE: %i\n"
"NUMDESKTOPS: %i\n" "NUMDESKTOPS: %i\n"
"DRAGDIR: %i\n" "DRAGDIR: %i\n"
"DRAGBARWIDTH: %i\n" "DRAGBARWIDTH: %i\n"
"DRAGBARORDERING: %i\n" "DRAGBARORDERING: %i\n"
@ -1577,7 +1595,6 @@ HandleComms(XEvent * ev)
"DESKSLIDEIN: %i\n" "DESKSLIDEIN: %i\n"
"DESKSLIDESPEED: %i\n" "DESKSLIDESPEED: %i\n"
"HIQUALITYBG: %i\n" "HIQUALITYBG: %i\n"
"TRANSIENTSFOLLOWLEADER: %i\n" "TRANSIENTSFOLLOWLEADER: %i\n"
"SWITCHFORTRANSIENTMAP: %i\n" "SWITCHFORTRANSIENTMAP: %i\n"
"SHOWICONS: %i\n" "SHOWICONS: %i\n"
@ -1591,8 +1608,7 @@ HandleComms(XEvent * ev)
"DISPLAY_WARP: %i\n" "DISPLAY_WARP: %i\n"
"WARP_ON_NEXT_FOCUS: %i\n" "WARP_ON_NEXT_FOCUS: %i\n"
"WARP_AFTER_NEXT_FOCUS: %i\n" "WARP_AFTER_NEXT_FOCUS: %i\n"
"EDGE_FLIP_RESISTANCE: %i\n" "EDGE_FLIP_RESISTANCE: %i\n",
,
mode.focusmode, mode.dockdirmode, mode.primaryicondir, mode.focusmode, mode.dockdirmode, mode.primaryicondir,
mode.movemode, mode.resizemode, mode.slidemode, mode.movemode, mode.resizemode, mode.slidemode,
mode.cleanupslide, mode.mapslide, mode.slidespeedmap, mode.cleanupslide, mode.mapslide, mode.slidespeedmap,
@ -1603,11 +1619,9 @@ HandleComms(XEvent * ev)
mode.autoraise, mode.autoraisetime, mode.autoraise, mode.autoraisetime,
mode.dockstartx, mode.dockstarty, mode.save_under, mode.dockstartx, mode.dockstarty, mode.save_under,
mode.menuslide, mode.numdesktops, mode.menuslide, mode.numdesktops,
desks.dragdir, desks.dragbar_width, desks.dragdir, desks.dragbar_width,
desks.dragbar_ordering, desks.dragbar_length, desks.slidein, desks.dragbar_ordering, desks.dragbar_length, desks.slidein,
desks.slidespeed, desks.hiqualitybg, desks.slidespeed, desks.hiqualitybg,
mode.transientsfollowleader, mode.switchfortransientmap, mode.transientsfollowleader, mode.switchfortransientmap,
mode.showicons, a, b, mode.showicons, a, b,
mode.all_new_windows_get_focus, mode.all_new_windows_get_focus,
@ -1618,9 +1632,7 @@ HandleComms(XEvent * ev)
mode.raise_after_next_focus, mode.raise_after_next_focus,
mode.display_warp, mode.display_warp,
mode.warp_on_next_focus, mode.warp_on_next_focus,
mode.warp_after_next_focus, mode.warp_after_next_focus, mode.edge_flip_resistance);
mode.edge_flip_resistance
);
CommsSend(c, buf); CommsSend(c, buf);
} }
else if (!strcmp(w, "call_raw")) else if (!strcmp(w, "call_raw"))
@ -1739,56 +1751,7 @@ HandleComms(XEvent * ev)
"MWM_TITLE: %5i\n" "MWM_TITLE: %5i\n"
"MWM_MENU: %5i\n" "MWM_MENU: %5i\n"
"MWM_MINIMIZE: %5i\n" "MWM_MINIMIZE: %5i\n"
"MWM_MAXIMIZE: %5i\n" "MWM_MAXIMIZE: %5i\n" "APP_STATE: %5i\n", ewin->client.win, ewin->win, ewin->x, ewin->y, ewin->w, ewin->h, ewin->border->name, ewin->border->border.left, ewin->border->border.right, ewin->border->border.top, ewin->border->border.bottom, ewin->desktop, ewin->num_groups, ewin->docked, ewin->sticky, ewin->visible, ewin->iconified, ewin->shaded, ewin->active, ewin->layer, ewin->never_use_area, ewin->floating, ewin->client.w, ewin->client.h, ewin->client.icon_win, ewin->client.icon_pmap, ewin->client.icon_mask, ewin->client.group, ewin->client.need_input, ewin->client.transient, ewin->client.title, ewin->client.class, ewin->client.name, ewin->client.command, ewin->client.machine, ewin->client.icon_name, ewin->client.is_group_leader, ewin->client.no_resize_h, ewin->client.no_resize_v, ewin->client.shaped, ewin->client.width.min, ewin->client.height.min, ewin->client.width.max, ewin->client.height.max, ewin->client.base_w, ewin->client.base_h, ewin->client.w_inc, ewin->client.h_inc,
"APP_STATE: %5i\n",
ewin->client.win,
ewin->win,
ewin->x,
ewin->y,
ewin->w,
ewin->h,
ewin->border->name,
ewin->border->border.left,
ewin->border->border.right,
ewin->border->border.top,
ewin->border->border.bottom,
ewin->desktop,
ewin->num_groups,
ewin->docked,
ewin->sticky,
ewin->visible,
ewin->iconified,
ewin->shaded,
ewin->active,
ewin->layer,
ewin->never_use_area,
ewin->floating,
ewin->client.w,
ewin->client.h,
ewin->client.icon_win,
ewin->client.icon_pmap,
ewin->client.icon_mask,
ewin->client.group,
ewin->client.need_input,
ewin->client.transient,
ewin->client.title,
ewin->client.class,
ewin->client.name,
ewin->client.command,
ewin->client.machine,
ewin->client.icon_name,
ewin->client.is_group_leader,
ewin->client.no_resize_h,
ewin->client.no_resize_v,
ewin->client.shaped,
ewin->client.width.min,
ewin->client.height.min,
ewin->client.width.max,
ewin->client.height.max,
ewin->client.base_w,
ewin->client.base_h,
ewin->client.w_inc,
ewin->client.h_inc,
ewin->client.aspect_min, ewin->client.aspect_min,
ewin->client.aspect_max, ewin->client.aspect_max,
ewin->client.mwm_decor_border, ewin->client.mwm_decor_border,
@ -1970,7 +1933,9 @@ HandleComms(XEvent * ev)
} }
else if (!strcmp(w, "list_clients")) else if (!strcmp(w, "list_clients"))
{ {
char buf[FILEPATH_LEN_MAX], *ret = NULL, none[] = "-NONE-"; char buf[FILEPATH_LEN_MAX], *ret = NULL, none[] =
"-NONE-";
EWin **lst; EWin **lst;
int i, num; int i, num;
@ -2248,12 +2213,11 @@ HandleComms(XEvent * ev)
{ {
char buf[FILEPATH_LEN_MAX]; char buf[FILEPATH_LEN_MAX];
Esnprintf(buf, sizeof(buf), "Received Unknown Client Message.\n" Esnprintf(buf, sizeof(buf),
"Client Name: %s\n" gettext("Received Unknown Client Message.\n"
"Client Version: %s\n" "Client Name: %s\n" "Client Version: %s\n"
"Message Contents:\n\n" "Message Contents:\n\n" "%s\n"), s1, s2, s);
"%s\n", s1, s2, s); DIALOG_OK(gettext("E IPC Error"), buf);
DIALOG_OK("E IPC Error", buf);
AUDIO_PLAY("SOUND_ERROR_IPC"); AUDIO_PLAY("SOUND_ERROR_IPC");
} }
} }

View File

@ -128,6 +128,7 @@
#define CONTROL_KDESUPPORT 1366 #define CONTROL_KDESUPPORT 1366
#define CONTROL_CLICK_ALWAYS 1367 #define CONTROL_CLICK_ALWAYS 1367
#define CONTROL_SHOWROOTTOOLTIP 1368 #define CONTROL_SHOWROOTTOOLTIP 1368
#define CONTROL_PAGER_BUTTONS 1369
#define ICLASS_NAME 350 #define ICLASS_NAME 350
#define ICLASS_NORMAL 351 #define ICLASS_NORMAL 351

File diff suppressed because it is too large Load Diff

View File

@ -69,7 +69,8 @@ AddButtonToContainer(Container * bc, Button * b)
else else
{ {
bc->ButtonList = Erealloc(bc->ButtonList, bc->ButtonList = Erealloc(bc->ButtonList,
(bc->numofbuttonsinlist + 1) * sizeof(Container *)); (bc->numofbuttonsinlist +
1) * sizeof(Container *));
} }
bc->ButtonList[bc->numofbuttonsinlist++] = b; bc->ButtonList[bc->numofbuttonsinlist++] = b;
b->ref_count++; b->ref_count++;
@ -103,7 +104,8 @@ RemoveButtonFromContainer(Container * bc, Button * b)
if (found && ((bc->numofbuttonsinlist - 1) > 0)) if (found && ((bc->numofbuttonsinlist - 1) > 0))
{ {
bc->ButtonList = Erealloc(bc->ButtonList, bc->ButtonList = Erealloc(bc->ButtonList,
(bc->numofbuttonsinlist * sizeof(Container *))); (bc->numofbuttonsinlist *
sizeof(Container *)));
for (i = 0; i <= bc->numofbuttonsinlist; i++) for (i = 0; i <= bc->numofbuttonsinlist; i++)
{ {
if (i != j) if (i != j)

View File

@ -68,8 +68,12 @@ SetCoords(int x, int y, int w, int h)
case 0: case 0:
case 1: case 1:
case 2: case 2:
cx = ewin->x + ((ewin->w - cw) / 2) + desks.desk[ewin->desktop].x; cx =
cy = ewin->y + ((ewin->h - ch) / 2) + desks.desk[ewin->desktop].y; ewin->x + ((ewin->w - cw) / 2) +
desks.desk[ewin->desktop].x;
cy =
ewin->y + ((ewin->h - ch) / 2) +
desks.desk[ewin->desktop].y;
break; break;
case 3: case 3:
cx = 0; cx = 0;

View File

@ -28,10 +28,10 @@ GetUniqueBGString(Background * bg)
char s[256]; char s[256];
const char *chmap = const char *chmap =
#ifndef __EMX__ #ifndef __EMX__
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
#else #else
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_"; "0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_";
/* cyrillic symbols from 866 page correctly handled instead of eng. capitals */ /* cyrillic symbols from 866 page correctly handled instead of eng. capitals */
#endif #endif
@ -87,8 +87,7 @@ GetUniqueBGString(Background * bg)
"%c%c%c%c%c%c" "%c%c%c%c%c%c"
"%c%c%c%c%c%c" "%c%c%c%c%c%c"
"%c%c%c%c%c%c" "%c%c%c%c%c%c"
"%c%c%c%c%c%c" "%c%c%c%c%c%c",
,
chmap[(n1 >> 0) & 0x3f], chmap[(n1 >> 0) & 0x3f],
chmap[(n1 >> 6) & 0x3f], chmap[(n1 >> 6) & 0x3f],
chmap[(n1 >> 12) & 0x3f], chmap[(n1 >> 12) & 0x3f],
@ -153,9 +152,7 @@ GetUniqueBGString(Background * bg)
chmap[(f6 >> 6) & 0x3f], chmap[(f6 >> 6) & 0x3f],
chmap[(f6 >> 12) & 0x3f], chmap[(f6 >> 12) & 0x3f],
chmap[(f6 >> 18) & 0x3f], chmap[(f6 >> 18) & 0x3f],
chmap[(f6 >> 24) & 0x3f], chmap[(f6 >> 24) & 0x3f], chmap[(f6 >> 28) & 0x3f]);
chmap[(f6 >> 28) & 0x3f]
);
return duplicate(s); return duplicate(s);
} }
@ -632,21 +629,15 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg)
cm->ref_count++; cm->ref_count++;
if (dsk->top.im) if (dsk->top.im)
{ {
Imlib_set_image_red_curve(id, dsk->top.im, Imlib_set_image_red_curve(id, dsk->top.im, cm->red.map);
cm->red.map); Imlib_set_image_green_curve(id, dsk->top.im, cm->green.map);
Imlib_set_image_green_curve(id, dsk->top.im, Imlib_set_image_blue_curve(id, dsk->top.im, cm->blue.map);
cm->green.map);
Imlib_set_image_blue_curve(id, dsk->top.im,
cm->blue.map);
} }
if (dsk->bg.im) if (dsk->bg.im)
{ {
Imlib_set_image_red_curve(id, dsk->bg.im, Imlib_set_image_red_curve(id, dsk->bg.im, cm->red.map);
cm->red.map); Imlib_set_image_green_curve(id, dsk->bg.im, cm->green.map);
Imlib_set_image_green_curve(id, dsk->bg.im, Imlib_set_image_blue_curve(id, dsk->bg.im, cm->blue.map);
cm->green.map);
Imlib_set_image_blue_curve(id, dsk->bg.im,
cm->blue.map);
} }
} }
} }
@ -764,16 +755,20 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg)
if (dsk->top.yperc <= 0) if (dsk->top.yperc <= 0)
{ {
if (((ww << 10) / hh) != if (((ww << 10) / hh) !=
((dsk->top.im->rgb_width << 10) / dsk->top.im->rgb_height)) ((dsk->top.im->rgb_width << 10) /
hh = ((ww * dsk->top.im->rgb_height) dsk->top.im->rgb_height))
/ dsk->top.im->rgb_width); hh =
((ww * dsk->top.im->rgb_height) /
dsk->top.im->rgb_width);
} }
else else
{ {
if (((hh << 10) / ww) != if (((hh << 10) / ww) !=
((dsk->top.im->rgb_height << 10) / dsk->top.im->rgb_width)) ((dsk->top.im->rgb_height << 10) /
ww = ((hh * dsk->top.im->rgb_width) dsk->top.im->rgb_width))
/ dsk->top.im->rgb_height); ww =
((hh * dsk->top.im->rgb_width) /
dsk->top.im->rgb_height);
} }
} }
Imlib_render(imd, dsk->top.im, ww, hh); Imlib_render(imd, dsk->top.im, ww, hh);
@ -935,16 +930,20 @@ SetBackgroundTo(ImlibData * imd, Window win, Background * dsk, char setbg)
if (dsk->top.yperc <= 0) if (dsk->top.yperc <= 0)
{ {
if (((ww << 10) / hh) != if (((ww << 10) / hh) !=
((dsk->top.im->rgb_width << 10) / dsk->top.im->rgb_height)) ((dsk->top.im->rgb_width << 10) /
hh = ((ww * dsk->top.im->rgb_height) dsk->top.im->rgb_height))
/ dsk->top.im->rgb_width); hh =
((ww * dsk->top.im->rgb_height) /
dsk->top.im->rgb_width);
} }
else else
{ {
if (((hh << 10) / ww) != if (((hh << 10) / ww) !=
((dsk->top.im->rgb_height << 10) / dsk->top.im->rgb_width)) ((dsk->top.im->rgb_height << 10) /
ww = ((hh * dsk->top.im->rgb_width) dsk->top.im->rgb_width))
/ dsk->top.im->rgb_height); ww =
((hh * dsk->top.im->rgb_width) /
dsk->top.im->rgb_height);
} }
} }
Imlib_render(imd, dsk->top.im, ww, hh); Imlib_render(imd, dsk->top.im, ww, hh);
@ -1043,13 +1042,14 @@ InitDesktopBgs()
} }
else else
{ {
d->win = ECreateWindow(root.win, -root.w, -root.h, root.w, root.h, 0); d->win =
ECreateWindow(root.win, -root.w, -root.h, root.w, root.h, 0);
XSelectInput(disp, d->win, XSelectInput(disp, d->win,
SubstructureNotifyMask | ButtonPressMask | SubstructureNotifyMask | ButtonPressMask |
ButtonReleaseMask | EnterWindowMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask
LeaveWindowMask | ButtonMotionMask | | ButtonMotionMask | PropertyChangeMask |
PropertyChangeMask | SubstructureRedirectMask | SubstructureRedirectMask | KeyPressMask |
KeyPressMask | KeyReleaseMask | PointerMotionMask); KeyReleaseMask | PointerMotionMask);
d->viewable = 0; d->viewable = 0;
} }
at = XInternAtom(disp, "ENLIGHTENMENT_DESKTOP", False); at = XInternAtom(disp, "ENLIGHTENMENT_DESKTOP", False);
@ -1105,33 +1105,27 @@ InitDesktopControls()
AddToAction(a, ACTION_SHOW_MENU, duplicate(s)); AddToAction(a, ACTION_SHOW_MENU, duplicate(s));
if (i > 0) if (i > 0)
{ {
ac->tooltipstring = duplicate("Hold down the mouse button " ac->tooltipstring =
"and drag\n" duplicate(gettext
"the mouse to be able to " ("Hold down the mouse button " "and drag\n"
"drag the desktop\n" "the mouse to be able to " "drag the desktop\n"
"back and forth.\n" "back and forth.\n" "Click right mouse button "
"Click right mouse button " "for a list of all\n" "Desktops and their "
"for a list of all\n" "applications.\n" "Click middle mouse button "
"Desktops and their " "for a list of all\n" "applications currently"
"applications.\n" " running.\n"));
"Click middle mouse button "
"for a list of all\n"
"applications currently"
" running.\n");
} }
else else
{ {
ac->tooltipstring = duplicate("This is the Root desktop.\n" ac->tooltipstring =
"You cannot drag the " duplicate(gettext
"root desktop around.\n" ("This is the Root desktop.\n"
"Click right mouse button " "You cannot drag the " "root desktop around.\n"
"for a list of all\n" "Click right mouse button "
"Desktops and their " "for a list of all\n" "Desktops and their "
"applications.\n" "applications.\n" "Click middle mouse button "
"Click middle mouse button " "for a list of all\n" "applications currently "
"for a list of all\n" "running.\n"));
"applications currently "
"running.\n");
} }
} }
Esnprintf(s, sizeof(s), "RAISEBUTTON_DESKTOP_%i", i); Esnprintf(s, sizeof(s), "RAISEBUTTON_DESKTOP_%i", i);
@ -1145,8 +1139,10 @@ InitDesktopControls()
param = Emalloc(3); param = Emalloc(3);
Esnprintf(param, 3, "%i", i); Esnprintf(param, 3, "%i", i);
AddToAction(a, ACTION_DESKTOP_RAISE, param); AddToAction(a, ACTION_DESKTOP_RAISE, param);
ac2->tooltipstring = duplicate("Click here to raise this desktop\n" ac2->tooltipstring =
"to the top.\n"); duplicate(gettext
("Click here to raise this desktop\n"
"to the top.\n"));
} }
Esnprintf(s, sizeof(s), "LOWERBUTTON_DESKTOP_%i", i); Esnprintf(s, sizeof(s), "LOWERBUTTON_DESKTOP_%i", i);
ac3 = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS); ac3 = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
@ -1159,8 +1155,10 @@ InitDesktopControls()
param = Emalloc(3); param = Emalloc(3);
Esnprintf(param, 3, "%i", i); Esnprintf(param, 3, "%i", i);
AddToAction(a, ACTION_DESKTOP_LOWER, param); AddToAction(a, ACTION_DESKTOP_LOWER, param);
ac3->tooltipstring = duplicate("Click here to lower this desktop\n" ac3->tooltipstring =
"to the bottom.\n"); duplicate(gettext
("Click here to lower this desktop\n"
"to the bottom.\n"));
} }
b = NULL; b = NULL;
@ -1312,17 +1310,17 @@ InitDesktopControls()
else if (desks.dragdir == 2) else if (desks.dragdir == 2)
{ {
b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac,
NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1,
99999, 0, 0, desks.desk[i].x, 0, 99999, 0, 0, desks.desk[i].x, 0,
desks.desk[i].y, 0, 0, 0, 0, 0, 1, 0, 1); desks.desk[i].y, 0, 0, 0, 0, 0, 1, 0, 1);
} }
else else
{ {
b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac, b = CreateButton("_DESKTOP_DESKRAY_DRAG_CONTROL", ic4, ac,
NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1, NULL, NULL, 1, FLAG_FIXED_HORIZ, 1, 99999, 1,
99999, 0, 0, desks.desk[i].x, 0, 99999, 0, 0, desks.desk[i].x, 0,
desks.desk[i].y + root.h - desks.dragbar_width, desks.desk[i].y + root.h -
0, 0, 0, 0, 0, 1, 0, 1); desks.dragbar_width, 0, 0, 0, 0, 0, 1, 0, 1);
} }
AddItem(b, b->name, 2, LIST_TYPE_BUTTON); AddItem(b, b->name, 2, LIST_TYPE_BUTTON);
desks.desk[i].tag = b; desks.desk[i].tag = b;
@ -1377,8 +1375,7 @@ ConformEwinToDesktop(EWin * ewin)
EDBUG(3, "ConformEwinToDesktop"); EDBUG(3, "ConformEwinToDesktop");
if ((ewin->iconified) && if ((ewin->iconified) && (ewin->parent != desks.desk[ewin->desktop].win))
(ewin->parent != desks.desk[ewin->desktop].win))
{ {
ewin->parent = desks.desk[ewin->desktop].win; ewin->parent = desks.desk[ewin->desktop].win;
DesktopAddEwinToTop(ewin); DesktopAddEwinToTop(ewin);
@ -1460,8 +1457,9 @@ MoveStickyWindowsToCurrentDesk(void)
DesktopRemoveEwin(ewin); DesktopRemoveEwin(ewin);
ewin->desktop = DESKTOPS_WRAP_NUM(desks.current); ewin->desktop = DESKTOPS_WRAP_NUM(desks.current);
ewin->parent = desks.desk[ewin->desktop].win; ewin->parent = desks.desk[ewin->desktop].win;
EReparentWindow(disp, ewin->win, desks.desk[ewin->desktop].win, EReparentWindow(disp, ewin->win,
root.w, root.h); desks.desk[ewin->desktop].win, root.w,
root.h);
XLowerWindow(disp, ewin->win); XLowerWindow(disp, ewin->win);
EMoveWindow(disp, ewin->win, ewin->x, ewin->y); EMoveWindow(disp, ewin->win, ewin->x, ewin->y);
DesktopAddEwinToTop(ewin); DesktopAddEwinToTop(ewin);
@ -1511,8 +1509,7 @@ GotoDesktop(int num)
} }
if ((mode.mode == MODE_RESIZE) || if ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V))
(mode.mode == MODE_RESIZE_V))
{ {
doResizeEnd(NULL); doResizeEnd(NULL);
} }
@ -1530,8 +1527,7 @@ GotoDesktop(int num)
mode.ewin->reqy = -99999; mode.ewin->reqy = -99999;
DrawEwinShape(mode.ewin, mode.movemode, DrawEwinShape(mode.ewin, mode.movemode,
x, y, x, y,
mode.ewin->client.w, mode.ewin->client.h, mode.ewin->client.w, mode.ewin->client.h, 3);
3);
} }
} }
else else
@ -1626,14 +1622,12 @@ GotoDesktop(int num)
if (mode.movemode == 5) if (mode.movemode == 5)
{ {
DrawEwinShape(mode.ewin, mode.movemode, x, y, DrawEwinShape(mode.ewin, mode.movemode, x, y,
mode.ewin->client.w, mode.ewin->client.h, mode.ewin->client.w, mode.ewin->client.h, 4);
4);
} }
else else
{ {
DrawEwinShape(mode.ewin, mode.movemode, x, y, DrawEwinShape(mode.ewin, mode.movemode, x, y,
mode.ewin->client.w, mode.ewin->client.h, mode.ewin->client.w, mode.ewin->client.h, 0);
0);
} }
} }
} }
@ -1720,7 +1714,8 @@ MoveDesktop(int num, int x, int y)
if ((!v) && (desks.desk[deskorder[i]].viewable) if ((!v) && (desks.desk[deskorder[i]].viewable)
&& (desks.desk[deskorder[i]].bg)) && (desks.desk[deskorder[i]].bg))
{ {
desks.desk[deskorder[i]].bg->last_viewed = time(NULL); desks.desk[deskorder[i]].bg->last_viewed =
time(NULL);
} }
desks.desk[deskorder[i]].viewable = v; desks.desk[deskorder[i]].viewable = v;
} }
@ -2053,7 +2048,8 @@ DesktopRemoveEwin(EWin * ewin)
int i, j; int i, j;
EDBUG(5, "DesktopRemoveEwin"); EDBUG(5, "DesktopRemoveEwin");
if ((ewin->desktop < 0) || (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1)) if ((ewin->desktop < 0)
|| (ewin->desktop > ENLIGHTENMENT_CONF_NUM_DESKTOPS - 1))
EDBUG_RETURN_; EDBUG_RETURN_;
for (i = 0; i < desks.desk[ewin->desktop].num; i++) for (i = 0; i < desks.desk[ewin->desktop].num; i++)
{ {
@ -2191,7 +2187,8 @@ MoveEwinToDesktopAt(EWin * ewin, int num, int x, int y)
{ {
for (i = 0; i < nn; i++) for (i = 0; i < nn; i++)
{ {
MoveEwinToDesktopAt(lst[i], num, lst[i]->x + dx, lst[i]->y + dy); MoveEwinToDesktopAt(lst[i], num, lst[i]->x + dx,
lst[i]->y + dy);
} }
Efree(lst); Efree(lst);
} }

View File

@ -174,7 +174,8 @@ DialogBindKey(Dialog * d, char *key, void (*func) (int val, void *data),
if (!d->keybindings) if (!d->keybindings)
d->keybindings = Emalloc(sizeof(DKeyBind) * d->num_bindings); d->keybindings = Emalloc(sizeof(DKeyBind) * d->num_bindings);
else else
d->keybindings = Erealloc(d->keybindings, sizeof(DKeyBind) * d->num_bindings); d->keybindings =
Erealloc(d->keybindings, sizeof(DKeyBind) * d->num_bindings);
d->keybindings[d->num_bindings - 1].val = val; d->keybindings[d->num_bindings - 1].val = val;
d->keybindings[d->num_bindings - 1].data = data; d->keybindings[d->num_bindings - 1].data = data;
d->keybindings[d->num_bindings - 1].func = func; d->keybindings[d->num_bindings - 1].func = func;
@ -279,7 +280,7 @@ DialogQuit(int val, void *data)
} }
void void
DialogAlert(char *fmt,...) DialogAlert(char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list ap;
@ -292,7 +293,7 @@ DialogAlert(char *fmt,...)
} }
void void
DialogAlertOK(char *fmt,...) DialogAlertOK(char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list ap;
@ -300,13 +301,13 @@ DialogAlertOK(char *fmt,...)
va_start(ap, fmt); va_start(ap, fmt);
Evsnprintf(text, 10240, fmt, ap); Evsnprintf(text, 10240, fmt, ap);
va_end(ap); va_end(ap);
ASSIGN_ALERT("Attention !!!", "OK", " ", " "); ASSIGN_ALERT(gettext("Attention !!!"), gettext("OK"), " ", " ");
Alert(text); Alert(text);
RESET_ALERT; RESET_ALERT;
} }
void void
DialogSetParamText(Dialog * d, char *fmt,...) DialogSetParamText(Dialog * d, char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list ap;
@ -419,12 +420,10 @@ DialogDrawButton(Dialog * d, int bnum)
state = STATE_CLICKED; state = STATE_CLICKED;
} }
IclassApply(d->button[bnum]->iclass, d->button[bnum]->win, IclassApply(d->button[bnum]->iclass, d->button[bnum]->win,
d->button[bnum]->w, d->button[bnum]->h, 0, 0, d->button[bnum]->w, d->button[bnum]->h, 0, 0, state, 0);
state, 0);
TclassApply(d->button[bnum]->iclass, d->button[bnum]->win, TclassApply(d->button[bnum]->iclass, d->button[bnum]->win,
d->button[bnum]->w, d->button[bnum]->h, d->button[bnum]->w, d->button[bnum]->h,
0, 0, state, 1, d->button[bnum]->tclass, 0, 0, state, 1, d->button[bnum]->tclass, d->button[bnum]->text);
d->button[bnum]->text);
} }
void void
@ -464,8 +463,7 @@ DialogDraw(Dialog * d)
if (d->text) if (d->text)
{ {
TclassApply(d->iclass, d->win, d->w, d->h, TclassApply(d->iclass, d->win, d->w, d->h,
0, 0, STATE_NORMAL, 1, d->tclass, 0, 0, STATE_NORMAL, 1, d->tclass, d->text);
d->text);
} }
else if (d->item) else if (d->item)
{ {
@ -482,8 +480,7 @@ DialogDrawArea(Dialog * d, int x, int y, int w, int h)
if (d->text) if (d->text)
{ {
TclassApply(d->iclass, d->win, d->w, d->h, TclassApply(d->iclass, d->win, d->w, d->h,
0, 0, STATE_NORMAL, 1, d->tclass, 0, 0, STATE_NORMAL, 1, d->tclass, d->text);
d->text);
} }
else if (d->item) else if (d->item)
{ {
@ -554,8 +551,7 @@ ShowDialog(Dialog * d)
if ((d->iclass->padding.left + d->iclass->padding.right + if ((d->iclass->padding.left + d->iclass->padding.right +
(d->num_buttons * (mw + d->iclass->padding.left + (d->num_buttons * (mw + d->iclass->padding.left +
d->iclass->padding.right))) d->iclass->padding.right))) > w)
> w)
w = d->iclass->padding.left + d->iclass->padding.right + w = d->iclass->padding.left + d->iclass->padding.right +
(d->num_buttons * (mw + d->iclass->padding.left + (d->num_buttons * (mw + d->iclass->padding.left +
d->iclass->padding.right)); d->iclass->padding.right));
@ -587,8 +583,7 @@ ShowDialog(Dialog * d)
for (i = 0; i < d->num_buttons; i++) for (i = 0; i < d->num_buttons; i++)
IclassApply(d->button[i]->iclass, d->button[i]->win, IclassApply(d->button[i]->iclass, d->button[i]->win,
d->button[i]->w, d->button[i]->h, 0, 0, d->button[i]->w, d->button[i]->h, 0, 0, STATE_NORMAL, 0);
STATE_NORMAL, 0);
queue_up = pq; queue_up = pq;
ewin = AddInternalToFamily(d->win, 1, NULL, 0, d); ewin = AddInternalToFamily(d->win, 1, NULL, 0, d);
@ -993,8 +988,7 @@ DialogRealizeItem(Dialog * d, DItem * di)
EnterWindowMask | LeaveWindowMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask | ButtonPressMask |
ButtonReleaseMask); ButtonReleaseMask);
XSelectInput(disp, di->item.slider.knob_win, XSelectInput(disp, di->item.slider.knob_win,
ButtonPressMask | ButtonPressMask | ButtonReleaseMask | PointerMotionMask);
ButtonReleaseMask | PointerMotionMask);
if (!di->item.slider.ic_base) if (!di->item.slider.ic_base)
{ {
if (di->item.slider.horizontal) if (di->item.slider.horizontal)
@ -1086,14 +1080,16 @@ DialogRealizeItem(Dialog * d, DItem * di)
{ {
ImlibImage *im; ImlibImage *im;
im = ELoadImage(di->item.slider.ic_border->norm.normal->im_file); im =
ELoadImage(di->item.slider.ic_border->norm.normal->
im_file);
if (im) if (im)
{ {
di->item.slider.border_orig_w = im->rgb_width; di->item.slider.border_orig_w = im->rgb_width;
di->item.slider.border_orig_h = im->rgb_height; di->item.slider.border_orig_h = im->rgb_height;
Imlib_destroy_image(id, im); Imlib_destroy_image(id, im);
di->item.slider.border_win = ECreateWindow(d->win, -20, di->item.slider.border_win = ECreateWindow(d->win, -20,
-20, 2, 2, 0); -20, 2, 2, 0);
EMapWindow(disp, di->item.slider.border_win); EMapWindow(disp, di->item.slider.border_win);
} }
} }
@ -1241,7 +1237,7 @@ DialogRealizeItem(Dialog * d, DItem * di)
if ((cols > 0) && (rows > 0)) if ((cols > 0) && (rows > 0))
{ {
int i, *col_size, *row_size = NULL, r = 0, int i, *col_size, *row_size = NULL, r = 0,
c = 0, x = 0, y = 0; c = 0, x = 0, y = 0;
col_size = Emalloc(sizeof(int) * cols); col_size = Emalloc(sizeof(int) * cols);
row_size = Erealloc(row_size, sizeof(int)); row_size = Erealloc(row_size, sizeof(int));
@ -1320,11 +1316,9 @@ DialogRealizeItem(Dialog * d, DItem * di)
for (j = 0; j < dii->row_span; j++) for (j = 0; j < dii->row_span; j++)
sh += row_size[r + j]; sh += row_size[r + j];
if (dii->fill_h) if (dii->fill_h)
dii->w = sw - (dii->padding.left dii->w = sw - (dii->padding.left + dii->padding.right);
+ dii->padding.right);
if (dii->fill_v) if (dii->fill_v)
dii->h = sh - (dii->padding.top dii->h = sh - (dii->padding.top + dii->padding.bottom);
+ dii->padding.bottom);
if (dii->type == DITEM_TABLE) if (dii->type == DITEM_TABLE)
{ {
int dx, dy, newx, newy; int dx, dy, newx, newy;
@ -1359,20 +1353,26 @@ DialogRealizeItem(Dialog * d, DItem * di)
dii->w, dii->h); dii->w, dii->h);
if (dii->type == DITEM_CHECKBUTTON) if (dii->type == DITEM_CHECKBUTTON)
EMoveResizeWindow(disp, EMoveResizeWindow(disp,
dii->item.check_button.check_win, dii->item.check_button.check_win,
dii->x, dii->y + dii->x, dii->y +
((dii->h - ((dii->h -
dii->item.check_button.check_orig_h) / 2), dii->item.check_button.
dii->item.check_button.check_orig_w, check_orig_h) / 2),
dii->item.check_button.check_orig_h); dii->item.check_button.
check_orig_w,
dii->item.check_button.
check_orig_h);
if (dii->type == DITEM_RADIOBUTTON) if (dii->type == DITEM_RADIOBUTTON)
EMoveResizeWindow(disp, EMoveResizeWindow(disp,
dii->item.radio_button.radio_win, dii->item.radio_button.radio_win,
dii->x, dii->y + dii->x, dii->y +
((dii->h - ((dii->h -
dii->item.radio_button.radio_orig_h) / 2), dii->item.radio_button.
dii->item.radio_button.radio_orig_w, radio_orig_h) / 2),
dii->item.radio_button.radio_orig_h); dii->item.radio_button.
radio_orig_w,
dii->item.radio_button.
radio_orig_h);
if (dii->type == DITEM_AREA) if (dii->type == DITEM_AREA)
{ {
dii->item.area.w = dii->w - dii->item.area.w = dii->w -
@ -1404,23 +1404,29 @@ DialogRealizeItem(Dialog * d, DItem * di)
if (dii->item.slider.base_win) if (dii->item.slider.base_win)
EMoveResizeWindow(disp, EMoveResizeWindow(disp,
dii->item.slider.base_win, dii->item.slider.base_win,
dii->x + dii->item.slider.base_x, dii->x +
dii->y + dii->item.slider.base_y, dii->item.slider.base_x,
dii->y +
dii->item.slider.base_y,
dii->item.slider.base_w, dii->item.slider.base_w,
dii->item.slider.base_h); dii->item.slider.base_h);
if (dii->item.slider.border_win) if (dii->item.slider.border_win)
EMoveResizeWindow(disp, EMoveResizeWindow(disp,
dii->item.slider.border_win, dii->item.slider.border_win,
dii->x + dii->item.slider.border_x, dii->x +
dii->y + dii->item.slider.border_y, dii->item.slider.border_x,
dii->y +
dii->item.slider.border_y,
dii->item.slider.border_w, dii->item.slider.border_w,
dii->item.slider.border_h); dii->item.slider.border_h);
if (dii->win) if (dii->win)
EMoveResizeWindow(disp, dii->win, EMoveResizeWindow(disp, dii->win,
dii->x + dii->item.slider.numeric_x, dii->x +
dii->y + dii->item.slider.numeric_y, dii->item.slider.numeric_x,
dii->y +
dii->item.slider.numeric_y,
dii->item.slider.numeric_w, dii->item.slider.numeric_w,
dii->item.slider.numeric_h); dii->item.slider.numeric_h);
} }
} }
x += sw; x += sw;
@ -1544,16 +1550,14 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h)
{ {
int i; int i;
if (INTERSECTS(x, y, w, h, if (INTERSECTS(x, y, w, h, di->x, di->y, di->w, di->h))
di->x, di->y, di->w, di->h))
{ {
for (i = 0; i < di->item.table.num_items; i++) for (i = 0; i < di->item.table.num_items; i++)
DialogDrawItems(d, di->item.table.items[i], x, y, w, h); DialogDrawItems(d, di->item.table.items[i], x, y, w, h);
} }
return; return;
} }
if (INTERSECTS(x, y, w, h, if (INTERSECTS(x, y, w, h, di->x, di->y, di->w, di->h))
di->x, di->y, di->w, di->h))
{ {
switch (di->type) switch (di->type)
{ {
@ -1634,13 +1638,11 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h)
if (di->item.check_button.onoff) if (di->item.check_button.onoff)
IclassApply(di->iclass, di->item.check_button.check_win, IclassApply(di->iclass, di->item.check_button.check_win,
di->item.check_button.check_orig_w, di->item.check_button.check_orig_w,
di->item.check_button.check_orig_h, 1, 0, di->item.check_button.check_orig_h, 1, 0, state, 0);
state, 0);
else else
IclassApply(di->iclass, di->item.check_button.check_win, IclassApply(di->iclass, di->item.check_button.check_win,
di->item.check_button.check_orig_w, di->item.check_button.check_orig_w,
di->item.check_button.check_orig_h, 0, 0, di->item.check_button.check_orig_h, 0, 0, state, 0);
state, 0);
XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False);
TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL,
di->item.check_button.text, di->item.check_button.text,
@ -1677,13 +1679,11 @@ DialogDrawItems(Dialog * d, DItem * di, int x, int y, int w, int h)
if (di->item.radio_button.onoff) if (di->item.radio_button.onoff)
IclassApply(di->iclass, di->item.radio_button.radio_win, IclassApply(di->iclass, di->item.radio_button.radio_win,
di->item.radio_button.radio_orig_w, di->item.radio_button.radio_orig_w,
di->item.radio_button.radio_orig_h, 1, 0, di->item.radio_button.radio_orig_h, 1, 0, state, 0);
state, 0);
else else
IclassApply(di->iclass, di->item.radio_button.radio_win, IclassApply(di->iclass, di->item.radio_button.radio_win,
di->item.radio_button.radio_orig_w, di->item.radio_button.radio_orig_w,
di->item.radio_button.radio_orig_w, 0, 0, di->item.radio_button.radio_orig_w, 0, 0, state, 0);
state, 0);
XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False); XClearArea(disp, d->win, di->x, di->y, di->w, di->h, False);
TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL, TextDraw(di->tclass, d->win, 0, 0, STATE_NORMAL,
di->item.radio_button.text, di->item.radio_button.text,
@ -1882,8 +1882,7 @@ DialogItemAreaSetSize(DItem * di, int w, int h)
di->item.area.h = h; di->item.area.h = h;
} }
Window Window DialogItemAreaGetWindow(DItem * di)
DialogItemAreaGetWindow(DItem * di)
{ {
return di->item.area.area_win; return di->item.area.area_win;
} }
@ -1973,8 +1972,7 @@ DialogItemFindWindow(DItem * di, Window win)
else if ((di->win == win) || ((di->type == DITEM_SLIDER) && else if ((di->win == win) || ((di->type == DITEM_SLIDER) &&
((di->item.slider.base_win == win) || ((di->item.slider.base_win == win) ||
(di->item.slider.knob_win == win))) || (di->item.slider.knob_win == win))) ||
((di->type == DITEM_AREA) && ((di->type == DITEM_AREA) && (di->item.area.area_win == win)))
(di->item.area.area_win == win)))
{ {
return di; return di;
} }

View File

@ -98,7 +98,7 @@ HandleDrawQueue()
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if ((lst[i]->d == dq->d) && (dq->d->item) && if ((lst[i]->d == dq->d) && (dq->d->item) &&
/*(dq->d->item == dq->di) && */ (lst[i]->di == dq->di)) /*(dq->d->item == dq->di) && */ (lst[i]->di == dq->di))
{ {
if (dq->x < lst[i]->x) if (dq->x < lst[i]->x)
{ {
@ -200,8 +200,7 @@ HandleDrawQueue()
else if (lst[i]->iclass) else if (lst[i]->iclass)
{ {
IclassApply(lst[i]->iclass, lst[i]->win, lst[i]->w, lst[i]->h, IclassApply(lst[i]->iclass, lst[i]->win, lst[i]->w, lst[i]->h,
lst[i]->active, lst[i]->sticky, lst[i]->state, lst[i]->active, lst[i]->sticky, lst[i]->state, 0);
0);
/* printf("I %x\n", lst[i]->win); */ /* printf("I %x\n", lst[i]->win); */
} }
else if (lst[i]->pager) else if (lst[i]->pager)
@ -429,7 +428,8 @@ EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y)
XFillRectangle(disp, mask, gcm, 0, 0, w, h); XFillRectangle(disp, mask, gcm, 0, 0, w, h);
XSetForeground(disp, gcm, 0); XSetForeground(disp, gcm, 0);
for (i = 0; i < rn; i++) for (i = 0; i < rn; i++)
XFillRectangle(disp, mask, gcm, rl[i].x, rl[i].y, rl[i].width, rl[i].height); XFillRectangle(disp, mask, gcm, rl[i].x, rl[i].y, rl[i].width,
rl[i].height);
XSetClipMask(disp, gc, mask); XSetClipMask(disp, gc, mask);
} }
XSetClipOrigin(disp, gc, x, y); XSetClipOrigin(disp, gc, x, y);
@ -437,7 +437,8 @@ EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y)
} }
void void
EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y, int w, int h) EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
int w, int h)
{ {
int ox, oy; int ox, oy;
int i, j; int i, j;
@ -521,7 +522,8 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++; p1 = *ptr1++;
p2 = *ptr2++; p2 = *ptr2++;
*ptr3++ = ((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) + *ptr3++ =
((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) +
(p1 & p2 & 0x01010101); (p1 & p2 & 0x01010101);
} }
} }
@ -570,12 +572,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++; p1 = *ptr1++;
p2 = *ptr2++; p2 = *ptr2++;
*ptr3++ = *ptr3++ =
((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | ((p1 >> 1) &
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
((p2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | (0x78 << 24) | (0x7c << 19) | (0x78 <<
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + 13))) +
(p1 & p2 & ((0x1 << 11) | (0x1 << 5) | (0x1) | ((p2 >> 1) &
(0x1 << 27) | (0x1 << 21) | (0x1 << 16))); ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 <<
13))) +
(p1 & p2 &
((0x1 << 11) | (0x1 << 5) | (0x1) |
(0x1 << 27) | (0x1 << 21) | (0x1 << 16)));
} }
} }
else else
@ -587,12 +594,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++; p1 = *ptr1++;
p2 = *ptr2++; p2 = *ptr2++;
*ptr3++ = *ptr3++ =
((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | ((p1 >> 1) &
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
((p2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) | (0x78 << 24) | (0x7c << 19) | (0x78 <<
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) + 13))) +
(p1 & p2 & ((0x1 << 11) | (0x1 << 5) | (0x1) | ((p2 >> 1) &
(0x1 << 27) | (0x1 << 21) | (0x1 << 16))); ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 <<
13))) +
(p1 & p2 &
((0x1 << 11) | (0x1 << 5) | (0x1) |
(0x1 << 27) | (0x1 << 21) | (0x1 << 16)));
} }
{ {
unsigned short *pptr1, *pptr2, *pptr3; unsigned short *pptr1, *pptr2, *pptr3;
@ -603,9 +615,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
pptr3 = (unsigned short *)ptr3; pptr3 = (unsigned short *)ptr3;
pp1 = *pptr1; pp1 = *pptr1;
pp2 = *pptr2; pp2 = *pptr2;
*pptr3 = ((pp1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + *pptr3 =
((pp2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) + ((pp1 >> 1) &
(pp1 & pp2 & ((0x1 << 11) | (0x1 << 5) | (0x1))); ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) +
((pp2 >> 1) &
((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) +
(pp1 & pp2 & ((0x1 << 11) | (0x1 << 5) |
(0x1)));
} }
} }
} }
@ -637,12 +653,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++; p1 = *ptr1++;
p2 = *ptr2++; p2 = *ptr2++;
*ptr3++ = *ptr3++ =
((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | ((p1 >> 1) &
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
((p2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | (0x78 << 23) | (0x78 << 18) | (0x78 <<
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + 13))) +
(p1 & p2 & ((0x1 << 10) | (0x1 << 5) | (0x1) | ((p2 >> 1) &
(0x1 << 26) | (0x1 << 20) | (0x1 << 16))); ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 <<
13))) +
(p1 & p2 &
((0x1 << 10) | (0x1 << 5) | (0x1) |
(0x1 << 26) | (0x1 << 20) | (0x1 << 16)));
} }
} }
else else
@ -654,12 +675,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++; p1 = *ptr1++;
p2 = *ptr2++; p2 = *ptr2++;
*ptr3++ = *ptr3++ =
((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | ((p1 >> 1) &
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
((p2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) | (0x78 << 23) | (0x78 << 18) | (0x78 <<
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) + 13))) +
(p1 & p2 & ((0x1 << 10) | (0x1 << 5) | (0x1) | ((p2 >> 1) &
(0x1 << 26) | (0x1 << 20) | (0x1 << 16))); ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 <<
13))) +
(p1 & p2 &
((0x1 << 10) | (0x1 << 5) | (0x1) |
(0x1 << 26) | (0x1 << 20) | (0x1 << 16)));
} }
{ {
unsigned short *pptr1, *pptr2, *pptr3; unsigned short *pptr1, *pptr2, *pptr3;
@ -670,9 +696,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
pptr3 = (unsigned short *)ptr3; pptr3 = (unsigned short *)ptr3;
pp1 = *pptr1; pp1 = *pptr1;
pp2 = *pptr2; pp2 = *pptr2;
*pptr3++ = ((pp1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + *pptr3++ =
((pp2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) + ((pp1 >> 1) &
(pp1 & pp2 & ((0x1 << 10) | (0x1 << 5) | (0x1))); ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) +
((pp2 >> 1) &
((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) +
(pp1 & pp2 & ((0x1 << 10) | (0x1 << 5) |
(0x1)));
} }
} }
} }
@ -800,8 +830,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
} }
if ((mode.mode == MODE_RESIZE) || if ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V))
(mode.mode == MODE_RESIZE_V))
{ {
w1 = ewin->client.w; w1 = ewin->client.w;
h1 = ewin->client.h; h1 = ewin->client.h;
@ -818,8 +847,7 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((md == 5) if ((md == 5)
&& ((mode.mode == MODE_RESIZE) || && ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_H) ||
(mode.mode == MODE_RESIZE_V) || (mode.mode == MODE_RESIZE_V) || (ewin->groups && check_move)))
(ewin->groups && check_move)))
md = 0; md = 0;
if (md == 5) if (md == 5)
{ {
@ -846,8 +874,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
MoveResizeEwin(ewin, x, y, w, h); MoveResizeEwin(ewin, x, y, w, h);
if (mode.mode != MODE_NONE) if (mode.mode != MODE_NONE)
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
break; break;
case 1: case 1:
case 2: case 2:
@ -856,16 +886,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
case 5: case 5:
if (!b1) if (!b1)
b1 = XCreateBitmapFromData(disp, root.win, flipped_gray_bits, b1 = XCreateBitmapFromData(disp, root.win, flipped_gray_bits,
flipped_gray_width, flipped_gray_width, flipped_gray_height);
flipped_gray_height);
if (!b2) if (!b2)
b2 = XCreateBitmapFromData(disp, root.win, gray_bits, b2 = XCreateBitmapFromData(disp, root.win, gray_bits,
gray_width, gray_width, gray_height);
gray_height);
if (!b3) if (!b3)
b3 = XCreateBitmapFromData(disp, root.win, gray3_bits, b3 = XCreateBitmapFromData(disp, root.win, gray3_bits,
gray3_width, gray3_width, gray3_height);
gray3_height);
x1 = ewin->x + desks.desk[ewin->desktop].x; x1 = ewin->x + desks.desk[ewin->desktop].x;
y1 = ewin->y + desks.desk[ewin->desktop].y; y1 = ewin->y + desks.desk[ewin->desktop].y;
w1 = ewin->w - (ewin->border->border.left + ewin->border->border.right); w1 = ewin->w - (ewin->border->border.left + ewin->border->border.right);
@ -881,8 +908,12 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
ewin->client.w = w; ewin->client.w = w;
ewin->client.h = h; ewin->client.h = h;
ICCCM_MatchSize(ewin); ICCCM_MatchSize(ewin);
ewin->w = ewin->client.w + ewin->border->border.left + ewin->border->border.right; ewin->w =
ewin->h = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; ewin->client.w + ewin->border->border.left +
ewin->border->border.right;
ewin->h =
ewin->client.h + ewin->border->border.top +
ewin->border->border.bottom;
} }
w = ewin->w - (ewin->border->border.left + ewin->border->border.right); w = ewin->w - (ewin->border->border.left + ewin->border->border.right);
h = ewin->h - (ewin->border->border.top + ewin->border->border.bottom); h = ewin->h - (ewin->border->border.top + ewin->border->border.bottom);
@ -893,7 +924,9 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if (gcv.foreground == 0) if (gcv.foreground == 0)
gcv.foreground = BlackPixel(disp, root.scr); gcv.foreground = BlackPixel(disp, root.scr);
gcv.subwindow_mode = IncludeInferiors; gcv.subwindow_mode = IncludeInferiors;
gc = XCreateGC(disp, root.win, GCFunction | GCForeground | GCSubwindowMode, &gcv); gc =
XCreateGC(disp, root.win,
GCFunction | GCForeground | GCSubwindowMode, &gcv);
} }
#define DRAW_H_ARROW(x1, x2, y1) \ #define DRAW_H_ARROW(x1, x2, y1) \
if (((x2) - (x1)) >= 12) \ if (((x2) - (x1)) >= 12) \
@ -1020,8 +1053,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((mode.mode != MODE_NONE) && if ((mode.mode != MODE_NONE) &&
(!ewin->groups || (ewin->groups && !check_move))) (!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2) if (firstlast < 2)
{ {
DO_DRAW_MODE_1(x, y, w, h); DO_DRAW_MODE_1(x, y, w, h);
@ -1036,8 +1071,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((mode.mode != MODE_NONE) && if ((mode.mode != MODE_NONE) &&
(!ewin->groups || (ewin->groups && !check_move))) (!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2) if (firstlast < 2)
{ {
DO_DRAW_MODE_2(x, y, w, h); DO_DRAW_MODE_2(x, y, w, h);
@ -1052,8 +1089,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((mode.mode != MODE_NONE) && if ((mode.mode != MODE_NONE) &&
(!ewin->groups || (ewin->groups && !check_move))) (!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2) if (firstlast < 2)
{ {
DO_DRAW_MODE_3(x, y, w, h); DO_DRAW_MODE_3(x, y, w, h);
@ -1069,8 +1108,10 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if ((mode.mode != MODE_NONE) && if ((mode.mode != MODE_NONE) &&
(!ewin->groups || (ewin->groups && !check_move))) (!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2) if (firstlast < 2)
{ {
DO_DRAW_MODE_4(x, y, w, h); DO_DRAW_MODE_4(x, y, w, h);
@ -1105,10 +1146,12 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
{ {
mode.movemode = 0; mode.movemode = 0;
UngrabX(); UngrabX();
DrawEwinShape(ewin, mode.movemode, x, y, w, h, firstlast); DrawEwinShape(ewin, mode.movemode, x, y, w, h,
firstlast);
EDBUG_RETURN_; EDBUG_RETURN_;
} }
EFillPixmap(root.win, root_pi->pmap, x1, y1, ewin->w, ewin->h); EFillPixmap(root.win, root_pi->pmap, x1, y1, ewin->w,
ewin->h);
gc = XCreateGC(disp, root_pi->pmap, 0, &gcv); gc = XCreateGC(disp, root_pi->pmap, 0, &gcv);
XCopyArea(disp, root_pi->pmap, ewin_pi->pmap, gc, x1, y1, XCopyArea(disp, root_pi->pmap, ewin_pi->pmap, gc, x1, y1,
ewin->w, ewin->h, 0, 0); ewin->w, ewin->h, 0, 0);
@ -1138,11 +1181,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if (dx < 0) if (dx < 0)
EFillPixmap(root.win, root_pi->pmap, x, y, -dx, ht); EFillPixmap(root.win, root_pi->pmap, x, y, -dx, ht);
else if (dx > 0) else if (dx > 0)
EFillPixmap(root.win, root_pi->pmap, x + wt - dx, y, dx, ht); EFillPixmap(root.win, root_pi->pmap, x + wt - dx, y,
dx, ht);
if (dy < 0) if (dy < 0)
EFillPixmap(root.win, root_pi->pmap, x, y, wt, -dy); EFillPixmap(root.win, root_pi->pmap, x, y, wt, -dy);
else if (dy > 0) else if (dy > 0)
EFillPixmap(root.win, root_pi->pmap, x, y + ht - dy, wt, dy); EFillPixmap(root.win, root_pi->pmap, x, y + ht - dy,
wt, dy);
} }
else else
EFillPixmap(root.win, root_pi->pmap, x, y, wt, ht); EFillPixmap(root.win, root_pi->pmap, x, y, wt, ht);
@ -1153,11 +1198,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
if (dx > 0) if (dx > 0)
EPastePixmap(root.win, root_pi->pmap, x1, y1, dx, ht); EPastePixmap(root.win, root_pi->pmap, x1, y1, dx, ht);
else if (dx < 0) else if (dx < 0)
EPastePixmap(root.win, root_pi->pmap, x1 + wt + dx, y1, -dx, ht); EPastePixmap(root.win, root_pi->pmap, x1 + wt + dx,
y1, -dx, ht);
if (dy > 0) if (dy > 0)
EPastePixmap(root.win, root_pi->pmap, x1, y1, wt, dy); EPastePixmap(root.win, root_pi->pmap, x1, y1, wt, dy);
else if (dy < 0) else if (dy < 0)
EPastePixmap(root.win, root_pi->pmap, x1, y1 + ht + dy, wt, -dy); EPastePixmap(root.win, root_pi->pmap, x1,
y1 + ht + dy, wt, -dy);
} }
else else
{ {
@ -1169,7 +1216,8 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
} }
else if (firstlast == 2) else if (firstlast == 2)
{ {
EPastePixmap(root.win, root_pi->pmap, x1, y1, ewin->w, ewin->h); EPastePixmap(root.win, root_pi->pmap, x1, y1, ewin->w,
ewin->h);
if (ewin_pi) if (ewin_pi)
EDestroyPixImg(ewin_pi); EDestroyPixImg(ewin_pi);
if (root_pi) if (root_pi)
@ -1208,14 +1256,17 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
} }
if (mode.mode != MODE_NONE) if (mode.mode != MODE_NONE)
SetCoords(ewin->x, ewin->y, SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc, (ewin->client.w -
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc); ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
} }
if (firstlast == 2) if (firstlast == 2)
{ {
/* If we're moving a group, don't do this, /* If we're moving a group, don't do this,
* otherwise we have a lot of garbage onscreen */ * otherwise we have a lot of garbage onscreen */
if (!ewin->floating || !ewin->groups || (ewin->groups && !check_move)) if (!ewin->floating || !ewin->groups
|| (ewin->groups && !check_move))
{ {
if (ewin->shaded) if (ewin->shaded)
MoveEwin(ewin, ewin->x, ewin->y); MoveEwin(ewin, ewin->x, ewin->y);
@ -1321,13 +1372,16 @@ PropagateShapes(Window win)
if ((att.class == InputOutput) && (att.map_state != IsUnmapped)) if ((att.class == InputOutput) && (att.map_state != IsUnmapped))
{ {
rl = NULL; rl = NULL;
rl = EShapeGetRectangles(disp, list[i], ShapeBounding, &rn, &ord); rl =
EShapeGetRectangles(disp, list[i], ShapeBounding, &rn,
&ord);
if (rl) if (rl)
{ {
num_rects += rn; num_rects += rn;
if (rn > 0) if (rn > 0)
{ {
rects = Erealloc(rects, num_rects * sizeof(XRectangle)); rects =
Erealloc(rects, num_rects * sizeof(XRectangle));
/* go through all clip rects in thsi window's shape */ /* go through all clip rects in thsi window's shape */
for (k = 0; k < rn; k++) for (k = 0; k < rn; k++)
{ {
@ -1335,7 +1389,8 @@ PropagateShapes(Window win)
rects[num_rects - rn + k].x = x + rl[k].x; rects[num_rects - rn + k].x = x + rl[k].x;
rects[num_rects - rn + k].y = y + rl[k].y; rects[num_rects - rn + k].y = y + rl[k].y;
rects[num_rects - rn + k].width = rl[k].width; rects[num_rects - rn + k].width = rl[k].width;
rects[num_rects - rn + k].height = rl[k].height; rects[num_rects - rn + k].height =
rl[k].height;
} }
} }
Efree(rl); Efree(rl);
@ -1355,8 +1410,8 @@ PropagateShapes(Window win)
/* set the rects as the shape mask */ /* set the rects as the shape mask */
if (rects) if (rects)
{ {
EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects, EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects,
ShapeSet, Unsorted); num_rects, ShapeSet, Unsorted);
Efree(rects); Efree(rects);
rl = NULL; rl = NULL;
rl = EShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord); rl = EShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
@ -1375,7 +1430,8 @@ PropagateShapes(Window win)
Efree(rl); Efree(rl);
} }
else else
EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None, ShapeSet); EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None,
ShapeSet);
} }
XFree(list); XFree(list);
} }

View File

@ -29,8 +29,7 @@
char throw_move_events_away = 0; char throw_move_events_away = 0;
void DeskAccountTimeout(int val, void *data); void DeskAccountTimeout(int val, void *data);
HandleStruct HArray[] = HandleStruct HArray[] = {
{
{DefaultFunc}, {DefaultFunc},
{DefaultFunc}, {DefaultFunc},
{HKeyPress}, {HKeyPress},
@ -277,7 +276,8 @@ HandleEvent(XEvent * ev)
if (((ev->type == KeyPress) || (ev->type == KeyRelease)) && if (((ev->type == KeyPress) || (ev->type == KeyRelease)) &&
(ev->xkey.root != root.win)) (ev->xkey.root != root.win))
{ {
XSetInputFocus(disp, ev->xkey.root, RevertToPointerRoot, CurrentTime); XSetInputFocus(disp, ev->xkey.root, RevertToPointerRoot,
CurrentTime);
XSync(disp, False); XSync(disp, False);
ev->xkey.time = CurrentTime; ev->xkey.time = CurrentTime;
XSendEvent(disp, ev->xkey.root, False, 0, ev); XSendEvent(disp, ev->xkey.root, False, 0, ev);
@ -346,8 +346,7 @@ WaitEvent()
/* XEvent ev; */ /* XEvent ev; */
fd_set fdset; fd_set fdset;
struct timeval tval; struct timeval tval;
static struct timeval tval_last = static struct timeval tval_last = { 0, 0 };
{0, 0};
double time1, time2; double time1, time2;
Qentry *qe; Qentry *qe;
int count, pcount; int count, pcount;
@ -661,8 +660,7 @@ HLeaveNotify(XEvent * ev)
if (ev->xcrossing.window == root.win) if (ev->xcrossing.window == root.win)
{ {
if (ev->xcrossing.mode == NotifyNormal && if (ev->xcrossing.mode == NotifyNormal &&
ev->xcrossing.detail != NotifyInferior && ev->xcrossing.detail != NotifyInferior && mode.focuswin)
mode.focuswin)
HandleFocusWindow(root.focuswin); HandleFocusWindow(root.focuswin);
else else
HandleFocusWindow(ev->xcrossing.window); HandleFocusWindow(ev->xcrossing.window);

View File

@ -43,11 +43,11 @@
static ToolTip *ttip = NULL; static ToolTip *ttip = NULL;
struct _mdata struct _mdata
{ {
Menu *m; Menu *m;
MenuItem *mi; MenuItem *mi;
EWin *ewin; EWin *ewin;
}; };
static void ToolTipTimeout(int val, void *data); static void ToolTipTimeout(int val, void *data);
static void SubmenuShowTimeout(int val, void *dat); static void SubmenuShowTimeout(int val, void *dat);
@ -84,8 +84,7 @@ ToolTipTimeout(int val, void *data)
EDBUG_RETURN_; EDBUG_RETURN_;
if (!ttip) if (!ttip)
ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, ttip = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
LIST_TYPE_TOOLTIP);
if (ac->tooltipstring) if (ac->tooltipstring)
{ {
@ -150,7 +149,8 @@ HandleClientMessage(XEvent * ev)
} }
if (ev->xclient.message_type == a4) if (ev->xclient.message_type == a4)
{ {
ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); ewin =
FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
if (ewin) if (ewin)
{ {
ewin->layer = ev->xclient.data.l[0]; ewin->layer = ev->xclient.data.l[0];
@ -163,7 +163,8 @@ HandleClientMessage(XEvent * ev)
} }
if (ev->xclient.message_type == a5) if (ev->xclient.message_type == a5)
{ {
ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); ewin =
FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
if (!ewin) if (!ewin)
EDBUG_RETURN_; EDBUG_RETURN_;
if (ev->xclient.data.l[0] & WIN_STATE_FIXED_POSITION) if (ev->xclient.data.l[0] & WIN_STATE_FIXED_POSITION)
@ -180,7 +181,8 @@ HandleClientMessage(XEvent * ev)
else else
ewin->ignorearrange = 0; ewin->ignorearrange = 0;
} }
if ((ev->xclient.data.l[0] & WIN_STATE_STICKY) && (!ewin->ignorearrange)) if ((ev->xclient.data.l[0] & WIN_STATE_STICKY)
&& (!ewin->ignorearrange))
{ {
if (ev->xclient.data.l[1] & WIN_STATE_STICKY) if (ev->xclient.data.l[1] & WIN_STATE_STICKY)
{ {
@ -190,7 +192,8 @@ HandleClientMessage(XEvent * ev)
RaiseEwin(ewin); RaiseEwin(ewin);
DrawEwin(ewin); DrawEwin(ewin);
ApplySclass(FindItem("SOUND_WINDOW_STICK", 0, ApplySclass(FindItem("SOUND_WINDOW_STICK", 0,
LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); LIST_FINDBY_NAME,
LIST_TYPE_SCLASS));
} }
} }
else else
@ -201,7 +204,8 @@ HandleClientMessage(XEvent * ev)
RaiseEwin(ewin); RaiseEwin(ewin);
DrawEwin(ewin); DrawEwin(ewin);
ApplySclass(FindItem("SOUND_WINDOW_UNSTICK", 0, ApplySclass(FindItem("SOUND_WINDOW_UNSTICK", 0,
LIST_FINDBY_NAME, LIST_TYPE_SCLASS)); LIST_FINDBY_NAME,
LIST_TYPE_SCLASS));
} }
} }
} }
@ -217,9 +221,10 @@ HandleClientMessage(XEvent * ev)
} }
if (ev->xclient.message_type == a6) if (ev->xclient.message_type == a6)
{ {
ewin = FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); ewin =
if ((ewin) && (ev->xclient.data.l[0] == IconicState) && FindItem(NULL, ev->xclient.window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
(!(ewin->iconified))) if ((ewin) && (ev->xclient.data.l[0] == IconicState)
&& (!(ewin->iconified)))
{ {
IconifyEwin(ewin); IconifyEwin(ewin);
EDBUG_RETURN_; EDBUG_RETURN_;
@ -266,7 +271,8 @@ HandleFocusWindowIn(Window win)
DrawEwin(mode.focuswin); DrawEwin(mode.focuswin);
if (mode.focusmode == FOCUS_CLICK) if (mode.focusmode == FOCUS_CLICK)
{ {
XUngrabButton(disp, AnyButton, AnyModifier, mode.focuswin->win_container); XUngrabButton(disp, AnyButton, AnyModifier,
mode.focuswin->win_container);
GrabButtonGrabs(mode.focuswin); GrabButtonGrabs(mode.focuswin);
} }
} }
@ -354,8 +360,7 @@ HandleMotion(XEvent * ev)
if ((!(ev->xmotion.state & (Button1Mask | Button2Mask | if ((!(ev->xmotion.state & (Button1Mask | Button2Mask |
Button3Mask | Button4Mask | Button3Mask | Button4Mask |
Button5Mask)) && Button5Mask)) && (!mode.place)))
(!mode.place)))
{ {
switch (mode.mode) switch (mode.mode)
{ {
@ -389,14 +394,17 @@ HandleMotion(XEvent * ev)
int screen_snap_dist; int screen_snap_dist;
ewin = mode.ewin; ewin = mode.ewin;
gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup,
&num);
if ((mode.moveresize_pending_ewin) && if ((mode.moveresize_pending_ewin) &&
(mode.ewin == mode.moveresize_pending_ewin)) (mode.ewin == mode.moveresize_pending_ewin))
{ {
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x, gwins[i]->y, DrawEwinShape(gwins[i], mode.movemode, gwins[i]->x,
gwins[i]->client.w, gwins[i]->client.h, 0); gwins[i]->y, gwins[i]->client.w,
gwins[i]->client.h, 0);
mode.moveresize_pending_ewin = NULL; mode.moveresize_pending_ewin = NULL;
} }
dx = mode.x - mode.px; dx = mode.x - mode.px;
@ -471,12 +479,23 @@ HandleMotion(XEvent * ev)
/* jump out of snap horizontally */ /* jump out of snap horizontally */
if ((ndx != dx) && if ((ndx != dx) &&
(((gwins[i]->x == 0) && (((gwins[i]->x == 0) &&
(!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, screen_snap_dist)))) || (!(IN_RANGE
((gwins[i]->x == (root.w - gwins[i]->w)) && (gwins[i]->reqx, gwins[i]->x, screen_snap_dist))))
(!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, screen_snap_dist)))) || || ((gwins[i]->x == (root.w - gwins[i]->w))
((gwins[i]->x != 0) && &&
(gwins[i]->x != (root.w - gwins[i]->w) && (!(IN_RANGE
(!(IN_RANGE(gwins[i]->reqx, gwins[i]->x, mode.edge_snap_dist))))))) (gwins[i]->reqx, gwins[i]->x,
screen_snap_dist)))) || ((gwins[i]->x != 0)
&& (gwins[i]->x !=
(root.w -
gwins[i]->w)
&&
(!(IN_RANGE
(gwins[i]->
reqx,
gwins[i]->x,
mode.
edge_snap_dist)))))))
{ {
jumpx = 1; jumpx = 1;
ndx = gwins[i]->reqx - gwins[i]->x + dx; ndx = gwins[i]->reqx - gwins[i]->x + dx;
@ -484,12 +503,23 @@ HandleMotion(XEvent * ev)
/* jump out of snap vertically */ /* jump out of snap vertically */
if ((ndy != dy) && if ((ndy != dy) &&
(((gwins[i]->y == 0) && (((gwins[i]->y == 0) &&
(!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, screen_snap_dist)))) || (!(IN_RANGE
((gwins[i]->y == (root.h - gwins[i]->h)) && (gwins[i]->reqy, gwins[i]->y, screen_snap_dist))))
(!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, screen_snap_dist)))) || || ((gwins[i]->y == (root.h - gwins[i]->h))
((gwins[i]->y != 0) && &&
(gwins[i]->y != (root.h - gwins[i]->h) && (!(IN_RANGE
(!(IN_RANGE(gwins[i]->reqy, gwins[i]->y, mode.edge_snap_dist))))))) (gwins[i]->reqy, gwins[i]->y,
screen_snap_dist)))) || ((gwins[i]->y != 0)
&& (gwins[i]->y !=
(root.h -
gwins[i]->h)
&&
(!(IN_RANGE
(gwins[i]->
reqy,
gwins[i]->y,
mode.
edge_snap_dist)))))))
{ {
jumpy = 1; jumpy = 1;
ndy = gwins[i]->reqy - gwins[i]->y + dy; ndy = gwins[i]->reqy - gwins[i]->y + dy;
@ -547,7 +577,8 @@ HandleMotion(XEvent * ev)
y = mode.win_y + mode.win_h - h; y = mode.win_y + mode.win_h - h;
ewin->client.w = pw; ewin->client.w = pw;
ewin->client.h = ph; ewin->client.h = ph;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
case 1: case 1:
ph = ewin->client.h; ph = ewin->client.h;
@ -563,7 +594,8 @@ HandleMotion(XEvent * ev)
else else
y = mode.win_y + mode.win_h - h; y = mode.win_y + mode.win_h - h;
ewin->client.h = ph; ewin->client.h = ph;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
case 2: case 2:
pw = ewin->client.w; pw = ewin->client.w;
@ -579,14 +611,16 @@ HandleMotion(XEvent * ev)
else else
x = mode.win_x + mode.win_w - w; x = mode.win_x + mode.win_w - w;
ewin->client.w = pw; ewin->client.w = pw;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
case 3: case 3:
w = mode.win_w + (mode.x - mode.start_x); w = mode.win_w + (mode.x - mode.start_x);
h = mode.win_h + (mode.y - mode.start_y); h = mode.win_h + (mode.y - mode.start_y);
x = ewin->x; x = ewin->x;
y = ewin->y; y = ewin->y;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
default: default:
break; break;
@ -613,14 +647,16 @@ HandleMotion(XEvent * ev)
else else
x = mode.win_x + mode.win_w - w; x = mode.win_x + mode.win_w - w;
ewin->client.w = pw; ewin->client.w = pw;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
case 1: case 1:
w = mode.win_w + (mode.x - mode.start_x); w = mode.win_w + (mode.x - mode.start_x);
h = ewin->client.h; h = ewin->client.h;
x = ewin->x; x = ewin->x;
y = ewin->y; y = ewin->y;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
default: default:
break; break;
@ -647,14 +683,16 @@ HandleMotion(XEvent * ev)
else else
y = mode.win_y + mode.win_h - h; y = mode.win_y + mode.win_h - h;
ewin->client.h = ph; ewin->client.h = ph;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
case 1: case 1:
w = ewin->client.w; w = ewin->client.w;
h = mode.win_h + (mode.y - mode.start_y); h = mode.win_h + (mode.y - mode.start_y);
x = ewin->x; x = ewin->x;
y = ewin->y; y = ewin->y;
DrawEwinShape(ewin, mode.resizemode, x, y, w, h, mode.firstlast); DrawEwinShape(ewin, mode.resizemode, x, y, w, h,
mode.firstlast);
break; break;
default: default:
break; break;
@ -716,8 +754,7 @@ HandleMotion(XEvent * ev)
if (mode.button) if (mode.button)
{ {
MovebuttonToCoord(mode.button, MovebuttonToCoord(mode.button,
mode.button->x + dx, mode.button->x + dx, mode.button->y + dy);
mode.button->y + dy);
if (mode.deskmode == MODE_DESKRAY) if (mode.deskmode == MODE_DESKRAY)
{ {
MoveDesktop(mode.deskdrag, desks.desk[mode.deskdrag].x, MoveDesktop(mode.deskdrag, desks.desk[mode.deskdrag].x,
@ -809,8 +846,9 @@ HandleMotion(XEvent * ev)
ydist = offy; ydist = offy;
/* only if any active menus are partially off screen then scroll */ /* only if any active menus are partially off screen then scroll */
if ((((xdist > 0) && (x1 < 0)) || ((xdist < 0) && (x2 >= root.w))) || if ((((xdist > 0) && (x1 < 0)) || ((xdist < 0) && (x2 >= root.w)))
(((ydist > 0) && (y1 < 0)) || ((ydist < 0) && (y2 >= root.h)))) || (((ydist > 0) && (y1 < 0))
|| ((ydist < 0) && (y2 >= root.h))))
{ {
/* If we would scroll too far, limit scrolling to 2/3s of screen */ /* If we would scroll too far, limit scrolling to 2/3s of screen */
if (ydist < -root.h) if (ydist < -root.h)
@ -839,7 +877,8 @@ HandleMotion(XEvent * ev)
} }
} }
} }
SlideEwinsTo(menus, fx, fy, tx, ty, mode.cur_menu_depth, mode.shadespeed); SlideEwinsTo(menus, fx, fy, tx, ty, mode.cur_menu_depth,
mode.shadespeed);
} }
} }
if ((xdist != 0) || (ydist != 0)) if ((xdist != 0) || (ydist != 0))
@ -851,7 +890,8 @@ HandleMotion(XEvent * ev)
p = FindPager(ev->xmotion.window); p = FindPager(ev->xmotion.window);
if (p) if (p)
PagerHandleMotion(p, ev->xmotion.window, ev->xmotion.x, ev->xmotion.y); PagerHandleMotion(p, ev->xmotion.window, ev->xmotion.x,
ev->xmotion.y);
else else
PagerHandleMotion(NULL, ev->xmotion.window, -99, -99); PagerHandleMotion(NULL, ev->xmotion.window, -99, -99);
} }
@ -885,13 +925,16 @@ HandleMotion(XEvent * ev)
x += dx; x += dx;
y += dy; y += dy;
EMoveWindow(disp, p->hi_win, x, y); EMoveWindow(disp, p->hi_win, x, y);
XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py, &dw); XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py,
&dw);
x -= px + (cx * (p->w / ax)); x -= px + (cx * (p->w / ax));
y -= py + (cy * (p->h / ay)); y -= py + (cy * (p->h / ay));
MoveEwin(p->hi_ewin, (x * root.w * ax) / p->w, MoveEwin(p->hi_ewin, (x * root.w * ax) / p->w,
(y * root.h * ay) / p->h); (y * root.h * ay) / p->h);
} }
gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
mode.nogroup, &num);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if ((gwins[i] != p->hi_ewin) && (!gwins[i]->pager) && if ((gwins[i] != p->hi_ewin) && (!gwins[i]->pager) &&
@ -929,18 +972,23 @@ HandleMotion(XEvent * ev)
di->item.slider.wanted_val += dx; di->item.slider.wanted_val += dx;
di->item.slider.val = di->item.slider.lower + di->item.slider.val = di->item.slider.lower +
(((di->item.slider.wanted_val * (((di->item.slider.wanted_val *
(di->item.slider.upper - di->item.slider.lower)) / (di->item.slider.upper -
(di->item.slider.base_w - di->item.slider.knob_w)) / di->item.slider.lower)) /
(di->item.slider.base_w -
di->item.slider.knob_w)) /
di->item.slider.unit) * di->item.slider.unit; di->item.slider.unit) * di->item.slider.unit;
} }
else else
{ {
di->item.slider.wanted_val += dy; di->item.slider.wanted_val += dy;
di->item.slider.val = di->item.slider.lower + di->item.slider.val = di->item.slider.lower +
((((di->item.slider.base_h - di->item.slider.knob_h - ((((di->
item.slider.base_h - di->item.slider.knob_h -
di->item.slider.wanted_val) * di->item.slider.wanted_val) *
(di->item.slider.upper - di->item.slider.lower)) / (di->item.slider.upper -
(di->item.slider.base_h - di->item.slider.knob_h)) / di->item.slider.lower)) /
(di->item.slider.base_h -
di->item.slider.knob_h)) /
di->item.slider.unit) * di->item.slider.unit; di->item.slider.unit) * di->item.slider.unit;
} }
if (di->item.slider.val < di->item.slider.lower) if (di->item.slider.val < di->item.slider.lower)
@ -1013,7 +1061,8 @@ HandleDestroy(XEvent * ev)
} }
if (mode.doingslide) if (mode.doingslide)
{ {
DrawEwinShape(ewin, mode.slidemode, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 2); DrawEwinShape(ewin, mode.slidemode, ewin->x, ewin->y,
ewin->client.w, ewin->client.h, 2);
mode.doingslide = 0; mode.doingslide = 0;
} }
if (ewin == mode.focuswin) if (ewin == mode.focuswin)
@ -1179,7 +1228,9 @@ HandleReparent(XEvent * ev)
Efree(lst); Efree(lst);
if (!found) if (!found)
{ {
ewin = RemoveItem(NULL, ev->xreparent.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); ewin =
RemoveItem(NULL, ev->xreparent.window, LIST_FINDBY_ID,
LIST_TYPE_EWIN);
if (ewin) if (ewin)
{ {
if (ewin == mode.ewin) if (ewin == mode.ewin)
@ -1274,8 +1325,7 @@ HandleConfigureRequest(XEvent * ev)
ewin->client.height.max = h; ewin->client.height.max = h;
MoveResizeEwin(ewin, MoveResizeEwin(ewin,
x - ewin->border->border.left, x - ewin->border->border.left,
y - ewin->border->border.top, y - ewin->border->border.top, w, h);
w, h);
if (mode.mode == MODE_MOVE) if (mode.mode == MODE_MOVE)
ICCCM_Configure(ewin); ICCCM_Configure(ewin);
{ {
@ -1334,7 +1384,8 @@ HandleResizeRequest(XEvent * ev)
ReZoom(ewin); ReZoom(ewin);
} }
else else
EResizeWindow(disp, win, ev->xresizerequest.width, ev->xresizerequest.height); EResizeWindow(disp, win, ev->xresizerequest.width,
ev->xresizerequest.height);
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -1440,7 +1491,8 @@ HandleMapRequest(XEvent * ev)
{ {
EWin *ewin; EWin *ewin;
ewin = FindItem(NULL, ev->xmap.window, LIST_FINDBY_ID, LIST_TYPE_EWIN); ewin =
FindItem(NULL, ev->xmap.window, LIST_FINDBY_ID, LIST_TYPE_EWIN);
KDE_NewWindow(ewin); KDE_NewWindow(ewin);
} }
@ -1565,7 +1617,8 @@ HandleMouseDown(XEvent * ev)
unsigned int bmask = 0, evmask; unsigned int bmask = 0, evmask;
evmask = ev->xbutton.state & evmask = ev->xbutton.state &
(Button1Mask | Button2Mask | Button3Mask | Button4Mask | Button5Mask); (Button1Mask | Button2Mask | Button3Mask | Button4Mask |
Button5Mask);
if (ev->xbutton.button == 1) if (ev->xbutton.button == 1)
bmask = Button1Mask; bmask = Button1Mask;
else if (ev->xbutton.button == 2) else if (ev->xbutton.button == 2)
@ -1589,8 +1642,8 @@ HandleMouseDown(XEvent * ev)
if (mode.tooltips) if (mode.tooltips)
DoIn("TOOLTIP_TIMEOUT", mode.tiptime, ToolTipTimeout, 0, NULL); DoIn("TOOLTIP_TIMEOUT", mode.tiptime, ToolTipTimeout, 0, NULL);
if ((((float)(ev->xbutton.time - last_time) / 1000) < mode_double_click_time) && if ((((float)(ev->xbutton.time - last_time) / 1000) < mode_double_click_time)
((int)(ev->xbutton.button) == (int)(last_button))) && ((int)(ev->xbutton.button) == (int)(last_button)))
double_click = 1; double_click = 1;
last_time = ev->xbutton.time; last_time = ev->xbutton.time;
last_button = ev->xbutton.button; last_button = ev->xbutton.button;
@ -1615,8 +1668,7 @@ HandleMouseDown(XEvent * ev)
XUngrabPointer(disp, CurrentTime); XUngrabPointer(disp, CurrentTime);
ac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME, ac = FindItem("DESKBINDINGS", 0, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
LIST_TYPE_ACLASS);
if (ac) if (ac)
{ {
if (!EventAclass(ev, ac)) if (!EventAclass(ev, ac))
@ -1667,7 +1719,8 @@ HandleMouseDown(XEvent * ev)
ewin2 = FindEwinByMenu(mi->child); ewin2 = FindEwinByMenu(mi->child);
if (ewin2) if (ewin2)
{ {
MoveEwin(ewin2, ewin->x + ewin->border->border.left + mx + mw, MoveEwin(ewin2,
ewin->x + ewin->border->border.left + mx + mw,
ewin->y + ewin->border->border.top + my - ewin->y + ewin->border->border.top + my -
ewin2->border->border.top); ewin2->border->border.top);
RaiseEwin(ewin2); RaiseEwin(ewin2);
@ -1702,7 +1755,8 @@ HandleMouseDown(XEvent * ev)
mode.context_ewin = ewins[i]; mode.context_ewin = ewins[i];
mode.borderpartpress = 1; mode.borderpartpress = 1;
if (ewins[i]->border->part[j].aclass) if (ewins[i]->border->part[j].aclass)
EventAclass(ev, ewins[i]->border->part[j].aclass); EventAclass(ev,
ewins[i]->border->part[j].aclass);
mode.borderpartpress = 0; mode.borderpartpress = 0;
} }
Efree(ewins); Efree(ewins);
@ -1721,7 +1775,8 @@ HandleMouseDown(XEvent * ev)
{ {
GrabThePointer(win); GrabThePointer(win);
if (buttons[i]->inside_win) if (buttons[i]->inside_win)
XSendEvent(disp, buttons[i]->inside_win, False, ButtonPressMask, ev); XSendEvent(disp, buttons[i]->inside_win, False,
ButtonPressMask, ev);
mode.button = buttons[i]; mode.button = buttons[i];
buttons[i]->state = STATE_CLICKED; buttons[i]->state = STATE_CLICKED;
DrawButton(buttons[i]); DrawButton(buttons[i]);
@ -1792,9 +1847,11 @@ HandleMouseDown(XEvent * ev)
{ {
di->item.slider.in_drag = 1; di->item.slider.in_drag = 1;
if (di->item.slider.horizontal) if (di->item.slider.horizontal)
di->item.slider.wanted_val = di->item.slider.knob_x; di->item.slider.wanted_val =
di->item.slider.knob_x;
else else
di->item.slider.wanted_val = di->item.slider.knob_y; di->item.slider.wanted_val =
di->item.slider.knob_y;
} }
} }
di->clicked = 1; di->clicked = 1;
@ -1808,8 +1865,7 @@ HandleMouseDown(XEvent * ev)
ActionClass *ac; ActionClass *ac;
ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0,
LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
LIST_TYPE_ACLASS);
if (ac) if (ac)
{ {
mode.ewin = ewin; mode.ewin = ewin;
@ -1847,24 +1903,24 @@ HandleMouseDown(XEvent * ev)
int hx, hy; int hx, hy;
Window dw; Window dw;
XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, &dw); XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy,
&dw);
ev->xbutton.x += hx; ev->xbutton.x += hx;
ev->xbutton.y += hy; ev->xbutton.y += hy;
} }
if (ev->xbutton.button == 3) if (ev->xbutton.button == mode.pager_menu_button)
{ {
if ((ev->xbutton.x >= 0) && (ev->xbutton.y >= 0) && if ((ev->xbutton.x >= 0) && (ev->xbutton.y >= 0) &&
(ev->xbutton.x < p->w) && (ev->xbutton.y < p->h)) (ev->xbutton.x < p->w) && (ev->xbutton.y < p->h))
PagerShowMenu(p, ev->xbutton.x, ev->xbutton.y); PagerShowMenu(p, ev->xbutton.x, ev->xbutton.y);
} }
else if (ev->xbutton.button == 1) else if (ev->xbutton.button == mode.pager_win_button)
{ {
ewin = EwinInPagerAt(p, ev->xbutton.x, ev->xbutton.y); ewin = EwinInPagerAt(p, ev->xbutton.x, ev->xbutton.y);
if ((ewin) && (!ewin->pager)) if ((ewin) && (!ewin->pager))
{ {
Window dw; Window dw;
int wx, wy, ww, wh, ax, ay, cx, cy, int wx, wy, ww, wh, ax, ay, cx, cy, px, py;
px, py;
PagerHideHi(p); PagerHideHi(p);
pwin_px = ewin->x; pwin_px = ewin->x;
@ -1876,9 +1932,12 @@ HandleMouseDown(XEvent * ev)
wy = ((ewin->y + (cy * root.h)) * (p->h / ay)) / root.h; wy = ((ewin->y + (cy * root.h)) * (p->h / ay)) / root.h;
ww = ((ewin->w) * (p->w / ax)) / root.w; ww = ((ewin->w) * (p->w / ax)) / root.w;
wh = ((ewin->h) * (p->h / ay)) / root.h; wh = ((ewin->h) * (p->h / ay)) / root.h;
XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px, &py, &dw); XTranslateCoordinates(disp, p->win, root.win, 0, 0, &px,
EMoveResizeWindow(disp, p->hi_win, px + wx, py + wy, ww, wh); &py, &dw);
ESetWindowBackgroundPixmap(disp, p->hi_win, ewin->mini_pmap); EMoveResizeWindow(disp, p->hi_win, px + wx, py + wy, ww,
wh);
ESetWindowBackgroundPixmap(disp, p->hi_win,
ewin->mini_pmap);
EMapRaised(disp, p->hi_win); EMapRaised(disp, p->hi_win);
GrabThePointer(p->hi_win); GrabThePointer(p->hi_win);
p->hi_visible = 1; p->hi_visible = 1;
@ -1936,7 +1995,9 @@ HandleMouseUp(XEvent * ev)
ewin = GetEwin(); ewin = GetEwin();
if (ewin) if (ewin)
{ {
gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup,
&num);
if ((mode.movemode == 0) && (mode.mode == MODE_MOVE)) if ((mode.movemode == 0) && (mode.mode == MODE_MOVE))
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
DetermineEwinFloat(gwins[i], 0, 0); DetermineEwinFloat(gwins[i], 0, 0);
@ -1991,7 +2052,9 @@ HandleMouseUp(XEvent * ev)
ewin = GetEwin(); ewin = GetEwin();
if (ewin) if (ewin)
{ {
gwins = ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup, &num); gwins =
ListWinGroupMembersForEwin(ewin, ACTION_MOVE, mode.nogroup,
&num);
if ((mode.movemode == 0) && (mode.mode == MODE_MOVE)) if ((mode.movemode == 0) && (mode.mode == MODE_MOVE))
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
DetermineEwinFloat(gwins[i], 0, 0); DetermineEwinFloat(gwins[i], 0, 0);
@ -2149,8 +2212,9 @@ HandleMouseUp(XEvent * ev)
if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) if ((!ewins[i]->menu) && (!mode.cur_menu_mode))
mode.context_ewin = ewins[i]; mode.context_ewin = ewins[i];
mode.borderpartpress = 1; mode.borderpartpress = 1;
if ((click_was_in == win2) && (ewins[i]->border->part[j].aclass) && if ((click_was_in == win2)
(!wasmovres)) && (ewins[i]->border->part[j].aclass)
&& (!wasmovres))
EventAclass(ev, ewins[i]->border->part[j].aclass); EventAclass(ev, ewins[i]->border->part[j].aclass);
mode.borderpartpress = 0; mode.borderpartpress = 0;
if ((mode.slideout) && (pslideout)) if ((mode.slideout) && (pslideout))
@ -2170,7 +2234,8 @@ HandleMouseUp(XEvent * ev)
buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON); buttons = (Button **) ListItemType(&num, LIST_TYPE_BUTTON);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if ((click_was_in == buttons[i]->win) || (click_was_in == buttons[i]->event_win)) if ((click_was_in == buttons[i]->win)
|| (click_was_in == buttons[i]->event_win))
{ {
if ((buttons[i]->inside_win) && (!wasmovres)) if ((buttons[i]->inside_win) && (!wasmovres))
XSendEvent(disp, buttons[i]->inside_win, False, XSendEvent(disp, buttons[i]->inside_win, False,
@ -2269,8 +2334,7 @@ HandleMouseUp(XEvent * ev)
ActionClass *ac; ActionClass *ac;
ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0, ac = (ActionClass *) FindItem("BUTTONBINDINGS", 0,
LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_ACLASS);
LIST_TYPE_ACLASS);
if (ac) if (ac)
{ {
mode.borderpartpress = 1; mode.borderpartpress = 1;
@ -2292,7 +2356,7 @@ HandleMouseUp(XEvent * ev)
int pax, pay; int pax, pay;
p = FindPager(ev->xbutton.window); p = FindPager(ev->xbutton.window);
if ((p) && (ev->xbutton.button == 2)) if ((p) && (ev->xbutton.button == mode.pager_sel_button))
{ {
PagerAreaAt(p, ev->xbutton.x, ev->xbutton.y, &pax, &pay); PagerAreaAt(p, ev->xbutton.x, ev->xbutton.y, &pax, &pay);
GotoDesktop(p->desktop); GotoDesktop(p->desktop);
@ -2302,14 +2366,15 @@ HandleMouseUp(XEvent * ev)
} }
SetCurrentArea(pax, pay); SetCurrentArea(pax, pay);
} }
else if ((p) && (ev->xbutton.button == 1)) else if ((p) && (ev->xbutton.button == mode.pager_win_button))
{ {
if (ev->xbutton.window == p->hi_win) if (ev->xbutton.window == p->hi_win)
{ {
int hx, hy; int hx, hy;
Window dw; Window dw;
XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy, &dw); XTranslateCoordinates(disp, p->hi_win, p->win, 0, 0, &hx, &hy,
&dw);
ev->xbutton.x += hx; ev->xbutton.x += hx;
ev->xbutton.y += hy; ev->xbutton.y += hy;
} }
@ -2325,13 +2390,18 @@ HandleMouseUp(XEvent * ev)
ew = desks.desk[desks.current].list[i]; ew = desks.desk[desks.current].list[i];
if (((ew->pager) || (ew->ibox)) && if (((ew->pager) || (ew->ibox)) &&
((ew->desktop == desks.current) || ((ew->desktop == desks.current) || (ew->sticky)))
(ew->sticky)))
{ {
if ((ev->xbutton.x_root >= (ew->x + ew->border->border.left)) && if (
(ev->xbutton.x_root < (ew->x + ew->w - ew->border->border.right)) && (ev->xbutton.x_root >=
(ev->xbutton.y_root >= (ew->y + ew->border->border.top)) && (ew->x + ew->border->border.left))
(ev->xbutton.y_root < (ew->y + ew->h - ew->border->border.bottom))) && (ev->xbutton.x_root <
(ew->x + ew->w - ew->border->border.right))
&& (ev->xbutton.y_root >=
(ew->y + ew->border->border.top))
&& (ev->xbutton.y_root <
(ew->y + ew->h -
ew->border->border.bottom)))
{ {
ewin = ew; ewin = ew;
i = desks.desk[desks.current].num; i = desks.desk[desks.current].num;
@ -2342,13 +2412,13 @@ HandleMouseUp(XEvent * ev)
if ((ewin) && (ewin->pager)) if ((ewin) && (ewin->pager))
{ {
Pager *pp; Pager *pp;
int w, h, x, y, ax, ay, cx, cy, px, int w, h, x, y, ax, ay, cx, cy, px, py;
py;
int wx, wy, base_x = 0, base_y = 0; int wx, wy, base_x = 0, base_y = 0;
Window dw; Window dw;
gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, gwins =
mode.nogroup, &num); ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
mode.nogroup, &num);
pp = ewin->pager; pp = ewin->pager;
cx = desks.desk[pp->desktop].current_area_x; cx = desks.desk[pp->desktop].current_area_x;
cy = desks.desk[pp->desktop].current_area_y; cy = desks.desk[pp->desktop].current_area_y;
@ -2363,8 +2433,7 @@ HandleMouseUp(XEvent * ev)
(root.h / (pp->h / ay)); (root.h / (pp->h / ay));
if (((x + w) <= px) || if (((x + w) <= px) ||
((y + h) <= py) || ((y + h) <= py) ||
(x >= (px + pp->w)) || (x >= (px + pp->w)) || (y >= (py + pp->h)))
(y >= (py + pp->h)))
{ {
int ndesk, nx, ny; int ndesk, nx, ny;
@ -2381,7 +2450,9 @@ HandleMouseUp(XEvent * ev)
} }
else else
{ {
gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, gwins =
ListWinGroupMembersForEwin(p->hi_ewin,
ACTION_MOVE,
mode.nogroup, &num); mode.nogroup, &num);
/* get get the location of the base win so we can move the */ /* get get the location of the base win so we can move the */
/* rest of the windows in the group to the correct offset */ /* rest of the windows in the group to the correct offset */
@ -2395,25 +2466,29 @@ HandleMouseUp(XEvent * ev)
{ {
if (!gwins[i]->sticky) if (!gwins[i]->sticky)
MoveEwinToDesktopAt(gwins[i], pp->desktop, MoveEwinToDesktopAt(gwins[i], pp->desktop,
wx + (gwin_px[i] - base_x), wx + (gwin_px[i] -
wy + (gwin_py[i] - base_y)); base_x),
wy + (gwin_py[i] -
base_y));
else else
MoveEwin(gwins[i], MoveEwin(gwins[i],
((root.w * ax) + wx + (gwin_px[i] - base_x)) % root.w, ((root.w * ax) + wx +
((root.h * ay) + wy + (gwin_py[i] - base_y)) % root.h); (gwin_px[i] - base_x)) % root.w,
((root.h * ay) + wy +
(gwin_py[i] - base_y)) % root.h);
} }
} }
} }
else if ((ewin) && (ewin->ibox) && else if ((ewin) && (ewin->ibox) &&
(!((p->hi_ewin->ibox) || (!((p->hi_ewin->ibox) ||
((ewin->client.need_input) && ((ewin->client.need_input) &&
((ewin->skiptask) || (ewin->skipwinlist))) ((ewin->skiptask) || (ewin->skipwinlist))))))
)))
{ {
char was_shaded; char was_shaded;
gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, gwins =
mode.nogroup, &num); ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
mode.nogroup, &num);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if (!gwins[i]->pager) if (!gwins[i]->pager)
@ -2424,13 +2499,19 @@ HandleMouseUp(XEvent * ev)
if (ewin->ibox) if (ewin->ibox)
{ {
IB_Animate(1, gwins[i], ewin->ibox->ewin); IB_Animate(1, gwins[i], ewin->ibox->ewin);
UpdateAppIcon(gwins[i], ewin->ibox->icon_mode); UpdateAppIcon(gwins[i],
ewin->ibox->icon_mode);
} }
HideEwin(gwins[i]); HideEwin(gwins[i]);
MoveEwin(gwins[i], gwin_px[i] + MoveEwin(gwins[i], gwin_px[i] +
((desks.desk[gwins[i]->desktop].current_area_x) - ((desks.
p->hi_ewin->area_x) * root.w, gwin_py[i] + desk[gwins[i]->desktop].
((desks.desk[gwins[i]->desktop].current_area_y) - current_area_x) -
p->hi_ewin->area_x) * root.w,
gwin_py[i] +
((desks.
desk[gwins[i]->desktop].
current_area_y) -
p->hi_ewin->area_y) * root.h); p->hi_ewin->area_y) * root.h);
if (was_shaded != gwins[i]->shaded) if (was_shaded != gwins[i]->shaded)
InstantShadeEwin(gwins[i]); InstantShadeEwin(gwins[i]);
@ -2441,8 +2522,8 @@ HandleMouseUp(XEvent * ev)
} }
else else
{ {
int ndesk, nx, ny, base_x = 0, base_y = 0, int ndesk, nx, ny, base_x = 0, base_y =
ax, ay; 0, ax, ay;
ndesk = desks.current; ndesk = desks.current;
nx = (int)ev->xbutton.x_root - nx = (int)ev->xbutton.x_root -
@ -2453,8 +2534,9 @@ HandleMouseUp(XEvent * ev)
((int)p->hi_ewin->h / 2); ((int)p->hi_ewin->h / 2);
GetAreaSize(&ax, &ay); GetAreaSize(&ax, &ay);
gwins = ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE, gwins =
mode.nogroup, &num); ListWinGroupMembersForEwin(p->hi_ewin, ACTION_MOVE,
mode.nogroup, &num);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
if (gwins[i] == p->hi_ewin) if (gwins[i] == p->hi_ewin)
{ {
@ -2468,8 +2550,10 @@ HandleMouseUp(XEvent * ev)
ny + (gwin_py[i] - base_y)); ny + (gwin_py[i] - base_y));
else else
MoveEwin(gwins[i], MoveEwin(gwins[i],
((root.w * ax) + nx + (gwin_px[i] - base_x)) % root.w, ((root.w * ax) + nx +
((root.h * ay) + ny + (gwin_py[i] - base_y)) % root.h); (gwin_px[i] - base_x)) % root.w,
((root.h * ay) + ny +
(gwin_py[i] - base_y)) % root.h);
if (!gwins[i]->sticky) if (!gwins[i]->sticky)
MoveEwinToDesktop(gwins[i], ndesk); MoveEwinToDesktop(gwins[i], ndesk);
} }
@ -2533,7 +2617,8 @@ SubmenuShowTimeout(int val, void *dat)
ewin2 = FindEwinByMenu(data->mi->child); ewin2 = FindEwinByMenu(data->mi->child);
if (ewin2) if (ewin2)
{ {
MoveEwin(ewin2, data->ewin->x + data->ewin->border->border.left + mx + mw, MoveEwin(ewin2,
data->ewin->x + data->ewin->border->border.left + mx + mw,
data->ewin->y + data->ewin->border->border.top + my - data->ewin->y + data->ewin->border->border.top + my -
ewin2->border->border.top); ewin2->border->border.top);
RaiseEwin(ewin2); RaiseEwin(ewin2);
@ -2645,8 +2730,7 @@ HandleMouseIn(XEvent * ev)
mdata.m = m; mdata.m = m;
mdata.mi = mi; mdata.mi = mi;
mdata.ewin = ewin; mdata.ewin = ewin;
DoIn("SUBMENU_SHOW", 0.2, SubmenuShowTimeout, DoIn("SUBMENU_SHOW", 0.2, SubmenuShowTimeout, 0, &mdata);
0, &mdata);
} }
} }
EDBUG_RETURN_; EDBUG_RETURN_;
@ -2672,7 +2756,8 @@ HandleMouseIn(XEvent * ev)
if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) if ((!ewins[i]->menu) && (!mode.cur_menu_mode))
mode.context_ewin = ewins[i]; mode.context_ewin = ewins[i];
if (ewins[i]->border->part[j].aclass) if (ewins[i]->border->part[j].aclass)
EventAclass(ev, ewins[i]->border->part[j].aclass); EventAclass(ev,
ewins[i]->border->part[j].aclass);
} }
} }
Efree(ewins); Efree(ewins);
@ -2797,7 +2882,8 @@ HandleMouseOut(XEvent * ev)
if ((!ewins[i]->menu) && (!mode.cur_menu_mode)) if ((!ewins[i]->menu) && (!mode.cur_menu_mode))
mode.context_ewin = ewins[i]; mode.context_ewin = ewins[i];
if (ewins[i]->border->part[j].aclass) if (ewins[i]->border->part[j].aclass)
EventAclass(ev, ewins[i]->border->part[j].aclass); EventAclass(ev,
ewins[i]->border->part[j].aclass);
} }
} }
Efree(ewins); Efree(ewins);

View File

@ -54,8 +54,7 @@ Etmp(char *s)
n_calls = (unsigned long)time(NULL) + (unsigned long)getpid(); n_calls = (unsigned long)time(NULL) + (unsigned long)getpid();
Esnprintf(s, 1024, "%s/TMP_%Xl", UserEDir(), n_calls); Esnprintf(s, 1024, "%s/TMP_%Xl", UserEDir(), n_calls);
n_calls++; n_calls++;
EDBUG_RETURN_ EDBUG_RETURN_}
}
void void
md(char *s) md(char *s)
@ -263,8 +262,7 @@ cp(char *s, char *ss)
EDBUG_RETURN_; EDBUG_RETURN_;
} }
time_t time_t moddate(char *s)
moddate(char *s)
{ {
struct stat st; struct stat st;
@ -762,8 +760,7 @@ field(char *s, int field)
fword(s, field + 1, buf); fword(s, field + 1, buf);
if (buf[0]) if (buf[0])
{ {
if ((!strcmp(buf, "NULL")) || if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)")))
(!strcmp(buf, "(null)")))
EDBUG_RETURN(NULL); EDBUG_RETURN(NULL);
EDBUG_RETURN(duplicate(buf)); EDBUG_RETURN(duplicate(buf));
} }
@ -780,8 +777,7 @@ fillfield(char *s, int field, char *buf)
fword(s, field + 1, buf); fword(s, field + 1, buf);
if (buf[0]) if (buf[0])
{ {
if ((!strcmp(buf, "NULL")) || if ((!strcmp(buf, "NULL")) || (!strcmp(buf, "(null)")))
(!strcmp(buf, "(null)")))
{ {
buf[0] = 0; buf[0] = 0;
EDBUG_RETURN(0); EDBUG_RETURN(0);

View File

@ -249,7 +249,9 @@ ListWinGroups(EWin * ewin, char group_select, int *num)
{ {
case GROUP_SELECT_EWIN_ONLY: case GROUP_SELECT_EWIN_ONLY:
groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups); groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups);
groups = (Group **) memcpy(groups, ewin->groups, sizeof(Group *) * ewin->num_groups); groups =
(Group **) memcpy(groups, ewin->groups,
sizeof(Group *) * ewin->num_groups);
*num = ewin->num_groups; *num = ewin->num_groups;
break; break;
case GROUP_SELECT_ALL_EXCEPT_EWIN: case GROUP_SELECT_ALL_EXCEPT_EWIN:
@ -347,12 +349,16 @@ ListWinGroupMembersForEwin(EWin * ewin, int action, char nogroup, int *num)
if (!daddy_says_no_no) if (!daddy_says_no_no)
{ {
gwins = Erealloc(gwins, sizeof(EWin *) * (*num + ewin->groups[i]->num_members)); gwins =
Erealloc(gwins,
sizeof(EWin *) * (*num +
ewin->groups[i]->num_members));
/* Check if a window is not already in the group */ /* Check if a window is not already in the group */
for (k = 0; k < ewin->groups[i]->num_members; k++) for (k = 0; k < ewin->groups[i]->num_members; k++)
{ {
/* To get consistent behaviour, limit groups to a single desktop for now: */ /* To get consistent behaviour, limit groups to a single desktop for now: */
if (ewin->groups[i]->members[k]->desktop == ewin->desktop) if (ewin->groups[i]->members[k]->desktop ==
ewin->desktop)
{ {
inlist = 0; inlist = 0;
for (j = 0; j < (*num); j++) for (j = 0; j < (*num); j++)

View File

@ -75,9 +75,9 @@ GetNextFocusEwin(void)
if (((ewin->sticky) || (ewin->desktop == desks.current)) && if (((ewin->sticky) || (ewin->desktop == desks.current)) &&
((ewin->area_x == ax) && (ewin->area_y == ay)) && ((ewin->area_x == ax) && (ewin->area_y == ay)) &&
(!ewin->skipfocus) && (!ewin->shaded) && (!ewin->skipfocus) && (!ewin->shaded) &&
(!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) &&
(!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && * (ewin->client.mwm_decor_border) */
* (ewin->client.mwm_decor_border) */ ) )
{ {
num++; num++;
lst = Erealloc(lst, sizeof(EWin *) * num); lst = Erealloc(lst, sizeof(EWin *) * num);
@ -146,9 +146,9 @@ GetPrevFocusEwin(void)
if (((ewin->sticky) || (ewin->desktop == desks.current)) && if (((ewin->sticky) || (ewin->desktop == desks.current)) &&
((ewin->area_x == ax) && (ewin->area_y == ay)) && ((ewin->area_x == ax) && (ewin->area_y == ay)) &&
(!ewin->skipfocus) && (!ewin->shaded) && (!ewin->skipfocus) && (!ewin->shaded) &&
(!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) &&
(!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && * (ewin->client.mwm_decor_border) */
* (ewin->client.mwm_decor_border) */ ) )
{ {
num++; num++;
lst = Erealloc(lst, sizeof(EWin *) * num); lst = Erealloc(lst, sizeof(EWin *) * num);
@ -207,13 +207,14 @@ FixFocus(void)
if (mode.focusmode == FOCUS_CLICK) if (mode.focusmode == FOCUS_CLICK)
{ {
if (!(ewin->active)) if (!(ewin->active))
XGrabButton(disp, AnyButton, AnyModifier, ewin->win_container, XGrabButton(disp, AnyButton, AnyModifier,
False, ButtonPressMask, ewin->win_container, False, ButtonPressMask,
GrabModeSync, GrabModeAsync, None, None); GrabModeSync, GrabModeAsync, None, None);
} }
else else
{ {
XUngrabButton(disp, AnyButton, AnyModifier, ewin->win_container); XUngrabButton(disp, AnyButton, AnyModifier,
ewin->win_container);
GrabButtonGrabs(ewin); GrabButtonGrabs(ewin);
} }
} }
@ -345,7 +346,8 @@ FocusToEWin(EWin * ewin)
if ((ax != ewin->area_x) || (ay != ewin->area_y)) if ((ax != ewin->area_x) || (ay != ewin->area_y))
{ {
if ((ewin->x >= root.w) || (ewin->y >= root.h) || if ((ewin->x >= root.w) || (ewin->y >= root.h) ||
((ewin->x + ewin->w) < 0) || ((ewin->y + ewin->h) < 0)) ((ewin->x + ewin->w) < 0)
|| ((ewin->y + ewin->h) < 0))
SetCurrentArea(ewin->area_x, ewin->area_y); SetCurrentArea(ewin->area_x, ewin->area_y);
} }
} }
@ -379,8 +381,7 @@ BeginNewDeskFocus(void)
FocusChangeMask | FocusChangeMask |
SubstructureNotifyMask | SubstructureNotifyMask |
SubstructureRedirectMask | SubstructureRedirectMask |
PropertyChangeMask | PropertyChangeMask | ResizeRedirectMask);
ResizeRedirectMask);
if (ewin->pager) if (ewin->pager)
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
@ -389,35 +390,29 @@ BeginNewDeskFocus(void)
StructureNotifyMask | StructureNotifyMask |
ColormapChangeMask | ColormapChangeMask |
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask | PointerMotionMask);
PointerMotionMask);
else if (ewin->dialog) else if (ewin->dialog)
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
FocusChangeMask | FocusChangeMask |
ResizeRedirectMask | ResizeRedirectMask |
StructureNotifyMask | StructureNotifyMask |
ColormapChangeMask | ColormapChangeMask | ExposureMask | KeyPressMask);
ExposureMask |
KeyPressMask);
else else
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
FocusChangeMask | FocusChangeMask |
ResizeRedirectMask | ResizeRedirectMask |
StructureNotifyMask | StructureNotifyMask | ColormapChangeMask);
ColormapChangeMask);
for (j = 0; j < ewin->border->num_winparts; j++) for (j = 0; j < ewin->border->num_winparts; j++)
{ {
if (ewin->border->part[j].flags & FLAG_TITLE) if (ewin->border->part[j].flags & FLAG_TITLE)
XSelectInput(disp, ewin->bits[j].win, XSelectInput(disp, ewin->bits[j].win,
ExposureMask | ExposureMask |
ButtonPressMask | ButtonPressMask | ButtonReleaseMask);
ButtonReleaseMask);
else else
XSelectInput(disp, ewin->bits[j].win, XSelectInput(disp, ewin->bits[j].win,
ButtonPressMask | ButtonPressMask | ButtonReleaseMask);
ButtonReleaseMask);
} }
} }
Efree(lst); Efree(lst);
@ -426,8 +421,7 @@ BeginNewDeskFocus(void)
XSelectInput(disp, desks.desk[i].win, XSelectInput(disp, desks.desk[i].win,
PropertyChangeMask | PropertyChangeMask |
SubstructureRedirectMask | SubstructureRedirectMask |
ButtonPressMask | ButtonPressMask | ButtonReleaseMask);
ButtonReleaseMask);
} }
void void
@ -454,8 +448,7 @@ NewDeskFocus(void)
PointerMotionMask | PointerMotionMask |
PropertyChangeMask | PropertyChangeMask |
ResizeRedirectMask | ResizeRedirectMask |
ButtonPressMask | ButtonPressMask | ButtonReleaseMask);
ButtonReleaseMask);
if (ewin->pager) if (ewin->pager)
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
@ -466,8 +459,7 @@ NewDeskFocus(void)
StructureNotifyMask | StructureNotifyMask |
ColormapChangeMask | ColormapChangeMask |
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask | PointerMotionMask);
PointerMotionMask);
else if (ewin->dialog) else if (ewin->dialog)
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
@ -476,9 +468,7 @@ NewDeskFocus(void)
FocusChangeMask | FocusChangeMask |
ResizeRedirectMask | ResizeRedirectMask |
StructureNotifyMask | StructureNotifyMask |
ColormapChangeMask | ColormapChangeMask | ExposureMask | KeyPressMask);
ExposureMask |
KeyPressMask);
else else
XSelectInput(disp, ewin->client.win, XSelectInput(disp, ewin->client.win,
PropertyChangeMask | PropertyChangeMask |
@ -486,8 +476,7 @@ NewDeskFocus(void)
LeaveWindowMask | LeaveWindowMask |
FocusChangeMask | FocusChangeMask |
ResizeRedirectMask | ResizeRedirectMask |
StructureNotifyMask | StructureNotifyMask | ColormapChangeMask);
ColormapChangeMask);
for (j = 0; j < ewin->border->num_winparts; j++) for (j = 0; j < ewin->border->num_winparts; j++)
{ {
if (ewin->border->part[j].flags & FLAG_TITLE) if (ewin->border->part[j].flags & FLAG_TITLE)
@ -498,8 +487,7 @@ NewDeskFocus(void)
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask |
EnterWindowMask | EnterWindowMask |
LeaveWindowMask | LeaveWindowMask | PointerMotionMask);
PointerMotionMask);
else else
XSelectInput(disp, ewin->bits[j].win, XSelectInput(disp, ewin->bits[j].win,
KeyPressMask | KeyPressMask |
@ -507,8 +495,7 @@ NewDeskFocus(void)
ButtonPressMask | ButtonPressMask |
ButtonReleaseMask | ButtonReleaseMask |
EnterWindowMask | EnterWindowMask |
LeaveWindowMask | LeaveWindowMask | PointerMotionMask);
PointerMotionMask);
} }
} }
Efree(lst); Efree(lst);
@ -523,11 +510,8 @@ NewDeskFocus(void)
ButtonMotionMask | ButtonMotionMask |
PropertyChangeMask | PropertyChangeMask |
SubstructureRedirectMask | SubstructureRedirectMask |
KeyPressMask | KeyPressMask | KeyReleaseMask | PointerMotionMask);
KeyReleaseMask | if ((mode.focusmode == FOCUS_POINTER) || (mode.focusmode == FOCUS_SLOPPY))
PointerMotionMask);
if ((mode.focusmode == FOCUS_POINTER) ||
(mode.focusmode == FOCUS_SLOPPY))
{ {
ewin = GetEwinPointerInClient(); ewin = GetEwinPointerInClient();
if (ewin) if (ewin)

269
src/fx.c
View File

@ -27,15 +27,15 @@
#endif #endif
typedef struct _fxhandler typedef struct _fxhandler
{ {
char *name; char *name;
void (*init_func) (char *name); void (*init_func) (char *name);
void (*desk_func) (void); void (*desk_func) (void);
void (*quit_func) (void); void (*quit_func) (void);
void (*pause_func) (void); void (*pause_func) (void);
char in_use; char in_use;
char paused; char paused;
} }
FXHandler; FXHandler;
void FX_Ripple_Init(char *name); void FX_Ripple_Init(char *name);
@ -56,19 +56,19 @@ void FX_ImageSpinner_Quit(void);
void FX_ImageSpinner_Pause(void); void FX_ImageSpinner_Pause(void);
static int num_fx_handlers = 4; static int num_fx_handlers = 4;
static FXHandler fx_handlers[] = static FXHandler fx_handlers[] = {
{
{"ripples", {"ripples",
FX_Ripple_Init, FX_Ripple_Desk, FX_Ripple_Quit, FX_Ripple_Pause, FX_Ripple_Init, FX_Ripple_Desk, FX_Ripple_Quit, FX_Ripple_Pause,
0, 0}, 0, 0},
{"raindrops", {"raindrops",
FX_Raindrops_Init, FX_Raindrops_Desk, FX_Raindrops_Quit, FX_Raindrops_Pause, FX_Raindrops_Init, FX_Raindrops_Desk, FX_Raindrops_Quit, FX_Raindrops_Pause,
0, 0}, 0, 0},
{"waves", {"waves",
FX_Waves_Init, FX_Waves_Desk, FX_Waves_Quit, FX_Waves_Pause, FX_Waves_Init, FX_Waves_Desk, FX_Waves_Quit, FX_Waves_Pause,
0, 0}, 0, 0},
{"imagespinner", {"imagespinner",
FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit, FX_ImageSpinner_Pause, FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit,
FX_ImageSpinner_Pause,
0, 0} 0, 0}
}; };
@ -250,24 +250,23 @@ FX_ripple_timeout(int val, void *data)
gc = XCreateGC(disp, fx_ripple_win, GCSubwindowMode, &gcv); gc = XCreateGC(disp, fx_ripple_win, GCSubwindowMode, &gcv);
gc1 = XCreateGC(disp, fx_ripple_win, 0L, &gcv); gc1 = XCreateGC(disp, fx_ripple_win, 0L, &gcv);
if (!before) if (!before)
DIALOG_OK("Starting up Ripples FX...", DIALOG_OK(gettext("Starting up Ripples FX..."),
"\n" gettext("\n"
"You have just started the Ripples Effect.\n" "You have just started the Ripples Effect.\n"
"\n" "\n"
"If you look closely on your desktop background, and if it\n" "If you look closely on your desktop background, and if it\n"
"doesn't have a solid colour (ie has a background texture or\n" "doesn't have a solid colour (ie has a background texture or\n"
"image), you will see a pool of water at the bottom of your\n" "image), you will see a pool of water at the bottom of your\n"
"screen that reflects everything above it and \"ripples\".\n" "screen that reflects everything above it and \"ripples\".\n"
"\n" "\n"
"To disable this effect just select this option again to toggle\n" "To disable this effect just select this option again to toggle\n"
"it off.\n"); "it off.\n"));
before = 1; before = 1;
} }
if (fx_ripple_count == 0) if (fx_ripple_count == 0)
XCopyArea(disp, fx_ripple_win, fx_ripple_above, gc, XCopyArea(disp, fx_ripple_win, fx_ripple_above, gc,
0, root.h - (fx_ripple_waterh * 3), 0, root.h - (fx_ripple_waterh * 3),
root.w, fx_ripple_waterh * 2, root.w, fx_ripple_waterh * 2, 0, 0);
0, 0);
fx_ripple_count++; fx_ripple_count++;
if (fx_ripple_count > 32) if (fx_ripple_count > 32)
fx_ripple_count = 0; fx_ripple_count = 0;
@ -322,8 +321,7 @@ FX_Ripple_Quit(void)
{ {
RemoveTimerEvent("FX_RIPPLE_TIMEOUT"); RemoveTimerEvent("FX_RIPPLE_TIMEOUT");
XClearArea(disp, fx_ripple_win, XClearArea(disp, fx_ripple_win,
0, root.h - fx_ripple_waterh, 0, root.h - fx_ripple_waterh, root.w, fx_ripple_waterh, False);
root.w, fx_ripple_waterh, False);
} }
void void
@ -359,11 +357,11 @@ static PixImg *fx_raindrops_draw = NULL;
void FX_raindrops_timeout(int val, void *data); void FX_raindrops_timeout(int val, void *data);
typedef struct _drop_context typedef struct _drop_context
{ {
int x, y; int x, y;
int count; int count;
PixImg *buf; PixImg *buf;
} }
DropContext; DropContext;
static DropContext fx_raindrops[4]; static DropContext fx_raindrops[4];
@ -385,53 +383,53 @@ FX_raindrops_timeout(int val, void *data)
if (!id->x.shm) if (!id->x.shm)
{ {
DIALOG_OK("Unable to display raindrops", DIALOG_OK(gettext("Unable to display raindrops"),
"\n" gettext("\n"
"Enlightenment is unable to display raindrops on this\n" "Enlightenment is unable to display raindrops on this\n"
"display because Shared memory is not available on this\n" "display because Shared memory is not available on this\n"
"X-Server.\n" "X-Server.\n"
"\n" "\n"
"This may be due to Enlightenment being a remote client\n" "This may be due to Enlightenment being a remote client\n"
"running over the network, a MIT-SHM incapable X-server,\n" "running over the network, a MIT-SHM incapable X-server,\n"
"having run out of SHM ID's on the system or Shared\n" "having run out of SHM ID's on the system or Shared\n"
"Memory support being turned off in Imlib\n" "Memory support being turned off in Imlib\n"
"\n" "\n"
"You may correct this by either running `imlib_config'\n" "You may correct this by either running `imlib_config'\n"
"or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n"
"and editing it, enabling shared memory.\n" "and editing it, enabling shared memory.\n"
"\n"); "\n"));
return; return;
} }
if (!id->x.shmp) if (!id->x.shmp)
{ {
DIALOG_OK("Unable to display raindrops", DIALOG_OK(gettext("Unable to display raindrops"),
"\n" gettext("\n"
"Enlightenment is unable to display raindrops on this\n" "Enlightenment is unable to display raindrops on this\n"
"display because shared pixmaps are not available on this\n" "display because shared pixmaps are not available on this\n"
"X-Server.\n" "X-Server.\n"
"\n" "\n"
"This may be due to either the X-Server not implimenting\n" "This may be due to either the X-Server not implimenting\n"
"shared pixmaps, or shared pixmaps being disabled in\n" "shared pixmaps, or shared pixmaps being disabled in\n"
"Imlib's configuration.\n" "Imlib's configuration.\n"
"\n" "\n"
"You may correct this by either running `imlib_config'\n" "You may correct this by either running `imlib_config'\n"
"or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n" "or copying the system imrc (/usr/etc/imrc) to ~/.imrc\n"
"and editing it, enabling shared pixmaps.\n" "and editing it, enabling shared pixmaps.\n"
"\n"); "\n"));
return; return;
} }
if (!before) if (!before)
DIALOG_OK("Starting up Raindrops FX...", DIALOG_OK(gettext("Starting up Raindrops FX..."),
"\n" gettext("\n"
"You have just started the Raindrops Effect.\n" "You have just started the Raindrops Effect.\n"
"\n" "\n"
"If you look closely on your desktop background, and if it\n" "If you look closely on your desktop background, and if it\n"
"doesn't have a solid colour (ie has a background texture or\n" "doesn't have a solid colour (ie has a background texture or\n"
"image), you will see \"raindrops\" hit the background and\n" "image), you will see \"raindrops\" hit the background and\n"
"make little splashes. This Effect can be VERY CPU intensive.\n" "make little splashes. This Effect can be VERY CPU intensive.\n"
"\n" "\n"
"To disable this effect just select this option again to toggle\n" "To disable this effect just select this option again to toggle\n"
"it off.\n"); "it off.\n"));
before = 1; before = 1;
if (first) if (first)
{ {
@ -439,14 +437,16 @@ FX_raindrops_timeout(int val, void *data)
first = 0; first = 0;
for (i = 0; i < 256; i++) for (i = 0; i < 256; i++)
sintab[i] = (char)(sin(((double)i) * M_PI_2 * 4 / 256) * fx_amplitude); sintab[i] =
(char)(sin(((double)i) * M_PI_2 * 4 / 256) * fx_amplitude);
for (j = 0; j < fx_raindrop_size; j++) for (j = 0; j < fx_raindrop_size; j++)
{ {
for (i = 0; i < fx_raindrop_size; i++) for (i = 0; i < fx_raindrop_size; i++)
{ {
xx = i - fx_raindrop_size2; xx = i - fx_raindrop_size2;
yy = j - fx_raindrop_size2; yy = j - fx_raindrop_size2;
disttab[i][j] = (unsigned char)sqrt((double)((xx * xx) + (yy * yy))); disttab[i][j] =
(unsigned char)sqrt((double)((xx * xx) + (yy * yy)));
} }
} }
} }
@ -459,8 +459,7 @@ FX_raindrops_timeout(int val, void *data)
gc = XCreateGC(disp, fx_raindrops_win, GCSubwindowMode, &gcv); gc = XCreateGC(disp, fx_raindrops_win, GCSubwindowMode, &gcv);
gc1 = XCreateGC(disp, fx_raindrops_win, 0L, &gcv); gc1 = XCreateGC(disp, fx_raindrops_win, 0L, &gcv);
fx_raindrops_draw = ECreatePixImg(fx_raindrops_win, fx_raindrops_draw = ECreatePixImg(fx_raindrops_win,
fx_raindrop_size, fx_raindrop_size, fx_raindrop_size);
fx_raindrop_size);
if (!fx_raindrops_draw) if (!fx_raindrops_draw)
return; return;
for (i = 0; i < fx_raindrops_number; i++) for (i = 0; i < fx_raindrops_number; i++)
@ -508,21 +507,35 @@ FX_raindrops_timeout(int val, void *data)
if (i != j) if (i != j)
{ {
if (((fx_raindrops[i].x >= fx_raindrops[j].x) && if (((fx_raindrops[i].x >= fx_raindrops[j].x) &&
(fx_raindrops[i].x < fx_raindrops[j].x + fx_raindrop_size) && (fx_raindrops[i].x <
(fx_raindrops[i].y >= fx_raindrops[j].y) && fx_raindrops[j].x + fx_raindrop_size)
(fx_raindrops[i].y < fx_raindrops[j].y + fx_raindrop_size)) || && (fx_raindrops[i].y >= fx_raindrops[j].y)
((fx_raindrops[i].x + fx_raindrop_size >= fx_raindrops[j].x) && && (fx_raindrops[i].y <
(fx_raindrops[i].x + fx_raindrop_size < fx_raindrops[j].x + fx_raindrop_size) && fx_raindrops[j].y + fx_raindrop_size))
(fx_raindrops[i].y >= fx_raindrops[j].y) && ||
(fx_raindrops[i].y < fx_raindrops[j].y + fx_raindrop_size)) || ((fx_raindrops
((fx_raindrops[i].x >= fx_raindrops[j].x) && [i].x + fx_raindrop_size >= fx_raindrops[j].x)
(fx_raindrops[i].x < fx_raindrops[j].x + fx_raindrop_size) && && (fx_raindrops[i].x + fx_raindrop_size <
(fx_raindrops[i].y + fx_raindrop_size >= fx_raindrops[j].y) && fx_raindrops[j].x + fx_raindrop_size)
(fx_raindrops[i].y + fx_raindrop_size < fx_raindrops[j].y + fx_raindrop_size)) || && (fx_raindrops[i].y >= fx_raindrops[j].y)
((fx_raindrops[i].x + fx_raindrop_size >= fx_raindrops[j].x) && && (fx_raindrops[i].y <
(fx_raindrops[i].x + fx_raindrop_size < fx_raindrops[j].x + fx_raindrop_size) && fx_raindrops[j].y + fx_raindrop_size))
(fx_raindrops[i].y + fx_raindrop_size >= fx_raindrops[j].y) && || ((fx_raindrops[i].x >= fx_raindrops[j].x)
(fx_raindrops[i].y + fx_raindrop_size < fx_raindrops[j].y + fx_raindrop_size))) && (fx_raindrops[i].x <
fx_raindrops[j].x + fx_raindrop_size)
&& (fx_raindrops[i].y + fx_raindrop_size >=
fx_raindrops[j].y)
&& (fx_raindrops[i].y + fx_raindrop_size <
fx_raindrops[j].y + fx_raindrop_size))
||
((fx_raindrops
[i].x + fx_raindrop_size >= fx_raindrops[j].x)
&& (fx_raindrops[i].x + fx_raindrop_size <
fx_raindrops[j].x + fx_raindrop_size)
&& (fx_raindrops[i].y + fx_raindrop_size >=
fx_raindrops[j].y)
&& (fx_raindrops[i].y + fx_raindrop_size <
fx_raindrops[j].y + fx_raindrop_size)))
intersect = 1; intersect = 1;
} }
} }
@ -530,7 +543,8 @@ FX_raindrops_timeout(int val, void *data)
XShmGetImage(disp, fx_raindrops_win, fx_raindrops[i].buf->xim, XShmGetImage(disp, fx_raindrops_win, fx_raindrops[i].buf->xim,
fx_raindrops[i].x, fx_raindrops[i].y, 0xffffffff); fx_raindrops[i].x, fx_raindrops[i].y, 0xffffffff);
} }
percent_done = 1 + ((fx_raindrops[i].count << 8) / fx_raindrop_duration); percent_done =
1 + ((fx_raindrops[i].count << 8) / fx_raindrop_duration);
for (y = 0; y < fx_raindrop_size; y++) for (y = 0; y < fx_raindrop_size; y++)
{ {
for (x = 0; x < fx_raindrop_size; x++) for (x = 0; x < fx_raindrop_size; x++)
@ -554,11 +568,13 @@ FX_raindrops_timeout(int val, void *data)
int varx, vary; int varx, vary;
int phase, divisor, multiplier; int phase, divisor, multiplier;
phase = ((percent - percent_done) * fx_frequency) & 0xff; phase =
((percent - percent_done) * fx_frequency) & 0xff;
xx = x - fx_raindrop_size2; xx = x - fx_raindrop_size2;
yy = y - fx_raindrop_size2; yy = y - fx_raindrop_size2;
divisor = 1 + (dist << 8); divisor = 1 + (dist << 8);
multiplier = (int)sintab[phase] * (256 - percent_done); multiplier =
(int)sintab[phase] * (256 - percent_done);
varx = ((-xx) * multiplier) / divisor; varx = ((-xx) * multiplier) / divisor;
vary = ((-yy) * multiplier) / divisor; vary = ((-yy) * multiplier) / divisor;
xx = x + varx; xx = x + varx;
@ -572,7 +588,8 @@ FX_raindrops_timeout(int val, void *data)
else if (yy >= fx_raindrop_size) else if (yy >= fx_raindrop_size)
yy = fx_raindrop_size - 1; yy = fx_raindrop_size - 1;
XPutPixel(fx_raindrops_draw->xim, x, y, XPutPixel(fx_raindrops_draw->xim, x, y,
XGetPixel(fx_raindrops[i].buf->xim, xx, yy)); XGetPixel(fx_raindrops[i].buf->xim, xx,
yy));
} }
} }
} }
@ -582,7 +599,8 @@ FX_raindrops_timeout(int val, void *data)
fx_raindrop_size, fx_raindrop_size, False); fx_raindrop_size, fx_raindrop_size, False);
XSync(disp, False); XSync(disp, False);
} }
DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ), FX_raindrops_timeout, 0, NULL); DoIn("FX_RAINDROPS_TIMEOUT", (0.066 /*/ (float)fx_raindrops_number */ ),
FX_raindrops_timeout, 0, NULL);
return; return;
val = 0; val = 0;
data = NULL; data = NULL;
@ -696,17 +714,17 @@ FX_Wave_timeout(int val, void *data)
gc = XCreateGC(disp, fx_wave_win, GCSubwindowMode, &gcv); gc = XCreateGC(disp, fx_wave_win, GCSubwindowMode, &gcv);
gc1 = XCreateGC(disp, fx_wave_win, 0L, &gcv); gc1 = XCreateGC(disp, fx_wave_win, 0L, &gcv);
if (!before) if (!before)
DIALOG_OK("Starting up Waves FX...", DIALOG_OK(gettext("Starting up Waves FX..."),
"\n" gettext("\n"
"You have just started the Waves Effect.\n" "You have just started the Waves Effect.\n"
"\n" "\n"
"If you look closely on your desktop background, and if it\n" "If you look closely on your desktop background, and if it\n"
"doesn't have a solid colour (ie has a background texture or\n" "doesn't have a solid colour (ie has a background texture or\n"
"image), you will see a pool of water at the bottom of your\n" "image), you will see a pool of water at the bottom of your\n"
"screen that reflects everything above it and \"waves\".\n" "screen that reflects everything above it and \"waves\".\n"
"\n" "\n"
"To disable this effect just select this option again to toggle\n" "To disable this effect just select this option again to toggle\n"
"it off.\n"); "it off.\n"));
before = 1; before = 1;
} }
@ -715,8 +733,7 @@ FX_Wave_timeout(int val, void *data)
{ {
XCopyArea(disp, fx_wave_win, fx_wave_above, gc, XCopyArea(disp, fx_wave_win, fx_wave_above, gc,
0, root.h - (FX_WAVE_WATERH * 3), 0, root.h - (FX_WAVE_WATERH * 3),
root.w, FX_WAVE_WATERH * 2, root.w, FX_WAVE_WATERH * 2, 0, 0);
0, 0);
} }
/* Increment and roll the counter */ /* Increment and roll the counter */
@ -742,8 +759,7 @@ FX_Wave_timeout(int val, void *data)
{ {
XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, XCopyArea(disp, fx_wave_above, fx_wave_win, gc1,
0, root.h - FX_WAVE_GRABH, 0, root.h - FX_WAVE_GRABH,
root.w, FX_WAVE_DEPTH * 2, root.w, FX_WAVE_DEPTH * 2, 0, root.h - FX_WAVE_GRABH);
0, root.h - FX_WAVE_GRABH);
} }
/* Go through the bottom couple (FX_WAVE_WATERH) lines of the window */ /* Go through the bottom couple (FX_WAVE_WATERH) lines of the window */
@ -781,8 +797,7 @@ FX_Wave_timeout(int val, void *data)
sx = (int)(sin(incx2) * FX_WAVE_DEPTH); sx = (int)(sin(incx2) * FX_WAVE_DEPTH);
/* Display this block */ /* Display this block */
XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, XCopyArea(disp, fx_wave_above, fx_wave_win, gc1, x, yy, /* x, y */
x, yy, /* x, y */
FX_WAVE_WATERW, 1, /* w, h */ FX_WAVE_WATERW, 1, /* w, h */
off + x, root.h - FX_WAVE_WATERH + y + sx /* dx, dy */ off + x, root.h - FX_WAVE_WATERH + y + sx /* dx, dy */
); );
@ -821,8 +836,7 @@ FX_Waves_Quit(void)
{ {
RemoveTimerEvent("FX_WAVE_TIMEOUT"); RemoveTimerEvent("FX_WAVE_TIMEOUT");
XClearArea(disp, fx_wave_win, XClearArea(disp, fx_wave_win,
0, root.h - FX_WAVE_WATERH, 0, root.h - FX_WAVE_WATERH, root.w, FX_WAVE_WATERH, False);
root.w, FX_WAVE_WATERH, False);
} }
void void
@ -850,8 +864,7 @@ static Window fx_imagespinner_win = 0;
static int fx_imagespinner_count = 3; static int fx_imagespinner_count = 3;
static ImlibData *fx_imagespinner_imd = NULL; static ImlibData *fx_imagespinner_imd = NULL;
static char *fx_imagespinner_params = NULL; static char *fx_imagespinner_params = NULL;
static static void FX_imagespinner_timeout(int val, void *data);
void FX_imagespinner_timeout(int val, void *data);
void void
FX_imagespinner_timeout(int val, void *data) FX_imagespinner_timeout(int val, void *data)
@ -867,12 +880,12 @@ FX_imagespinner_timeout(int val, void *data)
else else
fx_imagespinner_imd = id; fx_imagespinner_imd = id;
if (!before) if (!before)
DIALOG_OK("Starting up imagespinners FX...", DIALOG_OK(gettext("Starting up imagespinners FX..."),
"\n" gettext("\n"
"You have just started the imagespinners Effect.\n" "You have just started the imagespinners Effect.\n"
"\n" "\n"
"To disable this effect just select this option again to toggle\n" "To disable this effect just select this option again to toggle\n"
"it off.\n"); "it off.\n"));
before = 1; before = 1;
} }
/* do stuff here */ /* do stuff here */
@ -898,8 +911,7 @@ FX_imagespinner_timeout(int val, void *data)
x = ((root.w * x) >> 10) - ((w * x) >> 10); x = ((root.w * x) >> 10) - ((w * x) >> 10);
y = ((root.h * y) >> 10) - ((h * y) >> 10); y = ((root.h * y) >> 10) - ((h * y) >> 10);
Imlib_paste_image(fx_imagespinner_imd, im, Imlib_paste_image(fx_imagespinner_imd, im,
fx_imagespinner_win, fx_imagespinner_win, x, y, w, h);
x, y, w, h);
Imlib_destroy_image(fx_imagespinner_imd, im); Imlib_destroy_image(fx_imagespinner_imd, im);
} }
Efree(string); Efree(string);
@ -933,10 +945,7 @@ void
FX_ImageSpinner_Quit(void) FX_ImageSpinner_Quit(void)
{ {
RemoveTimerEvent("FX_IMAGESPINNER_TIMEOUT"); RemoveTimerEvent("FX_IMAGESPINNER_TIMEOUT");
XClearArea(disp, fx_imagespinner_win, XClearArea(disp, fx_imagespinner_win, 0, 0, root.w, root.h, False);
0, 0,
root.w, root.h,
False);
if (fx_imagespinner_params) if (fx_imagespinner_params)
Efree(fx_imagespinner_params); Efree(fx_imagespinner_params);
fx_imagespinner_params = NULL; fx_imagespinner_params = NULL;

View File

@ -128,12 +128,12 @@
/* Preferences for behavior for app */ /* Preferences for behavior for app */
/* ONLY the client sets this */ /* ONLY the client sets this */
#define WIN_HINTS_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */ #define WIN_HINTS_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */
#define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */ #define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */
#define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */ #define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */
#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */ #define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */
#define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /* app only accepts focus when clicked */ #define WIN_HINTS_FOCUS_ON_CLICK (1<<4) /* app only accepts focus when clicked */
#define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */ #define WIN_HINTS_DO_NOT_COVER (1<<5) /* attempt to not cover this window */
#define XA_WIN_HINTS "_WIN_HINTS" #define XA_WIN_HINTS "_WIN_HINTS"
/* WIN_HINTS = CARD32 */ /* WIN_HINTS = CARD32 */
@ -720,8 +720,7 @@ GNOME_SetWMNameVer(void)
void void
GNOME_DelHints(EWin * ewin) GNOME_DelHints(EWin * ewin)
{ {
static Atom atom_get[7] = static Atom atom_get[7] = { 0, 0, 0, 0, 0, 0, 0 };
{0, 0, 0, 0, 0, 0, 0};
EDBUG(6, "GNOME_DelHints"); EDBUG(6, "GNOME_DelHints");
if (!atom_get[0]) if (!atom_get[0])

View File

@ -34,7 +34,8 @@ GrabActionKey(Action * a)
if (a->anymodifier) if (a->anymodifier)
{ {
mod = AnyModifier; mod = AnyModifier;
XGrabKey(disp, a->key, mod, root.win, False, GrabModeAsync, GrabModeAsync); XGrabKey(disp, a->key, mod, root.win, False, GrabModeAsync,
GrabModeAsync);
} }
else else
{ {
@ -42,7 +43,8 @@ GrabActionKey(Action * a)
/* grab the key even if locks are on or not */ /* grab the key even if locks are on or not */
for (i = 0; i < 8; i++) for (i = 0; i < 8; i++)
XGrabKey(disp, a->key, mod | mask_mod_combos[i], root.win, False, GrabModeAsync, GrabModeAsync); XGrabKey(disp, a->key, mod | mask_mod_combos[i], root.win, False,
GrabModeAsync, GrabModeAsync);
} }
EDBUG_RETURN_; EDBUG_RETURN_;
} }

View File

@ -114,10 +114,11 @@ BuildWindowGroup(EWin ** ewins, int num)
AddEwinToGroup(ewins[i], g); AddEwinToGroup(ewins[i], g);
else else
{ {
DIALOG_OK("Cannot comply", DIALOG_OK(gettext("Cannot comply"),
"Iconboxes and Pagers are disallowed from being\n" gettext
"members of a group. You cannot add these windows\n" ("Iconboxes and Pagers are disallowed from being\n"
"to a group.\n"); "members of a group. You cannot add these windows\n"
"to a group.\n"));
} }
} }
} }
@ -136,7 +137,8 @@ AddEwinToGroup(EWin * ewin, Group * g)
if (ewin->groups[i] == g) if (ewin->groups[i] == g)
return; return;
ewin->num_groups++; ewin->num_groups++;
ewin->groups = Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups); ewin->groups =
Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups);
ewin->groups[ewin->num_groups - 1] = g; ewin->groups[ewin->num_groups - 1] = g;
g->num_members++; g->num_members++;
g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members); g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members);
@ -145,10 +147,11 @@ AddEwinToGroup(EWin * ewin, Group * g)
} }
else else
{ {
DIALOG_OK("Cannot comply", DIALOG_OK(gettext("Cannot comply"),
"Iconboxes and Pagers are disallowed from being\n" gettext
"members of a group. You cannot add these windows\n" ("Iconboxes and Pagers are disallowed from being\n"
"to a group.\n"); "members of a group. You cannot add these windows\n"
"to a group.\n"));
} }
} }
} }
@ -208,10 +211,15 @@ RemoveEwinFromGroup(EWin * ewin, Group * g)
g->members[j] = g->members[j + 1]; g->members[j] = g->members[j + 1];
g->num_members--; g->num_members--;
if (g->num_members > 0) if (g->num_members > 0)
g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members); g->members =
Erealloc(g->members,
sizeof(EWin *) *
g->num_members);
else else
{ {
RemoveItem((char *)g, 0, LIST_FINDBY_POINTER, LIST_TYPE_GROUP); RemoveItem((char *)g, 0,
LIST_FINDBY_POINTER,
LIST_TYPE_GROUP);
FreeGroup(g); FreeGroup(g);
} }
/* and remove the group from the groups that the window is in */ /* and remove the group from the groups that the window is in */
@ -225,21 +233,30 @@ RemoveEwinFromGroup(EWin * ewin, Group * g)
ewin->num_groups = 0; ewin->num_groups = 0;
} }
else else
ewin->groups = Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups); ewin->groups =
Erealloc(ewin->groups,
sizeof(Group *) *
ewin->num_groups);
SaveGroups(); SaveGroups();
x = ewin->x; x = ewin->x;
y = ewin->y; y = ewin->y;
if ((ewin->x + ewin->border->border.left + 1) > root.w) if ((ewin->x + ewin->border->border.left + 1) >
root.w)
x = root.w - ewin->border->border.left - 1; x = root.w - ewin->border->border.left - 1;
else if ((ewin->x + ewin->w - else if ((ewin->x + ewin->w -
ewin->border->border.right - 1) < 0) ewin->border->border.right - 1) < 0)
x = 0 - ewin->w + ewin->border->border.right + 1; x =
if ((ewin->y + ewin->border->border.top + 1) > root.h) 0 - ewin->w +
ewin->border->border.right + 1;
if ((ewin->y + ewin->border->border.top + 1) >
root.h)
y = root.h - ewin->border->border.top - 1; y = root.h - ewin->border->border.top - 1;
else if ((ewin->y + ewin->h - else if ((ewin->y + ewin->h -
ewin->border->border.bottom - 1) < 0) ewin->border->border.bottom - 1) < 0)
y = 0 - ewin->h + ewin->border->border.bottom + 1; y =
0 - ewin->h +
ewin->border->border.bottom + 1;
MoveEwin(ewin, x, y); MoveEwin(ewin, x, y);
@ -266,7 +283,8 @@ GetWinGroupMemberNames(Group ** groups, int num)
group_member_strings[i][0] = 0; group_member_strings[i][0] = 0;
for (j = 0; j < groups[i]->num_members; j++) for (j = 0; j < groups[i]->num_members; j++)
{ {
strcat(group_member_strings[i], groups[i]->members[j]->client.title); strcat(group_member_strings[i],
groups[i]->members[j]->client.title);
strcat(group_member_strings[i], "\n"); strcat(group_member_strings[i], "\n");
} }
} }
@ -305,8 +323,9 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
if (!gwins[i]->border->group_border_name) if (!gwins[i]->border->group_border_name)
continue; continue;
b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME, b =
LIST_TYPE_BORDER); (Border *) FindItem(gwins[i]->border->group_border_name, 0,
LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if (b) if (b)
{ {
gwins[i]->previous_border = gwins[i]->border; gwins[i]->previous_border = gwins[i]->border;
@ -326,8 +345,9 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
if (!gwins[i]->border->group_border_name) if (!gwins[i]->border->group_border_name)
continue; continue;
b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME, b =
LIST_TYPE_BORDER); (Border *) FindItem(gwins[i]->border->group_border_name, 0,
LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if (b) if (b)
{ {
gwins[i]->previous_border = gwins[i]->border; gwins[i]->previous_border = gwins[i]->border;
@ -352,8 +372,8 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
gwins[i]->border_new = 1; gwins[i]->border_new = 1;
SetEwinToBorder(gwins[i], b); SetEwinToBorder(gwins[i], b);
ICCCM_MatchSize(gwins[i]); ICCCM_MatchSize(gwins[i]);
MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w, MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y,
gwins[i]->client.h); gwins[i]->client.w, gwins[i]->client.h);
RememberImportantInfoForEwin(gwins[i]); RememberImportantInfoForEwin(gwins[i]);
} }
} }
@ -389,14 +409,20 @@ SaveGroups(void)
if (groups[i]->members[0]->snap->num_groups) if (groups[i]->members[0]->snap->num_groups)
{ {
fprintf(f, "NEW: %i\n", groups[i]->index); fprintf(f, "NEW: %i\n", groups[i]->index);
fprintf(f, "ICONIFY: %i\n", groups[i]->cfg.iconify); fprintf(f, "ICONIFY: %i\n",
groups[i]->cfg.iconify);
fprintf(f, "KILL: %i\n", groups[i]->cfg.kill); fprintf(f, "KILL: %i\n", groups[i]->cfg.kill);
fprintf(f, "MOVE: %i\n", groups[i]->cfg.move); fprintf(f, "MOVE: %i\n", groups[i]->cfg.move);
fprintf(f, "RAISE: %i\n", groups[i]->cfg.raise); fprintf(f, "RAISE: %i\n",
fprintf(f, "SET_BORDER: %i\n", groups[i]->cfg.set_border); groups[i]->cfg.raise);
fprintf(f, "STICK: %i\n", groups[i]->cfg.stick); fprintf(f, "SET_BORDER: %i\n",
fprintf(f, "SHADE: %i\n", groups[i]->cfg.shade); groups[i]->cfg.set_border);
fprintf(f, "MIRROR: %i\n", groups[i]->cfg.mirror); fprintf(f, "STICK: %i\n",
groups[i]->cfg.stick);
fprintf(f, "SHADE: %i\n",
groups[i]->cfg.shade);
fprintf(f, "MIRROR: %i\n",
groups[i]->cfg.mirror);
} }
} }
} }
@ -571,25 +597,29 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
tmp_action = action; tmp_action = action;
tmp_groups = ListWinGroups(ewin, group_select, &num_groups); tmp_groups = ListWinGroups(ewin, group_select, &num_groups);
if ((num_groups == 0) && (action == ACTION_BREAK_GROUP || action == ACTION_REMOVE_FROM_GROUP)) if ((num_groups == 0)
&& (action == ACTION_BREAK_GROUP || action == ACTION_REMOVE_FROM_GROUP))
{ {
DIALOG_OK("Window Group Error", DIALOG_OK(gettext("Window Group Error"),
"\n This window currently does not belong to any groups. \n" gettext
" You can only destroy groups or remove windows from groups \n" ("\n This window currently does not belong to any groups. \n"
" through a window that actually belongs to at least one group. \n\n"); " You can only destroy groups or remove windows from groups \n"
" through a window that actually belongs to at least one group.\n\n"));
return; return;
} }
if ((num_groups == 0) && (group_select == GROUP_SELECT_ALL_EXCEPT_EWIN)) if ((num_groups == 0) && (group_select == GROUP_SELECT_ALL_EXCEPT_EWIN))
{ {
DIALOG_OK("Window Group Error", DIALOG_OK(gettext("Window Group Error"),
"\n Currently, no groups exist or this window \n" gettext("\n Currently, no groups exist or this window \n"
" already belongs to all existing groups. \n" " already belongs to all existing groups. \n"
" You have to start other groups first. \n\n"); " You have to start other groups first. \n\n"));
return; return;
} }
if (!tmp_groups) if (!tmp_groups)
{ {
DIALOG_OK("Window Group Error", "\n Currently, no groups exist. You have to start a group first. \n\n"); DIALOG_OK(gettext("Window Group Error"),
gettext
("\n Currently, no groups exist. You have to start a group first.\n\n"));
return; return;
} }
@ -604,7 +634,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
AUDIO_PLAY("SOUND_SETTINGS_GROUP"); AUDIO_PLAY("SOUND_SETTINGS_GROUP");
d = CreateDialog("GROUP_SELECTION"); d = CreateDialog("GROUP_SELECTION");
DialogSetTitle(d, "Window Group Selection"); DialogSetTitle(d, gettext("Window Group Selection"));
table = DialogInitItem(d); table = DialogInitItem(d);
DialogItemTableSetOptions(table, 2, 0, 0, 0); DialogItemTableSetOptions(table, 2, 0, 0, 0);
@ -661,8 +691,8 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0); DialogItemSeparatorSetOrientation(di, 0);
DialogAddButton(d, "OK", ChooseGroup, 1); DialogAddButton(d, gettext("OK"), ChooseGroup, 1);
DialogAddButton(d, "Close", ChooseGroup, 1); DialogAddButton(d, gettext("Close"), ChooseGroup, 1);
DialogSetExitFunction(d, ChooseGroup, 2, d); DialogSetExitFunction(d, ChooseGroup, 2, d);
DialogBindKey(d, "Escape", ChooseGroupEscape, 0, d); DialogBindKey(d, "Escape", ChooseGroupEscape, 0, d);
DialogBindKey(d, "Return", ChooseGroup, 0, d); DialogBindKey(d, "Return", ChooseGroup, 0, d);

View File

@ -56,14 +56,14 @@ HandleSigIll(int num)
num = 0; num = 0;
if (disp) if (disp)
UngrabX(); UngrabX();
DialogAlert("Enlightenment performed an Illegal Instruction.\n" DialogAlert(gettext("Enlightenment performed an Illegal Instruction.\n"
"\n" "\n"
"This most likely is due to you having installed an run a\n" "This most likely is due to you having installed an run a\n"
"binary of Enlightenment that was compiled for a make or model\n" "binary of Enlightenment that was compiled for a make or model\n"
"of CPU not 100% identical or compatible with yours. Please\n" "of CPU not 100% identical or compatible with yours. Please\n"
"either obtain the correct package for your system, or\n" "either obtain the correct package for your system, or\n"
"re-compile enlightenment and possibly any support libraries\n" "re-compile enlightenment and possibly any support libraries\n"
"that you got in binary format to run Enlightenment.\n"); "that you got in binary format to run Enlightenment.\n"));
doExit("error"); doExit("error");
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -84,16 +84,16 @@ HandleSigFpe(int num)
num = 0; num = 0;
if (disp) if (disp)
UngrabX(); UngrabX();
DialogAlert("Enlightenment caused a Floating Point Exception.\n" DialogAlert(gettext("Enlightenment caused a Floating Point Exception.\n"
"\n" "\n"
"This means that Enlightenment or support library routines it calls\n" "This means that Enlightenment or support library routines it calls\n"
"have performed an illegal mathematical operation (most likely\n" "have performed an illegal mathematical operation (most likely\n"
"dividing a number by zero). This is most likely a bug. It is\n" "dividing a number by zero). This is most likely a bug. It is\n"
"recommended to restart now. If you wish to help fix this please\n" "recommended to restart now. If you wish to help fix this please\n"
"compile Enlightenment with debugging symbols in and run\n" "compile Enlightenment with debugging symbols in and run\n"
"Enlightenment under gdb so you can backtrace for where it died and\n" "Enlightenment under gdb so you can backtrace for where it died and\n"
"send in a useful bug report with backtrace information and variable\n" "send in a useful bug report with backtrace information and variable\n"
"dumps etc.\n"); "dumps etc.\n"));
doExit("error"); doExit("error");
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -109,16 +109,16 @@ HandleSigSegv(int num)
loop_count++; loop_count++;
if (disp) if (disp)
UngrabX(); UngrabX();
DialogAlert("Enlightenment caused Segment Violation (Segfault)\n" DialogAlert(gettext("Enlightenment caused Segment Violation (Segfault)\n"
"\n" "\n"
"This means that Enlightenment or support library routines it calls\n" "This means that Enlightenment or support library routines it calls\n"
"have accessed areas of your system's memory that they are not\n" "have accessed areas of your system's memory that they are not\n"
"allowed access to. This is most likely a bug. It is recommended to\n" "allowed access to. This is most likely a bug. It is recommended to\n"
"restart now. If you wish to help fix this please compile\n" "restart now. If you wish to help fix this please compile\n"
"Enlightenment with debugging symbols in and run Enlightenment\n" "Enlightenment with debugging symbols in and run Enlightenment\n"
"under gdb so you can backtrace for where it died and send in a\n" "under gdb so you can backtrace for where it died and send in a\n"
"useful bug report with backtrace information and variable\n" "useful bug report with backtrace information and variable\n"
"dumps etc.\n"); "dumps etc.\n"));
abort(); abort();
num = 0; num = 0;
EDBUG_RETURN_; EDBUG_RETURN_;
@ -193,11 +193,11 @@ HandleSigBus(int num)
num = 0; num = 0;
if (disp) if (disp)
UngrabX(); UngrabX();
DialogAlert("Enlightenment caused Bus Error.\n" DialogAlert(gettext("Enlightenment caused Bus Error.\n"
"\n" "\n"
"It is suggested you check your hardware and OS installation.\n" "It is suggested you check your hardware and OS installation.\n"
"It is highly unusual to cause Bus Errors on operational\n" "It is highly unusual to cause Bus Errors on operational\n"
"hardware.\n"); "hardware.\n"));
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -212,39 +212,33 @@ EHandleXError(Display * d, XErrorEvent * ev)
{ {
if ((!no_overwrite) && (mode.xselect)) if ((!no_overwrite) && (mode.xselect))
{ {
ASSIGN_ALERT("Another Window Manager is already running", ASSIGN_ALERT(gettext("Another Window Manager is already running"),
"OK (edit file)", gettext("OK (edit file)"),
"", "", gettext("Cancel (do NOT edit)"));
"Cancel (do NOT edit)"); Alert(gettext("Another Window Manager is already running.\n"
Alert("Another Window Manager is already running.\n" "\n"
"\n" "You will have to quit your current Window Manager first before\n"
"You will have to quit your current Window Manager first before\n" "you can successfully run Enlightenment.\n"
"you can successfully run Enlightenment.\n" "\n"
"\n" "If you haven't edited your user startup files, Enlightenment\n"
"If you haven't edited your user startup files, Enlightenment\n" "can do that now for you, so when you log in again after\n"
"can do that now for you, so when you log in again after\n" "quitting your current window manager, you will have\n"
"quitting your current window manager, you will have\n" "Enlightenment running.\n"
"Enlightenment running.\n" "\n"
"\n" "If you want to do this, click OK, otherwise hit cancel\n"
"If you want to do this, click OK, otherwise hit cancel\n" "to abort this operation and edit the files by hand.\n"
"to abort this operation and edit the files by hand.\n" "\n"
"\n" "WARNING WARNING WARNING WARNING!\n"
"WARNING WARNING WARNING WARNING!\n" "\n"
"\n" "It is possible that this MAY not properly edit your files.\n"));
"It is possible that this MAY not properly edit your files.\n" ASSIGN_ALERT(gettext("Are you sure?"),
); gettext("YES (edit file)"),
ASSIGN_ALERT("Are you sure?", "", gettext("NO (do not edit)"));
"YES (edit file)", Alert(gettext
"", ("Are you absolutely sure you want to have Enlightenment\n"
"NO (do not edit)"); "edit your startup files for you?\n" "\n"
Alert("Are you absolutely sure you want to have Enlightenment\n" "If your startup files are highly customised this may not\n"
"edit your startup files for you?\n" "work.\n" "\n" "Are you ABSOLUTELY sure?\n"));
"\n"
"If your startup files are highly customised this may not\n"
"work.\n"
"\n"
"Are you ABSOLUTELY sure?\n"
);
RESET_ALERT; RESET_ALERT;
AddE(); AddE();
EExit((void *)1); EExit((void *)1);

View File

@ -139,8 +139,8 @@ ICCCM_Delete(EWin * ewin)
del = 0; del = 0;
if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num)) if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num))
{ {
XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, &dummy, XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3,
&lnum, &ldummy, (unsigned char **)&prop); &dummy, &lnum, &ldummy, (unsigned char **)&prop);
num = (int)lnum; num = (int)lnum;
} }
if (prop) if (prop)
@ -226,8 +226,7 @@ ICCCM_DeIconify(EWin * ewin)
ewin->iconified = 0; ewin->iconified = 0;
XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace, XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace,
(unsigned char *)c, 2); (unsigned char *)c, 2);
RemoveItem("ICON", ewin->client.win, LIST_FINDBY_BOTH, RemoveItem("ICON", ewin->client.win, LIST_FINDBY_BOTH, LIST_TYPE_ICONIFIEDS);
LIST_TYPE_ICONIFIEDS);
EMapWindow(disp, ewin->client.win); EMapWindow(disp, ewin->client.win);
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -309,7 +308,8 @@ ICCCM_Configure(EWin * ewin)
xwc.y = ewin->border->border.top; xwc.y = ewin->border->border.top;
xwc.width = ewin->client.w; xwc.width = ewin->client.w;
xwc.height = ewin->client.h; xwc.height = ewin->client.h;
XConfigureWindow(disp, ewin->win_container, CWX | CWY | CWWidth | CWHeight, &xwc); XConfigureWindow(disp, ewin->win_container,
CWX | CWY | CWWidth | CWHeight, &xwc);
} }
else else
{ {
@ -317,13 +317,15 @@ ICCCM_Configure(EWin * ewin)
xwc.y = -30; xwc.y = -30;
xwc.width = 1; xwc.width = 1;
xwc.height = 1; xwc.height = 1;
XConfigureWindow(disp, ewin->win_container, CWX | CWY | CWWidth | CWHeight, &xwc); XConfigureWindow(disp, ewin->win_container,
CWX | CWY | CWWidth | CWHeight, &xwc);
xwc.width = ewin->client.w; xwc.width = ewin->client.w;
xwc.height = ewin->client.h; xwc.height = ewin->client.h;
} }
xwc.x = 0; xwc.x = 0;
xwc.y = 0; xwc.y = 0;
XConfigureWindow(disp, ewin->client.win, CWX | CWY | CWWidth | CWHeight, &xwc); XConfigureWindow(disp, ewin->client.win, CWX | CWY | CWWidth | CWHeight,
&xwc);
if ((ewin->menu) || (ewin->dialog)) if ((ewin->menu) || (ewin->dialog))
EDBUG_RETURN_; EDBUG_RETURN_;
ev.type = ConfigureNotify; ev.type = ConfigureNotify;
@ -382,8 +384,10 @@ ICCCM_Adopt(EWin * ewin, Window win)
ewin->y = ewin->client.y; ewin->y = ewin->client.y;
ewin->reqx = ewin->client.x; ewin->reqx = ewin->client.x;
ewin->reqy = ewin->client.y; ewin->reqy = ewin->client.y;
ewin->w = ewin->client.w + ewin->border->border.left + ewin->border->border.right; ewin->w =
ewin->h = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom; ewin->client.w + ewin->border->border.left + ewin->border->border.right;
ewin->h =
ewin->client.h + ewin->border->border.top + ewin->border->border.bottom;
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -405,7 +409,8 @@ ICCCM_Withdraw(EWin * ewin)
*/ */
c[0] = WithdrawnState; c[0] = WithdrawnState;
c[1] = 0; c[1] = 0;
XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace, (unsigned char *)c, 2); XChangeProperty(disp, ewin->client.win, a, a, 32, PropModeReplace,
(unsigned char *)c, 2);
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -495,8 +500,8 @@ ICCCM_Focus(EWin * ewin)
} }
if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num)) if (!XGetWMProtocols(disp, ewin->client.win, &prop, &num))
{ {
XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3, &dummy, XGetWindowProperty(disp, ewin->client.win, a2, 0, 10, False, a2, &a3,
&lnum, &ldummy, (unsigned char **)&prop); &dummy, &lnum, &ldummy, (unsigned char **)&prop);
num = (int)lnum; num = (int)lnum;
} }
if (prop) if (prop)
@ -527,7 +532,7 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change)
XSizeHints hint; XSizeHints hint;
Window ww; Window ww;
long mask; long mask;
unsigned int dummy, w, h; unsigned int dummy, w, h, bw;
int x, y; int x, y;
EDBUG(6, "ICCCM_GetGeoms"); EDBUG(6, "ICCCM_GetGeoms");
@ -540,17 +545,17 @@ ICCCM_GetGeoms(EWin * ewin, Atom atom_change)
if (atom_change != atom) if (atom_change != atom)
EDBUG_RETURN_; EDBUG_RETURN_;
} }
EGetGeometry(disp, ewin->client.win, &ww, &x, &y, &w, &h, &dummy, &dummy); EGetGeometry(disp, ewin->client.win, &ww, &x, &y, &w, &h, &bw, &dummy);
ewin->client.x = x; ewin->client.x = x;
ewin->client.y = y; ewin->client.y = y;
ewin->client.w = w; ewin->client.w = w;
ewin->client.h = h; ewin->client.h = h;
ewin->client.bw = bw;
if (XGetWMNormalHints(disp, ewin->client.win, &hint, &mask)) if (XGetWMNormalHints(disp, ewin->client.win, &hint, &mask))
{ {
if (!(ewin->client.already_placed)) if (!(ewin->client.already_placed))
{ {
if ((hint.flags & USPosition) || if ((hint.flags & USPosition) || ((hint.flags & PPosition)))
((hint.flags & PPosition)))
{ {
if (hint.flags & PWinGravity) if (hint.flags & PWinGravity)
ewin->client.grav = hint.win_gravity; ewin->client.grav = hint.win_gravity;
@ -972,7 +977,8 @@ ICCCM_GetHints(EWin * ewin, Atom atom_change)
if (hint) if (hint)
{ {
/* I have to make sure the thing i'm docking is a dock app */ /* I have to make sure the thing i'm docking is a dock app */
if ((hint->flags & StateHint) && (hint->initial_state == WithdrawnState)) if ((hint->flags & StateHint)
&& (hint->initial_state == WithdrawnState))
{ {
if (hint->flags & (StateHint | IconWindowHint | if (hint->flags & (StateHint | IconWindowHint |
IconPositionHint | WindowGroupHint)) IconPositionHint | WindowGroupHint))
@ -1283,8 +1289,9 @@ ICCCM_GetEInfo(EWin * ewin)
ewin->client.w = c[6]; ewin->client.w = c[6];
ewin->client.h = c[7]; ewin->client.h = c[7];
} }
XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True, XA_STRING, XGetWindowProperty(disp, ewin->client.win, aa, 0, 0xffff, True,
&a2, &dummy, &lnum, &ldummy, (unsigned char **)&str); XA_STRING, &a2, &dummy, &lnum, &ldummy,
(unsigned char **)&str);
num = (int)lnum; num = (int)lnum;
if ((num > 0) && (str)) if ((num > 0) && (str))
@ -1292,8 +1299,7 @@ ICCCM_GetEInfo(EWin * ewin)
Border *b = NULL; Border *b = NULL;
b = (Border *) FindItem(str, 0, b = (Border *) FindItem(str, 0,
LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_BORDER);
LIST_TYPE_BORDER);
if ((ewin->border) && (strcmp(ewin->border->name, b->name))) if ((ewin->border) && (strcmp(ewin->border->name, b->name)))
b = NULL; b = NULL;
if (b) if (b)

View File

@ -35,8 +35,7 @@ CreateIclass()
i->name = NULL; i->name = NULL;
i->external = 0; i->external = 0;
i->norm.normal = i->norm.hilited = i->norm.clicked i->norm.normal = i->norm.hilited = i->norm.clicked = i->norm.disabled = NULL;
= i->norm.disabled = NULL;
i->active.normal = i->active.hilited = i->active.clicked i->active.normal = i->active.hilited = i->active.clicked
= i->active.disabled = NULL; = i->active.disabled = NULL;
i->sticky.normal = i->sticky.hilited = i->sticky.clicked i->sticky.normal = i->sticky.hilited = i->sticky.clicked
@ -727,8 +726,8 @@ IclassApply(ImageClass * iclass, Window win, int w, int h,
gcv.ts_y_origin = 0; gcv.ts_y_origin = 0;
tm = ECreatePixmap(disp, win, w, h, 1); tm = ECreatePixmap(disp, win, w, h, 1);
gc = XCreateGC(disp, tm, GCFillStyle | GCTile | gc = XCreateGC(disp, tm, GCFillStyle | GCTile |
GCTileStipXOrigin | GCTileStipYOrigin, GCTileStipXOrigin |
&gcv); GCTileStipYOrigin, &gcv);
XFillRectangle(disp, tm, gc, 0, 0, w, h); XFillRectangle(disp, tm, gc, 0, 0, w, h);
XFreeGC(disp, gc); XFreeGC(disp, gc);
EShapeCombineMask(disp, win, ShapeBounding, EShapeCombineMask(disp, win, ShapeBounding,
@ -1038,8 +1037,8 @@ IclassApplyCopy(ImageClass * iclass, Window win, int w, int h, int active,
gcv.ts_x_origin = 0; gcv.ts_x_origin = 0;
gcv.ts_y_origin = 0; gcv.ts_y_origin = 0;
gc = XCreateGC(disp, tm, GCFillStyle | GCTile | gc = XCreateGC(disp, tm, GCFillStyle | GCTile |
GCTileStipXOrigin | GCTileStipYOrigin, GCTileStipXOrigin |
&gcv); GCTileStipYOrigin, &gcv);
XFillRectangle(disp, tm, gc, 0, 0, w, h); XFillRectangle(disp, tm, gc, 0, 0, w, h);
XFreeGC(disp, gc); XFreeGC(disp, gc);
} }

File diff suppressed because it is too large Load Diff

View File

@ -177,18 +177,14 @@ SetupFallbackClasses(void)
b->border.top = 8; b->border.top = 8;
b->border.bottom = 8; b->border.bottom = 8;
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1, 1024, -1, 0, 7, 1);
-1, 1024, -1, 0, 7, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 1024, -8, -1, 0, 0, 1024, -8, -1, 1024, -1, 1024, -1, 1);
-1, 1024, -1, 1024, -1, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 0, 8, -1, 0, 0, 0, 8, -1, 0, 7, 1024, -9, 1);
-1, 0, 7, 1024, -9, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999, AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 1024, -8, 0, 8, -1, 1024, -8, 0, 8, -1, 1024, -1, 1024, -9, 1);
-1, 1024, -1, 1024, -9, 1);
AddItem(b, b->name, 0, LIST_TYPE_BORDER); AddItem(b, b->name, 0, LIST_TYPE_BORDER);
/* create a fallback background in case no background is found */ /* create a fallback background in case no background is found */
@ -200,7 +196,8 @@ SetupFallbackClasses(void)
tc = CreateTclass(); tc = CreateTclass();
tc->name = "__FALLBACK_TCLASS"; tc->name = "__FALLBACK_TCLASS";
tc->norm.normal = CreateTextState(); tc->norm.normal = CreateTextState();
tc->norm.normal->fontname = duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*"); tc->norm.normal->fontname =
duplicate("-*-helvetica-medium-r-*-*-12-*-*-*-*-*-*-*");
tc->norm.normal->fg_col.r = 0; tc->norm.normal->fg_col.r = 0;
tc->norm.normal->fg_col.g = 0; tc->norm.normal->fg_col.g = 0;
tc->norm.normal->fg_col.b = 0; tc->norm.normal->fg_col.b = 0;

1145
src/ipc.c

File diff suppressed because it is too large Load Diff

View File

@ -88,12 +88,12 @@ static Atom KDE_WIN_TITLE = 0;
/* the modules I have to communicate to */ /* the modules I have to communicate to */
typedef struct KModuleList typedef struct KModuleList
{ {
Window win; Window win;
struct KModuleList *next; struct KModuleList *next;
} }
KModuleList; KModuleList;
static KModuleList *KModules = NULL; static KModuleList *KModules = NULL;
@ -189,8 +189,8 @@ KDE_UpdateFocusedWindow(void)
if (ewin) if (ewin)
{ {
XChangeProperty(disp, root.win, KDE_ACTIVE_WINDOW, KDE_ACTIVE_WINDOW, XChangeProperty(disp, root.win, KDE_ACTIVE_WINDOW, KDE_ACTIVE_WINDOW,
32, PropModeReplace, (unsigned char *) 32, PropModeReplace,
&(ewin->client.win), 1); (unsigned char *)&(ewin->client.win), 1);
} }
else else
{ {
@ -256,7 +256,8 @@ KDE_NewWindow(EWin * ewin)
setSimpleHint(ewin->client.win, KDE_WIN_MAXIMIZED, 0); setSimpleHint(ewin->client.win, KDE_WIN_MAXIMIZED, 0);
} }
setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP, ewin->desktop + 1); setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP,
ewin->desktop + 1);
ewin->kde_hint = 1; ewin->kde_hint = 1;
KDE_SendMessagesToModules(KDE_MODULE_WIN_ADD, ewin->client.win); KDE_SendMessagesToModules(KDE_MODULE_WIN_ADD, ewin->client.win);
@ -403,7 +404,8 @@ KDE_AddModule(Window win)
KDE_WIN_MAXIMIZED, 0); KDE_WIN_MAXIMIZED, 0);
} }
if (!getSimpleHint(lst[i]->client.win, KDE_WIN_DESKTOP)) if (!getSimpleHint(lst[i]->client.win, KDE_WIN_DESKTOP))
setSimpleHint(lst[i]->client.win, KDE_WIN_DESKTOP, lst[i]->desktop + 1); setSimpleHint(lst[i]->client.win, KDE_WIN_DESKTOP,
lst[i]->desktop + 1);
KDE_ClientMessage(win, KDE_MODULE_WIN_ADD, KDE_ClientMessage(win, KDE_MODULE_WIN_ADD,
lst[i]->client.win, CurrentTime); lst[i]->client.win, CurrentTime);
lst[i]->kde_hint = 1; lst[i]->kde_hint = 1;
@ -499,8 +501,7 @@ KDE_Init(void)
if (!KDE_WIN_STICKY) if (!KDE_WIN_STICKY)
{ {
KDE_WIN_UNSAVED_DATA = XInternAtom(disp, "KWM_WIN_UNSAVED_DATA", KDE_WIN_UNSAVED_DATA = XInternAtom(disp, "KWM_WIN_UNSAVED_DATA", False);
False);
KDE_WIN_DECORATION = XInternAtom(disp, "KWM_WIN_DECORATION", False); KDE_WIN_DECORATION = XInternAtom(disp, "KWM_WIN_DECORATION", False);
@ -533,8 +534,7 @@ KDE_Init(void)
KDE_DO_NOT_MANAGE = XInternAtom(disp, "KWM_DO_NOT_MANAGE", False); KDE_DO_NOT_MANAGE = XInternAtom(disp, "KWM_DO_NOT_MANAGE", False);
KDE_CURRENT_DESKTOP = XInternAtom(disp, "KWM_CURRENT_DESKTOP", KDE_CURRENT_DESKTOP = XInternAtom(disp, "KWM_CURRENT_DESKTOP", False);
False);
KDE_NUMBER_OF_DESKTOPS = XInternAtom(disp, "KWM_NUMBER_OF_DESKTOPS", KDE_NUMBER_OF_DESKTOPS = XInternAtom(disp, "KWM_NUMBER_OF_DESKTOPS",
False); False);
@ -550,11 +550,12 @@ KDE_Init(void)
False); False);
KDE_MODULE_DESKTOP_CHANGE = XInternAtom(disp, KDE_MODULE_DESKTOP_CHANGE = XInternAtom(disp,
"KWM_MODULE_DESKTOP_CHANGE", False); "KWM_MODULE_DESKTOP_CHANGE",
KDE_MODULE_DESKTOP_NAME_CHANGE = XInternAtom(disp, False);
"KWM_MODULE_DESKTOP_NAME_CHANGE", False); KDE_MODULE_DESKTOP_NAME_CHANGE =
KDE_MODULE_DESKTOP_NUMBER_CHANGE = XInternAtom(disp, XInternAtom(disp, "KWM_MODULE_DESKTOP_NAME_CHANGE", False);
"KWM_MODULE_DESKTOP_NUMBER_CHANGE", False); KDE_MODULE_DESKTOP_NUMBER_CHANGE =
XInternAtom(disp, "KWM_MODULE_DESKTOP_NUMBER_CHANGE", False);
KDE_MODULE_WIN_ADD = XInternAtom(disp, "KWM_MODULE_WIN_ADD", False); KDE_MODULE_WIN_ADD = XInternAtom(disp, "KWM_MODULE_WIN_ADD", False);
KDE_MODULE_WIN_REMOVE = XInternAtom(disp, "KWM_MODULE_WIN_REMOVE", KDE_MODULE_WIN_REMOVE = XInternAtom(disp, "KWM_MODULE_WIN_REMOVE",
@ -566,11 +567,12 @@ KDE_Init(void)
KDE_MODULE_WIN_ACTIVATE = XInternAtom(disp, "KWM_MODULE_WIN_ACTIVATE", KDE_MODULE_WIN_ACTIVATE = XInternAtom(disp, "KWM_MODULE_WIN_ACTIVATE",
False); False);
KDE_MODULE_WIN_ICON_CHANGE = XInternAtom(disp, KDE_MODULE_WIN_ICON_CHANGE = XInternAtom(disp,
"KWM_MODULE_WIN_ICON_CHANGE", False); "KWM_MODULE_WIN_ICON_CHANGE",
KDE_MODULE_DOCKWIN_ADD = XInternAtom(disp, "KWM_MODULE_DOCKWIN_ADD", False);
False); KDE_MODULE_DOCKWIN_ADD =
KDE_MODULE_DOCKWIN_REMOVE = XInternAtom(disp, XInternAtom(disp, "KWM_MODULE_DOCKWIN_ADD", False);
"KWM_MODULE_DOCKWIN_REMOVE", False); KDE_MODULE_DOCKWIN_REMOVE =
XInternAtom(disp, "KWM_MODULE_DOCKWIN_REMOVE", False);
memset(KDE_DESKTOP_WINDOW_REGION, 0, sizeof(KDE_DESKTOP_WINDOW_REGION)); memset(KDE_DESKTOP_WINDOW_REGION, 0, sizeof(KDE_DESKTOP_WINDOW_REGION));
@ -870,8 +872,7 @@ KDE_GetDecorationHint(Window win, long *dechints)
ewin->border_new = 1; ewin->border_new = 1;
SetEwinToBorder(ewin, b); SetEwinToBorder(ewin, b);
ICCCM_MatchSize(ewin); ICCCM_MatchSize(ewin);
MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
ewin->client.h);
EDBUG_RETURN_; EDBUG_RETURN_;
@ -1170,8 +1171,7 @@ KDE_SetRootArea(void)
EDBUG(6, "KDE_SetRootArea"); EDBUG(6, "KDE_SetRootArea");
if (getSimpleHint(root.win, KDE_CURRENT_DESKTOP)) if (getSimpleHint(root.win, KDE_CURRENT_DESKTOP))
if (*(getSimpleHint(root.win, KDE_CURRENT_DESKTOP)) == if (*(getSimpleHint(root.win, KDE_CURRENT_DESKTOP)) == desks.current + 1)
desks.current + 1)
EDBUG_RETURN_; EDBUG_RETURN_;
setSimpleHint(root.win, KDE_CURRENT_DESKTOP, desks.current + 1); setSimpleHint(root.win, KDE_CURRENT_DESKTOP, desks.current + 1);
@ -1211,7 +1211,8 @@ KDE_SetNumDesktops(void)
{ {
Esnprintf(s, sizeof(s), "Desk %d", i); Esnprintf(s, sizeof(s), "Desk %d", i);
XChangeProperty(disp, root.win, KDE_DESKTOP_NAME[i], XA_STRING, 8, XChangeProperty(disp, root.win, KDE_DESKTOP_NAME[i], XA_STRING, 8,
PropModeReplace, (unsigned char *)s, strlen(s) + 1); PropModeReplace, (unsigned char *)s,
strlen(s) + 1);
} }
} }
@ -1254,9 +1255,10 @@ KDE_HintChange(Atom a)
unsigned long extra; unsigned long extra;
unsigned long *data; unsigned long *data;
if (XGetWindowProperty(disp, root.win, a, 0, 4, False, a, &type_ret, if (XGetWindowProperty
&fmt_ret, &num, &extra, (disp, root.win, a, 0, 4, False, a, &type_ret, &fmt_ret,
(unsigned char **)&data) != Success || !data) &num, &extra, (unsigned char **)&data) != Success
|| !data)
{ {
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -1364,7 +1366,8 @@ KDE_UpdateClient(EWin * ewin)
{ {
if ((*(getSimpleHint(ewin->client.win, KDE_WIN_DESKTOP)) - 1) != if ((*(getSimpleHint(ewin->client.win, KDE_WIN_DESKTOP)) - 1) !=
ewin->desktop) ewin->desktop)
setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP, (ewin->desktop) + 1); setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP,
(ewin->desktop) + 1);
} }
else else
{ {

View File

@ -35,8 +35,7 @@ runDocBrowser(void)
Esnprintf(file, sizeof(file), "exec %s/dox %s/E-docs", Esnprintf(file, sizeof(file), "exec %s/dox %s/E-docs",
ENLIGHTENMENT_BIN, ENLIGHTENMENT_ROOT); ENLIGHTENMENT_BIN, ENLIGHTENMENT_ROOT);
execl(usershell(getuid()), usershell(getuid()), "-c", execl(usershell(getuid()), usershell(getuid()), "-c", (char *)file, NULL);
(char *)file, NULL);
exit(0); exit(0);
} }
@ -58,6 +57,14 @@ main(int argc, char **argv)
single_screen_mode = 0; single_screen_mode = 0;
/* unsetenv("LD_PRELOAD"); */ /* unsetenv("LD_PRELOAD"); */
/* Part of gettext stuff */
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, ENLIGHTENMENT_ROOT "/locale");
textdomain(PACKAGE);
/* End of gettext stuff */
#ifdef DEBUG #ifdef DEBUG
call_level = 0; call_level = 0;
debug_level = 0; debug_level = 0;
@ -79,10 +86,10 @@ main(int argc, char **argv)
lists = memset(lists, 0, (sizeof(List) * LIST_TYPE_COUNT)); lists = memset(lists, 0, (sizeof(List) * LIST_TYPE_COUNT));
/* Set up all the text bits that belong on the GSOD */ /* Set up all the text bits that belong on the GSOD */
AssignTitleText("Enlightenment Message Dialog"); AssignTitleText(gettext("Enlightenment Message Dialog"));
AssignIgnoreText("Ignore this"); AssignIgnoreText(gettext("Ignore this"));
AssignRestartText("Restart Enlightenment"); AssignRestartText(gettext("Restart Enlightenment"));
AssignExitText("Quit Enlightenment"); AssignExitText(gettext("Quit Enlightenment"));
/* We'll set up what the buttons do now, too */ /* We'll set up what the buttons do now, too */
AssignRestartFunction(doExit, "restart"); AssignRestartFunction(doExit, "restart");
@ -166,10 +173,10 @@ main(int argc, char **argv)
} }
else if ((!strcmp("-v", argv[j])) || else if ((!strcmp("-v", argv[j])) ||
(!strcmp("-version", argv[j])) || (!strcmp("-version", argv[j])) ||
(!strcmp("--version", argv[j])) || (!strcmp("--version", argv[j])) || (!strcmp("-v", argv[j])))
(!strcmp("-v", argv[j])))
{ {
printf("Enlightenment Version: %s\nLast updated on: %s\n", printf(gettext
("Enlightenment Version: %s\nLast updated on: %s\n"),
ENLIGHTENMENT_VERSION, E_CHECKOUT_DATE); ENLIGHTENMENT_VERSION, E_CHECKOUT_DATE);
exit(0); exit(0);
} }

View File

@ -71,10 +71,10 @@ end: \
} }
static struct _symtab static struct _symtab
{ {
void *val; void *val;
char *symbol; char *symbol;
} }
*sym = NULL; *sym = NULL;
static int sym_count = 0; static int sym_count = 0;
@ -192,24 +192,25 @@ __Emalloc(int size, const char *file, int line)
{ {
if (disp) if (disp)
UngrabX(); UngrabX();
ASSIGN_ALERT("Cannot allocate enough memory", ASSIGN_ALERT(gettext("Cannot allocate enough memory"),
"Ignore this", gettext("Ignore this"),
"Restart Enlightenment", gettext("Restart Enlightenment"),
"Quit Enlightenment"); gettext("Quit Enlightenment"));
Alert("WARNING!!!!!!\n" Alert(gettext("WARNING!!!!!!\n"
"\n" "\n"
"Allocation for %i bytes (%3.0f Kb or %3.1f Mb) did not succeed.\n" "Allocation for %i bytes (%3.0f Kb or %3.1f Mb) did not succeed.\n"
"\n" "\n"
"Either this is a bug where ridiculous amounts of memory\n" "Either this is a bug where ridiculous amounts of memory\n"
"are being allocated, or your system has run out of both\n" "are being allocated, or your system has run out of both\n"
"real and virtual memory and is unable to satisfy the request.\n" "real and virtual memory and is unable to satisfy the request.\n"
"\n" "\n"
"If you have a low memory system it is suggested to either\n" "If you have a low memory system it is suggested to either\n"
"purchase more memory, increase SWAP space, or reconfigure\n" "purchase more memory, increase SWAP space, or reconfigure\n"
"Enlightenment to use less resources by turning features off.\n" "Enlightenment to use less resources by turning features off.\n"
"\n" "\n"
"The malloc requested was at %s, line %d\n ", "The malloc requested was at %s, line %d\n "),
size, (float)size / 1024, (float)size / (1024 * 1024), file, line); size, (float)size / 1024, (float)size / (1024 * 1024), file,
line);
RESET_ALERT; RESET_ALERT;
} }
#ifdef DBUG_MEM #ifdef DBUG_MEM
@ -272,21 +273,18 @@ __Erealloc(void *ptr, int size, const char *file, int line)
{ {
if (disp) if (disp)
UngrabX(); UngrabX();
ASSIGN_ALERT("Error in reallocating memory that hasn't been allocated", ASSIGN_ALERT(gettext
"Ignore this", ("Error in reallocating memory that hasn't been allocated"),
"Restart Enlightenment", gettext("Ignore this"), gettext("Restart Enlightenment"),
"Quit Enlightenment"); gettext("Quit Enlightenment"));
Alert("WARNING!!!!!!\n" Alert(gettext
"\n" ("WARNING!!!!!!\n" "\n"
"Re-allocation for %i bytes (%3.0f Kb or %f3.1 Mb)\n" "Re-allocation for %i bytes (%3.0f Kb or %f3.1 Mb)\n"
"for pointer %x is attempting to re-allocate memory for a\n" "for pointer %x is attempting to re-allocate memory for a\n"
"memory chunk that has not been allocated or has already been\n" "memory chunk that has not been allocated or has already been\n"
"freed.\n" "freed.\n" "\n" "This is definitely a bug. Please report it.\n"
"\n" "\n" "The error occured at %s, line %d.\n"), size,
"This is definitely a bug. Please report it.\n" (float)size / 1024, (float)size / (1024 * 1024), ptr, file, line);
"\n"
"The error occured at %s, line %d.\n",
size, (float)size / 1024, (float)size / (1024 * 1024), ptr, file, line);
RESET_ALERT; RESET_ALERT;
EDBUG_RETURN(NULL); EDBUG_RETURN(NULL);
} }
@ -296,24 +294,25 @@ __Erealloc(void *ptr, int size, const char *file, int line)
{ {
if (disp) if (disp)
UngrabX(); UngrabX();
ASSIGN_ALERT("Cannot allocate enough memory", ASSIGN_ALERT(gettext("Cannot allocate enough memory"),
"Ignore this", gettext("Ignore this"),
"Restart Enlightenment", gettext("Restart Enlightenment"),
"Quit Enlightenment"); gettext("Quit Enlightenment"));
Alert("WARNING!!!!!!\n" Alert(gettext("WARNING!!!!!!\n"
"\n" "\n"
"Re-allocation for %i bytes (%3.0f Kb or %3.1f Mb) did not succeed.\n" "Re-allocation for %i bytes (%3.0f Kb or %3.1f Mb) did not succeed.\n"
"\n" "\n"
"Either this is a bug where ridiculous amounts of memory\n" "Either this is a bug where ridiculous amounts of memory\n"
"are being allocated, or your system has run out of both\n" "are being allocated, or your system has run out of both\n"
"real and virtual memory and is unable to satisfy the request.\n" "real and virtual memory and is unable to satisfy the request.\n"
"\n" "\n"
"If you have a low memory system it is suggested to either\n" "If you have a low memory system it is suggested to either\n"
"purchase more memory, increase SWAP space, or reconfigure\n" "purchase more memory, increase SWAP space, or reconfigure\n"
"Enlightenment to use less resources by turning features off.\n" "Enlightenment to use less resources by turning features off.\n"
"\n" "\n"
"The realloc requested was at %s, line %d\n ", "The realloc requested was at %s, line %d\n "),
size, (float)size / 1024, (float)size / (1024 * 1024), file, line); size, (float)size / 1024, (float)size / (1024 * 1024), file,
line);
RESET_ALERT; RESET_ALERT;
} }
#ifdef DBUG_MEM #ifdef DBUG_MEM
@ -376,20 +375,16 @@ __Efree(void *ptr, const char *file, int line)
{ {
if (disp) if (disp)
UngrabX(); UngrabX();
ASSIGN_ALERT("Error in freeing memory that hasn't been allocated", ASSIGN_ALERT(gettext
"Ignore this", ("Error in freeing memory that hasn't been allocated"),
"Restart Enlightenment", gettext("Ignore this"), gettext("Restart Enlightenment"),
"Quit Enlightenment"); gettext("Quit Enlightenment"));
Alert("WARNING!!!!!!\n" Alert(gettext
"\n" ("WARNING!!!!!!\n" "\n"
"freeing for pointer %x is attempting to free memory for a\n" "freeing for pointer %x is attempting to free memory for a\n"
"memory chunk that has not been allocated, or has already been\n" "memory chunk that has not been allocated, or has already been\n"
"freed.\n" "freed.\n" "\n" "This is definitely a bug. Please report it.\n"
"\n" "\n" "The error occured at %s, line %d.\n"), ptr, file, line);
"This is definitely a bug. Please report it.\n"
"\n"
"The error occured at %s, line %d.\n",
ptr, file, line);
RESET_ALERT; RESET_ALERT;
EDBUG_RETURN_; EDBUG_RETURN_;
} }
@ -398,20 +393,19 @@ __Efree(void *ptr, const char *file, int line)
{ {
if (disp) if (disp)
UngrabX(); UngrabX();
ASSIGN_ALERT("Error in attempting to free NULL pointer", ASSIGN_ALERT(gettext("Error in attempting to free NULL pointer"),
"Ignore this (safe)", gettext("Ignore this (safe)"),
"Restart Enlightenment", gettext("Restart Enlightenment"),
"Quit Enlightenment"); gettext("Quit Enlightenment"));
Alert("WARNING!!!!!!\n" Alert(gettext("WARNING!!!!!!\n"
"\n" "\n"
"Enlightenment attempted to free a NULL pointer.\n" "Enlightenment attempted to free a NULL pointer.\n"
"\n" "\n"
"This is definitely a bug. Please report it.\n" "This is definitely a bug. Please report it.\n"
"It is safe to ignore this error and continue running Enlightenment.\n" "It is safe to ignore this error and continue running Enlightenment.\n"
"\n" "\n"
"The pointer value was %x.\n" "The pointer value was %x.\n"
"The error occured at %s, line %d.\n", "The error occured at %s, line %d.\n"), ptr, file, line);
ptr, file, line);
RESET_ALERT; RESET_ALERT;
EDBUG_RETURN_; EDBUG_RETURN_;
} }

View File

@ -27,7 +27,8 @@ static MenuStyle *desk_menu_style = NULL;
static MenuStyle *group_menu_style = NULL; static MenuStyle *group_menu_style = NULL;
static void FileMenuUpdate(int val, void *data); static void FileMenuUpdate(int val, void *data);
static void FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name, char *file, Menu * parent); static void FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name,
char *file, Menu * parent);
void void
ShowTaskMenu(void) ShowTaskMenu(void)
@ -308,8 +309,9 @@ ShowMenu(Menu * m, char noshow)
ewin = FindEwinByMenu(m); ewin = FindEwinByMenu(m);
if (ewin) if (ewin)
{ {
if ((mode.button) && FindItem((char *)mode.button, 0, LIST_FINDBY_POINTER, if ((mode.button)
LIST_TYPE_BUTTON)) && FindItem((char *)mode.button, 0, LIST_FINDBY_POINTER,
LIST_TYPE_BUTTON))
{ {
fprintf(stderr, "setting back to normal\n"); fprintf(stderr, "setting back to normal\n");
mode.button->state = STATE_NORMAL; mode.button->state = STATE_NORMAL;
@ -355,7 +357,8 @@ ShowMenu(Menu * m, char noshow)
if (mode.menusonscreen) if (mode.menusonscreen)
EMoveWindow(disp, m->win, wx, wy); EMoveWindow(disp, m->win, wx, wy);
else else
EMoveWindow(disp, m->win, mode.x - x - (w / 2), mode.y - y - (h / 2)); EMoveWindow(disp, m->win, mode.x - x - (w / 2),
mode.y - y - (h / 2));
} }
else if ((mode.x >= 0) && (mode.y < 0)) else if ((mode.x >= 0) && (mode.y < 0))
{ {
@ -671,7 +674,8 @@ void
RealizeMenu(Menu * m) RealizeMenu(Menu * m)
{ {
int i, maxh = 0, maxw = 0, maxx1, maxx2, w, h, x, y, r, int i, maxh = 0, maxw = 0, maxx1, maxx2, w, h, x, y, r,
mmw, mmh;
mmw, mmh;
unsigned int iw, ih; unsigned int iw, ih;
ImlibImage *im; ImlibImage *im;
XSetWindowAttributes att; XSetWindowAttributes att;
@ -728,7 +732,8 @@ RealizeMenu(Menu * m)
im->rgb_width, im->rgb_width,
im->rgb_height, 0); im->rgb_height, 0);
EMapWindow(disp, m->items[i]->icon_win); EMapWindow(disp, m->items[i]->icon_win);
XChangeWindowAttributes(disp, m->items[i]->icon_win, CWEventMask, &att); XChangeWindowAttributes(disp, m->items[i]->icon_win,
CWEventMask, &att);
m->items[i]->icon_w = im->rgb_width; m->items[i]->icon_w = im->rgb_width;
m->items[i]->icon_h = im->rgb_height; m->items[i]->icon_h = im->rgb_height;
if (im->rgb_height > maxh) if (im->rgb_height > maxh)
@ -743,20 +748,24 @@ RealizeMenu(Menu * m)
} }
if (((has_i) && (has_s)) || ((!has_i) && (!has_s))) if (((has_i) && (has_s)) || ((!has_i) && (!has_s)))
{ {
if (m->style->item_iclass->padding.top > m->style->sub_iclass->padding.top) if (m->style->item_iclass->padding.top >
m->style->sub_iclass->padding.top)
maxh += m->style->item_iclass->padding.top; maxh += m->style->item_iclass->padding.top;
else else
maxh += m->style->sub_iclass->padding.top; maxh += m->style->sub_iclass->padding.top;
if (m->style->item_iclass->padding.bottom > m->style->sub_iclass->padding.bottom) if (m->style->item_iclass->padding.bottom >
m->style->sub_iclass->padding.bottom)
maxh += m->style->item_iclass->padding.bottom; maxh += m->style->item_iclass->padding.bottom;
else else
maxh += m->style->sub_iclass->padding.bottom; maxh += m->style->sub_iclass->padding.bottom;
maxw = maxx1 + maxx2; maxw = maxx1 + maxx2;
if (m->style->item_iclass->padding.left > m->style->sub_iclass->padding.left) if (m->style->item_iclass->padding.left >
m->style->sub_iclass->padding.left)
maxw += m->style->item_iclass->padding.left; maxw += m->style->item_iclass->padding.left;
else else
maxw += m->style->sub_iclass->padding.left; maxw += m->style->sub_iclass->padding.left;
if (m->style->item_iclass->padding.right > m->style->sub_iclass->padding.right) if (m->style->item_iclass->padding.right >
m->style->sub_iclass->padding.right)
maxw += m->style->item_iclass->padding.right; maxw += m->style->item_iclass->padding.right;
else else
maxw += m->style->sub_iclass->padding.right; maxw += m->style->sub_iclass->padding.right;
@ -818,8 +827,8 @@ RealizeMenu(Menu * m)
iw = 0; iw = 0;
ih = 0; ih = 0;
GetWinWH(m->items[i]->icon_win, &iw, &ih); GetWinWH(m->items[i]->icon_win, &iw, &ih);
IclassApply(m->items[i]->icon_iclass, m->items[i]->icon_win, iw, ih, IclassApply(m->items[i]->icon_iclass, m->items[i]->icon_win, iw,
0, 0, STATE_NORMAL, 0); ih, 0, 0, STATE_NORMAL, 0);
} }
if (x + maxw > mmw) if (x + maxw > mmw)
mmw = x + maxw; mmw = x + maxw;
@ -864,8 +873,7 @@ RealizeMenu(Menu * m)
IclassApplyCopy(m->style->bg_iclass, m->win, mmw, mmh, 0, 0, IclassApplyCopy(m->style->bg_iclass, m->win, mmw, mmh, 0, 0,
STATE_NORMAL, &(m->pmap), &(m->mask)); STATE_NORMAL, &(m->pmap), &(m->mask));
ESetWindowBackgroundPixmap(disp, m->win, m->pmap); ESetWindowBackgroundPixmap(disp, m->win, m->pmap);
EShapeCombineMask(disp, m->win, ShapeBounding, EShapeCombineMask(disp, m->win, ShapeBounding, 0, 0, m->mask, ShapeSet);
0, 0, m->mask, ShapeSet);
for (i = 0; i < m->num; i++) for (i = 0; i < m->num; i++)
DrawMenuItem(m, m->items[i], 0); DrawMenuItem(m, m->items[i], 0);
} }
@ -900,26 +908,29 @@ DrawMenuItem(Menu * m, MenuItem * mi, char shape)
GetWinXY(mi->win, &x, &y); GetWinXY(mi->win, &x, &y);
if (!m->style->use_item_bg) if (!m->style->use_item_bg)
{ {
mi->pmap[(int)(mi->state)] = ECreatePixmap(disp, mi->win, w, h, id->x.depth); mi->pmap[(int)(mi->state)] =
ECreatePixmap(disp, mi->win, w, h, id->x.depth);
gc = XCreateGC(disp, m->pmap, 0, &gcv); gc = XCreateGC(disp, m->pmap, 0, &gcv);
XCopyArea(disp, m->pmap, mi->pmap[(int)(mi->state)], gc, x, y, w, h, 0, 0); XCopyArea(disp, m->pmap, mi->pmap[(int)(mi->state)], gc, x, y,
w, h, 0, 0);
mi->mask[(int)(mi->state)] = None; mi->mask[(int)(mi->state)] = None;
if ((mi->state != STATE_NORMAL) || (mi->child)) if ((mi->state != STATE_NORMAL) || (mi->child))
{ {
pmap = 0; pmap = 0;
mask = 0; mask = 0;
if (mi->child) if (mi->child)
IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0, mi->state, IclassApplyCopy(m->style->sub_iclass, mi->win, w, h,
&pmap, &mask); 0, 0, mi->state, &pmap, &mask);
else else
IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, IclassApplyCopy(m->style->item_iclass, mi->win, w, h,
&pmap, &mask); 0, 0, mi->state, &pmap, &mask);
if (mask) if (mask)
{ {
XSetClipMask(disp, gc, mask); XSetClipMask(disp, gc, mask);
XSetClipOrigin(disp, gc, 0, 0); XSetClipOrigin(disp, gc, 0, 0);
} }
XCopyArea(disp, pmap, mi->pmap[(int)(mi->state)], gc, 0, 0, w, h, 0, 0); XCopyArea(disp, pmap, mi->pmap[(int)(mi->state)], gc, 0,
0, w, h, 0, 0);
Imlib_free_pixmap(id, pmap); Imlib_free_pixmap(id, pmap);
if (mask) if (mask)
Imlib_free_pixmap(id, mask); Imlib_free_pixmap(id, mask);
@ -929,11 +940,13 @@ DrawMenuItem(Menu * m, MenuItem * mi, char shape)
else else
{ {
if (mi->child) if (mi->child)
IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0, mi->state, IclassApplyCopy(m->style->sub_iclass, mi->win, w, h, 0, 0,
&(mi->pmap[(int)(mi->state)]), &(mi->mask[(int)(mi->state)])); mi->state, &(mi->pmap[(int)(mi->state)]),
&(mi->mask[(int)(mi->state)]));
else else
IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, IclassApplyCopy(m->style->item_iclass, mi->win, w, h, 0, 0,
&(mi->pmap[(int)(mi->state)]), &(mi->mask[(int)(mi->state)])); mi->state, &(mi->pmap[(int)(mi->state)]),
&(mi->mask[(int)(mi->state)]));
} }
} }
} }
@ -957,7 +970,8 @@ DrawMenuItem(Menu * m, MenuItem * mi, char shape)
if (!m->style->use_item_bg) if (!m->style->use_item_bg)
{ {
if ((mi->state != STATE_NORMAL) || (mi->child)) if ((mi->state != STATE_NORMAL) || (mi->child))
IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, 0); IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0,
mi->state, 0);
else else
{ {
ESetWindowBackgroundPixmap(disp, mi->win, ParentRelative); ESetWindowBackgroundPixmap(disp, mi->win, ParentRelative);
@ -969,9 +983,11 @@ DrawMenuItem(Menu * m, MenuItem * mi, char shape)
else else
{ {
if (mi->child) if (mi->child)
IclassApply(m->style->sub_iclass, mi->win, w, h, 0, 0, mi->state, 0); IclassApply(m->style->sub_iclass, mi->win, w, h, 0, 0,
mi->state, 0);
else else
IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0, mi->state, 0); IclassApply(m->style->item_iclass, mi->win, w, h, 0, 0,
mi->state, 0);
} }
} }
if ((shape) && (m->style->use_item_bg)) if ((shape) && (m->style->use_item_bg))
@ -991,10 +1007,10 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
struct stat st; struct stat st;
const char *chmap = const char *chmap =
#ifndef __EMX__ #ifndef __EMX__
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_"; "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
#else #else
"0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_"; "0123456789abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>“”•˜<EFBFBD>-_";
#endif #endif
FILE *f; FILE *f;
@ -1039,8 +1055,7 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
chmap[(cc >> 6) & 0x3f], chmap[(cc >> 6) & 0x3f],
chmap[(cc >> 12) & 0x3f], chmap[(cc >> 12) & 0x3f],
chmap[(cc >> 18) & 0x3f], chmap[(cc >> 18) & 0x3f],
chmap[(cc >> 24) & 0x3f], chmap[(cc >> 24) & 0x3f], chmap[(cc >> 28) & 0x3f]);
chmap[(cc >> 28) & 0x3f]);
/* cached dir listing - use it */ /* cached dir listing - use it */
if (exists(cs)) if (exists(cs))
{ {
@ -1060,7 +1075,9 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
char s2[4096], s3[512]; char s2[4096], s3[512];
word(s, 3, s3); word(s, 3, s3);
bg = (Background *) FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); bg =
(Background *) FindItem(s3, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
if (!bg) if (!bg)
{ {
ImlibImage *im; ImlibImage *im;
@ -1074,13 +1091,13 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ImlibColor icl; ImlibColor icl;
char tile = 1, keep_asp = 0; char tile = 1, keep_asp = 0;
int width, height, scalex = 0, int width, height, scalex = 0,
scaley = 0; scaley = 0;
int scr_asp, im_asp, w2, int scr_asp, im_asp, w2, h2;
h2;
int maxw = 48, maxh = 48; int maxw = 48, maxh = 48;
int justx = 512, justy = 512; int justx = 512, justy = 512;
Esnprintf(s2, sizeof(s2), "%s/cached/img/%s", UserEDir(), s3); Esnprintf(s2, sizeof(s2), "%s/cached/img/%s",
UserEDir(), s3);
width = im->rgb_width; width = im->rgb_width;
height = im->rgb_height; height = im->rgb_height;
h2 = maxh; h2 = maxh;
@ -1088,7 +1105,8 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
if (w2 > maxw) if (w2 > maxw)
{ {
w2 = maxw; w2 = maxw;
h2 = (im->rgb_height * w2) / im->rgb_width; h2 =
(im->rgb_height * w2) / im->rgb_width;
} }
im2 = Imlib_clone_scaled_image(id, im, w2, h2); im2 = Imlib_clone_scaled_image(id, im, w2, h2);
Imlib_save_image_to_ppm(id, im2, s2); Imlib_save_image_to_ppm(id, im2, s2);
@ -1107,8 +1125,8 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
tile = 1; tile = 1;
keep_asp = 0; keep_asp = 0;
} }
else if ((!(IN_RANGE(scr_asp, im_asp, 16000))) && else if ((!(IN_RANGE(scr_asp, im_asp, 16000)))
((width < 480) && (height < 360))) && ((width < 480) && (height < 360)))
{ {
justx = 0; justx = 0;
justy = 0; justy = 0;
@ -1147,9 +1165,11 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
icl.r = 0; icl.r = 0;
icl.g = 0; icl.g = 0;
icl.b = 0; icl.b = 0;
bg = CreateDesktopBG(s3, &icl, ss, tile, keep_asp, bg =
justx, justy, scalex, scaley, CreateDesktopBG(s3, &icl, ss, tile,
NULL, 0, 0, 0, 0, 0); keep_asp, justx, justy,
scalex, scaley, NULL, 0, 0,
0, 0, 0);
AddItem(bg, bg->name, 0, LIST_TYPE_BACKGROUND); AddItem(bg, bg->name, 0, LIST_TYPE_BACKGROUND);
} }
else else
@ -1168,7 +1188,9 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ic->norm.normal->unloadable = 1; ic->norm.normal->unloadable = 1;
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS); AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
mi = CreateMenuItem(NULL, ic, ACTION_BACKGROUND_SET, s3, NULL); mi =
CreateMenuItem(NULL, ic, ACTION_BACKGROUND_SET,
s3, NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
} }
@ -1287,9 +1309,10 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
chmap[(cc >> 6) & 0x3f], chmap[(cc >> 6) & 0x3f],
chmap[(cc >> 12) & 0x3f], chmap[(cc >> 12) & 0x3f],
chmap[(cc >> 18) & 0x3f], chmap[(cc >> 18) & 0x3f],
chmap[(cc >> 24) & 0x3f], chmap[(cc >> 24) & 0x3f], chmap[(cc >> 28) & 0x3f]);
chmap[(cc >> 28) & 0x3f]); bg =
bg = (Background *) FindItem(s3, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND); (Background *) FindItem(s3, 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
if (!bg) if (!bg)
{ {
ImlibImage *im; ImlibImage *im;
@ -1301,11 +1324,12 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ImlibColor icl; ImlibColor icl;
char tile = 1, keep_asp = 0; char tile = 1, keep_asp = 0;
int width, height, scalex = 0, int width, height, scalex = 0,
scaley = 0; scaley = 0;
int scr_asp, im_asp, w2, h2; int scr_asp, im_asp, w2, h2;
int maxw = 48, maxh = 48; int maxw = 48, maxh = 48;
Esnprintf(s2, sizeof(s2), "%s/cached/img/%s", UserEDir(), s3); Esnprintf(s2, sizeof(s2), "%s/cached/img/%s",
UserEDir(), s3);
width = im->rgb_width; width = im->rgb_width;
height = im->rgb_height; height = im->rgb_height;
h2 = maxh; h2 = maxh;
@ -1383,7 +1407,9 @@ CreateMenuFromDirectory(char *name, MenuStyle * ms, char *dir)
ic->norm.normal->unloadable = 1; ic->norm.normal->unloadable = 1;
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS); AddItem(ic, ic->name, 0, LIST_TYPE_ICLASS);
mi = CreateMenuItem(NULL, ic, ACTION_BACKGROUND_SET, s3, NULL); mi =
CreateMenuItem(NULL, ic, ACTION_BACKGROUND_SET, s3,
NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
if (f) if (f)
@ -1440,7 +1466,8 @@ CreateMenuFromFlatFile(char *name, MenuStyle * ms, char *file, Menu * parent)
} }
static void static void
FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name, char *file, Menu * parent) FillFlatFileMenu(Menu * m, MenuStyle * ms, char *name, char *file,
Menu * parent)
{ {
FILE *f; FILE *f;
char first = 1; char first = 1;
@ -1658,8 +1685,9 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
#endif #endif
if (f) if (f)
{ {
char *iname = NULL, *exec = NULL, *texec = NULL, char *iname = NULL, *exec = NULL, *texec =
*tmp;
NULL, *tmp;
char *en_name = NULL; char *en_name = NULL;
while (fgets(s, sizeof(s), f)) while (fgets(s, sizeof(s), f))
@ -1671,7 +1699,8 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
else if (name_buf[0] && else if (name_buf[0] &&
!strncmp(s, name_buf, strlen(name_buf))) !strncmp(s, name_buf, strlen(name_buf)))
iname = duplicate(&(s[strlen(name_buf)])); iname = duplicate(&(s[strlen(name_buf)]));
else if (!strncmp(s, "TryExec=", strlen("TryExec="))) else
if (!strncmp(s, "TryExec=", strlen("TryExec=")))
texec = duplicate(&(s[strlen("TryExec=")])); texec = duplicate(&(s[strlen("TryExec=")]));
else if (!strncmp(s, "Exec=", strlen("Exec="))) else if (!strncmp(s, "Exec=", strlen("Exec=")))
exec = duplicate(&(s[strlen("Exec=")])); exec = duplicate(&(s[strlen("Exec=")]));
@ -1697,7 +1726,9 @@ CreateMenuFromGnome(char *name, MenuStyle * ms, char *dir)
if (tmp) if (tmp)
Efree(tmp); Efree(tmp);
mi = CreateMenuItem(iname, NULL, ACTION_EXEC, exec, NULL); mi =
CreateMenuItem(iname, NULL, ACTION_EXEC,
exec, NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
} }
@ -1781,7 +1812,9 @@ CreateMenuFromBorders(char *name, MenuStyle * ms)
/* if its not internal (ie doesnt start with _ ) */ /* if its not internal (ie doesnt start with _ ) */
if (lst[i]->name[0] != '_') if (lst[i]->name[0] != '_')
{ {
mi = CreateMenuItem(lst[i]->name, NULL, ACTION_SET_WINDOW_BORDER, lst[i]->name, NULL); mi =
CreateMenuItem(lst[i]->name, NULL, ACTION_SET_WINDOW_BORDER,
lst[i]->name, NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
} }
@ -1810,10 +1843,13 @@ CreateMenuFromAllEWins(char *name, MenuStyle * ms)
{ {
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if ((!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist) && (lst[i]->client.title) && (!lst[i]->ibox)) if ((!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist)
&& (lst[i]->client.title) && (!lst[i]->ibox))
{ {
Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win)); Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
mi = CreateMenuItem(lst[i]->client.title, NULL, ACTION_FOCUS_SET, s, NULL); mi =
CreateMenuItem(lst[i]->client.title, NULL,
ACTION_FOCUS_SET, s, NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
} }
@ -1843,10 +1879,13 @@ CreateMenuFromDesktopEWins(char *name, MenuStyle * ms, int desk)
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if (((lst[i]->desktop == desk) || (lst[i]->sticky)) && if (((lst[i]->desktop == desk) || (lst[i]->sticky)) &&
(!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist) && (lst[i]->client.title) && (!lst[i]->ibox)) (!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist)
&& (lst[i]->client.title) && (!lst[i]->ibox))
{ {
Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win)); Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
mi = CreateMenuItem(lst[i]->client.title, NULL, ACTION_FOCUS_SET, s, NULL); mi =
CreateMenuItem(lst[i]->client.title, NULL,
ACTION_FOCUS_SET, s, NULL);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
} }
@ -1877,20 +1916,25 @@ CreateMenuFromDesktops(char *name, MenuStyle * ms)
mm->name = duplicate("__SUBMENUDESK_E"); mm->name = duplicate("__SUBMENUDESK_E");
mm->style = ms; mm->style = ms;
Esnprintf(s, sizeof(s), "%i", j); Esnprintf(s, sizeof(s), "%i", j);
mi = CreateMenuItem("Go to this Desktop", NULL, ACTION_GOTO_DESK, s, NULL); mi =
CreateMenuItem(gettext("Go to this Desktop"), NULL, ACTION_GOTO_DESK,
s, NULL);
AddItemToMenu(mm, mi); AddItemToMenu(mm, mi);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
if (((lst[i]->desktop == j) || (lst[i]->sticky)) && if (((lst[i]->desktop == j) || (lst[i]->sticky)) &&
(!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist) && (lst[i]->client.title) && (!lst[i]->ibox)) (!lst[i]->menu) && (!lst[i]->pager) && (!lst[i]->skipwinlist)
&& (lst[i]->client.title) && (!lst[i]->ibox))
{ {
Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win)); Esnprintf(s, sizeof(s), "%i", (int)(lst[i]->client.win));
mi = CreateMenuItem(lst[i]->client.title, NULL, ACTION_FOCUS_SET, s, NULL); mi =
CreateMenuItem(lst[i]->client.title, NULL,
ACTION_FOCUS_SET, s, NULL);
AddItemToMenu(mm, mi); AddItemToMenu(mm, mi);
} }
} }
mm->parent = m; mm->parent = m;
Esnprintf(s, sizeof(s), "Desktop %i", j); Esnprintf(s, sizeof(s), gettext("Desktop %i"), j);
mi = CreateMenuItem(s, NULL, 0, NULL, mm); mi = CreateMenuItem(s, NULL, 0, NULL, mm);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }
@ -1952,19 +1996,25 @@ CreateMenuFromGroups(char *name, MenuStyle * ms)
mm->name = duplicate("__SUBMENUGROUP_E"); mm->name = duplicate("__SUBMENUGROUP_E");
mm->style = ms; mm->style = ms;
Esnprintf(s, sizeof(s), "%i", lst[i]->members[0]->client.win); Esnprintf(s, sizeof(s), "%i", lst[i]->members[0]->client.win);
mi = CreateMenuItem("Show/Hide this group", NULL, ACTION_SHOW_HIDE_GROUP, s, NULL); mi =
CreateMenuItem(gettext("Show/Hide this group"), NULL,
ACTION_SHOW_HIDE_GROUP, s, NULL);
AddItemToMenu(mm, mi); AddItemToMenu(mm, mi);
mi = CreateMenuItem("Iconify this group", NULL, ACTION_ICONIFY, s, NULL); mi =
CreateMenuItem(gettext("Iconify this group"), NULL,
ACTION_ICONIFY, s, NULL);
AddItemToMenu(mm, mi); AddItemToMenu(mm, mi);
for (j = 0; j < lst[i]->num_members; j++) for (j = 0; j < lst[i]->num_members; j++)
{ {
Esnprintf(s, sizeof(s), "%i", lst[i]->members[j]->client.win); Esnprintf(s, sizeof(s), "%i", lst[i]->members[j]->client.win);
mi = CreateMenuItem(lst[i]->members[j]->client.title, NULL, ACTION_FOCUS_SET, s, NULL); mi =
CreateMenuItem(lst[i]->members[j]->client.title, NULL,
ACTION_FOCUS_SET, s, NULL);
AddItemToMenu(mm, mi); AddItemToMenu(mm, mi);
} }
mm->parent = m; mm->parent = m;
Esnprintf(s, sizeof(s), "Group %i", i); Esnprintf(s, sizeof(s), gettext("Group %i"), i);
mi = CreateMenuItem(s, NULL, 0, NULL, mm); mi = CreateMenuItem(s, NULL, 0, NULL, mm);
AddItemToMenu(m, mi); AddItemToMenu(m, mi);
} }

View File

@ -37,50 +37,50 @@ BlumFlimFrub(void)
char s[1024]; char s[1024];
char *bins[3] = char *bins[3] =
#ifndef __EMX__ #ifndef __EMX__
{"dox", "eesh", "epp"}; { "dox", "eesh", "epp" };
#else #else
{"dox.exe", "eesh.exe", "epp.exe"}; { "dox.exe", "eesh.exe", "epp.exe" };
#endif #endif
char *docs[4] = char *docs[4] =
{"E-docs/MAIN", "E-docs/Edoc_bg.png", "E-docs/E_logo.png"}; { "E-docs/MAIN", "E-docs/Edoc_bg.png", "E-docs/E_logo.png" };
char *thms[1] = char *thms[1] = { "themes/DEFAULT/epplets/epplets.cfg" };
{"themes/DEFAULT/epplets/epplets.cfg"};
for (i = 0; i < 3; i++) for (i = 0; i < 3; i++)
{ {
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_BIN, bins[i]); Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_BIN, bins[i]);
#else #else
Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_BIN), bins[i]); Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_BIN),
bins[i]);
#endif #endif
if (!exists(s)) if (!exists(s))
{ {
Alert("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n" Alert(gettext("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n"
"\n" "\n"
"Enlightenment's utility executable cannot be found at:\n" "Enlightenment's utility executable cannot be found at:\n"
"\n" "\n"
"%s\n" "%s\n"
"This is a fatal error and Enlightenment will cease to run.\n" "This is a fatal error and Enlightenment will cease to run.\n"
"Please rectify this situation and ensure it is installed\n" "Please rectify this situation and ensure it is installed\n"
"correctly.\n" "correctly.\n"
"\n" "\n"
"The reason this could be missing is due to badly created\n" "The reason this could be missing is due to badly created\n"
"packages, someone manually deleting that program or perhaps\n" "packages, someone manually deleting that program or perhaps\n"
"an error in installing Enlightenment.\n", s); "an error in installing Enlightenment.\n"), s);
EExit(NULL); EExit(NULL);
} }
if (!canexec(s)) if (!canexec(s))
{ {
Alert("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n" Alert(gettext("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n"
"\n" "\n"
"Enlightenment's dox executable is not able to be executed:\n" "Enlightenment's dox executable is not able to be executed:\n"
"\n" "\n"
"%s\n" "%s\n"
"This is a fatal error and Enlightenment will cease to run.\n" "This is a fatal error and Enlightenment will cease to run.\n"
"Please rectify this situation and ensure dox is installed\n" "Please rectify this situation and ensure dox is installed\n"
"correctly.\n", s); "correctly.\n"), s);
EExit(NULL); EExit(NULL);
} }
Esnprintf(s, sizeof(s), "%s/dox", ENLIGHTENMENT_BIN); Esnprintf(s, sizeof(s), "%s/dox", ENLIGHTENMENT_BIN);
@ -90,21 +90,22 @@ BlumFlimFrub(void)
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_ROOT, docs[i]); Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_ROOT, docs[i]);
#else #else
Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), docs[i]); Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT),
docs[i]);
#endif #endif
if (!exists(s)) if (!exists(s))
{ {
Alert("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n" Alert(gettext("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n"
"\n" "\n"
"Enlightenment's documentation is not present or correctly installed\n" "Enlightenment's documentation is not present or correctly installed\n"
"\n" "\n"
"This is a fatal error and Enlightenment will cease to run.\n" "This is a fatal error and Enlightenment will cease to run.\n"
"Please rectify this situation and ensure it is installed\n" "Please rectify this situation and ensure it is installed\n"
"correctly.\n" "correctly.\n"
"\n" "\n"
"The reason this could be missing is due to badly created\n" "The reason this could be missing is due to badly created\n"
"packages, someone manually deleting those files or perhaps\n" "packages, someone manually deleting those files or perhaps\n"
"an error in installing Enlightenment.\n"); "an error in installing Enlightenment.\n"));
EExit(NULL); EExit(NULL);
} }
} }
@ -113,20 +114,21 @@ BlumFlimFrub(void)
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_ROOT, thms[i]); Esnprintf(s, sizeof(s), "%s/%s", ENLIGHTENMENT_ROOT, thms[i]);
#else #else
Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), thms[i]); Esnprintf(s, sizeof(s), "%s/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT),
thms[i]);
#endif #endif
if (!exists(s)) if (!exists(s))
{ {
Alert("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n" Alert(gettext("!!!!!!!! ERROR ERROR ERROR ERROR !!!!!!!!\n"
"\n" "\n"
"Enlightenment's DEFAULT installed theme is missing or inadequately\n" "Enlightenment's DEFAULT installed theme is missing or inadequately\n"
"configured to be a useful DEFAULT theme.\n" "configured to be a useful DEFAULT theme.\n"
"\n" "\n"
"This is a fatal error and Enlightenment will cease to run.\n" "This is a fatal error and Enlightenment will cease to run.\n"
"Please rectify this situation and ensure it is installed\n" "Please rectify this situation and ensure it is installed\n"
"correctly. The DEFAULT theme Enlightenment comes with normally\n" "correctly. The DEFAULT theme Enlightenment comes with normally\n"
"is BrushedMetal-Tigert and this theme is adequate for a DEFAULT\n" "is BrushedMetal-Tigert and this theme is adequate for a DEFAULT\n"
"theme.\n"); "theme.\n"));
EExit(NULL); EExit(NULL);
} }
} }
@ -417,93 +419,95 @@ SanitiseThemeDir(char *dir)
Esnprintf(s, sizeof(s), "%s/%s", dir, "borders.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "borders.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a borders.cfg file\n"; badreason = gettext("Theme does not contain a borders.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "buttons.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "buttons.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a buttons.cfg file\n"; badreason = gettext("Theme does not contain a buttons.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "colormodifiers.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "colormodifiers.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a colormodifiers.cfg file\n"; badreason =
gettext("Theme does not contain a colormodifiers.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "cursors.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "cursors.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a cursors.cfg file\n"; badreason = gettext("Theme does not contain a cursors.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "desktops.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "desktops.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a desktops.cfg file\n"; badreason = gettext("Theme does not contain a desktops.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "imageclasses.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "imageclasses.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a imageclasses.cfg file\n"; badreason = gettext("Theme does not contain a imageclasses.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "init.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "init.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a init.cfg file\n"; badreason = gettext("Theme does not contain a init.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "menustyles.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "menustyles.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a menustyles.cfg file\n"; badreason = gettext("Theme does not contain a menustyles.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "slideouts.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "slideouts.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a slideouts.cfg file\n"; badreason = gettext("Theme does not contain a slideouts.cfg file\n");
return 0; return 0;
} }
#ifndef __EMX__ /* OS/2 Team will compile ESound after XMMS project */ #ifndef __EMX__ /* OS/2 Team will compile ESound after XMMS project */
Esnprintf(s, sizeof(s), "%s/%s", dir, "sound.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "sound.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a sound.cfg file\n"; badreason = gettext("Theme does not contain a sound.cfg file\n");
return 0; return 0;
} }
#endif #endif
Esnprintf(s, sizeof(s), "%s/%s", dir, "tooltips.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "tooltips.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a tooltips.cfg file\n"; badreason = gettext("Theme does not contain a tooltips.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "windowmatches.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "windowmatches.cfg");
if (!isfile(s)) if (!isfile(s))
{ {
badreason = "Theme does not contain a windowmatches.cfg file\n"; badreason =
gettext("Theme does not contain a windowmatches.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "menus.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "menus.cfg");
if (isfile(s)) if (isfile(s))
{ {
badreason = "Theme contains a menus.cfg file\n"; badreason = gettext("Theme contains a menus.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "control.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "control.cfg");
if (isfile(s)) if (isfile(s))
{ {
badreason = "Theme contains a control.cfg file\n"; badreason = gettext("Theme contains a control.cfg file\n");
return 0; return 0;
} }
Esnprintf(s, sizeof(s), "%s/%s", dir, "keybindings.cfg"); Esnprintf(s, sizeof(s), "%s/%s", dir, "keybindings.cfg");
if (isfile(s)) if (isfile(s))
{ {
badreason = "Theme contains a keybindings.cfg file\n"; badreason = gettext("Theme contains a keybindings.cfg file\n");
return 0; return 0;
} }
return 1; return 1;

View File

@ -35,12 +35,12 @@
/* This is the Modules List that we maintain */ /* This is the Modules List that we maintain */
typedef struct _ModuleMember typedef struct _ModuleMember
{ {
char *ModuleName; char *ModuleName;
void *handle; void *handle;
} }
ModuleMember; ModuleMember;
int ListLength = 0; int ListLength = 0;
@ -135,15 +135,15 @@ ModuleErrorCodeToString(int error_code)
{ {
case MODULE_ALREADY_LOADED: case MODULE_ALREADY_LOADED:
return ("Module is Already Loaded.\n"); return (gettext("Module is Already Loaded.\n"));
case MODULE_LOAD_FAIL: case MODULE_LOAD_FAIL:
return ("Module Failed During Load.\n"); return (gettext("Module Failed During Load.\n"));
case MODULE_UNLOAD_FAIL: case MODULE_UNLOAD_FAIL:
return ("Module Unload Failed.\n"); return (gettext("Module Unload Failed.\n"));
case MODULE_NOT_LOADED: case MODULE_NOT_LOADED:
return ("Module is not Loaded.\n"); return (gettext("Module is not Loaded.\n"));
default: default:
return ("Unknown Module Error.\n"); return (gettext("Unknown Module Error.\n"));
} }

View File

@ -55,13 +55,13 @@
/* Motif window hints */ /* Motif window hints */
typedef struct _mwmhints typedef struct _mwmhints
{ {
CARD32 flags; CARD32 flags;
CARD32 functions; CARD32 functions;
CARD32 decorations; CARD32 decorations;
INT32 inputMode; INT32 inputMode;
CARD32 status; CARD32 status;
} }
MWMHints; MWMHints;
void void
@ -172,10 +172,10 @@ MWM_SetInfo()
{ {
Atom a1; Atom a1;
struct _mwminfo struct _mwminfo
{ {
long flags; long flags;
Window win; Window win;
} }
mwminfo; mwminfo;
EDBUG(6, "MWM_SetInfo"); EDBUG(6, "MWM_SetInfo");

View File

@ -30,11 +30,11 @@
*/ */
typedef struct conn_data_tag typedef struct conn_data_tag
{ {
int read_sock; int read_sock;
int write_sock; int write_sock;
ghttp_request *req; ghttp_request *req;
} }
conn_data; conn_data;
#endif #endif
@ -126,8 +126,7 @@ GetNetText(char *URL)
} }
time_t time_t GetNetFileDate(char *URL)
GetNetFileDate(char *URL)
{ {
#ifdef AUTOUPGRADE #ifdef AUTOUPGRADE

View File

@ -28,7 +28,8 @@ static void PagerUpdateTimeout(int val, void *data);
#define SNAP mode.pager_snap #define SNAP mode.pager_snap
void void
PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy, int sh) PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy,
int sh)
{ {
static GC gc = 0; static GC gc = 0;
XGCValues gcv; XGCValues gcv;
@ -79,13 +80,17 @@ PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy,
if (!px_grab) if (!px_grab)
return; return;
if (HIQ) if (HIQ)
px_grab2 = XGetImage(disp, src, 0, sy + (sh / 2), sw, 1, 0xffffffff, ZPixmap); px_grab2 =
XGetImage(disp, src, 0, sy + (sh / 2), sw, 1, 0xffffffff,
ZPixmap);
if (!px_grab2) if (!px_grab2)
{ {
XDestroyImage(px_grab); XDestroyImage(px_grab);
return; return;
} }
px_buf = XCreateImage(disp, root.vis, root.depth, ZPixmap, 0, NULL, pw, 1, 32, 0); px_buf =
XCreateImage(disp, root.vis, root.depth, ZPixmap, 0, NULL, pw, 1, 32,
0);
if (!px_buf) if (!px_buf)
{ {
XDestroyImage(px_grab); XDestroyImage(px_grab);
@ -208,7 +213,8 @@ PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy,
} }
void void
PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw, int sh, int dw, int dh) PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
int sh, int dw, int dh)
{ {
static GC gc = 0, gc2 = 0; static GC gc = 0, gc2 = 0;
XGCValues gcv; XGCValues gcv;
@ -244,7 +250,8 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
for (y = 0; y < (dh * 2); y++) for (y = 0; y < (dh * 2); y++)
{ {
y2 = (sh * y) / (dh * 2); y2 = (sh * y) / (dh * 2);
XCopyArea(disp, src, p_grab->pmap, gc, sx, sy + y2, sw, 1, 0, y); XCopyArea(disp, src, p_grab->pmap, gc, sx, sy + y2, sw,
1, 0, y);
} }
} }
else else
@ -252,7 +259,8 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
for (y = 0; y < dh; y++) for (y = 0; y < dh; y++)
{ {
y2 = (sh * y) / dh; y2 = (sh * y) / dh;
XCopyArea(disp, src, p_grab->pmap, gc, sx, sy + y2, sw, 1, 0, y); XCopyArea(disp, src, p_grab->pmap, gc, sx, sy + y2, sw,
1, 0, y);
} }
} }
XSync(disp, False); XSync(disp, False);
@ -275,7 +283,8 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
y2 = (sh * y) / (dh * 2); y2 = (sh * y) / (dh * 2);
XCopyArea(disp, src, pmap, gc, sx, sy + y2, sw, 1, 0, y); XCopyArea(disp, src, pmap, gc, sx, sy + y2, sw, 1, 0, y);
} }
px_grab = XGetImage(disp, pmap, 0, 0, sw, dh * 2, 0xffffffff, ZPixmap); px_grab =
XGetImage(disp, pmap, 0, 0, sw, dh * 2, 0xffffffff, ZPixmap);
EFreePixmap(disp, pmap); EFreePixmap(disp, pmap);
if (!px_grab) if (!px_grab)
return; return;
@ -295,7 +304,9 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
if (!px_grab) if (!px_grab)
return; return;
} }
px_buf = XCreateImage(disp, root.vis, root.depth, ZPixmap, 0, NULL, dw, dh, 32, 0); px_buf =
XCreateImage(disp, root.vis, root.depth, ZPixmap, 0, NULL, dw, dh,
32, 0);
if (!px_buf) if (!px_buf)
{ {
XDestroyImage(px_grab); XDestroyImage(px_grab);
@ -339,7 +350,8 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
v2 = XGetPixel(xim1, x2 + difx, y2); v2 = XGetPixel(xim1, x2 + difx, y2);
v3 = XGetPixel(xim1, x2, y2 + 1); v3 = XGetPixel(xim1, x2, y2 + 1);
v4 = XGetPixel(xim1, x2 + difx, y2 + 1); v4 = XGetPixel(xim1, x2 + difx, y2 + 1);
v1 = ((v1 >> 2) & 0x3f3f3f3f) + ((v2 >> 2) & 0x3f3f3f3f) + v1 =
((v1 >> 2) & 0x3f3f3f3f) + ((v2 >> 2) & 0x3f3f3f3f) +
((v3 >> 2) & 0x3f3f3f3f) + ((v4 >> 2) & 0x3f3f3f3f) + ((v3 >> 2) & 0x3f3f3f3f) + ((v4 >> 2) & 0x3f3f3f3f) +
(v1 & v2 & v3 & v4 & 0x03030303); (v1 & v2 & v3 & v4 & 0x03030303);
XPutPixel(xim3, x, y, v1); XPutPixel(xim3, x, y, v1);
@ -358,11 +370,16 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
v3 = XGetPixel(xim1, x2, y2 + 1); v3 = XGetPixel(xim1, x2, y2 + 1);
v4 = XGetPixel(xim1, x2 + difx, y2 + 1); v4 = XGetPixel(xim1, x2 + difx, y2 + 1);
v1 = v1 =
((v1 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) + ((v1 >> 2) &
((v2 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) + ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((v3 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) + ((v2 >> 2) &
((v4 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) + ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
(v1 & v2 & v3 & v4 & ((0x3 << 11) | (0x3 << 5) | (0x3))); ((v3 >> 2) &
((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((v4 >> 2) &
((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
(v1 & v2 & v3 & v4 &
((0x3 << 11) | (0x3 << 5) | (0x3)));
XPutPixel(xim3, x, y, v1); XPutPixel(xim3, x, y, v1);
} }
} }
@ -433,8 +450,7 @@ PagerUpdateTimeout(int val, void *data)
double cur_time, in; double cur_time, in;
static int calls = 0; static int calls = 0;
int y, y2, phase, ax, ay, cx, cy, ww, hh, xx, yy; int y, y2, phase, ax, ay, cx, cy, ww, hh, xx, yy;
static int offsets[8] = static int offsets[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
{0, 4, 2, 6, 1, 5, 3, 7};
p = (Pager *) data; p = (Pager *) data;
Esnprintf(s, sizeof(s), "__.%x", p->win); Esnprintf(s, sizeof(s), "__.%x", p->win);
@ -508,50 +524,49 @@ CreatePager(void)
{ {
SettingsPager(); SettingsPager();
DIALOG_OK DIALOG_OK
("Warning!", (gettext("Warning!"),
"\n" gettext("\n"
"You seem to have an X Server capable of Shared Memory\n" "You seem to have an X Server capable of Shared Memory\n"
"but it is incapable of doing ZPixmap Shared pixmaps\n" "but it is incapable of doing ZPixmap Shared pixmaps\n"
"(The server does not claim to be able to do them).\n" "(The server does not claim to be able to do them).\n"
"\n" "\n"
"The pager in enlightenment will run slowly in snapshot\n" "The pager in enlightenment will run slowly in snapshot\n"
"mode if you continue to use that mode of the pager\n" "mode if you continue to use that mode of the pager\n"
"under these conditions.\n" "under these conditions.\n"
"\n" "\n"
"It is suggested you change the settings on your pager to\n" "It is suggested you change the settings on your pager to\n"
"disable snapshots to improve performance.\n" "disable snapshots to improve performance.\n"
"\n"); "\n"));
} }
else else
DIALOG_OK DIALOG_OK
("Warning!", (gettext("Warning!"),
"\n" gettext("\n"
"Your X Server is capable of doing Shared Memory but you do\n" "Your X Server is capable of doing Shared Memory but you do\n"
"not have Shared Pixmaps enabled in your Imlib configuration.\n" "not have Shared Pixmaps enabled in your Imlib configuration.\n"
"\n" "\n"
"Please enable Shared Pixmaps in your Imlib configuration\n" "Please enable Shared Pixmaps in your Imlib configuration\n"
"then restart enlightenment to gain better performance for\n" "then restart enlightenment to gain better performance for\n"
"the pagers when snapshot mode is enabled.\n" "the pagers when snapshot mode is enabled.\n"
"\n"); "\n"));
} }
} }
else else
{ {
SettingsPager(); SettingsPager();
DIALOG_OK DIALOG_OK
("Warning!", (gettext("Warning!"),
"\n" gettext("\n"
"You seem to be running Enlightenment over a network Connection\n" "You seem to be running Enlightenment over a network Connection\n"
"or on an X Server that does not support Shared Memory, or you\n" "or on an X Server that does not support Shared Memory, or you\n"
"have disabled MIT-SHM Shared memory in your Imlib configuration.\n" "have disabled MIT-SHM Shared memory in your Imlib configuration.\n"
"This means the Enlightenment Pager will perform slowly and use\n" "This means the Enlightenment Pager will perform slowly and use\n"
"more system resources than it would when Shared Memory is\n" "more system resources than it would when Shared Memory is\n"
"available.\n" "available.\n"
"\n" "\n"
"To improve performance please either enable MIT-SHM Shared Memory\n" "To improve performance please either enable MIT-SHM Shared Memory\n"
"in your Imlib config, if you disabled it, or disable Pager\n" "in your Imlib config, if you disabled it, or disable Pager\n"
"snapshots.\n" "snapshots.\n" "\n"));
"\n");
} }
did_dialog = 1; did_dialog = 1;
} }
@ -720,7 +735,8 @@ PagerShow(Pager * p)
{ {
Esnprintf(s, sizeof(s), "__.%x", p->win); Esnprintf(s, sizeof(s), "__.%x", p->win);
if (mode.pager_scanspeed > 0) if (mode.pager_scanspeed > 0)
DoIn(s, 1 / ((double)mode.pager_scanspeed), PagerUpdateTimeout, 0, p); DoIn(s, 1 / ((double)mode.pager_scanspeed), PagerUpdateTimeout,
0, p);
} }
queue_up = pq; queue_up = pq;
AddItem(p, "PAGER", p->win, LIST_TYPE_PAGER); AddItem(p, "PAGER", p->win, LIST_TYPE_PAGER);
@ -1031,8 +1047,8 @@ PagerRedraw(Pager * p, char newbg)
for (y = 0; y < ay; y++) for (y = 0; y < ay; y++)
{ {
for (x = 0; x < ax; x++) for (x = 0; x < ax; x++)
XCopyArea(disp, p->bgpmap, p->pmap, gc, 0, 0, p->w / ax, p->h / ay, XCopyArea(disp, p->bgpmap, p->pmap, gc, 0, 0, p->w / ax,
x * (p->w / ax), y * (p->h / ay)); p->h / ay, x * (p->w / ax), y * (p->h / ay));
} }
for (i = desks.desk[p->desktop].num - 1; i >= 0; i--) for (i = desks.desk[p->desktop].num - 1; i >= 0; i--)
{ {
@ -1054,14 +1070,16 @@ PagerRedraw(Pager * p, char newbg)
XSetClipMask(disp, gc, ewin->mini_mask); XSetClipMask(disp, gc, ewin->mini_mask);
XSetClipOrigin(disp, gc, wx, wy); XSetClipOrigin(disp, gc, wx, wy);
} }
XCopyArea(disp, ewin->mini_pmap, p->pmap, gc, 0, 0, ww, wh, wx, wy); XCopyArea(disp, ewin->mini_pmap, p->pmap, gc, 0, 0, ww,
wh, wx, wy);
if (ewin->mini_mask) if (ewin->mini_mask)
XSetClipMask(disp, gc, None); XSetClipMask(disp, gc, None);
} }
else else
{ {
XSetForeground(disp, gc, c1); XSetForeground(disp, gc, c1);
XDrawRectangle(disp, p->pmap, gc, wx - 1, wy - 1, ww + 1, wh + 1); XDrawRectangle(disp, p->pmap, gc, wx - 1, wy - 1, ww + 1,
wh + 1);
XSetForeground(disp, gc, c2); XSetForeground(disp, gc, c2);
XFillRectangle(disp, p->pmap, gc, wx, wy, ww, wh); XFillRectangle(disp, p->pmap, gc, wx, wy, ww, wh);
} }
@ -1152,11 +1170,12 @@ PagerReArea(void)
aspect = ((double)root.w) / ((double)root.h); aspect = ((double)root.w) / ((double)root.h);
pl[i]->ewin->client.w_inc = ax * 4; pl[i]->ewin->client.w_inc = ax * 4;
pl[i]->ewin->client.h_inc = ay * 8; pl[i]->ewin->client.h_inc = ay * 8;
pl[i]->ewin->client.aspect_min = aspect * ((double)ax / (double)ay); pl[i]->ewin->client.aspect_min =
pl[i]->ewin->client.aspect_max = aspect * ((double)ax / (double)ay); aspect * ((double)ax / (double)ay);
MoveResizeEwin(pl[i]->ewin, pl[i]->ewin->client.aspect_max =
pl[i]->ewin->x, pl[i]->ewin->y, aspect * ((double)ax / (double)ay);
w, h); MoveResizeEwin(pl[i]->ewin, pl[i]->ewin->x, pl[i]->ewin->y, w,
h);
} }
} }
Efree(pl); Efree(pl);
@ -1246,21 +1265,26 @@ PagerShowMenu(Pager * p, int x, int y)
if (pw_menu) if (pw_menu)
DestroyMenu(pw_menu); DestroyMenu(pw_menu);
pw_menu = CreateMenu(); pw_menu = CreateMenu();
AddTitleToMenu(pw_menu, "Window Options"); AddTitleToMenu(pw_menu, gettext("Window Options"));
pw_menu->name = duplicate("__DESK_WIN_MENU"); pw_menu->name = duplicate("__DESK_WIN_MENU");
pw_menu->style = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); pw_menu->style =
FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE);
Esnprintf(s, sizeof(s), "%i", ewin->client.win); Esnprintf(s, sizeof(s), "%i", ewin->client.win);
mi = CreateMenuItem("Iconify", NULL, ACTION_ICONIFY, s, NULL); mi = CreateMenuItem(gettext("Iconify"), NULL, ACTION_ICONIFY, s, NULL);
AddItemToMenu(pw_menu, mi); AddItemToMenu(pw_menu, mi);
mi = CreateMenuItem("Close", NULL, ACTION_KILL, s, NULL); mi = CreateMenuItem(gettext("Close"), NULL, ACTION_KILL, s, NULL);
AddItemToMenu(pw_menu, mi); AddItemToMenu(pw_menu, mi);
mi = CreateMenuItem("Annihilate", NULL, ACTION_KILL_NASTY, s, NULL); mi =
CreateMenuItem(gettext("Annihilate"), NULL, ACTION_KILL_NASTY, s,
NULL);
AddItemToMenu(pw_menu, mi); AddItemToMenu(pw_menu, mi);
mi = CreateMenuItem("Stick / Unstick", NULL, ACTION_STICK, s, NULL); mi =
CreateMenuItem(gettext("Stick / Unstick"), NULL, ACTION_STICK, s,
NULL);
AddItemToMenu(pw_menu, mi); AddItemToMenu(pw_menu, mi);
AddItem(pw_menu, pw_menu->name, 0, LIST_TYPE_MENU); AddItem(pw_menu, pw_menu->name, 0, LIST_TYPE_MENU);
@ -1272,25 +1296,36 @@ PagerShowMenu(Pager * p, int x, int y)
if (p_menu) if (p_menu)
DestroyMenu(p_menu); DestroyMenu(p_menu);
p_menu = CreateMenu(); p_menu = CreateMenu();
AddTitleToMenu(p_menu, "Desktop Options"); AddTitleToMenu(p_menu, gettext("Desktop Options"));
p_menu->name = duplicate("__DESK_MENU"); p_menu->name = duplicate("__DESK_MENU");
p_menu->style = FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE); p_menu->style =
FindItem("DEFAULT", 0, LIST_FINDBY_NAME, LIST_TYPE_MENU_STYLE);
mi = CreateMenuItem("Pager Settings...", NULL, ACTION_CONFIG, "pager", NULL); mi =
CreateMenuItem(gettext("Pager Settings..."), NULL, ACTION_CONFIG, "pager",
NULL);
AddItemToMenu(p_menu, mi); AddItemToMenu(p_menu, mi);
mi = CreateMenuItem("Snapshotting On", NULL, ACTION_SET_PAGER_SNAP, "1", NULL); mi =
CreateMenuItem(gettext("Snapshotting On"), NULL, ACTION_SET_PAGER_SNAP,
"1", NULL);
AddItemToMenu(p_menu, mi); AddItemToMenu(p_menu, mi);
mi = CreateMenuItem("Snapshotting Off", NULL, ACTION_SET_PAGER_SNAP, "0", NULL); mi =
CreateMenuItem(gettext("Snapshotting Off"), NULL, ACTION_SET_PAGER_SNAP,
"0", NULL);
AddItemToMenu(p_menu, mi); AddItemToMenu(p_menu, mi);
if (SNAP) if (SNAP)
{ {
mi = CreateMenuItem("High Quality On", NULL, ACTION_SET_PAGER_HIQ, "1", NULL); mi =
CreateMenuItem(gettext("High Quality On"), NULL,
ACTION_SET_PAGER_HIQ, "1", NULL);
AddItemToMenu(p_menu, mi); AddItemToMenu(p_menu, mi);
mi = CreateMenuItem("High Quality Off", NULL, ACTION_SET_PAGER_HIQ, "0", NULL); mi =
CreateMenuItem(gettext("High Quality Off"), NULL,
ACTION_SET_PAGER_HIQ, "0", NULL);
AddItemToMenu(p_menu, mi); AddItemToMenu(p_menu, mi);
} }
AddItem(p_menu, p_menu->name, 0, LIST_TYPE_MENU); AddItem(p_menu, p_menu->name, 0, LIST_TYPE_MENU);
@ -1343,9 +1378,12 @@ UpdatePagerSel(void)
cy = desks.desk[p->desktop].current_area_y; cy = desks.desk[p->desktop].current_area_y;
EMoveWindow(disp, p->sel_win, cx * p->dw, cy * p->dh); EMoveWindow(disp, p->sel_win, cx * p->dw, cy * p->dh);
EMapWindow(disp, p->sel_win); EMapWindow(disp, p->sel_win);
ic = FindItem("PAGER_SEL", 0, LIST_FINDBY_NAME, LIST_TYPE_ICLASS); ic =
FindItem("PAGER_SEL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
IclassApply(ic, p->sel_win, p->dw, p->dh, 0, 0, STATE_NORMAL, 0); IclassApply(ic, p->sel_win, p->dw, p->dh, 0, 0,
STATE_NORMAL, 0);
} }
} }
Efree(pl); Efree(pl);
@ -1379,8 +1417,7 @@ PagerHideHi(Pager * p)
p->hi_visible = 0; p->hi_visible = 0;
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
LIST_TYPE_TOOLTIP);
if (tt) if (tt)
HideToolTip(tt); HideToolTip(tt);
} }
@ -1423,7 +1460,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
Imlib_kill_image(id, im); Imlib_kill_image(id, im);
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
@ -1452,7 +1490,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
Imlib_kill_image(id, im); Imlib_kill_image(id, im);
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
@ -1481,14 +1520,16 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
hh = (i * h) / w; hh = (i * h) / w;
xx = x + ((w - ww) / 2); xx = x + ((w - ww) / 2);
yy = y + ((h - hh) / 2); yy = y + ((h - hh) / 2);
IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0); IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL,
0);
EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh); EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
XClearWindow(disp, p->hi_win); XClearWindow(disp, p->hi_win);
{ {
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
return; return;
@ -1504,14 +1545,16 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
hh = i; hh = i;
xx = x + ((w - ww) / 2); xx = x + ((w - ww) / 2);
yy = y + ((h - hh) / 2); yy = y + ((h - hh) / 2);
IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL, 0); IclassApply(ic, p->hi_win, ww, hh, 0, 0, STATE_NORMAL,
0);
EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh); EMoveResizeWindow(disp, p->hi_win, xx, yy, ww, hh);
XClearWindow(disp, p->hi_win); XClearWindow(disp, p->hi_win);
{ {
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
return; return;
@ -1561,7 +1604,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
EFreePixmap(disp, pmap); EFreePixmap(disp, pmap);
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
@ -1588,7 +1632,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int px, py; int px, py;
PointerAt(&px, &py); PointerAt(&px, &py);
if ((px < x) || (py < y) || (px >= (x + w)) || (py >= (y + h))) if ((px < x) || (py < y) || (px >= (x + w))
|| (py >= (y + h)))
{ {
EFreePixmap(disp, pmap); EFreePixmap(disp, pmap);
EUnmapWindow(disp, p->hi_win); EUnmapWindow(disp, p->hi_win);
@ -1607,8 +1652,7 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
{ {
ToolTip *tt = NULL; ToolTip *tt = NULL;
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
LIST_TYPE_TOOLTIP);
if (tt) if (tt)
{ {
ShowToolTip(tt, ewin->client.title, NULL, mode.x, mode.y); ShowToolTip(tt, ewin->client.title, NULL, mode.x, mode.y);
@ -1826,7 +1870,8 @@ PagerSetSnap(char onoff)
{ {
Esnprintf(s, sizeof(s), "__.%x", pl[i]->win); Esnprintf(s, sizeof(s), "__.%x", pl[i]->win);
if (mode.pager_scanspeed > 0) if (mode.pager_scanspeed > 0)
DoIn(s, 1 / ((double)mode.pager_scanspeed), PagerUpdateTimeout, 0, pl[i]); DoIn(s, 1 / ((double)mode.pager_scanspeed),
PagerUpdateTimeout, 0, pl[i]);
} }
} }
Efree(pl); Efree(pl);

View File

@ -124,7 +124,8 @@ ShowProgressbar(Progressbar * p)
EMapRaised(disp, p->n_win); EMapRaised(disp, p->n_win);
EMapRaised(disp, p->p_win); EMapRaised(disp, p->p_win);
XSync(disp, False); XSync(disp, False);
TclassApply(p->ic, p->win, p->w - (p->h * 5), p->h, 0, 0, STATE_NORMAL, 0, p->tc, p->name); TclassApply(p->ic, p->win, p->w - (p->h * 5), p->h, 0, 0, STATE_NORMAL, 0,
p->tc, p->name);
queue_up = pq; queue_up = pq;
EDBUG_RETURN_; EDBUG_RETURN_;
} }

View File

@ -37,8 +37,7 @@ static Window sc_window = 0;
static Atom sc_atom = 0; static Atom sc_atom = 0;
static ImlibData *imd = NULL; static ImlibData *imd = NULL;
Window Window SC_GetDestWin(void)
SC_GetDestWin(void)
{ {
return 0; return 0;
} }
@ -61,9 +60,7 @@ SC_Main(void)
if (XCheckWindowEvent(sc_disp, sc_window, if (XCheckWindowEvent(sc_disp, sc_window,
PropertyChangeMask | PropertyChangeMask |
PointerMotionMask | PointerMotionMask |
ButtonPressMask | ButtonPressMask | ButtonReleaseMask, &ev))
ButtonReleaseMask
,&ev))
{ {
switch (ev.type) switch (ev.type)
{ {
@ -94,7 +91,8 @@ SC_Main(void)
if (!a_wait) if (!a_wait)
a_wait = XInternAtom(sc_disp, "ENL_SC_WAIT", False); a_wait = XInternAtom(sc_disp, "ENL_SC_WAIT", False);
if (!a_hotspot) if (!a_hotspot)
a_hotspot = XInternAtom(sc_disp, "ENL_SC_HOTSPOT", False); a_hotspot =
XInternAtom(sc_disp, "ENL_SC_HOTSPOT", False);
if (ev.xproperty.atom == a_wait) if (ev.xproperty.atom == a_wait)
{ {
retval = NULL; retval = NULL;
@ -158,7 +156,8 @@ SC_Main(void)
ESetWindowBackgroundPixmap(sc_disp, sc_window, pmap); ESetWindowBackgroundPixmap(sc_disp, sc_window, pmap);
Imlib_free_pixmap(imd, pmap); Imlib_free_pixmap(imd, pmap);
XClearWindow(sc_disp, sc_window); XClearWindow(sc_disp, sc_window);
EResizeWindow(sc_disp, sc_window, im->rgb_width, im->rgb_height); EResizeWindow(sc_disp, sc_window, im->rgb_width,
im->rgb_height);
Imlib_destroy_image(imd, im); Imlib_destroy_image(imd, im);
} }
} }
@ -240,8 +239,8 @@ SC_Init(void)
{ {
int test_event_base, test_error_base, test_v1, test_v2; int test_event_base, test_error_base, test_v1, test_v2;
if (XTestQueryExtension(sc_disp, &test_event_base, &test_error_base, & if (XTestQueryExtension
test_v1, &test_v2)) (sc_disp, &test_event_base, &test_error_base, &test_v1, &test_v2))
XTestGrabControl(sc_disp, True); XTestGrabControl(sc_disp, True);
} }
#endif #endif
@ -259,10 +258,7 @@ SC_Init(void)
CWBackPixel | CWBorderPixel, &attr); CWBackPixel | CWBorderPixel, &attr);
XSelectInput(sc_disp, sc_window, XSelectInput(sc_disp, sc_window,
PropertyChangeMask | PropertyChangeMask |
PointerMotionMask | PointerMotionMask | ButtonPressMask | ButtonReleaseMask);
ButtonPressMask |
ButtonReleaseMask
);
sc_atom = XInternAtom(disp, "ENLIGHTENMENT_SOFT_CURSOR", False); sc_atom = XInternAtom(disp, "ENLIGHTENMENT_SOFT_CURSOR", False);
val = sc_window; val = sc_window;
XChangeProperty(sc_disp, root.win, sc_atom, XA_CARDINAL, 32, XChangeProperty(sc_disp, root.win, sc_atom, XA_CARDINAL, 32,
@ -282,9 +278,8 @@ SC_Init(void)
XGrabPointer(sc_disp, sc_window, True, XGrabPointer(sc_disp, sc_window, True,
ButtonPressMask | ButtonReleaseMask | ButtonPressMask | ButtonReleaseMask |
PointerMotionMask | ButtonMotionMask PointerMotionMask | ButtonMotionMask, GrabModeAsync,
,GrabModeAsync, GrabModeAsync, None, cs, GrabModeAsync, None, cs, CurrentTime);
CurrentTime);
XUngrabServer(sc_disp); XUngrabServer(sc_disp);
SC_Main(); SC_Main();
exit(0); exit(0);

View File

@ -47,10 +47,10 @@ Emkstemp(char *template)
{ {
static const char letters[] static const char letters[]
#ifndef __EMX__ #ifndef __EMX__
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
#else #else
= "abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>Ž“”•˜™0123456789"; = "abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>Ž“”•˜™0123456789";
#endif #endif
@ -140,16 +140,15 @@ static char *userthemepath;
/* The saved window details */ /* The saved window details */
static int num_match = 0; static int num_match = 0;
typedef struct _match typedef struct _match
{ {
char *session_id; char *session_id;
char *name; char *name;
char *class; char *class;
char *role; char *role;
char *command; char *command;
char used; char used;
int x, y, w, h, desktop, iconified, shaded, sticky, int x, y, w, h, desktop, iconified, shaded, sticky, layer;
layer; }
}
Match; Match;
Match *matches = NULL; Match *matches = NULL;
@ -214,8 +213,12 @@ SaveWindowStates(void)
y = 0; y = 0;
if (!ewin->sticky) if (!ewin->sticky)
{ {
x = desks.desk[ewin->desktop].current_area_x * root.w; x =
y = desks.desk[ewin->desktop].current_area_y * root.h; desks.desk[ewin->desktop].current_area_x *
root.w;
y =
desks.desk[ewin->desktop].current_area_y *
root.h;
} }
fprintf(f, "[CLIENT] %i %i %i %i %i %i %i %i %i\n", fprintf(f, "[CLIENT] %i %i %i %i %i %i %i %i %i\n",
ewin->x + x, ewin->y + y, ewin->x + x, ewin->y + y,
@ -239,13 +242,12 @@ SaveWindowStates(void)
rm(ss); rm(ss);
mv(s, ss); mv(s, ss);
if (!isfile(ss)) if (!isfile(ss))
Alert("There was an error writing the clients " Alert(gettext("There was an error writing the clients "
"session save file.\n" "session save file.\n"
"You may have run out of disk " "You may have run out of disk "
"space, not have permission\n" "space, not have permission\n"
"to write to your filing system " "to write to your filing system "
"or other similar problems.\n" "or other similar problems.\n"));
);
} }
Efree(lst); Efree(lst);
} }
@ -288,8 +290,7 @@ LoadWindowStates(void)
&(matches[num_match - 1].iconified), &(matches[num_match - 1].iconified),
&(matches[num_match - 1].shaded), &(matches[num_match - 1].shaded),
&(matches[num_match - 1].sticky), &(matches[num_match - 1].sticky),
&(matches[num_match - 1].layer) &(matches[num_match - 1].layer));
);
} }
else if (!strcmp(s1, "[SESSION_ID]")) else if (!strcmp(s1, "[SESSION_ID]"))
{ {
@ -432,9 +433,9 @@ autosave(void)
rm(GetGenericSMFile()); rm(GetGenericSMFile());
mv(s, GetGenericSMFile()); mv(s, GetGenericSMFile());
if (!isfile(GetGenericSMFile())) if (!isfile(GetGenericSMFile()))
Alert("There was an error saving your autosave data - filing\n" Alert(gettext
"system problems.\n" ("There was an error saving your autosave data - filing\n"
); "system problems.\n"));
/* /*
* if (strcmp(GetSMFile(), GetGenericSMFile())) * if (strcmp(GetSMFile(), GetGenericSMFile()))
* { * {
@ -557,7 +558,7 @@ doSMExit(void *params)
if (themepath[0] != 0) if (themepath[0] != 0)
{ {
Esnprintf(sss, sizeof(sss), Esnprintf(sss, sizeof(sss),
"exec %s -single -ext_init_win %i -theme %s -display %s", "exec %s -single -ext_init_win %i -theme %s -display %s",
command, w, themename, dstr); command, w, themename, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
} }
@ -579,7 +580,7 @@ doSMExit(void *params)
disp = NULL; disp = NULL;
sscanf(params, "%*s %1000s", s); sscanf(params, "%*s %1000s", s);
Esnprintf(sss, sizeof(sss), Esnprintf(sss, sizeof(sss),
"exec %s -single -ext_init_win %i -theme %s -display %s", "exec %s -single -ext_init_win %i -theme %s -display %s",
command, w, s, dstr); command, w, s, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
} }
@ -615,9 +616,7 @@ doSMExit(void *params)
"\n" "\n"
"\n" "\n"
" Are you sure you wish to log out ? \n" " Are you sure you wish to log out ? \n"
"\n" "\n" "\n");
"\n"
);
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1); DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1); DialogAddButton(d, " No ", NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d); DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d);
@ -627,7 +626,8 @@ doSMExit(void *params)
ewin = FindEwinByDialog(d); ewin = FindEwinByDialog(d);
if (ewin) if (ewin)
{ {
MoveEwin(ewin, ((root.w - (ewin->w)) / 2), ((root.h - (ewin->h)) / 2)); MoveEwin(ewin, ((root.w - (ewin->w)) / 2),
((root.h - (ewin->h)) / 2));
FocusToEWin(ewin); FocusToEWin(ewin);
} }
return; return;
@ -651,15 +651,19 @@ static int restarting = False;
static void LogoutCB(int val, void *data); static void LogoutCB(int val, void *data);
static void set_save_props(SmcConn smc_conn, int master_flag); static void set_save_props(SmcConn smc_conn, int master_flag);
static void callback_save_yourself2(SmcConn smc_conn, SmPointer client_data); static void callback_save_yourself2(SmcConn smc_conn,
SmPointer client_data);
static void callback_save_yourself(SmcConn smc_conn, static void callback_save_yourself(SmcConn smc_conn,
SmPointer client_data, int save_style, SmPointer client_data,
Bool shutdown, int interact_style, int save_style, Bool shutdown,
Bool fast); int interact_style, Bool fast);
static void callback_die(SmcConn smc_conn, SmPointer client_data); static void callback_die(SmcConn smc_conn, SmPointer client_data);
static void callback_save_complete(SmcConn smc_conn, static void callback_save_complete(SmcConn smc_conn,
SmPointer client_data); SmPointer client_data);
static void callback_shutdown_cancelled(SmcConn smc_conn, static void callback_shutdown_cancelled(SmcConn smc_conn,
SmPointer client_data); SmPointer client_data);
static void static void
@ -678,17 +682,14 @@ set_save_props(SmcConn smc_conn, int master_flag)
char priority = 10; char priority = 10;
char style; char style;
int n = 0; int n = 0;
SmPropValue programVal = SmPropValue programVal = { 0, NULL };
{0, NULL}; SmPropValue userIDVal = { 0, NULL };
SmPropValue userIDVal = SmPropValue discardVal[] = {
{0, NULL};
SmPropValue discardVal[] =
{
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
{0, NULL}}; {0, NULL}
SmPropValue restartVal[] = };
{ SmPropValue restartVal[] = {
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
@ -698,11 +699,10 @@ set_save_props(SmcConn smc_conn, int master_flag)
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
{0, NULL}, {0, NULL},
{0, NULL}}; {0, NULL}
SmPropValue styleVal = };
{0, NULL}; SmPropValue styleVal = { 0, NULL };
SmPropValue priorityVal = SmPropValue priorityVal = { 0, NULL };
{0, NULL};
SmProp programProp; SmProp programProp;
SmProp userIDProp; SmProp userIDProp;
SmProp discardProp; SmProp discardProp;
@ -1016,18 +1016,16 @@ ProcessICEMSGS(void)
if (status == IceProcessMessagesIOError) if (status == IceProcessMessagesIOError)
{ {
/* Less of the hope.... E survives */ /* Less of the hope.... E survives */
DialogAlert("ERROR!\n" DialogAlert(gettext("ERROR!\n"
"\n" "\n"
"Lost the Session Manager that was there?\n" "Lost the Session Manager that was there?\n"
"Here here session manager... come here... want a bone?\n" "Here here session manager... come here... want a bone?\n"
"Oh come now! Stop sulking! Bugger. Oh well. " "Oh come now! Stop sulking! Bugger. Oh well. "
"Will continue without\n" "Will continue without\n"
"a session manager.\n" "a session manager.\n"
"\n" "\n"
"I'll survive somehow.\n" "I'll survive somehow.\n"
"\n" "\n" "\n" "... I hope.\n"));
"\n"
"... I hope.\n");
SmcCloseConnection(sm_conn, 0, NULL); SmcCloseConnection(sm_conn, 0, NULL);
sm_conn = NULL; sm_conn = NULL;
sm_fd = -1; sm_fd = -1;
@ -1158,16 +1156,14 @@ doSMExit(void *params)
{ {
AUDIO_PLAY("SOUND_LOGOUT"); AUDIO_PLAY("SOUND_LOGOUT");
d = CreateDialog("LOGOUT_DIALOG"); d = CreateDialog("LOGOUT_DIALOG");
DialogSetTitle(d, "Are you sure?"); DialogSetTitle(d, gettext("Are you sure?"));
DialogSetText(d, DialogSetText(d,
"\n" gettext("\n"
"\n" "\n"
" Are you sure you wish to log out ? \n" " Are you sure you wish to log out ? \n"
"\n" "\n" "\n"));
"\n" DialogAddButton(d, gettext(" Yes, Log Out "), LogoutCB, 1);
); DialogAddButton(d, gettext(" No "), NULL, 1);
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 1, d); DialogBindKey(d, "Escape", CB_SettingsEscape, 1, d);
DialogBindKey(d, "Return", LogoutCB, 0, d); DialogBindKey(d, "Return", LogoutCB, 0, d);
} }
@ -1175,7 +1171,8 @@ doSMExit(void *params)
ewin = FindEwinByDialog(d); ewin = FindEwinByDialog(d);
if (ewin) if (ewin)
{ {
MoveEwin(ewin, ((root.w - (ewin->w)) / 2), ((root.h - (ewin->h)) / 2)); MoveEwin(ewin, ((root.w - (ewin->w)) / 2),
((root.h - (ewin->h)) / 2));
FocusToEWin(ewin); FocusToEWin(ewin);
} }
return; return;
@ -1188,8 +1185,7 @@ doSMExit(void *params)
KDE_Shutdown(); KDE_Shutdown();
XCloseDisplay(disp); XCloseDisplay(disp);
disp = NULL; disp = NULL;
Esnprintf(s, sizeof(s), "exec %s -display %s", Esnprintf(s, sizeof(s), "exec %s -display %s", atword(params, 2), dstr);
atword(params, 2), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
} }
else if (!strcmp(s, "restart")) else if (!strcmp(s, "restart"))
@ -1215,8 +1211,7 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i -theme %s " "exec %s -single -ext_init_win %i -theme %s "
"-smfile %s -display %s", "-smfile %s -display %s",
command, init_win_ext, themename, command, init_win_ext, themename, sm_file, dstr);
sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
} }
else else
@ -1225,14 +1220,12 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i " "exec %s -single -ext_init_win %i "
"-smfile %s -smid %s -display %s", "-smfile %s -smid %s -display %s",
command, init_win_ext, command, init_win_ext, sm_file, sm_client_id, dstr);
sm_file, sm_client_id, dstr);
else else
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i" "exec %s -single -ext_init_win %i"
"-smfile %s -display %s", "-smfile %s -display %s",
command, init_win_ext, command, init_win_ext, sm_file, dstr);
sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
} }
} }
@ -1260,8 +1253,7 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"exec %s -ext_init_win %i -theme %s " "exec %s -ext_init_win %i -theme %s "
"-smfile %s -single -display %s", "-smfile %s -single -display %s",
command, init_win_ext, userthemepath, command, init_win_ext, userthemepath, sm_file, dstr);
sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL); execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
} }
else if (!strcmp((char *)s, "error")) else if (!strcmp((char *)s, "error"))

File diff suppressed because it is too large Load Diff

View File

@ -218,16 +218,17 @@ SetupX()
/* if cannot connect to display */ /* if cannot connect to display */
if (!disp) if (!disp)
{ {
Alert("Enlightenment cannot connect to the display nominated by\n" Alert(gettext
"your shell's DISPLAY environment variable. You may set this\n" ("Enlightenment cannot connect to the display nominated by\n"
"variable to indicate which display name Enlightenment is to\n" "your shell's DISPLAY environment variable. You may set this\n"
"connect to. It may be that you do not have an Xserver already\n" "variable to indicate which display name Enlightenment is to\n"
"running to serve that Display connection, or that you do not\n" "connect to. It may be that you do not have an Xserver already\n"
"have permission to connect to that display. Please make sure\n" "running to serve that Display connection, or that you do not\n"
"all is correct before trying again. Run an Xserver by running\n" "have permission to connect to that display. Please make sure\n"
"xdm or startx first, or contact your local system\n" "all is correct before trying again. Run an Xserver by running\n"
"administrator, or Xserver vendor, or read the X, xdm and\n" "xdm or startx first, or contact your local system\n"
"startx manual pages before proceeding.\n"); "administrator, or Xserver vendor, or read the X, xdm and\n"
"startx manual pages before proceeding.\n"));
EExit((void *)1); EExit((void *)1);
} }
root.scr = DefaultScreen(disp); root.scr = DefaultScreen(disp);
@ -272,7 +273,8 @@ SetupX()
if (NULL != dispstr) if (NULL != dispstr)
*dispstr = '\0'; *dispstr = '\0';
} }
Esnprintf(subdisplay + strlen(subdisplay), 255, ".%d", i); Esnprintf(subdisplay + strlen(subdisplay), 255, ".%d",
i);
dstr = duplicate(subdisplay); dstr = duplicate(subdisplay);
disp = XOpenDisplay(dstr); disp = XOpenDisplay(dstr);
root.scr = i; root.scr = i;
@ -289,18 +291,15 @@ SetupX()
/* Check for the Shape Extension */ /* Check for the Shape Extension */
if (!XShapeQueryExtension(disp, &shape_event_base, &shape_error_base)) if (!XShapeQueryExtension(disp, &shape_event_base, &shape_error_base))
{ {
ASSIGN_ALERT("X server setup error", ASSIGN_ALERT(gettext("X server setup error"),
"", "", "", gettext("Quit Enlightenment"));
"", Alert(gettext("FATAL ERROR:\n"
"Quit Enlightenment"); "\n"
Alert("FATAL ERROR:\n" "This Xserver does not support the Shape extension.\n"
"\n" "This is required for Enlightenment to run.\n"
"This Xserver does not support the Shape extension.\n" "\n"
"This is required for Enlightenment to run.\n" "Your Xserver probably is too old or mis-configured.\n"
"\n" "\n" "Exiting.\n"));
"Your Xserver probably is too old or mis-configured.\n"
"\n"
"Exiting.\n");
RESET_ALERT; RESET_ALERT;
EExit((void *)1); EExit((void *)1);
} }
@ -326,32 +325,26 @@ SetupX()
id = Imlib_init(disp); id = Imlib_init(disp);
if (!id) if (!id)
{ {
ASSIGN_ALERT("Imlib initialisation error", ASSIGN_ALERT(gettext("Imlib initialisation error"),
"", "", "", gettext("Quit Enlightenment"));
"", Alert(gettext("FATAL ERROR:\n"
"Quit Enlightenment"); "\n"
Alert("FATAL ERROR:\n" "Enlightenment is unable to initialise Imlib.\n"
"\n" "\n"
"Enlightenment is unable to initialise Imlib.\n" "This is unusual. Unable to contiune.\n" "Exiting.\n"));
"\n"
"This is unusual. Unable to contiune.\n"
"Exiting.\n");
RESET_ALERT; RESET_ALERT;
EExit((void *)1); EExit((void *)1);
} }
fd = Fnlib_init(id); fd = Fnlib_init(id);
if (!fd) if (!fd)
{ {
ASSIGN_ALERT("X server setup error", ASSIGN_ALERT(gettext("X server setup error"),
"", "", "", gettext("Quit Enlightenment"));
"", Alert(gettext("FATAL ERROR:\n"
"Quit Enlightenment"); "\n"
Alert("FATAL ERROR:\n" "Enlightenment is unable to initialise Fnlib.\n"
"\n" "\n"
"Enlightenment is unable to initialise Fnlib.\n" "This is unusual. Unable to contiune.\n" "Exiting.\n"));
"\n"
"This is unusual. Unable to contiune.\n"
"Exiting.\n");
RESET_ALERT; RESET_ALERT;
EExit((void *)1); EExit((void *)1);
} }
@ -398,11 +391,9 @@ SetupX()
bpress_win = ECreateWindow(root.win, -80, -80, 24, 24, 0); bpress_win = ECreateWindow(root.win, -80, -80, 24, 24, 0);
val = bpress_win; val = bpress_win;
XChangeProperty(disp, root.win, atom_set, XA_CARDINAL, XChangeProperty(disp, root.win, atom_set, XA_CARDINAL,
32, PropModeReplace, 32, PropModeReplace, (unsigned char *)&val, 1);
(unsigned char *)&val, 1);
XChangeProperty(disp, bpress_win, atom_set, XA_CARDINAL, XChangeProperty(disp, bpress_win, atom_set, XA_CARDINAL,
32, PropModeReplace, 32, PropModeReplace, (unsigned char *)&val, 1);
(unsigned char *)&val, 1);
} }
XSync(disp, False); XSync(disp, False);
@ -410,16 +401,15 @@ SetupX()
/* warn, if necessary about X version problems */ /* warn, if necessary about X version problems */
if (ProtocolVersion(disp) != 11) if (ProtocolVersion(disp) != 11)
{ {
ASSIGN_ALERT("X server version error", ASSIGN_ALERT(gettext("X server version error"),
"Ignore this error", gettext("Ignore this error"),
"", "", gettext("Quit Enlightenment"));
"Quit Enlightenment"); Alert(gettext("WARNING:\n"
Alert("WARNING:\n" "This is not an X11 Xserver. It infact talks the X%i protocol.\n"
"This is not an X11 Xserver. It infact talks the X%i protocol.\n" "This may mean Enlightenment will either not function, or\n"
"This may mean Enlightenment will either not function, or\n" "function incorrectly. If it is later than X11, then your\n"
"function incorrectly. If it is later than X11, then your\n" "server is one the author of Enlightenment neither have\n"
"server is one the author of Enlightenment neither have\n" "access to, nor have heard of.\n"),
"access to, nor have heard of.\n",
ProtocolVersion(disp)); ProtocolVersion(disp));
RESET_ALERT; RESET_ALERT;
} }
@ -447,8 +437,7 @@ SetupX()
XModifierKeymap *mod; XModifierKeymap *mod;
KeyCode nl, sl; KeyCode nl, sl;
int i; int i;
int masks[8] = int masks[8] = {
{
ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask, ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask,
Mod4Mask, Mod5Mask Mod4Mask, Mod5Mask
}; };
@ -503,6 +492,9 @@ SetupX()
mode.x = 0; mode.x = 0;
mode.y = 0; mode.y = 0;
mode.showroottooltip = 1; mode.showroottooltip = 1;
mode.pager_sel_button = 2;
mode.pager_win_button = 1;
mode.pager_menu_button = 3;
mode.focusmode = FOCUS_SLOPPY; mode.focusmode = FOCUS_SLOPPY;
mode.focuswin = NULL; mode.focuswin = NULL;
mode.realfocuswin = NULL; mode.realfocuswin = NULL;
@ -628,37 +620,33 @@ ChkDir(char *d)
{ {
if (!isdir(d)) if (!isdir(d))
{ {
Alert("The directory %s is apparently not a directory\n" Alert(gettext("The directory %s is apparently not a directory\n"
"This is a fatal condition.\n" "This is a fatal condition.\n"
"Please remove this file\n", "Please remove this file\n"), d);
d);
EExit((void *)1); EExit((void *)1);
} }
if (!canexec(d)) if (!canexec(d))
{ {
Alert("Do not have execute access to %s\n" Alert(gettext("Do not have execute access to %s\n"
"This is a fatal condition.\n" "This is a fatal condition.\n"
"Please check the ownership and permissions of this\n" "Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n", "directory and take steps to rectify this.\n"), d);
d);
EExit((void *)1); EExit((void *)1);
} }
if (!canread(d)) if (!canread(d))
{ {
Alert("Do not have read access to %s\n" Alert(gettext("Do not have read access to %s\n"
"This is a fatal condition.\n" "This is a fatal condition.\n"
"Please check the ownership and permissions of this\n" "Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n", "directory and take steps to rectify this.\n"), d);
d);
EExit((void *)1); EExit((void *)1);
} }
if (!canwrite(d)) if (!canwrite(d))
{ {
Alert("Do not have write access to %s\n" Alert(gettext("Do not have write access to %s\n"
"This is a fatal condition.\n" "This is a fatal condition.\n"
"Please check the ownership and permissions of this\n" "Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n", "directory and take steps to rectify this.\n"), d);
d);
EExit((void *)1); EExit((void *)1);
} }
} }
@ -752,8 +740,7 @@ SetupEnv()
return; return;
} }
Window Window MakeExtInitWin(void)
MakeExtInitWin(void)
{ {
Display *d2; Display *d2;
Window win; Window win;
@ -822,9 +809,9 @@ MakeExtInitWin(void)
attr.background_pixel = 0; attr.background_pixel = 0;
attr.save_under = True; attr.save_under = True;
win = XCreateWindow(d2, root.win, 0, 0, root.w, root.h, 0, root.depth, win = XCreateWindow(d2, root.win, 0, 0, root.w, root.h, 0, root.depth,
InputOutput, root.vis, CWOverrideRedirect | CWSaveUnder | InputOutput, root.vis, CWOverrideRedirect | CWSaveUnder |
CWBackingStore | CWColormap | CWBackPixel | CWBorderPixel, CWBackingStore | CWColormap | CWBackPixel |
&attr); CWBorderPixel, &attr);
pmap = ECreatePixmap(d2, win, root.w, root.h, root.depth); pmap = ECreatePixmap(d2, win, root.w, root.h, root.depth);
gcv.subwindow_mode = IncludeInferiors; gcv.subwindow_mode = IncludeInferiors;
gc = XCreateGC(d2, win, GCSubwindowMode, &gcv); gc = XCreateGC(d2, win, GCSubwindowMode, &gcv);
@ -923,8 +910,7 @@ MakeExtInitWin(void)
EMoveResizeWindow(d2, w2, EMoveResizeWindow(d2, w2,
x - (im->rgb_width / 2), x - (im->rgb_width / 2),
y - (im->rgb_height / 2), y - (im->rgb_height / 2),
im->rgb_width, im->rgb_width, im->rgb_height);
im->rgb_height);
EMapWindow(d2, w2); EMapWindow(d2, w2);
} }
tv.tv_sec = 0; tv.tv_sec = 0;

View File

@ -64,7 +64,7 @@ MaxHeight(EWin * ewin, char *resize_type)
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(lst[i] != ewin) && (lst[i] != ewin) &&
(!(lst[i]->ignorearrange)) && (!(lst[i]->ignorearrange)) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w)) SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w))
{ {
if (((lst[i]->y + lst[i]->h) <= y) && if (((lst[i]->y + lst[i]->h) <= y) &&
((lst[i]->y + lst[i]->h) >= y1)) ((lst[i]->y + lst[i]->h) >= y1))
@ -107,7 +107,7 @@ MaxHeight(EWin * ewin, char *resize_type)
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(lst[i] != ewin) && (lst[i] != ewin) &&
(lst[i]->never_use_area) && (lst[i]->never_use_area) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w)) SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w))
{ {
if (((lst[i]->y + lst[i]->h) <= y) && if (((lst[i]->y + lst[i]->h) <= y) &&
((lst[i]->y + lst[i]->h) >= y1)) ((lst[i]->y + lst[i]->h) >= y1))
@ -185,7 +185,7 @@ MaxWidth(EWin * ewin, char *resize_type)
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(lst[i] != ewin) && (lst[i] != ewin) &&
(!(lst[i]->ignorearrange)) && (!(lst[i]->ignorearrange)) &&
SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h)) SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h))
{ {
if (((lst[i]->x + lst[i]->w) <= x) && if (((lst[i]->x + lst[i]->w) <= x) &&
((lst[i]->x + lst[i]->w) >= x1)) ((lst[i]->x + lst[i]->w) >= x1))
@ -228,7 +228,7 @@ MaxWidth(EWin * ewin, char *resize_type)
(((ewin->desktop == lst[i]->desktop) && (((ewin->desktop == lst[i]->desktop) &&
(lst[i]->fixedpos)) || (lst[i]->fixedpos)) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h)) SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h))
{ {
if (((lst[i]->x + lst[i]->w) <= x) && if (((lst[i]->x + lst[i]->w) <= x) &&
((lst[i]->x + lst[i]->w) >= x1)) ((lst[i]->x + lst[i]->w) >= x1))
@ -312,7 +312,7 @@ MaxSize(EWin * ewin, char *resize_type)
(!(lst[i]->floating)) && (!(lst[i]->floating)) &&
(lst[i] != ewin) && (lst[i] != ewin) &&
(!(lst[i]->ignorearrange)) && (!(lst[i]->ignorearrange)) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w)) SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w))
{ {
if (((lst[i]->y + lst[i]->h) <= y) && if (((lst[i]->y + lst[i]->h) <= y) &&
((lst[i]->y + lst[i]->h) >= y1)) ((lst[i]->y + lst[i]->h) >= y1))
@ -381,7 +381,7 @@ MaxSize(EWin * ewin, char *resize_type)
(((ewin->desktop == lst[i]->desktop) && (((ewin->desktop == lst[i]->desktop) &&
(lst[i]->fixedpos)) || (lst[i]->fixedpos)) ||
(lst[i]->sticky)) && (lst[i]->sticky)) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w)) SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w))
{ {
if (((lst[i]->y + lst[i]->h) <= y) && if (((lst[i]->y + lst[i]->h) <= y) &&
((lst[i]->y + lst[i]->h) >= y1)) ((lst[i]->y + lst[i]->h) >= y1))

View File

@ -177,8 +177,7 @@ ShowSlideout(Slideout * s, Window win)
XChangeWindowAttributes(disp, s->win, CWWinGravity, &att); XChangeWindowAttributes(disp, s->win, CWWinGravity, &att);
att.win_gravity = NorthWestGravity; att.win_gravity = NorthWestGravity;
for (i = 0; i < s->num_buttons; i++) for (i = 0; i < s->num_buttons; i++)
XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, &att);
&att);
EMoveResizeWindow(disp, s->win, xx, yy, 1, 1); EMoveResizeWindow(disp, s->win, xx, yy, 1, 1);
XSync(disp, False); XSync(disp, False);
EMapRaised(disp, s->win); EMapRaised(disp, s->win);
@ -190,8 +189,7 @@ ShowSlideout(Slideout * s, Window win)
XChangeWindowAttributes(disp, s->win, CWWinGravity, &att); XChangeWindowAttributes(disp, s->win, CWWinGravity, &att);
att.win_gravity = SouthEastGravity; att.win_gravity = SouthEastGravity;
for (i = 0; i < s->num_buttons; i++) for (i = 0; i < s->num_buttons; i++)
XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, &att);
&att);
EMoveResizeWindow(disp, s->win, xx, yy, 1, 1); EMoveResizeWindow(disp, s->win, xx, yy, 1, 1);
XSync(disp, False); XSync(disp, False);
EMapRaised(disp, s->win); EMapRaised(disp, s->win);
@ -203,8 +201,7 @@ ShowSlideout(Slideout * s, Window win)
XChangeWindowAttributes(disp, s->win, CWWinGravity, &att); XChangeWindowAttributes(disp, s->win, CWWinGravity, &att);
att.win_gravity = NorthWestGravity; att.win_gravity = NorthWestGravity;
for (i = 0; i < s->num_buttons; i++) for (i = 0; i < s->num_buttons; i++)
XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, &att);
&att);
EMoveResizeWindow(disp, s->win, xx, yy, 1, 1); EMoveResizeWindow(disp, s->win, xx, yy, 1, 1);
XSync(disp, False); XSync(disp, False);
EMapRaised(disp, s->win); EMapRaised(disp, s->win);
@ -216,8 +213,7 @@ ShowSlideout(Slideout * s, Window win)
XChangeWindowAttributes(disp, s->win, CWWinGravity, &att); XChangeWindowAttributes(disp, s->win, CWWinGravity, &att);
att.win_gravity = SouthEastGravity; att.win_gravity = SouthEastGravity;
for (i = 0; i < s->num_buttons; i++) for (i = 0; i < s->num_buttons; i++)
XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, XChangeWindowAttributes(disp, s->button[i]->win, CWWinGravity, &att);
&att);
EMoveResizeWindow(disp, s->win, xx, yy, 1, 1); EMoveResizeWindow(disp, s->win, xx, yy, 1, 1);
XSync(disp, False); XSync(disp, False);
EMapRaised(disp, s->win); EMapRaised(disp, s->win);

View File

@ -35,7 +35,8 @@ FindSnapshot(EWin * ewin)
if (ewin->snap) if (ewin->snap)
return ewin->snap; return ewin->snap;
if ((ewin->client.name) && (ewin->client.class)) if ((ewin->client.name) && (ewin->client.class))
Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name, ewin->client.class); Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name,
ewin->client.class);
else if (ewin->client.title) else if (ewin->client.title)
Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title); Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title);
else else
@ -62,7 +63,8 @@ GetSnapshot(EWin * ewin)
char buf[4096]; char buf[4096];
if ((ewin->client.name) && (ewin->client.class)) if ((ewin->client.name) && (ewin->client.class))
Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name, ewin->client.class); Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name,
ewin->client.class);
else if (ewin->client.title) else if (ewin->client.title)
Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title); Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title);
sn = NewSnapshot(buf); sn = NewSnapshot(buf);
@ -400,7 +402,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Location"); DialogItemCheckButtonSetText(di, gettext("Location"));
DialogItemCheckButtonSetState(di, tmp_snap_location); DialogItemCheckButtonSetState(di, tmp_snap_location);
DialogItemCheckButtonSetPtr(di, &tmp_snap_location); DialogItemCheckButtonSetPtr(di, &tmp_snap_location);
@ -408,7 +410,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Border style"); DialogItemCheckButtonSetText(di, gettext("Border style"));
DialogItemCheckButtonSetState(di, tmp_snap_border); DialogItemCheckButtonSetState(di, tmp_snap_border);
DialogItemCheckButtonSetPtr(di, &tmp_snap_border); DialogItemCheckButtonSetPtr(di, &tmp_snap_border);
@ -416,7 +418,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Size"); DialogItemCheckButtonSetText(di, gettext("Size"));
DialogItemCheckButtonSetState(di, tmp_snap_size); DialogItemCheckButtonSetState(di, tmp_snap_size);
DialogItemCheckButtonSetPtr(di, &tmp_snap_size); DialogItemCheckButtonSetPtr(di, &tmp_snap_size);
@ -424,7 +426,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Desktop"); DialogItemCheckButtonSetText(di, gettext("Desktop"));
DialogItemCheckButtonSetState(di, tmp_snap_desktop); DialogItemCheckButtonSetState(di, tmp_snap_desktop);
DialogItemCheckButtonSetPtr(di, &tmp_snap_desktop); DialogItemCheckButtonSetPtr(di, &tmp_snap_desktop);
@ -432,7 +434,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Shaded state"); DialogItemCheckButtonSetText(di, gettext("Shaded state"));
DialogItemCheckButtonSetState(di, tmp_snap_shade); DialogItemCheckButtonSetState(di, tmp_snap_shade);
DialogItemCheckButtonSetPtr(di, &tmp_snap_shade); DialogItemCheckButtonSetPtr(di, &tmp_snap_shade);
@ -440,7 +442,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Sticky state"); DialogItemCheckButtonSetText(di, gettext("Sticky state"));
DialogItemCheckButtonSetState(di, tmp_snap_sticky); DialogItemCheckButtonSetState(di, tmp_snap_sticky);
DialogItemCheckButtonSetPtr(di, &tmp_snap_sticky); DialogItemCheckButtonSetPtr(di, &tmp_snap_sticky);
@ -448,7 +450,7 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Stacking layer"); DialogItemCheckButtonSetText(di, gettext("Stacking layer"));
DialogItemCheckButtonSetState(di, tmp_snap_layer); DialogItemCheckButtonSetState(di, tmp_snap_layer);
DialogItemCheckButtonSetPtr(di, &tmp_snap_layer); DialogItemCheckButtonSetPtr(di, &tmp_snap_layer);
@ -467,7 +469,9 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Restart application on login"); DialogItemCheckButtonSetText(di,
gettext
("Restart application on login"));
DialogItemCheckButtonSetState(di, tmp_snap_cmd); DialogItemCheckButtonSetState(di, tmp_snap_cmd);
DialogItemCheckButtonSetPtr(di, &tmp_snap_cmd); DialogItemCheckButtonSetPtr(di, &tmp_snap_cmd);
} }
@ -489,7 +493,9 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetColSpan(di, 4); DialogItemSetColSpan(di, 4);
DialogItemSetPadding(di, 2, 2, 2, 2); DialogItemSetPadding(di, 2, 2, 2, 2);
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemCheckButtonSetText(di, "Remember this window's group(s)"); DialogItemCheckButtonSetText(di,
gettext
("Remember this window's group(s)"));
DialogItemCheckButtonSetState(di, tmp_snap_group); DialogItemCheckButtonSetState(di, tmp_snap_group);
DialogItemCheckButtonSetPtr(di, &tmp_snap_group); DialogItemCheckButtonSetPtr(di, &tmp_snap_group);
} }
@ -500,9 +506,9 @@ SnapshotEwinDialog(EWin * ewin)
DialogItemSetFill(di, 1, 0); DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0); DialogItemSeparatorSetOrientation(di, 0);
DialogAddButton(d, "OK", CB_ApplySnap, 1); DialogAddButton(d, gettext("OK"), CB_ApplySnap, 1);
DialogAddButton(d, "Apply", CB_ApplySnap, 0); DialogAddButton(d, gettext("Apply"), CB_ApplySnap, 0);
DialogAddButton(d, "Cancel", CB_ApplySnap, 1); DialogAddButton(d, gettext("Cancel"), CB_ApplySnap, 1);
DialogSetExitFunction(d, CB_ApplySnap, 2, d); DialogSetExitFunction(d, CB_ApplySnap, 2, d);
DialogBindKey(d, "Escape", CB_ApplySnapEscape, 0, d); DialogBindKey(d, "Escape", CB_ApplySnapEscape, 0, d);
DialogBindKey(d, "Return", CB_ApplySnap, 0, d); DialogBindKey(d, "Return", CB_ApplySnap, 0, d);
@ -677,7 +683,8 @@ SnapshotEwinGroups(EWin * ewin, char onoff)
{ {
if (onoff) if (onoff)
{ {
groups = ListWinGroups(gwins[i], GROUP_SELECT_EWIN_ONLY, &num_groups); groups =
ListWinGroups(gwins[i], GROUP_SELECT_EWIN_ONLY, &num_groups);
if (groups) if (groups)
{ {
sn = gwins[i]->snap; sn = gwins[i]->snap;
@ -739,7 +746,8 @@ UnsnapshotEwin(EWin * ewin)
char buf[4096]; char buf[4096];
if ((ewin->client.name) && (ewin->client.class)) if ((ewin->client.name) && (ewin->client.class))
Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name, ewin->client.class); Esnprintf(buf, sizeof(buf), "%s.%s", ewin->client.name,
ewin->client.class);
else if (ewin->client.title) else if (ewin->client.title)
Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title); Esnprintf(buf, sizeof(buf), "TITLE.%s", ewin->client.title);
else else
@ -748,7 +756,9 @@ UnsnapshotEwin(EWin * ewin)
{ {
ListChangeItemID(LIST_TYPE_SNAPSHOT, ewin->snap, 0); ListChangeItemID(LIST_TYPE_SNAPSHOT, ewin->snap, 0);
ewin->snap->used = 0; ewin->snap->used = 0;
sn = RemoveItem((char *)ewin->snap, 0, LIST_FINDBY_POINTER, LIST_TYPE_SNAPSHOT); sn =
RemoveItem((char *)ewin->snap, 0, LIST_FINDBY_POINTER,
LIST_TYPE_SNAPSHOT);
ewin->snap = NULL; ewin->snap = NULL;
} }
else else
@ -800,7 +810,8 @@ SaveSnapInfo(void)
if (sn->use_wh) if (sn->use_wh)
fprintf(f, "WH: %i %i\n", sn->w, sn->h); fprintf(f, "WH: %i %i\n", sn->w, sn->h);
if (sn->use_xy) if (sn->use_xy)
fprintf(f, "XY: %i %i %i %i\n", sn->x, sn->y, sn->area_x, sn->area_y); fprintf(f, "XY: %i %i %i %i\n", sn->x, sn->y, sn->area_x,
sn->area_y);
if (sn->use_layer) if (sn->use_layer)
fprintf(f, "LAYER: %i\n", sn->layer); fprintf(f, "LAYER: %i\n", sn->layer);
if (sn->use_sticky) if (sn->use_sticky)
@ -826,7 +837,7 @@ SaveSnapInfo(void)
rm(buf); rm(buf);
mv(s, buf); mv(s, buf);
if (!isfile(buf)) if (!isfile(buf))
Alert("Error saving snaps file\n"); Alert(gettext("Error saving snaps file\n"));
SaveGroups(); SaveGroups();
} }
@ -861,7 +872,8 @@ LoadSnapInfo(void)
Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetSMFile(), root.scr); Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetSMFile(), root.scr);
if (!exists(buf)) if (!exists(buf))
Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetGenericSMFile(), root.scr); Esnprintf(buf, sizeof(buf), "%s.snapshots.%i", GetGenericSMFile(),
root.scr);
#ifndef __EMX__ #ifndef __EMX__
f = fopen(buf, "r"); f = fopen(buf, "r");
#else #else
@ -987,7 +999,9 @@ LoadSnapInfo(void)
{ {
word(buf, 2, s); word(buf, 2, s);
sn->num_groups++; sn->num_groups++;
sn->groups = Erealloc(sn->groups, sizeof(int) * sn->num_groups); sn->groups =
Erealloc(sn->groups, sizeof(int) * sn->num_groups);
sn->groups[sn->num_groups - 1] = atoi(s); sn->groups[sn->num_groups - 1] = atoi(s);
} }
@ -1028,16 +1042,20 @@ MatchEwinToSnapInfo(EWin * ewin)
if (sn->use_desktop) if (sn->use_desktop)
{ {
ewin->client.x += ewin->client.x +=
((sn->area_x - desks.desk[ewin->desktop].current_area_x) * root.w); ((sn->area_x - desks.desk[ewin->desktop].current_area_x) *
root.w);
ewin->client.y += ewin->client.y +=
((sn->area_y - desks.desk[ewin->desktop].current_area_y) * root.h); ((sn->area_y - desks.desk[ewin->desktop].current_area_y) *
root.h);
} }
else else
{ {
ewin->client.x += ewin->client.x +=
((sn->area_x - desks.desk[desks.current].current_area_x) * root.w); ((sn->area_x - desks.desk[desks.current].current_area_x) *
root.w);
ewin->client.y += ewin->client.y +=
((sn->area_y - desks.desk[desks.current].current_area_y) * root.h); ((sn->area_y - desks.desk[desks.current].current_area_y) *
root.h);
} }
} }
ewin->x = ewin->client.x; ewin->x = ewin->client.x;
@ -1079,7 +1097,9 @@ MatchEwinToSnapInfo(EWin * ewin)
{ {
BuildWindowGroup(&ewin, 1); BuildWindowGroup(&ewin, 1);
ewin->groups[ewin->num_groups - 1]->index = sn->groups[i]; ewin->groups[ewin->num_groups - 1]->index = sn->groups[i];
ListChangeItemID(LIST_TYPE_GROUP, ewin->groups[ewin->num_groups - 1], sn->groups[i]); ListChangeItemID(LIST_TYPE_GROUP,
ewin->groups[ewin->num_groups - 1],
sn->groups[i]);
} }
else else
AddEwinToGroup(ewin, g); AddEwinToGroup(ewin, g);
@ -1169,12 +1189,28 @@ MatchEwinToSnapInfoAfter(EWin * ewin)
{ {
if (sn->use_desktop) if (sn->use_desktop)
MoveEwin(ewin, MoveEwin(ewin,
sn->x + ((sn->area_x - desks.desk[ewin->desktop].current_area_x) * root.w), sn->x +
sn->y + ((sn->area_y - desks.desk[ewin->desktop].current_area_y) * root.h)); ((sn->
area_x -
desks.desk[ewin->desktop].current_area_x) *
root.w),
sn->y +
((sn->
area_y -
desks.desk[ewin->desktop].current_area_y) *
root.h));
else else
MoveEwin(ewin, MoveEwin(ewin,
sn->x + ((sn->area_x - desks.desk[desks.current].current_area_x) * root.w), sn->x +
sn->y + ((sn->area_y - desks.desk[desks.current].current_area_y) * root.h)); ((sn->
area_x -
desks.desk[desks.current].current_area_x) *
root.w),
sn->y +
((sn->
area_y -
desks.desk[desks.current].current_area_y) *
root.h));
} }
else else
MoveEwin(ewin, sn->x, sn->y); MoveEwin(ewin, sn->x, sn->y);
@ -1228,7 +1264,9 @@ MatchEwinToSnapInfoAfter(EWin * ewin)
{ {
BuildWindowGroup(&ewin, 1); BuildWindowGroup(&ewin, 1);
ewin->groups[ewin->num_groups - 1]->index = sn->groups[i]; ewin->groups[ewin->num_groups - 1]->index = sn->groups[i];
ListChangeItemID(LIST_TYPE_GROUP, ewin->groups[ewin->num_groups - 1], sn->groups[i]); ListChangeItemID(LIST_TYPE_GROUP,
ewin->groups[ewin->num_groups - 1],
sn->groups[i]);
} }
else else
AddEwinToGroup(ewin, g); AddEwinToGroup(ewin, g);

View File

@ -56,11 +56,13 @@
*/ */
static void dopr(char *buffer, const char *format, va_list args); static void dopr(char *buffer, const char *format, va_list args);
static void fmtstr(char *value, int ljust, int len, int zpad, int precision); static void fmtstr(char *value, int ljust, int len, int zpad,
static void fmtnum(long value, int base, int dosign,
int ljust, int len, int zpad, int precision); int precision);
static void fmtdouble(int fmt, double value, static void fmtnum(long value, int base, int dosign, int ljust, int len,
int ljust, int len, int zpad, int precision); int zpad, int precision);
static void fmtdouble(int fmt, double value, int ljust, int len,
int zpad, int precision);
static void dostr(char *); static void dostr(char *);
static char *output; static char *output;
static void dopr_outch(int c); static void dopr_outch(int c);
@ -82,12 +84,11 @@ Evsnprintf(char *str, size_t count, const char *fmt, va_list args)
#ifdef HAVE_STDARGS #ifdef HAVE_STDARGS
int int
Esnprintf(char *str, size_t count, const char *fmt,...) Esnprintf(char *str, size_t count, const char *fmt, ...)
#else #else
int int
Esnprintf(va_alist) Esnprintf(va_alist)
va_dcl va_dcl
#endif #endif
{ {
#ifndef HAVE_STDARGS #ifndef HAVE_STDARGS

View File

@ -50,12 +50,12 @@ LoadWav(char *file)
find = FindFile(file); find = FindFile(file);
if (!find) if (!find)
{ {
DIALOG_PARAM_OK("Error finding sound file"); DIALOG_PARAM_OK(gettext("Error finding sound file"));
DIALOG_PARAM DIALOG_PARAM
"Warning! Enlightenment was unable " gettext("Warning! Enlightenment was unable "
"to load the\nfollowing sound file:\n%s\n" "to load the\nfollowing sound file:\n%s\n"
"Enlightenment will continue to operate, but you\n" "Enlightenment will continue to operate, but you\n"
"may wish to check your configuration settings.\n", file "may wish to check your configuration settings.\n"), file
DIALOG_PARAM_END; DIALOG_PARAM_END;
EDBUG_RETURN(NULL); EDBUG_RETURN(NULL);
} }
@ -134,7 +134,9 @@ SoundPlay(Sample * s)
s->id = esd_sample_getid(sound_fd, s->file); s->id = esd_sample_getid(sound_fd, s->file);
if (s->id < 0) if (s->id < 0)
{ {
s->id = esd_sample_cache(sound_fd, s->format, s->rate, size, s->file); s->id =
esd_sample_cache(sound_fd, s->format, s->rate, size,
s->file);
write(sound_fd, s->data, size); write(sound_fd, s->data, size);
confirm = esd_confirm_sample_cache(sound_fd); confirm = esd_confirm_sample_cache(sound_fd);
if (confirm != s->id) if (confirm != s->id)
@ -257,13 +259,12 @@ SoundInit()
sound_fd = fd; sound_fd = fd;
else else
{ {
ASSIGN_ALERT("Error initialising sound", ASSIGN_ALERT(gettext("Error initialising sound"),
"OK", gettext("OK"), " ", " ");
" ", Alert(gettext
" "); ("Audio was enabled for Enlightenemnt but there was an error\n"
Alert("Audio was enabled for Enlightenemnt but there was an error\n" "communicating with the audio server (Esound). Audio will\n"
"communicating with the audio server (Esound). Audio will\n" "now be disabled.\n"));
"now be disabled.\n");
RESET_ALERT; RESET_ALERT;
mode.sound = 0; mode.sound = 0;
} }

View File

@ -31,10 +31,11 @@ AddEToFile(char *file)
char *s1, *s2; char *s1, *s2;
char hase = 0; char hase = 0;
char foundwm = 0; char foundwm = 0;
char *wms[] = char *wms[] = {
{ "wmaker", "afterstep", "fvwm", "fvwm2", "twm", "mwm", "vtwm", "ctwm",
"wmaker", "afterstep", "fvwm", "fvwm2", "twm", "mwm", "vtwm", "ctwm", "gwm", "gwm",
"mlvwm", "kwm", "olwm", "wm2", "wmx", "olvwm", "9wm", "blackbox", "awm", "uwm", "mlvwm", "kwm", "olwm", "wm2", "wmx", "olvwm", "9wm", "blackbox", "awm",
"uwm",
"amiwm", "dtwm", "4dwm", "scwm", "fvwm95", "fvwm95-2", "tvtwm", "bowman", "amiwm", "dtwm", "4dwm", "scwm", "fvwm95", "fvwm95-2", "tvtwm", "bowman",
"qwm", "icewm", "qvwm", "gnome-session", "xsm", "startkde" "qwm", "icewm", "qvwm", "gnome-session", "xsm", "startkde"
}; };
@ -75,8 +76,10 @@ AddEToFile(char *file)
if ((!s2) || (s1 < s2)) if ((!s2) || (s1 < s2))
{ {
fprintf(f2, "#%s", s); fprintf(f2, "#%s", s);
fprintf(f2, "\n# Enlightenment inserted Execution string here\n"); fprintf(f2,
fprintf(f2, "exec %s/enlightenment\n\n", ENLIGHTENMENT_BIN); "\n# Enlightenment inserted Execution string here\n");
fprintf(f2, "exec %s/enlightenment\n\n",
ENLIGHTENMENT_BIN);
foundwm = 1; foundwm = 1;
i = wmnum + 1; i = wmnum + 1;
} }
@ -173,15 +176,19 @@ CreateStartupDisplay(char start)
EDBUG_RETURN_; EDBUG_RETURN_;
if (start) if (start)
{ {
bg_sideways = (Background *) FindItem("STARTUP_BACKGROUND_SIDEWAYS", 0, LIST_FINDBY_NAME, bg_sideways =
LIST_TYPE_BACKGROUND); (Background *) FindItem("STARTUP_BACKGROUND_SIDEWAYS", 0,
ic = (ImageClass *) FindItem("STARTUP_BAR", 0, LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND);
LIST_TYPE_ICLASS); ic =
(ImageClass *) FindItem("STARTUP_BAR", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
ic = (ImageClass *) FindItem("DESKTOP_DRAGBUTTON_HORIZ", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); (ImageClass *) FindItem("DESKTOP_DRAGBUTTON_HORIZ", 0,
bg = (Background *) FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME, LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
LIST_TYPE_BACKGROUND); bg =
(Background *) FindItem("STARTUP_BACKGROUND", 0, LIST_FINDBY_NAME,
LIST_TYPE_BACKGROUND);
if ((!ic) || (!bg)) if ((!ic) || (!bg))
EDBUG_RETURN_; EDBUG_RETURN_;
@ -203,7 +210,9 @@ CreateStartupDisplay(char start)
EMapWindow(disp, win1); EMapWindow(disp, win1);
EMapWindow(disp, win2); EMapWindow(disp, win2);
b1 = ECreateWindow(w1, 0, root.h - desks.dragbar_width, root.w, desks.dragbar_width, 0); b1 =
ECreateWindow(w1, 0, root.h - desks.dragbar_width, root.w,
desks.dragbar_width, 0);
b2 = ECreateWindow(w2, 0, 0, root.w, desks.dragbar_width, 0); b2 = ECreateWindow(w2, 0, 0, root.w, desks.dragbar_width, 0);
EMapRaised(disp, b1); EMapRaised(disp, b1);
EMapRaised(disp, b2); EMapRaised(disp, b2);
@ -226,8 +235,7 @@ CreateStartupDisplay(char start)
} }
else else
{ {
int k, spd, x, y, xOffset, yOffset, ty, fy, min, int k, spd, x, y, xOffset, yOffset, ty, fy, min, speed;
speed;
/* we have this many so that we save on lines o code - eAndroid */ /* we have this many so that we save on lines o code - eAndroid */
struct timeval timev1, timev2; struct timeval timev1, timev2;

View File

@ -31,8 +31,7 @@ MakeWindowUnSticky(EWin * ewin)
EDBUG_RETURN_; EDBUG_RETURN_;
FloatEwinAt(ewin, ewin->x, ewin->y); FloatEwinAt(ewin, ewin->x, ewin->y);
DrawEwinShape(ewin, 0, ewin->x, ewin->y, DrawEwinShape(ewin, 0, ewin->x, ewin->y, ewin->client.w, ewin->client.h, 0);
ewin->client.w, ewin->client.h, 0);
MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y); MoveEwinToDesktopAt(ewin, desks.current, ewin->x, ewin->y);
ewin->sticky = 0; ewin->sticky = 0;
RaiseEwin(ewin); RaiseEwin(ewin);

View File

@ -203,8 +203,7 @@ TclassPopulate(TextClass * tclass)
void void
TclassApply(ImageClass * iclass, Window win, int w, int h, int active, TclassApply(ImageClass * iclass, Window win, int w, int h, int active,
int sticky, int state, char expose, int sticky, int state, char expose, TextClass * tclass, char *text)
TextClass * tclass, char *text)
{ {
EDBUG(4, "TclassApply"); EDBUG(4, "TclassApply");

View File

@ -250,7 +250,8 @@ TextSize(TextClass * tclass, int active, int sticky, int state, char *text,
{ {
XRectangle ret1, ret2; XRectangle ret1, ret2;
XmbTextExtents(ts->xfontset, lines[i], strlen(lines[i]), &ret1, &ret2); XmbTextExtents(ts->xfontset, lines[i], strlen(lines[i]), &ret1,
&ret2);
*height += ret2.height; *height += ret2.height;
if (ret2.width > *width) if (ret2.width > *width)
*width = ret2.width; *width = ret2.width;
@ -314,7 +315,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
if (!gc) if (!gc)
gc = XCreateGC(disp, win, 0, &gcv); gc = XCreateGC(disp, win, 0, &gcv);
if (ts->style.orientation == FONT_TO_RIGHT || ts->style.orientation == FONT_TO_LEFT) if (ts->style.orientation == FONT_TO_RIGHT
|| ts->style.orientation == FONT_TO_LEFT)
textwidth_limit = w; textwidth_limit = w;
else else
textwidth_limit = h; textwidth_limit = h;
@ -367,9 +369,10 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0; new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2); strncat(new_line, lines[i], (len - nuke_count) / 2);
strcat(new_line, "..."); strcat(new_line, "...");
strcat(new_line, lines[i] + ((len - nuke_count) / 2) + nuke_count); strcat(new_line,
Efont_extents(ts->efont, new_line, &ascent, &descent, &wid, lines[i] + ((len - nuke_count) / 2) + nuke_count);
NULL, NULL, NULL, NULL); Efont_extents(ts->efont, new_line, &ascent, &descent,
&wid, NULL, NULL, NULL, NULL);
} }
Efree(lines[i]); Efree(lines[i]);
lines[i] = new_line; lines[i] = new_line;
@ -379,10 +382,13 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
xx = x + (((textwidth_limit - wid) * justification) >> 10); xx = x + (((textwidth_limit - wid) * justification) >> 10);
if (ts->style.orientation != FONT_TO_RIGHT) if (ts->style.orientation != FONT_TO_RIGHT)
drawable = ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2, GetWinDepth(win)); drawable =
ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2,
GetWinDepth(win));
else else
drawable = win; drawable = win;
TextDrawRotTo(win, &drawable, xx - 1, yy - 1 - ascent, wid + 2, ascent + descent + 2, ts); TextDrawRotTo(win, &drawable, xx - 1, yy - 1 - ascent, wid + 2,
ascent + descent + 2, ts);
if (ts->style.orientation == FONT_TO_RIGHT) if (ts->style.orientation == FONT_TO_RIGHT)
{ {
offset_x = xx; offset_x = xx;
@ -399,9 +405,11 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
EFont_draw_string(disp, drawable, gc, offset_x + 1, offset_y + 1, Imlib_best_color_match(id, &r, &g, &b));
lines[i], ts->efont, Imlib_get_visual(id), EFont_draw_string(disp, drawable, gc, offset_x + 1,
offset_y + 1, lines[i], ts->efont,
Imlib_get_visual(id),
Imlib_get_colormap(id)); Imlib_get_colormap(id));
} }
else if (ts->effect == 2) else if (ts->effect == 2)
@ -409,7 +417,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
EFont_draw_string(disp, drawable, gc, offset_x - 1, offset_y, EFont_draw_string(disp, drawable, gc, offset_x - 1, offset_y,
lines[i], ts->efont, Imlib_get_visual(id), lines[i], ts->efont, Imlib_get_visual(id),
Imlib_get_colormap(id)); Imlib_get_colormap(id));
@ -431,7 +440,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
lines[i], ts->efont, Imlib_get_visual(id), lines[i], ts->efont, Imlib_get_visual(id),
Imlib_get_colormap(id)); Imlib_get_colormap(id));
TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2, ascent + descent + 2, ts); TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
ascent + descent + 2, ts);
if (drawable != win) if (drawable != win)
EFreePixmap(disp, drawable); EFreePixmap(disp, drawable);
yy += ascent + descent; yy += ascent + descent;
@ -443,7 +453,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
{ {
XRectangle ret1, ret2; XRectangle ret1, ret2;
XmbTextExtents(ts->xfontset, lines[i], strlen(lines[i]), &ret1, &ret2); XmbTextExtents(ts->xfontset, lines[i], strlen(lines[i]), &ret1,
&ret2);
if (ret2.width > textwidth_limit) if (ret2.width > textwidth_limit)
{ {
char *new_line; char *new_line;
@ -465,8 +476,10 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0; new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2); strncat(new_line, lines[i], (len - nuke_count) / 2);
strcat(new_line, "..."); strcat(new_line, "...");
strcat(new_line, lines[i] + ((len - nuke_count) / 2) + nuke_count); strcat(new_line,
XmbTextExtents(ts->xfontset, new_line, strlen(new_line), &ret1, &ret2); lines[i] + ((len - nuke_count) / 2) + nuke_count);
XmbTextExtents(ts->xfontset, new_line, strlen(new_line),
&ret1, &ret2);
} }
Efree(lines[i]); Efree(lines[i]);
lines[i] = new_line; lines[i] = new_line;
@ -476,10 +489,14 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
xx = x + (((textwidth_limit - ret2.width) * justification) >> 10); xx = x + (((textwidth_limit - ret2.width) * justification) >> 10);
if (ts->style.orientation != FONT_TO_RIGHT) if (ts->style.orientation != FONT_TO_RIGHT)
drawable = ECreatePixmap(disp, root.win, ret2.width + 2, ret2.height + 2, GetWinDepth(win)); drawable =
ECreatePixmap(disp, root.win, ret2.width + 2,
ret2.height + 2, GetWinDepth(win));
else else
drawable = win; drawable = win;
TextDrawRotTo(win, &drawable, xx - 1, yy - (ts->xfontset_ascent) - 1, ret2.width + 2, ret2.height + 2, ts); TextDrawRotTo(win, &drawable, xx - 1,
yy - (ts->xfontset_ascent) - 1, ret2.width + 2,
ret2.height + 2, ts);
if (ts->style.orientation == FONT_TO_RIGHT) if (ts->style.orientation == FONT_TO_RIGHT)
{ {
offset_x = xx; offset_x = xx;
@ -496,24 +513,26 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1, offset_y + 1, Imlib_best_color_match(id, &r, &g, &b));
lines[i], strlen(lines[i])); XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
offset_y + 1, lines[i], strlen(lines[i]));
} }
else if (ts->effect == 2) else if (ts->effect == 2)
{ {
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x - 1, offset_y, Imlib_best_color_match(id, &r, &g, &b));
lines[i], strlen(lines[i])); XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x - 1,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1, offset_y, offset_y, lines[i], strlen(lines[i]));
lines[i], strlen(lines[i])); XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y - 1, offset_y, lines[i], strlen(lines[i]));
lines[i], strlen(lines[i])); XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y + 1, offset_y - 1, lines[i], strlen(lines[i]));
lines[i], strlen(lines[i])); XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x,
offset_y + 1, lines[i], strlen(lines[i]));
} }
r = ts->fg_col.r; r = ts->fg_col.r;
g = ts->fg_col.g; g = ts->fg_col.g;
@ -522,7 +541,9 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y, XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y,
lines[i], strlen(lines[i])); lines[i], strlen(lines[i]));
TextDrawRotBack(win, drawable, xx - 1, yy - (ts->xfontset_ascent) - 1, ret2.width + 2, ret2.height + 2, ts); TextDrawRotBack(win, drawable, xx - 1,
yy - (ts->xfontset_ascent) - 1, ret2.width + 2,
ret2.height + 2, ts);
if (drawable != win) if (drawable != win)
EFreePixmap(disp, drawable); EFreePixmap(disp, drawable);
yy += ret2.height; yy += ret2.height;
@ -560,7 +581,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0; new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2); strncat(new_line, lines[i], (len - nuke_count) / 2);
strcat(new_line, "..."); strcat(new_line, "...");
strcat(new_line, lines[i] + ((len - nuke_count) / 2) + nuke_count); strcat(new_line,
lines[i] + ((len - nuke_count) / 2) + nuke_count);
wid = XTextWidth(ts->xfont, new_line, strlen(new_line)); wid = XTextWidth(ts->xfont, new_line, strlen(new_line));
} }
Efree(lines[i]); Efree(lines[i]);
@ -571,10 +593,13 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
xx = x + (((textwidth_limit - wid) * justification) >> 10); xx = x + (((textwidth_limit - wid) * justification) >> 10);
if (ts->style.orientation != FONT_TO_RIGHT) if (ts->style.orientation != FONT_TO_RIGHT)
drawable = ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2, GetWinDepth(win)); drawable =
ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2,
GetWinDepth(win));
else else
drawable = win; drawable = win;
TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2, ascent + descent + 2, ts); TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2,
ascent + descent + 2, ts);
if (ts->style.orientation == FONT_TO_RIGHT) if (ts->style.orientation == FONT_TO_RIGHT)
{ {
offset_x = xx; offset_x = xx;
@ -591,7 +616,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XDrawString(disp, drawable, gc, offset_x + 1, offset_y + 1, XDrawString(disp, drawable, gc, offset_x + 1, offset_y + 1,
lines[i], strlen(lines[i])); lines[i], strlen(lines[i]));
} }
@ -600,7 +626,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XDrawString(disp, drawable, gc, offset_x - 1, offset_y, XDrawString(disp, drawable, gc, offset_x - 1, offset_y,
lines[i], strlen(lines[i])); lines[i], strlen(lines[i]));
XDrawString(disp, drawable, gc, offset_x + 1, offset_y, XDrawString(disp, drawable, gc, offset_x + 1, offset_y,
@ -617,7 +644,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
XDrawString(disp, drawable, gc, offset_x, offset_y, XDrawString(disp, drawable, gc, offset_x, offset_y,
lines[i], strlen(lines[i])); lines[i], strlen(lines[i]));
TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2, ascent + descent + 2, ts); TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
ascent + descent + 2, ts);
if (drawable != win) if (drawable != win)
EFreePixmap(disp, drawable); EFreePixmap(disp, drawable);
yy += ts->xfont->ascent + ts->xfont->descent; yy += ts->xfont->ascent + ts->xfont->descent;
@ -655,9 +683,11 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0; new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 4); strncat(new_line, lines[i], (len - nuke_count) / 4);
strcat(new_line, ". . . "); strcat(new_line, ". . . ");
strcat(new_line, lines[i] + ((len - nuke_count) / 4) + nuke_count); strcat(new_line,
wid = XTextWidth16(ts->xfont, (XChar2b *) new_line, lines[i] + ((len - nuke_count) / 4) + nuke_count);
strlen(new_line) / 2); wid =
XTextWidth16(ts->xfont, (XChar2b *) new_line,
strlen(new_line) / 2);
} }
Efree(lines[i]); Efree(lines[i]);
lines[i] = new_line; lines[i] = new_line;
@ -667,10 +697,13 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
xx = x + (((textwidth_limit - wid) * justification) >> 10); xx = x + (((textwidth_limit - wid) * justification) >> 10);
if (ts->style.orientation != FONT_TO_RIGHT) if (ts->style.orientation != FONT_TO_RIGHT)
drawable = ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2, GetWinDepth(win)); drawable =
ECreatePixmap(disp, root.win, wid + 2, ascent + descent + 2,
GetWinDepth(win));
else else
drawable = win; drawable = win;
TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2, ascent + descent + 2, ts); TextDrawRotTo(win, &drawable, xx - 1, yy - ascent - 1, wid + 2,
ascent + descent + 2, ts);
if (ts->style.orientation == FONT_TO_RIGHT) if (ts->style.orientation == FONT_TO_RIGHT)
{ {
offset_x = xx; offset_x = xx;
@ -687,7 +720,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XDrawString16(disp, drawable, gc, offset_x + 1, offset_y + 1, XDrawString16(disp, drawable, gc, offset_x + 1, offset_y + 1,
(XChar2b *) lines[i], strlen(lines[i]) / 2); (XChar2b *) lines[i], strlen(lines[i]) / 2);
} }
@ -696,7 +730,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r; r = ts->bg_col.r;
g = ts->bg_col.g; g = ts->bg_col.g;
b = ts->bg_col.b; b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b)); XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XDrawString16(disp, drawable, gc, offset_x - 1, offset_y, XDrawString16(disp, drawable, gc, offset_x - 1, offset_y,
(XChar2b *) lines[i], strlen(lines[i]) / 2); (XChar2b *) lines[i], strlen(lines[i]) / 2);
XDrawString16(disp, drawable, gc, offset_y + 1, offset_y, XDrawString16(disp, drawable, gc, offset_y + 1, offset_y,
@ -713,7 +748,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
XDrawString16(disp, drawable, gc, offset_x, offset_y, XDrawString16(disp, drawable, gc, offset_x, offset_y,
(XChar2b *) lines[i], strlen(lines[i]) / 2); (XChar2b *) lines[i], strlen(lines[i]) / 2);
TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2, ascent + descent + 2, ts); TextDrawRotBack(win, drawable, xx - 1, yy - 1 - ascent, wid + 2,
ascent + descent + 2, ts);
if (drawable != win) if (drawable != win)
EFreePixmap(disp, drawable); EFreePixmap(disp, drawable);
yy += ts->xfont->ascent + ts->xfont->descent; yy += ts->xfont->ascent + ts->xfont->descent;
@ -724,7 +760,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
} }
void void
TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h, TextState * ts) TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h,
TextState * ts)
{ {
ImlibImage *ii = NULL; ImlibImage *ii = NULL;
int win_x, win_y; int win_x, win_y;
@ -739,8 +776,10 @@ TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h, TextS
Imlib_paste_image(id, ii, *drawable, 0, 0, w, h); Imlib_paste_image(id, ii, *drawable, 0, 0, w, h);
break; break;
case FONT_TO_DOWN: case FONT_TO_DOWN:
EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h, &win_b, &win_d); EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h,
ii = Imlib_create_image_from_drawable(id, win, 0, win_w - y - h, x, h, w); &win_b, &win_d);
ii =
Imlib_create_image_from_drawable(id, win, 0, win_w - y - h, x, h, w);
Imlib_rotate_image(id, ii, -1); Imlib_rotate_image(id, ii, -1);
Imlib_flip_image_vertical(id, ii); Imlib_flip_image_vertical(id, ii);
Imlib_paste_image(id, ii, *drawable, 0, 0, w, h); Imlib_paste_image(id, ii, *drawable, 0, 0, w, h);
@ -759,7 +798,8 @@ TextDrawRotTo(Window win, Drawable * drawable, int x, int y, int w, int h, TextS
} }
void void
TextDrawRotBack(Window win, Pixmap drawable, int x, int y, int w, int h, TextState * ts) TextDrawRotBack(Window win, Pixmap drawable, int x, int y, int w, int h,
TextState * ts)
{ {
ImlibImage *ii = NULL; ImlibImage *ii = NULL;
int win_x, win_y; int win_x, win_y;
@ -774,7 +814,8 @@ TextDrawRotBack(Window win, Pixmap drawable, int x, int y, int w, int h, TextSta
Imlib_paste_image(id, ii, win, y, x, h, w); Imlib_paste_image(id, ii, win, y, x, h, w);
break; break;
case FONT_TO_DOWN: case FONT_TO_DOWN:
EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h, &win_b, &win_d); EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h,
&win_b, &win_d);
ii = Imlib_create_image_from_drawable(id, drawable, 0, 0, 0, w, h); ii = Imlib_create_image_from_drawable(id, drawable, 0, 0, 0, w, h);
Imlib_rotate_image(id, ii, 1); Imlib_rotate_image(id, ii, 1);
Imlib_flip_image_horizontal(id, ii); Imlib_flip_image_horizontal(id, ii);

View File

@ -31,7 +31,7 @@ char *
append_merge_dir(char *dir, char ***list, int *count) append_merge_dir(char *dir, char ***list, int *count)
{ {
char s[FILEPATH_LEN_MAX], ss[FILEPATH_LEN_MAX], **str = NULL, char s[FILEPATH_LEN_MAX], ss[FILEPATH_LEN_MAX], **str = NULL,
*def = NULL; *def = NULL;
char already, *tmp, *tmp2, ok; char already, *tmp, *tmp2, ok;
int i, j, num; int i, j, num;
@ -107,7 +107,9 @@ append_merge_dir(char *dir, char ***list, int *count)
char ** char **
ListThemes(int *number) ListThemes(int *number)
{ {
char s[FILEPATH_LEN_MAX], **list = NULL, *def = NULL, *def2 = NULL; char s[FILEPATH_LEN_MAX], **list = NULL, *def = NULL, *def2 =
NULL;
int count = 0; int count = 0;
Esnprintf(s, sizeof(s), "%s/themes", UserEDir()); Esnprintf(s, sizeof(s), "%s/themes", UserEDir());
@ -162,7 +164,8 @@ GetDefaultTheme(void)
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT); Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT);
#else #else
Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT", __XOS2RedirRoot(ENLIGHTENMENT_ROOT)); Esnprintf(ss, sizeof(ss), "%s/themes/DEFAULT",
__XOS2RedirRoot(ENLIGHTENMENT_ROOT));
#endif #endif
#ifndef __EMX__ #ifndef __EMX__
count = readlink(ss, s, sizeof(s)); count = readlink(ss, s, sizeof(s));
@ -173,7 +176,8 @@ GetDefaultTheme(void)
def = duplicate(s); def = duplicate(s);
else else
{ {
Esnprintf(ss, sizeof(ss), "%s/themes/%s", ENLIGHTENMENT_ROOT, s); Esnprintf(ss, sizeof(ss), "%s/themes/%s", ENLIGHTENMENT_ROOT,
s);
def = duplicate(ss); def = duplicate(ss);
} }
} }
@ -237,8 +241,7 @@ ExtractTheme(char *theme)
/* make the temp dir */ /* make the temp dir */
themename = fileof(theme); themename = fileof(theme);
Esnprintf(th, sizeof(th), "%s/themes/%s", Esnprintf(th, sizeof(th), "%s/themes/%s", UserEDir(), themename);
UserEDir(), themename);
Efree(themename); Efree(themename);
md(th); md(th);
/* check magic numbers */ /* check magic numbers */
@ -246,10 +249,11 @@ ExtractTheme(char *theme)
{ {
/*gzipped tarball */ /*gzipped tarball */
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"gzip -d -c < %s | (cd %s ; tar -xf -)", theme, th); "gzip -d -c < %s | (cd %s ; tar -xf -)", theme, th);
} }
else if ((buf[257] == 'u') && (buf[258] == 's') && (buf[259] == 't') && else if ((buf[257] == 'u') && (buf[258] == 's')
(buf[260] == 'a') && (buf[261] == 'r')) && (buf[259] == 't') && (buf[260] == 'a')
&& (buf[261] == 'r'))
{ {
/*vanilla tarball */ /*vanilla tarball */
Esnprintf(s, sizeof(s), "(cd %s ; tar -xf %s)", th, theme); Esnprintf(s, sizeof(s), "(cd %s ; tar -xf %s)", th, theme);
@ -286,13 +290,14 @@ FindTheme(char *theme)
char *ret = NULL; char *ret = NULL;
EDBUG(6, "FindTheme"); EDBUG(6, "FindTheme");
badreason = "Unknown\n"; badreason = gettext("Unknown\n");
if (!theme[0]) if (!theme[0])
{ {
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT); Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", ENLIGHTENMENT_ROOT);
#else #else
Esnprintf(s, sizeof(s), "%s/themes/DEFAULT", __XOS2RedirRoot(ENLIGHTENMENT_ROOT)); Esnprintf(s, sizeof(s), "%s/themes/DEFAULT",
__XOS2RedirRoot(ENLIGHTENMENT_ROOT));
#endif #endif
EDBUG_RETURN(duplicate(s)); EDBUG_RETURN(duplicate(s));
} }
@ -308,18 +313,19 @@ FindTheme(char *theme)
if (exists(s)) if (exists(s))
ret = ExtractTheme(s); ret = ExtractTheme(s);
else else
badreason = "Theme file/directory does not exist\n"; badreason = gettext("Theme file/directory does not exist\n");
if (!ret) if (!ret)
{ {
#ifndef __EMX__ #ifndef __EMX__
Esnprintf(s, sizeof(s), "%s/themes/%s", ENLIGHTENMENT_ROOT, theme); Esnprintf(s, sizeof(s), "%s/themes/%s", ENLIGHTENMENT_ROOT, theme);
#else #else
Esnprintf(s, sizeof(s), "%s/themes/%s", __XOS2RedirRoot(ENLIGHTENMENT_ROOT), theme); Esnprintf(s, sizeof(s), "%s/themes/%s",
__XOS2RedirRoot(ENLIGHTENMENT_ROOT), theme);
#endif #endif
if (exists(s)) if (exists(s))
ret = ExtractTheme(s); ret = ExtractTheme(s);
else else
badreason = "Theme file/directory does not exist\n"; badreason = gettext("Theme file/directory does not exist\n");
if (!ret) if (!ret)
{ {
ret = GetDefaultTheme(); ret = GetDefaultTheme();
@ -339,13 +345,12 @@ BadThemeDialog(void)
return; return;
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
"The theme:\n" gettext("The theme:\n"
"%s\n" "%s\n"
"Is a badly formed theme package and is thus not being used.\n" "Is a badly formed theme package and is thus not being used.\n"
"Enlightenment has fallen back to using the DEFAULT theme.\n" "Enlightenment has fallen back to using the DEFAULT theme.\n"
"\n" "\n"
"The reason this theme is bad is:\n" "The reason this theme is bad is:\n"
"%s", "%s"), badtheme, badreason);
badtheme, badreason); DIALOG_OK(gettext("Bad Theme"), s);
DIALOG_OK("Bad Theme", s);
} }

View File

@ -147,6 +147,7 @@
#define __KDE_SUPPORT 1366 #define __KDE_SUPPORT 1366
#define __CLICKS_ALWAYS_RAISE_WINDOWS 1367 #define __CLICKS_ALWAYS_RAISE_WINDOWS 1367
#define __ROOT_WINDOW_TOOLTIP 1368 #define __ROOT_WINDOW_TOOLTIP 1368
#define __PAGER_BUTTONS 1369
#define __DIRECTION_OF_DESKTOP_DRAG 400 #define __DIRECTION_OF_DESKTOP_DRAG 400
#define __WIDTH_OF_DRAGBAR 401 #define __WIDTH_OF_DRAGBAR 401

View File

@ -134,14 +134,13 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{ {
int i, w = 0, h = 0, ix, iy, iw, ih, dx, dy, xx, yy; int i, w = 0, h = 0, ix, iy, iw, ih, dx, dy, xx, yy;
int ww, hh, adx, ady, dist; int ww, hh, adx, ady, dist;
int headline_h = 0, headline_w = 0, icons_width = 0, labels_width = 0, int headline_h = 0, headline_w = 0, icons_width =
double_w = 0, temp_w, temp_h; 0, labels_width = 0, double_w = 0, temp_w, temp_h;
ImlibImage *im; ImlibImage *im;
char pq; char pq;
int *heights = NULL; int *heights = NULL;
ImageClass *ic = NULL; ImageClass *ic = NULL;
int cols[10] = int cols[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
EDBUG(5, "ShowToolTip"); EDBUG(5, "ShowToolTip");
if (!tt) if (!tt)
@ -162,29 +161,33 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
if (ac->list[i]->tooltipstring) if (ac->list[i]->tooltipstring)
{ {
TextSize(tt->tclass, 0, 0, STATE_NORMAL, ac->list[i]->tooltipstring, &temp_w, &temp_h, 17); TextSize(tt->tclass, 0, 0, STATE_NORMAL,
ac->list[i]->tooltipstring, &temp_w, &temp_h, 17);
if (temp_w > labels_width) if (temp_w > labels_width)
labels_width = temp_w; labels_width = temp_w;
temp_w = 0; temp_w = 0;
if (ac->list[i]->event == EVENT_DOUBLE_DOWN) if (ac->list[i]->event == EVENT_DOUBLE_DOWN)
{ {
TextSize(tt->tclass, 0, 0, STATE_NORMAL, "2x", &double_w, &temp_h, 17); TextSize(tt->tclass, 0, 0, STATE_NORMAL, "2x", &double_w,
&temp_h, 17);
if (cols[0] < double_w) if (cols[0] < double_w)
cols[0] = double_w; cols[0] = double_w;
} }
if (ac->list[i]->anybutton) if (ac->list[i]->anybutton)
{ {
ic = FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_any.png"; ic->norm.normal->im_file = "pix/mouse_any.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -193,71 +196,81 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
switch (ac->list[i]->button) switch (ac->list[i]->button)
{ {
case 1: case 1:
ic = FindItem("TOOLTIP_MOUSEBUTTON_1", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_1", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_1.png"; ic->norm.normal->im_file = "pix/mouse_1.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_1", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_1", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
break; break;
case 2: case 2:
ic = FindItem("TOOLTIP_MOUSEBUTTON_2", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_2", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_2.png"; ic->norm.normal->im_file = "pix/mouse_2.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_2", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_2", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
break; break;
case 3: case 3:
ic = FindItem("TOOLTIP_MOUSEBUTTON_3", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_3", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_3.png"; ic->norm.normal->im_file = "pix/mouse_3.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_3", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_3", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
break; break;
case 4: case 4:
ic = FindItem("TOOLTIP_MOUSEBUTTON_4", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_4", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_4.png"; ic->norm.normal->im_file = "pix/mouse_4.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_4", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_4", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
break; break;
case 5: case 5:
ic = FindItem("TOOLTIP_MOUSEBUTTON_5", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_5", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_5.png"; ic->norm.normal->im_file = "pix/mouse_5.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_5", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_MOUSEBUTTON_5", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -281,15 +294,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{ {
if (ac->list[i]->modifiers & ShiftMask) if (ac->list[i]->modifiers & ShiftMask)
{ {
ic = FindItem("TOOLTIP_KEY_SHIFT", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_SHIFT", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_shift.png"; ic->norm.normal->im_file = "pix/key_shift.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_SHIFT", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_SHIFT", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -303,15 +318,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & LockMask) if (ac->list[i]->modifiers & LockMask)
{ {
ic = FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_lock.png"; ic->norm.normal->im_file = "pix/key_lock.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_LOCK", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_LOCK", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -325,15 +342,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & ControlMask) if (ac->list[i]->modifiers & ControlMask)
{ {
ic = FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_ctrl.png"; ic->norm.normal->im_file = "pix/key_ctrl.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_CTRL", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_CTRL", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -347,15 +366,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & Mod1Mask) if (ac->list[i]->modifiers & Mod1Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod1.png"; ic->norm.normal->im_file = "pix/key_mod1.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD1", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_MOD1", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -369,15 +390,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & Mod2Mask) if (ac->list[i]->modifiers & Mod2Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod2.png"; ic->norm.normal->im_file = "pix/key_mod2.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD2", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_MOD2", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -391,15 +414,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & Mod3Mask) if (ac->list[i]->modifiers & Mod3Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod3.png"; ic->norm.normal->im_file = "pix/key_mod3.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD3", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_MOD3", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -413,15 +438,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & Mod4Mask) if (ac->list[i]->modifiers & Mod4Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod4.png"; ic->norm.normal->im_file = "pix/key_mod4.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD4", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_MOD4", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -435,15 +462,17 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
} }
if (ac->list[i]->modifiers & Mod5Mask) if (ac->list[i]->modifiers & Mod5Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic) if (!ic)
{ {
ic = CreateIclass(); ic = CreateIclass();
ic->norm.normal = CreateImageState(); ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod5.png"; ic->norm.normal->im_file = "pix/key_mod5.png";
IclassPopulate(ic); IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD5", 0, LIST_TYPE_ICLASS); AddItem(ic, "TOOLTIP_KEY_MOD5", 0,
LIST_TYPE_ICLASS);
} }
if (ic->norm.normal) if (ic->norm.normal)
ImageStateRealize(ic->norm.normal); ImageStateRealize(ic->norm.normal);
@ -618,8 +647,7 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
/* draw the ordinary tooltip text */ /* draw the ordinary tooltip text */
TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, text, TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, text,
xx, tt->iclass->padding.top, xx, tt->iclass->padding.top, headline_w, headline_h, 17, 512);
headline_w, headline_h, 17, 512);
/* draw the icons and labels, if any */ /* draw the icons and labels, if any */
if (ac) if (ac)
@ -635,19 +663,27 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
if (ac->list[i]->event == EVENT_DOUBLE_DOWN) if (ac->list[i]->event == EVENT_DOUBLE_DOWN)
{ {
TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, "2x", TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, "2x",
xx + iw - double_w, y, double_w, heights[i], 17, 0); xx + iw - double_w, y, double_w, heights[i], 17,
0);
} }
if (ac->list[i]->anybutton) if (ac->list[i]->anybutton)
{ {
ic = FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->im),
x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
@ -655,67 +691,102 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
switch (ac->list[i]->button) switch (ac->list[i]->button)
{ {
case 1: case 1:
ic = FindItem("TOOLTIP_MOUSEBUTTON_1", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_1", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
break; break;
case 2: case 2:
ic = FindItem("TOOLTIP_MOUSEBUTTON_2", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_2", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
break; break;
case 3: case 3:
ic = FindItem("TOOLTIP_MOUSEBUTTON_3", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_3", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
break; break;
case 4: case 4:
ic = FindItem("TOOLTIP_MOUSEBUTTON_4", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_4", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
break; break;
case 5: case 5:
ic = FindItem("TOOLTIP_MOUSEBUTTON_5", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_MOUSEBUTTON_5", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->rgb_height);
Imlib_copy_mask(id, ic->norm.normal->im), x, y); PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.normal->
im),
Imlib_copy_mask(id,
ic->norm.normal->
im), x, y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
break; break;
@ -727,119 +798,192 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{ {
if (ac->list[i]->modifiers & ShiftMask) if (ac->list[i]->modifiers & ShiftMask)
{ {
ic = FindItem("TOOLTIP_KEY_SHIFT", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_SHIFT", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & LockMask) if (ac->list[i]->modifiers & LockMask)
{ {
ic = FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & ControlMask) if (ac->list[i]->modifiers & ControlMask)
{ {
ic = FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & Mod1Mask) if (ac->list[i]->modifiers & Mod1Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & Mod2Mask) if (ac->list[i]->modifiers & Mod2Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & Mod3Mask) if (ac->list[i]->modifiers & Mod3Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & Mod4Mask) if (ac->list[i]->modifiers & Mod4Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
if (ac->list[i]->modifiers & Mod5Mask) if (ac->list[i]->modifiers & Mod5Mask)
{ {
ic = FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME, ic =
LIST_TYPE_ICLASS); FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic) if (ic)
if (ic->norm.normal->im) if (ic->norm.normal->im)
{ {
Imlib_render(id, ic->norm.normal->im, Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height); ic->norm.normal->im->rgb_width,
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im), ic->norm.normal->im->
Imlib_copy_mask(id, ic->norm.normal->im), x, y); rgb_height);
PastePixmap(disp, tt->win,
Imlib_copy_image(id,
ic->norm.
normal->im),
Imlib_copy_mask(id,
ic->norm.
normal->im), x,
y);
x += ic->norm.normal->im->rgb_width; x += ic->norm.normal->im->rgb_width;
} }
} }
} }
TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, ac->list[i]->tooltipstring, TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL,
ac->list[i]->tooltipstring,
tt->iclass->padding.left + icons_width + iw, y, tt->iclass->padding.left + icons_width + iw, y,
labels_width, heights[i], 17, 0); labels_width, heights[i], 17, 0);
y += heights[i]; y += heights[i];

View File

@ -25,18 +25,16 @@
typedef struct _efont_color_tab EfontColorTable; typedef struct _efont_color_tab EfontColorTable;
struct _efont_color_tab struct _efont_color_tab
{ {
Colormap cmap; Colormap cmap;
XColor list[256]; XColor list[256];
unsigned char match[8][8][8]; unsigned char match[8][8][8];
}; };
/*static EfontColorTable *color_tab = NULL; */ /*static EfontColorTable *color_tab = NULL; */
static unsigned char alpha_lut[5] = static unsigned char alpha_lut[5] = { 0, 64, 128, 192, 255 };
{0, 64, 128, 192, 255}; static unsigned char bounded_palette[9] = { 0, 1, 2, 3, 4, 4, 4, 4, 4 };
static unsigned char bounded_palette[9] =
{0, 1, 2, 3, 4, 4, 4, 4, 4};
static TT_Raster_Map * static TT_Raster_Map *
create_font_raster(int width, int height) create_font_raster(int width, int height)
@ -196,9 +194,7 @@ render_text(TT_Raster_Map * rmap, TT_Raster_Map * rchr, Efont * f, char *text,
/* was unsigned. */ /* was unsigned. */
if (xmin >= (int)rmap->width || if (xmin >= (int)rmap->width ||
ymin >= (int)rmap->rows || ymin >= (int)rmap->rows || xmax < 0 || ymax < 0)
xmax < 0 ||
ymax < 0)
continue; continue;
/* Note that the clipping check is performed _after_ rendering */ /* Note that the clipping check is performed _after_ rendering */
@ -275,7 +271,9 @@ merge_text_16(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
cb = (col << 3) & 0xf8; cb = (col << 3) & 0xf8;
for (y = 0; y < xim->height; y++) for (y = 0; y < xim->height; y++)
{ {
ptr = (unsigned char *)rmap->bitmap + offset_x + ((y + offset_y) * rmap->cols); ptr =
(unsigned char *)rmap->bitmap + offset_x +
((y + offset_y) * rmap->cols);
for (x = 0; x < xim->width; x++) for (x = 0; x < xim->width; x++)
{ {
if ((a = alpha_lut[*ptr]) > 0) if ((a = alpha_lut[*ptr]) > 0)
@ -293,7 +291,9 @@ merge_text_16(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
ng = g + ((tmp + (tmp >> 8) + 0x80) >> 8); ng = g + ((tmp + (tmp >> 8) + 0x80) >> 8);
tmp = (cb - b) * a; tmp = (cb - b) * a;
nb = b + ((tmp + (tmp >> 8) + 0x80) >> 8); nb = b + ((tmp + (tmp >> 8) + 0x80) >> 8);
pixel = ((nr & 0xf8) << 8) | ((ng & 0xfc) << 3) | ((nb & 0xf8) >> 3); pixel =
((nr & 0xf8) << 8) | ((ng & 0xfc) << 3) | ((nb & 0xf8)
>> 3);
XPutPixel(xim, x, y, pixel); XPutPixel(xim, x, y, pixel);
} }
else else
@ -318,7 +318,9 @@ merge_text_15(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
cb = (col << 3) & 0xf8; cb = (col << 3) & 0xf8;
for (y = 0; y < xim->height; y++) for (y = 0; y < xim->height; y++)
{ {
ptr = (unsigned char *)rmap->bitmap + offset_x + ((y + offset_y) * rmap->cols); ptr =
(unsigned char *)rmap->bitmap + offset_x +
((y + offset_y) * rmap->cols);
for (x = 0; x < xim->width; x++) for (x = 0; x < xim->width; x++)
{ {
if ((a = alpha_lut[*ptr]) > 0) if ((a = alpha_lut[*ptr]) > 0)
@ -336,7 +338,9 @@ merge_text_15(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
ng = g + ((tmp + (tmp >> 8) + 0x80) >> 8); ng = g + ((tmp + (tmp >> 8) + 0x80) >> 8);
tmp = (cb - b) * a; tmp = (cb - b) * a;
nb = b + ((tmp + (tmp >> 8) + 0x80) >> 8); nb = b + ((tmp + (tmp >> 8) + 0x80) >> 8);
pixel = ((nr & 0xf8) << 7) | ((ng & 0xf8) << 2) | ((nb & 0xf8) >> 3); pixel =
((nr & 0xf8) << 7) | ((ng & 0xf8) << 2) | ((nb & 0xf8)
>> 3);
XPutPixel(xim, x, y, pixel); XPutPixel(xim, x, y, pixel);
} }
else else
@ -361,7 +365,9 @@ merge_text_24(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
cb = col & 0xff; cb = col & 0xff;
for (y = 0; y < xim->height; y++) for (y = 0; y < xim->height; y++)
{ {
ptr = (unsigned char *)rmap->bitmap + offset_x + ((y + offset_y) * rmap->cols); ptr =
(unsigned char *)rmap->bitmap + offset_x +
((y + offset_y) * rmap->cols);
for (x = 0; x < xim->width; x++) for (x = 0; x < xim->width; x++)
{ {
if ((a = alpha_lut[*ptr]) > 0) if ((a = alpha_lut[*ptr]) > 0)
@ -438,7 +444,9 @@ merge_text_1(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
for (y = 0; y < xim->height; y++) for (y = 0; y < xim->height; y++)
{ {
ptr = (unsigned char *)rmap->bitmap + offset_x + ((y + offset_y) * rmap->cols); ptr =
(unsigned char *)rmap->bitmap + offset_x +
((y + offset_y) * rmap->cols);
for (x = 0; x < xim->width; x++) for (x = 0; x < xim->width; x++)
{ {
if (alpha_lut[*ptr] > 2) if (alpha_lut[*ptr] > 2)
@ -511,8 +519,7 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{ {
XGetWindowAttributes(disp, xatt.root, &ratt); XGetWindowAttributes(disp, xatt.root, &ratt);
XTranslateCoordinates(disp, win, xatt.root, 0, 0, &rx, &ry, &chld); XTranslateCoordinates(disp, win, xatt.root, 0, 0, &rx, &ry, &chld);
if ((xatt.map_state != IsViewable) && if ((xatt.map_state != IsViewable) && (xatt.backing_store == NotUseful))
(xatt.backing_store == NotUseful))
{ {
destroy_font_raster(rmap); destroy_font_raster(rmap);
destroy_font_raster(rtmp); destroy_font_raster(rtmp);
@ -596,7 +603,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{ {
shm = 0; shm = 0;
XDestroyImage(xim); XDestroyImage(xim);
xim = XGetImage(disp, win, x, y, width, height, 0xffffffff, ZPixmap); xim =
XGetImage(disp, win, x, y, width, height, 0xffffffff,
ZPixmap);
XSetErrorHandler((XErrorHandler) erh); XSetErrorHandler((XErrorHandler) erh);
shm_checked = 1; shm_checked = 1;
} }
@ -608,7 +617,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{ {
shm = 0; shm = 0;
XDestroyImage(xim); XDestroyImage(xim);
xim = XGetImage(disp, win, x, y, width, height, 0xffffffff, ZPixmap); xim =
XGetImage(disp, win, x, y, width, height, 0xffffffff,
ZPixmap);
XSetErrorHandler((XErrorHandler) erh); XSetErrorHandler((XErrorHandler) erh);
shm_checked = 1; shm_checked = 1;
} }
@ -628,7 +639,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{ {
shm = 0; shm = 0;
XDestroyImage(xim); XDestroyImage(xim);
xim = XGetImage(disp, win, x, y, width, height, 0xffffffff, ZPixmap); xim =
XGetImage(disp, win, x, y, width, height, 0xffffffff,
ZPixmap);
XSetErrorHandler((XErrorHandler) erh); XSetErrorHandler((XErrorHandler) erh);
shm_checked = 1; shm_checked = 1;
} }
@ -646,7 +659,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{ {
shm = 0; shm = 0;
XDestroyImage(xim); XDestroyImage(xim);
xim = XGetImage(disp, win, x, y, width, height, 0xffffffff, ZPixmap); xim =
XGetImage(disp, win, x, y, width, height, 0xffffffff,
ZPixmap);
shm_checked = 1; shm_checked = 1;
} }
XSetErrorHandler((XErrorHandler) erh); XSetErrorHandler((XErrorHandler) erh);
@ -694,8 +709,7 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
merge_text_1(xim, rmap, clipx, clipy, col); merge_text_1(xim, rmap, clipx, clipy, col);
if (shm) if (shm)
XShmPutImage(disp, win, gc, xim, 0, 0, x, y, XShmPutImage(disp, win, gc, xim, 0, 0, x, y, width, height, False);
width, height, False);
else else
XPutImage(disp, win, gc, xim, 0, 0, x, y, width, height); XPutImage(disp, win, gc, xim, 0, 0, x, y, width, height);
destroy_font_raster(rmap); destroy_font_raster(rmap);
@ -880,7 +894,8 @@ Efont_extents(Efont * f, char *text, int *font_ascent_return,
if (text[i + 1] == 0) if (text[i + 1] == 0)
{ {
if (rbearing_return) if (rbearing_return)
*rbearing_return = ((gmetrics.bbox.xMax - gmetrics.advance) / 64); *rbearing_return =
((gmetrics.bbox.xMax - gmetrics.advance) / 64);
} }
pw += gmetrics.advance / 64; pw += gmetrics.advance / 64;
} }

View File

@ -163,7 +163,8 @@ CheckForNewMOTD(int val, void *data)
if (MOTD) if (MOTD)
{ {
DIALOG_OK("Enlightenment's message of the day", MOTD); DIALOG_OK(gettext("Enlightenment's message of the day"),
MOTD);
Efree(MOTD); Efree(MOTD);
} }
} }

View File

@ -129,8 +129,7 @@ WarpFocus(int delta)
lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING); lst = (EWin **) ListItemType(&num, LIST_TYPE_WARP_RING);
if (!lst) if (!lst)
{ {
num0 = desks.desk[desks.current].num; lst0 = (EWin **) ListItemType(&num0, LIST_TYPE_EWIN);
lst0 = desks.desk[desks.current].list;
num = 0; num = 0;
lst = NULL; lst = NULL;
if (lst0) if (lst0)
@ -142,9 +141,9 @@ WarpFocus(int delta)
(ewin->x + ewin->w > 0) && (ewin->x < root.w) && (ewin->x + ewin->w > 0) && (ewin->x < root.w) &&
(ewin->y + ewin->h > 0) && (ewin->y < root.h) && (ewin->y + ewin->h > 0) && (ewin->y < root.h) &&
(!ewin->skipfocus) && (!ewin->shaded) && (!ewin->skipfocus) && (!ewin->shaded) &&
(!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->menu) && (!ewin->pager) && (!ewin->ibox) && (!ewin->iconified) /*&& (ewin->client.mwm_decor_title) &&
(!ewin->iconified) /*&& (ewin->client.mwm_decor_title) && * (ewin->client.mwm_decor_border) */
* (ewin->client.mwm_decor_border) */ ) )
AddItem(ewin, "", 0, LIST_TYPE_WARP_RING); AddItem(ewin, "", 0, LIST_TYPE_WARP_RING);
} }
} }
@ -164,7 +163,8 @@ WarpFocus(int delta)
if (mode.raise_on_next_focus) if (mode.raise_on_next_focus)
RaiseEwin(ewin); RaiseEwin(ewin);
if (mode.warp_on_next_focus) if (mode.warp_on_next_focus)
XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2,
ewin->h / 2);
/* if (mode.focusmode == FOCUS_CLICK) */ /* if (mode.focusmode == FOCUS_CLICK) */
/* FocusToEWin(ewin); */ /* FocusToEWin(ewin); */
} }
@ -194,7 +194,8 @@ WarpFocusFinish(void)
FocusToEWin(ewin); FocusToEWin(ewin);
if (mode.warp_after_next_focus || mode.warp_on_next_focus) if (mode.warp_after_next_focus || mode.warp_on_next_focus)
{ {
XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2, ewin->h / 2); XWarpPointer(disp, None, ewin->win, 0, 0, 0, 0, ewin->w / 2,
ewin->h / 2);
} }
if (mode.raise_after_next_focus) if (mode.raise_after_next_focus)
RaiseEwin(ewin); RaiseEwin(ewin);
@ -244,7 +245,8 @@ WarpFocusShowTitle(EWin * ewin)
warptitles = warptitles =
Erealloc(warptitles, (sizeof(Window) * warptitles_num)); Erealloc(warptitles, (sizeof(Window) * warptitles_num));
warptitles_ewin = warptitles_ewin =
Erealloc(warptitles_ewin, (sizeof(EWin *) * warptitles_num)); Erealloc(warptitles_ewin,
(sizeof(EWin *) * warptitles_num));
warptitles[warptitles_num - 1] = warptitles[warptitles_num - 1] =
ECreateWindow(warpFocusTitleWindow, 0, 0, 1, 1, 0); ECreateWindow(warpFocusTitleWindow, 0, 0, 1, 1, 0);
EMapWindow(disp, warptitles[warptitles_num - 1]); EMapWindow(disp, warptitles[warptitles_num - 1]);
@ -285,7 +287,8 @@ WarpFocusShowTitle(EWin * ewin)
{ {
if (ewin == warptitles_ewin[i]) if (ewin == warptitles_ewin[i])
{ {
IclassApply(ic, warptitles[i], mw, mh, 0, 0, STATE_CLICKED, 0); IclassApply(ic, warptitles[i], mw, mh, 0, 0, STATE_CLICKED,
0);
TclassApply(ic, warptitles[i], mw, mh, 0, 0, STATE_CLICKED, 0, TclassApply(ic, warptitles[i], mw, mh, 0, 0, STATE_CLICKED, 0,
tc, warptitles_ewin[i]->client.title); tc, warptitles_ewin[i]->client.title);
} }

View File

@ -143,7 +143,7 @@ MatchEwinDesktop(EWin * ewin, WindowMatch * b)
void * void *
MatchEwinByFunction(EWin * ewin, MatchEwinByFunction(EWin * ewin,
void * (*FunctionToTest) (EWin *, WindowMatch *)) void *(*FunctionToTest) (EWin *, WindowMatch *))
{ {
WindowMatch **lst; WindowMatch **lst;
int i, num; int i, num;

25
src/x.c
View File

@ -40,8 +40,7 @@ EFreePixmap(Display * display, Pixmap pixmap)
XFreePixmap(display, pixmap); XFreePixmap(display, pixmap);
} }
Window Window ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
{ {
EXID *xid; EXID *xid;
Window win; Window win;
@ -63,8 +62,7 @@ ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
win = XCreateWindow(disp, parent, x, y, w, h, 0, root.depth, win = XCreateWindow(disp, parent, x, y, w, h, 0, root.depth,
InputOutput, root.vis, CWOverrideRedirect | InputOutput, root.vis, CWOverrideRedirect |
CWSaveUnder | CWBackingStore | CWColormap | CWSaveUnder | CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel, CWBackPixmap | CWBorderPixel, &attr);
&attr);
xid = NewXID(); xid = NewXID();
xid->parent = parent; xid->parent = parent;
xid->win = win; xid->win = win;
@ -261,8 +259,7 @@ EShapeCombineRectangles(Display * d, Window win, int dest, int x, int y,
{ {
if ((rect[0].x == 0) && if ((rect[0].x == 0) &&
(rect[0].y == 0) && (rect[0].y == 0) &&
(rect[0].width == xid->w) && (rect[0].width == xid->w) && (rect[0].height == xid->h))
(rect[0].height == xid->h))
{ {
xid->num_rect = 0; xid->num_rect = 0;
XFree(xid->rects); XFree(xid->rects);
@ -589,8 +586,7 @@ DelXID(Window win)
} }
} }
Window Window ECreateEventWindow(Window parent, int x, int y, int w, int h)
ECreateEventWindow(Window parent, int x, int y, int w, int h)
{ {
Window win; Window win;
XSetWindowAttributes attr; XSetWindowAttributes attr;
@ -606,8 +602,7 @@ ECreateEventWindow(Window parent, int x, int y, int w, int h)
* create a window which will accept the keyboard focus when no other * create a window which will accept the keyboard focus when no other
* windows have it * windows have it
*/ */
Window Window ECreateFocusWindow(Window parent, int x, int y, int w, int h)
ECreateFocusWindow(Window parent, int x, int y, int w, int h)
{ {
Window win; Window win;
XSetWindowAttributes attr; XSetWindowAttributes attr;
@ -741,8 +736,7 @@ WinExists(Window win)
EDBUG_RETURN(0); EDBUG_RETURN(0);
} }
Window Window WindowAtXY_0(Window base, int bx, int by, int x, int y)
WindowAtXY_0(Window base, int bx, int by, int x, int y)
{ {
Window *list = NULL; Window *list = NULL;
XWindowAttributes att; XWindowAttributes att;
@ -767,9 +761,7 @@ WindowAtXY_0(Window base, int bx, int by, int x, int y)
wy += by; wy += by;
if (!((x >= wx) && if (!((x >= wx) &&
(y >= wy) && (y >= wy) && (x < (int)(wx + ww)) && (y < (int)(wy + wh))))
(x < (int)(wx + ww)) &&
(y < (int)(wy + wh))))
EDBUG_RETURN(0); EDBUG_RETURN(0);
if (!XQueryTree(disp, base, &root_win, &parent_win, &list, &num)) if (!XQueryTree(disp, base, &root_win, &parent_win, &list, &num))
@ -791,8 +783,7 @@ WindowAtXY_0(Window base, int bx, int by, int x, int y)
EDBUG_RETURN(base); EDBUG_RETURN(base);
} }
Window Window WindowAtXY(int x, int y)
WindowAtXY(int x, int y)
{ {
Window *list = NULL; Window *list = NULL;
Window child = 0, parent_win = 0, root_win = 0; Window child = 0, parent_win = 0, root_win = 0;

View File

@ -95,15 +95,13 @@ SwitchRes(char inout, int x, int y, int w, int h)
if (inout) if (inout)
{ {
if (!XF86VidModeGetModeLine(disp, root.scr, if (!XF86VidModeGetModeLine(disp, root.scr, &dotclock, &curmode))
&dotclock, &curmode))
return 0; return 0;
mode = FindMode(w, h); mode = FindMode(w, h);
if (mode) if (mode)
{ {
jump = GetModeJumpCount(mode); jump = GetModeJumpCount(mode);
XWarpPointer(disp, None, root.win, XWarpPointer(disp, None, root.win, 0, 0, 0, 0, x, y);
0, 0, 0, 0, x, y);
XF86VidModeSetViewPort(disp, root.scr, x, y); XF86VidModeSetViewPort(disp, root.scr, x, y);
XF86VidModeLockModeSwitch(disp, root.scr, 0); XF86VidModeLockModeSwitch(disp, root.scr, 0);
for (i = 0; i < jump; i++) for (i = 0; i < jump; i++)
@ -203,8 +201,7 @@ Zoom(EWin * ewin)
zoom_last_x = ewin->x; zoom_last_x = ewin->x;
zoom_last_y = ewin->y; zoom_last_y = ewin->y;
RaiseEwin(ewin); RaiseEwin(ewin);
MoveEwin(ewin, -ewin->border->border.left, MoveEwin(ewin, -ewin->border->border.left, -ewin->border->border.top);
-ewin->border->border.top);
ICCCM_Configure(ewin); ICCCM_Configure(ewin);
FocusToEWin(ewin); FocusToEWin(ewin);
/* XGrabPointer(disp, ewin->client.win, False, 0, /* XGrabPointer(disp, ewin->client.win, False, 0,