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)
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
LDADD = \
@INTLLIBS@ \
$(FNLIB_LIBS) \
$(TTF_LIBS) \
$(ESD_LIBS) \
@ -103,7 +104,7 @@ LDADD = \
$(DL_LIBS) \
-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@\"

View File

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

View File

@ -42,7 +42,7 @@ int debug_level;
char *call_stack[1024];
void
Alert(char *fmt,...)
Alert(char *fmt, ...)
{
char text[10240];
va_list ap;
@ -175,13 +175,13 @@ ShowAlert(char *text)
str2 = RestartText;
str3 = ExitText;
if (!title)
title = "Enlightenment Error";
title = gettext("Enlightenment Error");
if (!str1)
str1 = "Ignore";
str1 = gettext("Ignore");
if (!str2)
str2 = "Restart";
str2 = gettext("Restart");
if (!str3)
str3 = "Exit";
str3 = gettext("Exit");
#define DRAW_BOX_OUT(mdd, mgc, mwin, mx, my, mw, mh) \
if (colorful) { \
@ -308,7 +308,9 @@ goto CN; \
hih = DisplayHeight(dd, DefaultScreen(dd));
w = (wid - 600) / 2;
h = (hih - 440) / 2;
mask = CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder | CWBackingStore;
mask =
CWBackPixel | CWBorderPixel | CWOverrideRedirect | CWSaveUnder |
CWBackingStore;
if (colorful)
att.background_pixel = cols[1];
else
@ -401,21 +403,24 @@ goto CN; \
h = XTextWidth(xfs, str1, strlen(str1));
w = 10 + (((580 - mh) * 0) / 4);
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)
{
h = XTextWidth(xfs, str2, strlen(str2));
w = 10 + (((580 - mh) * 1) / 2);
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)
{
h = XTextWidth(xfs, str3, strlen(str3));
w = 10 + (((580 - mh) * 2) / 2);
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);
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;
double tm;
struct _xy
{
int x, y;
}
{
int x, y;
}
*xy;
EDBUG(5, "SlideWindowsBy");
@ -224,8 +224,7 @@ SetCurrentArea(int ax, int ay)
EDBUG(4, "SetCurrentArea");
if ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) ||
(mode.mode == MODE_RESIZE_V))
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V))
EDBUG_RETURN_;
AREA_FIX(ax, ay);
@ -257,15 +256,15 @@ SetCurrentArea(int ax, int ay)
if ((mode.mode == MODE_MOVE) && (mode.ewin) && (mode.movemode > 0) &&
(!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++)
{
x = lst[i]->x;
y = lst[i]->y;
DrawEwinShape(lst[i], mode.movemode,
x, y,
lst[i]->client.w, lst[i]->client.h,
3);
x, y, lst[i]->client.w, lst[i]->client.h, 3);
}
Efree(lst);
}
@ -307,8 +306,12 @@ SetCurrentArea(int ax, int ay)
if (wl)
{
SlideWindowsBy(wl, wnum,
-(root.w * (ax - desks.desk[desks.current].current_area_x)),
-(root.h * (ay - desks.desk[desks.current].current_area_y)),
-(root.w *
(ax -
desks.desk[desks.current].current_area_x)),
-(root.h *
(ay -
desks.desk[desks.current].current_area_y)),
desks.slidespeed);
Efree(wl);
}
@ -331,8 +334,16 @@ SetCurrentArea(int ax, int ay)
mode.flipp = 1;
}
MoveEwin(lst[i],
lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)),
lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y)));
lst[i]->x -
(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)
mode.flipp = 0;
lst[i]->area_x = a1;
@ -360,8 +371,16 @@ SetCurrentArea(int ax, int ay)
{
GetWinXY(lst[i]->win, &x, &y);
EMoveWindow(disp, lst[i]->win,
x - (root.w * (ax - desks.desk[desks.current].current_area_x)),
y - (root.h * (ay - desks.desk[desks.current].current_area_y)));
x -
(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 */
@ -377,8 +396,16 @@ SetCurrentArea(int ax, int ay)
mode.flipp = 1;
}
MoveEwin(lst[i],
lst[i]->x - (root.w * (ax - desks.desk[desks.current].current_area_x)),
lst[i]->y - (root.h * (ay - desks.desk[desks.current].current_area_y)));
lst[i]->x -
(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)
mode.flipp = 0;
lst[i]->area_x = a1;
@ -422,12 +449,12 @@ SetCurrentArea(int ax, int ay)
if (mode.movemode == 5)
DrawEwinShape(lst[i], mode.movemode,
x, y,
lst[i]->client.w, lst[i]->client.h,
lst[i]->client.w, lst[i]->client.h,
4);
else
DrawEwinShape(lst[i], mode.movemode,
x, y,
lst[i]->client.w, lst[i]->client.h,
lst[i]->client.w, lst[i]->client.h,
0);
if (mode.flipp)
{

View File

@ -210,11 +210,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (sorted[j].x < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x);
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)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y);
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 */
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++)
{
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;
}
}
@ -355,11 +358,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (a1 >= 0)
sorted[num_sorted].x = spaces[k].x;
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)
sorted[num_sorted].y = spaces[k].y;
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
{
@ -391,11 +396,13 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
if (sorted[j].x < width)
xsize = ArrangeAddToList(&xarray, xsize, sorted[j].x);
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)
ysize = ArrangeAddToList(&yarray, ysize, sorted[j].y);
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 */
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++)
{
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;
}
}
@ -609,8 +617,7 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
ody = dy;
if (dx < 0)
{
if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist)
&& (ewin->x >= 0))
if (IN_BELOW(ewin->x + dx, 0, screen_snap_dist) && (ewin->x >= 0))
dx = 0 - ewin->x;
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) ||
(lst[i]->sticky)) &&
(!(lst[i]->floating)) &&
(!(lst[i]->iconified)) &&
(!(lst[i]->ignorearrange)))
(!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
{
if (IN_BELOW(ewin->x + dx, lst[i]->x + lst[i]->w - 1,
mode.edge_snap_dist) &&
SPANS_COMMON(ewin->y, ewin->h, lst[i]->y, lst[i]->h)
if (IN_BELOW
(ewin->x + dx, lst[i]->x + lst[i]->w - 1,
mode.edge_snap_dist)
&& SPANS_COMMON(ewin->y, ewin->h, lst[i]->y,
lst[i]->h)
&& (ewin->x >= (lst[i]->x + lst[i]->w)))
{
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) ||
(lst[i]->sticky)) &&
(!(lst[i]->floating)) &&
(!(lst[i]->iconified)) &&
(!(lst[i]->ignorearrange)))
(!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
{
if (IN_ABOVE(ewin->x + ewin->w + dx - 1, lst[i]->x,
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))
{
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 (IN_BELOW(ewin->y + dy, 0, screen_snap_dist)
&& (ewin->y >= 0))
if (IN_BELOW(ewin->y + dy, 0, screen_snap_dist) && (ewin->y >= 0))
dy = 0 - ewin->y;
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) ||
(lst[i]->sticky)) &&
(!(lst[i]->floating)) &&
(!(lst[i]->iconified)) &&
(!(lst[i]->ignorearrange)))
(!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
{
if (IN_BELOW(ewin->y + dy, lst[i]->y + lst[i]->h - 1,
mode.edge_snap_dist) &&
SPANS_COMMON(ewin->x, ewin->w, lst[i]->x, lst[i]->w)
if (IN_BELOW
(ewin->y + dy, lst[i]->y + lst[i]->h - 1,
mode.edge_snap_dist)
&& SPANS_COMMON(ewin->x, ewin->w, lst[i]->x,
lst[i]->w)
&& (ewin->y >= (lst[i]->y + lst[i]->h)))
{
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) ||
(lst[i]->sticky)) &&
(!(lst[i]->floating)) &&
(!(lst[i]->iconified)) &&
(!(lst[i]->ignorearrange)))
(!(lst[i]->iconified)) && (!(lst[i]->ignorearrange)))
{
if (IN_ABOVE(ewin->y + ewin->h + dy - 1, lst[i]->y,
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))
{
dy = lst[i]->y - (ewin->y + ewin->h);
@ -773,10 +781,11 @@ ArrangeEwin(EWin * ewin)
{
if ((lst[i] != ewin) && (!lst[i]->iconified) &&
(!lst[i]->ignorearrange) && (lst[i]->layer != 0) &&
(((lst[i]->area_x == desks.desk[ewin->desktop].current_area_x) &&
(lst[i]->area_y == desks.desk[ewin->desktop].current_area_y) &&
(lst[i]->desktop == ewin->desktop)) ||
(lst[i]->sticky)))
(((lst
[i]->area_x == desks.desk[ewin->desktop].current_area_x)
&& (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].x = (lst[i])->x;

View File

@ -29,11 +29,11 @@
#define ARRANGE_BY_POSITION 2
typedef struct _rectbox
{
void *data;
int x, y, w, h;
int p;
}
{
void *data;
int x, y, w, h;
int p;
}
RectBox;
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,
length,
False, type,
&type_ret,
&format_ret,
&num_ret,
&bytes_after,
&retval);
&type_ret, &format_ret, &num_ret, &bytes_after, &retval);
if ((retval) && (num_ret > 0) && (format_ret > 0))
{
if (format_ret == 32)

View File

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

View File

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

View File

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

View File

@ -78,8 +78,8 @@ CommsFindCommsWindow()
if (comms_win)
{
XGetWindowProperty(disp, comms_win, a, 0, 14, False,
AnyPropertyType, &ar, &format, &num, &after,
&s);
AnyPropertyType, &ar, &format, &num,
&after, &s);
if (s)
XFree(s);
else
@ -382,8 +382,7 @@ void
HandleComms(XEvent * ev)
{
Client *c;
char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1,
*s2;
char *s, w[FILEPATH_LEN_MAX], w2[FILEPATH_LEN_MAX], *s1, *s2;
char sunknown[] = "UNKNOWN";
int unknown;
@ -699,7 +698,8 @@ HandleComms(XEvent * ev)
mod = 5;
else if (a->modifiers == (ShiftMask | Mod1Mask))
mod = 6;
else if (a->modifiers == (ShiftMask | ControlMask | Mod1Mask))
else if (a->modifiers ==
(ShiftMask | ControlMask | Mod1Mask))
mod = 7;
else if (a->modifiers == (Mod2Mask))
mod = 8;
@ -719,13 +719,15 @@ HandleComms(XEvent * ev)
mod = 15;
else if (a->modifiers == (Mod4Mask | ControlMask))
mod = 16;
else if (a->modifiers == (Mod4Mask | ControlMask | ShiftMask))
else if (a->modifiers ==
(Mod4Mask | ControlMask | ShiftMask))
mod = 17;
else if (a->modifiers == (Mod5Mask | ShiftMask))
mod = 18;
else if (a->modifiers == (Mod5Mask | ControlMask))
mod = 19;
else if (a->modifiers == (Mod5Mask | ControlMask | ShiftMask))
else if (a->modifiers ==
(Mod5Mask | ControlMask | ShiftMask))
mod = 20;
if (a->action->params)
Esnprintf(buf2, sizeof(buf2),
@ -737,7 +739,9 @@ HandleComms(XEvent * ev)
a->action->Type);
if (buf)
{
buf = Erealloc(buf, strlen(buf) + strlen(buf2) + 1);
buf =
Erealloc(buf,
strlen(buf) + strlen(buf2) + 1);
strcat(buf, buf2);
}
else
@ -877,8 +881,7 @@ HandleComms(XEvent * ev)
bg->pmap = 0;
for (i = 0; i < ENLIGHTENMENT_CONF_NUM_DESKTOPS; i++)
{
if ((desks.desk[i].bg == bg) &&
(desks.desk[i].viewable))
if ((desks.desk[i].bg == bg) && (desks.desk[i].viewable))
RefreshDesktop(i);
}
}
@ -1010,7 +1013,9 @@ HandleComms(XEvent * ev)
ModifyCMClass(name, rnum, rpx, rpy, gnum, gpx, gpy, bnum, bpx, bpy);
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);
}
Efree(name);
@ -1033,7 +1038,9 @@ HandleComms(XEvent * ev)
char buf[FILEPATH_LEN_MAX];
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)");
if (bg)
{
@ -1043,36 +1050,40 @@ HandleComms(XEvent * ev)
bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
bg->bg.file, bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc,
bg->top.file, bg->top.keep_aspect, bg->top.xjust,
bg->top.yjust, bg->top.xperc, bg->top.yperc);
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->bg.yperc, bg->top.file, bg->top.keep_aspect,
bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((!(bg->bg.file)) && (bg->top.file))
Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
"(null)", bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc,
bg->top.file, bg->top.keep_aspect, bg->top.xjust,
bg->top.yjust, bg->top.xperc, bg->top.yperc);
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->bg.yperc, bg->top.file, bg->top.keep_aspect,
bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((bg->bg.file) && (!(bg->top.file)))
Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
bg->bg.file, bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc,
"(null)", bg->top.keep_aspect, bg->top.xjust,
bg->top.yjust, bg->top.xperc, bg->top.yperc);
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->bg.yperc, "(null)", bg->top.keep_aspect,
bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
else if ((!(bg->bg.file)) && (!(bg->top.file)))
Esnprintf(buf, sizeof(buf),
"%s %i %i %i %s %i %i %i %i %i %i %s %i %i %i %i %i",
bg->name,
bg->bg.solid.r, bg->bg.solid.g, bg->bg.solid.b,
"(null)", bg->bg.tile, bg->bg.keep_aspect,
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc, bg->bg.yperc,
"(null)", bg->top.keep_aspect, bg->top.xjust,
bg->top.yjust, bg->top.xperc, bg->top.yperc);
bg->bg.xjust, bg->bg.yjust, bg->bg.xperc,
bg->bg.yperc, "(null)", bg->top.keep_aspect,
bg->top.xjust, bg->top.yjust, bg->top.xperc,
bg->top.yperc);
}
CommsSend(c, buf);
}
@ -1085,16 +1096,20 @@ HandleComms(XEvent * ev)
char *name = NULL, *bgf = NULL, *topf = NULL;
int updated = 0, tile, keep_aspect, tkeep_aspect;
int xjust, yjust, xperc, yperc, txjust, tyjust, txperc,
typerc;
typerc;
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;
i = sscanf(s, "%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i",
tmp, tmp,
&(icl.r), &(icl.g), &(icl.b), tmp, &tile, (int *)&keep_aspect,
&xjust, &yjust, &xperc, &yperc, tmp, &tkeep_aspect, &txjust,
&tyjust, &txperc, &typerc);
i =
sscanf(s,
"%1000s %1000s %i %i %i %1000s %i %i %i %i %i %i %1000s %i %i %i %i %i",
tmp, tmp, &(icl.r), &(icl.g), &(icl.b), tmp, &tile,
(int *)&keep_aspect, &xjust, &yjust, &xperc, &yperc, tmp,
&tkeep_aspect, &txjust, &tyjust, &txperc, &typerc);
if (bg)
{
name = duplicate(w);
@ -1216,7 +1231,9 @@ HandleComms(XEvent * ev)
Background *bg;
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)
SetBackgroundTo(id, win, bg, 0);
CommsSend(c, "done");
@ -1503,8 +1520,10 @@ HandleComms(XEvent * ev)
{
Button *b;
while ((b = RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME,
LIST_TYPE_BUTTON)))
while (
(b =
RemoveItem("_DESKTOP_DRAG_CONTROL", 0, LIST_FINDBY_NAME,
LIST_TYPE_BUTTON)))
DestroyButton(b);
InitDesktopControls();
ShowDesktopControls();
@ -1569,7 +1588,6 @@ HandleComms(XEvent * ev)
"SAVEUNDER: %i\n"
"MENUSLIDE: %i\n"
"NUMDESKTOPS: %i\n"
"DRAGDIR: %i\n"
"DRAGBARWIDTH: %i\n"
"DRAGBARORDERING: %i\n"
@ -1577,7 +1595,6 @@ HandleComms(XEvent * ev)
"DESKSLIDEIN: %i\n"
"DESKSLIDESPEED: %i\n"
"HIQUALITYBG: %i\n"
"TRANSIENTSFOLLOWLEADER: %i\n"
"SWITCHFORTRANSIENTMAP: %i\n"
"SHOWICONS: %i\n"
@ -1591,8 +1608,7 @@ HandleComms(XEvent * ev)
"DISPLAY_WARP: %i\n"
"WARP_ON_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.movemode, mode.resizemode, mode.slidemode,
mode.cleanupslide, mode.mapslide, mode.slidespeedmap,
@ -1603,11 +1619,9 @@ HandleComms(XEvent * ev)
mode.autoraise, mode.autoraisetime,
mode.dockstartx, mode.dockstarty, mode.save_under,
mode.menuslide, mode.numdesktops,
desks.dragdir, desks.dragbar_width,
desks.dragbar_ordering, desks.dragbar_length, desks.slidein,
desks.slidespeed, desks.hiqualitybg,
mode.transientsfollowleader, mode.switchfortransientmap,
mode.showicons, a, b,
mode.all_new_windows_get_focus,
@ -1618,9 +1632,7 @@ HandleComms(XEvent * ev)
mode.raise_after_next_focus,
mode.display_warp,
mode.warp_on_next_focus,
mode.warp_after_next_focus,
mode.edge_flip_resistance
);
mode.warp_after_next_focus, mode.edge_flip_resistance);
CommsSend(c, buf);
}
else if (!strcmp(w, "call_raw"))
@ -1739,56 +1751,7 @@ HandleComms(XEvent * ev)
"MWM_TITLE: %5i\n"
"MWM_MENU: %5i\n"
"MWM_MINIMIZE: %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,
"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,
ewin->client.aspect_min,
ewin->client.aspect_max,
ewin->client.mwm_decor_border,
@ -1970,7 +1933,9 @@ HandleComms(XEvent * ev)
}
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;
int i, num;
@ -2248,12 +2213,11 @@ HandleComms(XEvent * ev)
{
char buf[FILEPATH_LEN_MAX];
Esnprintf(buf, sizeof(buf), "Received Unknown Client Message.\n"
"Client Name: %s\n"
"Client Version: %s\n"
"Message Contents:\n\n"
"%s\n", s1, s2, s);
DIALOG_OK("E IPC Error", buf);
Esnprintf(buf, sizeof(buf),
gettext("Received Unknown Client Message.\n"
"Client Name: %s\n" "Client Version: %s\n"
"Message Contents:\n\n" "%s\n"), s1, s2, s);
DIALOG_OK(gettext("E IPC Error"), buf);
AUDIO_PLAY("SOUND_ERROR_IPC");
}
}

