Enlightenment CVS committal
Author : sebastid
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_ipc_handlers.h e_ipc_handlers_list.h
Log Message:
Free some allocated memory.
Add some TODO notices.
Add checks wether transitions exists.
Get known categories and transitions.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers.h,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -3 -r1.88 -r1.89
--- e_ipc_handlers.h 28 Sep 2005 13:30:49 -0000 1.88
+++ e_ipc_handlers.h 28 Sep 2005 18:57:56 -0000 1.89
@@ -947,7 +947,13 @@
r->modules[count] = md;
count++;
}
- END_RESPONSE(r, E_RESPONSE_MODULE_LIST); /* FIXME - need a custom free */
+ END_RESPONSE(r, E_RESPONSE_MODULE_LIST);
+ if (r->count)
+ {
+ for (count = 0; count < r->count; count++)
+ free(r->modules[count]);
+ free(r->modules);
+ }
}
END_GENERIC();
#endif
@@ -961,6 +967,7 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
+ /* TODO: Check if file exists */
E_FREE(e_config->desktop_default_background);
e_config->desktop_default_background = strdup(s);
e_bg_update();
@@ -1159,6 +1166,7 @@
REQ_2STRING_INT(params[0], params[1], atoi(params[2]), HDL)
#elif (TYPE == E_WM_IN)
STRING2_INT(text_class, font_name, font_size, e_2str_int, HDL);
+ /* TODO: Check if font_name (and text_class?) exists */
e_font_default_set(text_class, font_name, font_size);
SAVE;
END_STRING2_INT(e_2str_int);
@@ -1336,6 +1344,7 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
+ /* TODO: Check if language exists */
E_FREE(e_config->language);
e_config->language = strdup(s);
if ((e_config->language) && (strlen(e_config->language) > 0))
@@ -1481,7 +1490,8 @@
res = E_RESPONSE_MODULE_DIRS_LIST;
else if (!strcmp(type, "backgrounds"))
res = E_RESPONSE_BACKGROUND_DIRS_LIST;
- END_RESPONSE(r, res); /* FIXME - need a custom free */
+ END_RESPONSE(r, res);
+ if (r->dirs) free(r->dirs);
}
END_GENERIC();
#endif
@@ -4231,9 +4241,12 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
- E_FREE(e_config->transition_start);
- e_config->transition_start = strdup(s);
- SAVE;
+ if (e_theme_transition_find(s))
+ {
+ E_FREE(e_config->transition_start);
+ e_config->transition_start = strdup(s);
+ SAVE;
+ }
END_STRING(s);
#elif (TYPE == E_REMOTE_IN)
#endif
@@ -4272,9 +4285,12 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
- E_FREE(e_config->transition_desk);
- e_config->transition_desk = strdup(s);
- SAVE;
+ if (e_theme_transition_find(s))
+ {
+ E_FREE(e_config->transition_desk);
+ e_config->transition_desk = strdup(s);
+ SAVE;
+ }
END_STRING(s);
#elif (TYPE == E_REMOTE_IN)
#endif
@@ -4313,9 +4329,12 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
- E_FREE(e_config->transition_change);
- e_config->transition_change = strdup(s);
- SAVE;
+ if (e_theme_transition_find(s))
+ {
+ E_FREE(e_config->transition_change);
+ e_config->transition_change = strdup(s);
+ SAVE;
+ }
END_STRING(s);
#elif (TYPE == E_REMOTE_IN)
#endif
@@ -4476,6 +4495,7 @@
REQ_2STRING(params[0], params[1], HDL)
#elif (TYPE == E_WM_IN)
STRING2(category, file, e_2str, HDL);
+ /* TODO: Check if category is sane and file exists */
e_theme_config_set(category, file);
SAVE;
END_STRING2(e_2str);
@@ -4799,6 +4819,7 @@
REQ_STRING(params[0], HDL);
#elif (TYPE == E_WM_IN)
STRING(s, HDL);
+ /* TODO: Check if profile exists (or create profile?) */
e_config_save_flush();
e_config_profile_set(s);
e_config_profile_save();
@@ -6230,3 +6251,73 @@
END_INT;
#endif
#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_THEME_CATEGORY_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-theme-category-list", 0, "List all available theme categories", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+ GENERIC(HDL);
+ LIST_DATA();
+ ENCODE(e_theme_category_list(), e_ipc_codec_str_list_enc);
+ SEND_DATA(E_IPC_OP_THEME_CATEGORY_LIST_REPLY);
+ END_GENERIC();
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_THEME_CATEGORY_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ GENERIC(HDL);
+ LIST();
+ DECODE(e_ipc_codec_str_list_dec) {
+ FOR(dat) {
+ printf("REPLY: \"%s\"\n", (char *)(l->data));
+ }
+ FREE_LIST(dat);
+ }
+ END_GENERIC();
+#endif
+#undef HDL
+
+
+/****************************************************************************/
+#define HDL E_IPC_OP_TRANSITION_LIST
+#if (TYPE == E_REMOTE_OPTIONS)
+ OP("-transition-list", 0, "List all available transitions", 1, HDL)
+#elif (TYPE == E_REMOTE_OUT)
+ REQ_NULL(HDL);
+#elif (TYPE == E_WM_IN)
+ GENERIC(HDL);
+ LIST_DATA();
+ ENCODE(e_theme_transition_list(), e_ipc_codec_str_list_enc);
+ SEND_DATA(E_IPC_OP_TRANSITION_LIST_REPLY);
+ END_GENERIC();
+#elif (TYPE == E_REMOTE_IN)
+#endif
+#undef HDL
+
+/****************************************************************************/
+#define HDL E_IPC_OP_TRANSITION_LIST_REPLY
+#if (TYPE == E_REMOTE_OPTIONS)
+#elif (TYPE == E_REMOTE_OUT)
+#elif (TYPE == E_WM_IN)
+#elif (TYPE == E_REMOTE_IN)
+ GENERIC(HDL);
+ LIST();
+ DECODE(e_ipc_codec_str_list_dec) {
+ FOR(dat) {
+ printf("REPLY: \"%s\"\n", (char *)(l->data));
+ }
+ FREE_LIST(dat);
+ }
+ END_GENERIC();
+#endif
+#undef HDL
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_ipc_handlers_list.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- e_ipc_handlers_list.h 27 Sep 2005 22:50:56 -0000 1.29
+++ e_ipc_handlers_list.h 28 Sep 2005 18:57:56 -0000 1.30
@@ -297,3 +297,9 @@
#define E_IPC_OP_WINLIST_LIST_RAISE_WHILE_SELECTING_SET 287
#define E_IPC_OP_WINLIST_LIST_RAISE_WHILE_SELECTING_GET 288
#define E_IPC_OP_WINLIST_LIST_RAISE_WHILE_SELECTING_GET_REPLY 289
+
+#define E_IPC_OP_THEME_CATEGORY_LIST 290
+#define E_IPC_OP_THEME_CATEGORY_LIST_REPLY 291
+
+#define E_IPC_OP_TRANSITION_LIST 292
+#define E_IPC_OP_TRANSITION_LIST_REPLY 293
-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs