Change some stuff to const. Minor config tweaks.
SVN revision: 22284
This commit is contained in:
parent
0a4c0153e0
commit
6eb1fbcb72
6
src/E.h
6
src/E.h
|
@ -203,6 +203,12 @@ typedef struct
|
|||
}
|
||||
IpcItem;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int num;
|
||||
const IpcItem *lst;
|
||||
} IpcItemList;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
Window win;
|
||||
|
|
|
@ -1445,7 +1445,7 @@ static const IpcItem AclassIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModAclass = {
|
||||
const EModule ModAclass = {
|
||||
"aclass", "ac",
|
||||
AclassSighan,
|
||||
{N_IPC_FUNCS, AclassIpcArray}
|
||||
|
|
|
@ -2642,7 +2642,7 @@ static const CfgItem BackgroundsCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModBackgrounds = {
|
||||
const EModule ModBackgrounds = {
|
||||
"backgrounds", "bg",
|
||||
BackgroundsSighan,
|
||||
{N_IPC_FUNCS, BackgroundsIpcArray},
|
||||
|
|
|
@ -1192,7 +1192,7 @@ static const CfgItem ButtonsCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModButtons = {
|
||||
const EModule ModButtons = {
|
||||
"buttons", "btn",
|
||||
ButtonsSighan,
|
||||
{N_IPC_FUNCS, ButtonsIpcArray},
|
||||
|
|
|
@ -372,7 +372,7 @@ static const IpcItem CursorIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModCursors = {
|
||||
const EModule ModCursors = {
|
||||
"cursor", "csr",
|
||||
CursorSighan,
|
||||
{N_IPC_FUNCS, CursorIpcArray}
|
||||
|
|
|
@ -2945,7 +2945,7 @@ static const CfgItem DesksCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModDesktops = {
|
||||
const EModule ModDesktops = {
|
||||
"desktops", "desk",
|
||||
DesksSighan,
|
||||
{N_IPC_FUNCS, DesksIpcArray},
|
||||
|
|
|
@ -2726,7 +2726,7 @@ static const CfgItem CompMgrCfgItems[] = {
|
|||
CFG_ITEM_BOOL(Conf_compmgr, use_name_pixmap, 0),
|
||||
CFG_ITEM_BOOL(Conf_compmgr, fading.enable, 1),
|
||||
CFG_ITEM_INT(Conf_compmgr, fading.dt_us, 10000),
|
||||
CFG_ITEM_INT(Conf_compmgr, fading.step, 0x10000000),
|
||||
CFG_ITEM_HEX(Conf_compmgr, fading.step, 0x10000000),
|
||||
CFG_ITEM_INT(Conf_compmgr, override_redirect.mode, 1),
|
||||
CFG_ITEM_INT(Conf_compmgr, override_redirect.opacity, 90),
|
||||
};
|
||||
|
@ -2735,7 +2735,7 @@ static const CfgItem CompMgrCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModCompMgr = {
|
||||
const EModule ModCompMgr = {
|
||||
"compmgr", "cm",
|
||||
ECompMgrSighan,
|
||||
{N_IPC_FUNCS, CompMgrIpcArray},
|
||||
|
|
|
@ -195,6 +195,12 @@ e16_db_int_set(ECfgFile * ecf, const char *key, int value)
|
|||
fprintf(ecf->fs, "%s = %d\n", key, value);
|
||||
}
|
||||
|
||||
static void
|
||||
e16_db_hex_set(ECfgFile * ecf, const char *key, unsigned int value)
|
||||
{
|
||||
fprintf(ecf->fs, "%s = %#x\n", key, value);
|
||||
}
|
||||
|
||||
static void
|
||||
e16_db_float_set(ECfgFile * ecf, const char *key, float value)
|
||||
{
|
||||
|
@ -239,6 +245,7 @@ CfgItemLoad(E_DB_File * edf, const char *prefix, const CfgItem * ci)
|
|||
*((char *)ci->ptr) = my_int;
|
||||
break;
|
||||
case ITEM_TYPE_INT:
|
||||
case ITEM_TYPE_HEX:
|
||||
if (!edf || !e16_db_int_get(edf, name, &my_int))
|
||||
my_int = ci->dflt;
|
||||
*((int *)ci->ptr) = my_int;
|
||||
|
@ -281,6 +288,9 @@ CfgItemSave(E_DB_File * edf, const char *prefix, const CfgItem * ci)
|
|||
case ITEM_TYPE_INT:
|
||||
e16_db_int_set(edf, name, *((int *)ci->ptr));
|
||||
break;
|
||||
case ITEM_TYPE_HEX:
|
||||
e16_db_hex_set(edf, name, *((unsigned int *)ci->ptr));
|
||||
break;
|
||||
case ITEM_TYPE_FLOAT:
|
||||
e16_db_float_set(edf, name, *((float *)ci->ptr));
|
||||
break;
|
||||
|
@ -413,6 +423,9 @@ CfgItemToString(const CfgItem * ci, char *buf, int len)
|
|||
case ITEM_TYPE_INT:
|
||||
Esnprintf(buf, len, "%d", *((int *)ci->ptr));
|
||||
break;
|
||||
case ITEM_TYPE_HEX:
|
||||
Esnprintf(buf, len, "%#x", *((unsigned int *)ci->ptr));
|
||||
break;
|
||||
case ITEM_TYPE_FLOAT:
|
||||
Esnprintf(buf, len, "%.3f", *((float *)ci->ptr));
|
||||
break;
|
||||
|
|
|
@ -32,16 +32,24 @@ typedef struct
|
|||
void (*func) (void *item, const char *value);
|
||||
} CfgItem;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int num;
|
||||
const CfgItem *lst;
|
||||
} CfgItemList;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ITEM_TYPE_BOOL,
|
||||
ITEM_TYPE_INT,
|
||||
ITEM_TYPE_HEX,
|
||||
ITEM_TYPE_FLOAT,
|
||||
ITEM_TYPE_STRING
|
||||
} cfg_item_type_e;
|
||||
|
||||
#define CFG_ITEM_BOOL(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_BOOL, dflt, NULL }
|
||||
#define CFG_ITEM_INT(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_INT, dflt, NULL }
|
||||
#define CFG_ITEM_HEX(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_HEX, dflt, NULL }
|
||||
#define CFG_ITEM_STR(conf, name) { #name, &conf.name, ITEM_TYPE_STRING, 0, NULL }
|
||||
|
||||
#define CFG_FUNC_BOOL(conf, name, dflt, func) { #name, &conf.name, ITEM_TYPE_BOOL, dflt, func }
|
||||
|
|
|
@ -30,16 +30,8 @@ typedef struct
|
|||
const char *name;
|
||||
const char *nick;
|
||||
void (*Signal) (int sig, void *prm);
|
||||
struct
|
||||
{
|
||||
int num;
|
||||
const IpcItem *lst;
|
||||
} ipc;
|
||||
struct
|
||||
{
|
||||
int num;
|
||||
const CfgItem *lst;
|
||||
} cfg;
|
||||
IpcItemList ipc;
|
||||
CfgItemList cfg;
|
||||
} EModule;
|
||||
|
||||
typedef enum
|
||||
|
|
|
@ -2252,7 +2252,7 @@ static const IpcItem EwinsIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModEwins = {
|
||||
const const EModule ModEwins = {
|
||||
"ewins", NULL,
|
||||
EwinsSighan,
|
||||
{N_IPC_FUNCS, EwinsIpcArray}
|
||||
|
|
|
@ -1023,7 +1023,7 @@ static const CfgItem FocusCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModFocus = {
|
||||
const EModule ModFocus = {
|
||||
"focus", NULL,
|
||||
FocusSighan,
|
||||
{N_IPC_FUNCS, FocusIpcArray},
|
||||
|
|
2
src/fx.c
2
src/fx.c
|
@ -1083,7 +1083,7 @@ static const CfgItem FxCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModEffects = {
|
||||
const EModule ModEffects = {
|
||||
"effects", "efx",
|
||||
FxSighan,
|
||||
{N_IPC_FUNCS, FxIpcArray},
|
||||
|
|
|
@ -1494,7 +1494,7 @@ static const CfgItem GroupsCfgItems[] = {
|
|||
};
|
||||
#define N_CFG_ITEMS (sizeof(GroupsCfgItems)/sizeof(CfgItem))
|
||||
|
||||
EModule ModGroups = {
|
||||
const EModule ModGroups = {
|
||||
"groups", "grp",
|
||||
GroupsSighan,
|
||||
{N_IPC_FUNCS, GroupsIpcArray},
|
||||
|
|
|
@ -1616,7 +1616,7 @@ static const IpcItem ImageclassIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModImageclass = {
|
||||
const EModule ModImageclass = {
|
||||
"imageclass", "ic",
|
||||
ImageclassSighan,
|
||||
{N_IPC_FUNCS, ImageclassIpcArray}
|
||||
|
|
|
@ -2610,7 +2610,7 @@ static const CfgItem IconboxesCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModIconboxes = {
|
||||
const EModule ModIconboxes = {
|
||||
"iconboxes", "ibox",
|
||||
IconboxesSighan,
|
||||
{N_IPC_FUNCS, IconboxesIpcArray},
|
||||
|
|
14
src/menus.c
14
src/menus.c
|
@ -2136,19 +2136,19 @@ static const CfgItem MenusCfgItems[] = {
|
|||
CFG_ITEM_BOOL(Conf.menus, warp, 1),
|
||||
CFG_ITEM_BOOL(Conf.menus, show_icons, 1),
|
||||
CFG_ITEM_INT(Conf.menus, icon_size, 16),
|
||||
CFG_ITEM_INT(Conf.menus, key.left, XK_Left),
|
||||
CFG_ITEM_INT(Conf.menus, key.right, XK_Right),
|
||||
CFG_ITEM_INT(Conf.menus, key.up, XK_Up),
|
||||
CFG_ITEM_INT(Conf.menus, key.down, XK_Down),
|
||||
CFG_ITEM_INT(Conf.menus, key.escape, XK_Escape),
|
||||
CFG_ITEM_INT(Conf.menus, key.ret, XK_Return),
|
||||
CFG_ITEM_HEX(Conf.menus, key.left, XK_Left),
|
||||
CFG_ITEM_HEX(Conf.menus, key.right, XK_Right),
|
||||
CFG_ITEM_HEX(Conf.menus, key.up, XK_Up),
|
||||
CFG_ITEM_HEX(Conf.menus, key.down, XK_Down),
|
||||
CFG_ITEM_HEX(Conf.menus, key.escape, XK_Escape),
|
||||
CFG_ITEM_HEX(Conf.menus, key.ret, XK_Return),
|
||||
};
|
||||
#define N_CFG_ITEMS (sizeof(MenusCfgItems)/sizeof(CfgItem))
|
||||
|
||||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModMenus = {
|
||||
const EModule ModMenus = {
|
||||
"menus", "menu",
|
||||
MenusSighan,
|
||||
{N_IPC_FUNCS, MenusIpcArray},
|
||||
|
|
|
@ -30,35 +30,35 @@
|
|||
**********************************************************************/
|
||||
|
||||
/* Use static module list for now */
|
||||
extern EModule ModAclass;
|
||||
extern EModule ModBackgrounds;
|
||||
extern EModule ModButtons;
|
||||
extern const EModule ModAclass;
|
||||
extern const EModule ModBackgrounds;
|
||||
extern const EModule ModButtons;
|
||||
|
||||
#if USE_COMPOSITE
|
||||
extern EModule ModCompMgr;
|
||||
extern const EModule ModCompMgr;
|
||||
#endif
|
||||
extern EModule ModCursors;
|
||||
extern EModule ModDesktops;
|
||||
extern EModule ModEffects;
|
||||
extern EModule ModEwins;
|
||||
extern EModule ModFocus;
|
||||
extern EModule ModGroups;
|
||||
extern EModule ModImageclass;
|
||||
extern EModule ModIconboxes;
|
||||
extern EModule ModMenus;
|
||||
extern EModule ModMisc;
|
||||
extern EModule ModPagers;
|
||||
extern EModule ModSlideouts;
|
||||
extern EModule ModSound;
|
||||
extern EModule ModTextclass;
|
||||
extern EModule ModTheme;
|
||||
extern EModule ModTooltips;
|
||||
extern const EModule ModCursors;
|
||||
extern const EModule ModDesktops;
|
||||
extern const EModule ModEffects;
|
||||
extern const EModule ModEwins;
|
||||
extern const EModule ModFocus;
|
||||
extern const EModule ModGroups;
|
||||
extern const EModule ModImageclass;
|
||||
extern const EModule ModIconboxes;
|
||||
extern const EModule ModMenus;
|
||||
extern const EModule ModMisc;
|
||||
extern const EModule ModPagers;
|
||||
extern const EModule ModSlideouts;
|
||||
extern const EModule ModSound;
|
||||
extern const EModule ModTextclass;
|
||||
extern const EModule ModTheme;
|
||||
extern const EModule ModTooltips;
|
||||
|
||||
#ifdef ENABLE_THEME_TRANSPARENCY
|
||||
extern EModule ModTransparency;
|
||||
extern const EModule ModTransparency;
|
||||
#endif
|
||||
extern EModule ModWarplist;
|
||||
extern EModule ModWindowMatch;
|
||||
extern const EModule ModWarplist;
|
||||
extern const EModule ModWindowMatch;
|
||||
|
||||
const EModule *p_modules[] = {
|
||||
&ModAclass,
|
||||
|
@ -227,7 +227,7 @@ static const IpcItem MiscIpcArray[] = {
|
|||
#define N_IPC_FUNCS (sizeof(MiscIpcArray)/sizeof(IpcItem))
|
||||
|
||||
/* Stuff not elsewhere */
|
||||
EModule ModMisc = {
|
||||
const const EModule ModMisc = {
|
||||
"misc", NULL,
|
||||
NULL,
|
||||
{N_IPC_FUNCS, MiscIpcArray}
|
||||
|
|
|
@ -333,7 +333,7 @@ static const CfgItem TransCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModTransparency = {
|
||||
const EModule ModTransparency = {
|
||||
"transparency", "tr",
|
||||
TransparencySighan,
|
||||
{N_IPC_FUNCS, TransIpcArray},
|
||||
|
|
|
@ -2068,7 +2068,7 @@ static const CfgItem PagersCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModPagers = {
|
||||
const EModule ModPagers = {
|
||||
"pagers", "pg",
|
||||
PagersSighan,
|
||||
{N_IPC_FUNCS, PagersIpcArray},
|
||||
|
|
|
@ -523,7 +523,7 @@ static const IpcItem SlideoutsIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModSlideouts = {
|
||||
const EModule ModSlideouts = {
|
||||
"slideouts", "slideout",
|
||||
SlideoutsSighan,
|
||||
{N_IPC_FUNCS, SlideoutsIpcArray},
|
||||
|
|
|
@ -559,7 +559,7 @@ static const CfgItem SoundCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModSound = {
|
||||
const EModule ModSound = {
|
||||
"sound", "audio",
|
||||
SoundSighan,
|
||||
{N_IPC_FUNCS, SoundIpcArray},
|
||||
|
|
|
@ -642,7 +642,7 @@ static const IpcItem TextclassIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModTextclass = {
|
||||
const EModule ModTextclass = {
|
||||
"textclass", "tc",
|
||||
TextclassSighan,
|
||||
{N_IPC_FUNCS, TextclassIpcArray}
|
||||
|
|
|
@ -507,7 +507,7 @@ static const CfgItem ThemeCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModTheme = {
|
||||
const EModule ModTheme = {
|
||||
"theme", "th",
|
||||
ThemesSighan,
|
||||
{N_IPC_FUNCS, ThemeIpcArray},
|
||||
|
|
|
@ -919,7 +919,7 @@ static const CfgItem TooltipsCfgItems[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModTooltips = {
|
||||
const EModule ModTooltips = {
|
||||
"tooltips", "tt",
|
||||
TooltipsSighan,
|
||||
{N_IPC_FUNCS, TooltipsIpcArray},
|
||||
|
|
|
@ -484,7 +484,7 @@ static const CfgItem WarplistCfgItems[] = {
|
|||
};
|
||||
#define N_CFG_ITEMS (sizeof(WarplistCfgItems)/sizeof(CfgItem))
|
||||
|
||||
EModule ModWarplist = {
|
||||
const EModule ModWarplist = {
|
||||
"warplist", "warp",
|
||||
WarplistSighan,
|
||||
{0, NULL},
|
||||
|
|
|
@ -920,7 +920,7 @@ static const IpcItem WindowMatchIpcArray[] = {
|
|||
/*
|
||||
* Module descriptor
|
||||
*/
|
||||
EModule ModWindowMatch = {
|
||||
const EModule ModWindowMatch = {
|
||||
"winmatch", NULL,
|
||||
WindowMatchSighan,
|
||||
{N_IPC_FUNCS, WindowMatchIpcArray}
|
||||
|
|
Loading…
Reference in New Issue