General bug hunt - Found a few, pedantic cleanups, dead code removal.
SVN revision: 18153
This commit is contained in:
parent
46265d2e96
commit
0dfa113313
35
src/E.h
35
src/E.h
|
@ -102,10 +102,6 @@
|
|||
#define __PRINTF__
|
||||
#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
|
||||
#error "ERROR: Enlightenment needs a system with getcwd() in it's libs."
|
||||
#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);
|
||||
|
||||
/* borders.c */
|
||||
Border *BorderCreate(const char *name);
|
||||
void BorderDestroy(Border * b);
|
||||
void BorderIncRefcount(const Border * b);
|
||||
void BorderDecRefcount(const Border * b);
|
||||
const char *BorderGetName(const Border * b);
|
||||
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 EwinBorderDetach(EWin * ewin);
|
||||
void EwinBorderSetTo(EWin * ewin, const Border * b);
|
||||
|
@ -840,7 +826,6 @@ void EwinBorderUpdateState(EWin * ewin);
|
|||
void EwinBorderEventsConfigure(EWin * ewin, int mode);
|
||||
void EwinSetBorder(EWin * ewin, const Border * b, int apply);
|
||||
void EwinSetBorderByName(EWin * ewin, const char *name);
|
||||
void BorderWinpartChange(EWin * ewin, int i, int force);
|
||||
int BorderWinpartIndex(EWin * ewin, Window win);
|
||||
Border *BorderCreateFiller(int left, int right, int top,
|
||||
int bottom);
|
||||
|
@ -896,7 +881,6 @@ void DialogAlertOK(const char *fmt, ...);
|
|||
|
||||
/* dock.c */
|
||||
void DockIt(EWin * ewin);
|
||||
void DockDestroy(EWin * ewin);
|
||||
|
||||
/* draw.c */
|
||||
Imlib_Image *ELoadImage(const char *file);
|
||||
|
@ -966,27 +950,20 @@ void ExtInitWinKill(void);
|
|||
void Etmp(char *s);
|
||||
void E_md(const char *s);
|
||||
int exists(const char *s);
|
||||
void mkdirs(const char *s);
|
||||
int isfile(const char *s);
|
||||
int isdir(const char *s);
|
||||
int isabspath(const char *s);
|
||||
char **E_ls(const char *dir, int *num);
|
||||
void E_rm(const char *s);
|
||||
void E_mv(const char *s, const char *ss);
|
||||
void E_cp(const char *s, const char *ss);
|
||||
time_t moddate(const char *s);
|
||||
int filesize(const char *s);
|
||||
int fileinode(const char *s);
|
||||
int filedev_map(int dev);
|
||||
int filedev(const char *s);
|
||||
void E_cd(const char *s);
|
||||
char *cwd(void);
|
||||
int permissions(const char *s);
|
||||
char *username(int uid);
|
||||
char *homedir(int uid);
|
||||
char *usershell(int uid);
|
||||
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);
|
||||
int canread(const char *s);
|
||||
int canwrite(const char *s);
|
||||
|
@ -1021,10 +998,7 @@ EWin **ListWinGroupMembersForEwin(const EWin * ewin, int action,
|
|||
#define FOCUS_CLICK 12
|
||||
|
||||
void FocusEnable(int on);
|
||||
void FocusGetNextEwin(void);
|
||||
void FocusGetPrevEwin(void);
|
||||
void FocusEwinSetGrabs(EWin * ewin);
|
||||
void FocusFix(void);
|
||||
void FocusToEWin(EWin * ewin, int why);
|
||||
void FocusHandleEnter(EWin * ewin, XEvent * ev);
|
||||
void FocusHandleLeave(EWin * ewin, XEvent * ev);
|
||||
|
@ -1049,16 +1023,10 @@ void GrabButtonRelease(unsigned int button,
|
|||
unsigned int modifiers, Window win);
|
||||
|
||||
/* groups.c */
|
||||
void BreakWindowGroup(EWin * ewin, Group * g);
|
||||
void BuildWindowGroup(EWin ** ewins, int num);
|
||||
int EwinInGroup(EWin * ewin, Group * g);
|
||||
Group *EwinsInGroup(EWin * ewin1, EWin * ewin2);
|
||||
void AddEwinToGroup(EWin * ewin, Group * g);
|
||||
void RemoveEwinFromGroup(EWin * ewin, Group * g);
|
||||
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);
|
||||
|
||||
/* handlers.c */
|
||||
|
@ -1204,8 +1172,6 @@ void autosave(void);
|
|||
|
||||
/* settings.c */
|
||||
void SettingsMoveResize(void);
|
||||
void SettingsDesktops(void);
|
||||
void SettingsArea(void);
|
||||
void SettingsPlacement(void);
|
||||
void SettingsAutoRaise(void);
|
||||
void SettingsMiscellaneous(void);
|
||||
|
@ -1263,7 +1229,6 @@ void WarpFocus(int delta);
|
|||
typedef struct _windowmatch WindowMatch;
|
||||
|
||||
int WindowMatchConfigLoad(FILE * fs);
|
||||
void *WindowMatchEwin(EWin * ewin);
|
||||
Border *WindowMatchEwinBorder(const EWin * ewin);
|
||||
const char *WindowMatchEwinIcon(const EWin * ewin);
|
||||
void WindowMatchEwinOps(EWin * ewin);
|
||||
|
|
14
src/aclass.c
14
src/aclass.c
|
@ -125,8 +125,9 @@ ActionAddTo(Action * aa, const char *params)
|
|||
{
|
||||
ActionType *pptr, *ptr, *at;
|
||||
|
||||
pptr = NULL;
|
||||
at = Emalloc(sizeof(ActionType));
|
||||
if (!at)
|
||||
return;
|
||||
at->next = NULL;
|
||||
at->params = Estrdup(params);
|
||||
if (!aa->action)
|
||||
|
@ -135,13 +136,15 @@ ActionAddTo(Action * aa, const char *params)
|
|||
}
|
||||
else
|
||||
{
|
||||
pptr = NULL;
|
||||
ptr = aa->action;
|
||||
while (ptr)
|
||||
{
|
||||
pptr = ptr;
|
||||
ptr = ptr->next;
|
||||
}
|
||||
pptr->next = at;
|
||||
if (pptr)
|
||||
pptr->next = at;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -187,7 +190,8 @@ ActionclassDestroy(ActionClass * ac)
|
|||
ac->ref_count);
|
||||
return;
|
||||
}
|
||||
while (RemoveItemByPtr(ac, LIST_TYPE_ACLASS));
|
||||
while (RemoveItemByPtr(ac, LIST_TYPE_ACLASS))
|
||||
;
|
||||
|
||||
for (i = 0; i < ac->num; i++)
|
||||
ActionDestroy(ac->list[i]);
|
||||
|
@ -579,7 +583,7 @@ ActionEncode(Action * aa, char *buf, int len)
|
|||
{
|
||||
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))
|
||||
return 0;
|
||||
|
||||
|
@ -1270,7 +1274,7 @@ IPC_KeybindingsSet(const char *params, Client * c __UNUSED__)
|
|||
AclassConfigSave();
|
||||
}
|
||||
|
||||
IpcItem AclassIpcArray[] = {
|
||||
static const IpcItem AclassIpcArray[] = {
|
||||
{
|
||||
AclassIpc,
|
||||
"aclass", "ac",
|
||||
|
|
|
@ -48,6 +48,8 @@ runApp(const char *exe, const char *params)
|
|||
{
|
||||
Efree(path);
|
||||
real_exec = Emalloc(strlen(params) + 6);
|
||||
if (!real_exec)
|
||||
return;
|
||||
sprintf(real_exec, "exec %s", params);
|
||||
execl(sh, sh, "-c", real_exec, NULL);
|
||||
exit(0);
|
||||
|
@ -129,13 +131,14 @@ runApp(const char *exe, const char *params)
|
|||
"This is because the file is not a "
|
||||
"regular file.\n"), path);
|
||||
}
|
||||
if (path)
|
||||
Efree(path);
|
||||
Efree(path);
|
||||
}
|
||||
}
|
||||
exit(100);
|
||||
}
|
||||
real_exec = Emalloc(strlen(params) + 6);
|
||||
if (!real_exec)
|
||||
return;
|
||||
sprintf(real_exec, "exec %s", params);
|
||||
execl(sh, sh, "-c", real_exec, NULL);
|
||||
exit(0);
|
||||
|
|
22
src/alert.c
22
src/alert.c
|
@ -154,7 +154,7 @@ ShowAlert(char *text)
|
|||
XSetWindowAttributes att;
|
||||
XRectangle rect1, rect2;
|
||||
char colorful;
|
||||
unsigned long cols[256];
|
||||
unsigned long cols[5];
|
||||
XColor xcl;
|
||||
Colormap cmap;
|
||||
int cnum, fh, x, y, ww, hh, mh;
|
||||
|
@ -200,6 +200,7 @@ ShowAlert(char *text)
|
|||
|
||||
cnum = 0;
|
||||
colorful = 0;
|
||||
cols[0] = cols[1] = cols[2] = cols[3] = cols[4] = 0;
|
||||
if (DefaultDepth(dd, DefaultScreen(dd)) > 4)
|
||||
{
|
||||
ExSetColor(&xcl, 220, 220, 220);
|
||||
|
@ -437,7 +438,8 @@ ShowAlert(char *text)
|
|||
|
||||
case Expose:
|
||||
/* 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);
|
||||
w = rect2.width;
|
||||
|
@ -597,16 +599,16 @@ AlertX(const char *title, const char *ignore,
|
|||
const char *restart, const char *quit, const char *fmt, ...)
|
||||
{
|
||||
char text[10240];
|
||||
va_list ap;
|
||||
va_list args;
|
||||
|
||||
AssignTitleText(title);
|
||||
AssignIgnoreText(ignore);
|
||||
AssignRestartText(restart);
|
||||
AssignExitText(quit);
|
||||
|
||||
va_start(ap, fmt);
|
||||
Evsnprintf(text, 10240, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(args, fmt);
|
||||
Evsnprintf(text, 10240, fmt, args);
|
||||
va_end(args);
|
||||
SoundPlay("SOUND_ALERT");
|
||||
ShowAlert(text);
|
||||
|
||||
|
@ -620,11 +622,11 @@ void
|
|||
Alert(const char *fmt, ...)
|
||||
{
|
||||
char text[10240];
|
||||
va_list ap;
|
||||
va_list args;
|
||||
|
||||
va_start(ap, fmt);
|
||||
Evsnprintf(text, 10240, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(args, fmt);
|
||||
Evsnprintf(text, 10240, fmt, args);
|
||||
va_end(args);
|
||||
SoundPlay("SOUND_ALERT");
|
||||
ShowAlert(text);
|
||||
}
|
||||
|
|
|
@ -195,7 +195,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
|
|||
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
|
||||
}
|
||||
/* 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++)
|
||||
{
|
||||
x1 = -1;
|
||||
|
@ -405,7 +406,8 @@ ArrangeRects(RectBox * fixed, int fixed_count, RectBox * floating,
|
|||
ArrangeAddToList(&yarray, ysize, sorted[j].y + sorted[j].h);
|
||||
}
|
||||
/* 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++)
|
||||
{
|
||||
x1 = -1;
|
||||
|
@ -605,6 +607,8 @@ SnapEwin(EWin * ewin, int dx, int dy, int *new_dx, int *new_dy)
|
|||
if (lst1)
|
||||
{
|
||||
lst = malloc(num * sizeof(EWin *));
|
||||
if (!lst)
|
||||
return;
|
||||
memcpy(lst, lst1, num * sizeof(EWin *));
|
||||
}
|
||||
gwins = ListWinGroupMembersForEwin(ewin, GROUP_ACTION_MOVE, Mode.nogroup
|
||||
|
|
|
@ -668,7 +668,7 @@ BackgroundApply(Background * bg, Drawable draw,
|
|||
imlib_context_set_drawable(pmap);
|
||||
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);
|
||||
}
|
||||
|
@ -1161,7 +1161,8 @@ BackgroundsConfigLoad(FILE * fs)
|
|||
|
||||
case CONFIG_CLASSNAME:
|
||||
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;
|
||||
}
|
||||
|
@ -1610,17 +1611,15 @@ BG_GetValues(void)
|
|||
static void
|
||||
BG_DialogSetFileName(DItem * di)
|
||||
{
|
||||
char *stmp;
|
||||
char *stmp = NULL;
|
||||
char s[1024];
|
||||
|
||||
if (BackgroundGetBgFile(tmp_bg))
|
||||
stmp = fullfileof(BackgroundGetBgFile(tmp_bg));
|
||||
else
|
||||
stmp = Estrdup(_("-NONE-"));
|
||||
Esnprintf(s, sizeof(s),
|
||||
_("Background definition information:\nName: %s\nFile: %s\n"),
|
||||
BackgroundGetName(tmp_bg), stmp);
|
||||
Efree(stmp);
|
||||
BackgroundGetName(tmp_bg), (stmp) ? stmp : _("-NONE-"));
|
||||
_EFREE(stmp);
|
||||
DialogItemSetText(di, s);
|
||||
}
|
||||
|
||||
|
@ -2104,7 +2103,8 @@ SettingsBackground(Background * bg)
|
|||
int num;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -2112,7 +2112,7 @@ SettingsBackground(Background * bg)
|
|||
}
|
||||
SoundPlay("SOUND_SETTINGS_BG");
|
||||
|
||||
if (!bg || (bg && BackgroundIsNone(bg)))
|
||||
if (!bg || BackgroundIsNone(bg))
|
||||
{
|
||||
Esnprintf(s, sizeof(s), "__NEWBG_%i", (unsigned)time(NULL));
|
||||
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
|
||||
|
||||
IpcItem BackgroundsIpcArray[] = {
|
||||
static const IpcItem BackgroundsIpcArray[] = {
|
||||
{
|
||||
BackgroundsIpc,
|
||||
"background", "bg",
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
#include "tclass.h"
|
||||
#include "tooltips.h"
|
||||
#include "xwin.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
#define EWIN_BORDER_PART_EVENT_MASK \
|
||||
(KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | \
|
||||
|
@ -37,6 +36,7 @@
|
|||
#define EWIN_BORDER_TITLE_EVENT_MASK \
|
||||
(EWIN_BORDER_PART_EVENT_MASK)
|
||||
|
||||
static void BorderDestroy(Border * b);
|
||||
static void BorderWinpartHandleEvents(XEvent * ev, void *prm);
|
||||
static void BorderFrameHandleEvents(XEvent * ev, void *prm);
|
||||
|
||||
|
@ -143,7 +143,7 @@ BorderWinpartDraw(EWin * ewin, int i)
|
|||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
BorderWinpartChange(EWin * ewin, int i, int force)
|
||||
{
|
||||
BorderWinpartITclassApply(ewin, i, force);
|
||||
|
@ -597,8 +597,7 @@ EwinSetBorder(EWin * ewin, const Border * b, int apply)
|
|||
if (ewin->border)
|
||||
BorderDecRefcount(ewin->border);
|
||||
ewin->border = b;
|
||||
if (b)
|
||||
BorderIncRefcount(b);
|
||||
BorderIncRefcount(b);
|
||||
}
|
||||
|
||||
if (!ewin->state.fullscreen)
|
||||
|
@ -615,7 +614,7 @@ EwinSetBorderByName(EWin * ewin, const char *name)
|
|||
EwinSetBorder(ewin, b, 0);
|
||||
}
|
||||
|
||||
Border *
|
||||
static Border *
|
||||
BorderCreate(const char *name)
|
||||
{
|
||||
Border *b;
|
||||
|
@ -631,7 +630,7 @@ BorderCreate(const char *name)
|
|||
return b;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
BorderDestroy(Border * b)
|
||||
{
|
||||
int i;
|
||||
|
@ -645,7 +644,8 @@ BorderDestroy(Border * b)
|
|||
return;
|
||||
}
|
||||
|
||||
while (RemoveItemByPtr(b, LIST_TYPE_BORDER));
|
||||
while (RemoveItemByPtr(b, LIST_TYPE_BORDER))
|
||||
;
|
||||
|
||||
for (i = 0; i < b->num_winparts; i++)
|
||||
{
|
||||
|
@ -670,20 +670,19 @@ BorderDestroy(Border * b)
|
|||
ActionclassDecRefcount(b->aclass);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
BorderWinpartAdd(Border * b, ImageClass * iclass, ActionClass * aclass,
|
||||
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)
|
||||
char isregion __UNUSED__, 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)
|
||||
{
|
||||
int n;
|
||||
|
||||
b->num_winparts++;
|
||||
n = b->num_winparts;
|
||||
|
||||
isregion = 0;
|
||||
|
||||
b->part = Erealloc(b->part, n * sizeof(WinPart));
|
||||
|
||||
if (!iclass)
|
||||
|
@ -1031,7 +1030,7 @@ BorderWinpartHandleEvents(XEvent * ev, void *prm)
|
|||
#include "conf.h"
|
||||
|
||||
static int
|
||||
BorderPartLoad(FILE * fs, char type, Border * b)
|
||||
BorderPartLoad(FILE * fs, char type __UNUSED__, Border * b)
|
||||
{
|
||||
int err = 0;
|
||||
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 fields;
|
||||
|
||||
type = 0;
|
||||
while (GetLine(s, sizeof(s), fs))
|
||||
{
|
||||
s2[0] = 0;
|
||||
|
|
|
@ -180,7 +180,8 @@ ButtonDestroy(Button * b)
|
|||
return;
|
||||
}
|
||||
|
||||
while (RemoveItemByPtr(b, LIST_TYPE_BUTTON));
|
||||
while (RemoveItemByPtr(b, LIST_TYPE_BUTTON))
|
||||
;
|
||||
|
||||
EoFini(b);
|
||||
|
||||
|
@ -697,6 +698,7 @@ ButtonsConfigLoad(FILE * ConfigFile)
|
|||
char show = 1;
|
||||
char internal = 0;
|
||||
int fields;
|
||||
const char *ss;
|
||||
|
||||
while (GetLine(s, sizeof(s), ConfigFile))
|
||||
{
|
||||
|
@ -745,7 +747,8 @@ ButtonsConfigLoad(FILE * ConfigFile)
|
|||
break;
|
||||
case BUTTON_LABEL:
|
||||
_EFREE(label);
|
||||
label = Estrdup(atword(s, 2));
|
||||
ss = atword(s, 2);
|
||||
label = Estrdup(ss);
|
||||
if (pbt)
|
||||
{
|
||||
_EFREE(pbt->label);
|
||||
|
@ -1132,7 +1135,7 @@ IPC_ButtonShow(const char *params, Client * c __UNUSED__)
|
|||
doHideShowButton(params);
|
||||
}
|
||||
|
||||
IpcItem ButtonsIpcArray[] = {
|
||||
static const IpcItem ButtonsIpcArray[] = {
|
||||
{
|
||||
ButtonsIpc,
|
||||
"button", "btn",
|
||||
|
|
|
@ -21,9 +21,9 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include "conf.h"
|
||||
|
||||
#if ENABLE_COLOR_MODIFIERS
|
||||
#include "conf.h"
|
||||
|
||||
void
|
||||
CreateCurve(ModCurve * c)
|
||||
|
@ -644,7 +644,7 @@ IPC_ColormodifierSet(const char *params, Client * c __UNUSED__)
|
|||
Efree(bpy);
|
||||
}
|
||||
|
||||
IpcItem CmClassIpcArray[] = {
|
||||
static const IpcItem CmClassIpcArray[] = {
|
||||
{
|
||||
IPC_ColorModifierClass,
|
||||
"colormod", NULL,
|
||||
|
|
|
@ -27,7 +27,6 @@
|
|||
#include "conf.h"
|
||||
#include "menus.h"
|
||||
#include "tooltips.h"
|
||||
#include <ctype.h>
|
||||
|
||||
#define SKIP_If_EXISTS(name, type) \
|
||||
if (ConfigSkipIfExists(ConfigFile, name, type)) return
|
||||
|
|
|
@ -115,7 +115,8 @@ ECursorDestroy(ECursor * ec)
|
|||
return;
|
||||
}
|
||||
|
||||
while (RemoveItemByPtr(ec, LIST_TYPE_ECURSOR));
|
||||
while (RemoveItemByPtr(ec, LIST_TYPE_ECURSOR))
|
||||
;
|
||||
|
||||
if (ec->name)
|
||||
Efree(ec->name);
|
||||
|
@ -184,12 +185,12 @@ ECursorConfigLoad(FILE * fs)
|
|||
_EFDUP(name, s2);
|
||||
break;
|
||||
case CURS_BG_RGB:
|
||||
EGetColor(&xclr, &r, &g, &b);
|
||||
r = g = b = 0;
|
||||
sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b);
|
||||
ESetColor(&xclr, r, g, b);
|
||||
break;
|
||||
case CURS_FG_RGB:
|
||||
EGetColor(&xclr2, &r, &g, &b);
|
||||
r = g = b = 255;
|
||||
sscanf(s, "%4000s %d %d %d", s2, &r, &g, &b);
|
||||
ESetColor(&xclr2, r, g, b);
|
||||
break;
|
||||
|
@ -354,7 +355,7 @@ CursorsIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem CursorIpcArray[] = {
|
||||
static const IpcItem CursorIpcArray[] = {
|
||||
{
|
||||
CursorsIpc,
|
||||
"cursor", "csr",
|
||||
|
|
|
@ -71,7 +71,7 @@ DeskControlsCreate(Desk * dsk)
|
|||
{
|
||||
char s[512];
|
||||
ActionClass *ac, *ac2, *ac3;
|
||||
ImageClass *ic, *ic2, *ic3, *ic4;
|
||||
ImageClass *ic, *ic2, *ic3;
|
||||
Button *b;
|
||||
Action *a;
|
||||
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);
|
||||
ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_VERT", 0);
|
||||
ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_VERT", 0);
|
||||
#if 0
|
||||
ic4 = ImageclassFind("DESKTOP_DESKRAY_VERT", 0);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
ic = ImageclassFind("DESKTOP_DRAGBUTTON_HORIZ", 0);
|
||||
ic2 = ImageclassFind("DESKTOP_RAISEBUTTON_HORIZ", 0);
|
||||
ic3 = ImageclassFind("DESKTOP_LOWERBUTTON_HORIZ", 0);
|
||||
#if 0
|
||||
ic4 = ImageclassFind("DESKTOP_DESKRAY_HORIZ", 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (Conf.desks.dragbar_ordering)
|
||||
|
@ -216,6 +220,7 @@ DeskControlsCreate(Desk * dsk)
|
|||
|
||||
switch (Conf.desks.dragdir)
|
||||
{
|
||||
default:
|
||||
case 0:
|
||||
w[0] = w[1] = w[2] = h[0] = h[1] = Conf.desks.dragbar_width;
|
||||
if (Conf.desks.dragbar_length == 0)
|
||||
|
@ -260,8 +265,6 @@ DeskControlsCreate(Desk * dsk)
|
|||
x[n] = x[m] + w[m];
|
||||
x[o] = x[n] + w[n];
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
b = NULL;
|
||||
|
@ -621,7 +624,7 @@ DesksClear(void)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
DesksResize(int w, int h)
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SettingsDesktops(void)
|
||||
{
|
||||
Dialog *d;
|
||||
DItem *table, *di, *area, *slider, *radio;
|
||||
char s[64];
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_DESKTOPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_DESKTOPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
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);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
SettingsArea(void)
|
||||
{
|
||||
Dialog *d;
|
||||
DItem *table, *di, *area, *slider, *slider2, *table2;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -2388,7 +2392,7 @@ DesksIpcArea(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem DesksIpcArray[] = {
|
||||
static const IpcItem DesksIpcArray[] = {
|
||||
{
|
||||
DesksIpcDesk,
|
||||
"desk", NULL,
|
||||
|
|
|
@ -78,6 +78,5 @@ void DesksSetCurrent(Desk * dsk);
|
|||
void DeskGetCurrentArea(int *ax, int *ay);
|
||||
void DeskSetCurrentArea(int ax, int ay);
|
||||
void DesksClear(void);
|
||||
void DesksResize(int w, int h);
|
||||
|
||||
#endif /* _DESKTOPS_H_ */
|
||||
|
|
51
src/dialog.c
51
src/dialog.c
|
@ -197,12 +197,14 @@ struct _dialog
|
|||
};
|
||||
|
||||
static Dialog *FindDialog(Window win);
|
||||
static int FindADialog(void);
|
||||
|
||||
static void DialogHandleEvents(XEvent * ev, void *prm);
|
||||
static void DButtonHandleEvents(XEvent * ev, void *prm);
|
||||
|
||||
static void MoveTableBy(Dialog * d, DItem * di, int dx, int dy);
|
||||
static void DialogItemsRealize(Dialog * d);
|
||||
static void DialogFreeItem(DItem * di);
|
||||
|
||||
static void DialogUpdate(Dialog * d);
|
||||
static char dialog_update_pending = 0;
|
||||
|
@ -957,13 +959,11 @@ DialogRealizeItem(Dialog * d, DItem * di)
|
|||
def = "DIALOG_WIDGET_BUTTON";
|
||||
}
|
||||
|
||||
if (def)
|
||||
{
|
||||
if (!di->tclass)
|
||||
di->tclass = TextclassFind(def, 1);
|
||||
if (!di->iclass)
|
||||
di->iclass = ImageclassFind(def, 1);
|
||||
}
|
||||
if (!di->tclass)
|
||||
di->tclass = TextclassFind(def, 1);
|
||||
if (!di->iclass)
|
||||
di->iclass = ImageclassFind(def, 1);
|
||||
|
||||
if (di->tclass)
|
||||
TextclassIncRefcount(di->tclass);
|
||||
if (di->iclass)
|
||||
|
@ -1220,7 +1220,7 @@ DialogRealizeItem(Dialog * d, DItem * di)
|
|||
|
||||
cols = di->item.table.num_columns;
|
||||
rows = 1;
|
||||
if ((cols > 0) && (rows > 0))
|
||||
if (cols > 0)
|
||||
{
|
||||
int i, r, c, x, y;
|
||||
int *col_size, *row_size;
|
||||
|
@ -2004,7 +2004,8 @@ DialogItemFindWindow(DItem * di, Window win)
|
|||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -2019,12 +2020,6 @@ DialogItemFindWindow(DItem * di, Window win)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
DItem *
|
||||
DialogItem(Dialog * d)
|
||||
{
|
||||
return d->item;
|
||||
}
|
||||
|
||||
/* Convenience callback to close dialog */
|
||||
void
|
||||
DialogCallbackClose(Dialog * d, int val __UNUSED__, void *data __UNUSED__)
|
||||
|
@ -2040,11 +2035,11 @@ void
|
|||
DialogOK(const char *title, const char *fmt, ...)
|
||||
{
|
||||
char text[10240];
|
||||
va_list ap;
|
||||
va_list args;
|
||||
|
||||
va_start(ap, fmt);
|
||||
Evsnprintf(text, sizeof(text), fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(args, fmt);
|
||||
Evsnprintf(text, sizeof(text), fmt, args);
|
||||
va_end(args);
|
||||
|
||||
DialogOKstr(title, text);
|
||||
}
|
||||
|
@ -2066,11 +2061,11 @@ void
|
|||
DialogAlert(const char *fmt, ...)
|
||||
{
|
||||
char text[10240];
|
||||
va_list ap;
|
||||
va_list args;
|
||||
|
||||
va_start(ap, fmt);
|
||||
Evsnprintf(text, 10240, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(args, fmt);
|
||||
Evsnprintf(text, 10240, fmt, args);
|
||||
va_end(args);
|
||||
Alert(text);
|
||||
}
|
||||
|
||||
|
@ -2078,11 +2073,11 @@ void
|
|||
DialogAlertOK(const char *fmt, ...)
|
||||
{
|
||||
char text[10240];
|
||||
va_list ap;
|
||||
va_list args;
|
||||
|
||||
va_start(ap, fmt);
|
||||
Evsnprintf(text, 10240, fmt, ap);
|
||||
va_end(ap);
|
||||
va_start(args, fmt);
|
||||
Evsnprintf(text, 10240, fmt, args);
|
||||
va_end(args);
|
||||
AlertX(_("Attention !!!"), _("OK"), NULL, NULL, text);
|
||||
}
|
||||
|
||||
|
@ -2563,7 +2558,7 @@ FindEwinByDialog(Dialog * d)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
FindADialog(void)
|
||||
{
|
||||
EWin *const *ewins;
|
||||
|
|
|
@ -77,7 +77,6 @@ void DialogAddFooter(Dialog * d, int flags,
|
|||
DialogCallbackFunc * cb);
|
||||
DItem *DialogInitItem(Dialog * d);
|
||||
DItem *DialogAddItem(DItem * dii, int type);
|
||||
DItem *DialogItem(Dialog * d);
|
||||
void DialogItemSetCallback(DItem * di, DialogCallbackFunc * func,
|
||||
int val, void *data);
|
||||
void DialogItemSetClass(DItem * di, struct _imageclass *ic,
|
||||
|
@ -101,7 +100,6 @@ void DialogItemTableSetOptions(DItem * di, int num_columns,
|
|||
void DialogItemSeparatorSetOrientation(DItem * di,
|
||||
char horizontal);
|
||||
void DialogItemImageSetFile(DItem * di, const char *image);
|
||||
void DialogFreeItem(DItem * di);
|
||||
void DialogItemSetRowSpan(DItem * di, int row_span);
|
||||
void DialogItemSetColSpan(DItem * di, int col_span);
|
||||
void DialogItemRadioButtonSetFirst(DItem * di, DItem * first);
|
||||
|
@ -131,6 +129,5 @@ void DialogCallbackClose(Dialog * d, int val, void *data);
|
|||
void DialogsCheckUpdate(void);
|
||||
|
||||
EWin *FindEwinByDialog(Dialog * d);
|
||||
int FindADialog(void);
|
||||
|
||||
#endif /* _DIALOG_H_ */
|
||||
|
|
22
src/draw.c
22
src/draw.c
|
@ -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) \
|
||||
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, x2, y1, (x2) - 6, (y1) - 3); \
|
||||
XDrawLine(disp, root, gc, x2, y1, (x2) - 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); \
|
||||
} \
|
||||
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); \
|
||||
XDrawString(disp, root, gc, ((x1) + (x2)) / 2, (y1) - 10, str, strlen(str)); \
|
||||
}
|
||||
#define DRAW_V_ARROW(y1, y2, x1) \
|
||||
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, y2, (x1) + 3, (y2) - 6); \
|
||||
XDrawLine(disp, root, gc, x1, y2, (x1) - 3, (y2) - 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); \
|
||||
} \
|
||||
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); \
|
||||
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) \
|
||||
if (!font) \
|
||||
|
|
|
@ -43,7 +43,6 @@
|
|||
#include <unistd.h>
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xatom.h>
|
||||
#include <X11/extensions/Xcomposite.h>
|
||||
#include <X11/extensions/Xdamage.h>
|
||||
#include <X11/extensions/Xrender.h>
|
||||
|
@ -1684,7 +1683,7 @@ ECompMgrCheckAlphaMask(ECmWinInfo * cw)
|
|||
{
|
||||
if (cw->opacity != OPAQUE && !cw->alphaPict)
|
||||
cw->alphaPict = EPictureCreateSolid(False, (double)cw->opacity / OPAQUE,
|
||||
0, 0, 0);
|
||||
0., 0., 0.);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1786,7 +1785,6 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
|
|||
if (eo->type == EOBJ_TYPE_DESK)
|
||||
{
|
||||
EObj *eo1, *eo2;
|
||||
ECmWinInfo *ec1;
|
||||
Desk *d = (Desk *) eo;
|
||||
|
||||
if (!d->viewable)
|
||||
|
@ -1795,7 +1793,6 @@ ECompMgrDetermineOrder(EObj * const *lst, int num, EObj ** first,
|
|||
stop = ECompMgrDetermineOrder(lst, num, &eo1, &eo2, d, clip);
|
||||
if (eo1)
|
||||
{
|
||||
ec1 = eo1->cmhook;
|
||||
if (!eo_first)
|
||||
eo_first = eo1;
|
||||
if (eo_prev)
|
||||
|
@ -1945,7 +1942,7 @@ ECompMgrRepaintObj(Picture pbuf, XserverRegion region, EObj * eo, int mode)
|
|||
if (cw->opacity != OPAQUE && !cw->shadowPict)
|
||||
cw->shadowPict = EPictureCreateSolid(True,
|
||||
(double)cw->opacity /
|
||||
OPAQUE * 0.3, 0, 0, 0);
|
||||
OPAQUE * 0.3, 0., 0., 0.);
|
||||
ERegionSubtractOffset(clip, x, y, cw->shape);
|
||||
XFixesSetPictureClipRegion(dpy, pbuf, 0, 0, clip);
|
||||
XRenderComposite(dpy, PictOpOver,
|
||||
|
@ -2122,7 +2119,7 @@ static void
|
|||
ECompMgrShadowsInit(int mode, int cleanup)
|
||||
{
|
||||
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
|
||||
{
|
||||
if (gaussianMap)
|
||||
|
@ -2131,7 +2128,7 @@ ECompMgrShadowsInit(int mode, int cleanup)
|
|||
}
|
||||
|
||||
if (mode != ECM_SHADOWS_OFF)
|
||||
blackPicture = EPictureCreateSolid(True, 1, 0, 0, 0);
|
||||
blackPicture = EPictureCreateSolid(True, 1., 0., 0., 0.);
|
||||
else
|
||||
{
|
||||
if (blackPicture)
|
||||
|
@ -2140,7 +2137,7 @@ ECompMgrShadowsInit(int mode, int cleanup)
|
|||
}
|
||||
|
||||
if (mode == ECM_SHADOWS_SHARP)
|
||||
transBlackPicture = EPictureCreateSolid(True, 0.3, 0, 0, 0);
|
||||
transBlackPicture = EPictureCreateSolid(True, 0.3, 0., 0., 0.);
|
||||
else
|
||||
{
|
||||
if (transBlackPicture)
|
||||
|
@ -2239,15 +2236,18 @@ ECompMgrStop(void)
|
|||
if (num > 0)
|
||||
{
|
||||
lst = Emalloc(num * sizeof(EObj *));
|
||||
memcpy(lst, lst1, num * sizeof(EObj *));
|
||||
for (i = 0; i < num; i++)
|
||||
if (lst)
|
||||
{
|
||||
if (lst[i]->type == EOBJ_TYPE_EXT)
|
||||
EobjUnregister(lst[i]); /* Modifies the object stack! */
|
||||
else
|
||||
ECompMgrWinDel(lst[i]);
|
||||
memcpy(lst, lst1, num * sizeof(EObj *));
|
||||
for (i = 0; i < num; 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)
|
||||
|
@ -2372,7 +2372,7 @@ ECompMgrHandleRootEvent(XEvent * ev, void *prm)
|
|||
case CreateNotify:
|
||||
xwin = ev->xcreatewindow.window;
|
||||
case_CreateNotify:
|
||||
if (!Conf_compmgr.override_redirect.mode != ECM_OR_ON_CREATE)
|
||||
if (Conf_compmgr.override_redirect.mode != ECM_OR_ON_CREATE)
|
||||
break;
|
||||
eo = EobjListStackFind(xwin);
|
||||
if (!eo)
|
||||
|
@ -2583,7 +2583,7 @@ CompMgrIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem CompMgrIpcArray[] = {
|
||||
static const IpcItem CompMgrIpcArray[] = {
|
||||
{
|
||||
CompMgrIpc,
|
||||
"compmgr", "cm",
|
||||
|
|
|
@ -463,7 +463,7 @@ ConfigurationSet(const char *params)
|
|||
const char *p;
|
||||
char name[1024];
|
||||
char item[1024];
|
||||
unsigned int len, err;
|
||||
unsigned int len;
|
||||
|
||||
if (!params)
|
||||
return;
|
||||
|
@ -484,7 +484,7 @@ ConfigurationSet(const char *params)
|
|||
len = 0;
|
||||
sscanf(p, "%1000s %n", item, &len);
|
||||
p += len;
|
||||
err = ModuleConfigSet(name, item, p);
|
||||
ModuleConfigSet(name, item, p);
|
||||
|
||||
/* Save changed configuration */
|
||||
autosave();
|
||||
|
|
|
@ -759,7 +759,7 @@ ecore_x_icccm_save_yourself_send(Ecore_X_Window win, Ecore_X_Time ts)
|
|||
void
|
||||
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 *
|
||||
|
|
|
@ -127,7 +127,7 @@ EdgeEvent(int dir)
|
|||
static void
|
||||
EdgeHandleEvents(XEvent * ev, void *prm)
|
||||
{
|
||||
static Time last_time;
|
||||
static Time last_time = 0;
|
||||
int dir;
|
||||
unsigned long dt;
|
||||
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
#include "snaps.h"
|
||||
#include "xwin.h"
|
||||
#include <math.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static const WinOp winops[] = {
|
||||
{"close", 2, 1, 0, EWIN_OP_CLOSE},
|
||||
|
@ -1475,6 +1474,7 @@ EwinOpLower(EWin * ewin)
|
|||
Efree(gwins);
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
static int
|
||||
FindEwinInList(EWin * ewin, EWin ** gwins, int num)
|
||||
{
|
||||
|
@ -1534,6 +1534,7 @@ EwinOpRaiseLower(EWin * ewin)
|
|||
if (gwins)
|
||||
Efree(gwins);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
EwinOpStick(EWin * ewin, int on)
|
||||
|
@ -1578,6 +1579,7 @@ EwinOpSkipLists(EWin * ewin, int skip)
|
|||
EwinStateUpdate(ewin);
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
void
|
||||
EwinOpSkipTask(EWin * ewin, int skip)
|
||||
{
|
||||
|
@ -1613,6 +1615,7 @@ EwinOpNeverFocus(EWin * ewin, int on)
|
|||
SnapshotEwinUpdate(ewin, SNAP_USE_FOCUS_NEVER);
|
||||
EwinStateUpdate(ewin);
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
EwinOpIconify(EWin * ewin, int on)
|
||||
|
@ -1777,12 +1780,14 @@ EwinOpMoveToDesk(EWin * ewin, Desk * dsk, int inc)
|
|||
SnapshotEwinUpdate(ewin, SNAP_USE_STICKY);
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
void
|
||||
EwinOpMoveToArea(EWin * ewin, int x, int y)
|
||||
{
|
||||
EwinMoveToArea(ewin, x, y);
|
||||
SnapshotEwinUpdate(ewin, SNAP_USE_POS);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if 0 /* Not used? */
|
||||
static int
|
||||
|
|
16
src/ewins.c
16
src/ewins.c
|
@ -28,10 +28,8 @@
|
|||
#include "eobj.h"
|
||||
#include "ewins.h"
|
||||
#include "hints.h"
|
||||
#include "icons.h"
|
||||
#include "snaps.h"
|
||||
#include "xwin.h"
|
||||
#include <sys/time.h>
|
||||
|
||||
#define EWIN_TOP_EVENT_MASK \
|
||||
(ButtonPressMask | ButtonReleaseMask | \
|
||||
|
@ -1542,11 +1540,9 @@ static struct
|
|||
} EWinChanges;
|
||||
|
||||
void
|
||||
EwinChange(EWin * ewin, unsigned int flag)
|
||||
EwinChange(EWin * ewin __UNUSED__, unsigned int flag)
|
||||
{
|
||||
EWinChanges.flags |= flag;
|
||||
return;
|
||||
ewin = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -1604,16 +1600,12 @@ EwinChangesProcess(EWin * ewin)
|
|||
void
|
||||
EwinsEventsConfigure(int mode)
|
||||
{
|
||||
EWin *const *lst, *ewin;
|
||||
EWin *const *lst;
|
||||
int i, num;
|
||||
|
||||
lst = EwinListGetAll(&num);
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
ewin = lst[i];
|
||||
|
||||
EwinEventsConfigure(lst[i], mode);
|
||||
}
|
||||
EwinEventsConfigure(lst[i], mode);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1979,7 +1971,7 @@ EwinsSighan(int sig, void *prm)
|
|||
}
|
||||
|
||||
#if 0
|
||||
IpcItem EwinsIpcArray[] = {
|
||||
static const IpcItem EwinsIpcArray[] = {
|
||||
};
|
||||
#define N_IPC_FUNCS (sizeof(EwinsIpcArray)/sizeof(IpcItem))
|
||||
#else
|
||||
|
|
|
@ -315,20 +315,14 @@ void EwinOpActivate(EWin * ewin);
|
|||
void EwinOpKill(EWin * ewin);
|
||||
void EwinOpRaise(EWin * ewin);
|
||||
void EwinOpLower(EWin * ewin);
|
||||
void EwinOpRaiseLower(EWin * ewin);
|
||||
void EwinOpStick(EWin * ewin, int on);
|
||||
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 EwinOpShade(EWin * ewin, int on);
|
||||
void EwinOpSetLayer(EWin * ewin, int layer);
|
||||
void EwinOpSetBorder(EWin * ewin, const char *name);
|
||||
void EwinOpSetOpacity(EWin * ewin, int opacity);
|
||||
void EwinOpMoveToDesk(EWin * ewin, struct _desk *dsk, int inc);
|
||||
void EwinOpMoveToArea(EWin * ewin, int x, int y);
|
||||
|
||||
/* finders.c */
|
||||
EWin *EwinFindByPtr(const EWin * ewin);
|
||||
|
|
|
@ -332,7 +332,7 @@ EWMH_SetClientStacking(void)
|
|||
void
|
||||
EWMH_SetActiveWindow(Window win)
|
||||
{
|
||||
static Window win_last_set;
|
||||
static Window win_last_set = None;
|
||||
|
||||
if (win == win_last_set)
|
||||
return;
|
||||
|
|
|
@ -24,7 +24,6 @@
|
|||
#include "E.h"
|
||||
#include "ecore-e16.h"
|
||||
#include "xwin.h"
|
||||
#include <X11/keysym.h>
|
||||
#include <sys/time.h>
|
||||
|
||||
static Window
|
||||
|
|
82
src/file.c
82
src/file.c
|
@ -30,7 +30,7 @@
|
|||
const char *
|
||||
FileExtension(const char *file)
|
||||
{
|
||||
char *p;
|
||||
const char *p;
|
||||
|
||||
p = strrchr(file, '.');
|
||||
if (p != NULL)
|
||||
|
@ -71,29 +71,6 @@ exists(const char *s)
|
|||
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
|
||||
isfile(const char *s)
|
||||
{
|
||||
|
@ -146,7 +123,8 @@ E_ls(const char *dir, int *num)
|
|||
return NULL;
|
||||
}
|
||||
/* 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)
|
||||
{
|
||||
closedir(dirp);
|
||||
|
@ -175,6 +153,7 @@ E_ls(const char *dir, int *num)
|
|||
dirlen = i; /* dir got shorter... */
|
||||
closedir(dirp);
|
||||
*num = dirlen;
|
||||
|
||||
/* do a simple bubble sort here to alphanumberic it */
|
||||
while (!done)
|
||||
{
|
||||
|
@ -211,6 +190,7 @@ E_mv(const char *s, const char *ss)
|
|||
rename(s, ss);
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
void
|
||||
E_cp(const char *s, const char *ss)
|
||||
{
|
||||
|
@ -237,6 +217,7 @@ E_cp(const char *s, const char *ss)
|
|||
fclose(f);
|
||||
fclose(ff);
|
||||
}
|
||||
#endif
|
||||
|
||||
time_t
|
||||
moddate(const char *s)
|
||||
|
@ -252,6 +233,7 @@ moddate(const char *s)
|
|||
return st.st_ctime;
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
int
|
||||
filesize(const char *s)
|
||||
{
|
||||
|
@ -263,6 +245,7 @@ filesize(const char *s)
|
|||
return 0;
|
||||
return (int)st.st_size;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
fileinode(const char *s)
|
||||
|
@ -309,14 +292,7 @@ filedev(const char *s)
|
|||
return filedev_map((int)st.st_dev);
|
||||
}
|
||||
|
||||
void
|
||||
E_cd(const char *s)
|
||||
{
|
||||
if ((!s) || (!*s))
|
||||
return;
|
||||
chdir(s);
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
char *
|
||||
cwd(void)
|
||||
{
|
||||
|
@ -327,8 +303,9 @@ cwd(void)
|
|||
s = Estrdup(ss);
|
||||
return s;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
static int
|
||||
permissions(const char *s)
|
||||
{
|
||||
struct stat st;
|
||||
|
@ -392,9 +369,10 @@ username(int uid)
|
|||
char *
|
||||
homedir(int uid)
|
||||
{
|
||||
char *s;
|
||||
static int usr_uid = -1;
|
||||
static char *usr_s = NULL;
|
||||
char *s;
|
||||
const char *ss;
|
||||
struct passwd *pwd;
|
||||
|
||||
if (usr_uid < 0)
|
||||
|
@ -411,7 +389,10 @@ homedir(int uid)
|
|||
usr_s = Estrdup(s);
|
||||
return s;
|
||||
}
|
||||
return Estrdup((getenv("TMPDIR") == NULL) ? "/tmp" : getenv("TMPDIR"));
|
||||
ss = getenv("TMPDIR");
|
||||
if (!ss)
|
||||
ss = "/tmp";
|
||||
return Estrdup(ss);
|
||||
}
|
||||
|
||||
char *
|
||||
|
@ -469,23 +450,6 @@ atword(const char *s, int num)
|
|||
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
|
||||
word(const char *s, int num, char *wd)
|
||||
{
|
||||
|
@ -729,7 +693,7 @@ pathtoexec(const char *file)
|
|||
|
||||
cp = p;
|
||||
exelen = strlen(file);
|
||||
while ((ep = strchr(cp, ':')))
|
||||
while ((ep = strchr(cp, ':')) != NULL)
|
||||
{
|
||||
len = ep - cp;
|
||||
s = Emalloc(len + 1);
|
||||
|
@ -738,6 +702,8 @@ pathtoexec(const char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
if (!s)
|
||||
return NULL;
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (canexec(s))
|
||||
|
@ -753,6 +719,8 @@ pathtoexec(const char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
if (!s)
|
||||
return NULL;
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (canexec(s))
|
||||
|
@ -781,7 +749,7 @@ pathtofile(const char *file)
|
|||
return NULL;
|
||||
cp = p;
|
||||
exelen = strlen(file);
|
||||
while ((ep = strchr(cp, ':')))
|
||||
while ((ep = strchr(cp, ':')) != NULL)
|
||||
{
|
||||
len = ep - cp;
|
||||
s = Emalloc(len + 1);
|
||||
|
@ -790,6 +758,8 @@ pathtofile(const char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
if (!s)
|
||||
return NULL;
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (exists(s))
|
||||
|
@ -805,6 +775,8 @@ pathtofile(const char *file)
|
|||
strncpy(s, cp, len);
|
||||
s[len] = 0;
|
||||
s = Erealloc(s, len + 2 + exelen);
|
||||
if (!s)
|
||||
return NULL;
|
||||
strcat(s, "/");
|
||||
strcat(s, file);
|
||||
if (exists(s))
|
||||
|
|
|
@ -151,9 +151,9 @@ ListWinGroups(const EWin * ewin, char group_select, int *num)
|
|||
{
|
||||
case GROUP_SELECT_EWIN_ONLY:
|
||||
groups = (Group **) Emalloc(sizeof(Group *) * ewin->num_groups);
|
||||
groups =
|
||||
(Group **) memcpy(groups, ewin->groups,
|
||||
sizeof(Group *) * ewin->num_groups);
|
||||
if (!groups)
|
||||
break;
|
||||
memcpy(groups, ewin->groups, sizeof(Group *) * ewin->num_groups);
|
||||
*num = ewin->num_groups;
|
||||
break;
|
||||
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));
|
||||
j = 0;
|
||||
for (i = 0; i < (*num); i++)
|
||||
if (groups2[i])
|
||||
groups[j++] = groups2[i];
|
||||
(*num) -= killed;
|
||||
if (groups)
|
||||
{
|
||||
j = 0;
|
||||
for (i = 0; i < (*num); i++)
|
||||
if (groups2[i])
|
||||
groups[j++] = groups2[i];
|
||||
(*num) -= killed;
|
||||
}
|
||||
Efree(groups2);
|
||||
}
|
||||
break;
|
||||
|
@ -279,7 +282,7 @@ ListWinGroupMembersForEwin(const EWin * ewin, int action, char nogroup,
|
|||
}
|
||||
}
|
||||
|
||||
if ((*num) == 0)
|
||||
if (gwins == NULL)
|
||||
{
|
||||
gwins = Emalloc(sizeof(EWin *));
|
||||
gwins[0] = (EWin *) ewin;
|
||||
|
|
11
src/focus.c
11
src/focus.c
|
@ -152,7 +152,7 @@ ReverseTimeout(int val, void *data __UNUSED__)
|
|||
EwinListFocusRaise(ewin);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
FocusGetNextEwin(void)
|
||||
{
|
||||
EWin *const *lst;
|
||||
|
@ -176,7 +176,7 @@ FocusGetNextEwin(void)
|
|||
FocusToEWin(ewin, FOCUS_NEXT);
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
FocusGetPrevEwin(void)
|
||||
{
|
||||
EWin *const *lst;
|
||||
|
@ -254,7 +254,7 @@ FocusEwinSetActive(EWin * ewin, int active)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
FocusFix(void)
|
||||
{
|
||||
EWin *const *lst, *ewin;
|
||||
|
@ -669,7 +669,8 @@ SettingsFocus(void)
|
|||
Dialog *d;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -969,7 +970,7 @@ FocusIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem FocusIpcArray[] = {
|
||||
static const IpcItem FocusIpcArray[] = {
|
||||
{
|
||||
FocusIpc,
|
||||
"focus", "sf",
|
||||
|
|
|
@ -118,6 +118,6 @@ FontConfigUnload(void)
|
|||
{
|
||||
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);
|
||||
}
|
||||
|
|
18
src/fx.c
18
src/fx.c
|
@ -181,7 +181,6 @@ FX_Ripple_Pause(void)
|
|||
}
|
||||
|
||||
#ifdef E_FX_RAINDROPS /* FIXME - Requires eliminating use of PixImg */
|
||||
/****************************************************************************/
|
||||
|
||||
/****************************** RAIN DROPS **********************************/
|
||||
|
||||
|
@ -474,9 +473,8 @@ FX_Raindrops_Pause(void)
|
|||
paused = 0;
|
||||
}
|
||||
}
|
||||
#endif /* E_FX_RAINDROPS */
|
||||
|
||||
/****************************************************************************/
|
||||
#endif /* E_FX_RAINDROPS */
|
||||
|
||||
/****************************** WAVES ***************************************/
|
||||
/* by tsade :) */
|
||||
|
@ -661,7 +659,7 @@ FX_Waves_Pause(void)
|
|||
}
|
||||
}
|
||||
|
||||
/****************************************************************************/
|
||||
#ifdef E_FX_IMAGESPINNER
|
||||
|
||||
/****************************** IMAGESPINNER ********************************/
|
||||
|
||||
|
@ -774,6 +772,8 @@ FX_ImageSpinner_Pause(void)
|
|||
}
|
||||
}
|
||||
|
||||
#endif /* E_FX_IMAGESPINNER */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
static FXHandler fx_handlers[] = {
|
||||
|
@ -789,10 +789,12 @@ static FXHandler fx_handlers[] = {
|
|||
FX_Raindrops_Pause,
|
||||
0, 0},
|
||||
#endif
|
||||
#ifdef E_FX_IMAGESPINNER
|
||||
{"imagespinner",
|
||||
FX_ImageSpinner_Init, FX_ImageSpinner_Desk, FX_ImageSpinner_Quit,
|
||||
FX_ImageSpinner_Pause,
|
||||
0, 0}
|
||||
0, 0},
|
||||
#endif
|
||||
};
|
||||
#define N_FX_HANDLERS (sizeof(fx_handlers)/sizeof(FXHandler))
|
||||
|
||||
|
@ -844,7 +846,6 @@ FX_Op(const char *name, int fx_op)
|
|||
goto do_stop;
|
||||
else
|
||||
goto do_start;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -967,7 +968,8 @@ FxSettings(void)
|
|||
Dialog *d;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -1045,7 +1047,7 @@ FxIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem FxIpcArray[] = {
|
||||
static const IpcItem FxIpcArray[] = {
|
||||
{
|
||||
FxIpc,
|
||||
"fx", "fx",
|
||||
|
|
64
src/groups.c
64
src/groups.c
|
@ -30,6 +30,8 @@
|
|||
|
||||
#define DISABLE_PAGER_ICONBOX_GROUPING 0
|
||||
|
||||
static void RemoveEwinFromGroup(EWin * ewin, Group * g);
|
||||
|
||||
static Group *
|
||||
GroupCreate(void)
|
||||
{
|
||||
|
@ -80,7 +82,7 @@ CopyGroupConfig(GroupConfig * src, GroupConfig * dest)
|
|||
memcpy(dest, src, sizeof(GroupConfig));
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
BreakWindowGroup(EWin * ewin, Group * g)
|
||||
{
|
||||
int i, j, num;
|
||||
|
@ -164,7 +166,7 @@ AddEwinToGroup(EWin * ewin, Group * g)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
static int
|
||||
EwinInGroup(EWin * ewin, Group * g)
|
||||
{
|
||||
int i;
|
||||
|
@ -262,11 +264,17 @@ static char **
|
|||
GetWinGroupMemberNames(Group ** groups, int num)
|
||||
{
|
||||
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++)
|
||||
{
|
||||
group_member_strings[i] = Emalloc(sizeof(char) * 1024);
|
||||
if (!group_member_strings[i])
|
||||
break;
|
||||
|
||||
group_member_strings[i][0] = 0;
|
||||
for (j = 0; j < groups[i]->num_members; j++)
|
||||
|
@ -280,7 +288,7 @@ GetWinGroupMemberNames(Group ** groups, int num)
|
|||
return group_member_strings;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
ShowHideWinGroups(EWin * ewin, Group * g, char onoff)
|
||||
{
|
||||
EWin **gwins;
|
||||
|
@ -538,7 +546,7 @@ GroupCallback(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
|
|||
tmp_index = val;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
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);
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -608,7 +617,7 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
|
|||
|
||||
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupCallback, 0, (void *)d);
|
||||
DialogItemSetCallback(di, GroupCallback, 0, (void *)d);
|
||||
DialogItemSetText(di, group_member_strings[0]);
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
@ -635,10 +644,13 @@ ChooseGroupDialog(EWin * ewin, char *message, char group_select, int action)
|
|||
|
||||
static GroupConfig *tmp_cfgs = NULL;
|
||||
static int tmp_current_group;
|
||||
|
||||
#if 0 /* FIXME - Should these be separate variables? */
|
||||
static int tmp_index;
|
||||
static GroupConfig tmp_cfg;
|
||||
static EWin *tmp_ewin;
|
||||
static Group **tmp_groups;
|
||||
#endif
|
||||
static GroupConfig tmp_cfg;
|
||||
|
||||
static DItem *di_border;
|
||||
static DItem *di_iconify;
|
||||
|
@ -736,7 +748,9 @@ SettingsGroups(EWin * ewin)
|
|||
("\n This window currently does not belong to any groups. \n\n"));
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -772,7 +786,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
radio = di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupSelectCallback, 0, (void *)d);
|
||||
DialogItemSetCallback(di, GroupSelectCallback, 0, (void *)d);
|
||||
DialogItemSetText(di, group_member_strings[0]);
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, 0);
|
||||
|
@ -781,7 +795,7 @@ SettingsGroups(EWin * ewin)
|
|||
{
|
||||
di = DialogAddItem(table, DITEM_RADIOBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupSelectCallback, i, (void *)d);
|
||||
DialogItemSetCallback(di, GroupSelectCallback, i, (void *)d);
|
||||
DialogItemSetText(di, group_member_strings[i]);
|
||||
DialogItemRadioButtonSetFirst(di, radio);
|
||||
DialogItemRadioButtonGroupSetVal(di, i);
|
||||
|
@ -800,7 +814,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_border = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_BORDER,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_BORDER,
|
||||
&(tmp_cfg.set_border));
|
||||
DialogItemSetText(di, _("Changing Border Style"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].set_border);
|
||||
|
@ -808,7 +822,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_iconify = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback,
|
||||
GROUP_FEATURE_ICONIFY, &(tmp_cfg.iconify));
|
||||
DialogItemSetText(di, _("Iconifying"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].iconify);
|
||||
|
@ -816,7 +830,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_kill = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_KILL,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_KILL,
|
||||
&(tmp_cfg.kill));
|
||||
DialogItemSetText(di, _("Killing"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].kill);
|
||||
|
@ -824,7 +838,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_move = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_MOVE,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_MOVE,
|
||||
&(tmp_cfg.move));
|
||||
DialogItemSetText(di, _("Moving"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].move);
|
||||
|
@ -832,7 +846,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_raise = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_RAISE,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_RAISE,
|
||||
&(tmp_cfg.raise));
|
||||
DialogItemSetText(di, _("Raising/Lowering"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].raise);
|
||||
|
@ -840,7 +854,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_stick = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_STICK,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_STICK,
|
||||
&(tmp_cfg.stick));
|
||||
DialogItemSetText(di, _("Sticking"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].stick);
|
||||
|
@ -848,7 +862,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_shade = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_SHADE,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_SHADE,
|
||||
&(tmp_cfg.shade));
|
||||
DialogItemSetText(di, _("Shading"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].shade);
|
||||
|
@ -856,7 +870,7 @@ SettingsGroups(EWin * ewin)
|
|||
|
||||
di_mirror = di = DialogAddItem(table, DITEM_CHECKBUTTON);
|
||||
DialogItemSetColSpan(di, 2);
|
||||
DialogItemSetCallback(di, &GroupFeatureChangeCallback, GROUP_FEATURE_MIRROR,
|
||||
DialogItemSetCallback(di, GroupFeatureChangeCallback, GROUP_FEATURE_MIRROR,
|
||||
&(tmp_cfg.mirror));
|
||||
DialogItemSetText(di, _("Mirror Shade/Iconify/Stick"));
|
||||
DialogItemCheckButtonSetState(di, tmp_cfgs[0].mirror);
|
||||
|
@ -891,8 +905,9 @@ SettingsDefaultGroupControl(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di;
|
||||
|
||||
if ((d = FindItem("CONFIGURE_DEFAULT_GROUP_CONTROL", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_DEFAULT_GROUP_CONTROL", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -1090,12 +1105,9 @@ doBreakGroup(EWin * ewin, const char *params __UNUSED__)
|
|||
static void
|
||||
IPC_GroupInfo(const char *params, Client * c __UNUSED__)
|
||||
{
|
||||
char buf[FILEPATH_LEN_MAX];
|
||||
Group **groups = NULL;
|
||||
int num_groups, i, j;
|
||||
|
||||
buf[0] = 0;
|
||||
|
||||
if (params)
|
||||
{
|
||||
Group *group;
|
||||
|
@ -1158,7 +1170,6 @@ IPC_GroupOps(const char *params, Client * c __UNUSED__)
|
|||
int gix;
|
||||
char windowid[FILEPATH_LEN_MAX];
|
||||
char operation[FILEPATH_LEN_MAX];
|
||||
char param1[FILEPATH_LEN_MAX];
|
||||
unsigned int win;
|
||||
EWin *ewin;
|
||||
|
||||
|
@ -1170,7 +1181,6 @@ IPC_GroupOps(const char *params, Client * c __UNUSED__)
|
|||
|
||||
windowid[0] = 0;
|
||||
operation[0] = 0;
|
||||
param1[0] = 0;
|
||||
word(params, 1, windowid);
|
||||
sscanf(windowid, "%x", &win);
|
||||
word(params, 2, operation);
|
||||
|
@ -1400,7 +1410,7 @@ GroupsIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem GroupsIpcArray[] = {
|
||||
static const IpcItem GroupsIpcArray[] = {
|
||||
{
|
||||
GroupsIpc,
|
||||
"groups", "grp",
|
||||
|
|
|
@ -115,7 +115,8 @@ SignalHandler(int sig)
|
|||
break;
|
||||
|
||||
case SIGCHLD:
|
||||
while (waitpid(-1, &status, WNOHANG) > 0);
|
||||
while (waitpid(-1, &status, WNOHANG) > 0)
|
||||
;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@ HintsSetActiveWindow(Window win)
|
|||
void
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -132,7 +132,6 @@ void ICCCM_Focus(const EWin * ewin);
|
|||
void ICCCM_GetGeoms(EWin * ewin, Atom atom_change);
|
||||
void ICCCM_GetInfo(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);
|
||||
|
||||
/* mwm.c */
|
||||
|
|
12
src/icccm.c
12
src/icccm.c
|
@ -28,6 +28,8 @@
|
|||
#include "hints.h"
|
||||
#include "xwin.h"
|
||||
|
||||
static void ICCCM_SetIconSizes(void);
|
||||
|
||||
void
|
||||
ICCCM_Init(void)
|
||||
{
|
||||
|
@ -39,7 +41,9 @@ ICCCM_Init(void)
|
|||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
@ -541,7 +545,7 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
if (atom_change == 0 || atom_change == ECORE_X_ATOM_WM_COMMAND)
|
||||
{
|
||||
int argc;
|
||||
char **argv, s[4096];
|
||||
char **argv, s[4096], *ss;
|
||||
|
||||
_EFREE(ewin->icccm.wm_command);
|
||||
|
||||
|
@ -553,8 +557,8 @@ ICCCM_GetInfo(EWin * ewin, Atom atom_change)
|
|||
ECORE_X_ATOM_WM_COMMAND,
|
||||
&argv);
|
||||
|
||||
ewin->icccm.wm_command =
|
||||
Estrdup(StrlistEncodeEscaped(s, sizeof(s), argv, argc));
|
||||
ss = StrlistEncodeEscaped(s, sizeof(s), argv, argc);
|
||||
ewin->icccm.wm_command = Estrdup(ss);
|
||||
StrlistFree(argv, argc);
|
||||
}
|
||||
|
||||
|
|
11
src/iclass.c
11
src/iclass.c
|
@ -366,7 +366,8 @@ ImageclassDestroy(ImageClass * ic)
|
|||
ic->ref_count);
|
||||
return;
|
||||
}
|
||||
while (RemoveItemByPtr(ic, LIST_TYPE_ICLASS));
|
||||
while (RemoveItemByPtr(ic, LIST_TYPE_ICLASS))
|
||||
;
|
||||
|
||||
if (ic->name)
|
||||
Efree(ic->name);
|
||||
|
@ -1570,7 +1571,8 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
|
|||
st = STATE_DISABLED;
|
||||
else
|
||||
st = STATE_NORMAL;
|
||||
if ((hptr = atword(params, 6)))
|
||||
hptr = atword(params, 6);
|
||||
if (hptr)
|
||||
{
|
||||
w = (int)strtol(atword(params, 5), (char **)NULL, 0);
|
||||
h = (int)strtol(hptr, (char **)NULL, 0);
|
||||
|
@ -1599,7 +1601,8 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
|
|||
st = STATE_DISABLED;
|
||||
else
|
||||
st = STATE_NORMAL;
|
||||
if (!(hptr = atword(params, 6)))
|
||||
hptr = atword(params, 6);
|
||||
if (!hptr)
|
||||
IpcPrintf("Error: missing width and/or height\n");
|
||||
else
|
||||
{
|
||||
|
@ -1635,7 +1638,7 @@ ImageclassIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem ImageclassIpcArray[] = {
|
||||
static const IpcItem ImageclassIpcArray[] = {
|
||||
{
|
||||
ImageclassIpc,
|
||||
"imageclass", NULL,
|
||||
|
|
|
@ -327,7 +327,8 @@ IconboxCreate(const char *name)
|
|||
|
||||
ib = Ecalloc(1, sizeof(Iconbox));
|
||||
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->scrollbar_side = 1;
|
||||
ib->arrow_side = 1;
|
||||
|
@ -1573,7 +1574,7 @@ IconboxLayout(Iconbox * ib, int *px, int *py, int *pw, int *ph)
|
|||
static void
|
||||
IconboxDraw(Iconbox * ib)
|
||||
{
|
||||
int i, x, y, w, h;
|
||||
int i, w, h;
|
||||
ImageClass *ib_ic_cover;
|
||||
int ib_xlt, ib_ylt, ib_ww, ib_hh;
|
||||
int ib_x0, ib_y0, ib_w0, ib_h0;
|
||||
|
@ -1581,8 +1582,6 @@ IconboxDraw(Iconbox * ib)
|
|||
int ww, hh;
|
||||
Pixmap pmap, mask;
|
||||
|
||||
x = EoGetX(ib->ewin);
|
||||
y = EoGetY(ib->ewin);
|
||||
w = ib->w;
|
||||
h = ib->h;
|
||||
|
||||
|
@ -2185,8 +2184,8 @@ IconboxConfigure(Iconbox * ib)
|
|||
if (!ib)
|
||||
return;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_ICONBOX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_ICONBOX", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -2650,7 +2649,7 @@ IboxIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem IconboxesIpcArray[] = {
|
||||
static const IpcItem IconboxesIpcArray[] = {
|
||||
{
|
||||
IboxIpc,
|
||||
"iconbox", "ibox",
|
||||
|
|
|
@ -1313,7 +1313,7 @@ IPC_Compat(const char *params)
|
|||
*/
|
||||
static void IPC_Help(const char *params, Client * c);
|
||||
|
||||
IpcItem IPCArray[] = {
|
||||
static const IpcItem IPCArray[] = {
|
||||
{
|
||||
IPC_Help,
|
||||
"help", "?",
|
||||
|
@ -1532,6 +1532,7 @@ HandleIPC(const char *params, Client * c)
|
|||
|
||||
lst = IPC_GetList(&num);
|
||||
|
||||
w[0] = 0;
|
||||
word(params, 1, w);
|
||||
|
||||
ok = 0;
|
||||
|
@ -1541,8 +1542,9 @@ HandleIPC(const char *params, Client * c)
|
|||
if (!(ipc->nick && !strcmp(w, ipc->nick)) && strcmp(w, ipc->name))
|
||||
continue;
|
||||
|
||||
w[0] = 0;
|
||||
word(params, 2, w);
|
||||
if (w)
|
||||
if (w[0])
|
||||
ipc->func(atword(params, 2), c);
|
||||
else
|
||||
ipc->func(NULL, c);
|
||||
|
|
|
@ -170,6 +170,7 @@ MoveItemToListTop(const void *item, int type)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
void
|
||||
MoveItemToListBottom(const void *item, int type)
|
||||
{
|
||||
|
@ -205,6 +206,7 @@ MoveItemToListBottom(const void *item, int type)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void *
|
||||
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);
|
||||
return p;
|
||||
#if 0 /* FIXME - Is something wrong here? */
|
||||
pptr = ptr;
|
||||
ptr = ptr->next;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -473,6 +477,7 @@ ListItemTypeID(int *num, int type, int id)
|
|||
return lst;
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
void **
|
||||
ListItemTypeName(int *num, int type, const char *name)
|
||||
{
|
||||
|
@ -507,6 +512,7 @@ ListItemTypeName(int *num, int type, const char *name)
|
|||
}
|
||||
return lst;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
ListChangeItemID(int type, void *item, int id)
|
||||
|
|
|
@ -130,7 +130,7 @@ main(int argc, char **argv)
|
|||
/* Set up the internal data lists used to find everything */
|
||||
ListsInit(LIST_TYPE_COUNT);
|
||||
|
||||
srand(time(NULL));
|
||||
srand((unsigned int)time(NULL));
|
||||
|
||||
if (!uname(&ubuf))
|
||||
Mode.wm.machine_name = Estrdup(ubuf.nodename);
|
||||
|
@ -565,7 +565,7 @@ EConfName(void)
|
|||
const char *
|
||||
EDirUser(void)
|
||||
{
|
||||
static char *user_dir;
|
||||
static char *user_dir = NULL;
|
||||
char *home, buf[4096];
|
||||
|
||||
if (Mode.conf.dir)
|
||||
|
@ -697,7 +697,8 @@ EGetSavePrefix(void)
|
|||
Mode.display.name);
|
||||
def_prefix = Estrdup(buf);
|
||||
|
||||
for (s = def_prefix; (s = strchr(s, ':')); *s = '-');
|
||||
for (s = def_prefix; (s = strchr(s, ':')) != NULL; *s = '-')
|
||||
;
|
||||
|
||||
return def_prefix;
|
||||
}
|
||||
|
|
|
@ -87,15 +87,18 @@ Estrdupcat2(char *ss, const char *s1, const char *s2)
|
|||
l2 = (s2) ? strlen(s2) : 0;
|
||||
|
||||
s = Erealloc(ss, len + l1 + l2 + 1);
|
||||
if (l1)
|
||||
if (!s)
|
||||
return NULL;
|
||||
if (s1 && l1)
|
||||
memcpy(s + len, s1, l1);
|
||||
if (l2)
|
||||
if (s2 && l2)
|
||||
memcpy(s + len + l1, s2, l2);
|
||||
s[len + l1 + l2] = '\0';
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
#if 0 /* Unused */
|
||||
char **
|
||||
StrlistDup(char **lst, int num)
|
||||
{
|
||||
|
@ -112,6 +115,7 @@ StrlistDup(char **lst, int num)
|
|||
|
||||
return ss;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
StrlistFree(char **lst, int num)
|
||||
|
|
|
@ -23,12 +23,10 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
#include "backgrounds.h"
|
||||
#include "conf.h"
|
||||
#include "desktops.h"
|
||||
#include "ewins.h"
|
||||
#include "iclass.h"
|
||||
#include "menus.h"
|
||||
#include "xwin.h"
|
||||
#include <errno.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
@ -82,6 +80,8 @@ MenuLoadFromDirectory(Menu * m)
|
|||
|
||||
MenuEmpty(m, 0);
|
||||
|
||||
cs[0] = '\0'; /* FIXME - Check this */
|
||||
|
||||
if (stat(dir, &st) >= 0)
|
||||
{
|
||||
int aa, bb, cc;
|
||||
|
@ -109,6 +109,8 @@ MenuLoadFromDirectory(Menu * m)
|
|||
if (exists(cs))
|
||||
{
|
||||
f = fopen(cs, "r");
|
||||
if (!f)
|
||||
return 1;
|
||||
while (fgets(s, sizeof(s), f))
|
||||
{
|
||||
s[strlen(s) - 1] = 0;
|
||||
|
@ -467,9 +469,10 @@ MenuCreateFromGnome(const char *name, Menu * parent, MenuStyle * ms,
|
|||
f = fopen(ss, "r");
|
||||
if (f)
|
||||
{
|
||||
char *iname = NULL, *exec = NULL, *texec =
|
||||
NULL, *tmp;
|
||||
char *en_name = NULL;
|
||||
char *iname, *exec, *texec, *en_name;
|
||||
char *tmp;
|
||||
|
||||
iname = exec = texec = en_name = NULL;
|
||||
|
||||
while (fgets(s, sizeof(s), f))
|
||||
{
|
||||
|
|
19
src/menus.c
19
src/menus.c
|
@ -37,7 +37,7 @@
|
|||
|
||||
#define DEBUG_MENU_EVENTS 0
|
||||
|
||||
struct
|
||||
static struct
|
||||
{
|
||||
Menu *first;
|
||||
Menu *active;
|
||||
|
@ -761,8 +761,9 @@ MenuRealize(Menu * m)
|
|||
m->items[i]->text_y = (maxh - m->items[i]->text_h) / 2;
|
||||
if (m->items[i]->icon_win)
|
||||
EMoveWindow(m->items[i]->icon_win,
|
||||
maxw - pad_item->right -
|
||||
maxx2 + ((maxx2 - w) / 2), ((maxh - h) / 2));
|
||||
maxw - pad_item->right - maxx2 +
|
||||
((maxx2 - m->items[i]->icon_w) / 2),
|
||||
((maxh - m->items[i]->icon_h) / 2));
|
||||
}
|
||||
if (m->items[i]->icon_iclass)
|
||||
{
|
||||
|
@ -1761,14 +1762,13 @@ MenuConfigLoad(FILE * fs)
|
|||
char s4[FILEPATH_LEN_MAX];
|
||||
char s5[FILEPATH_LEN_MAX];
|
||||
char *txt = NULL;
|
||||
const char *params = NULL;
|
||||
const char *params;
|
||||
int i1, i2;
|
||||
Menu *m = NULL, *mm;
|
||||
MenuItem *mi;
|
||||
MenuStyle *ms;
|
||||
ImageClass *ic = NULL;
|
||||
int fields;
|
||||
int act = 0;
|
||||
|
||||
while (GetLine(s, sizeof(s), fs))
|
||||
{
|
||||
|
@ -1804,7 +1804,6 @@ MenuConfigLoad(FILE * fs)
|
|||
m = NULL;
|
||||
ic = NULL;
|
||||
_EFREE(txt);
|
||||
act = 0;
|
||||
break;
|
||||
case CONFIG_CLOSE:
|
||||
err = 0;
|
||||
|
@ -1840,7 +1839,8 @@ MenuConfigLoad(FILE * fs)
|
|||
ic = NULL;
|
||||
if (strcmp("NULL", s2))
|
||||
ic = ImageclassFind(s2, 0);
|
||||
_EFDUP(txt, atword(s, 3));
|
||||
params = atword(s, 3);
|
||||
_EFDUP(txt, params);
|
||||
break;
|
||||
case MENU_ACTION:
|
||||
if ((txt) || (ic))
|
||||
|
@ -1981,7 +1981,8 @@ MenusSettings(void)
|
|||
Dialog *d;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -2073,7 +2074,7 @@ MenusIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem MenusIpcArray[] = {
|
||||
static const IpcItem MenusIpcArray[] = {
|
||||
{
|
||||
MenusIpc,
|
||||
"menus", "mnu",
|
||||
|
|
10
src/misc.c
10
src/misc.c
|
@ -79,8 +79,10 @@ Quicksort(void **a, int l, int r, int (*CompareFunc) (void *d1, void *d2))
|
|||
|
||||
for (;;)
|
||||
{
|
||||
while (CompareFunc(a[++i], v) < 0);
|
||||
while (CompareFunc(a[--j], v) > 0);
|
||||
while (CompareFunc(a[++i], v) < 0)
|
||||
;
|
||||
while (CompareFunc(a[--j], v) > 0)
|
||||
;
|
||||
if (i >= j)
|
||||
break;
|
||||
t = a[i];
|
||||
|
@ -120,7 +122,7 @@ ETimeElapsed(struct timeval *t0)
|
|||
#include <math.h>
|
||||
|
||||
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;
|
||||
|
||||
|
@ -173,7 +175,7 @@ ETimedLoopNext(void)
|
|||
Eprintf("ETimedLoopNext k=%4f tm=%.3f\n", etl_k, tm);
|
||||
#endif
|
||||
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();
|
||||
|
||||
|
|
|
@ -205,7 +205,7 @@ MiscIpcConfig(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem MiscIpcArray[] = {
|
||||
static const IpcItem MiscIpcArray[] = {
|
||||
{
|
||||
MiscIpcExec,
|
||||
"exec", NULL,
|
||||
|
|
|
@ -30,8 +30,6 @@
|
|||
/*
|
||||
* Theme transparency settings
|
||||
*/
|
||||
static Dialog *tr_sel_dialog;
|
||||
|
||||
static int tmp_theme_transparency;
|
||||
|
||||
static int tmp_st_border;
|
||||
|
@ -117,7 +115,8 @@ SettingsTransparency(void)
|
|||
*radio_dialog, *radio_tooltip, *radio_hilight;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -134,7 +133,7 @@ SettingsTransparency(void)
|
|||
|
||||
tmp_theme_transparency = Conf.trans.alpha;
|
||||
|
||||
d = tr_sel_dialog = DialogCreate("CONFIGURE_TRANS");
|
||||
d = DialogCreate("CONFIGURE_TRANS");
|
||||
DialogSetTitle(d, _("Selective Transparency Settings"));
|
||||
|
||||
table = DialogInitItem(d);
|
||||
|
@ -307,7 +306,7 @@ TransparencyIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem TransIpcArray[] = {
|
||||
static const IpcItem TransIpcArray[] = {
|
||||
{
|
||||
TransparencyIpc,
|
||||
"trans", "tr",
|
||||
|
|
|
@ -24,6 +24,10 @@
|
|||
#include "ewins.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 */
|
||||
#define MWM_HINTS_FUNCTIONS (1L << 0)
|
||||
#define MWM_HINTS_DECORATIONS (1L << 1)
|
||||
|
|
13
src/pager.c
13
src/pager.c
|
@ -41,7 +41,7 @@
|
|||
#define EwinGetVX2(ew) (ew->vx + EoGetW(ew))
|
||||
#define EwinGetVY2(ew) (ew->vy + EoGetH(ew))
|
||||
|
||||
struct
|
||||
static struct
|
||||
{
|
||||
char enable;
|
||||
char zoom;
|
||||
|
@ -54,7 +54,7 @@ struct
|
|||
int menu_button;
|
||||
} Conf_pagers;
|
||||
|
||||
struct
|
||||
static struct
|
||||
{
|
||||
int zoom;
|
||||
} Mode_pagers;
|
||||
|
@ -1377,7 +1377,7 @@ PagerHandleMouseUp(Pager * p, int px, int py, int button)
|
|||
static void
|
||||
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;
|
||||
int x, y;
|
||||
|
||||
|
@ -1401,8 +1401,6 @@ PagerHiwinHandleMouseUp(Pager * p, int px, int py, int button)
|
|||
if (!ewin)
|
||||
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 &&
|
||||
Mode.events.y >= 0 && Mode.events.y < VRoot.h);
|
||||
|
||||
|
@ -1726,7 +1724,8 @@ SettingsPager(void)
|
|||
DItem *table, *di, *radio;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -2028,7 +2027,7 @@ IPC_Pager(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem PagersIpcArray[] = {
|
||||
static const IpcItem PagersIpcArray[] = {
|
||||
{
|
||||
IPC_Pager,
|
||||
"pager", "pg",
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "ewins.h"
|
||||
#include "snaps.h"
|
||||
#include "xwin.h"
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
#include <sys/time.h>
|
||||
|
@ -380,26 +379,26 @@ set_save_props(SmcConn smc_conn, int master_flag)
|
|||
discardProp.name = (char *)SmDiscardCommand;
|
||||
discardProp.type = (char *)SmLISTofARRAY8;
|
||||
discardProp.num_vals = 3;
|
||||
discardProp.vals = (SmPropValue *) & discardVal;
|
||||
discardProp.vals = discardVal;
|
||||
#endif
|
||||
|
||||
restartProp.name = (char *)SmRestartCommand;
|
||||
restartProp.type = (char *)SmLISTofARRAY8;
|
||||
restartProp.vals = (SmPropValue *) & restartVal;
|
||||
restartProp.vals = restartVal;
|
||||
|
||||
cloneProp.name = (char *)SmCloneCommand;
|
||||
cloneProp.type = (char *)SmLISTofARRAY8;
|
||||
cloneProp.vals = (SmPropValue *) & restartVal;
|
||||
cloneProp.vals = restartVal;
|
||||
|
||||
styleProp.name = (char *)SmRestartStyleHint;
|
||||
styleProp.type = (char *)SmCARD8;
|
||||
styleProp.num_vals = 1;
|
||||
styleProp.vals = (SmPropValue *) & styleVal;
|
||||
styleProp.vals = &styleVal;
|
||||
|
||||
priorityProp.name = (char *)"_GSM_Priority";
|
||||
priorityProp.type = (char *)SmCARD8;
|
||||
priorityProp.num_vals = 1;
|
||||
priorityProp.vals = (SmPropValue *) & priorityVal;
|
||||
priorityProp.vals = &priorityVal;
|
||||
|
||||
if (master_flag)
|
||||
/* 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. */
|
||||
program = Mode.wm.exec_name;
|
||||
|
||||
userIDVal.length = strlen(user);
|
||||
userIDVal.length = (user) ? strlen(user) : 0;
|
||||
userIDVal.value = user;
|
||||
programVal.length = strlen(program);
|
||||
programVal.value = (char *)program;
|
||||
|
@ -629,14 +628,13 @@ static Atom atom_wm_client_leader;
|
|||
static IceConn ice_conn;
|
||||
|
||||
static void
|
||||
ice_io_error_handler(IceConn connection)
|
||||
ice_io_error_handler(IceConn connection __UNUSED__)
|
||||
{
|
||||
if (EventDebug(EDBUG_TYPE_SESSION))
|
||||
Eprintf("ice_io_error_handler\n");
|
||||
|
||||
/* The less we do here the better - the default handler does an
|
||||
* exit(1) instead of closing the losing connection. */
|
||||
connection = 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_X11_SM_SMLIB_H */
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
*/
|
||||
#include "E.h"
|
||||
#include "dialog.h"
|
||||
#include <time.h>
|
||||
|
||||
static int tmp_move;
|
||||
static int tmp_resize;
|
||||
|
@ -31,7 +30,7 @@ static int tmp_geominfo;
|
|||
static char tmp_update_while_moving;
|
||||
|
||||
static void
|
||||
CB_ConfigureMoveResize(Dialog * d, int val, void *data __UNUSED__)
|
||||
CB_ConfigureMoveResize(Dialog * d __UNUSED__, int val, void *data __UNUSED__)
|
||||
{
|
||||
if (val < 2)
|
||||
{
|
||||
|
@ -40,12 +39,6 @@ CB_ConfigureMoveResize(Dialog * d, int val, void *data __UNUSED__)
|
|||
Conf.movres.mode_info = tmp_geominfo;
|
||||
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();
|
||||
}
|
||||
|
||||
|
@ -55,9 +48,8 @@ SettingsMoveResize(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di, *radio1, *radio2, *radio3;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_MOVERESIZE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -245,8 +237,8 @@ SettingsPlacement(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di, *radio;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_PLACEMENT", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_PLACEMENT", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -441,8 +433,8 @@ SettingsAutoRaise(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_AUTORAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_AUTORAISE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -513,8 +505,9 @@ SettingsMiscellaneous(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di;
|
||||
|
||||
if ((d = FindItem("CONFIGURE_MISCELLANEOUS", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_MISCELLANEOUS", 0, LIST_FINDBY_NAME,
|
||||
LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -608,8 +601,8 @@ SettingsComposite(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di, *radio;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_COMPOSITE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_COMPOSITE", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
|
|
@ -153,9 +153,6 @@ SetupX(const char *dstr)
|
|||
if (Mode.display.screens > 1 && !Mode.wm.single && !Mode.wm.restart)
|
||||
{
|
||||
int i;
|
||||
char *dispstr;
|
||||
|
||||
dispstr = DisplayString(disp);
|
||||
|
||||
for (i = 0; i < Mode.display.screens; i++)
|
||||
{
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef struct
|
|||
|
||||
static void SlideoutCalcSize(Slideout * s);
|
||||
|
||||
struct
|
||||
static struct
|
||||
{
|
||||
Slideout *active;
|
||||
} Mode_slideouts =
|
||||
|
@ -498,7 +498,7 @@ IPC_Slideout(const char *params, Client * c __UNUSED__)
|
|||
SlideoutShow(s, GetContextEwin(), Mode.context_win);
|
||||
}
|
||||
|
||||
static IpcItem SlideoutsIpcArray[] = {
|
||||
static const IpcItem SlideoutsIpcArray[] = {
|
||||
{
|
||||
IPC_Slideout, "slideout", NULL, "Show slideout", NULL},
|
||||
};
|
||||
|
|
|
@ -664,7 +664,8 @@ SnapshotEwinDialog(const EWin * 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);
|
||||
return;
|
||||
|
@ -998,7 +999,8 @@ SettingsRemember(void)
|
|||
const char *s;
|
||||
|
||||
/* 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");
|
||||
ShowDialog(d);
|
||||
|
|
|
@ -427,7 +427,8 @@ SettingsAudio(void)
|
|||
Dialog *d;
|
||||
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");
|
||||
ShowDialog(d);
|
||||
|
@ -525,7 +526,7 @@ SoundIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem SoundIpcArray[] = {
|
||||
static const IpcItem SoundIpcArray[] = {
|
||||
{
|
||||
SoundIpc,
|
||||
"sound", "snd",
|
||||
|
|
|
@ -266,9 +266,9 @@ EobjListTypeCount(const EobjList * ewl, int type)
|
|||
/*
|
||||
* The global object/client lists
|
||||
*/
|
||||
EobjList EwinListStack = { "Stack", 0, 0, NULL, 1 };
|
||||
EobjList EwinListFocus = { "Focus", 0, 0, NULL, 0 };
|
||||
EobjList EwinListOrder = { "Order", 0, 0, NULL, 0 };
|
||||
static EobjList EwinListStack = { "Stack", 0, 0, NULL, 1 };
|
||||
static EobjList EwinListFocus = { "Focus", 0, 0, NULL, 0 };
|
||||
static EobjList EwinListOrder = { "Order", 0, 0, NULL, 0 };
|
||||
|
||||
static EObj *const *
|
||||
EobjListGet(EobjList * ewl, int *num)
|
||||
|
|
|
@ -95,7 +95,7 @@ StartupWindowsCreate(void)
|
|||
EMapWindow(win1);
|
||||
EMapWindow(win2);
|
||||
|
||||
if (ic && bw > 0 && bh > 0)
|
||||
if (bw > 0 && bh > 0)
|
||||
{
|
||||
b1 = ECreateWindow(w1, bx, by, bw, bh, 0);
|
||||
b2 = ECreateWindow(w2, 0, 0, bw, bh, 0);
|
||||
|
|
|
@ -618,7 +618,7 @@ TextclassIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem TextclassIpcArray[] = {
|
||||
static const IpcItem TextclassIpcArray[] = {
|
||||
{
|
||||
TextclassIpc,
|
||||
"textclass", NULL,
|
||||
|
|
14
src/text.c
14
src/text.c
|
@ -156,6 +156,8 @@ TextStateLoadFont(TextState * ts)
|
|||
char s[4096], *s2, *ss;
|
||||
|
||||
s2 = Estrdup(ts->fontname);
|
||||
if (!s2)
|
||||
return;
|
||||
ss = strchr(s2, '/');
|
||||
if (ss)
|
||||
{
|
||||
|
@ -163,8 +165,7 @@ TextStateLoadFont(TextState * ts)
|
|||
Esnprintf(s, sizeof(s), "%s.ttf", s2);
|
||||
ts->efont = Efont_load(s2, atoi(ss));
|
||||
}
|
||||
if (s2)
|
||||
Efree(s2);
|
||||
Efree(s2);
|
||||
|
||||
if (ts->efont)
|
||||
ts->need_utf8 = 1;
|
||||
|
@ -350,6 +351,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
|
|||
|
||||
len = strlen(lines[i]);
|
||||
new_line = Emalloc(len + 10);
|
||||
if (!new_line)
|
||||
goto done;
|
||||
while (wid > textwidth_limit)
|
||||
{
|
||||
nuke_count++;
|
||||
|
@ -445,6 +448,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
|
|||
|
||||
len = strlen(lines[i]);
|
||||
new_line = Emalloc(len + 10);
|
||||
if (!new_line)
|
||||
goto done;
|
||||
wc_len = mbstowcs(NULL, lines[i], 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]);
|
||||
new_line = Emalloc(len + 10);
|
||||
if (!new_line)
|
||||
goto done;
|
||||
while (wid > textwidth_limit)
|
||||
{
|
||||
nuke_count++;
|
||||
|
@ -683,6 +690,8 @@ TextstateDrawText(TextState * ts, Window win, const char *text, int x, int y,
|
|||
|
||||
len = strlen(lines[i]);
|
||||
new_line = Emalloc(len + 20);
|
||||
if (!new_line)
|
||||
goto done;
|
||||
while (wid > textwidth_limit)
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
done:
|
||||
StrlistFree(lines, num_lines);
|
||||
}
|
||||
|
||||
|
|
33
src/theme.c
33
src/theme.c
|
@ -26,8 +26,10 @@
|
|||
|
||||
#define ENABLE_THEME_SANITY_CHECKING 0
|
||||
|
||||
#if ENABLE_THEME_SANITY_CHECKING
|
||||
static char *badtheme = NULL;
|
||||
static char *badreason = NULL;
|
||||
#endif
|
||||
|
||||
static const char *const theme_files[] = {
|
||||
#if ENABLE_THEME_SANITY_CHECKING
|
||||
|
@ -54,7 +56,7 @@ SanitiseThemeDir(const char *dir)
|
|||
int i;
|
||||
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);
|
||||
if (isfile(s))
|
||||
|
@ -243,14 +245,16 @@ ThemeGetDefault(void)
|
|||
/* Then, try out all installed themes */
|
||||
path = NULL;
|
||||
lst = ThemesList(&num);
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
path = ThemeCheckPath(lst[i]);
|
||||
if (path)
|
||||
break;
|
||||
}
|
||||
if (lst)
|
||||
StrlistFree(lst, num);
|
||||
{
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
path = ThemeCheckPath(lst[i]);
|
||||
if (path)
|
||||
break;
|
||||
}
|
||||
StrlistFree(lst, num);
|
||||
}
|
||||
if (path)
|
||||
return ThemeGetPath(path);
|
||||
|
||||
|
@ -309,6 +313,8 @@ ThemeExtract(const char *theme)
|
|||
/* vanilla tarball */
|
||||
Esnprintf(s, sizeof(s), "(cd %s ; tar -xf %s)", th, theme);
|
||||
}
|
||||
else
|
||||
goto done;
|
||||
|
||||
/* exec the untar if tarred */
|
||||
system(s);
|
||||
|
@ -332,7 +338,9 @@ ThemeFind(const char *theme)
|
|||
char paths[4096], tdir[4096], *p, *s;
|
||||
char *ret;
|
||||
|
||||
#if ENABLE_THEME_SANITY_CHECKING
|
||||
badreason = _("Unknown\n");
|
||||
#endif
|
||||
|
||||
if (!theme || !theme[0])
|
||||
return ThemeGetDefault();
|
||||
|
@ -362,7 +370,9 @@ ThemeFind(const char *theme)
|
|||
}
|
||||
|
||||
ret = ThemeGetDefault();
|
||||
#if ENABLE_THEME_SANITY_CHECKING
|
||||
badtheme = Estrdup(theme);
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -461,10 +471,11 @@ ThemesIpc(const char *params, Client * c __UNUSED__)
|
|||
int i, num;
|
||||
|
||||
lst = ThemesList(&num);
|
||||
if (!lst)
|
||||
return;
|
||||
for (i = 0; i < num; i++)
|
||||
IpcPrintf("%s\n", lst[i]);
|
||||
if (lst)
|
||||
StrlistFree(lst, num);
|
||||
StrlistFree(lst, num);
|
||||
}
|
||||
else if (!strcmp(cmd, "use"))
|
||||
{
|
||||
|
@ -473,7 +484,7 @@ ThemesIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem ThemeIpcArray[] = {
|
||||
static const IpcItem ThemeIpcArray[] = {
|
||||
{
|
||||
ThemesIpc,
|
||||
"theme", "th",
|
||||
|
|
|
@ -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;
|
||||
ady = ady / dy;
|
||||
|
||||
|
@ -832,8 +837,8 @@ SettingsTooltips(void)
|
|||
Dialog *d;
|
||||
DItem *table, *di;
|
||||
|
||||
if ((d =
|
||||
FindItem("CONFIGURE_TOOLTIPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG)))
|
||||
d = FindItem("CONFIGURE_TOOLTIPS", 0, LIST_FINDBY_NAME, LIST_TYPE_DIALOG);
|
||||
if (d)
|
||||
{
|
||||
SoundPlay("SOUND_SETTINGS_ACTIVE");
|
||||
ShowDialog(d);
|
||||
|
@ -889,7 +894,7 @@ TooltipsIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem TooltipsIpcArray[] = {
|
||||
static const IpcItem TooltipsIpcArray[] = {
|
||||
{
|
||||
TooltipsIpc,
|
||||
"tooltips", "tt",
|
||||
|
|
|
@ -64,15 +64,15 @@ struct _windowmatch
|
|||
#define MATCH_OP_ICON 2
|
||||
#define MATCH_OP_WINOP 3
|
||||
|
||||
const char *MatchType[] = {
|
||||
static const char *MatchType[] = {
|
||||
NULL, "Title", "Name", "Class", "Size", "Width", "Height", "Prop", NULL
|
||||
};
|
||||
|
||||
const char *MatchProp[] = {
|
||||
static const char *MatchProp[] = {
|
||||
NULL, "Transient", "Shaped", "FixedSize", "FixedWidth", "FixedHeight", NULL
|
||||
};
|
||||
|
||||
const char *MatchOp[] = {
|
||||
static const char *MatchOp[] = {
|
||||
NULL, "Border", "Icon", "Winop", NULL
|
||||
};
|
||||
|
||||
|
@ -110,7 +110,8 @@ WindowMatchDestroy(WindowMatch * wm)
|
|||
if (!wm)
|
||||
return;
|
||||
|
||||
while (RemoveItemByPtr(wm, LIST_TYPE_WINDOWMATCH));
|
||||
while (RemoveItemByPtr(wm, LIST_TYPE_WINDOWMATCH))
|
||||
;
|
||||
|
||||
if (wm->name)
|
||||
Efree(wm->name);
|
||||
|
@ -131,6 +132,7 @@ WindowMatchConfigLoad(FILE * fs)
|
|||
WindowMatch *wm = 0;
|
||||
char s[FILEPATH_LEN_MAX];
|
||||
char s2[FILEPATH_LEN_MAX];
|
||||
const char *ss;
|
||||
int i1;
|
||||
int fields;
|
||||
|
||||
|
@ -182,19 +184,22 @@ WindowMatchConfigLoad(FILE * fs)
|
|||
if (!wm)
|
||||
break;
|
||||
wm->match = MATCH_TYPE_TITLE;
|
||||
wm->value = Estrdup(atword(s, 2));
|
||||
ss = atword(s, 2);
|
||||
wm->value = Estrdup(ss);
|
||||
break;
|
||||
case WINDOWMATCH_MATCHNAME:
|
||||
if (!wm)
|
||||
break;
|
||||
wm->match = MATCH_TYPE_WM_NAME;
|
||||
wm->value = Estrdup(atword(s, 2));
|
||||
ss = atword(s, 2);
|
||||
wm->value = Estrdup(ss);
|
||||
break;
|
||||
case WINDOWMATCH_MATCHCLASS:
|
||||
if (!wm)
|
||||
break;
|
||||
wm->match = MATCH_TYPE_WM_CLASS;
|
||||
wm->value = Estrdup(atword(s, 2));
|
||||
ss = atword(s, 2);
|
||||
wm->value = Estrdup(ss);
|
||||
break;
|
||||
|
||||
case WINDOWMATCH_WIDTH:
|
||||
|
@ -894,7 +899,7 @@ WindowMatchIpc(const char *params, Client * c __UNUSED__)
|
|||
}
|
||||
}
|
||||
|
||||
IpcItem WindowMatchIpcArray[] = {
|
||||
static const IpcItem WindowMatchIpcArray[] = {
|
||||
{
|
||||
WindowMatchIpc,
|
||||
"wmatch", "wma",
|
||||
|
|
5
src/x.c
5
src/x.c
|
@ -22,7 +22,6 @@
|
|||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
#include "E.h"
|
||||
#include "ecore-e16.h"
|
||||
#include "xwin.h"
|
||||
#include <X11/Xutil.h>
|
||||
#include <X11/Xresource.h>
|
||||
|
@ -1055,6 +1054,8 @@ EShapeGetRectangles(Window win, int dest, int *rn, int *ord)
|
|||
if (xid->num_rect > 0)
|
||||
{
|
||||
r = Emalloc(sizeof(XRectangle) * xid->num_rect);
|
||||
if (!r)
|
||||
return NULL;
|
||||
memcpy(r, xid->rects, sizeof(XRectangle) * xid->num_rect);
|
||||
return r;
|
||||
}
|
||||
|
@ -1070,6 +1071,8 @@ EShapeGetRectangles(Window win, int dest, int *rn, int *ord)
|
|||
if (r)
|
||||
{
|
||||
rr = Emalloc(sizeof(XRectangle) * *rn);
|
||||
if (!rr)
|
||||
return NULL;
|
||||
memcpy(rr, r, sizeof(XRectangle) * *rn);
|
||||
XFree(r);
|
||||
return rr;
|
||||
|
|
Loading…
Reference in New Issue