Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
Tag: branch-exp
E.h config.c econfig.h fx.c ipc.c main.c menus-misc.c
mod-misc.c session.c theme.c
Log Message:
Theme module. Remove more obsolete stuff.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/E.h,v
retrieving revision 1.314.2.28
retrieving revision 1.314.2.29
diff -u -3 -r1.314.2.28 -r1.314.2.29
--- E.h 25 Aug 2004 21:56:56 -0000 1.314.2.28
+++ E.h 26 Aug 2004 23:20:59 -0000 1.314.2.29
@@ -1536,7 +1536,7 @@
char *GetLine(char *s, int size, FILE * f);
char *FindFile(const char *file);
int LoadConfigFile(const char *file);
-int LoadEConfig(char *themelocation);
+int LoadEConfig(void);
void SaveUserControlConfig(FILE * autosavefile);
void RecoverUserConfig(void);
@@ -2365,12 +2365,8 @@
int y, int w, int h, int fsize, int justification);
/* theme.c */
-char *ThemeGetDefault(void);
-void ThemeSetDefault(const char *theme);
-void ThemeCleanup(void);
-void ThemeBadDialog(void);
-char *ThemeFind(const char *theme);
-char **ListThemes(int *number);
+void ThemesInit(void);
+char **ThemesList(int *num);
/* timers.c */
double GetTime(void);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/config.c,v
retrieving revision 1.111.2.13
retrieving revision 1.111.2.14
diff -u -3 -r1.111.2.13 -r1.111.2.14
--- config.c 24 Aug 2004 23:37:52 -0000 1.111.2.13
+++ config.c 26 Aug 2004 23:21:00 -0000 1.111.2.14
@@ -981,7 +981,7 @@
}
int
-LoadEConfig(char *themelocation)
+LoadEConfig(void)
{
static const char *const config_files[] = {
"init.cfg",
@@ -1010,29 +1010,12 @@
"menus.cfg"
};
char s[FILEPATH_LEN_MAX];
- char *theme;
Progressbar *p = NULL;
int i;
EDBUG(5, "LoadEConfig");
- Esnprintf(s, sizeof(s), "%s/", EDirUser());
- Esnprintf(s, sizeof(s), "%s/config/", EDirRoot());
-
- theme = ThemeFind(themelocation);
- if (!theme)
- {
- Alert(_("No themes were found in the default theme directory:\n"
- " %s/themes/\n"
- "or in the user theme directory:\n"
- " %s/themes/\n"
- "Proceeding from here is mostly pointless.\n"),
- EDirRoot(), EDirUser());
- EDBUG_RETURN(0);
- }
-
- Mode.theme.path = Estrdup(theme);
- Esnprintf(s, sizeof(s), "%s/", theme);
+ Esnprintf(s, sizeof(s), "%s/", Mode.theme.path);
for (i = 0; i < (int)(sizeof(config_files) / sizeof(char *)); i++)
@@ -1072,9 +1055,6 @@
if (p)
ProgressbarDestroy(p);
- if (theme)
- Efree(theme);
-
EDBUG_RETURN(0);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/econfig.h,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -3 -r1.1.2.3 -r1.1.2.4
--- econfig.h 24 Aug 2004 23:37:52 -0000 1.1.2.3
+++ econfig.h 26 Aug 2004 23:21:00 -0000 1.1.2.4
@@ -42,7 +42,7 @@
#define CFG_ITEM_BOOL(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_BOOL, dflt }
#define CFG_ITEM_INT(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_INT, dflt }
-#define CFG_ITEM_FLOAT(conf, name, dflt) { #name, &conf.name, ITEM_TYPE_FLOAT, dflt }
+#define CFG_ITEM_STR(conf, name) { #name, &conf.name, ITEM_TYPE_INT, 0 }
/* Change to this? */
#define CFR_ITEM_BOOL(conf, name, dflt) { #name, &conf, ITEM_TYPE_BOOL, dflt }
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/fx.c,v
retrieving revision 1.41.2.5
retrieving revision 1.41.2.6
diff -u -3 -r1.41.2.5 -r1.41.2.6
--- fx.c 25 Aug 2004 21:56:57 -0000 1.41.2.5
+++ fx.c 26 Aug 2004 23:21:00 -0000 1.41.2.6
@@ -1197,5 +1197,5 @@
NULL, NULL,
FxConfigure,
{N_CFG_ITEMS, FxCfgItems},
- {0, NULL}
+ {N_IPC_FUNCS, FxIpcArray}
};
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/ipc.c,v
retrieving revision 1.174.2.15
retrieving revision 1.174.2.16
diff -u -3 -r1.174.2.15 -r1.174.2.16
--- ipc.c 24 Aug 2004 23:37:53 -0000 1.174.2.15
+++ ipc.c 26 Aug 2004 23:21:00 -0000 1.174.2.16
@@ -1032,392 +1032,6 @@
}
static void
-IPC_AdvancedFocus(const char *params, Client * c)
-{
- char buf[FILEPATH_LEN_MAX];
-
- buf[0] = 0;
-
- if (params)
- {
- char param1[FILEPATH_LEN_MAX];
- char param2[FILEPATH_LEN_MAX];
-
- param1[0] = 0;
- param2[0] = 0;
- word(params, 1, param1);
- word(params, 2, param2);
- if (!strcmp(param1, "new_window_focus"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.all_new_windows_get_focus = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.all_new_windows_get_focus = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.all_new_windows_get_focus)
- {
- Esnprintf(buf, sizeof(buf), "new_window_focus: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "new_window_focus: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "focus_list"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.warplist.enable = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.warplist.enable = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.warplist.enable)
- {
- Esnprintf(buf, sizeof(buf), "focus_list: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "focus_list: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "new_popup_window_focus"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.new_transients_get_focus = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.new_transients_get_focus = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.new_transients_get_focus)
- {
- Esnprintf(buf, sizeof(buf),
- "new_popup_window_focus: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "new_popup_window_focus: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "new_popup_of_owner_focus"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.new_transients_get_focus_if_group_focused = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.new_transients_get_focus_if_group_focused = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.new_transients_get_focus_if_group_focused)
- {
- Esnprintf(buf, sizeof(buf),
- "new_popup_of_owner_focus: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "new_popup_of_owner_focus: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "raise_on_keyboard_focus_switch"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.raise_on_next = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.raise_on_next = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.raise_on_next)
- {
- Esnprintf(buf, sizeof(buf),
- "raise_on_keyboard_focus_switch: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "raise_on_keyboard_focus_switch: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "raise_after_keyboard_focus_switch"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.warplist.raise_on_select = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.warplist.raise_on_select = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.warplist.raise_on_select)
- {
- Esnprintf(buf, sizeof(buf),
- "raise_after_keyboard_focus_switch: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "raise_after_keyboard_focus_switch: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "display_warp"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.warplist.enable = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.warplist.enable = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.warplist.enable)
- {
- Esnprintf(buf, sizeof(buf), "display_warp: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "display_warp: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "pointer_to_keyboard_focus_window"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.warp_on_next = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.warp_on_next = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.warp_on_next)
- {
- Esnprintf(buf, sizeof(buf),
- "pointer_to_keyboard_focus_window: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "pointer_to_keyboard_focus_window: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "pointer_after_keyboard_focus_window"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.warplist.warp_on_select = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.warplist.warp_on_select = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.warplist.warp_on_select)
- {
- Esnprintf(buf, sizeof(buf),
- "pointer_after_keyboard_focus_window: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "pointer_after_keyboard_focus_window: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "transients_follow_leader"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.transientsfollowleader = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.transientsfollowleader = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.transientsfollowleader)
- {
- Esnprintf(buf, sizeof(buf),
- "transients_follow_leader: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "transients_follow_leader: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "switch_to_popup_location"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.focus.switchfortransientmap = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.focus.switchfortransientmap = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.focus.switchfortransientmap)
- {
- Esnprintf(buf, sizeof(buf),
- "switch_to_popup_location: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "switch_to_popup_location: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "manual_placement"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.place.manual = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.place.manual = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.place.manual)
- {
- Esnprintf(buf, sizeof(buf), "manual_placement: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "manual_placement: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else if (!strcmp(param1, "manual_placement_mouse_pointer"))
- {
- if (!strcmp(param2, "on"))
- {
- Conf.place.manual_mouse_pointer = 1;
- }
- else if (!strcmp(param2, "off"))
- {
- Conf.place.manual_mouse_pointer = 0;
- }
- else if (!strcmp(param2, "?"))
- {
- if (Conf.place.manual_mouse_pointer)
- {
- Esnprintf(buf, sizeof(buf),
- "manual_placement_mouse_pointer: on");
- }
- else
- {
- Esnprintf(buf, sizeof(buf),
- "manual_placement_mouse_pointer: off");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: unknown mode selected");
- }
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: no mode selected");
- }
-
- if (buf[0])
- CommsSend(c, buf);
-}
-
-static void
IPC_InternalList(const char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
@@ -2522,17 +2136,6 @@
}
static void
-IPC_ShowIcons(const char *params, Client * c)
-{
- /* Doesn't look like this function is doing anything, but it used to
- * if I recall correctly --Mandrake
- * If it did anything useful, it was before 0.16.5 /Kim */
- return;
- params = NULL;
- c = NULL;
-}
-
-static void
IPC_GotoDesktop(const char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
@@ -2567,43 +2170,6 @@
}
static void
-IPC_ListThemes(const char *params, Client * c)
-{
- char **list, *buf = NULL;
- int i, num;
-
- params = NULL;
- list = ListThemes(&num);
- for (i = 0; i < num; i++)
- {
- if (buf)
- {
- buf = Erealloc(buf, strlen(buf) + strlen(list[i]) + 2);
- }
- else
- {
- buf = Emalloc(strlen(list[i]) + 2);
- buf[0] = 0;
- }
- strcat(buf, list[i]);
- strcat(buf, "\n");
- }
-
- if (list)
- freestrlist(list, num);
-
- if (buf)
- {
- CommsSend(c, buf);
- Efree(buf);
- }
- else
- {
- CommsSend(c, "");
- }
-}
-
-static void
IPC_SMFile(const char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
@@ -2674,24 +2240,6 @@
}
static void
-IPC_RestartTheme(const char *params, Client * c)
-{
- char buf[FILEPATH_LEN_MAX];
-
- if (params)
- {
- Esnprintf(buf, sizeof(buf), "restart_theme %s", params);
- params = NULL;
- SessionExit(buf);
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Error: no theme specified");
- CommsSend(c, buf);
- }
-}
-
-static void
IPC_Exit(const char *params, Client * c)
{
c = NULL;
@@ -2703,48 +2251,6 @@
}
static void
-IPC_DefaultTheme(const char *params, Client * c)
-{
- char buf[FILEPATH_LEN_MAX];
-
- buf[0] = 0;
-
- if (!params)
- return;
-
- if (!strcmp(params, "?"))
- {
- Esnprintf(buf, sizeof(buf), "%s", ThemeGetDefault());
- }
- else
- {
- if (exists(params))
- {
- char restartcommand[FILEPATH_LEN_MAX];
-
- ThemeSetDefault(params);
- Esnprintf(restartcommand, sizeof(restartcommand),
- "restart_theme %s", params);
- SessionExit(restartcommand);
- }
- else
- {
- Esnprintf(buf, sizeof(buf), "Could not find theme: %s",
- ThemeGetDefault());
- }
- }
-
- if (buf[0])
- CommsSend(c, buf);
-}
-
-static void
-IPC_CurrentTheme(const char *params __UNUSED__, Client * c __UNUSED__)
-{
- IpcPrintf("%s\n", Mode.theme.path);
-}
-
-static void
IPC_AutoSave(const char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
@@ -2847,20 +2353,6 @@
CommsSend(c, buf);
}
-#if 0 /* Not implemented */
-/* The External function designed for attaching to a dialog box
- * to return a message back to an external app telling you what
- * button was depressed
- */
-
-static void
-ButtonIPC(int val, void *data)
-{
- val = 0;
- data = NULL;
-}
-#endif
-
/*
* Reloads the menus.cfg file from cache,
*
@@ -3423,36 +2915,6 @@
}
static void
-IPC_ThemeGet(const char *params __UNUSED__, Client * c)
-{
- char *s1;
-
- s1 = ThemeGetDefault();
- if (s1)
- {
- CommsSend(c, s1);
- Efree(s1);
- }
- else
- CommsSend(c, "");
-}
-
-static void
-IPC_ThemeSet(const char *params, Client * c __UNUSED__)
-{
- char param1[FILEPATH_LEN_MAX], sss[FILEPATH_LEN_MAX];
-
- word(params, 1, param1);
-
- if (exists(param1))
- {
- ThemeSetDefault(param1);
- Esnprintf(sss, sizeof(sss), "restart_theme %s", param1);
- SessionExit(sss);
- }
-}
-
-static void
IPC_KeybindingsGet(const char *params __UNUSED__, Client * c)
{
ActionClass *ac;
@@ -3792,371 +3254,6 @@
Efree(bpy);
}
-#if 0
-static void
-IPC_ControlsSet(const char *s, Client * c __UNUSED__)
-{
- char w[FILEPATH_LEN_MAX];
- int wd;
- int a, b;
- int ax, ay;
- char dragbar_change = 0;
-
- wd = 2;
- w[0] = 0;
- while (atword(s, wd))
- {
- word(s, wd, w);
- wd++;
- if (!strcmp(w, "FOCUSMODE:"))
- {
- word(s, wd, w);
- Conf.focus.mode = atoi(w);
- }
- else if (!strcmp(w, "DOCKAPP_SUPPORT:"))
- {
- word(s, wd, w);
- Conf.dock.dirmode = atoi(w);
- }
- else if (!strcmp(w, "DOCKDIRMODE:"))
- {
- word(s, wd, w);
- Conf.dockapp_support = atoi(w);
- }
- else if (!strcmp(w, "ICONDIRMODE:"))
- {
- word(s, wd, w);
- Conf.primaryicondir = atoi(w);
- }
- else if (!strcmp(w, "MOVEMODE:"))
- {
- word(s, wd, w);
- Conf.movemode = atoi(w);
- }
- else if (!strcmp(w, "RESIZEMODE:"))
- {
- word(s, wd, w);
- Conf.resizemode = atoi(w);
- if (Conf.resizemode == 5)
- Conf.resizemode = 3;
- }
- else if (!strcmp(w, "SLIDEMODE:"))
- {
- word(s, wd, w);
- Conf.slidemode = atoi(w);
- }
- else if (!strcmp(w, "CLEANUPSLIDE:"))
- {
- word(s, wd, w);
- Conf.cleanupslide = atoi(w);
- }
- else if (!strcmp(w, "MAPSLIDE:"))
- {
- word(s, wd, w);
- Conf.mapslide = atoi(w);
- }
- else if (!strcmp(w, "SLIDESPEEDMAP:"))
- {
- word(s, wd, w);
- Conf.slidespeedmap = atoi(w);
- }
- else if (!strcmp(w, "SLIDESPEEDCLEANUP:"))
- {
- word(s, wd, w);
- Conf.slidespeedcleanup = atoi(w);
- }
- else if (!strcmp(w, "SHADESPEED:"))
- {
- word(s, wd, w);
- Conf.shadespeed = atoi(w);
- }
- else if (!strcmp(w, "DESKTOPBGTIMEOUT:"))
- {
- word(s, wd, w);
- Conf.backgrounds.timeout = atoi(w);
- }
- else if (!strcmp(w, "SOUND:"))
- {
- word(s, wd, w);
- Conf.sound = atoi(w);
- if (Conf.sound)
- SoundInit();
- else
- SoundExit();
- }
- else if (!strcmp(w, "BUTTONMOVERESISTANCE:"))
- {
- word(s, wd, w);
- Conf.button_move_resistance = atoi(w);
- }
- else if (!strcmp(w, "AUTOSAVE:"))
- {
- word(s, wd, w);
- Conf.autosave = atoi(w);
- }
- else if (!strcmp(w, "MEMORYPARANOIA:"))
- {
- word(s, wd, w);
- Conf.memory_paranoia = atoi(w);
- }
- else if (!strcmp(w, "MENUSLIDE:"))
- {
- word(s, wd, w);
- Conf.menuslide = atoi(w);
- }
- else if (!strcmp(w, "NUMDESKTOPS:"))
- {
- word(s, wd, w);
- ChangeNumberOfDesktops(atoi(w));
- }
- else if (!strcmp(w, "TOOLTIPS:"))
- {
- word(s, wd, w);
- Conf.tooltips.enable = atoi(w);
- }
- else if (!strcmp(w, "TIPTIME:"))
- {
- word(s, wd, w);
- Conf.tooltips.delay = atof(w);
- }
- else if (!strcmp(w, "AUTORAISE:"))
- {
- word(s, wd, w);
- Conf.autoraise.enable = atoi(w);
- }
- else if (!strcmp(w, "AUTORAISETIME:"))
- {
- word(s, wd, w);
- Conf.autoraise.delay = atof(w);
- }
- else if (!strcmp(w, "DOCKSTARTX:"))
- {
- word(s, wd, w);
- Conf.dock.startx = atoi(w);
- }
- else if (!strcmp(w, "DOCKSTARTY:"))
- {
- word(s, wd, w);
- Conf.dock.starty = atoi(w);
- }
- else if (!strcmp(w, "SAVEUNDER:"))
- {
- word(s, wd, w);
- Conf.save_under = atoi(w);
- }
- else if (!strcmp(w, "DRAGDIR:"))
- {
- word(s, wd, w);
- if (Conf.desks.dragdir != atoi(w))
- dragbar_change = 1;
- Conf.desks.dragdir = atoi(w);
- }
- else if (!strcmp(w, "DRAGBARWIDTH:"))
- {
- word(s, wd, w);
- if (Conf.desks.dragbar_width != atoi(w))
- dragbar_change = 1;
- Conf.desks.dragbar_width = atoi(w);
- }
- else if (!strcmp(w, "DRAGBARORDERING:"))
- {
- word(s, wd, w);
- if (Conf.desks.dragbar_ordering != atoi(w))
- dragbar_change = 1;
- Conf.desks.dragbar_ordering = atoi(w);
- }
- else if (!strcmp(w, "DRAGBARLENGTH:"))
- {
- word(s, wd, w);
- if (Conf.desks.dragbar_length != atoi(w))
- dragbar_change = 1;
- Conf.desks.dragbar_length = atoi(w);
- }
- else if (!strcmp(w, "DESKSLIDEIN:"))
- {
- word(s, wd, w);
- Conf.desks.slidein = atoi(w);
- }
- else if (!strcmp(w, "DESKSLIDESPEED:"))
- {
- word(s, wd, w);
- Conf.desks.slidespeed = atoi(w);
- }
- else if (!strcmp(w, "HIQUALITYBG:"))
- {
- word(s, wd, w);
- Conf.backgrounds.hiquality = atoi(w);
- }
- else if (!strcmp(w, "TRANSIENTSFOLLOWLEADER:"))
- {
- word(s, wd, w);
- Conf.focus.transientsfollowleader = atoi(w);
- }
- else if (!strcmp(w, "SWITCHFORTRANSIENTMAP:"))
- {
- word(s, wd, w);
- Conf.focus.switchfortransientmap = atoi(w);
- }
- else if (!strcmp(w, "SHOWICONS:"))
- {
- /* Obsolete */
- }
- else if (!strcmp(w, "ALL_NEW_WINDOWS_GET_FOCUS:"))
- {
- word(s, wd, w);
- Conf.focus.all_new_windows_get_focus = atoi(w);
- }
- else if (!strcmp(w, "NEW_TRANSIENTS_GET_FOCUS:"))
- {
- word(s, wd, w);
- Conf.focus.new_transients_get_focus = atoi(w);
- }
- else if (!strcmp(w, "NEW_TRANSIENTS_GET_FOCUS_IF_GROUP_FOCUSED:"))
- {
- word(s, wd, w);
- Conf.focus.new_transients_get_focus_if_group_focused = atoi(w);
- }
- else if (!strcmp(w, "MANUAL_PLACEMENT:"))
- {
- word(s, wd, w);
- Conf.place.manual = atoi(w);
- }
- else if (!strcmp(w, "MANUAL_PLACEMENT_MOUSE_POINTER:"))
- {
- word(s, wd, w);
- Conf.place.manual_mouse_pointer = atoi(w);
- }
- else if (!strcmp(w, "RAISE_ON_NEXT_FOCUS:"))
- {
- word(s, wd, w);
- Conf.focus.raise_on_next = atoi(w);
- }
- else if (!strcmp(w, "RAISE_AFTER_NEXT_FOCUS:"))
- {
- word(s, wd, w);
- Conf.warplist.raise_on_select = atoi(w);
- }
- else if (!strcmp(w, "DISPLAY_WARP:"))
- {
- word(s, wd, w);
- Conf.warplist.enable = atoi(w);
- }
- else if (!strcmp(w, "WARP_ON_NEXT_FOCUS:"))
- {
- word(s, wd, w);
- Conf.focus.warp_on_next = atoi(w);
- }
- else if (!strcmp(w, "WARP_AFTER_NEXT_FOCUS:"))
- {
- word(s, wd, w);
- Conf.warplist.warp_on_select = atoi(w);
- }
- else if (!strcmp(w, "EDGE_FLIP_RESISTANCE:"))
- {
- word(s, wd, w);
- Conf.edge_flip_resistance = atoi(w);
- EdgeWindowsShow();
- }
- else if (!strcmp(w, "AREA_SIZE:"))
- {
- w[0] = 0;
- word(s, wd, w);
- if (w[0])
- a = atoi(w);
- else
- a = 0;
- wd++;
- w[0] = 0;
- word(s, wd, w);
- if (w[0])
- b = atoi(w);
- else
- b = 0;
- if ((a > 0) && (b > 0))
- SetAreaSize(a, b);
- }
- wd++;
- }
- if (dragbar_change)
- {
- Button *btn;
-
- while ((btn = RemoveItem("_DESKTOP_DRAG_CONTROL", 0,
- LIST_FINDBY_NAME, LIST_TYPE_BUTTON)))
- ButtonDestroy(btn);
- InitDesktopControls();
- ShowDesktopControls();
- }
- FocusFix();
-
- GetAreaSize(&ax, &ay);
- GetCurrentArea(&a, &b);
- if (a >= ax)
- {
- SetCurrentArea(ax - 1, b);
- GetCurrentArea(&a, &b);
- }
- if (b >= ay)
- SetCurrentArea(a, ay - 1);
-}
-
-static void
-IPC_ControlsGet(const char *s __UNUSED__, Client * c)
-{
- char buf[FILEPATH_LEN_MAX];
- int a, b;
-
- GetAreaSize(&a, &b);
- Esnprintf(buf, sizeof(buf),
- "FOCUSMODE: %i\n" "DOCKAPP_SUPPORT: %i\n" "DOCKDIRMODE: %i\n"
- "ICONDIRMODE: %i\n" "MOVEMODE: %i\n" "RESIZEMODE: %i\n"
- "SLIDEMODE: %i\n" "CLEANUPSLIDE: %i\n" "MAPSLIDE: %i\n"
- "SLIDESPEEDMAP: %i\n" "SLIDESPEEDCLEANUP: %i\n"
- "SHADESPEED: %i\n" "DESKTOPBGTIMEOUT: %i\n" "SOUND: %i\n"
- "BUTTONMOVERESISTANCE: %i\n" "AUTOSAVE: %i\n"
- "MEMORYPARANOIA: %i\n" "TOOLTIPS: %i\n" "TIPTIME: %f\n"
- "AUTORAISE: %i\n" "AUTORAISETIME: %f\n" "DOCKSTARTX: %i\n"
- "DOCKSTARTY: %i\n" "SAVEUNDER: %i\n" "MENUSLIDE: %i\n"
- "NUMDESKTOPS: %i\n" "DRAGDIR: %i\n" "DRAGBARWIDTH: %i\n"
- "DRAGBARORDERING: %i\n" "DRAGBARLENGTH: %i\n"
- "DESKSLIDEIN: %i\n" "DESKSLIDESPEED: %i\n" "HIQUALITYBG: %i\n"
- "TRANSIENTSFOLLOWLEADER: %i\n" "SWITCHFORTRANSIENTMAP: %i\n"
- "AREA_SIZE: %i %i\n"
- "ALL_NEW_WINDOWS_GET_FOCUS: %i\n"
- "NEW_TRANSIENTS_GET_FOCUS: %i\n"
- "NEW_TRANSIENTS_GET_FOCUS_IF_GROUP_FOCUSED: %i\n"
- "MANUAL_PLACEMENT: %i\n"
- "MANUAL_PLACEMENT_MOUSE_POINTER: %i\n"
- "RAISE_ON_NEXT_FOCUS: %i\n" "RAISE_AFTER_NEXT_FOCUS: %i\n"
- "DISPLAY_WARP: %i\n" "WARP_ON_NEXT_FOCUS: %i\n"
- "WARP_AFTER_NEXT_FOCUS: %i\n" "EDGE_FLIP_RESISTANCE: %i\n",
- Conf.focus.mode, Conf.dockapp_support, Conf.dock.dirmode,
- Conf.primaryicondir, Conf.movemode, Conf.resizemode,
- Conf.slidemode, Conf.cleanupslide, Conf.mapslide,
- Conf.slidespeedmap, Conf.slidespeedcleanup, Conf.shadespeed,
- Conf.backgrounds.timeout, Conf.sound,
- Conf.button_move_resistance, Conf.autosave,
- Conf.memory_paranoia, Conf.tooltips.enable,
- Conf.tooltips.delay, Conf.autoraise.enable,
- Conf.autoraise.delay, Conf.dock.startx, Conf.dock.starty,
- Conf.save_under, Conf.menuslide, Conf.desks.num,
- Conf.desks.dragdir, Conf.desks.dragbar_width,
- Conf.desks.dragbar_ordering, Conf.desks.dragbar_length,
- Conf.desks.slidein, Conf.desks.slidespeed,
- Conf.backgrounds.hiquality, Conf.focus.transientsfollowleader,
- Conf.focus.switchfortransientmap, a, b,
- Conf.focus.all_new_windows_get_focus,
- Conf.focus.new_transients_get_focus,
- Conf.focus.new_transients_get_focus_if_group_focused,
- Conf.place.manual, Conf.place.manual_mouse_pointer,
- Conf.focus.raise_on_next,
- Conf.warplist.raise_on_select, Conf.warplist.enable,
- Conf.focus.warp_on_next,
- Conf.warplist.warp_on_select, Conf.edge_flip_resistance);
- CommsSend(c, buf);
-}
-#endif
-
static void
IPC_CallRaw(const char *params, Client * c __UNUSED__)
{
@@ -4480,14 +3577,6 @@
"Use \"autosave ?\" to list the current status\n"
"use \"autosave on\" or \"autosave off\" to toggle the status"},
{
- IPC_DefaultTheme,
- "default_theme", NULL,
- "toggle the default theme",
- "Use \"default_theme ?\" to get the current default theme\n"
- "use \"default_theme /path/to/theme\"\n"
- "you can retrieve a list of available themes from the "
- "\"list_themes\" command"},
- {
IPC_Restart,
"restart", NULL,
"Restart Enlightenment",
@@ -4499,12 +3588,6 @@
"Use \"restart_wm <wmname>\" to start another window manager.\n"
"Example: \"restart_wm fvwm\""},
{
- IPC_RestartTheme,
- "restart_theme", NULL,
- "Restart with another theme",
- "Use \"restart_theme <themename>\" to restart enlightenment "
- "with another theme\nExample: \"restart_theme icE\""},
- {
IPC_Exit,
"exit", "q",
"Exit Enlightenment",
@@ -4523,11 +3606,6 @@
"file prefix\nUse \"sm_file /path/to/prefix/filenameprefix\" "
"to change."},
{
- IPC_ListThemes,
- "list_themes", "tl",
- "List currently available themes",
- NULL},
- {
IPC_GotoDesktop,
"goto_desktop", "sd",
"Change currently active destkop",
@@ -4545,12 +3623,6 @@
"previous areas\nUse \"goto_area ?\" to find out what area "
"you are currently on"},
{
- IPC_ShowIcons,
- "show_icons", NULL,
- "Obsolete - Toggle the display of icons on the desktop",
- "Use \"show_icons on\" and \"show_icons off\" to change this setting\n"
- "Use \"show_icons ?\" to retrieve the current setting"},
- {
IPC_FocusMode,
"focus_mode", "sf",
"Change the current focus mode setting",
@@ -4565,30 +3637,6 @@
"but when over\n "
"the desktop background the last window does not lose the focus"},
{
- IPC_AdvancedFocus,
- "advanced_focus", "sfa",
- "Toggle Advanced Focus Settings",
- "use \"advanced_focus <option> <on/off/?>\" to change.\n"
- "the options you may set are:\n"
- "new_window_focus : all new windows get the keyboard focus\n"
- "new_popup_window_focus : all new transient windows get focus\n"
- "new_popup_of_owner_focus : transient windows from apps that have\n"
- " focus already may receive focus\n"
- "raise_on_keyboard_focus_switch: Raise windows when switching focus\n"
- " with the keyboard\n"
- "raise_after_keyboard_focus_switch: Raise windows after switching "
- "focus\n" " with the keyboard\n"
- "pointer_to_keyboard_focus_window: Send the pointer to the focused\n"
- " window when changing focus with the keyboard\n"
- "pointer_after_keyboard_focus_window: Send the pointer to the " "focused\n"
- " window after changing focus with the keyboard\n"
- "transients_follow_leader: popup windows appear together with the\n"
- " window that created them.\n"
- "switch_to_popup_location: switch to where a popup window appears\n"
- "focus_list: display and use focus list (requires XKB)\n"
- "manual_placement: place all new windows by hand\n"
- "manual_placement_mouse_pointer: place all new windows under mouse pointer"},
- {
IPC_NumDesks,
"num_desks", "snd",
"Change the number of available desktops",
@@ -4825,11 +3873,6 @@
" location, layer, sticky, icon, shade, group, dialog, command\n"
" Multiple parameters may be given."},
{
- IPC_CurrentTheme,
- "current_theme", "tc",
- "Returns the name of the currently used theme",
- NULL},
- {
IPC_Xinerama,
"xinerama", NULL,
"return xinerama information about your current system",
@@ -4866,10 +3909,6 @@
{
IPC_Reply, "reply", NULL, "TBD", NULL},
{
- IPC_ThemeGet, "get_default_theme", NULL, "TBD", NULL},
- {
- IPC_ThemeSet, "set_default_theme", NULL, "TBD", NULL},
- {
IPC_KeybindingsGet, "get_keybindings", NULL, "TBD", NULL},
{
IPC_KeybindingsSet, "set_keybindings", NULL, "TBD", NULL},
@@ -4879,12 +3918,6 @@
IPC_ColormodifierGet, "get_colmod", NULL, "TBD", NULL},
{
IPC_ColormodifierSet, "set_colmod", NULL, "TBD", NULL},
-#if 0
- {
- IPC_ControlsSet, "set_controls", NULL, "TBD", NULL},
- {
- IPC_ControlsGet, "get_controls", NULL, "TBD", NULL},
-#endif
{
IPC_CallRaw, "call_raw", NULL, "TBD", NULL},
{
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/main.c,v
retrieving revision 1.99.2.11
retrieving revision 1.99.2.12
diff -u -3 -r1.99.2.11 -r1.99.2.12
--- main.c 24 Aug 2004 23:37:54 -0000 1.99.2.11
+++ main.c 26 Aug 2004 23:21:00 -0000 1.99.2.12
@@ -180,9 +180,11 @@
}
}
+#if 0 /* TBD */
if (!Mode.theme.path)
Mode.theme.path = ThemeGetDefault();
SetSMUserThemePath(Mode.theme.path);
+#endif
/* run most of the setup */
AlertInit(); /* Set up all the text bits that belong on the
GSOD */
@@ -207,9 +209,12 @@
SetupFallbackClasses();
desks.desk[0].viewable = 0;
- /* now we're going to load the configuration/theme */
+
+ /* So far nothing should rely on a selected theme. */
+ /* Now we're going to load the configuration/theme */
ConfigurationLoad(); /* Load settings */
- LoadEConfig(Mode.theme.path);
+ ThemesInit();
+ LoadEConfig();
ConfigurationLoad(); /* FIXME - Override private settings set
elsewhere */
SetAreaSize(Conf.areas.nx, Conf.areas.ny);
TransparencySet(Conf.trans.alpha);
@@ -326,8 +331,6 @@
Mode.wm.startup = 0;
- ThemeBadDialog();
-
ModulesSignal(ESIGNAL_START);
/* Update pagers */
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/menus-misc.c,v
retrieving revision 1.1.2.6
retrieving revision 1.1.2.7
diff -u -3 -r1.1.2.6 -r1.1.2.7
--- menus-misc.c 22 Aug 2004 20:04:06 -0000 1.1.2.6
+++ menus-misc.c 26 Aug 2004 23:21:01 -0000 1.1.2.7
@@ -639,7 +639,7 @@
m = MenuCreate(name, NULL, NULL, ms);
- lst = ListThemes(&num);
+ lst = ThemesList(&num);
for (i = 0; i < num; i++)
{
s = fullfileof(lst[i]);
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/Attic/mod-misc.c,v
retrieving revision 1.1.2.9
retrieving revision 1.1.2.10
diff -u -3 -r1.1.2.9 -r1.1.2.10
--- mod-misc.c 24 Aug 2004 23:37:54 -0000 1.1.2.9
+++ mod-misc.c 26 Aug 2004 23:21:01 -0000 1.1.2.10
@@ -45,6 +45,7 @@
extern EModule ModSlideouts;
extern EModule ModSound;
extern EModule ModTextclass;
+extern EModule ModTheme;
extern EModule ModTooltips;
extern EModule ModTransparency;
extern EModule ModWarplist;
@@ -68,6 +69,7 @@
&ModSlideouts,
&ModSound,
&ModTextclass,
+ &ModTheme,
&ModTooltips,
&ModTransparency,
&ModWarplist,
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/session.c,v
retrieving revision 1.75.2.6
retrieving revision 1.75.2.7
diff -u -3 -r1.75.2.6 -r1.75.2.7
--- session.c 25 Aug 2004 21:56:59 -0000 1.75.2.6
+++ session.c 26 Aug 2004 23:21:01 -0000 1.75.2.7
@@ -1117,7 +1117,6 @@
SoundExit();
setsid();
sscanf(params, "%1000s", s);
- ThemeCleanup();
if (!strcmp(s, "restart"))
{
@@ -1267,7 +1266,6 @@
if (Mode.wm.master)
{
SoundExit();
- ThemeCleanup();
for (i = 0; i < Mode.wm.child_count; i++)
kill(Mode.wm.children[i], SIGINT);
}
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/theme.c,v
retrieving revision 1.37.2.1
retrieving revision 1.37.2.2
diff -u -3 -r1.37.2.1 -r1.37.2.2
--- theme.c 31 Jul 2004 08:07:33 -0000 1.37.2.1
+++ theme.c 26 Aug 2004 23:21:02 -0000 1.37.2.2
@@ -159,7 +159,7 @@
}
char **
-ListThemes(int *number)
+ThemesList(int *number)
{
char s[FILEPATH_LEN_MAX], **list = NULL;
char *def = NULL, *def2 = NULL;
@@ -212,7 +212,7 @@
return NULL;
}
-char *
+static char *
ThemeGetDefault(void)
{
static const char *const dts[] = {
@@ -240,7 +240,7 @@
/* Then, try out all installed themes */
path = NULL;
- lst = ListThemes(&num);
+ lst = ThemesList(&num);
for (i = 0; i < num; i++)
{
path = ThemeCheckPath(lst[i]);
@@ -255,7 +255,8 @@
return NULL;
}
-void
+#if 0
+static void
ThemeSetDefault(const char *theme)
{
/* os2 has no symlink,
@@ -269,6 +270,19 @@
if (theme)
symlink(theme, ss);
}
+#endif
+
+static void
+ThemeCleanup(void)
+{
+ if (!mustdel)
+ return;
+
+ /* We don't ever get here because mustdel is never set */
+#if 0 /* Don't do recursive theme removal (risky?) */
+ rmrf(themepath);
+#endif
+}
static char *
ThemeExtract(const char *theme)
@@ -337,19 +351,7 @@
EDBUG_RETURN(NULL);
}
-void
-ThemeCleanup(void)
-{
- if (!mustdel)
- return;
-
- /* We don't ever get here because mustdel is never set */
-#if 0 /* Don't do recursive theme removal (risky?) */
- rmrf(themepath);
-#endif
-}
-
-char *
+static char *
ThemeFind(const char *theme)
{
char s[FILEPATH_LEN_MAX];
@@ -362,7 +364,7 @@
Conf.theme.name = Estrdup(theme);
badreason = _("Unknown\n");
- if (!theme[0])
+ if (!theme || !theme[0])
EDBUG_RETURN(ThemeGetDefault());
if (isabspath(theme))
@@ -391,6 +393,7 @@
EDBUG_RETURN(ret);
}
+#if 0
void
ThemeBadDialog(void)
{
@@ -404,3 +407,116 @@
"\n" "The reason this theme is bad is:\n" "%s"),
badtheme, badreason);
}
+#endif
+
+/*
+ * Theme module
+ */
+
+void
+ThemesInit(void)
+{
+ char *theme;
+
+ /*
+ * Conf.theme.name is read from the configuration.
+ * Mode.theme.path may be assigned on the command line.
+ */
+ theme = (Mode.theme.path) ? Mode.theme.path : Conf.theme.name;
+ theme = ThemeFind(theme);
+ if (!theme)
+ {
+ Alert(_("No themes were found in the default theme directory:\n"
+ " %s/themes/\n"
+ "or in the user theme directory:\n"
+ " %s/themes/\n"
+ "Proceeding from here is mostly pointless.\n"),
+ EDirRoot(), EDirUser());
+ }
+
+ Mode.theme.path = Estrdup(theme);
+}
+
+static void
+ThemesSighan(int sig)
+{
+ switch (sig)
+ {
+ case ESIGNAL_EXIT:
+ ThemeCleanup();
+ break;
+ }
+}
+
+static void
+ThemesIpc(const char *params, Client * c __UNUSED__)
+{
+ const char *p;
+ char cmd[128], prm[128];
+ int len;
+
+ p = NULL;
+ if (params)
+ {
+ p = params;
+ len = 0;
+ cmd[0] = prm[0] = '\0';
+ sscanf(p, "%100s %100s %n", cmd, prm, &len);
+ p += len;
+ }
+
+ if (!p || cmd[0] == '?')
+ {
+ IpcPrintf("Name: %s\n", Conf.theme.name);
+ IpcPrintf("Path: %s\n", Mode.theme.path);
+ IpcPrintf("User: %s\n", ThemeGetDefault());
+ }
+ else if (!strncmp(cmd, "list", 2))
+ {
+ char **lst;
+ int i, num;
+
+ lst = ThemesList(&num);
+ for (i = 0; i < num; i++)
+ IpcPrintf("%s\n", lst[i]);
+ if (lst)
+ freestrlist(lst, num);
+ }
+ else if (!strcmp(cmd, "use"))
+ {
+ char s[FILEPATH_LEN_MAX];
+
+ Esnprintf(s, sizeof(s), "restart_theme %s", prm);
+ /* FIXME - ThemeCheckIfValid(s) */
+ SessionExit(s);
+ }
+}
+
+IpcItem ThemeIpcArray[] = {
+ {
+ ThemesIpc,
+ "themes", "th",
+ "Theme commands",
+ " theme Show current theme\n"
+ " theme list Show all themes\n"
+ " theme use <name> Switch to theme <name>\n"}
+ ,
+};
+#define N_IPC_FUNCS (sizeof(ThemeIpcArray)/sizeof(IpcItem))
+
+static const CfgItem ThemeCfgItems[] = {
+ CFG_ITEM_STR(Conf.theme, name),
+};
+#define N_CFG_ITEMS (sizeof(ThemeCfgItems)/sizeof(CfgItem))
+
+/*
+ * Module descriptor
+ */
+EModule ModTheme = {
+ "theme", "th",
+ ThemesSighan,
+ NULL, NULL,
+ NULL,
+ {N_CFG_ITEMS, ThemeCfgItems},
+ {N_IPC_FUNCS, ThemeIpcArray}
+};
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs