General bug hunt - Found a few, pedantic cleanups, dead code removal.

SVN revision: 18153
This commit is contained in:
Kim Woelders 2005-10-30 19:40:49 +00:00
parent 46265d2e96
commit 0dfa113313
62 changed files with 416 additions and 412 deletions

35
src/E.h
View File

@ -102,10 +102,6 @@
#define __PRINTF__ #define __PRINTF__
#endif #endif
/* workaround for 64bit architectures - xlib expects 32bit CARDINALS to be */
/* long's on 64bit machines... thus well the CARD32's Im unsing shoudl be.. */
#define CARD32 long
#ifndef HAVE_GETCWD #ifndef HAVE_GETCWD
#error "ERROR: Enlightenment needs a system with getcwd() in it's libs." #error "ERROR: Enlightenment needs a system with getcwd() in it's libs."
#error "You may have to upgrade your Operating system, Distribution, base" #error "You may have to upgrade your Operating system, Distribution, base"
@ -815,20 +811,10 @@ void ArrangeEwinCenteredXY(EWin * ewin, int *px, int *py);
void ArrangeEwins(const char *params); void ArrangeEwins(const char *params);
/* borders.c */ /* borders.c */
Border *BorderCreate(const char *name);
void BorderDestroy(Border * b);
void BorderIncRefcount(const Border * b); void BorderIncRefcount(const Border * b);
void BorderDecRefcount(const Border * b); void BorderDecRefcount(const Border * b);
const char *BorderGetName(const Border * b); const char *BorderGetName(const Border * b);
int BorderConfigLoad(FILE * fs); int BorderConfigLoad(FILE * fs);
void BorderWinpartAdd(Border * b, struct _imageclass *ic,
ActionClass * aclass,
struct _textclass *tclass, ECursor * ec,
char ontop, int flags, char isregion,
int wmin, int wmax, int hmin, int hmax,
int torigin, int txp, int txa, int typ,
int tya, int borigin, int bxp, int bxa,
int byp, int bya, char keep_for_shade);
void EwinBorderSelect(EWin * ewin); void EwinBorderSelect(EWin * ewin);
void EwinBorderDetach(EWin * ewin); void EwinBorderDetach(EWin * ewin);
void EwinBorderSetTo(EWin * ewin, const Border * b); void EwinBorderSetTo(EWin * ewin, const Border * b);
@ -840,7 +826,6 @@ void EwinBorderUpdateState(EWin * ewin);
void EwinBorderEventsConfigure(EWin * ewin, int mode); void EwinBorderEventsConfigure(EWin * ewin, int mode);
void EwinSetBorder(EWin * ewin, const Border * b, int apply); void EwinSetBorder(EWin * ewin, const Border * b, int apply);
void EwinSetBorderByName(EWin * ewin, const char *name); void EwinSetBorderByName(EWin * ewin, const char *name);
void BorderWinpartChange(EWin * ewin, int i, int force);
int BorderWinpartIndex(EWin * ewin, Window win); int BorderWinpartIndex(EWin * ewin, Window win);
Border *BorderCreateFiller(int left, int right, int top, Border *BorderCreateFiller(int left, int right, int top,
int bottom); int bottom);
@ -896,7 +881,6 @@ void DialogAlertOK(const char *fmt, ...);
/* dock.c */ /* dock.c */
void DockIt(EWin * ewin); void DockIt(EWin * ewin);
void DockDestroy(EWin * ewin);
/* draw.c */ /* draw.c */
Imlib_Image *ELoadImage(const char *file); Imlib_Image *ELoadImage(const char *file);
@ -966,27 +950,20 @@ void ExtInitWinKill(void);
void Etmp(char *s); void Etmp(char *s);
void E_md(const char *s); void E_md(const char *s);
int exists(const char *s); int exists(const char *s);
void mkdirs(const char *s);
int isfile(const char *s); int isfile(const char *s);
int isdir(const char *s); int isdir(const char *s);
int isabspath(const char *s); int isabspath(const char *s);
char **E_ls(const char *dir, int *num); char **E_ls(const char *dir, int *num);
void E_rm(const char *s); void E_rm(const char *s);
void E_mv(const char *s, const char *ss); void E_mv(const char *s, const char *ss);
void E_cp(const char *s, const char *ss);
time_t moddate(const char *s); time_t moddate(const char *s);
int filesize(const char *s);
int fileinode(const char *s); int fileinode(const char *s);
int filedev_map(int dev); int filedev_map(int dev);
int filedev(const char *s); int filedev(const char *s);
void E_cd(const char *s);
char *cwd(void);
int permissions(const char *s);
char *username(int uid); char *username(int uid);
char *homedir(int uid); char *homedir(int uid);
char *usershell(int uid); char *usershell(int uid);
const char *atword(const char *s, int num); const char *atword(const char *s, int num);
const char *atchar(const char *s, char c);
void word(const char *s, int num, char *wd); void word(const char *s, int num, char *wd);
int canread(const char *s); int canread(const char *s);
int canwrite(const char *s); int canwrite(const char *s);
@ -1021,10 +998,7 @@ EWin **ListWinGroupMembersForEwin(const EWin * ewin, int action,
#define FOCUS_CLICK 12 #define FOCUS_CLICK 12
void FocusEnable(int on); void FocusEnable(int on);
void FocusGetNextEwin(void);
void FocusGetPrevEwin(void);
void FocusEwinSetGrabs(EWin * ewin); void FocusEwinSetGrabs(EWin * ewin);
void FocusFix(void);
void FocusToEWin(EWin * ewin, int why); void FocusToEWin(EWin * ewin, int why);
void FocusHandleEnter(EWin * ewin, XEvent * ev); void FocusHandleEnter(EWin * ewin, XEvent * ev);
void FocusHandleLeave(EWin * ewin, XEvent * ev); void FocusHandleLeave(EWin * ewin, XEvent * ev);
@ -1049,16 +1023,10 @@ void GrabButtonRelease(unsigned int button,
unsigned int modifiers, Window win); unsigned int modifiers, Window win);
/* groups.c */ /* groups.c */
void BreakWindowGroup(EWin * ewin, Group * g);
void BuildWindowGroup(EWin ** ewins, int num); void BuildWindowGroup(EWin ** ewins, int num);
int EwinInGroup(EWin * ewin, Group * g);
Group *EwinsInGroup(EWin * ewin1, EWin * ewin2); Group *EwinsInGroup(EWin * ewin1, EWin * ewin2);
void AddEwinToGroup(EWin * ewin, Group * g); void AddEwinToGroup(EWin * ewin, Group * g);
void RemoveEwinFromGroup(EWin * ewin, Group * g);
void GroupsEwinRemove(EWin * ewin); void GroupsEwinRemove(EWin * ewin);
void ShowHideWinGroups(EWin * ewin, Group * g, char onoff);
void ChooseGroupDialog(EWin * ewin, char *message,
char group_select, int action);
void SaveGroups(void); void SaveGroups(void);
/* handlers.c */ /* handlers.c */
@ -1204,8 +1172,6 @@ void autosave(void);
/* settings.c */ /* settings.c */
void SettingsMoveResize(void); void SettingsMoveResize(void);
void SettingsDesktops(void);
void SettingsArea(void);
void SettingsPlacement(void); void SettingsPlacement(void);
void SettingsAutoRaise(void); void SettingsAutoRaise(void);
void SettingsMiscellaneous(void); void SettingsMiscellaneous(void);
@ -1263,7 +1229,6 @@ void WarpFocus(int delta);
typedef struct _windowmatch WindowMatch; typedef struct _windowmatch WindowMatch;
int WindowMatchConfigLoad(FILE * fs); int WindowMatchConfigLoad(FILE * fs);
void *WindowMatchEwin(EWin * ewin);
Border *WindowMatchEwinBorder(const EWin * ewin); Border *WindowMatchEwinBorder(const EWin * ewin);
const char *WindowMatchEwinIcon(const EWin * ewin); const char *WindowMatchEwinIcon(const EWin * ewin);
void WindowMatchEwinOps(EWin * ewin); void WindowMatchEwinOps(EWin * ewin);

View File

@ -125,8 +125,9 @@ ActionAddTo(Action * aa, const char *params)
{ {
ActionType *pptr, *ptr, *at; ActionType *pptr, *ptr, *at;
pptr = NULL;
at = Emalloc(sizeof(ActionType)); at = Emalloc(sizeof(ActionType));
if (!at)
return;
at->next = NULL; at->next = NULL;
at->params = Estrdup(params); at->params = Estrdup(params);
if (!aa->action) if (!aa->action)
@ -135,13 +136,15 @@ ActionAddTo(Action * aa, const char *params)
} }
else else
{ {
pptr = NULL;
ptr = aa->action; ptr = aa->action;
while (ptr) while (ptr)
{ {
pptr = ptr; pptr = ptr;
ptr = ptr->next; ptr = ptr->next;
} }
pptr->next = at; if (pptr)
pptr->next = at;
} }
} }
@ -187,7 +190,8 @@ ActionclassDestroy(ActionClass * ac)
ac->ref_count); ac->ref_count);
return; return;
} }
while (RemoveItemByPtr(ac, LIST_TYPE_ACLASS)); while (RemoveItemByPtr(ac, LIST_TYPE_ACLASS))
;
for (i = 0; i < ac->num; i++) for (i = 0; i < ac->num; i++)
ActionDestroy(ac->list[i]); ActionDestroy(ac->list[i]);
@ -579,7 +583,7 @@ ActionEncode(Action * aa, char *buf, int len)
{ {
char s[32], *p; char s[32], *p;
if ((!aa) || (!aa->action) || (!aa->event == EVENT_KEY_DOWN) || if ((!aa) || (!aa->action) || (aa->event != EVENT_KEY_DOWN) ||
(!aa->key_str)) (!aa->key_str))
return 0; return 0;
@ -1270,7 +1274,7 @@ IPC_KeybindingsSet(const char *params, Client * c __UNUSED__)
AclassConfigSave(); AclassConfigSave();
} }
IpcItem AclassIpcArray[] = { static const IpcItem AclassIpcArray[] = {
{ {
AclassIpc, AclassIpc,
"aclass", "ac", "aclass", "ac",

View File

@ -48,6 +48,8 @@ runApp(const char *exe, const char *params)
{ {
Efree(path); Efree(path);
real_exec = Emalloc(strlen(params) + 6); real_exec = Emalloc(strlen(params) + 6);
if (!real_exec)
return;
sprintf(real_exec, "exec %s", params); sprintf(real_exec, "exec %s", params);
execl(sh, sh, "-c", real_exec, NULL); execl(sh, sh, "-c", real_exec, NULL);
exit(0); exit(0);
@ -129,13 +131,14 @@ runApp(const char *exe, const char *params)
"This is because the file is not a " "This is because the file is not a "
"regular file.\n"), path); "regular file.\n"), path);
} }
if (path) Efree(path);
Efree(path);
} }
} }
exit(100); exit(100);
} }
real_exec = Emalloc(strlen(params) + 6); real_exec = Emalloc(strlen(params) + 6);
if (!real_exec)
return;
sprintf(real_exec, "exec %s", params); sprintf(real_exec, "exec %s", params);
execl(sh, sh, "-c", real_exec, NULL); execl(sh, sh, "-c", real_exec, NULL);
exit(0); exit(0);

View File

@ -154,7 +154,7 @@ ShowAlert(char *text)
XSetWindowAttributes att; XSetWindowAttributes att;
XRectangle rect1, rect2; XRectangle rect1, rect2;
char colorful; char colorful;
unsigned long cols[256]; unsigned long cols[5];
XColor xcl; XColor xcl;
Colormap cmap; Colormap cmap;
int cnum, fh, x, y, ww, hh, mh; int cnum, fh, x, y, ww, hh, mh;
@ -200,6 +200,7 @@ ShowAlert(char *text)
cnum = 0; cnum = 0;
colorful = 0; colorful = 0;
cols[0] = cols[1] = cols[2] = cols[3] = cols[4] = 0;
if (DefaultDepth(dd, DefaultScreen(dd)) > 4) if (DefaultDepth(dd, DefaultScreen(dd)) > 4)
{ {
ExSetColor(&xcl, 220, 220, 220); ExSetColor(&xcl, 220, 220, 220);
@ -437,7 +438,8 @@ ShowAlert(char *text)
case Expose: case Expose:
/* Flush all other Expose events */ /* Flush all other Expose events */
while (XCheckTypedWindowEvent(dd, ev.xexpose.window, Expose, &ev)); while (XCheckTypedWindowEvent(dd, ev.xexpose.window, Expose, &ev))
;
ExTextExtents(xfs, title, strlen(title), &rect1, &rect2); ExTextExtents(xfs, title, strlen(title), &rect1, &rect2);
w = rect2.width; w = rect2.width;
@ -597,16 +599,16 @@ AlertX(const char *title, const char *ignore,
const char *restart, const char *quit, const char *fmt, ...) const char *restart, const char *quit, const char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list args;
AssignTitleText(title); AssignTitleText(title);
AssignIgnoreText(ignore); AssignIgnoreText(ignore);
AssignRestartText(restart); AssignRestartText(restart);
AssignExitText(quit); AssignExitText(quit);
va_start(ap, fmt); va_start(args, fmt);
Evsnprintf(text, 10240, fmt, ap); Evsnprintf(text, 10240, fmt, args);
va_end(ap); va_end(args);
SoundPlay("SOUND_ALERT"); SoundPlay("SOUND_ALERT");
ShowAlert(text); ShowAlert(text);
@ -620,11 +622,11 @@ void
Alert(const char *fmt, ...) Alert(const char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list args;
va_start(ap, fmt); va_start(args, fmt);
Evsnprintf(text, 10240, fmt, ap); Evsnprintf(text, 10240, fmt, args);
va_end(ap); va_end(args);
SoundPlay("SOUND_ALERT"); SoundPlay("SOUND_ALERT");
ShowAlert(text); ShowAlert(text);
} }

View File

@ -195,7 +195,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
} }
/* fill the allocation array */ /* fill the allocation array */
for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0)
;
for (j = 0; j < num_sorted; j++) for (j = 0; j < num_sorted; j++)
{ {
x1 = -1; x1 = -1;
@ -405,7 +406,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h); ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
} }
/* fill the allocation array */ /* fill the allocation array */
for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0); for (j = 0; j < (xsize - 1) * (ysize - 1); filled[j++] = 0)
;
for (j = 0; j < num_sorted; j++) for (j = 0; j < num_sorted; j++)
{ {
x1 = -1; x1 = -1;
@ -605,6 +607,8 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
if (lst1) if (lst1)
{ {
lst = malloc(num * sizeof(EWin *)); lst = malloc(num * sizeof(EWin *));
if (!lst)
return;
memcpy(lst, lst1, num * sizeof(EWin *)); memcpy(lst, lst1, num * sizeof(EWin *));
} }
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup

View File

@ -668,7 +668,7 @@ BackgroundApply(Background * bg, Drawable draw,
imlib_context_set_drawable(pmap); imlib_context_set_drawable(pmap);
imlib_render_image_on_drawable_at_size(0, 0, w, h); imlib_render_image_on_drawable_at_size(0, 0, w, h);
if (x == 0 && y == 0) if (x == 0 && y == 0) /* Hmmm. Always true. */
{ {
ESetWindowBackgroundPixmap(draw, pmap); ESetWindowBackgroundPixmap(draw, pmap);
} }
@ -1161,7 +1161,8 @@ BackgroundsConfigLoad(FILE * fs)
case CONFIG_CLASSNAME: case CONFIG_CLASSNAME:
case BG_NAME: case BG_NAME:
if ((bg = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND))) bg = FindItem(s2, 0, LIST_FINDBY_NAME, LIST_TYPE_BACKGROUND);
if (bg)
{ {
ignore = 1; ignore = 1;
} }
@ -1610,17 +1611,15 @@ BG_GetValues(void)
static void static void
BG_DialogSetFileName(DItem * di) BG_DialogSetFileName(DItem * di)
{ {
char *stmp; char *stmp = NULL;
char s[1024]; char s[1024];
if (BackgroundGetBgFile(tmp_bg)) if (BackgroundGetBgFile(tmp_bg))
stmp = fullfileof(BackgroundGetBgFile(tmp_bg)); stmp = fullfileof(BackgroundGetBgFile(tmp_bg));
else
stmp = Estrdup(_("-NONE-"));
Esnprintf(s, sizeof(s), Esnprintf(s, sizeof(s),
_("Background definition information:\nName: %s\nFile: %s\n"), _("Background definition information:\nName: %s\nFile: %s\n"),
BackgroundGetName(tmp_bg), stmp); BackgroundGetName(tmp_bg), (stmp) ? stmp : _("-NONE-"));
Efree(stmp); _EFREE(stmp);
DialogItemSetText(di, s); DialogItemSetText(di, s);
} }
@ -2104,7 +2103,8 @@ SettingsBackground(Background * bg)
int num; int num;
char s[1024]; char s[1024];
if ((d = FindItem("CONFIGURE_BG", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_BG", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2112,7 +2112,7 @@ SettingsBackground(Background * bg)
} }
SoundPlay("SOUND_SETTINGS_BG"); SoundPlay("SOUND_SETTINGS_BG");
if (!bg || (bg && BackgroundIsNone(bg))) if (!bg || BackgroundIsNone(bg))
{ {
Esnprintf(s, sizeof(s), "__NEWBG_%i", (unsigned)time(NULL)); Esnprintf(s, sizeof(s), "__NEWBG_%i", (unsigned)time(NULL));
bg = BackgroundCreate(s, NULL, NULL, 1, 1, 0, 0, 0, 0, NULL, 1, bg = BackgroundCreate(s, NULL, NULL, 1, 1, 0, 0, 0, 0, NULL, 1,
@ -2739,7 +2739,7 @@ IPC_BackgroundColormodifierGet(const char *params, Client * c)
} }
#endif #endif
IpcItem BackgroundsIpcArray[] = { static const IpcItem BackgroundsIpcArray[] = {
{ {
BackgroundsIpc, BackgroundsIpc,
"background", "bg", "background", "bg",

View File

@ -29,7 +29,6 @@
#include "tclass.h" #include "tclass.h"
#include "tooltips.h" #include "tooltips.h"
#include "xwin.h" #include "xwin.h"
#include <sys/time.h>
#define EWIN_BORDER_PART_EVENT_MASK \ #define EWIN_BORDER_PART_EVENT_MASK \
(KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \ (KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
@ -37,6 +36,7 @@
#define EWIN_BORDER_TITLE_EVENT_MASK \ #define EWIN_BORDER_TITLE_EVENT_MASK \
(EWIN_BORDER_PART_EVENT_MASK) (EWIN_BORDER_PART_EVENT_MASK)
static void BorderDestroy(Border * b);
static void BorderWinpartHandleEvents(XEvent * ev, void *prm); static void BorderWinpartHandleEvents(XEvent * ev, void *prm);
static void BorderFrameHandleEvents(XEvent * ev, void *prm); static void BorderFrameHandleEvents(XEvent * ev, void *prm);
@ -143,7 +143,7 @@ BorderWinpartDraw(EWin * ewin, int i)
return ret; return ret;
} }
void static void
BorderWinpartChange(EWin * ewin, int i, int force) BorderWinpartChange(EWin * ewin, int i, int force)
{ {
BorderWinpartITclassApply(ewin, i, force); BorderWinpartITclassApply(ewin, i, force);
@ -597,8 +597,7 @@ EwinSetBorder(EWin * ewin, const Border * b, int apply)
if (ewin->border) if (ewin->border)
BorderDecRefcount(ewin->border); BorderDecRefcount(ewin->border);
ewin->border = b; ewin->border = b;
if (b) BorderIncRefcount(b);
BorderIncRefcount(b);
} }
if (!ewin->state.fullscreen) if (!ewin->state.fullscreen)
@ -615,7 +614,7 @@ EwinSetBorderByName(EWin * ewin, const char *name)
EwinSetBorder(ewin, b, 0); EwinSetBorder(ewin, b, 0);
} }
Border * static Border *
BorderCreate(const char *name) BorderCreate(const char *name)
{ {
Border *b; Border *b;
@ -631,7 +630,7 @@ BorderCreate(const char *name)
return b; return b;
} }
void static void
BorderDestroy(Border * b) BorderDestroy(Border * b)
{ {
int i; int i;
@ -645,7 +644,8 @@ BorderDestroy(Border * b)
return; return;
} }
while (RemoveItemByPtr(b, LIST_TYPE_BORDER)); while (RemoveItemByPtr(b, LIST_TYPE_BORDER))
;
for (i = 0; i < b->num_winparts; i++) for (i = 0; i < b->num_winparts; i++)
{ {
@ -670,20 +670,19 @@ BorderDestroy(Border * b)
ActionclassDecRefcount(b->aclass); ActionclassDecRefcount(b->aclass);
} }
void static void
BorderWinpartAdd(Border * b, ImageClass * iclass, ActionClass * aclass, BorderWinpartAdd(Border * b, ImageClass * iclass, ActionClass * aclass,
TextClass * tclass, ECursor * ec, char ontop, int flags, TextClass * tclass, ECursor * ec, char ontop, int flags,
char isregion, int wmin, int wmax, int hmin, int hmax, char isregion __UNUSED__, int wmin, int wmax, int hmin,
int torigin, int txp, int txa, int typ, int tya, int borigin, int hmax, int torigin, int txp, int txa, int typ, int tya,
int bxp, int bxa, int byp, int bya, char keep_for_shade) int borigin, int bxp, int bxa, int byp, int bya,
char keep_for_shade)
{ {
int n; int n;
b->num_winparts++; b->num_winparts++;
n = b->num_winparts; n = b->num_winparts;
isregion = 0;
b->part = Erealloc(b->part, n * sizeof(WinPart)); b->part = Erealloc(b->part, n * sizeof(WinPart));
if (!iclass) if (!iclass)
@ -1031,7 +1030,7 @@ BorderWinpartHandleEvents(XEvent * ev, void *prm)
#include "conf.h" #include "conf.h"
static int static int
BorderPartLoad(FILE * fs, char type, Border * b) BorderPartLoad(FILE * fs, char type __UNUSED__, Border * b)
{ {
int err = 0; int err = 0;
char s[FILEPATH_LEN_MAX]; char s[FILEPATH_LEN_MAX];
@ -1049,7 +1048,6 @@ BorderPartLoad(FILE * fs, char type, Border * b)
int bxp = 0, bxa = 0, byp = 0, bya = 0; int bxp = 0, bxa = 0, byp = 0, bya = 0;
int fields; int fields;
type = 0;
while (GetLine(s, sizeof(s), fs)) while (GetLine(s, sizeof(s), fs))
{ {
s2[0] = 0; s2[0] = 0;

View File

@ -180,7 +180,8 @@ ButtonDestroy(Button * b)
return; return;
} }
while (RemoveItemByPtr(b, LIST_TYPE_BUTTON)); while (RemoveItemByPtr(b, LIST_TYPE_BUTTON))
;
EoFini(b); EoFini(b);
@ -697,6 +698,7 @@ ButtonsConfigLoad(FILE * ConfigFile)
char show = 1; char show = 1;
char internal = 0; char internal = 0;
int fields; int fields;
const char *ss;
while (GetLine(s, sizeof(s), ConfigFile)) while (GetLine(s, sizeof(s), ConfigFile))
{ {
@ -745,7 +747,8 @@ ButtonsConfigLoad(FILE * ConfigFile)
break; break;
case BUTTON_LABEL: case BUTTON_LABEL:
_EFREE(label); _EFREE(label);
label = Estrdup(atword(s, 2)); ss = atword(s, 2);
label = Estrdup(ss);
if (pbt) if (pbt)
{ {
_EFREE(pbt->label); _EFREE(pbt->label);
@ -1132,7 +1135,7 @@ IPC_ButtonShow(const char *params, Client * c __UNUSED__)
doHideShowButton(params); doHideShowButton(params);
} }
IpcItem ButtonsIpcArray[] = { static const IpcItem ButtonsIpcArray[] = {
{ {
ButtonsIpc, ButtonsIpc,
"button", "btn", "button", "btn",

View File

@ -21,9 +21,9 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "E.h" #include "E.h"
#include "conf.h"
#if ENABLE_COLOR_MODIFIERS #if ENABLE_COLOR_MODIFIERS
#include "conf.h"
void void
CreateCurve(ModCurve * c) CreateCurve(ModCurve * c)
@ -644,7 +644,7 @@ IPC_ColormodifierSet(const char *params, Client * c __UNUSED__)
Efree(bpy); Efree(bpy);
} }
IpcItem CmClassIpcArray[] = { static const IpcItem CmClassIpcArray[] = {
{ {
IPC_ColorModifierClass, IPC_ColorModifierClass,
"colormod", NULL, "colormod", NULL,

View File

@ -27,7 +27,6 @@
#include "conf.h" #include "conf.h"
#include "menus.h" #include "menus.h"
#include "tooltips.h" #include "tooltips.h"
#include <ctype.h>
#define SKIP_If_EXISTS(name, type) \ #define SKIP_If_EXISTS(name, type) \
if (ConfigSkipIfExists(ConfigFile, name, type)) return if (ConfigSkipIfExists(ConfigFile, name, type)) return

View File

@ -115,7 +115,8 @@ ECursorDestroy(ECursor * ec)
return; return;
} }
while (RemoveItemByPtr(ec, LIST_TYPE_ECURSOR)); while (RemoveItemByPtr(ec, LIST_TYPE_ECURSOR))
;
if (ec->name) if (ec->name)
Efree(ec->name); Efree(ec->name);
@ -184,12 +185,12 @@ ECursorConfigLoad(FILE * fs)
_EFDUP(name, s2); _EFDUP(name, s2);
break; break;
case CURS_BG_RGB: case CURS_BG_RGB:
EGetColor(&xclr, &r, &g, &b); r = g = b = 0;
sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b); sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b);
ESetColor(&xclr, r, g, b); ESetColor(&xclr, r, g, b);
break; break;
case CURS_FG_RGB: case CURS_FG_RGB:
EGetColor(&xclr2, &r, &g, &b); r = g = b = 255;
sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b); sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b);
ESetColor(&xclr2, r, g, b); ESetColor(&xclr2, r, g, b);
break; break;
@ -354,7 +355,7 @@ CursorsIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem CursorIpcArray[] = { static const IpcItem CursorIpcArray[] = {
{ {
CursorsIpc, CursorsIpc,
"cursor", "csr", "cursor", "csr",

View File

@ -71,7 +71,7 @@ DeskControlsCreate(Desk * dsk)
{ {
char s[512]; char s[512];
ActionClass *ac, *ac2, *ac3; ActionClass *ac, *ac2, *ac3;
ImageClass *ic, *ic2, *ic3, *ic4; ImageClass *ic, *ic2, *ic3;
Button *b; Button *b;
Action *a; Action *a;
int x[3], y[3], w[3], h[3], m, n, o; int x[3], y[3], w[3], h[3], m, n, o;
@ -165,14 +165,18 @@ DeskControlsCreate(Desk * dsk)
ic = ImageclassFind("DESKTOP_DRAGBUTTON_VERT", 0); ic = ImageclassFind("DESKTOP_DRAGBUTTON_VERT", 0);
ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_VERT", 0); ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_VERT", 0);
ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_VERT", 0); ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_VERT", 0);
#if 0
ic4 = ImageclassFind("DESKTOP_DESKRAY_VERT", 0); ic4 = ImageclassFind("DESKTOP_DESKRAY_VERT", 0);
#endif
} }
else else
{ {
ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0); ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0);
ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_HORIZ", 0); ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_HORIZ", 0);
ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_HORIZ", 0); ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_HORIZ", 0);
#if 0
ic4 = ImageclassFind("DESKTOP_DESKRAY_HORIZ", 0); ic4 = ImageclassFind("DESKTOP_DESKRAY_HORIZ", 0);
#endif
} }
switch (Conf.desks.dragbar_ordering) switch (Conf.desks.dragbar_ordering)
@ -216,6 +220,7 @@ DeskControlsCreate(Desk * dsk)
switch (Conf.desks.dragdir) switch (Conf.desks.dragdir)
{ {
default:
case 0: case 0:
w[0] = w[1] = w[2] = h[0] = h[1] = Conf.desks.dragbar_width; w[0] = w[1] = w[2] = h[0] = h[1] = Conf.desks.dragbar_width;
if (Conf.desks.dragbar_length == 0) if (Conf.desks.dragbar_length == 0)
@ -260,8 +265,6 @@ DeskControlsCreate(Desk * dsk)
x[n] = x[m] + w[m]; x[n] = x[m] + w[m];
x[o] = x[n] + w[n]; x[o] = x[n] + w[n];
break; break;
default:
break;
} }
b = NULL; b = NULL;
@ -621,7 +624,7 @@ DesksClear(void)
} }
} }
void static void
DesksResize(int w, int h) DesksResize(int w, int h)
{ {
unsigned int i; unsigned int i;
@ -1889,15 +1892,15 @@ CB_DesktopDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
DialogDrawItems(tmp_desk_dialog, tmp_desk_text, 0, 0, 99999, 99999); DialogDrawItems(tmp_desk_dialog, tmp_desk_text, 0, 0, 99999, 99999);
} }
void static void
SettingsDesktops(void) SettingsDesktops(void)
{ {
Dialog *d; Dialog *d;
DItem *table, *di, *area, *slider, *radio; DItem *table, *di, *area, *slider, *radio;
char s[64]; char s[64];
if ((d = d = FindItem("CONFIGURE_DESKTOPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_DESKTOPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2110,14 +2113,15 @@ CB_AreaDisplayRedraw(Dialog * d __UNUSED__, int val, void *data)
DialogDrawItems(tmp_area_dialog, tmp_area_text, 0, 0, 99999, 99999); DialogDrawItems(tmp_area_dialog, tmp_area_text, 0, 0, 99999, 99999);
} }
void static void
SettingsArea(void) SettingsArea(void)
{ {
Dialog *d; Dialog *d;
DItem *table, *di, *area, *slider, *slider2, *table2; DItem *table, *di, *area, *slider, *slider2, *table2;
char s[64]; char s[64];
if ((d = FindItem("CONFIGURE_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_AREA", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2388,7 +2392,7 @@ DesksIpcArea(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem DesksIpcArray[] = { static const IpcItem DesksIpcArray[] = {
{ {
DesksIpcDesk, DesksIpcDesk,
"desk", NULL, "desk", NULL,

View File

@ -78,6 +78,5 @@ void DesksSetCurrent(Desk * dsk);
void DeskGetCurrentArea(int *ax, int *ay); void DeskGetCurrentArea(int *ax, int *ay);
void DeskSetCurrentArea(int ax, int ay); void DeskSetCurrentArea(int ax, int ay);
void DesksClear(void); void DesksClear(void);
void DesksResize(int w, int h);
#endif /* _DESKTOPS_H_ */ #endif /* _DESKTOPS_H_ */

View File

@ -197,12 +197,14 @@ struct _dialog
}; };
static Dialog *FindDialog(Window win); static Dialog *FindDialog(Window win);
static int FindADialog(void);
static void DialogHandleEvents(XEvent * ev, void *prm); static void DialogHandleEvents(XEvent * ev, void *prm);
static void DButtonHandleEvents(XEvent * ev, void *prm); static void DButtonHandleEvents(XEvent * ev, void *prm);
static void MoveTableBy(Dialog * d, DItem * di, int dx, int dy); static void MoveTableBy(Dialog * d, DItem * di, int dx, int dy);
static void DialogItemsRealize(Dialog * d); static void DialogItemsRealize(Dialog * d);
static void DialogFreeItem(DItem * di);
static void DialogUpdate(Dialog * d); static void DialogUpdate(Dialog * d);
static char dialog_update_pending = 0; static char dialog_update_pending = 0;
@ -957,13 +959,11 @@ DialogRealizeItem(Dialog * d, DItem * di)
def = "DIALOG_WIDGET_BUTTON"; def = "DIALOG_WIDGET_BUTTON";
} }
if (def) if (!di->tclass)
{ di->tclass = TextclassFind(def, 1);
if (!di->tclass) if (!di->iclass)
di->tclass = TextclassFind(def, 1); di->iclass = ImageclassFind(def, 1);
if (!di->iclass)
di->iclass = ImageclassFind(def, 1);
}
if (di->tclass) if (di->tclass)
TextclassIncRefcount(di->tclass); TextclassIncRefcount(di->tclass);
if (di->iclass) if (di->iclass)
@ -1220,7 +1220,7 @@ DialogRealizeItem(Dialog * d, DItem * di)
cols = di->item.table.num_columns; cols = di->item.table.num_columns;
rows = 1; rows = 1;
if ((cols > 0) && (rows > 0)) if (cols > 0)
{ {
int i, r, c, x, y; int i, r, c, x, y;
int *col_size, *row_size; int *col_size, *row_size;
@ -2004,7 +2004,8 @@ DialogItemFindWindow(DItem * di, Window win)
for (i = 0; i < di->item.table.num_items; i++) for (i = 0; i < di->item.table.num_items; i++)
{ {
if ((dii = DialogItemFindWindow(di->item.table.items[i], win))) dii = DialogItemFindWindow(di->item.table.items[i], win);
if (dii)
return dii; return dii;
} }
} }
@ -2019,12 +2020,6 @@ DialogItemFindWindow(DItem * di, Window win)
return NULL; return NULL;
} }
DItem *
DialogItem(Dialog * d)
{
return d->item;
}
/* Convenience callback to close dialog */ /* Convenience callback to close dialog */
void void
DialogCallbackClose(Dialog * d, int val __UNUSED__, void *data __UNUSED__) DialogCallbackClose(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
@ -2040,11 +2035,11 @@ void
DialogOK(const char *title, const char *fmt, ...) DialogOK(const char *title, const char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list args;
va_start(ap, fmt); va_start(args, fmt);
Evsnprintf(text, sizeof(text), fmt, ap); Evsnprintf(text, sizeof(text), fmt, args);
va_end(ap); va_end(args);
DialogOKstr(title, text); DialogOKstr(title, text);
} }
@ -2066,11 +2061,11 @@ void
DialogAlert(const char *fmt, ...) DialogAlert(const char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list args;
va_start(ap, fmt); va_start(args, fmt);
Evsnprintf(text, 10240, fmt, ap); Evsnprintf(text, 10240, fmt, args);
va_end(ap); va_end(args);
Alert(text); Alert(text);
} }
@ -2078,11 +2073,11 @@ void
DialogAlertOK(const char *fmt, ...) DialogAlertOK(const char *fmt, ...)
{ {
char text[10240]; char text[10240];
va_list ap; va_list args;
va_start(ap, fmt); va_start(args, fmt);
Evsnprintf(text, 10240, fmt, ap); Evsnprintf(text, 10240, fmt, args);
va_end(ap); va_end(args);
AlertX(_("Attention !!!"), _("OK"), NULL, NULL, text); AlertX(_("Attention !!!"), _("OK"), NULL, NULL, text);
} }
@ -2563,7 +2558,7 @@ FindEwinByDialog(Dialog * d)
return NULL; return NULL;
} }
int static int
FindADialog(void) FindADialog(void)
{ {
EWin *const *ewins; EWin *const *ewins;

View File

@ -77,7 +77,6 @@ void DialogAddFooter(Dialog * d, int flags,
DialogCallbackFunc * cb); DialogCallbackFunc * cb);
DItem *DialogInitItem(Dialog * d); DItem *DialogInitItem(Dialog * d);
DItem *DialogAddItem(DItem * dii, int type); DItem *DialogAddItem(DItem * dii, int type);
DItem *DialogItem(Dialog * d);
void DialogItemSetCallback(DItem * di, DialogCallbackFunc * func, void DialogItemSetCallback(DItem * di, DialogCallbackFunc * func,
int val, void *data); int val, void *data);
void DialogItemSetClass(DItem * di, struct _imageclass *ic, void DialogItemSetClass(DItem * di, struct _imageclass *ic,
@ -101,7 +100,6 @@ void DialogItemTableSetOptions(DItem * di, int num_columns,
void DialogItemSeparatorSetOrientation(DItem * di, void DialogItemSeparatorSetOrientation(DItem * di,
char horizontal); char horizontal);
void DialogItemImageSetFile(DItem * di, const char *image); void DialogItemImageSetFile(DItem * di, const char *image);
void DialogFreeItem(DItem * di);
void DialogItemSetRowSpan(DItem * di, int row_span); void DialogItemSetRowSpan(DItem * di, int row_span);
void DialogItemSetColSpan(DItem * di, int col_span); void DialogItemSetColSpan(DItem * di, int col_span);
void DialogItemRadioButtonSetFirst(DItem * di, DItem * first); void DialogItemRadioButtonSetFirst(DItem * di, DItem * first);
@ -131,6 +129,5 @@ void DialogCallbackClose(Dialog * d, int val, void *data);
void DialogsCheckUpdate(void); void DialogsCheckUpdate(void);
EWin *FindEwinByDialog(Dialog * d); EWin *FindEwinByDialog(Dialog * d);
int FindADialog(void);
#endif /* _DIALOG_H_ */ #endif /* _DIALOG_H_ */

View File

@ -715,30 +715,30 @@ DrawEwinShape(EWin * ewin, int md, int x, int y, int w, int h, char firstlast)
#define DRAW_H_ARROW(x1, x2, y1) \ #define DRAW_H_ARROW(x1, x2, y1) \
if (((x2) - (x1)) >= 12) \ if (((x2) - (x1)) >= 12) \
{ \ { \
XDrawLine(disp, root, gc, x1, y1, (x1) + 6, (y1) - 3); \ XDrawLine(disp, root, gc, (x1), (y1), (x1) + 6, (y1) - 3); \
XDrawLine(disp, root, gc, x1, y1, (x1) + 6, (y1) + 3); \ XDrawLine(disp, root, gc, (x1), (y1), (x1) + 6, (y1) + 3); \
XDrawLine(disp, root, gc, x2, y1, (x2) - 6, (y1) - 3); \ XDrawLine(disp, root, gc, (x2), (y1), (x2) - 6, (y1) - 3); \
XDrawLine(disp, root, gc, x2, y1, (x2) - 6, (y1) + 3); \ XDrawLine(disp, root, gc, (x2), (y1), (x2) - 6, (y1) + 3); \
} \ } \
if ((x2) >= (x1)) \ if ((x2) >= (x1)) \
{ \ { \
XDrawLine(disp, root, gc, x1, y1, x2, y1); \ XDrawLine(disp, root, gc, (x1), (y1), (x2), (y1)); \
Esnprintf(str, sizeof(str), "%i", (x2) - (x1) + 1); \ Esnprintf(str, sizeof(str), "%i", (x2) - (x1) + 1); \
XDrawString(disp, root, gc, ((x1) + (x2)) / 2, (y1) - 10, str, strlen(str)); \ XDrawString(disp, root, gc, ((x1) + (x2)) / 2, (y1) - 10, str, strlen(str)); \
} }
#define DRAW_V_ARROW(y1, y2, x1) \ #define DRAW_V_ARROW(y1, y2, x1) \
if (((y2) - (y1)) >= 12) \ if (((y2) - (y1)) >= 12) \
{ \ { \
XDrawLine(disp, root, gc, x1, y1, (x1) + 3, (y1) + 6); \ XDrawLine(disp, root, gc, (x1), (y1), (x1) + 3, (y1) + 6); \
XDrawLine(disp, root, gc, x1, y1, (x1) - 3, (y1) + 6); \ XDrawLine(disp, root, gc, (x1), (y1), (x1) - 3, (y1) + 6); \
XDrawLine(disp, root, gc, x1, y2, (x1) + 3, (y2) - 6); \ XDrawLine(disp, root, gc, (x1), (y2), (x1) + 3, (y2) - 6); \
XDrawLine(disp, root, gc, x1, y2, (x1) - 3, (y2) - 6); \ XDrawLine(disp, root, gc, (x1), (y2), (x1) - 3, (y2) - 6); \
} \ } \
if ((y2) >= (y1)) \ if ((y2) >= (y1)) \
{ \ { \
XDrawLine(disp, root, gc, x1, y1, x1, y2); \ XDrawLine(disp, root, gc, (x1), (y1), (x1), (y2)); \
Esnprintf(str, sizeof(str), "%i", (y2) - (y1) + 1); \ Esnprintf(str, sizeof(str), "%i", (y2) - (y1) + 1); \
XDrawString(disp, root, gc, x1 + 10, ((y1) + (y2)) / 2, str, strlen(str)); \ XDrawString(disp, root, gc, (x1) + 10, ((y1) + (y2)) / 2, str, strlen(str)); \
} }
#define DO_DRAW_MODE_1(aa, bb, cc, dd) \ #define DO_DRAW_MODE_1(aa, bb, cc, dd) \
if (!font) \ if (!font) \

View File

@ -43,7 +43,6 @@
#include <unistd.h> #include <unistd.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <X11/extensions/Xcomposite.h> #include <X11/extensions/Xcomposite.h>
#include <X11/extensions/Xdamage.h> #include <X11/extensions/Xdamage.h>
#include <X11/extensions/Xrender.h> #include <X11/extensions/Xrender.h>
@ -1684,7 +1683,7 @@ ECompMgrCheckAlphaMask(ECmWinInfo * cw)
{ {
if (cw->opacity != OPAQUE && !cw->alphaPict) if (cw->opacity != OPAQUE && !cw->alphaPict)
cw->alphaPict = EPictureCreateSolid(False, (double)cw->opacity / OPAQUE, cw->alphaPict = EPictureCreateSolid(False, (double)cw->opacity / OPAQUE,
0, 0, 0); 0., 0., 0.);
} }
static void static void
@ -1786,7 +1785,6 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
if (eo->type == EOBJ_TYPE_DESK) if (eo->type == EOBJ_TYPE_DESK)
{ {
EObj *eo1, *eo2; EObj *eo1, *eo2;
ECmWinInfo *ec1;
Desk *d = (Desk *) eo; Desk *d = (Desk *) eo;
if (!d->viewable) if (!d->viewable)
@ -1795,7 +1793,6 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
stop = ECompMgrDetermineOrder(lst, num, &eo1, &eo2, d, clip); stop = ECompMgrDetermineOrder(lst, num, &eo1, &eo2, d, clip);
if (eo1) if (eo1)
{ {
ec1 = eo1->cmhook;
if (!eo_first) if (!eo_first)
eo_first = eo1; eo_first = eo1;
if (eo_prev) if (eo_prev)
@ -1945,7 +1942,7 @@ ECompMgrRepaintObj(Picture pbuf, XserverRegion region, EObj * eo, int mode)
if (cw->opacity != OPAQUE && !cw->shadowPict) if (cw->opacity != OPAQUE && !cw->shadowPict)
cw->shadowPict = EPictureCreateSolid(True, cw->shadowPict = EPictureCreateSolid(True,
(double)cw->opacity / (double)cw->opacity /
OPAQUE * 0.3, 0, 0, 0); OPAQUE * 0.3, 0., 0., 0.);
ERegionSubtractOffset(clip, x, y, cw->shape); ERegionSubtractOffset(clip, x, y, cw->shape);
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, clip); XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, clip);
XRenderComposite(dpy, PictOpOver, XRenderComposite(dpy, PictOpOver,
@ -2122,7 +2119,7 @@ static void
ECompMgrShadowsInit(int mode, int cleanup) ECompMgrShadowsInit(int mode, int cleanup)
{ {
if (mode == ECM_SHADOWS_BLURRED) if (mode == ECM_SHADOWS_BLURRED)
gaussianMap = make_gaussian_map(Conf_compmgr.shadows.blur.radius); gaussianMap = make_gaussian_map((double)Conf_compmgr.shadows.blur.radius);
else else
{ {
if (gaussianMap) if (gaussianMap)
@ -2131,7 +2128,7 @@ ECompMgrShadowsInit(int mode, int cleanup)
} }
if (mode != ECM_SHADOWS_OFF) if (mode != ECM_SHADOWS_OFF)
blackPicture = EPictureCreateSolid(True, 1, 0, 0, 0); blackPicture = EPictureCreateSolid(True, 1., 0., 0., 0.);
else else
{ {
if (blackPicture) if (blackPicture)
@ -2140,7 +2137,7 @@ ECompMgrShadowsInit(int mode, int cleanup)
} }
if (mode == ECM_SHADOWS_SHARP) if (mode == ECM_SHADOWS_SHARP)
transBlackPicture = EPictureCreateSolid(True, 0.3, 0, 0, 0); transBlackPicture = EPictureCreateSolid(True, 0.3, 0., 0., 0.);
else else
{ {
if (transBlackPicture) if (transBlackPicture)
@ -2239,15 +2236,18 @@ ECompMgrStop(void)
if (num > 0) if (num > 0)
{ {
lst = Emalloc(num * sizeof(EObj *)); lst = Emalloc(num * sizeof(EObj *));
memcpy(lst, lst1, num * sizeof(EObj *)); if (lst)
for (i = 0; i < num; i++)
{ {
if (lst[i]->type == EOBJ_TYPE_EXT) memcpy(lst, lst1, num * sizeof(EObj *));
EobjUnregister(lst[i]); /* Modifies the object stack! */ for (i = 0; i < num; i++)
else {
ECompMgrWinDel(lst[i]); if (lst[i]->type == EOBJ_TYPE_EXT)
EobjUnregister(lst[i]); /* Modifies the object stack! */
else
ECompMgrWinDel(lst[i]);
}
Efree(lst);
} }
Efree(lst);
} }
if (allDamage != None) if (allDamage != None)
@ -2372,7 +2372,7 @@ ECompMgrHandleRootEvent(XEvent * ev, void *prm)
case CreateNotify: case CreateNotify:
xwin = ev->xcreatewindow.window; xwin = ev->xcreatewindow.window;
case_CreateNotify: case_CreateNotify:
if (!Conf_compmgr.override_redirect.mode != ECM_OR_ON_CREATE) if (Conf_compmgr.override_redirect.mode != ECM_OR_ON_CREATE)
break; break;
eo = EobjListStackFind(xwin); eo = EobjListStackFind(xwin);
if (!eo) if (!eo)
@ -2583,7 +2583,7 @@ CompMgrIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem CompMgrIpcArray[] = { static const IpcItem CompMgrIpcArray[] = {
{ {
CompMgrIpc, CompMgrIpc,
"compmgr", "cm", "compmgr", "cm",

View File

@ -463,7 +463,7 @@ ConfigurationSet(const char *params)
const char *p; const char *p;
char name[1024]; char name[1024];
char item[1024]; char item[1024];
unsigned int len, err; unsigned int len;
if (!params) if (!params)
return; return;
@ -484,7 +484,7 @@ ConfigurationSet(const char *params)
len = 0; len = 0;
sscanf(p, "%1000s %n", item, &len); sscanf(p, "%1000s %n", item, &len);
p += len; p += len;
err = ModuleConfigSet(name, item, p); ModuleConfigSet(name, item, p);
/* Save changed configuration */ /* Save changed configuration */
autosave(); autosave();

View File

@ -759,7 +759,7 @@ ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time ts)
void void
ecore_x_icccm_title_set(Ecore_X_Window win, const char *title) ecore_x_icccm_title_set(Ecore_X_Window win, const char *title)
{ {
return ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_NAME, title); ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_NAME, title);
} }
char * char *

View File

@ -127,7 +127,7 @@ EdgeEvent(int dir)
static void static void
EdgeHandleEvents(XEvent * ev, void *prm) EdgeHandleEvents(XEvent * ev, void *prm)
{ {
static Time last_time; static Time last_time = 0;
int dir; int dir;
unsigned long dt; unsigned long dt;

View File

@ -32,7 +32,6 @@
#include "snaps.h" #include "snaps.h"
#include "xwin.h" #include "xwin.h"
#include <math.h> #include <math.h>
#include <sys/time.h>
static const WinOp winops[] = { static const WinOp winops[] = {
{"close", 2, 1, 0, EWIN_OP_CLOSE}, {"close", 2, 1, 0, EWIN_OP_CLOSE},
@ -1475,6 +1474,7 @@ EwinOpLower(EWin * ewin)
Efree(gwins); Efree(gwins);
} }
#if 0 /* Unused */
static int static int
FindEwinInList(EWin * ewin, EWin ** gwins, int num) FindEwinInList(EWin * ewin, EWin ** gwins, int num)
{ {
@ -1534,6 +1534,7 @@ EwinOpRaiseLower(EWin * ewin)
if (gwins) if (gwins)
Efree(gwins); Efree(gwins);
} }
#endif
void void
EwinOpStick(EWin * ewin, int on) EwinOpStick(EWin * ewin, int on)
@ -1578,6 +1579,7 @@ EwinOpSkipLists(EWin * ewin, int skip)
EwinStateUpdate(ewin); EwinStateUpdate(ewin);
} }
#if 0 /* Unused */
void void
EwinOpSkipTask(EWin * ewin, int skip) EwinOpSkipTask(EWin * ewin, int skip)
{ {
@ -1613,6 +1615,7 @@ EwinOpNeverFocus(EWin * ewin, int on)
SnapshotEwinUpdate(ewin, SNAP_USE_FOCUS_NEVER); SnapshotEwinUpdate(ewin, SNAP_USE_FOCUS_NEVER);
EwinStateUpdate(ewin); EwinStateUpdate(ewin);
} }
#endif
void void
EwinOpIconify(EWin * ewin, int on) EwinOpIconify(EWin * ewin, int on)
@ -1777,12 +1780,14 @@ EwinOpMoveToDesk(EWin * ewin, Desk * dsk, int inc)
SnapshotEwinUpdate(ewin, SNAP_USE_STICKY); SnapshotEwinUpdate(ewin, SNAP_USE_STICKY);
} }
#if 0 /* Unused */
void void
EwinOpMoveToArea(EWin * ewin, int x, int y) EwinOpMoveToArea(EWin * ewin, int x, int y)
{ {
EwinMoveToArea(ewin, x, y); EwinMoveToArea(ewin, x, y);
SnapshotEwinUpdate(ewin, SNAP_USE_POS); SnapshotEwinUpdate(ewin, SNAP_USE_POS);
} }
#endif
#if 0 /* Not used? */ #if 0 /* Not used? */
static int static int

View File

@ -28,10 +28,8 @@
#include "eobj.h" #include "eobj.h"
#include "ewins.h" #include "ewins.h"
#include "hints.h" #include "hints.h"
#include "icons.h"
#include "snaps.h" #include "snaps.h"
#include "xwin.h" #include "xwin.h"
#include <sys/time.h>
#define EWIN_TOP_EVENT_MASK \ #define EWIN_TOP_EVENT_MASK \
(ButtonPressMask | ButtonReleaseMask | \ (ButtonPressMask | ButtonReleaseMask | \
@ -1542,11 +1540,9 @@ static struct
} EWinChanges; } EWinChanges;
void void
EwinChange(EWin * ewin, unsigned int flag) EwinChange(EWin * ewin __UNUSED__, unsigned int flag)
{ {
EWinChanges.flags |= flag; EWinChanges.flags |= flag;
return;
ewin = NULL;
} }
void void
@ -1604,16 +1600,12 @@ EwinChangesProcess(EWin * ewin)
void void
EwinsEventsConfigure(int mode) EwinsEventsConfigure(int mode)
{ {
EWin *const *lst, *ewin; EWin *const *lst;
int i, num; int i, num;
lst = EwinListGetAll(&num); lst = EwinListGetAll(&num);
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ EwinEventsConfigure(lst[i], mode);
ewin = lst[i];
EwinEventsConfigure(lst[i], mode);
}
} }
static void static void
@ -1979,7 +1971,7 @@ EwinsSighan(int sig, void *prm)
} }
#if 0 #if 0
IpcItem EwinsIpcArray[] = { static const IpcItem EwinsIpcArray[] = {
}; };
#define N_IPC_FUNCS (sizeof(EwinsIpcArray)/sizeof(IpcItem)) #define N_IPC_FUNCS (sizeof(EwinsIpcArray)/sizeof(IpcItem))
#else #else

View File

@ -315,20 +315,14 @@ void EwinOpActivate(EWin * ewin);
void EwinOpKill(EWin * ewin); void EwinOpKill(EWin * ewin);
void EwinOpRaise(EWin * ewin); void EwinOpRaise(EWin * ewin);
void EwinOpLower(EWin * ewin); void EwinOpLower(EWin * ewin);
void EwinOpRaiseLower(EWin * ewin);
void EwinOpStick(EWin * ewin, int on); void EwinOpStick(EWin * ewin, int on);
void EwinOpSkipLists(EWin * ewin, int skip); void EwinOpSkipLists(EWin * ewin, int skip);
void EwinOpSkipTask(EWin * ewin, int skip);
void EwinOpSkipFocus(EWin * ewin, int skip);
void EwinOpSkipWinlist(EWin * ewin, int skip);
void EwinOpNeverFocus(EWin * ewin, int on);
void EwinOpIconify(EWin * ewin, int on); void EwinOpIconify(EWin * ewin, int on);
void EwinOpShade(EWin * ewin, int on); void EwinOpShade(EWin * ewin, int on);
void EwinOpSetLayer(EWin * ewin, int layer); void EwinOpSetLayer(EWin * ewin, int layer);
void EwinOpSetBorder(EWin * ewin, const char *name); void EwinOpSetBorder(EWin * ewin, const char *name);
void EwinOpSetOpacity(EWin * ewin, int opacity); void EwinOpSetOpacity(EWin * ewin, int opacity);
void EwinOpMoveToDesk(EWin * ewin, struct _desk *dsk, int inc); void EwinOpMoveToDesk(EWin * ewin, struct _desk *dsk, int inc);
void EwinOpMoveToArea(EWin * ewin, int x, int y);
/* finders.c */ /* finders.c */
EWin *EwinFindByPtr(const EWin * ewin); EWin *EwinFindByPtr(const EWin * ewin);

View File

@ -332,7 +332,7 @@ EWMH_SetClientStacking(void)
void void
EWMH_SetActiveWindow(Window win) EWMH_SetActiveWindow(Window win)
{ {
static Window win_last_set; static Window win_last_set = None;
if (win == win_last_set) if (win == win_last_set)
return; return;

View File

@ -24,7 +24,6 @@
#include "E.h" #include "E.h"
#include "ecore-e16.h" #include "ecore-e16.h"
#include "xwin.h" #include "xwin.h"
#include <X11/keysym.h>
#include <sys/time.h> #include <sys/time.h>
static Window static Window

View File

@ -30,7 +30,7 @@
const char * const char *
FileExtension(const char *file) FileExtension(const char *file)
{ {
char *p; const char *p;
p = strrchr(file, '.'); p = strrchr(file, '.');
if (p != NULL) if (p != NULL)
@ -71,29 +71,6 @@ exists(const char *s)
return 1; return 1;
} }
void
mkdirs(const char *s)
{
char ss[FILEPATH_LEN_MAX];
int i, ii;
i = 0;
ii = 0;
while (s[i])
{
ss[ii++] = s[i];
ss[ii] = 0;
if (s[i] == '/')
{
if (!exists(ss))
E_md(ss);
else if (!isdir(ss))
return;
}
i++;
}
}
int int
isfile(const char *s) isfile(const char *s)
{ {
@ -146,7 +123,8 @@ E_ls(const char *dir, int *num)
return NULL; return NULL;
} }
/* count # of entries in dir (worst case) */ /* count # of entries in dir (worst case) */
for (dirlen = 0; (dp = readdir(dirp)) != NULL; dirlen++); for (dirlen = 0; (dp = readdir(dirp)) != NULL; dirlen++)
;
if (!dirlen) if (!dirlen)
{ {
closedir(dirp); closedir(dirp);
@ -175,6 +153,7 @@ E_ls(const char *dir, int *num)
dirlen = i; /* dir got shorter... */ dirlen = i; /* dir got shorter... */
closedir(dirp); closedir(dirp);
*num = dirlen; *num = dirlen;
/* do a simple bubble sort here to alphanumberic it */ /* do a simple bubble sort here to alphanumberic it */
while (!done) while (!done)
{ {
@ -211,6 +190,7 @@ E_mv(const char *s, const char *ss)
rename(s, ss); rename(s, ss);
} }
#if 0 /* Unused */
void void
E_cp(const char *s, const char *ss) E_cp(const char *s, const char *ss)
{ {
@ -237,6 +217,7 @@ E_cp(const char *s, const char *ss)
fclose(f); fclose(f);
fclose(ff); fclose(ff);
} }
#endif
time_t time_t
moddate(const char *s) moddate(const char *s)
@ -252,6 +233,7 @@ moddate(const char *s)
return st.st_ctime; return st.st_ctime;
} }
#if 0 /* Unused */
int int
filesize(const char *s) filesize(const char *s)
{ {
@ -263,6 +245,7 @@ filesize(const char *s)
return 0; return 0;
return (int)st.st_size; return (int)st.st_size;
} }
#endif
int int
fileinode(const char *s) fileinode(const char *s)
@ -309,14 +292,7 @@ filedev(const char *s)
return filedev_map((int)st.st_dev); return filedev_map((int)st.st_dev);
} }
void #if 0 /* Unused */
E_cd(const char *s)
{
if ((!s) || (!*s))
return;
chdir(s);
}
char * char *
cwd(void) cwd(void)
{ {
@ -327,8 +303,9 @@ cwd(void)
s = Estrdup(ss); s = Estrdup(ss);
return s; return s;
} }
#endif
int static int
permissions(const char *s) permissions(const char *s)
{ {
struct stat st; struct stat st;
@ -392,9 +369,10 @@ username(int uid)
char * char *
homedir(int uid) homedir(int uid)
{ {
char *s;
static int usr_uid = -1; static int usr_uid = -1;
static char *usr_s = NULL; static char *usr_s = NULL;
char *s;
const char *ss;
struct passwd *pwd; struct passwd *pwd;
if (usr_uid < 0) if (usr_uid < 0)
@ -411,7 +389,10 @@ homedir(int uid)
usr_s = Estrdup(s); usr_s = Estrdup(s);
return s; return s;
} }
return Estrdup((getenv("TMPDIR") == NULL) ? "/tmp" : getenv("TMPDIR")); ss = getenv("TMPDIR");
if (!ss)
ss = "/tmp";
return Estrdup(ss);
} }
char * char *
@ -469,23 +450,6 @@ atword(const char *s, int num)
return NULL; return NULL;
} }
const char *
atchar(const char *s, char c)
{
int i;
if (!s)
return NULL;
i = 0;
while (s[i] != 0)
{
if (s[i] == c)
return &s[i];
i++;
}
return NULL;
}
void void
word(const char *s, int num, char *wd) word(const char *s, int num, char *wd)
{ {
@ -729,7 +693,7 @@ pathtoexec(const char *file)
cp = p; cp = p;
exelen = strlen(file); exelen = strlen(file);
while ((ep = strchr(cp, ':'))) while ((ep = strchr(cp, ':')) != NULL)
{ {
len = ep - cp; len = ep - cp;
s = Emalloc(len + 1); s = Emalloc(len + 1);
@ -738,6 +702,8 @@ pathtoexec(const char *file)
strncpy(s, cp, len); strncpy(s, cp, len);
s[len] = 0; s[len] = 0;
s = Erealloc(s, len + 2 + exelen); s = Erealloc(s, len + 2 + exelen);
if (!s)
return NULL;
strcat(s, "/"); strcat(s, "/");
strcat(s, file); strcat(s, file);
if (canexec(s)) if (canexec(s))
@ -753,6 +719,8 @@ pathtoexec(const char *file)
strncpy(s, cp, len); strncpy(s, cp, len);
s[len] = 0; s[len] = 0;
s = Erealloc(s, len + 2 + exelen); s = Erealloc(s, len + 2 + exelen);
if (!s)
return NULL;
strcat(s, "/"); strcat(s, "/");
strcat(s, file); strcat(s, file);
if (canexec(s)) if (canexec(s))
@ -781,7 +749,7 @@ pathtofile(const char *file)
return NULL; return NULL;
cp = p; cp = p;
exelen = strlen(file); exelen = strlen(file);
while ((ep = strchr(cp, ':'))) while ((ep = strchr(cp, ':')) != NULL)
{ {
len = ep - cp; len = ep - cp;
s = Emalloc(len + 1); s = Emalloc(len + 1);
@ -790,6 +758,8 @@ pathtofile(const char *file)
strncpy(s, cp, len); strncpy(s, cp, len);
s[len] = 0; s[len] = 0;
s = Erealloc(s, len + 2 + exelen); s = Erealloc(s, len + 2 + exelen);
if (!s)
return NULL;
strcat(s, "/"); strcat(s, "/");
strcat(s, file); strcat(s, file);
if (exists(s)) if (exists(s))
@ -805,6 +775,8 @@ pathtofile(const char *file)
strncpy(s, cp, len); strncpy(s, cp, len);
s[len] = 0; s[len] = 0;
s = Erealloc(s, len + 2 + exelen); s = Erealloc(s, len + 2 + exelen);
if (!s)
return NULL;
strcat(s, "/"); strcat(s, "/");
strcat(s, file); strcat(s, file);
if (exists(s)) if (exists(s))

View File

@ -151,9 +151,9 @@ ListWinGroups(const EWin * ewin, char group_select, int *num)
{ {
case GROUP_SELECT_EWIN_ONLY: case GROUP_SELECT_EWIN_ONLY:
groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups); groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups);
groups = if (!groups)
(Group **) memcpy(groups, ewin->groups, break;
sizeof(Group *) * ewin->num_groups); memcpy(groups, ewin->groups, sizeof(Group *) * ewin->num_groups);
*num = ewin->num_groups; *num = ewin->num_groups;
break; break;
case GROUP_SELECT_ALL_EXCEPT_EWIN: case GROUP_SELECT_ALL_EXCEPT_EWIN:
@ -172,11 +172,14 @@ ListWinGroups(const EWin * ewin, char group_select, int *num)
} }
} }
groups = (Group **) Emalloc(sizeof(Group *) * (*num - killed)); groups = (Group **) Emalloc(sizeof(Group *) * (*num - killed));
j = 0; if (groups)
for (i = 0; i < (*num); i++) {
if (groups2[i]) j = 0;
groups[j++] = groups2[i]; for (i = 0; i < (*num); i++)
(*num) -= killed; if (groups2[i])
groups[j++] = groups2[i];
(*num) -= killed;
}
Efree(groups2); Efree(groups2);
} }
break; break;
@ -279,7 +282,7 @@ ListWinGroupMembersForEwin(const EWin * ewin, int action, char nogroup,
} }
} }
if ((*num) == 0) if (gwins == NULL)
{ {
gwins = Emalloc(sizeof(EWin *)); gwins = Emalloc(sizeof(EWin *));
gwins[0] = (EWin *) ewin; gwins[0] = (EWin *) ewin;

View File

@ -152,7 +152,7 @@ ReverseTimeout(int val, void *data __UNUSED__)
EwinListFocusRaise(ewin); EwinListFocusRaise(ewin);
} }
void static void
FocusGetNextEwin(void) FocusGetNextEwin(void)
{ {
EWin *const *lst; EWin *const *lst;
@ -176,7 +176,7 @@ FocusGetNextEwin(void)
FocusToEWin(ewin, FOCUS_NEXT); FocusToEWin(ewin, FOCUS_NEXT);
} }
void static void
FocusGetPrevEwin(void) FocusGetPrevEwin(void)
{ {
EWin *const *lst; EWin *const *lst;
@ -254,7 +254,7 @@ FocusEwinSetActive(EWin * ewin, int active)
} }
} }
void static void
FocusFix(void) FocusFix(void)
{ {
EWin *const *lst, *ewin; EWin *const *lst, *ewin;
@ -669,7 +669,8 @@ SettingsFocus(void)
Dialog *d; Dialog *d;
DItem *table, *di, *radio, *radio2; DItem *table, *di, *radio, *radio2;
if ((d = FindItem("CONFIGURE_FOCUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_FOCUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -969,7 +970,7 @@ FocusIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem FocusIpcArray[] = { static const IpcItem FocusIpcArray[] = {
{ {
FocusIpc, FocusIpc,
"focus", "sf", "focus", "sf",

View File

@ -118,6 +118,6 @@ FontConfigUnload(void)
{ {
FontAlias *fa; FontAlias *fa;
while ((fa = RemoveItem(NULL, 0, LIST_FINDBY_NONE, LIST_TYPE_FONT))) while ((fa = RemoveItem(NULL, 0, LIST_FINDBY_NONE, LIST_TYPE_FONT)) != NULL)
FontAliasDestroy(fa); FontAliasDestroy(fa);
} }

View File

@ -181,7 +181,6 @@ FX_Ripple_Pause(void)
} }
#ifdef E_FX_RAINDROPS /* FIXME - Requires eliminating use of PixImg */ #ifdef E_FX_RAINDROPS /* FIXME - Requires eliminating use of PixImg */
/****************************************************************************/
/****************************** RAIN DROPS **********************************/ /****************************** RAIN DROPS **********************************/
@ -474,9 +473,8 @@ FX_Raindrops_Pause(void)
paused = 0; paused = 0;
} }
} }
#endif /* E_FX_RAINDROPS */
/****************************************************************************/ #endif /* E_FX_RAINDROPS */
/****************************** WAVES ***************************************/ /****************************** WAVES ***************************************/
/* by tsade :) */ /* by tsade :) */
@ -661,7 +659,7 @@ FX_Waves_Pause(void)
} }
} }
/****************************************************************************/ #ifdef E_FX_IMAGESPINNER
/****************************** IMAGESPINNER ********************************/ /****************************** IMAGESPINNER ********************************/
@ -774,6 +772,8 @@ FX_ImageSpinner_Pause(void)
} }
} }
#endif /* E_FX_IMAGESPINNER */
/****************************************************************************/ /****************************************************************************/
static FXHandler fx_handlers[] = { static FXHandler fx_handlers[] = {
@ -789,10 +789,12 @@ static FXHandler fx_handlers[] = {
FX_Raindrops_Pause, FX_Raindrops_Pause,
0, 0}, 0, 0},
#endif #endif
#ifdef E_FX_IMAGESPINNER
{"imagespinner", {"imagespinner",
FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit, FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit,
FX_ImageSpinner_Pause, FX_ImageSpinner_Pause,
0, 0} 0, 0},
#endif
}; };
#define N_FX_HANDLERS (sizeof(fx_handlers)/sizeof(FXHandler)) #define N_FX_HANDLERS (sizeof(fx_handlers)/sizeof(FXHandler))
@ -844,7 +846,6 @@ FX_Op(const char *name, int fx_op)
goto do_stop; goto do_stop;
else else
goto do_start; goto do_start;
break;
} }
} }
@ -967,7 +968,8 @@ FxSettings(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = FindItem("CONFIGURE_FX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_FX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -1045,7 +1047,7 @@ FxIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem FxIpcArray[] = { static const IpcItem FxIpcArray[] = {
{ {
FxIpc, FxIpc,
"fx", "fx", "fx", "fx",

View File

@ -30,6 +30,8 @@
#define DISABLE_PAGER_ICONBOX_GROUPING 0 #define DISABLE_PAGER_ICONBOX_GROUPING 0
static void RemoveEwinFromGroup(EWin * ewin, Group * g);
static Group * static Group *
GroupCreate(void) GroupCreate(void)
{ {
@ -80,7 +82,7 @@ CopyGroupConfig(GroupConfig * src, GroupConfig * dest)
memcpy(dest, src, sizeof(GroupConfig)); memcpy(dest, src, sizeof(GroupConfig));
} }
void static void
BreakWindowGroup(EWin * ewin, Group * g) BreakWindowGroup(EWin * ewin, Group * g)
{ {
int i, j, num; int i, j, num;
@ -164,7 +166,7 @@ AddEwinToGroup(EWin * ewin, Group * g)
} }
} }
int static int
EwinInGroup(EWin * ewin, Group * g) EwinInGroup(EWin * ewin, Group * g)
{ {
int i; int i;
@ -262,11 +264,17 @@ static char **
GetWinGroupMemberNames(Group ** groups, int num) GetWinGroupMemberNames(Group ** groups, int num)
{ {
int i, j; int i, j;
char **group_member_strings = Emalloc(sizeof(char *) * num); char **group_member_strings;
group_member_strings = Ecalloc(num, sizeof(char *));
if (!group_member_strings)
return NULL;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
{ {
group_member_strings[i] = Emalloc(sizeof(char) * 1024); group_member_strings[i] = Emalloc(sizeof(char) * 1024);
if (!group_member_strings[i])
break;
group_member_strings[i][0] = 0; group_member_strings[i][0] = 0;
for (j = 0; j < groups[i]->num_members; j++) for (j = 0; j < groups[i]->num_members; j++)
@ -280,7 +288,7 @@ GetWinGroupMemberNames(Group ** groups, int num)
return group_member_strings; return group_member_strings;
} }
void static void
ShowHideWinGroups(EWin * ewin, Group * g, char onoff) ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
{ {
EWin **gwins; EWin **gwins;
@ -538,7 +546,7 @@ GroupCallback(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
tmp_index = val; tmp_index = val;
} }
void static void
ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action) ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
{ {
@ -584,7 +592,8 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
group_member_strings = GetWinGroupMemberNames(tmp_groups, num_groups); group_member_strings = GetWinGroupMemberNames(tmp_groups, num_groups);
ShowHideWinGroups(ewin, tmp_groups[0], SET_ON); ShowHideWinGroups(ewin, tmp_groups[0], SET_ON);
if ((d = FindItem("GROUP_SELECTION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("GROUP_SELECTION", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("GROUP_SETTINGS_ACTIVE"); SoundPlay("GROUP_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -608,7 +617,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupCallback, 0, (void *)d); DialogItemSetCallback(di, GroupCallback, 0, (void *)d);
DialogItemSetText(di, group_member_strings[0]); DialogItemSetText(di, group_member_strings[0]);
DialogItemRadioButtonSetFirst(di, radio); DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, 0); DialogItemRadioButtonGroupSetVal(di, 0);
@ -635,10 +644,13 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
static GroupConfig *tmp_cfgs = NULL; static GroupConfig *tmp_cfgs = NULL;
static int tmp_current_group; static int tmp_current_group;
#if 0 /* FIXME - Should these be separate variables? */
static int tmp_index; static int tmp_index;
static GroupConfig tmp_cfg;
static EWin *tmp_ewin; static EWin *tmp_ewin;
static Group **tmp_groups; static Group **tmp_groups;
#endif
static GroupConfig tmp_cfg;
static DItem *di_border; static DItem *di_border;
static DItem *di_iconify; static DItem *di_iconify;
@ -736,7 +748,9 @@ SettingsGroups(EWin * ewin)
("\n This window currently does not belong to any groups. \n\n")); ("\n This window currently does not belong to any groups. \n\n"));
return; return;
} }
if ((d = FindItem("CONFIGURE_GROUP", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
d = FindItem("CONFIGURE_GROUP", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("GROUP_SETTINGS_ACTIVE"); SoundPlay("GROUP_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -772,7 +786,7 @@ SettingsGroups(EWin * ewin)
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON); radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupSelectCallback, 0, (void *)d); DialogItemSetCallback(di, GroupSelectCallback, 0, (void *)d);
DialogItemSetText(di, group_member_strings[0]); DialogItemSetText(di, group_member_strings[0]);
DialogItemRadioButtonSetFirst(di, radio); DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, 0); DialogItemRadioButtonGroupSetVal(di, 0);
@ -781,7 +795,7 @@ SettingsGroups(EWin * ewin)
{ {
di = DialogAddItem(table, DITEM_RADIOBUTTON); di = DialogAddItem(table, DITEM_RADIOBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupSelectCallback, i, (void *)d); DialogItemSetCallback(di, GroupSelectCallback, i, (void *)d);
DialogItemSetText(di, group_member_strings[i]); DialogItemSetText(di, group_member_strings[i]);
DialogItemRadioButtonSetFirst(di, radio); DialogItemRadioButtonSetFirst(di, radio);
DialogItemRadioButtonGroupSetVal(di, i); DialogItemRadioButtonGroupSetVal(di, i);
@ -800,7 +814,7 @@ SettingsGroups(EWin * ewin)
di_border = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_border = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_BORDER, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_BORDER,
&(tmp_cfg.set_border)); &(tmp_cfg.set_border));
DialogItemSetText(di, _("Changing Border Style")); DialogItemSetText(di, _("Changing Border Style"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].set_border); DialogItemCheckButtonSetState(di, tmp_cfgs[0].set_border);
@ -808,7 +822,7 @@ SettingsGroups(EWin * ewin)
di_iconify = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_iconify = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, DialogItemSetCallback(di, GroupFeatureChangeCallback,
GROUP_FEATURE_ICONIFY, &(tmp_cfg.iconify)); GROUP_FEATURE_ICONIFY, &(tmp_cfg.iconify));
DialogItemSetText(di, _("Iconifying")); DialogItemSetText(di, _("Iconifying"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].iconify); DialogItemCheckButtonSetState(di, tmp_cfgs[0].iconify);
@ -816,7 +830,7 @@ SettingsGroups(EWin * ewin)
di_kill = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_kill = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_KILL, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_KILL,
&(tmp_cfg.kill)); &(tmp_cfg.kill));
DialogItemSetText(di, _("Killing")); DialogItemSetText(di, _("Killing"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].kill); DialogItemCheckButtonSetState(di, tmp_cfgs[0].kill);
@ -824,7 +838,7 @@ SettingsGroups(EWin * ewin)
di_move = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_move = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_MOVE, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_MOVE,
&(tmp_cfg.move)); &(tmp_cfg.move));
DialogItemSetText(di, _("Moving")); DialogItemSetText(di, _("Moving"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].move); DialogItemCheckButtonSetState(di, tmp_cfgs[0].move);
@ -832,7 +846,7 @@ SettingsGroups(EWin * ewin)
di_raise = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_raise = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_RAISE, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_RAISE,
&(tmp_cfg.raise)); &(tmp_cfg.raise));
DialogItemSetText(di, _("Raising/Lowering")); DialogItemSetText(di, _("Raising/Lowering"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].raise); DialogItemCheckButtonSetState(di, tmp_cfgs[0].raise);
@ -840,7 +854,7 @@ SettingsGroups(EWin * ewin)
di_stick = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_stick = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_STICK, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_STICK,
&(tmp_cfg.stick)); &(tmp_cfg.stick));
DialogItemSetText(di, _("Sticking")); DialogItemSetText(di, _("Sticking"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].stick); DialogItemCheckButtonSetState(di, tmp_cfgs[0].stick);
@ -848,7 +862,7 @@ SettingsGroups(EWin * ewin)
di_shade = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_shade = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_SHADE, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_SHADE,
&(tmp_cfg.shade)); &(tmp_cfg.shade));
DialogItemSetText(di, _("Shading")); DialogItemSetText(di, _("Shading"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].shade); DialogItemCheckButtonSetState(di, tmp_cfgs[0].shade);
@ -856,7 +870,7 @@ SettingsGroups(EWin * ewin)
di_mirror = di = DialogAddItem(table, DITEM_CHECKBUTTON); di_mirror = di = DialogAddItem(table, DITEM_CHECKBUTTON);
DialogItemSetColSpan(di, 2); DialogItemSetColSpan(di, 2);
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_MIRROR, DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_MIRROR,
&(tmp_cfg.mirror)); &(tmp_cfg.mirror));
DialogItemSetText(di, _("Mirror Shade/Iconify/Stick")); DialogItemSetText(di, _("Mirror Shade/Iconify/Stick"));
DialogItemCheckButtonSetState(di, tmp_cfgs[0].mirror); DialogItemCheckButtonSetState(di, tmp_cfgs[0].mirror);
@ -891,8 +905,9 @@ SettingsDefaultGroupControl(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = FindItem("CONFIGURE_DEFAULT_GROUP_CONTROL", 0, LIST_FINDBY_NAME, d = FindItem("CONFIGURE_DEFAULT_GROUP_CONTROL", 0, LIST_FINDBY_NAME,
LIST_TYPE_DIALOG))) LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -1090,12 +1105,9 @@ doBreakGroup(EWin * ewin, const char *params __UNUSED__)
static void static void
IPC_GroupInfo(const char *params, Client * c __UNUSED__) IPC_GroupInfo(const char *params, Client * c __UNUSED__)
{ {
char buf[FILEPATH_LEN_MAX];
Group **groups = NULL; Group **groups = NULL;
int num_groups, i, j; int num_groups, i, j;
buf[0] = 0;
if (params) if (params)
{ {
Group *group; Group *group;
@ -1158,7 +1170,6 @@ IPC_GroupOps(const char *params, Client * c __UNUSED__)
int gix; int gix;
char windowid[FILEPATH_LEN_MAX]; char windowid[FILEPATH_LEN_MAX];
char operation[FILEPATH_LEN_MAX]; char operation[FILEPATH_LEN_MAX];
char param1[FILEPATH_LEN_MAX];
unsigned int win; unsigned int win;
EWin *ewin; EWin *ewin;
@ -1170,7 +1181,6 @@ IPC_GroupOps(const char *params, Client * c __UNUSED__)
windowid[0] = 0; windowid[0] = 0;
operation[0] = 0; operation[0] = 0;
param1[0] = 0;
word(params, 1, windowid); word(params, 1, windowid);
sscanf(windowid, "%x", &win); sscanf(windowid, "%x", &win);
word(params, 2, operation); word(params, 2, operation);
@ -1400,7 +1410,7 @@ GroupsIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem GroupsIpcArray[] = { static const IpcItem GroupsIpcArray[] = {
{ {
GroupsIpc, GroupsIpc,
"groups", "grp", "groups", "grp",

View File

@ -115,7 +115,8 @@ SignalHandler(int sig)
break; break;
case SIGCHLD: case SIGCHLD:
while (waitpid(-1, &status, WNOHANG) > 0); while (waitpid(-1, &status, WNOHANG) > 0)
;
break; break;
} }
} }

View File

@ -138,7 +138,7 @@ HintsSetActiveWindow(Window win)
void void
HintsSetWindowName(Window win, const char *name) HintsSetWindowName(Window win, const char *name)
{ {
ecore_x_window_prop_string_set(win, ECORE_X_ATOM_WM_NAME, name); ecore_x_icccm_title_set(win, name);
EWMH_SetWindowName(win, name); EWMH_SetWindowName(win, name);
} }

View File

@ -132,7 +132,6 @@ void ICCCM_Focus(const EWin * ewin);
void ICCCM_GetGeoms(EWin * ewin, Atom atom_change); void ICCCM_GetGeoms(EWin * ewin, Atom atom_change);
void ICCCM_GetInfo(EWin * ewin, Atom atom_change); void ICCCM_GetInfo(EWin * ewin, Atom atom_change);
void ICCCM_GetHints(EWin * ewin, Atom atom_change); void ICCCM_GetHints(EWin * ewin, Atom atom_change);
void ICCCM_SetIconSizes(void);
void ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change); void ICCCM_ProcessPropertyChange(EWin * ewin, Atom atom_change);
/* mwm.c */ /* mwm.c */

View File

@ -28,6 +28,8 @@
#include "hints.h" #include "hints.h"
#include "xwin.h" #include "xwin.h"
static void ICCCM_SetIconSizes(void);
void void
ICCCM_Init(void) ICCCM_Init(void)
{ {
@ -39,7 +41,9 @@ ICCCM_Init(void)
if (Mode.wm.window) if (Mode.wm.window)
{ {
Atom wm_props[1] = { ECORE_X_ATOM_WM_DELETE_WINDOW }; Atom wm_props[1];
wm_props[0] = ECORE_X_ATOM_WM_DELETE_WINDOW;
XSetWMProtocols(disp, VRoot.win, wm_props, 1); XSetWMProtocols(disp, VRoot.win, wm_props, 1);
} }
} }
@ -541,7 +545,7 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_COMMAND) if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_COMMAND)
{ {
int argc; int argc;
char **argv, s[4096]; char **argv, s[4096], *ss;
_EFREE(ewin->icccm.wm_command); _EFREE(ewin->icccm.wm_command);
@ -553,8 +557,8 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
ECORE_X_ATOM_WM_COMMAND, ECORE_X_ATOM_WM_COMMAND,
&argv); &argv);
ewin->icccm.wm_command = ss = StrlistEncodeEscaped(s, sizeof(s), argv, argc);
Estrdup(StrlistEncodeEscaped(s, sizeof(s), argv, argc)); ewin->icccm.wm_command = Estrdup(ss);
StrlistFree(argv, argc); StrlistFree(argv, argc);
} }

View File

@ -366,7 +366,8 @@ ImageclassDestroy(ImageClass * ic)
ic->ref_count); ic->ref_count);
return; return;
} }
while (RemoveItemByPtr(ic, LIST_TYPE_ICLASS)); while (RemoveItemByPtr(ic, LIST_TYPE_ICLASS))
;
if (ic->name) if (ic->name)
Efree(ic->name); Efree(ic->name);
@ -1570,7 +1571,8 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
st = STATE_DISABLED; st = STATE_DISABLED;
else else
st = STATE_NORMAL; st = STATE_NORMAL;
if ((hptr = atword(params, 6))) hptr = atword(params, 6);
if (hptr)
{ {
w = (int)strtol(atword(params, 5), (char **)NULL, 0); w = (int)strtol(atword(params, 5), (char **)NULL, 0);
h = (int)strtol(hptr, (char **)NULL, 0); h = (int)strtol(hptr, (char **)NULL, 0);
@ -1599,7 +1601,8 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
st = STATE_DISABLED; st = STATE_DISABLED;
else else
st = STATE_NORMAL; st = STATE_NORMAL;
if (!(hptr = atword(params, 6))) hptr = atword(params, 6);
if (!hptr)
IpcPrintf("Error: missing width and/or height\n"); IpcPrintf("Error: missing width and/or height\n");
else else
{ {
@ -1635,7 +1638,7 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem ImageclassIpcArray[] = { static const IpcItem ImageclassIpcArray[] = {
{ {
ImageclassIpc, ImageclassIpc,
"imageclass", NULL, "imageclass", NULL,

View File

@ -327,7 +327,8 @@ IconboxCreate(const char *name)
ib = Ecalloc(1, sizeof(Iconbox)); ib = Ecalloc(1, sizeof(Iconbox));
ib->name = Estrdup(name); ib->name = Estrdup(name);
ib->type = (!strncmp(name, "_ST_", 4)) ? IB_TYPE_SYSTRAY : IB_TYPE_ICONBOX; ib->type = (name && !strncmp(name, "_ST_", 4)) ?
IB_TYPE_SYSTRAY : IB_TYPE_ICONBOX;
ib->orientation = 0; ib->orientation = 0;
ib->scrollbar_side = 1; ib->scrollbar_side = 1;
ib->arrow_side = 1; ib->arrow_side = 1;
@ -1573,7 +1574,7 @@ IconboxLayout(Iconbox * ib, int *px, int *py, int *pw, int *ph)
static void static void
IconboxDraw(Iconbox * ib) IconboxDraw(Iconbox * ib)
{ {
int i, x, y, w, h; int i, w, h;
ImageClass *ib_ic_cover; ImageClass *ib_ic_cover;
int ib_xlt, ib_ylt, ib_ww, ib_hh; int ib_xlt, ib_ylt, ib_ww, ib_hh;
int ib_x0, ib_y0, ib_w0, ib_h0; int ib_x0, ib_y0, ib_w0, ib_h0;
@ -1581,8 +1582,6 @@ IconboxDraw(Iconbox * ib)
int ww, hh; int ww, hh;
Pixmap pmap, mask; Pixmap pmap, mask;
x = EoGetX(ib->ewin);
y = EoGetY(ib->ewin);
w = ib->w; w = ib->w;
h = ib->h; h = ib->h;
@ -2185,8 +2184,8 @@ IconboxConfigure(Iconbox * ib)
if (!ib) if (!ib)
return; return;
if ((d = d = FindItem("CONFIGURE_ICONBOX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_ICONBOX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2650,7 +2649,7 @@ IboxIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem IconboxesIpcArray[] = { static const IpcItem IconboxesIpcArray[] = {
{ {
IboxIpc, IboxIpc,
"iconbox", "ibox", "iconbox", "ibox",

View File

@ -1313,7 +1313,7 @@ IPC_Compat(const char *params)
*/ */
static void IPC_Help(const char *params, Client * c); static void IPC_Help(const char *params, Client * c);
IpcItem IPCArray[] = { static const IpcItem IPCArray[] = {
{ {
IPC_Help, IPC_Help,
"help", "?", "help", "?",
@ -1532,6 +1532,7 @@ HandleIPC(const char *params, Client * c)
lst = IPC_GetList(&num); lst = IPC_GetList(&num);
w[0] = 0;
word(params, 1, w); word(params, 1, w);
ok = 0; ok = 0;
@ -1541,8 +1542,9 @@ HandleIPC(const char *params, Client * c)
if (!(ipc->nick && !strcmp(w, ipc->nick)) && strcmp(w, ipc->name)) if (!(ipc->nick && !strcmp(w, ipc->nick)) && strcmp(w, ipc->name))
continue; continue;
w[0] = 0;
word(params, 2, w); word(params, 2, w);
if (w) if (w[0])
ipc->func(atword(params, 2), c); ipc->func(atword(params, 2), c);
else else
ipc->func(NULL, c); ipc->func(NULL, c);

View File

@ -170,6 +170,7 @@ MoveItemToListTop(const void *item, int type)
} }
} }
#if 0 /* Unused */
void void
MoveItemToListBottom(const void *item, int type) MoveItemToListBottom(const void *item, int type)
{ {
@ -205,6 +206,7 @@ MoveItemToListBottom(const void *item, int type)
} }
} }
} }
#endif
void * void *
RemoveItem(const void *name, int id, int find_by, int type) RemoveItem(const void *name, int id, int find_by, int type)
@ -307,8 +309,10 @@ RemoveItem(const void *name, int id, int find_by, int type)
Efree(ptr->name); Efree(ptr->name);
Efree(ptr); Efree(ptr);
return p; return p;
#if 0 /* FIXME - Is something wrong here? */
pptr = ptr; pptr = ptr;
ptr = ptr->next; ptr = ptr->next;
#endif
} }
} }
@ -473,6 +477,7 @@ ListItemTypeID(int *num, int type, int id)
return lst; return lst;
} }
#if 0 /* Unused */
void ** void **
ListItemTypeName(int *num, int type, const char *name) ListItemTypeName(int *num, int type, const char *name)
{ {
@ -507,6 +512,7 @@ ListItemTypeName(int *num, int type, const char *name)
} }
return lst; return lst;
} }
#endif
void void
ListChangeItemID(int type, void *item, int id) ListChangeItemID(int type, void *item, int id)

View File

@ -130,7 +130,7 @@ main(int argc, char **argv)
/* Set up the internal data lists used to find everything */ /* Set up the internal data lists used to find everything */
ListsInit(LIST_TYPE_COUNT); ListsInit(LIST_TYPE_COUNT);
srand(time(NULL)); srand((unsigned int)time(NULL));
if (!uname(&ubuf)) if (!uname(&ubuf))
Mode.wm.machine_name = Estrdup(ubuf.nodename); Mode.wm.machine_name = Estrdup(ubuf.nodename);
@ -565,7 +565,7 @@ EConfName(void)
const char * const char *
EDirUser(void) EDirUser(void)
{ {
static char *user_dir; static char *user_dir = NULL;
char *home, buf[4096]; char *home, buf[4096];
if (Mode.conf.dir) if (Mode.conf.dir)
@ -697,7 +697,8 @@ EGetSavePrefix(void)
Mode.display.name); Mode.display.name);
def_prefix = Estrdup(buf); def_prefix = Estrdup(buf);
for (s = def_prefix; (s = strchr(s, ':')); *s = '-'); for (s = def_prefix; (s = strchr(s, ':')) != NULL; *s = '-')
;
return def_prefix; return def_prefix;
} }

View File

@ -87,15 +87,18 @@ Estrdupcat2(char *ss, const char *s1, const char *s2)
l2 = (s2) ? strlen(s2) : 0; l2 = (s2) ? strlen(s2) : 0;
s = Erealloc(ss, len + l1 + l2 + 1); s = Erealloc(ss, len + l1 + l2 + 1);
if (l1) if (!s)
return NULL;
if (s1 && l1)
memcpy(s + len, s1, l1); memcpy(s + len, s1, l1);
if (l2) if (s2 && l2)
memcpy(s + len + l1, s2, l2); memcpy(s + len + l1, s2, l2);
s[len + l1 + l2] = '\0'; s[len + l1 + l2] = '\0';
return s; return s;
} }
#if 0 /* Unused */
char ** char **
StrlistDup(char **lst, int num) StrlistDup(char **lst, int num)
{ {
@ -112,6 +115,7 @@ StrlistDup(char **lst, int num)
return ss; return ss;
} }
#endif
void void
StrlistFree(char **lst, int num) StrlistFree(char **lst, int num)

View File

@ -23,12 +23,10 @@
*/ */
#include "E.h" #include "E.h"
#include "backgrounds.h" #include "backgrounds.h"
#include "conf.h"
#include "desktops.h" #include "desktops.h"
#include "ewins.h" #include "ewins.h"
#include "iclass.h" #include "iclass.h"
#include "menus.h" #include "menus.h"
#include "xwin.h"
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -82,6 +80,8 @@ MenuLoadFromDirectory(Menu * m)
MenuEmpty(m, 0); MenuEmpty(m, 0);
cs[0] = '\0'; /* FIXME - Check this */
if (stat(dir, &st) >= 0) if (stat(dir, &st) >= 0)
{ {
int aa, bb, cc; int aa, bb, cc;
@ -109,6 +109,8 @@ MenuLoadFromDirectory(Menu * m)
if (exists(cs)) if (exists(cs))
{ {
f = fopen(cs, "r"); f = fopen(cs, "r");
if (!f)
return 1;
while (fgets(s, sizeof(s), f)) while (fgets(s, sizeof(s), f))
{ {
s[strlen(s) - 1] = 0; s[strlen(s) - 1] = 0;
@ -467,9 +469,10 @@ MenuCreateFromGnome(const char *name, Menu * parent, MenuStyle * ms,
f = fopen(ss, "r"); f = fopen(ss, "r");
if (f) if (f)
{ {
char *iname = NULL, *exec = NULL, *texec = char *iname, *exec, *texec, *en_name;
NULL, *tmp; char *tmp;
char *en_name = NULL;
iname = exec = texec = en_name = NULL;
while (fgets(s, sizeof(s), f)) while (fgets(s, sizeof(s), f))
{ {

View File

@ -37,7 +37,7 @@
#define DEBUG_MENU_EVENTS 0 #define DEBUG_MENU_EVENTS 0
struct static struct
{ {
Menu *first; Menu *first;
Menu *active; Menu *active;
@ -761,8 +761,9 @@ MenuRealize(Menu * m)
m->items[i]->text_y = (maxh - m->items[i]->text_h) / 2; m->items[i]->text_y = (maxh - m->items[i]->text_h) / 2;
if (m->items[i]->icon_win) if (m->items[i]->icon_win)
EMoveWindow(m->items[i]->icon_win, EMoveWindow(m->items[i]->icon_win,
maxw - pad_item->right - maxw - pad_item->right - maxx2 +
maxx2 + ((maxx2 - w) / 2), ((maxh - h) / 2)); ((maxx2 - m->items[i]->icon_w) / 2),
((maxh - m->items[i]->icon_h) / 2));
} }
if (m->items[i]->icon_iclass) if (m->items[i]->icon_iclass)
{ {
@ -1761,14 +1762,13 @@ MenuConfigLoad(FILE * fs)
char s4[FILEPATH_LEN_MAX]; char s4[FILEPATH_LEN_MAX];
char s5[FILEPATH_LEN_MAX]; char s5[FILEPATH_LEN_MAX];
char *txt = NULL; char *txt = NULL;
const char *params = NULL; const char *params;
int i1, i2; int i1, i2;
Menu *m = NULL, *mm; Menu *m = NULL, *mm;
MenuItem *mi; MenuItem *mi;
MenuStyle *ms; MenuStyle *ms;
ImageClass *ic = NULL; ImageClass *ic = NULL;
int fields; int fields;
int act = 0;
while (GetLine(s, sizeof(s), fs)) while (GetLine(s, sizeof(s), fs))
{ {
@ -1804,7 +1804,6 @@ MenuConfigLoad(FILE * fs)
m = NULL; m = NULL;
ic = NULL; ic = NULL;
_EFREE(txt); _EFREE(txt);
act = 0;
break; break;
case CONFIG_CLOSE: case CONFIG_CLOSE:
err = 0; err = 0;
@ -1840,7 +1839,8 @@ MenuConfigLoad(FILE * fs)
ic = NULL; ic = NULL;
if (strcmp("NULL", s2)) if (strcmp("NULL", s2))
ic = ImageclassFind(s2, 0); ic = ImageclassFind(s2, 0);
_EFDUP(txt, atword(s, 3)); params = atword(s, 3);
_EFDUP(txt, params);
break; break;
case MENU_ACTION: case MENU_ACTION:
if ((txt) || (ic)) if ((txt) || (ic))
@ -1981,7 +1981,8 @@ MenusSettings(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = FindItem("CONFIGURE_MENUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_MENUS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2073,7 +2074,7 @@ MenusIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem MenusIpcArray[] = { static const IpcItem MenusIpcArray[] = {
{ {
MenusIpc, MenusIpc,
"menus", "mnu", "menus", "mnu",

View File

@ -79,8 +79,10 @@ Quicksort(void **a, int l, int r, int (*CompareFunc) (void *d1, void *d2))
for (;;) for (;;)
{ {
while (CompareFunc(a[++i], v) < 0); while (CompareFunc(a[++i], v) < 0)
while (CompareFunc(a[--j], v) > 0); ;
while (CompareFunc(a[--j], v) > 0)
;
if (i >= j) if (i >= j)
break; break;
t = a[i]; t = a[i];
@ -120,7 +122,7 @@ ETimeElapsed(struct timeval *t0)
#include <math.h> #include <math.h>
static float static float
ETimeCurve(int k1, int k2, float k, int mode, float slope __UNUSED__) ETimeCurve(int k1, int k2, float k, int mode)
{ {
float x, l; float x, l;
@ -173,7 +175,7 @@ ETimedLoopNext(void)
Eprintf("ETimedLoopNext k=%4f tm=%.3f\n", etl_k, tm); Eprintf("ETimedLoopNext k=%4f tm=%.3f\n", etl_k, tm);
#endif #endif
etl_k = etl_k1 + tm * etl_fac; etl_k = etl_k1 + tm * etl_fac;
y = ETimeCurve(etl_k1, etl_k2, etl_k, 2, 1.0); y = ETimeCurve(etl_k1, etl_k2, (float)etl_k, 2);
EobjsRepaint(); EobjsRepaint();

View File

@ -205,7 +205,7 @@ MiscIpcConfig(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem MiscIpcArray[] = { static const IpcItem MiscIpcArray[] = {
{ {
MiscIpcExec, MiscIpcExec,
"exec", NULL, "exec", NULL,

View File

@ -30,8 +30,6 @@
/* /*
* Theme transparency settings * Theme transparency settings
*/ */
static Dialog *tr_sel_dialog;
static int tmp_theme_transparency; static int tmp_theme_transparency;
static int tmp_st_border; static int tmp_st_border;
@ -117,7 +115,8 @@ SettingsTransparency(void)
*radio_dialog, *radio_tooltip, *radio_hilight; *radio_dialog, *radio_tooltip, *radio_hilight;
char s[256]; char s[256];
if ((d = FindItem("CONFIGURE_TRANS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_TRANS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -134,7 +133,7 @@ SettingsTransparency(void)
tmp_theme_transparency = Conf.trans.alpha; tmp_theme_transparency = Conf.trans.alpha;
d = tr_sel_dialog = DialogCreate("CONFIGURE_TRANS"); d = DialogCreate("CONFIGURE_TRANS");
DialogSetTitle(d, _("Selective Transparency Settings")); DialogSetTitle(d, _("Selective Transparency Settings"));
table = DialogInitItem(d); table = DialogInitItem(d);
@ -307,7 +306,7 @@ TransparencyIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem TransIpcArray[] = { static const IpcItem TransIpcArray[] = {
{ {
TransparencyIpc, TransparencyIpc,
"trans", "tr", "trans", "tr",

View File

@ -24,6 +24,10 @@
#include "ewins.h" #include "ewins.h"
#include "hints.h" #include "hints.h"
/* workaround for 64bit architectures - xlib expects 32bit CARDINALS to be */
/* long's on 64bit machines... thus well the CARD32's Im unsing shoudl be.. */
#define CARD32 long
/* Motif window hints */ /* Motif window hints */
#define MWM_HINTS_FUNCTIONS (1L << 0) #define MWM_HINTS_FUNCTIONS (1L << 0)
#define MWM_HINTS_DECORATIONS (1L << 1) #define MWM_HINTS_DECORATIONS (1L << 1)

View File

@ -41,7 +41,7 @@
#define EwinGetVX2(ew) (ew->vx + EoGetW(ew)) #define EwinGetVX2(ew) (ew->vx + EoGetW(ew))
#define EwinGetVY2(ew) (ew->vy + EoGetH(ew)) #define EwinGetVY2(ew) (ew->vy + EoGetH(ew))
struct static struct
{ {
char enable; char enable;
char zoom; char zoom;
@ -54,7 +54,7 @@ struct
int menu_button; int menu_button;
} Conf_pagers; } Conf_pagers;
struct static struct
{ {
int zoom; int zoom;
} Mode_pagers; } Mode_pagers;
@ -1377,7 +1377,7 @@ PagerHandleMouseUp(Pager * p, int px, int py, int button)
static void static void
PagerHiwinHandleMouseUp(Pager * p, int px, int py, int button) PagerHiwinHandleMouseUp(Pager * p, int px, int py, int button)
{ {
int i, num, in_pager, in_vroot; int i, num, in_vroot;
EWin *ewin, *ewin2, **gwins; EWin *ewin, *ewin2, **gwins;
int x, y; int x, y;
@ -1401,8 +1401,6 @@ PagerHiwinHandleMouseUp(Pager * p, int px, int py, int button)
if (!ewin) if (!ewin)
goto done; goto done;
in_pager = (px >= 0 && py >= 0 && px < p->w && py < p->h);
in_vroot = (Mode.events.x >= 0 && Mode.events.x < VRoot.w && in_vroot = (Mode.events.x >= 0 && Mode.events.x < VRoot.w &&
Mode.events.y >= 0 && Mode.events.y < VRoot.h); Mode.events.y >= 0 && Mode.events.y < VRoot.h);
@ -1726,7 +1724,8 @@ SettingsPager(void)
DItem *table, *di, *radio; DItem *table, *di, *radio;
char s[256]; char s[256];
if ((d = FindItem("CONFIGURE_PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_PAGER", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -2028,7 +2027,7 @@ IPC_Pager(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem PagersIpcArray[] = { static const IpcItem PagersIpcArray[] = {
{ {
IPC_Pager, IPC_Pager,
"pager", "pg", "pager", "pg",

View File

@ -28,7 +28,6 @@
#include "ewins.h" #include "ewins.h"
#include "snaps.h" #include "snaps.h"
#include "xwin.h" #include "xwin.h"
#include <errno.h>
#include <fcntl.h> #include <fcntl.h>
#include <signal.h> #include <signal.h>
#include <sys/time.h> #include <sys/time.h>
@ -380,26 +379,26 @@ set_save_props(SmcConn smc_conn, int master_flag)
discardProp.name = (char *)SmDiscardCommand; discardProp.name = (char *)SmDiscardCommand;
discardProp.type = (char *)SmLISTofARRAY8; discardProp.type = (char *)SmLISTofARRAY8;
discardProp.num_vals = 3; discardProp.num_vals = 3;
discardProp.vals = (SmPropValue *) & discardVal; discardProp.vals = discardVal;
#endif #endif
restartProp.name = (char *)SmRestartCommand; restartProp.name = (char *)SmRestartCommand;
restartProp.type = (char *)SmLISTofARRAY8; restartProp.type = (char *)SmLISTofARRAY8;
restartProp.vals = (SmPropValue *) & restartVal; restartProp.vals = restartVal;
cloneProp.name = (char *)SmCloneCommand; cloneProp.name = (char *)SmCloneCommand;
cloneProp.type = (char *)SmLISTofARRAY8; cloneProp.type = (char *)SmLISTofARRAY8;
cloneProp.vals = (SmPropValue *) & restartVal; cloneProp.vals = restartVal;
styleProp.name = (char *)SmRestartStyleHint; styleProp.name = (char *)SmRestartStyleHint;
styleProp.type = (char *)SmCARD8; styleProp.type = (char *)SmCARD8;
styleProp.num_vals = 1; styleProp.num_vals = 1;
styleProp.vals = (SmPropValue *) & styleVal; styleProp.vals = &styleVal;
priorityProp.name = (char *)"_GSM_Priority"; priorityProp.name = (char *)"_GSM_Priority";
priorityProp.type = (char *)SmCARD8; priorityProp.type = (char *)SmCARD8;
priorityProp.num_vals = 1; priorityProp.num_vals = 1;
priorityProp.vals = (SmPropValue *) & priorityVal; priorityProp.vals = &priorityVal;
if (master_flag) if (master_flag)
/* Master WM restarts immediately for a doExit("restart") */ /* Master WM restarts immediately for a doExit("restart") */
@ -413,7 +412,7 @@ set_save_props(SmcConn smc_conn, int master_flag)
* to execve. Passing argv[0] is close enough. */ * to execve. Passing argv[0] is close enough. */
program = Mode.wm.exec_name; program = Mode.wm.exec_name;
userIDVal.length = strlen(user); userIDVal.length = (user) ? strlen(user) : 0;
userIDVal.value = user; userIDVal.value = user;
programVal.length = strlen(program); programVal.length = strlen(program);
programVal.value = (char *)program; programVal.value = (char *)program;
@ -629,14 +628,13 @@ static Atom atom_wm_client_leader;
static IceConn ice_conn; static IceConn ice_conn;
static void static void
ice_io_error_handler(IceConn connection) ice_io_error_handler(IceConn connection __UNUSED__)
{ {
if (EventDebug(EDBUG_TYPE_SESSION)) if (EventDebug(EDBUG_TYPE_SESSION))
Eprintf("ice_io_error_handler\n"); Eprintf("ice_io_error_handler\n");
/* The less we do here the better - the default handler does an /* The less we do here the better - the default handler does an
* exit(1) instead of closing the losing connection. */ * exit(1) instead of closing the losing connection. */
connection = 0;
} }
#endif /* HAVE_X11_SM_SMLIB_H */ #endif /* HAVE_X11_SM_SMLIB_H */

View File

@ -23,7 +23,6 @@
*/ */
#include "E.h" #include "E.h"
#include "dialog.h" #include "dialog.h"
#include <time.h>
static int tmp_move; static int tmp_move;
static int tmp_resize; static int tmp_resize;
@ -31,7 +30,7 @@ static int tmp_geominfo;
static char tmp_update_while_moving; static char tmp_update_while_moving;
static void static void
CB_ConfigureMoveResize(Dialog * d, int val, void *data __UNUSED__) CB_ConfigureMoveResize(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
{ {
if (val < 2) if (val < 2)
{ {
@ -40,12 +39,6 @@ CB_ConfigureMoveResize(Dialog * d, int val, void *data __UNUSED__)
Conf.movres.mode_info = tmp_geominfo; Conf.movres.mode_info = tmp_geominfo;
Conf.movres.update_while_moving = tmp_update_while_moving; Conf.movres.update_while_moving = tmp_update_while_moving;
} }
if (val)
if ((d = FindItem("CONFIGURE_MOVERESIZE_EXAMPLE", 0, LIST_FINDBY_NAME,
LIST_TYPE_DIALOG)))
{
DialogClose(d);
}
autosave(); autosave();
} }
@ -55,9 +48,8 @@ SettingsMoveResize(void)
Dialog *d; Dialog *d;
DItem *table, *di, *radio1, *radio2, *radio3; DItem *table, *di, *radio1, *radio2, *radio3;
if ((d = d = FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME, if (d)
LIST_TYPE_DIALOG)))
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -245,8 +237,8 @@ SettingsPlacement(void)
Dialog *d; Dialog *d;
DItem *table, *di, *radio; DItem *table, *di, *radio;
if ((d = d = FindItem("CONFIGURE_PLACEMENT", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_PLACEMENT", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -441,8 +433,8 @@ SettingsAutoRaise(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = d = FindItem("CONFIGURE_AUTORAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_AUTORAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -513,8 +505,9 @@ SettingsMiscellaneous(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = FindItem("CONFIGURE_MISCELLANEOUS", 0, LIST_FINDBY_NAME, d = FindItem("CONFIGURE_MISCELLANEOUS", 0, LIST_FINDBY_NAME,
LIST_TYPE_DIALOG))) LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -608,8 +601,8 @@ SettingsComposite(void)
Dialog *d; Dialog *d;
DItem *table, *di, *radio; DItem *table, *di, *radio;
if ((d = d = FindItem("CONFIGURE_COMPOSITE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_COMPOSITE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);

View File

@ -153,9 +153,6 @@ SetupX(const char *dstr)
if (Mode.display.screens > 1 && !Mode.wm.single && !Mode.wm.restart) if (Mode.display.screens > 1 && !Mode.wm.single && !Mode.wm.restart)
{ {
int i; int i;
char *dispstr;
dispstr = DisplayString(disp);
for (i = 0; i < Mode.display.screens; i++) for (i = 0; i < Mode.display.screens; i++)
{ {

View File

@ -46,7 +46,7 @@ typedef struct
static void SlideoutCalcSize(Slideout * s); static void SlideoutCalcSize(Slideout * s);
struct static struct
{ {
Slideout *active; Slideout *active;
} Mode_slideouts = } Mode_slideouts =
@ -498,7 +498,7 @@ IPC_Slideout(const char *params, Client * c __UNUSED__)
SlideoutShow(s, GetContextEwin(), Mode.context_win); SlideoutShow(s, GetContextEwin(), Mode.context_win);
} }
static IpcItem SlideoutsIpcArray[] = { static const IpcItem SlideoutsIpcArray[] = {
{ {
IPC_Slideout, "slideout", NULL, "Show slideout", NULL}, IPC_Slideout, "slideout", NULL, "Show slideout", NULL},
}; };

View File

@ -664,7 +664,8 @@ SnapshotEwinDialog(const EWin * ewin)
Esnprintf(s, sizeof(s), "SNAPSHOT_WINDOW-%#lx", _EwinGetClientXwin(ewin)); Esnprintf(s, sizeof(s), "SNAPSHOT_WINDOW-%#lx", _EwinGetClientXwin(ewin));
if ((d = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem(s, 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
ShowDialog(d); ShowDialog(d);
return; return;
@ -998,7 +999,8 @@ SettingsRemember(void)
const char *s; const char *s;
/* init remember window */ /* init remember window */
if ((d = FindItem("REMEMBER_WINDOW", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("REMEMBER_WINDOW", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);

View File

@ -427,7 +427,8 @@ SettingsAudio(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = FindItem("CONFIGURE_AUDIO", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) d = FindItem("CONFIGURE_AUDIO", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -525,7 +526,7 @@ SoundIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem SoundIpcArray[] = { static const IpcItem SoundIpcArray[] = {
{ {
SoundIpc, SoundIpc,
"sound", "snd", "sound", "snd",

View File

@ -266,9 +266,9 @@ EobjListTypeCount(const EobjList * ewl, int type)
/* /*
* The global object/client lists * The global object/client lists
*/ */
EobjList EwinListStack = { "Stack", 0, 0, NULL, 1 }; static EobjList EwinListStack = { "Stack", 0, 0, NULL, 1 };
EobjList EwinListFocus = { "Focus", 0, 0, NULL, 0 }; static EobjList EwinListFocus = { "Focus", 0, 0, NULL, 0 };
EobjList EwinListOrder = { "Order", 0, 0, NULL, 0 }; static EobjList EwinListOrder = { "Order", 0, 0, NULL, 0 };
static EObj *const * static EObj *const *
EobjListGet(EobjList * ewl, int *num) EobjListGet(EobjList * ewl, int *num)

View File

@ -95,7 +95,7 @@ StartupWindowsCreate(void)
EMapWindow(win1); EMapWindow(win1);
EMapWindow(win2); EMapWindow(win2);
if (ic && bw > 0 && bh > 0) if (bw > 0 && bh > 0)
{ {
b1 = ECreateWindow(w1, bx, by, bw, bh, 0); b1 = ECreateWindow(w1, bx, by, bw, bh, 0);
b2 = ECreateWindow(w2, 0, 0, bw, bh, 0); b2 = ECreateWindow(w2, 0, 0, bw, bh, 0);

View File

@ -618,7 +618,7 @@ TextclassIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem TextclassIpcArray[] = { static const IpcItem TextclassIpcArray[] = {
{ {
TextclassIpc, TextclassIpc,
"textclass", NULL, "textclass", NULL,

View File

@ -156,6 +156,8 @@ TextStateLoadFont(TextState * ts)
char s[4096], *s2, *ss; char s[4096], *s2, *ss;
s2 = Estrdup(ts->fontname); s2 = Estrdup(ts->fontname);
if (!s2)
return;
ss = strchr(s2, '/'); ss = strchr(s2, '/');
if (ss) if (ss)
{ {
@ -163,8 +165,7 @@ TextStateLoadFont(TextState * ts)
Esnprintf(s, sizeof(s), "%s.ttf", s2); Esnprintf(s, sizeof(s), "%s.ttf", s2);
ts->efont = Efont_load(s2, atoi(ss)); ts->efont = Efont_load(s2, atoi(ss));
} }
if (s2) Efree(s2);
Efree(s2);
if (ts->efont) if (ts->efont)
ts->need_utf8 = 1; ts->need_utf8 = 1;
@ -350,6 +351,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
len = strlen(lines[i]); len = strlen(lines[i]);
new_line = Emalloc(len + 10); new_line = Emalloc(len + 10);
if (!new_line)
goto done;
while (wid > textwidth_limit) while (wid > textwidth_limit)
{ {
nuke_count++; nuke_count++;
@ -445,6 +448,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
len = strlen(lines[i]); len = strlen(lines[i]);
new_line = Emalloc(len + 10); new_line = Emalloc(len + 10);
if (!new_line)
goto done;
wc_len = mbstowcs(NULL, lines[i], 0); wc_len = mbstowcs(NULL, lines[i], 0);
if (wc_len > 0) if (wc_len > 0)
{ {
@ -589,6 +594,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
len = strlen(lines[i]); len = strlen(lines[i]);
new_line = Emalloc(len + 10); new_line = Emalloc(len + 10);
if (!new_line)
goto done;
while (wid > textwidth_limit) while (wid > textwidth_limit)
{ {
nuke_count++; nuke_count++;
@ -683,6 +690,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
len = strlen(lines[i]); len = strlen(lines[i]);
new_line = Emalloc(len + 20); new_line = Emalloc(len + 20);
if (!new_line)
goto done;
while (wid > textwidth_limit) while (wid > textwidth_limit)
{ {
nuke_count += 2; nuke_count += 2;
@ -760,6 +769,7 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
yy += ts->xfont->ascent + ts->xfont->descent; yy += ts->xfont->ascent + ts->xfont->descent;
} }
} }
done:
StrlistFree(lines, num_lines); StrlistFree(lines, num_lines);
} }

View File

@ -26,8 +26,10 @@
#define ENABLE_THEME_SANITY_CHECKING 0 #define ENABLE_THEME_SANITY_CHECKING 0
#if ENABLE_THEME_SANITY_CHECKING
static char *badtheme = NULL; static char *badtheme = NULL;
static char *badreason = NULL; static char *badreason = NULL;
#endif
static const char *const theme_files[] = { static const char *const theme_files[] = {
#if ENABLE_THEME_SANITY_CHECKING #if ENABLE_THEME_SANITY_CHECKING
@ -54,7 +56,7 @@ SanitiseThemeDir(const char *dir)
int i; int i;
char s[4096]; char s[4096];
for (i = 0; (tf = theme_files[i]); i++) for (i = 0; (tf = theme_files[i]) != NULL; i++)
{ {
Esnprintf(s, sizeof(s), "%s/%s", dir, tf); Esnprintf(s, sizeof(s), "%s/%s", dir, tf);
if (isfile(s)) if (isfile(s))
@ -243,14 +245,16 @@ ThemeGetDefault(void)
/* Then, try out all installed themes */ /* Then, try out all installed themes */
path = NULL; path = NULL;
lst = ThemesList(&num); lst = ThemesList(&num);
for (i = 0; i < num; i++)
{
path = ThemeCheckPath(lst[i]);
if (path)
break;
}
if (lst) if (lst)
StrlistFree(lst, num); {
for (i = 0; i < num; i++)
{
path = ThemeCheckPath(lst[i]);
if (path)
break;
}
StrlistFree(lst, num);
}
if (path) if (path)
return ThemeGetPath(path); return ThemeGetPath(path);
@ -309,6 +313,8 @@ ThemeExtract(const char *theme)
/* vanilla tarball */ /* vanilla tarball */
Esnprintf(s, sizeof(s), "(cd %s ; tar -xf %s)", th, theme); Esnprintf(s, sizeof(s), "(cd %s ; tar -xf %s)", th, theme);
} }
else
goto done;
/* exec the untar if tarred */ /* exec the untar if tarred */
system(s); system(s);
@ -332,7 +338,9 @@ ThemeFind(const char *theme)
char paths[4096], tdir[4096], *p, *s; char paths[4096], tdir[4096], *p, *s;
char *ret; char *ret;
#if ENABLE_THEME_SANITY_CHECKING
badreason = _("Unknown\n"); badreason = _("Unknown\n");
#endif
if (!theme || !theme[0]) if (!theme || !theme[0])
return ThemeGetDefault(); return ThemeGetDefault();
@ -362,7 +370,9 @@ ThemeFind(const char *theme)
} }
ret = ThemeGetDefault(); ret = ThemeGetDefault();
#if ENABLE_THEME_SANITY_CHECKING
badtheme = Estrdup(theme); badtheme = Estrdup(theme);
#endif
return ret; return ret;
} }
@ -461,10 +471,11 @@ ThemesIpc(const char *params, Client * c __UNUSED__)
int i, num; int i, num;
lst = ThemesList(&num); lst = ThemesList(&num);
if (!lst)
return;
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
IpcPrintf("%s\n", lst[i]); IpcPrintf("%s\n", lst[i]);
if (lst) StrlistFree(lst, num);
StrlistFree(lst, num);
} }
else if (!strcmp(cmd, "use")) else if (!strcmp(cmd, "use"))
{ {
@ -473,7 +484,7 @@ ThemesIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem ThemeIpcArray[] = { static const IpcItem ThemeIpcArray[] = {
{ {
ThemesIpc, ThemesIpc,
"theme", "th", "theme", "th",

View File

@ -467,6 +467,11 @@ TooltipShow(ToolTip * tt, const char *text, ActionClass * ac, int x, int y)
/* |/#####\| */ /* |/#####\| */
/* +-------+ */ /* +-------+ */
{ {
if (dy == 0)
{
dy = 1;
ady = 1;
}
dist = tt->dist; dist = tt->dist;
ady = ady / dy; ady = ady / dy;
@ -832,8 +837,8 @@ SettingsTooltips(void)
Dialog *d; Dialog *d;
DItem *table, *di; DItem *table, *di;
if ((d = d = FindItem("CONFIGURE_TOOLTIPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
FindItem("CONFIGURE_TOOLTIPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG))) if (d)
{ {
SoundPlay("SOUND_SETTINGS_ACTIVE"); SoundPlay("SOUND_SETTINGS_ACTIVE");
ShowDialog(d); ShowDialog(d);
@ -889,7 +894,7 @@ TooltipsIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem TooltipsIpcArray[] = { static const IpcItem TooltipsIpcArray[] = {
{ {
TooltipsIpc, TooltipsIpc,
"tooltips", "tt", "tooltips", "tt",

View File

@ -64,15 +64,15 @@ struct _windowmatch
#define MATCH_OP_ICON 2 #define MATCH_OP_ICON 2
#define MATCH_OP_WINOP 3 #define MATCH_OP_WINOP 3
const char *MatchType[] = { static const char *MatchType[] = {
NULL, "Title", "Name", "Class", "Size", "Width", "Height", "Prop", NULL NULL, "Title", "Name", "Class", "Size", "Width", "Height", "Prop", NULL
}; };
const char *MatchProp[] = { static const char *MatchProp[] = {
NULL, "Transient", "Shaped", "FixedSize", "FixedWidth", "FixedHeight", NULL NULL, "Transient", "Shaped", "FixedSize", "FixedWidth", "FixedHeight", NULL
}; };
const char *MatchOp[] = { static const char *MatchOp[] = {
NULL, "Border", "Icon", "Winop", NULL NULL, "Border", "Icon", "Winop", NULL
}; };
@ -110,7 +110,8 @@ WindowMatchDestroy(WindowMatch * wm)
if (!wm) if (!wm)
return; return;
while (RemoveItemByPtr(wm, LIST_TYPE_WINDOWMATCH)); while (RemoveItemByPtr(wm, LIST_TYPE_WINDOWMATCH))
;
if (wm->name) if (wm->name)
Efree(wm->name); Efree(wm->name);
@ -131,6 +132,7 @@ WindowMatchConfigLoad(FILE * fs)
WindowMatch *wm = 0; WindowMatch *wm = 0;
char s[FILEPATH_LEN_MAX]; char s[FILEPATH_LEN_MAX];
char s2[FILEPATH_LEN_MAX]; char s2[FILEPATH_LEN_MAX];
const char *ss;
int i1; int i1;
int fields; int fields;
@ -182,19 +184,22 @@ WindowMatchConfigLoad(FILE * fs)
if (!wm) if (!wm)
break; break;
wm->match = MATCH_TYPE_TITLE; wm->match = MATCH_TYPE_TITLE;
wm->value = Estrdup(atword(s, 2)); ss = atword(s, 2);
wm->value = Estrdup(ss);
break; break;
case WINDOWMATCH_MATCHNAME: case WINDOWMATCH_MATCHNAME:
if (!wm) if (!wm)
break; break;
wm->match = MATCH_TYPE_WM_NAME; wm->match = MATCH_TYPE_WM_NAME;
wm->value = Estrdup(atword(s, 2)); ss = atword(s, 2);
wm->value = Estrdup(ss);
break; break;
case WINDOWMATCH_MATCHCLASS: case WINDOWMATCH_MATCHCLASS:
if (!wm) if (!wm)
break; break;
wm->match = MATCH_TYPE_WM_CLASS; wm->match = MATCH_TYPE_WM_CLASS;
wm->value = Estrdup(atword(s, 2)); ss = atword(s, 2);
wm->value = Estrdup(ss);
break; break;
case WINDOWMATCH_WIDTH: case WINDOWMATCH_WIDTH:
@ -894,7 +899,7 @@ WindowMatchIpc(const char *params, Client * c __UNUSED__)
} }
} }
IpcItem WindowMatchIpcArray[] = { static const IpcItem WindowMatchIpcArray[] = {
{ {
WindowMatchIpc, WindowMatchIpc,
"wmatch", "wma", "wmatch", "wma",

View File

@ -22,7 +22,6 @@
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/ */
#include "E.h" #include "E.h"
#include "ecore-e16.h"
#include "xwin.h" #include "xwin.h"
#include <X11/Xutil.h> #include <X11/Xutil.h>
#include <X11/Xresource.h> #include <X11/Xresource.h>
@ -1055,6 +1054,8 @@ EShapeGetRectangles(Window win, int dest, int *rn, int *ord)
if (xid->num_rect > 0) if (xid->num_rect > 0)
{ {
r = Emalloc(sizeof(XRectangle) * xid->num_rect); r = Emalloc(sizeof(XRectangle) * xid->num_rect);
if (!r)
return NULL;
memcpy(r, xid->rects, sizeof(XRectangle) * xid->num_rect); memcpy(r, xid->rects, sizeof(XRectangle) * xid->num_rect);
return r; return r;
} }
@ -1070,6 +1071,8 @@ EShapeGetRectangles(Window win, int dest, int *rn, int *ord)
if (r) if (r)
{ {
rr = Emalloc(sizeof(XRectangle) * *rn); rr = Emalloc(sizeof(XRectangle) * *rn);
if (!rr)
return NULL;
memcpy(rr, r, sizeof(XRectangle) * *rn); memcpy(rr, r, sizeof(XRectangle) * *rn);
XFree(r); XFree(r);
return rr; return rr;