View File

@ -128,6 +128,7 @@
#define CONTROL_KDESUPPORT 1366
#define CONTROL_CLICK_ALWAYS 1367
#define CONTROL_SHOWROOTTOOLTIP 1368
#define CONTROL_PAGER_BUTTONS 1369
#define ICLASS_NAME 350
#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
{
bc->ButtonList = Erealloc(bc->ButtonList,
(bc->numofbuttonsinlist + 1) * sizeof(Container *));
(bc->numofbuttonsinlist +
1) * sizeof(Container *));
}
bc->ButtonList[bc->numofbuttonsinlist++] = b;
b->ref_count++;
@ -103,7 +104,8 @@ RemoveButtonFromContainer(Container * bc, Button * b)
if (found && ((bc->numofbuttonsinlist - 1) > 0))
{
bc->ButtonList = Erealloc(bc->ButtonList,
(bc->numofbuttonsinlist * sizeof(Container *)));
(bc->numofbuttonsinlist *
sizeof(Container *)));
for (i = 0; i <= bc->numofbuttonsinlist; i++)
{
if (i != j)

View File

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

View File

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

View File

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

View File

@ -98,7 +98,7 @@ HandleDrawQueue()
for (i = 0; i < num; i++)
{
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)
{
@ -200,8 +200,7 @@ HandleDrawQueue()
else if (lst[i]->iclass)
{
IclassApply(lst[i]->iclass, lst[i]->win, lst[i]->w, lst[i]->h,
lst[i]->active, lst[i]->sticky, lst[i]->state,
0);
lst[i]->active, lst[i]->sticky, lst[i]->state, 0);
/* printf("I %x\n", lst[i]->win); */
}
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);
XSetForeground(disp, gcm, 0);
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);
}
XSetClipOrigin(disp, gc, x, y);
@ -437,7 +437,8 @@ EBlendRemoveShape(EWin * ewin, Pixmap pmap, int x, int y)
}
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 i, j;
@ -521,7 +522,8 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++;
p2 = *ptr2++;
*ptr3++ = ((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) +
*ptr3++ =
((p1 >> 1) & 0x7f7f7f7f) + ((p2 >> 1) & 0x7f7f7f7f) +
(p1 & p2 & 0x01010101);
}
}
@ -570,12 +572,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++;
p2 = *ptr2++;
*ptr3++ =
((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) +
((p2 >> 1) & ((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)));
((p1 >> 1) &
((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 <<
13))) +
((p2 >> 1) &
((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
@ -587,12 +594,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++;
p2 = *ptr2++;
*ptr3++ =
((p1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 << 13))) +
((p2 >> 1) & ((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)));
((p1 >> 1) &
((0x78 << 8) | (0x7c << 3) | (0x78 >> 3) |
(0x78 << 24) | (0x7c << 19) | (0x78 <<
13))) +
((p2 >> 1) &
((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;
@ -603,9 +615,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
pptr3 = (unsigned short *)ptr3;
pp1 = *pptr1;
pp2 = *pptr2;
*pptr3 = ((pp1 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) +
((pp2 >> 1) & ((0x78 << 8) | (0x7c << 3) | (0x78 >> 3))) +
(pp1 & pp2 & ((0x1 << 11) | (0x1 << 5) | (0x1)));
*pptr3 =
((pp1 >> 1) &
((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++;
p2 = *ptr2++;
*ptr3++ =
((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) +
((p2 >> 1) & ((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)));
((p1 >> 1) &
((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 <<
13))) +
((p2 >> 1) &
((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
@ -654,12 +675,17 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
p1 = *ptr1++;
p2 = *ptr2++;
*ptr3++ =
((p1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 << 13))) +
((p2 >> 1) & ((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)));
((p1 >> 1) &
((0x78 << 7) | (0x78 << 2) | (0x78 >> 3) |
(0x78 << 23) | (0x78 << 18) | (0x78 <<
13))) +
((p2 >> 1) &
((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;
@ -670,9 +696,13 @@ EBlendPixImg(EWin * ewin, PixImg * s1, PixImg * s2, PixImg * dst, int x, int y,
pptr3 = (unsigned short *)ptr3;
pp1 = *pptr1;
pp2 = *pptr2;
*pptr3++ = ((pp1 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) +
((pp2 >> 1) & ((0x78 << 7) | (0x78 << 2) | (0x78 >> 3))) +
(pp1 & pp2 & ((0x1 << 10) | (0x1 << 5) | (0x1)));
*pptr3++ =
((pp1 >> 1) &
((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) ||
(mode.mode == MODE_RESIZE_H) ||
(mode.mode == MODE_RESIZE_V))
(mode.mode == MODE_RESIZE_H) || (mode.mode == MODE_RESIZE_V))
{
w1 = ewin->client.w;
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)
&& ((mode.mode == MODE_RESIZE) ||
(mode.mode == MODE_RESIZE_H) ||
(mode.mode == MODE_RESIZE_V) ||
(ewin->groups && check_move)))
(mode.mode == MODE_RESIZE_V) || (ewin->groups && check_move)))
md = 0;
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);
if (mode.mode != MODE_NONE)
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
break;
case 1:
case 2:
@ -856,16 +886,13 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
case 5:
if (!b1)
b1 = XCreateBitmapFromData(disp, root.win, flipped_gray_bits,
flipped_gray_width,
flipped_gray_height);
flipped_gray_width, flipped_gray_height);
if (!b2)
b2 = XCreateBitmapFromData(disp, root.win, gray_bits,
gray_width,
gray_height);
gray_width, gray_height);
if (!b3)
b3 = XCreateBitmapFromData(disp, root.win, gray3_bits,
gray3_width,
gray3_height);
gray3_width, gray3_height);
x1 = ewin->x + desks.desk[ewin->desktop].x;
y1 = ewin->y + desks.desk[ewin->desktop].y;
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.h = h;
ICCCM_MatchSize(ewin);
ewin->w = ewin->client.w + ewin->border->border.left + ewin->border->border.right;
ewin->h = ewin->client.h + ewin->border->border.top + ewin->border->border.bottom;
ewin->w =
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);
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)
gcv.foreground = BlackPixel(disp, root.scr);
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) \
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) &&
(!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2)
{
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) &&
(!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2)
{
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) &&
(!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2)
{
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) &&
(!ewin->groups || (ewin->groups && !check_move)))
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
if (firstlast < 2)
{
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;
UngrabX();
DrawEwinShape(ewin, mode.movemode, x, y, w, h, firstlast);
DrawEwinShape(ewin, mode.movemode, x, y, w, h,
firstlast);
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);
XCopyArea(disp, root_pi->pmap, ewin_pi->pmap, gc, x1, y1,
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)
EFillPixmap(root.win, root_pi->pmap, x, y, -dx, ht);
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)
EFillPixmap(root.win, root_pi->pmap, x, y, wt, -dy);
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
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)
EPastePixmap(root.win, root_pi->pmap, x1, y1, dx, ht);
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)
EPastePixmap(root.win, root_pi->pmap, x1, y1, wt, dy);
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
{
@ -1169,7 +1216,8 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
}
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)
EDestroyPixImg(ewin_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)
SetCoords(ewin->x, ewin->y,
(ewin->client.w - ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h - ewin->client.base_h) / ewin->client.h_inc);
(ewin->client.w -
ewin->client.base_w) / ewin->client.w_inc,
(ewin->client.h -
ewin->client.base_h) / ewin->client.h_inc);
}
if (firstlast == 2)
{
/* If we're moving a group, don't do this,
* 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)
MoveEwin(ewin, ewin->x, ewin->y);
@ -1321,13 +1372,16 @@ PropagateShapes(Window win)
if ((att.class == InputOutput) && (att.map_state != IsUnmapped))
{
rl = NULL;
rl = EShapeGetRectangles(disp, list[i], ShapeBounding, &rn, &ord);
rl =
EShapeGetRectangles(disp, list[i], ShapeBounding, &rn,
&ord);
if (rl)
{
num_rects += rn;
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 */
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].y = y + rl[k].y;
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);
@ -1355,8 +1410,8 @@ PropagateShapes(Window win)
/* set the rects as the shape mask */
if (rects)
{
EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects, num_rects,
ShapeSet, Unsorted);
EShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rects,
num_rects, ShapeSet, Unsorted);
Efree(rects);
rl = NULL;
rl = EShapeGetRectangles(disp, win, ShapeBounding, &rn, &ord);
@ -1375,7 +1430,8 @@ PropagateShapes(Window win)
Efree(rl);
}
else
EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None, ShapeSet);
EShapeCombineMask(disp, win, ShapeBounding, 0, 0, None,
ShapeSet);
}
XFree(list);
}

View File

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

View File

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

View File

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

View File

@ -249,7 +249,9 @@ ListWinGroups(EWin * ewin, char group_select, int *num)
{
case GROUP_SELECT_EWIN_ONLY:
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;
break;
case GROUP_SELECT_ALL_EXCEPT_EWIN:
@ -347,12 +349,16 @@ ListWinGroupMembersForEwin(EWin * ewin, int action, char nogroup, int *num)
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 */
for (k = 0; k < ewin->groups[i]->num_members; k++)
{
/* 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;
for (j = 0; j < (*num); j++)

View File

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

269
src/fx.c
View File

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

View File

@ -128,12 +128,12 @@
/* Preferences for behavior for app */
/* ONLY the client sets this */
#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_TASKBAR (1<<2) /* not on taskbar */
#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */
#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_SKIP_FOCUS (1<<0) /* "alt-tab" skips this win */
#define WIN_HINTS_SKIP_WINLIST (1<<1) /* not in win list */
#define WIN_HINTS_SKIP_TASKBAR (1<<2) /* not on taskbar */
#define WIN_HINTS_GROUP_TRANSIENT (1<<3) /* ??????? */
#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 XA_WIN_HINTS "_WIN_HINTS"
/* WIN_HINTS = CARD32 */
@ -720,8 +720,7 @@ GNOME_SetWMNameVer(void)
void
GNOME_DelHints(EWin * ewin)
{
static Atom atom_get[7] =
{0, 0, 0, 0, 0, 0, 0};
static Atom atom_get[7] = { 0, 0, 0, 0, 0, 0, 0 };
EDBUG(6, "GNOME_DelHints");
if (!atom_get[0])

View File

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

View File

@ -114,10 +114,11 @@ BuildWindowGroup(EWin ** ewins, int num)
AddEwinToGroup(ewins[i], g);
else
{
DIALOG_OK("Cannot comply",
"Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n");
DIALOG_OK(gettext("Cannot comply"),
gettext
("Iconboxes and Pagers are disallowed from being\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)
return;
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;
g->num_members++;
g->members = Erealloc(g->members, sizeof(EWin *) * g->num_members);
@ -145,10 +147,11 @@ AddEwinToGroup(EWin * ewin, Group * g)
}
else
{
DIALOG_OK("Cannot comply",
"Iconboxes and Pagers are disallowed from being\n"
"members of a group. You cannot add these windows\n"
"to a group.\n");
DIALOG_OK(gettext("Cannot comply"),
gettext
("Iconboxes and Pagers are disallowed from being\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->num_members--;
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
{
RemoveItem((char *)g, 0, LIST_FINDBY_POINTER, LIST_TYPE_GROUP);
RemoveItem((char *)g, 0,
LIST_FINDBY_POINTER,
LIST_TYPE_GROUP);
FreeGroup(g);
}
/* 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;
}
else
ewin->groups = Erealloc(ewin->groups, sizeof(Group *) * ewin->num_groups);
ewin->groups =
Erealloc(ewin->groups,
sizeof(Group *) *
ewin->num_groups);
SaveGroups();
x = ewin->x;
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;
else if ((ewin->x + ewin->w -
ewin->border->border.right - 1) < 0)
x = 0 - ewin->w + ewin->border->border.right + 1;
if ((ewin->y + ewin->border->border.top + 1) > root.h)
x =
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;
else if ((ewin->y + ewin->h -
ewin->border->border.bottom - 1) < 0)
y = 0 - ewin->h + ewin->border->border.bottom + 1;
ewin->border->border.bottom - 1) < 0)
y =
0 - ewin->h +
ewin->border->border.bottom + 1;
MoveEwin(ewin, x, y);
@ -266,7 +283,8 @@ GetWinGroupMemberNames(Group ** groups, int num)
group_member_strings[i][0] = 0;
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");
}
}
@ -305,8 +323,9 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
if (!gwins[i]->border->group_border_name)
continue;
b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME,
LIST_TYPE_BORDER);
b =
(Border *) FindItem(gwins[i]->border->group_border_name, 0,
LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if (b)
{
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)
continue;
b = (Border *) FindItem(gwins[i]->border->group_border_name, 0, LIST_FINDBY_NAME,
LIST_TYPE_BORDER);
b =
(Border *) FindItem(gwins[i]->border->group_border_name, 0,
LIST_FINDBY_NAME, LIST_TYPE_BORDER);
if (b)
{
gwins[i]->previous_border = gwins[i]->border;
@ -352,8 +372,8 @@ ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
gwins[i]->border_new = 1;
SetEwinToBorder(gwins[i], b);
ICCCM_MatchSize(gwins[i]);
MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y, gwins[i]->client.w,
gwins[i]->client.h);
MoveResizeEwin(gwins[i], gwins[i]->x, gwins[i]->y,
gwins[i]->client.w, gwins[i]->client.h);
RememberImportantInfoForEwin(gwins[i]);
}
}
@ -389,14 +409,20 @@ SaveGroups(void)
if (groups[i]->members[0]->snap->num_groups)
{
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, "MOVE: %i\n", groups[i]->cfg.move);
fprintf(f, "RAISE: %i\n", groups[i]->cfg.raise);
fprintf(f, "SET_BORDER: %i\n", groups[i]->cfg.set_border);
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);
fprintf(f, "RAISE: %i\n",
groups[i]->cfg.raise);
fprintf(f, "SET_BORDER: %i\n",
groups[i]->cfg.set_border);
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_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",
"\n This window currently does not belong to any groups. \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");
DIALOG_OK(gettext("Window Group Error"),
gettext
("\n This window currently does not belong to any groups. \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;
}
if ((num_groups == 0) && (group_select == GROUP_SELECT_ALL_EXCEPT_EWIN))
{
DIALOG_OK("Window Group Error",
"\n Currently, no groups exist or this window \n"
" already belongs to all existing groups. \n"
" You have to start other groups first. \n\n");
DIALOG_OK(gettext("Window Group Error"),
gettext("\n Currently, no groups exist or this window \n"
" already belongs to all existing groups. \n"
" You have to start other groups first. \n\n"));
return;
}
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;
}
@ -604,7 +634,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
AUDIO_PLAY("SOUND_SETTINGS_GROUP");
d = CreateDialog("GROUP_SELECTION");
DialogSetTitle(d, "Window Group Selection");
DialogSetTitle(d, gettext("Window Group Selection"));
table = DialogInitItem(d);
DialogItemTableSetOptions(table, 2, 0, 0, 0);
@ -661,8 +691,8 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
DialogItemSetFill(di, 1, 0);
DialogItemSeparatorSetOrientation(di, 0);
DialogAddButton(d, "OK", ChooseGroup, 1);
DialogAddButton(d, "Close", ChooseGroup, 1);
DialogAddButton(d, gettext("OK"), ChooseGroup, 1);
DialogAddButton(d, gettext("Close"), ChooseGroup, 1);
DialogSetExitFunction(d, ChooseGroup, 2, d);
DialogBindKey(d, "Escape", ChooseGroupEscape, 0, d);
DialogBindKey(d, "Return", ChooseGroup, 0, d);

View File

@ -56,14 +56,14 @@ HandleSigIll(int num)
num = 0;
if (disp)
UngrabX();
DialogAlert("Enlightenment performed an Illegal Instruction.\n"
"\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"
"of CPU not 100% identical or compatible with yours. Please\n"
"either obtain the correct package for your system, or\n"
"re-compile enlightenment and possibly any support libraries\n"
"that you got in binary format to run Enlightenment.\n");
DialogAlert(gettext("Enlightenment performed an Illegal Instruction.\n"
"\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"
"of CPU not 100% identical or compatible with yours. Please\n"
"either obtain the correct package for your system, or\n"
"re-compile enlightenment and possibly any support libraries\n"
"that you got in binary format to run Enlightenment.\n"));
doExit("error");
EDBUG_RETURN_;
}
@ -84,16 +84,16 @@ HandleSigFpe(int num)
num = 0;
if (disp)
UngrabX();
DialogAlert("Enlightenment caused a Floating Point Exception.\n"
"\n"
"This means that Enlightenment or support library routines it calls\n"
"have performed an illegal mathematical operation (most likely\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"
"compile Enlightenment with debugging symbols in and run\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"
"dumps etc.\n");
DialogAlert(gettext("Enlightenment caused a Floating Point Exception.\n"
"\n"
"This means that Enlightenment or support library routines it calls\n"
"have performed an illegal mathematical operation (most likely\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"
"compile Enlightenment with debugging symbols in and run\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"
"dumps etc.\n"));
doExit("error");
EDBUG_RETURN_;
}
@ -109,16 +109,16 @@ HandleSigSegv(int num)
loop_count++;
if (disp)
UngrabX();
DialogAlert("Enlightenment caused Segment Violation (Segfault)\n"
"\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"
"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"
"Enlightenment with debugging symbols in and run Enlightenment\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"
"dumps etc.\n");
DialogAlert(gettext("Enlightenment caused Segment Violation (Segfault)\n"
"\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"
"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"
"Enlightenment with debugging symbols in and run Enlightenment\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"
"dumps etc.\n"));
abort();
num = 0;
EDBUG_RETURN_;
@ -193,11 +193,11 @@ HandleSigBus(int num)
num = 0;
if (disp)
UngrabX();
DialogAlert("Enlightenment caused Bus Error.\n"
"\n"
"It is suggested you check your hardware and OS installation.\n"
"It is highly unusual to cause Bus Errors on operational\n"
"hardware.\n");
DialogAlert(gettext("Enlightenment caused Bus Error.\n"
"\n"
"It is suggested you check your hardware and OS installation.\n"
"It is highly unusual to cause Bus Errors on operational\n"
"hardware.\n"));
EDBUG_RETURN_;
}
@ -212,39 +212,33 @@ EHandleXError(Display * d, XErrorEvent * ev)
{
if ((!no_overwrite) && (mode.xselect))
{
ASSIGN_ALERT("Another Window Manager is already running",
"OK (edit file)",
"",
"Cancel (do NOT edit)");
Alert("Another Window Manager is already running.\n"
"\n"
"You will have to quit your current Window Manager first before\n"
"you can successfully run Enlightenment.\n"
"\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"
"quitting your current window manager, you will have\n"
"Enlightenment running.\n"
"\n"
"If you want to do this, click OK, otherwise hit cancel\n"
"to abort this operation and edit the files by hand.\n"
"\n"
"WARNING WARNING WARNING WARNING!\n"
"\n"
"It is possible that this MAY not properly edit your files.\n"
);
ASSIGN_ALERT("Are you sure?",
"YES (edit file)",
"",
"NO (do not edit)");
Alert("Are you absolutely sure you want to have Enlightenment\n"
"edit your startup files for you?\n"
"\n"
"If your startup files are highly customised this may not\n"
"work.\n"
"\n"
"Are you ABSOLUTELY sure?\n"
);
ASSIGN_ALERT(gettext("Another Window Manager is already running"),
gettext("OK (edit file)"),
"", gettext("Cancel (do NOT edit)"));
Alert(gettext("Another Window Manager is already running.\n"
"\n"
"You will have to quit your current Window Manager first before\n"
"you can successfully run Enlightenment.\n"
"\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"
"quitting your current window manager, you will have\n"
"Enlightenment running.\n"
"\n"
"If you want to do this, click OK, otherwise hit cancel\n"
"to abort this operation and edit the files by hand.\n"
"\n"
"WARNING WARNING WARNING WARNING!\n"
"\n"
"It is possible that this MAY not properly edit your files.\n"));
ASSIGN_ALERT(gettext("Are you sure?"),
gettext("YES (edit file)"),
"", gettext("NO (do not edit)"));
Alert(gettext
("Are you absolutely sure you want to have Enlightenment\n"
"edit your startup files for you?\n" "\n"
"If your startup files are highly customised this may not\n"
"work.\n" "\n" "Are you ABSOLUTELY sure?\n"));
RESET_ALERT;
AddE();
EExit((void *)1);

View File

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

View File

@ -35,8 +35,7 @@ CreateIclass()
i->name = NULL;
i->external = 0;
i->norm.normal = i->norm.hilited = i->norm.clicked
= i->norm.disabled = NULL;
i->norm.normal = i->norm.hilited = i->norm.clicked = i->norm.disabled = NULL;
i->active.normal = i->active.hilited = i->active.clicked
= i->active.disabled = NULL;
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;
tm = ECreatePixmap(disp, win, w, h, 1);
gc = XCreateGC(disp, tm, GCFillStyle | GCTile |
GCTileStipXOrigin | GCTileStipYOrigin,
&gcv);
GCTileStipXOrigin |
GCTileStipYOrigin, &gcv);
XFillRectangle(disp, tm, gc, 0, 0, w, h);
XFreeGC(disp, gc);
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_y_origin = 0;
gc = XCreateGC(disp, tm, GCFillStyle | GCTile |
GCTileStipXOrigin | GCTileStipYOrigin,
&gcv);
GCTileStipXOrigin |
GCTileStipYOrigin, &gcv);
XFillRectangle(disp, tm, gc, 0, 0, w, h);
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.bottom = 8;
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 0, 0,
-1, 1024, -1, 0, 7, 1);
-1, 0, 0, 0, 0, -1, 1024, -1, 0, 7, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 1024, -8,
-1, 1024, -1, 1024, -1, 1);
-1, 0, 0, 1024, -8, -1, 1024, -1, 1024, -1, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 0, 0, 0, 8,
-1, 0, 7, 1024, -9, 1);
-1, 0, 0, 0, 8, -1, 0, 7, 1024, -9, 1);
AddBorderPart(b, ic, ac, NULL, NULL, 1, FLAG_BUTTON, 0, 8, 99999, 8, 99999,
-1, 1024, -8, 0, 8,
-1, 1024, -1, 1024, -9, 1);
-1, 1024, -8, 0, 8, -1, 1024, -1, 1024, -9, 1);
AddItem(b, b->name, 0, LIST_TYPE_BORDER);
/* create a fallback background in case no background is found */
@ -200,7 +196,8 @@ SetupFallbackClasses(void)
tc = CreateTclass();
tc->name = "__FALLBACK_TCLASS";
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.g = 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 */
typedef struct KModuleList
{
{
Window win;
struct KModuleList *next;
Window win;
struct KModuleList *next;
}
}
KModuleList;
static KModuleList *KModules = NULL;
@ -189,8 +189,8 @@ KDE_UpdateFocusedWindow(void)
if (ewin)
{
XChangeProperty(disp, root.win, KDE_ACTIVE_WINDOW, KDE_ACTIVE_WINDOW,
32, PropModeReplace, (unsigned char *)
&(ewin->client.win), 1);
32, PropModeReplace,
(unsigned char *)&(ewin->client.win), 1);
}
else
{
@ -256,7 +256,8 @@ KDE_NewWindow(EWin * ewin)
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;
KDE_SendMessagesToModules(KDE_MODULE_WIN_ADD, ewin->client.win);
@ -403,7 +404,8 @@ KDE_AddModule(Window win)
KDE_WIN_MAXIMIZED, 0);
}
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,
lst[i]->client.win, CurrentTime);
lst[i]->kde_hint = 1;
@ -499,8 +501,7 @@ KDE_Init(void)
if (!KDE_WIN_STICKY)
{
KDE_WIN_UNSAVED_DATA = XInternAtom(disp, "KWM_WIN_UNSAVED_DATA",
False);
KDE_WIN_UNSAVED_DATA = XInternAtom(disp, "KWM_WIN_UNSAVED_DATA", 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_CURRENT_DESKTOP = XInternAtom(disp, "KWM_CURRENT_DESKTOP",
False);
KDE_CURRENT_DESKTOP = XInternAtom(disp, "KWM_CURRENT_DESKTOP", False);
KDE_NUMBER_OF_DESKTOPS = XInternAtom(disp, "KWM_NUMBER_OF_DESKTOPS",
False);
@ -550,11 +550,12 @@ KDE_Init(void)
False);
KDE_MODULE_DESKTOP_CHANGE = XInternAtom(disp,
"KWM_MODULE_DESKTOP_CHANGE", False);
KDE_MODULE_DESKTOP_NAME_CHANGE = XInternAtom(disp,
"KWM_MODULE_DESKTOP_NAME_CHANGE", False);
KDE_MODULE_DESKTOP_NUMBER_CHANGE = XInternAtom(disp,
"KWM_MODULE_DESKTOP_NUMBER_CHANGE", False);
"KWM_MODULE_DESKTOP_CHANGE",
False);
KDE_MODULE_DESKTOP_NAME_CHANGE =
XInternAtom(disp, "KWM_MODULE_DESKTOP_NAME_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_REMOVE = XInternAtom(disp, "KWM_MODULE_WIN_REMOVE",
@ -566,11 +567,12 @@ KDE_Init(void)
KDE_MODULE_WIN_ACTIVATE = XInternAtom(disp, "KWM_MODULE_WIN_ACTIVATE",
False);
KDE_MODULE_WIN_ICON_CHANGE = XInternAtom(disp,
"KWM_MODULE_WIN_ICON_CHANGE", False);
KDE_MODULE_DOCKWIN_ADD = XInternAtom(disp, "KWM_MODULE_DOCKWIN_ADD",
False);
KDE_MODULE_DOCKWIN_REMOVE = XInternAtom(disp,
"KWM_MODULE_DOCKWIN_REMOVE", False);
"KWM_MODULE_WIN_ICON_CHANGE",
False);
KDE_MODULE_DOCKWIN_ADD =
XInternAtom(disp, "KWM_MODULE_DOCKWIN_ADD", False);
KDE_MODULE_DOCKWIN_REMOVE =
XInternAtom(disp, "KWM_MODULE_DOCKWIN_REMOVE", False);
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;
SetEwinToBorder(ewin, b);
ICCCM_MatchSize(ewin);
MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w,
ewin->client.h);
MoveResizeEwin(ewin, ewin->x, ewin->y, ewin->client.w, ewin->client.h);
EDBUG_RETURN_;
@ -1170,8 +1171,7 @@ KDE_SetRootArea(void)
EDBUG(6, "KDE_SetRootArea");
if (getSimpleHint(root.win, KDE_CURRENT_DESKTOP))
if (*(getSimpleHint(root.win, KDE_CURRENT_DESKTOP)) ==
desks.current + 1)
if (*(getSimpleHint(root.win, KDE_CURRENT_DESKTOP)) == desks.current + 1)
EDBUG_RETURN_;
setSimpleHint(root.win, KDE_CURRENT_DESKTOP, desks.current + 1);
@ -1211,7 +1211,8 @@ KDE_SetNumDesktops(void)
{
Esnprintf(s, sizeof(s), "Desk %d", i);
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 *data;
if (XGetWindowProperty(disp, root.win, a, 0, 4, False, a, &type_ret,
&fmt_ret, &num, &extra,
(unsigned char **)&data) != Success || !data)
if (XGetWindowProperty
(disp, root.win, a, 0, 4, False, a, &type_ret, &fmt_ret,
&num, &extra, (unsigned char **)&data) != Success
|| !data)
{
EDBUG_RETURN_;
}
@ -1364,7 +1366,8 @@ KDE_UpdateClient(EWin * ewin)
{
if ((*(getSimpleHint(ewin->client.win, KDE_WIN_DESKTOP)) - 1) !=
ewin->desktop)
setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP, (ewin->desktop) + 1);
setSimpleHint(ewin->client.win, KDE_WIN_DESKTOP,
(ewin->desktop) + 1);
}
else
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -28,7 +28,8 @@ static void PagerUpdateTimeout(int val, void *data);
#define SNAP mode.pager_snap
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;
XGCValues gcv;
@ -79,13 +80,17 @@ PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy,
if (!px_grab)
return;
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)
{
XDestroyImage(px_grab);
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)
{
XDestroyImage(px_grab);
@ -208,7 +213,8 @@ PagerScaleLine(Pixmap dest, Window src, int dx, int dy, int sw, int pw, int sy,
}
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;
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++)
{
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
@ -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++)
{
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);
@ -275,7 +283,8 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
y2 = (sh * y) / (dh * 2);
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);
if (!px_grab)
return;
@ -295,7 +304,9 @@ PagerScaleRect(Pixmap dest, Window src, int sx, int sy, int dx, int dy, int sw,
if (!px_grab)
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)
{
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);
v3 = XGetPixel(xim1, x2, 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) +
(v1 & v2 & v3 & v4 & 0x03030303);
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);
v4 = XGetPixel(xim1, x2 + difx, y2 + 1);
v1 =
((v1 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((v2 >> 2) & ((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((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)));
((v1 >> 2) &
((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((v2 >> 2) &
((0x70 << 7) | (0x78 << 2) | (0x70 >> 4))) +
((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);
}
}
@ -433,8 +450,7 @@ PagerUpdateTimeout(int val, void *data)
double cur_time, in;
static int calls = 0;
int y, y2, phase, ax, ay, cx, cy, ww, hh, xx, yy;
static int offsets[8] =
{0, 4, 2, 6, 1, 5, 3, 7};
static int offsets[8] = { 0, 4, 2, 6, 1, 5, 3, 7 };
p = (Pager *) data;
Esnprintf(s, sizeof(s), "__.%x", p->win);
@ -508,50 +524,49 @@ CreatePager(void)
{
SettingsPager();
DIALOG_OK
("Warning!",
"\n"
"You seem to have an X Server capable of Shared Memory\n"
"but it is incapable of doing ZPixmap Shared pixmaps\n"
"(The server does not claim to be able to do them).\n"
"\n"
"The pager in enlightenment will run slowly in snapshot\n"
"mode if you continue to use that mode of the pager\n"
"under these conditions.\n"
"\n"
"It is suggested you change the settings on your pager to\n"
"disable snapshots to improve performance.\n"
"\n");
(gettext("Warning!"),
gettext("\n"
"You seem to have an X Server capable of Shared Memory\n"
"but it is incapable of doing ZPixmap Shared pixmaps\n"
"(The server does not claim to be able to do them).\n"
"\n"
"The pager in enlightenment will run slowly in snapshot\n"
"mode if you continue to use that mode of the pager\n"
"under these conditions.\n"
"\n"
"It is suggested you change the settings on your pager to\n"
"disable snapshots to improve performance.\n"
"\n"));
}
else
DIALOG_OK
("Warning!",
"\n"
"Your X Server is capable of doing Shared Memory but you do\n"
"not have Shared Pixmaps enabled in your Imlib configuration.\n"
"\n"
"Please enable Shared Pixmaps in your Imlib configuration\n"
"then restart enlightenment to gain better performance for\n"
"the pagers when snapshot mode is enabled.\n"
"\n");
(gettext("Warning!"),
gettext("\n"
"Your X Server is capable of doing Shared Memory but you do\n"
"not have Shared Pixmaps enabled in your Imlib configuration.\n"
"\n"
"Please enable Shared Pixmaps in your Imlib configuration\n"
"then restart enlightenment to gain better performance for\n"
"the pagers when snapshot mode is enabled.\n"
"\n"));
}
}
else
{
SettingsPager();
DIALOG_OK
("Warning!",
"\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"
"have disabled MIT-SHM Shared memory in your Imlib configuration.\n"
"This means the Enlightenment Pager will perform slowly and use\n"
"more system resources than it would when Shared Memory is\n"
"available.\n"
"\n"
"To improve performance please either enable MIT-SHM Shared Memory\n"
"in your Imlib config, if you disabled it, or disable Pager\n"
"snapshots.\n"
"\n");
(gettext("Warning!"),
gettext("\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"
"have disabled MIT-SHM Shared memory in your Imlib configuration.\n"
"This means the Enlightenment Pager will perform slowly and use\n"
"more system resources than it would when Shared Memory is\n"
"available.\n"
"\n"
"To improve performance please either enable MIT-SHM Shared Memory\n"
"in your Imlib config, if you disabled it, or disable Pager\n"
"snapshots.\n" "\n"));
}
did_dialog = 1;
}
@ -720,7 +735,8 @@ PagerShow(Pager * p)
{
Esnprintf(s, sizeof(s), "__.%x", p->win);
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;
AddItem(p, "PAGER", p->win, LIST_TYPE_PAGER);
@ -1031,8 +1047,8 @@ PagerRedraw(Pager * p, char newbg)
for (y = 0; y < ay; y++)
{
for (x = 0; x < ax; x++)
XCopyArea(disp, p->bgpmap, p->pmap, gc, 0, 0, p->w / ax, p->h / ay,
x * (p->w / ax), y * (p->h / ay));
XCopyArea(disp, p->bgpmap, p->pmap, gc, 0, 0, p->w / ax,
p->h / ay, x * (p->w / ax), y * (p->h / ay));
}
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);
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)
XSetClipMask(disp, gc, None);
}
else
{
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);
XFillRectangle(disp, p->pmap, gc, wx, wy, ww, wh);
}
@ -1152,11 +1170,12 @@ PagerReArea(void)
aspect = ((double)root.w) / ((double)root.h);
pl[i]->ewin->client.w_inc = ax * 4;
pl[i]->ewin->client.h_inc = ay * 8;
pl[i]->ewin->client.aspect_min = aspect * ((double)ax / (double)ay);
pl[i]->ewin->client.aspect_max = aspect * ((double)ax / (double)ay);
MoveResizeEwin(pl[i]->ewin,
pl[i]->ewin->x, pl[i]->ewin->y,
w, h);
pl[i]->ewin->client.aspect_min =
aspect * ((double)ax / (double)ay);
pl[i]->ewin->client.aspect_max =
aspect * ((double)ax / (double)ay);
MoveResizeEwin(pl[i]->ewin, pl[i]->ewin->x, pl[i]->ewin->y, w,
h);
}
}
Efree(pl);
@ -1246,21 +1265,26 @@ PagerShowMenu(Pager * p, int x, int y)
if (pw_menu)
DestroyMenu(pw_menu);
pw_menu = CreateMenu();
AddTitleToMenu(pw_menu, "Window Options");
AddTitleToMenu(pw_menu, gettext("Window Options"));
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);
mi = CreateMenuItem("Iconify", NULL, ACTION_ICONIFY, s, NULL);
mi = CreateMenuItem(gettext("Iconify"), NULL, ACTION_ICONIFY, s, NULL);
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);
mi = CreateMenuItem("Annihilate", NULL, ACTION_KILL_NASTY, s, NULL);
mi =
CreateMenuItem(gettext("Annihilate"), NULL, ACTION_KILL_NASTY, s,
NULL);
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);
AddItem(pw_menu, pw_menu->name, 0, LIST_TYPE_MENU);
@ -1272,25 +1296,36 @@ PagerShowMenu(Pager * p, int x, int y)
if (p_menu)
DestroyMenu(p_menu);
p_menu = CreateMenu();
AddTitleToMenu(p_menu, "Desktop Options");
AddTitleToMenu(p_menu, gettext("Desktop Options"));
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);
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);
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);
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);
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);
}
AddItem(p_menu, p_menu->name, 0, LIST_TYPE_MENU);
@ -1343,9 +1378,12 @@ UpdatePagerSel(void)
cy = desks.desk[p->desktop].current_area_y;
EMoveWindow(disp, p->sel_win, cx * p->dw, cy * p->dh);
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)
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);
@ -1379,8 +1417,7 @@ PagerHideHi(Pager * p)
p->hi_visible = 0;
EUnmapWindow(disp, p->hi_win);
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME,
LIST_TYPE_TOOLTIP);
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
if (tt)
HideToolTip(tt);
}
@ -1423,7 +1460,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int 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);
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;
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);
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;
xx = x + ((w - ww) / 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);
XClearWindow(disp, p->hi_win);
{
int 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);
return;
@ -1504,14 +1545,16 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
hh = i;
xx = x + ((w - ww) / 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);
XClearWindow(disp, p->hi_win);
{
int 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);
return;
@ -1561,7 +1604,8 @@ PagerShowHi(Pager * p, EWin * ewin, int x, int y, int w, int h)
int 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);
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;
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);
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;
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME,
LIST_TYPE_TOOLTIP);
tt = FindItem("PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_TOOLTIP);
if (tt)
{
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);
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);

View File

@ -124,7 +124,8 @@ ShowProgressbar(Progressbar * p)
EMapRaised(disp, p->n_win);
EMapRaised(disp, p->p_win);
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;
EDBUG_RETURN_;
}

View File

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

View File

@ -47,10 +47,10 @@ Emkstemp(char *template)
{
static const char letters[]
#ifndef __EMX__
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
= "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
#else
= "abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>Ž“”•˜™0123456789";
= "abcdefghijklmnopqrstuvwxyz€<EFBFBD>ƒ„…†‡ˆŠŒ<EFBFBD>Ž<EFBFBD><EFBFBD>Ž“”•˜™0123456789";
#endif
@ -140,16 +140,15 @@ static char *userthemepath;
/* The saved window details */
static int num_match = 0;
typedef struct _match
{
char *session_id;
char *name;
char *class;
char *role;
char *command;
char used;
int x, y, w, h, desktop, iconified, shaded, sticky,
layer;
}
{
char *session_id;
char *name;
char *class;
char *role;
char *command;
char used;
int x, y, w, h, desktop, iconified, shaded, sticky, layer;
}
Match;
Match *matches = NULL;
@ -214,8 +213,12 @@ SaveWindowStates(void)
y = 0;
if (!ewin->sticky)
{
x = desks.desk[ewin->desktop].current_area_x * root.w;
y = desks.desk[ewin->desktop].current_area_y * root.h;
x =
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",
ewin->x + x, ewin->y + y,
@ -239,13 +242,12 @@ SaveWindowStates(void)
rm(ss);
mv(s, ss);
if (!isfile(ss))
Alert("There was an error writing the clients "
"session save file.\n"
"You may have run out of disk "
"space, not have permission\n"
"to write to your filing system "
"or other similar problems.\n"
);
Alert(gettext("There was an error writing the clients "
"session save file.\n"
"You may have run out of disk "
"space, not have permission\n"
"to write to your filing system "
"or other similar problems.\n"));
}
Efree(lst);
}
@ -288,8 +290,7 @@ LoadWindowStates(void)
&(matches[num_match - 1].iconified),
&(matches[num_match - 1].shaded),
&(matches[num_match - 1].sticky),
&(matches[num_match - 1].layer)
);
&(matches[num_match - 1].layer));
}
else if (!strcmp(s1, "[SESSION_ID]"))
{
@ -432,9 +433,9 @@ autosave(void)
rm(GetGenericSMFile());
mv(s, GetGenericSMFile());
if (!isfile(GetGenericSMFile()))
Alert("There was an error saving your autosave data - filing\n"
"system problems.\n"
);
Alert(gettext
("There was an error saving your autosave data - filing\n"
"system problems.\n"));
/*
* if (strcmp(GetSMFile(), GetGenericSMFile()))
* {
@ -557,7 +558,7 @@ doSMExit(void *params)
if (themepath[0] != 0)
{
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);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
@ -579,7 +580,7 @@ doSMExit(void *params)
disp = NULL;
sscanf(params, "%*s %1000s", s);
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);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", sss, NULL);
}
@ -615,9 +616,7 @@ doSMExit(void *params)
"\n"
"\n"
" Are you sure you wish to log out ? \n"
"\n"
"\n"
);
"\n" "\n");
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 0, d);
@ -627,7 +626,8 @@ doSMExit(void *params)
ewin = FindEwinByDialog(d);
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);
}
return;
@ -651,15 +651,19 @@ static int restarting = False;
static void LogoutCB(int val, void *data);
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,
SmPointer client_data, int save_style,
Bool shutdown, int interact_style,
Bool fast);
SmPointer client_data,
int save_style, Bool shutdown,
int interact_style, Bool fast);
static void callback_die(SmcConn smc_conn, SmPointer client_data);
static void callback_save_complete(SmcConn smc_conn,
SmPointer client_data);
static void callback_shutdown_cancelled(SmcConn smc_conn,
SmPointer client_data);
static void
@ -678,17 +682,14 @@ set_save_props(SmcConn smc_conn, int master_flag)
char priority = 10;
char style;
int n = 0;
SmPropValue programVal =
{0, NULL};
SmPropValue userIDVal =
{0, NULL};
SmPropValue discardVal[] =
{
SmPropValue programVal = { 0, NULL };
SmPropValue userIDVal = { 0, NULL };
SmPropValue discardVal[] = {
{0, NULL},
{0, NULL},
{0, NULL}};
SmPropValue restartVal[] =
{
{0, NULL}
};
SmPropValue restartVal[] = {
{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}};
SmPropValue styleVal =
{0, NULL};
SmPropValue priorityVal =
{0, NULL};
{0, NULL}
};
SmPropValue styleVal = { 0, NULL };
SmPropValue priorityVal = { 0, NULL };
SmProp programProp;
SmProp userIDProp;
SmProp discardProp;
@ -1016,18 +1016,16 @@ ProcessICEMSGS(void)
if (status == IceProcessMessagesIOError)
{
/* Less of the hope.... E survives */
DialogAlert("ERROR!\n"
"\n"
"Lost the Session Manager that was there?\n"
"Here here session manager... come here... want a bone?\n"
"Oh come now! Stop sulking! Bugger. Oh well. "
"Will continue without\n"
"a session manager.\n"
"\n"
"I'll survive somehow.\n"
"\n"
"\n"
"... I hope.\n");
DialogAlert(gettext("ERROR!\n"
"\n"
"Lost the Session Manager that was there?\n"
"Here here session manager... come here... want a bone?\n"
"Oh come now! Stop sulking! Bugger. Oh well. "
"Will continue without\n"
"a session manager.\n"
"\n"
"I'll survive somehow.\n"
"\n" "\n" "... I hope.\n"));
SmcCloseConnection(sm_conn, 0, NULL);
sm_conn = NULL;
sm_fd = -1;
@ -1158,16 +1156,14 @@ doSMExit(void *params)
{
AUDIO_PLAY("SOUND_LOGOUT");
d = CreateDialog("LOGOUT_DIALOG");
DialogSetTitle(d, "Are you sure?");
DialogSetTitle(d, gettext("Are you sure?"));
DialogSetText(d,
"\n"
"\n"
" Are you sure you wish to log out ? \n"
"\n"
"\n"
);
DialogAddButton(d, " Yes, Log Out ", LogoutCB, 1);
DialogAddButton(d, " No ", NULL, 1);
gettext("\n"
"\n"
" Are you sure you wish to log out ? \n"
"\n" "\n"));
DialogAddButton(d, gettext(" Yes, Log Out "), LogoutCB, 1);
DialogAddButton(d, gettext(" No "), NULL, 1);
DialogBindKey(d, "Escape", CB_SettingsEscape, 1, d);
DialogBindKey(d, "Return", LogoutCB, 0, d);
}
@ -1175,7 +1171,8 @@ doSMExit(void *params)
ewin = FindEwinByDialog(d);
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);
}
return;
@ -1188,8 +1185,7 @@ doSMExit(void *params)
KDE_Shutdown();
XCloseDisplay(disp);
disp = NULL;
Esnprintf(s, sizeof(s), "exec %s -display %s",
atword(params, 2), dstr);
Esnprintf(s, sizeof(s), "exec %s -display %s", atword(params, 2), dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
else if (!strcmp(s, "restart"))
@ -1215,8 +1211,7 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i -theme %s "
"-smfile %s -display %s",
command, init_win_ext, themename,
sm_file, dstr);
command, init_win_ext, themename, sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
else
@ -1225,14 +1220,12 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i "
"-smfile %s -smid %s -display %s",
command, init_win_ext,
sm_file, sm_client_id, dstr);
command, init_win_ext, sm_file, sm_client_id, dstr);
else
Esnprintf(s, sizeof(s),
"exec %s -single -ext_init_win %i"
"-smfile %s -display %s",
command, init_win_ext,
sm_file, dstr);
command, init_win_ext, sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
}
@ -1260,8 +1253,7 @@ doSMExit(void *params)
Esnprintf(s, sizeof(s),
"exec %s -ext_init_win %i -theme %s "
"-smfile %s -single -display %s",
command, init_win_ext, userthemepath,
sm_file, dstr);
command, init_win_ext, userthemepath, sm_file, dstr);
execl(DEFAULT_SH_PATH, DEFAULT_SH_PATH, "-c", s, NULL);
}
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 (!disp)
{
Alert("Enlightenment cannot connect to the display nominated by\n"
"your shell's DISPLAY environment variable. You may set this\n"
"variable to indicate which display name Enlightenment is to\n"
"connect to. It may be that you do not have an Xserver already\n"
"running to serve that Display connection, or that you do not\n"
"have permission to connect to that display. Please make sure\n"
"all is correct before trying again. Run an Xserver by running\n"
"xdm or startx first, or contact your local system\n"
"administrator, or Xserver vendor, or read the X, xdm and\n"
"startx manual pages before proceeding.\n");
Alert(gettext
("Enlightenment cannot connect to the display nominated by\n"
"your shell's DISPLAY environment variable. You may set this\n"
"variable to indicate which display name Enlightenment is to\n"
"connect to. It may be that you do not have an Xserver already\n"
"running to serve that Display connection, or that you do not\n"
"have permission to connect to that display. Please make sure\n"
"all is correct before trying again. Run an Xserver by running\n"
"xdm or startx first, or contact your local system\n"
"administrator, or Xserver vendor, or read the X, xdm and\n"
"startx manual pages before proceeding.\n"));
EExit((void *)1);
}
root.scr = DefaultScreen(disp);
@ -272,7 +273,8 @@ SetupX()
if (NULL != dispstr)
*dispstr = '\0';
}
Esnprintf(subdisplay + strlen(subdisplay), 255, ".%d", i);
Esnprintf(subdisplay + strlen(subdisplay), 255, ".%d",
i);
dstr = duplicate(subdisplay);
disp = XOpenDisplay(dstr);
root.scr = i;
@ -289,18 +291,15 @@ SetupX()
/* Check for the Shape Extension */
if (!XShapeQueryExtension(disp, &shape_event_base, &shape_error_base))
{
ASSIGN_ALERT("X server setup error",
"",
"",
"Quit Enlightenment");
Alert("FATAL ERROR:\n"
"\n"
"This Xserver does not support the Shape extension.\n"
"This is required for Enlightenment to run.\n"
"\n"
"Your Xserver probably is too old or mis-configured.\n"
"\n"
"Exiting.\n");
ASSIGN_ALERT(gettext("X server setup error"),
"", "", gettext("Quit Enlightenment"));
Alert(gettext("FATAL ERROR:\n"
"\n"
"This Xserver does not support the Shape extension.\n"
"This is required for Enlightenment to run.\n"
"\n"
"Your Xserver probably is too old or mis-configured.\n"
"\n" "Exiting.\n"));
RESET_ALERT;
EExit((void *)1);
}
@ -326,32 +325,26 @@ SetupX()
id = Imlib_init(disp);
if (!id)
{
ASSIGN_ALERT("Imlib initialisation error",
"",
"",
"Quit Enlightenment");
Alert("FATAL ERROR:\n"
"\n"
"Enlightenment is unable to initialise Imlib.\n"
"\n"
"This is unusual. Unable to contiune.\n"
"Exiting.\n");
ASSIGN_ALERT(gettext("Imlib initialisation error"),
"", "", gettext("Quit Enlightenment"));
Alert(gettext("FATAL ERROR:\n"
"\n"
"Enlightenment is unable to initialise Imlib.\n"
"\n"
"This is unusual. Unable to contiune.\n" "Exiting.\n"));
RESET_ALERT;
EExit((void *)1);
}
fd = Fnlib_init(id);
if (!fd)
{
ASSIGN_ALERT("X server setup error",
"",
"",
"Quit Enlightenment");
Alert("FATAL ERROR:\n"
"\n"
"Enlightenment is unable to initialise Fnlib.\n"
"\n"
"This is unusual. Unable to contiune.\n"
"Exiting.\n");
ASSIGN_ALERT(gettext("X server setup error"),
"", "", gettext("Quit Enlightenment"));
Alert(gettext("FATAL ERROR:\n"
"\n"
"Enlightenment is unable to initialise Fnlib.\n"
"\n"
"This is unusual. Unable to contiune.\n" "Exiting.\n"));
RESET_ALERT;
EExit((void *)1);
}
@ -398,11 +391,9 @@ SetupX()
bpress_win = ECreateWindow(root.win, -80, -80, 24, 24, 0);
val = bpress_win;
XChangeProperty(disp, root.win, atom_set, XA_CARDINAL,
32, PropModeReplace,
(unsigned char *)&val, 1);
32, PropModeReplace, (unsigned char *)&val, 1);
XChangeProperty(disp, bpress_win, atom_set, XA_CARDINAL,
32, PropModeReplace,
(unsigned char *)&val, 1);
32, PropModeReplace, (unsigned char *)&val, 1);
}
XSync(disp, False);
@ -410,16 +401,15 @@ SetupX()
/* warn, if necessary about X version problems */
if (ProtocolVersion(disp) != 11)
{
ASSIGN_ALERT("X server version error",
"Ignore this error",
"",
"Quit Enlightenment");
Alert("WARNING:\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"
"function incorrectly. If it is later than X11, then your\n"
"server is one the author of Enlightenment neither have\n"
"access to, nor have heard of.\n",
ASSIGN_ALERT(gettext("X server version error"),
gettext("Ignore this error"),
"", gettext("Quit Enlightenment"));
Alert(gettext("WARNING:\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"
"function incorrectly. If it is later than X11, then your\n"
"server is one the author of Enlightenment neither have\n"
"access to, nor have heard of.\n"),
ProtocolVersion(disp));
RESET_ALERT;
}
@ -447,8 +437,7 @@ SetupX()
XModifierKeymap *mod;
KeyCode nl, sl;
int i;
int masks[8] =
{
int masks[8] = {
ShiftMask, LockMask, ControlMask, Mod1Mask, Mod2Mask, Mod3Mask,
Mod4Mask, Mod5Mask
};
@ -503,6 +492,9 @@ SetupX()
mode.x = 0;
mode.y = 0;
mode.showroottooltip = 1;
mode.pager_sel_button = 2;
mode.pager_win_button = 1;
mode.pager_menu_button = 3;
mode.focusmode = FOCUS_SLOPPY;
mode.focuswin = NULL;
mode.realfocuswin = NULL;
@ -628,37 +620,33 @@ ChkDir(char *d)
{
if (!isdir(d))
{
Alert("The directory %s is apparently not a directory\n"
"This is a fatal condition.\n"
"Please remove this file\n",
d);
Alert(gettext("The directory %s is apparently not a directory\n"
"This is a fatal condition.\n"
"Please remove this file\n"), d);
EExit((void *)1);
}
if (!canexec(d))
{
Alert("Do not have execute access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n",
d);
Alert(gettext("Do not have execute access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n"), d);
EExit((void *)1);
}
if (!canread(d))
{
Alert("Do not have read access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n",
d);
Alert(gettext("Do not have read access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n"), d);
EExit((void *)1);
}
if (!canwrite(d))
{
Alert("Do not have write access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n",
d);
Alert(gettext("Do not have write access to %s\n"
"This is a fatal condition.\n"
"Please check the ownership and permissions of this\n"
"directory and take steps to rectify this.\n"), d);
EExit((void *)1);
}
}
@ -752,8 +740,7 @@ SetupEnv()
return;
}
Window
MakeExtInitWin(void)
Window MakeExtInitWin(void)
{
Display *d2;
Window win;
@ -822,9 +809,9 @@ MakeExtInitWin(void)
attr.background_pixel = 0;
attr.save_under = True;
win = XCreateWindow(d2, root.win, 0, 0, root.w, root.h, 0, root.depth,
InputOutput, root.vis, CWOverrideRedirect | CWSaveUnder |
CWBackingStore | CWColormap | CWBackPixel | CWBorderPixel,
&attr);
InputOutput, root.vis, CWOverrideRedirect | CWSaveUnder |
CWBackingStore | CWColormap | CWBackPixel |
CWBorderPixel, &attr);
pmap = ECreatePixmap(d2, win, root.w, root.h, root.depth);
gcv.subwindow_mode = IncludeInferiors;
gc = XCreateGC(d2, win, GCSubwindowMode, &gcv);
@ -923,8 +910,7 @@ MakeExtInitWin(void)
EMoveResizeWindow(d2, w2,
x - (im->rgb_width / 2),
y - (im->rgb_height / 2),
im->rgb_width,
im->rgb_height);
im->rgb_width, im->rgb_height);
EMapWindow(d2, w2);
}
tv.tv_sec = 0;

View File

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

View File

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

View File

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

View File

@ -56,11 +56,13 @@
*/
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 fmtnum(long value, int base, int dosign,
int ljust, int len, int zpad, int precision);
static void fmtdouble(int fmt, double value,
int ljust, int len, int zpad, int precision);
static void fmtstr(char *value, int ljust, int len, int zpad,
int precision);
static void fmtnum(long value, int base, int dosign, int ljust, int len,
int zpad, int precision);
static void fmtdouble(int fmt, double value, int ljust, int len,
int zpad, int precision);
static void dostr(char *);
static char *output;
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
int
Esnprintf(char *str, size_t count, const char *fmt,...)
Esnprintf(char *str, size_t count, const char *fmt, ...)
#else
int
Esnprintf(va_alist)
va_dcl
#endif
{
#ifndef HAVE_STDARGS

View File

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

View File

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

View File

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

View File

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

View File

@ -250,7 +250,8 @@ TextSize(TextClass * tclass, int active, int sticky, int state, char *text,
{
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;
if (ret2.width > *width)
*width = ret2.width;
@ -314,7 +315,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
if (!gc)
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;
else
textwidth_limit = h;
@ -367,9 +369,10 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2);
strcat(new_line, "...");
strcat(new_line, lines[i] + ((len - nuke_count) / 2) + nuke_count);
Efont_extents(ts->efont, new_line, &ascent, &descent, &wid,
NULL, NULL, NULL, NULL);
strcat(new_line,
lines[i] + ((len - nuke_count) / 2) + nuke_count);
Efont_extents(ts->efont, new_line, &ascent, &descent,
&wid, NULL, NULL, NULL, NULL);
}
Efree(lines[i]);
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);
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
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)
{
offset_x = xx;
@ -399,9 +405,11 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r;
g = ts->bg_col.g;
b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b));
EFont_draw_string(disp, drawable, gc, offset_x + 1, offset_y + 1,
lines[i], ts->efont, Imlib_get_visual(id),
XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
EFont_draw_string(disp, drawable, gc, offset_x + 1,
offset_y + 1, lines[i], ts->efont,
Imlib_get_visual(id),
Imlib_get_colormap(id));
}
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;
g = ts->bg_col.g;
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,
lines[i], ts->efont, Imlib_get_visual(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),
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)
EFreePixmap(disp, drawable);
yy += ascent + descent;
@ -443,7 +453,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
{
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)
{
char *new_line;
@ -465,8 +476,10 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2);
strcat(new_line, "...");
strcat(new_line, lines[i] + ((len - nuke_count) / 2) + nuke_count);
XmbTextExtents(ts->xfontset, new_line, strlen(new_line), &ret1, &ret2);
strcat(new_line,
lines[i] + ((len - nuke_count) / 2) + nuke_count);
XmbTextExtents(ts->xfontset, new_line, strlen(new_line),
&ret1, &ret2);
}
Efree(lines[i]);
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);
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
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)
{
offset_x = xx;
@ -496,24 +513,26 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r;
g = ts->bg_col.g;
b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1, offset_y + 1,
lines[i], strlen(lines[i]));
XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
offset_y + 1, lines[i], strlen(lines[i]));
}
else if (ts->effect == 2)
{
r = ts->bg_col.r;
g = ts->bg_col.g;
b = ts->bg_col.b;
XSetForeground(disp, gc, Imlib_best_color_match(id, &r, &g, &b));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x - 1, offset_y,
lines[i], strlen(lines[i]));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1, offset_y,
lines[i], strlen(lines[i]));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y - 1,
lines[i], strlen(lines[i]));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x, offset_y + 1,
lines[i], strlen(lines[i]));
XSetForeground(disp, gc,
Imlib_best_color_match(id, &r, &g, &b));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x - 1,
offset_y, lines[i], strlen(lines[i]));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x + 1,
offset_y, lines[i], strlen(lines[i]));
XmbDrawString(disp, drawable, ts->xfontset, gc, offset_x,
offset_y - 1, 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;
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,
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)
EFreePixmap(disp, drawable);
yy += ret2.height;
@ -560,7 +581,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
new_line[0] = 0;
strncat(new_line, lines[i], (len - nuke_count) / 2);
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));
}
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);
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
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)
{
offset_x = xx;
@ -591,7 +616,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r;
g = ts->bg_col.g;
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,
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;
g = ts->bg_col.g;
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,
lines[i], strlen(lines[i]));
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,
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)
EFreePixmap(disp, drawable);
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;
strncat(new_line, lines[i], (len - nuke_count) / 4);
strcat(new_line, ". . . ");
strcat(new_line, lines[i] + ((len - nuke_count) / 4) + nuke_count);
wid = XTextWidth16(ts->xfont, (XChar2b *) new_line,
strlen(new_line) / 2);
strcat(new_line,
lines[i] + ((len - nuke_count) / 4) + nuke_count);
wid =
XTextWidth16(ts->xfont, (XChar2b *) new_line,
strlen(new_line) / 2);
}
Efree(lines[i]);
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);
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
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)
{
offset_x = xx;
@ -687,7 +720,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
r = ts->bg_col.r;
g = ts->bg_col.g;
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,
(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;
g = ts->bg_col.g;
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,
(XChar2b *) lines[i], strlen(lines[i]) / 2);
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,
(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)
EFreePixmap(disp, drawable);
yy += ts->xfont->ascent + ts->xfont->descent;
@ -724,7 +760,8 @@ TextDraw(TextClass * tclass, Window win, int active, int sticky, int state,
}
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;
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);
break;
case FONT_TO_DOWN:
EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h, &win_b, &win_d);
ii = Imlib_create_image_from_drawable(id, win, 0, win_w - y - h, x, h, w);
EGetGeometry(disp, win, &(root.win), &win_x, &win_y, &win_w, &win_h,
&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_flip_image_vertical(id, ii);
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
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;
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);
break;
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);
Imlib_rotate_image(id, ii, 1);
Imlib_flip_image_horizontal(id, ii);

View File

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

View File

@ -147,6 +147,7 @@
#define __KDE_SUPPORT 1366
#define __CLICKS_ALWAYS_RAISE_WINDOWS 1367
#define __ROOT_WINDOW_TOOLTIP 1368
#define __PAGER_BUTTONS 1369
#define __DIRECTION_OF_DESKTOP_DRAG 400
#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 ww, hh, adx, ady, dist;
int headline_h = 0, headline_w = 0, icons_width = 0, labels_width = 0,
double_w = 0, temp_w, temp_h;
int headline_h = 0, headline_w = 0, icons_width =
0, labels_width = 0, double_w = 0, temp_w, temp_h;
ImlibImage *im;
char pq;
int *heights = NULL;
ImageClass *ic = NULL;
int cols[10] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int cols[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
EDBUG(5, "ShowToolTip");
if (!tt)
@ -162,29 +161,33 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
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)
labels_width = temp_w;
temp_w = 0;
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)
cols[0] = double_w;
}
if (ac->list[i]->anybutton)
{
ic = FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_any.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
case 1:
ic = FindItem("TOOLTIP_MOUSEBUTTON_1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_1", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_1.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_1", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_1", 0,
LIST_TYPE_ICLASS);
}
if (ic->norm.normal)
ImageStateRealize(ic->norm.normal);
break;
case 2:
ic = FindItem("TOOLTIP_MOUSEBUTTON_2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_2", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_2.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_2", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_2", 0,
LIST_TYPE_ICLASS);
}
if (ic->norm.normal)
ImageStateRealize(ic->norm.normal);
break;
case 3:
ic = FindItem("TOOLTIP_MOUSEBUTTON_3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_3", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_3.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_3", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_3", 0,
LIST_TYPE_ICLASS);
}
if (ic->norm.normal)
ImageStateRealize(ic->norm.normal);
break;
case 4:
ic = FindItem("TOOLTIP_MOUSEBUTTON_4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_4", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_4.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_4", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_4", 0,
LIST_TYPE_ICLASS);
}
if (ic->norm.normal)
ImageStateRealize(ic->norm.normal);
break;
case 5:
ic = FindItem("TOOLTIP_MOUSEBUTTON_5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_5", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/mouse_5.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_5", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_MOUSEBUTTON_5", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_SHIFT", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_SHIFT", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_shift.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_SHIFT", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_SHIFT", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_lock.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_LOCK", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_LOCK", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_ctrl.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_CTRL", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_CTRL", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod1.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD1", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_MOD1", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod2.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD2", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_MOD2", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod3.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD3", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_MOD3", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod4.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD4", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_MOD4", 0,
LIST_TYPE_ICLASS);
}
if (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)
{
ic = FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (!ic)
{
ic = CreateIclass();
ic->norm.normal = CreateImageState();
ic->norm.normal->im_file = "pix/key_mod5.png";
IclassPopulate(ic);
AddItem(ic, "TOOLTIP_KEY_MOD5", 0, LIST_TYPE_ICLASS);
AddItem(ic, "TOOLTIP_KEY_MOD5", 0,
LIST_TYPE_ICLASS);
}
if (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 */
TextDraw(tt->tclass, tt->win, 0, 0, STATE_NORMAL, text,
xx, tt->iclass->padding.top,
headline_w, headline_h, 17, 512);
xx, tt->iclass->padding.top, headline_w, headline_h, 17, 512);
/* draw the icons and labels, if any */
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)
{
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)
{
ic = FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_ANY", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
}
@ -655,67 +691,102 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
switch (ac->list[i]->button)
{
case 1:
ic = FindItem("TOOLTIP_MOUSEBUTTON_1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_1", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
break;
case 2:
ic = FindItem("TOOLTIP_MOUSEBUTTON_2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_2", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
break;
case 3:
ic = FindItem("TOOLTIP_MOUSEBUTTON_3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_3", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
break;
case 4:
ic = FindItem("TOOLTIP_MOUSEBUTTON_4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_4", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
break;
case 5:
ic = FindItem("TOOLTIP_MOUSEBUTTON_5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_MOUSEBUTTON_5", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->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;
}
break;
@ -727,119 +798,192 @@ ShowToolTip(ToolTip * tt, char *text, ActionClass * ac, int x, int y)
{
if (ac->list[i]->modifiers & ShiftMask)
{
ic = FindItem("TOOLTIP_KEY_SHIFT", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_SHIFT", 0,
LIST_FINDBY_NAME, LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & LockMask)
{
ic = FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_LOCK", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & ControlMask)
{
ic = FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_CTRL", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & Mod1Mask)
{
ic = FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD1", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & Mod2Mask)
{
ic = FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD2", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & Mod3Mask)
{
ic = FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD3", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & Mod4Mask)
{
ic = FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD4", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
if (ac->list[i]->modifiers & Mod5Mask)
{
ic = FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
ic =
FindItem("TOOLTIP_KEY_MOD5", 0, LIST_FINDBY_NAME,
LIST_TYPE_ICLASS);
if (ic)
if (ic->norm.normal->im)
{
Imlib_render(id, ic->norm.normal->im,
ic->norm.normal->im->rgb_width, ic->norm.normal->im->rgb_height);
PastePixmap(disp, tt->win, Imlib_copy_image(id, ic->norm.normal->im),
Imlib_copy_mask(id, ic->norm.normal->im), x, y);
ic->norm.normal->im->rgb_width,
ic->norm.normal->im->
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;
}
}
}
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,
labels_width, heights[i], 17, 0);
y += heights[i];

View File

@ -25,18 +25,16 @@
typedef struct _efont_color_tab EfontColorTable;
struct _efont_color_tab
{
Colormap cmap;
{
Colormap cmap;
XColor list[256];
unsigned char match[8][8][8];
};
XColor list[256];
unsigned char match[8][8][8];
};
/*static EfontColorTable *color_tab = NULL; */
static unsigned char alpha_lut[5] =
{0, 64, 128, 192, 255};
static unsigned char bounded_palette[9] =
{0, 1, 2, 3, 4, 4, 4, 4, 4};
static unsigned char alpha_lut[5] = { 0, 64, 128, 192, 255 };
static unsigned char bounded_palette[9] = { 0, 1, 2, 3, 4, 4, 4, 4, 4 };
static TT_Raster_Map *
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. */
if (xmin >= (int)rmap->width ||
ymin >= (int)rmap->rows ||
xmax < 0 ||
ymax < 0)
ymin >= (int)rmap->rows || xmax < 0 || ymax < 0)
continue;
/* 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;
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++)
{
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);
tmp = (cb - b) * a;
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);
}
else
@ -318,7 +318,9 @@ merge_text_15(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
cb = (col << 3) & 0xf8;
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++)
{
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);
tmp = (cb - b) * a;
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);
}
else
@ -361,7 +365,9 @@ merge_text_24(XImage * xim, TT_Raster_Map * rmap, int offset_x, int offset_y,
cb = col & 0xff;
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++)
{
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++)
{
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++)
{
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);
XTranslateCoordinates(disp, win, xatt.root, 0, 0, &rx, &ry, &chld);
if ((xatt.map_state != IsViewable) &&
(xatt.backing_store == NotUseful))
if ((xatt.map_state != IsViewable) && (xatt.backing_store == NotUseful))
{
destroy_font_raster(rmap);
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;
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);
shm_checked = 1;
}
@ -608,7 +617,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{
shm = 0;
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);
shm_checked = 1;
}
@ -628,7 +639,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{
shm = 0;
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);
shm_checked = 1;
}
@ -646,7 +659,9 @@ EFont_draw_string(Display * disp, Drawable win, GC gc, int x, int y, char *text,
{
shm = 0;
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;
}
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);
if (shm)
XShmPutImage(disp, win, gc, xim, 0, 0, x, y,
width, height, False);
XShmPutImage(disp, win, gc, xim, 0, 0, x, y, width, height, False);
else
XPutImage(disp, win, gc, xim, 0, 0, x, y, width, height);
destroy_font_raster(rmap);
@ -880,7 +894,8 @@ Efont_extents(Efont * f, char *text, int *font_ascent_return,
if (text[i + 1] == 0)
{
if (rbearing_return)
*rbearing_return = ((gmetrics.bbox.xMax - gmetrics.advance) / 64);
*rbearing_return =
((gmetrics.bbox.xMax - gmetrics.advance) / 64);
}
pw += gmetrics.advance / 64;
}

View File

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

View File

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

View File

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

25
src/x.c
View File

@ -40,8 +40,7 @@ EFreePixmap(Display * display, Pixmap pixmap)
XFreePixmap(display, pixmap);
}
Window
ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
Window ECreateWindow(Window parent, int x, int y, int w, int h, int saveunder)
{
EXID *xid;
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,
InputOutput, root.vis, CWOverrideRedirect |
CWSaveUnder | CWBackingStore | CWColormap |
CWBackPixmap | CWBorderPixel,
&attr);
CWBackPixmap | CWBorderPixel, &attr);
xid = NewXID();
xid->parent = parent;
xid->win = win;
@ -261,8 +259,7 @@ EShapeCombineRectangles(Display * d, Window win, int dest, int x, int y,
{
if ((rect[0].x == 0) &&
(rect[0].y == 0) &&
(rect[0].width == xid->w) &&
(rect[0].height == xid->h))
(rect[0].width == xid->w) && (rect[0].height == xid->h))
{
xid->num_rect = 0;
XFree(xid->rects);
@ -589,8 +586,7 @@ DelXID(Window win)
}
}
Window
ECreateEventWindow(Window parent, int x, int y, int w, int h)
Window ECreateEventWindow(Window parent, int x, int y, int w, int h)
{
Window win;
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
* windows have it
*/
Window
ECreateFocusWindow(Window parent, int x, int y, int w, int h)
Window ECreateFocusWindow(Window parent, int x, int y, int w, int h)
{
Window win;
XSetWindowAttributes attr;
@ -741,8 +736,7 @@ WinExists(Window win)
EDBUG_RETURN(0);
}
Window
WindowAtXY_0(Window base, int bx, int by, int x, int y)
Window WindowAtXY_0(Window base, int bx, int by, int x, int y)
{
Window *list = NULL;
XWindowAttributes att;
@ -767,9 +761,7 @@ WindowAtXY_0(Window base, int bx, int by, int x, int y)
wy += by;
if (!((x >= wx) &&
(y >= wy) &&
(x < (int)(wx + ww)) &&
(y < (int)(wy + wh))))
(y >= wy) && (x < (int)(wx + ww)) && (y < (int)(wy + wh))))
EDBUG_RETURN(0);
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);
}
Window
WindowAtXY(int x, int y)
Window WindowAtXY(int x, int y)
{
Window *list = NULL;
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 (!XF86VidModeGetModeLine(disp, root.scr,
&dotclock, &curmode))
if (!XF86VidModeGetModeLine(disp, root.scr, &dotclock, &curmode))
return 0;
mode = FindMode(w, h);
if (mode)
{
jump = GetModeJumpCount(mode);
XWarpPointer(disp, None, root.win,
0, 0, 0, 0, x, y);
XWarpPointer(disp, None, root.win, 0, 0, 0, 0, x, y);
XF86VidModeSetViewPort(disp, root.scr, x, y);
XF86VidModeLockModeSwitch(disp, root.scr, 0);
for (i = 0; i < jump; i++)
@ -203,8 +201,7 @@ Zoom(EWin * ewin)
zoom_last_x = ewin->x;
zoom_last_y = ewin->y;
RaiseEwin(ewin);
MoveEwin(ewin, -ewin->border->border.left,
-ewin->border->border.top);
MoveEwin(ewin, -ewin->border->border.left, -ewin->border->border.top);
ICCCM_Configure(ewin);
FocusToEWin(ewin);
/* XGrabPointer(disp, ewin->client.win, False, 0,