Enlightenment CVS committal
Author : mej
Project : e_modules
Module : emu
Dir : e_modules/emu/src/modules/emu
Modified Files:
e_mod_config.c e_mod_config.h e_mod_main.c e_mod_main.h
easy_menu.c easy_menu.h
Log Message:
Mon Jan 30 15:11:58 2006 Michael Jennings (mej)
Getting emu back in shape.
----------------------------------------------------------------------
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_config.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_config.c 29 Jan 2006 17:53:04 -0000 1.3
+++ e_mod_config.c 30 Jan 2006 20:12:03 -0000 1.4
@@ -2,37 +2,38 @@
typedef struct _Cfg_File_Data Cfg_File_Data;
-struct _E_Config_Dialog_Data {
- int autofit;
- int follower;
- int iconsize;
- int allow_overlap;
- double follow_speed;
- double autoscroll_speed;
+struct _E_Config_Dialog_Data
+{
+ int autofit;
+ int follower;
+ int iconsize;
+ int allow_overlap;
+ double follow_speed;
+ double autoscroll_speed;
};
-struct _Cfg_File_Data {
- E_Config_Dialog *cfd;
- char *file;
+struct _Cfg_File_Data
+{
+ E_Config_Dialog *cfd;
+ char *file;
};
/* Protos */
-static void *_create_data(E_Config_Dialog * cfd);
-static void _free_data(E_Config_Dialog * cfd,
- E_Config_Dialog_Data * cfdata);
-static Evas_Object *_basic_create_widgets(E_Config_Dialog * cfd, Evas * evas,
- E_Config_Dialog_Data * cfdata);
-static int _basic_apply_data(E_Config_Dialog * cfd,
- E_Config_Dialog_Data * cfdata);
-static Evas_Object *_advanced_create_widgets(E_Config_Dialog * cfd, Evas *
evas,
- E_Config_Dialog_Data * cfdata);
-static int _advanced_apply_data(E_Config_Dialog * cfd,
- E_Config_Dialog_Data * cfdata);
+static void *_create_data(E_Config_Dialog *cfd);
+static void _free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
+static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
+ E_Config_Dialog_Data *cfdata);
+static int _basic_apply_data(E_Config_Dialog *cfd,
+ E_Config_Dialog_Data *cfdata);
+static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
+ E_Config_Dialog_Data *cfdata);
+static int _advanced_apply_data(E_Config_Dialog *cfd,
+ E_Config_Dialog_Data *cfdata);
void
-_config_emu_module(E_Container * con, Emu * emu)
+_config_emu_module(E_Container *con, Emu * emu)
{
- E_Config_Dialog *cfd;
+ E_Config_Dialog *cfd;
E_Config_Dialog_View *v;
v = E_NEW(E_Config_Dialog_View, 1);
@@ -51,7 +52,7 @@
}
static void
-_fill_data(Emu * emu, E_Config_Dialog_Data * cfdata)
+_fill_data(Emu * emu, E_Config_Dialog_Data *cfdata)
{
cfdata->autofit = (emu->conf->width == EMU_WIDTH_AUTO);
cfdata->follower = emu->conf->follower;
@@ -61,22 +62,23 @@
cfdata->autoscroll_speed = emu->conf->autoscroll_speed;
}
-static void *
-_create_data(E_Config_Dialog * cfd)
+static void *
+_create_data(E_Config_Dialog *cfd)
{
E_Config_Dialog_Data *cfdata;
- Emu *emu;
+ Emu *emu;
emu = cfd->data;
cfdata = E_NEW(E_Config_Dialog_Data, 1);
+
_fill_data(emu, cfdata);
return cfdata;
}
static void
-_free_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
+_free_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- Emu *emu;
+ Emu *emu;
emu = cfd->data;
emu->config_dialog = NULL;
@@ -84,11 +86,11 @@
}
static Evas_Object *
-_basic_create_widgets(E_Config_Dialog * cfd, Evas * evas,
- E_Config_Dialog_Data * cfdata)
+_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas,
+ E_Config_Dialog_Data *cfdata)
{
- Evas_Object *o, *ob;
- Emu *emu;
+ Evas_Object *o, *ob;
+ Emu *emu;
emu = cfd->data;
_fill_data(emu, cfdata);
@@ -105,9 +107,9 @@
}
static int
-_basic_apply_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
+_basic_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- Emu *emu;
+ Emu *emu;
emu = cfd->data;
e_border_button_bindings_ungrab_all();
@@ -141,11 +143,11 @@
}
static Evas_Object *
-_advanced_create_widgets(E_Config_Dialog * cfd, Evas * evas,
- E_Config_Dialog_Data * cfdata)
+_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas,
+ E_Config_Dialog_Data *cfdata)
{
- Evas_Object *o, *of, *ob;
- Emu *emu;
+ Evas_Object *o, *of, *ob;
+ Emu *emu;
emu = cfd->data;
_fill_data(emu, cfdata);
@@ -187,9 +189,9 @@
}
static int
-_advanced_apply_data(E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
+_advanced_apply_data(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
{
- Emu *emu;
+ Emu *emu;
emu = cfd->data;
e_border_button_bindings_ungrab_all();
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_config.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_mod_config.h 29 Jan 2006 17:53:04 -0000 1.2
+++ e_mod_config.h 30 Jan 2006 20:12:03 -0000 1.3
@@ -3,6 +3,6 @@
#ifndef E_MOD_CONFIG_H
#define E_MOD_CONFIG_H
#include "e_mod_main.h"
-void _config_emu_module(E_Container * con, Emu * emu);
+void _config_emu_module(E_Container *con, Emu * emu);
#endif
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_main.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e_mod_main.c 29 Jan 2006 17:53:04 -0000 1.5
+++ e_mod_main.c 30 Jan 2006 20:12:03 -0000 1.6
@@ -1,10 +1,10 @@
#include "e.h"
#include "e_mod_main.h"
-static const char *_emu_module_edje = NULL;
+static const char *_emu_module_edje = NULL;
/* The emu commands. */
-static char *_commands[] = {
+static char *_commands[] = {
#define EMU_MENU 0
"emu", // Menu
"menu",
@@ -28,58 +28,54 @@
};
/* E_Gadget interface. */
-static void _emu_face_init(void *data, E_Gadget_Face * face);
-static void _emu_face_free(void *data, E_Gadget_Face * face);
-static void _emu_face_change(void *data, E_Gadget_Face * face,
- E_Gadman_Client * gmc,
- E_Gadman_Change change);
-static void _emu_face_menu_init(void *data, E_Gadget_Face * face);
+static void _emu_face_init(void *data, E_Gadget_Face * face);
+static void _emu_face_free(void *data, E_Gadget_Face * face);
+static void _emu_face_change(void *data, E_Gadget_Face * face,
+ E_Gadman_Client *gmc, E_Gadman_Change change);
+static void _emu_face_menu_init(void *data, E_Gadget_Face * face);
/* Parsers. */
-static void _emu_parse_command(Emu_Face * emu_face, int command,
- char *name, int start, int end);
-static void _emu_parse_dropzone(Emu_Face * emu_face, char *name,
- int start, int end);
-static void _emu_parse_icon(Emu_Face * emu_face, char *name, int start,
- int end);
-static void _emu_parse_dialog(Emu_Face * emu_face, char *name,
- int start, int end);
-static void _emu_parse_text(Emu_Face * emu_face, char *name, int start,
- int end);
-static void _emu_parse_graph(Emu_Face * emu_face, char *name, int
start,
- int end);
-static void _emu_parse_menu(Emu_Face * emu_face, char *name, int start,
- int end);
+static void _emu_parse_command(Emu_Face * emu_face, int command,
+ char *name, int start, int end);
+static void _emu_parse_dropzone(Emu_Face * emu_face, char *name,
+ int start, int end);
+static void _emu_parse_icon(Emu_Face * emu_face, char *name, int start,
+ int end);
+static void _emu_parse_dialog(Emu_Face * emu_face, char *name,
+ int start, int end);
+static void _emu_parse_text(Emu_Face * emu_face, char *name, int start,
+ int end);
+static void _emu_parse_graph(Emu_Face * emu_face, char *name, int start,
+ int end);
+static void _emu_parse_menu(Emu_Face * emu_face, char *name, int start,
+ int end);
/* Support functions. */
-static void _emu_add_face_menu(E_Gadget_Face * face, E_Menu * menu);
+static void _emu_add_face_menu(E_Gadget_Face * face, E_Menu *menu);
/* Ecore_Exe callback functions. */
-static int _emu_cb_exe_add(void *data, int type, void *ev);
-static int _emu_cb_exe_del(void *data, int type, void *ev);
-static int _emu_cb_exe_data(void *data, int type, void *ev);
+static int _emu_cb_exe_add(void *data, int type, void *ev);
+static int _emu_cb_exe_del(void *data, int type, void *ev);
+static int _emu_cb_exe_data(void *data, int type, void *ev);
/* Menu callback functions. */
-static void _emu_face_cb_mouse_down(void *data, Evas * e,
- Evas_Object * obj,
- void *event_info);
-static void _emu_menu_cb_post_deactivate(void *data, E_Menu * m);
-
-static void _emu_menu_cb_action(void *data, E_Menu * m,
- E_Menu_Item * mi);
-static Evas_Bool _emu_menus_hash_cb_free(Evas_Hash * hash, const char *key,
- void *data, void *fdata);
+static void _emu_face_cb_mouse_down(void *data, Evas *e,
+ Evas_Object *obj, void *event_info);
+static void _emu_menu_cb_post_deactivate(void *data, E_Menu *m);
+
+static void _emu_menu_cb_action(void *data, E_Menu *m, E_Menu_Item *mi);
+static Evas_Bool _emu_menus_hash_cb_free(Evas_Hash * hash, const char *key,
+ void *data, void *fdata);
-static void _emu_cb_menu_configure(void *data, E_Menu * m,
- E_Menu_Item * mi);
+static void _emu_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi);
/* This is temporary until there is support in E_Gadget for third party
modules. */
void
emu_gadget_face_theme_set(E_Gadget_Face * face, char *category, char *file,
char *group)
{
- Evas_Object *o;
- Evas_Coord x, y, w, h;
+ Evas_Object *o;
+ Evas_Coord x, y, w, h;
if (!face)
return;
@@ -103,7 +99,7 @@
*
* @ingroup Emu_Module_Basic_Group
*/
-E_Module_Api e_modapi = {
+E_Module_Api e_modapi = {
E_MODULE_API_VERSION, /* Minimal API version this module expects. */
"Emu" /* Title of this module, or NULL to just use
the modules name. */
};
@@ -124,9 +120,9 @@
* @ingroup Emu_Module_Basic_Group
*/
EAPI int
-e_modapi_info(E_Module * m)
+e_modapi_info(E_Module *m)
{
- char buf[4096];
+ char buf[4096];
snprintf(buf, sizeof(buf), "%s/module_edje.edj", e_module_dir_get(m));
_emu_module_edje = evas_stringshare_add(buf);
@@ -156,7 +152,7 @@
* @ingroup Emu_Module_Basic_Group
*/
EAPI int
-e_modapi_about(E_Module * m)
+e_modapi_about(E_Module *m)
{
/* This is a basic module dialog that is provided for simplicity,
* but there is probably nothing stopping you from making a complex dialog.
*/
@@ -178,10 +174,10 @@
* @return This becomes m->data, return NULL if this falied, and you won't
get enabled.
* @ingroup Emu_Module_Basic_Group
*/
-EAPI void *
-e_modapi_init(E_Module * m)
+EAPI void *
+e_modapi_init(E_Module *m)
{
- Emu *emu;
+ Emu *emu;
emu = E_NEW(Emu, 1);
@@ -202,8 +198,8 @@
emu->gad = e_gadget_new(&emu->api);
emu->del =
- ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _emu_cb_exe_del,
- emu->gad);
+ ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _emu_cb_exe_del,
+ emu->gad);
if ((emu->gad == NULL) || (emu->del == NULL))
{
@@ -225,9 +221,9 @@
* @ingroup Emu_Module_Basic_Group
*/
EAPI int
-e_modapi_save(E_Module * m)
+e_modapi_save(E_Module *m)
{
- Emu *emu;
+ Emu *emu;
emu = m->data;
@@ -250,9 +246,9 @@
* @ingroup Emu_Module_Basic_Group
*/
EAPI int
-e_modapi_shutdown(E_Module * m)
+e_modapi_shutdown(E_Module *m)
{
- Emu *emu;
+ Emu *emu;
emu = m->data;
@@ -292,8 +288,8 @@
static void
_emu_face_init(void *data, E_Gadget_Face * face)
{
- Emu *emu;
- Emu_Face *emu_face;
+ Emu *emu;
+ Emu_Face *emu_face;
emu = data;
@@ -310,16 +306,16 @@
if (emu_face->command)
{
emu_face->add =
- ecore_event_handler_add(ECORE_EXE_EVENT_ADD, _emu_cb_exe_add,
- emu_face);
+ ecore_event_handler_add(ECORE_EXE_EVENT_ADD, _emu_cb_exe_add,
+ emu_face);
emu_face->read =
- ecore_event_handler_add(ECORE_EXE_EVENT_DATA,
_emu_cb_exe_data,
- emu_face);
+ ecore_event_handler_add(ECORE_EXE_EVENT_DATA, _emu_cb_exe_data,
+ emu_face);
emu_face->exe =
- ecore_exe_pipe_run(emu_face->command,
- ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE
|
- ECORE_EXE_PIPE_READ_LINE_BUFFERED
- /*| ECORE_EXE_RESPAWN */ , emu_face);
+ ecore_exe_pipe_run(emu_face->command,
+ ECORE_EXE_PIPE_READ | ECORE_EXE_PIPE_WRITE |
+ ECORE_EXE_PIPE_READ_LINE_BUFFERED
+ /*| ECORE_EXE_RESPAWN */ , emu_face);
if (!emu_face->exe)
e_module_dialog_show(_("Enlightenment Emu Module - error"),
_("There is no emu."));
@@ -361,7 +357,7 @@
* @ingroup Emu_Module_Gadget_Group
*/
static void
-_emu_face_change(void *data, E_Gadget_Face * face, E_Gadman_Client * gmc,
+_emu_face_change(void *data, E_Gadget_Face * face, E_Gadman_Client *gmc,
E_Gadman_Change change)
{
printf("change face!\n");
@@ -379,8 +375,8 @@
static void
_emu_face_free(void *data, E_Gadget_Face * face)
{
- Emu *emu;
- Emu_Face *emu_face;
+ Emu *emu;
+ Emu_Face *emu_face;
emu = data;
emu_face = face->data;
@@ -431,24 +427,24 @@
{
switch (command)
{
- case EMU_MENU:
- _emu_parse_menu(emu_face, name, start, end);
- break; // Menu
- case EMU_DROPZONE:
- _emu_parse_dropzone(emu_face, name, start, end);
- break; // DND drop zone
- case EMU_ICON:
- _emu_parse_icon(emu_face, name, start, end);
- break; // Icon
- case EMU_DIALOG:
- _emu_parse_dialog(emu_face, name, start, end);
- break; // Basic dialogs
- case EMU_TEXT:
- _emu_parse_text(emu_face, name, start, end);
- break; // Text
- case EMU_GRAPH:
- _emu_parse_graph(emu_face, name, start, end);
- break; // Graph
+ case EMU_MENU:
+ _emu_parse_menu(emu_face, name, start, end);
+ break; // Menu
+ case EMU_DROPZONE:
+ _emu_parse_dropzone(emu_face, name, start, end);
+ break; // DND drop zone
+ case EMU_ICON:
+ _emu_parse_icon(emu_face, name, start, end);
+ break; // Icon
+ case EMU_DIALOG:
+ _emu_parse_dialog(emu_face, name, start, end);
+ break; // Basic dialogs
+ case EMU_TEXT:
+ _emu_parse_text(emu_face, name, start, end);
+ break; // Text
+ case EMU_GRAPH:
+ _emu_parse_graph(emu_face, name, start, end);
+ break; // Graph
}
}
@@ -468,7 +464,7 @@
static void
_emu_parse_dropzone(Emu_Face * emu_face, char *name, int start, int end)
{
- int i;
+ int i;
for (i = start; i <= end; i++)
{
@@ -494,7 +490,7 @@
static void
_emu_parse_icon(Emu_Face * emu_face, char *name, int start, int end)
{
- int i;
+ int i;
for (i = start; i <= end; i++)
{
@@ -520,7 +516,7 @@
static void
_emu_parse_dialog(Emu_Face * emu_face, char *name, int start, int end)
{
- int i;
+ int i;
for (i = start; i <= end; i++)
{
@@ -546,7 +542,7 @@
static void
_emu_parse_text(Emu_Face * emu_face, char *name, int start, int end)
{
- int i;
+ int i;
for (i = start; i <= end; i++)
{
@@ -572,7 +568,7 @@
static void
_emu_parse_graph(Emu_Face * emu_face, char *name, int start, int end)
{
- int i;
+ int i;
for (i = start; i <= end; i++)
{
@@ -600,17 +596,17 @@
static void
_emu_parse_menu(Emu_Face * emu_face, char *name, int start, int end)
{
- char *category = NULL;
- int length;
+ char *category = NULL;
+ int length;
/* Calculate the length of the menu data. */
length =
- (emu_face->lines[end].line + emu_face->lines[end].size) -
- emu_face->lines[start].line;
+ (emu_face->lines[end].line + emu_face->lines[end].size) -
+ emu_face->lines[start].line;
if (length > 0)
{
- Easy_Menu *menu;
+ Easy_Menu *menu;
if (name == NULL) /* Default sub menu item text is the name of
the face. */
name = (char *)emu_face->name;
@@ -627,24 +623,24 @@
/* Turn the command data into a menu. */
menu =
- easy_menu_add_menus(name, category, emu_face->lines[start].line,
- length, _emu_menu_cb_action, emu_face->exe);
+ easy_menu_add_menus(name, category, emu_face->lines[start].line,
+ length, _emu_menu_cb_action, emu_face->exe);
if (menu)
{
- Easy_Menu *old_menu;
+ Easy_Menu *old_menu;
/* Associate this menu with it's category. Only one menu per
category. */
old_menu = evas_hash_find(emu_face->menus, menu->category);
if (old_menu)
{ /* Clean up the old one. */
emu_face->menus =
- evas_hash_del(emu_face->menus, menu->category, old_menu);
+ evas_hash_del(emu_face->menus, menu->category, old_menu);
emu_face->menus = evas_hash_del(emu_face->menus, NULL,
old_menu); /* Just to be on the safe side. */
e_object_del(E_OBJECT(old_menu->menu->menu));
}
/* evas_hash_direct_add is used because we allocate the key
ourselves and don't deallocate it until after removing it. */
emu_face->menus =
- evas_hash_direct_add(emu_face->menus, menu->category, menu);
+ evas_hash_direct_add(emu_face->menus, menu->category, menu);
}
}
}
@@ -665,9 +661,9 @@
* @ingroup Emu_Module_Support_Group
*/
static void
-_emu_add_face_menu(E_Gadget_Face * face, E_Menu * menu)
+_emu_add_face_menu(E_Gadget_Face * face, E_Menu *menu)
{
- E_Menu_Item *mi;
+ E_Menu_Item *mi;
mi = e_menu_item_new(menu);
e_menu_item_label_set(mi, _("Configuration"));
@@ -725,10 +721,10 @@
}
static void
-_emu_cb_menu_configure(void *data, E_Menu * m, E_Menu_Item * mi)
+_emu_cb_menu_configure(void *data, E_Menu *m, E_Menu_Item *mi)
{
- E_Gadget_Face *face;
- Emu_Face *emu_face;
+ E_Gadget_Face *face;
+ Emu_Face *emu_face;
face = data;
if (!face)
@@ -761,7 +757,7 @@
static int
_emu_cb_exe_add(void *data, int type, void *ev)
{
- Emu *emu;
+ Emu *emu;
emu = data;
@@ -785,16 +781,16 @@
{
if (E_OBJECT(data)->type == (E_GADGET_TYPE))
{
- E_Gadget *gad;
+ E_Gadget *gad;
Ecore_Exe_Event_Del *event;
- Evas_List *l;
+ Evas_List *l;
gad = data;
event = ev;
for (l = gad->faces; l; l = l->next) /* Search for the matching
face. */
{
- E_Gadget_Face *face;
- Emu_Face *emu_face;
+ E_Gadget_Face *face;
+ Emu_Face *emu_face;
face = l->data;
emu_face = face->data;
@@ -827,14 +823,14 @@
_emu_cb_exe_data(void *data, int type, void *ev)
{
Ecore_Exe_Event_Data *event;
- Emu_Face *emu_face;
+ Emu_Face *emu_face;
event = ev;
emu_face = data;
if ((emu_face->exe == event->exe)
&& (ecore_exe_data_get(event->exe) == emu_face))
{ /* This is the event we are interested in. */
- char *data;
+ char *data;
/* Copy new data to the end of the old data. */
emu_face->data = realloc(emu_face->data, emu_face->size + event->size);
@@ -844,8 +840,8 @@
if (event->lines)
{
- int old_size = 0;
- int new_size;
+ int old_size = 0;
+ int new_size;
/* Find out how many lines there are and make room for the new
lines. */
if (emu_face->lines)
@@ -855,14 +851,14 @@
for (new_size = 0; event->lines[new_size].line != NULL;
new_size++)
;
emu_face->lines =
- realloc(emu_face->lines,
- (old_size + new_size +
- 1) * sizeof(Ecore_Exe_Event_Data_Line));
+ realloc(emu_face->lines,
+ (old_size + new_size +
+ 1) * sizeof(Ecore_Exe_Event_Data_Line));
if (emu_face->lines)
{
- int i;
- int looking = TRUE;
- char *name = NULL;
+ int i;
+ int looking = TRUE;
+ char *name = NULL;
/* Copy the new sizes to the end. */
for (i = 0; event->lines[i].line != NULL; i++)
@@ -876,7 +872,7 @@
/* Scan through all the lines. */
for (i = 0; new_size < emu_face->size; i++)
{
- int j;
+ int j;
/* Create new line pointer. */
emu_face->lines[i].line = &data[new_size];
@@ -890,7 +886,7 @@
(emu_face->lines[i].line, _commands[j],
strlen(_commands[j])) == 0)
{ /* Found the beginning of a command. */
- unsigned char *s;
+ unsigned char *s;
s = &(emu_face->lines[i].
line[strlen(_commands[j])]);
@@ -934,9 +930,9 @@
for (i = old_size; new_size < emu_face->size; i++)
{
emu_face->lines[i - old_size].line =
- &data[new_size];
+ &data[new_size];
emu_face->lines[i - old_size].size =
- emu_face->lines[i].size;
+ emu_face->lines[i].size;
new_size += emu_face->lines[i].size + 1;
}
emu_face->lines[i - old_size].line = NULL;
@@ -977,10 +973,9 @@
* @ingroup Emu_Module_Menu_Group
*/
static void
-_emu_face_cb_mouse_down(void *data, Evas * e, Evas_Object * obj,
- void *event_info)
+_emu_face_cb_mouse_down(void *data, Evas *e, Evas_Object *obj, void
*event_info)
{
- Emu_Face *emu_face;
+ Emu_Face *emu_face;
Evas_Event_Mouse_Down *ev;
emu_face = data;
@@ -995,7 +990,7 @@
}
else if (ev->button == 1)
{ /* Left click default menu. */
- Easy_Menu *menu;
+ Easy_Menu *menu;
/* Find the default menu, if there is one. */
menu = evas_hash_find(emu_face->menus, "");
@@ -1022,9 +1017,9 @@
* @ingroup Emu_Module_Menu_Group
*/
static void
-_emu_menu_cb_post_deactivate(void *data, E_Menu * m)
+_emu_menu_cb_post_deactivate(void *data, E_Menu *m)
{
- Emu_Face *emu_face;
+ Emu_Face *emu_face;
emu_face = data;
edje_object_signal_emit(emu_face->face->main_obj, "passive", "");
@@ -1039,14 +1034,14 @@
* @ingroup Emu_Module_Menu_Group
*/
static void
-_emu_menu_cb_action(void *data, E_Menu * m, E_Menu_Item * mi)
+_emu_menu_cb_action(void *data, E_Menu *m, E_Menu_Item *mi)
{
struct _Menu_Item_Data *item;
item = data;
if (item->data)
{
- Ecore_Exe *exe;
+ Ecore_Exe *exe;
exe = item->data;
ecore_exe_send(exe, item->action, strlen(item->action));
@@ -1066,11 +1061,11 @@
* @param fdata unused.
* @ingroup Emu_Module_Menu_Group
*/
-static Evas_Bool
+static Evas_Bool
_emu_menus_hash_cb_free(Evas_Hash * hash, const char *key, void *data,
void *fdata)
{
- Easy_Menu *menu;
+ Easy_Menu *menu;
menu = data;
if ((menu) && (menu->menu) && (menu->menu->menu))
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_main.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_main.h 29 Jan 2006 17:53:04 -0000 1.4
+++ e_mod_main.h 30 Jan 2006 20:12:03 -0000 1.5
@@ -12,63 +12,67 @@
#define EMU_WIDTH_AUTO -1
#define EMU_WIDTH_FIXED -2
-struct _Config {
- char *appdir;
- int follower;
- double follow_speed;
- double autoscroll_speed;
- int iconsize;
- int width;
- int allow_overlap;
- Evas_List *emus;
+struct _Config
+{
+ char *appdir;
+ int follower;
+ double follow_speed;
+ double autoscroll_speed;
+ int iconsize;
+ int width;
+ int allow_overlap;
+ Evas_List *emus;
};
-struct _Config_Emu {
- unsigned char enabled;
+struct _Config_Emu
+{
+ unsigned char enabled;
};
typedef struct _Emu Emu;
-struct _Emu {
- E_Gadget_Api api;
- E_Gadget *gad;
+struct _Emu
+{
+ E_Gadget_Api api;
+ E_Gadget *gad;
Ecore_Event_Handler *del;
// Evas_List *bars;
- E_Menu *config_menu;
+ E_Menu *config_menu;
- Config *conf;
- E_Config_Dialog *config_dialog;
+ Config *conf;
+ E_Config_Dialog *config_dialog;
};
typedef struct _Emu_Face Emu_Face;
-struct _Emu_Face {
- Emu *emu;
- E_Gadget_Face *face;
-
- const char *name;
- const char *command;
- Ecore_Exe *exe;
+struct _Emu_Face
+{
+ Emu *emu;
+ E_Gadget_Face *face;
+
+ const char *name;
+ const char *command;
+ Ecore_Exe *exe;
Ecore_Event_Handler *add;
Ecore_Event_Handler *read;
- void *data;
+ void *data;
/**< the raw binary data from the child process that was
recieved */
- int size;
+ int size;
/**< the size of this data in bytes */
Ecore_Exe_Event_Data_Line *lines; /**< a NULL terminated array of line data
if line buffered */
- Evas_Hash *menus;
+ Evas_Hash *menus;
};
EAPI extern E_Module_Api e_modapi;
-EAPI void *e_modapi_init(E_Module * m);
-EAPI int e_modapi_shutdown(E_Module * m);
-EAPI int e_modapi_save(E_Module * m);
-EAPI int e_modapi_info(E_Module * m);
-EAPI int e_modapi_about(E_Module * m);
+EAPI void *e_modapi_init(E_Module *m);
+EAPI int e_modapi_shutdown(E_Module *m);
+EAPI int e_modapi_save(E_Module *m);
+EAPI int e_modapi_info(E_Module *m);
+EAPI int e_modapi_about(E_Module *m);
-void _emu_cb_config_updated(void *data);
+void _emu_cb_config_updated(void *data);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/easy_menu.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- easy_menu.c 29 Jan 2006 17:53:04 -0000 1.3
+++ easy_menu.c 30 Jan 2006 20:12:03 -0000 1.4
@@ -3,14 +3,14 @@
static struct _Menu_Data *_easy_menu_add_menus_real(char *input, char *end,
int *i, int level,
void (*func) (void *data,
- E_Menu * m,
- E_Menu_Item *
- mi),
+ E_Menu *m,
+ E_Menu_Item
+ *mi),
void *data);
-static void _easy_menu_menu_cb_create(E_Menu * m, void *category_data,
- void *data);
-static void _easy_menu_menu_cb_destroy(void *data);
-static void _easy_menu_menu_cb_free(void *obj);
+static void _easy_menu_menu_cb_create(E_Menu *m, void *category_data,
+ void *data);
+static void _easy_menu_menu_cb_destroy(void *data);
+static void _easy_menu_menu_cb_free(void *obj);
/**
* Construct a menu.
@@ -24,12 +24,12 @@
* @param func the pointer to your face.
* @param data the pointer to your face.
*/
-EAPI Easy_Menu *
+EAPI Easy_Menu *
easy_menu_add_menus(char *name, char *category, char *input, int length,
- void (*func) (void *data, E_Menu * m, E_Menu_Item * mi),
+ void (*func) (void *data, E_Menu *m, E_Menu_Item *mi),
void *data)
{
- Easy_Menu *menu = NULL;
+ Easy_Menu *menu = NULL;
menu = E_NEW(Easy_Menu, 1);
if (menu)
@@ -38,7 +38,7 @@
if (menu->buffer)
{
- int i = 0;
+ int i = 0;
memcpy(menu->buffer, input, length);
menu->name = strdup(name);
@@ -46,8 +46,8 @@
category = "";
menu->category = strdup(category);
menu->menu =
- _easy_menu_add_menus_real(menu->buffer, menu->buffer + length,
- &i, 0, func, data);
+ _easy_menu_add_menus_real(menu->buffer, menu->buffer + length,
+ &i, 0, func, data);
if (menu->menu)
{
@@ -58,10 +58,10 @@
/* A category that is an empty string, is handled by the
caller. */
if (strlen(menu->category) != 0)
menu->category_cb =
- e_menu_category_callback_add(menu->category,
-
_easy_menu_menu_cb_create,
-
_easy_menu_menu_cb_destroy,
- menu);
+ e_menu_category_callback_add(menu->category,
+ _easy_menu_menu_cb_create,
+
_easy_menu_menu_cb_destroy,
+ menu);
menu->valid = 1;
}
@@ -75,17 +75,17 @@
static struct _Menu_Data *
_easy_menu_add_menus_real(char *input, char *end, int *i, int level,
- void (*func) (void *data, E_Menu * m,
- E_Menu_Item * mi), void *data)
+ void (*func) (void *data, E_Menu *m,
+ E_Menu_Item *mi), void *data)
{
- char *oldInput = input;
- struct _Menu_Data *menu = calloc(1, sizeof(struct _Menu_Data));
+ char *oldInput = input;
+ struct _Menu_Data *menu = calloc(1, sizeof(struct _Menu_Data));
struct _Menu_Item_Data *item = NULL;
menu->menu = e_menu_new();
while (input < end)
{
- int count = 0;
+ int count = 0;
/* Skip spaces, but count them so we know what level this line is at.
*/
while (*(input + count) == ' ')
@@ -152,7 +152,7 @@
}
else if (count > level)
{ /* We have to add a sub menu here. */
- struct _Menu_Data *last_menu = menu;
+ struct _Menu_Data *last_menu = menu;
/* Seek out the end of the list, so we can add onto it. */
while (last_menu->next != NULL)
@@ -160,8 +160,7 @@
/* A recursing we will go. */
last_menu->next =
- _easy_menu_add_menus_real(input, end, i, level + 1, func,
- data);
+ _easy_menu_add_menus_real(input, end, i, level + 1, func,
data);
e_menu_item_submenu_set(item->item, last_menu->next->menu);
/* The recursion completed this much parsing for us, catch up. */
input = input + (*i);
@@ -185,9 +184,9 @@
* @ingroup Easy_Menu_Module_Menu_Group
*/
void
-_easy_menu_menu_cb_create(E_Menu * m, void *category_data, void *data)
+_easy_menu_menu_cb_create(E_Menu *m, void *category_data, void *data)
{
- Easy_Menu *menu;
+ Easy_Menu *menu;
menu = data;
if ((menu) && (m) && (menu->valid))
@@ -212,7 +211,7 @@
static void
_easy_menu_menu_cb_destroy(void *data)
{
- Easy_Menu *menu;
+ Easy_Menu *menu;
menu = data;
if (menu)
@@ -234,12 +233,12 @@
static void
_easy_menu_menu_cb_free(void *obj)
{
- Easy_Menu *menu;
+ Easy_Menu *menu;
menu = e_object_data_get(E_OBJECT(obj));
if (menu)
{
- int first = TRUE;
+ int first = TRUE;
menu->valid = 0; /* TO be on the safe side. */
@@ -256,8 +255,8 @@
/* Go through the attached menu structure, freeing it all. */
if (menu->menu)
{
- struct _Menu_Data *next = NULL;
- struct _Menu_Data *men;
+ struct _Menu_Data *next = NULL;
+ struct _Menu_Data *men;
men = menu->menu;
while (men != NULL)
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/easy_menu.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- easy_menu.h 29 Jan 2006 17:53:04 -0000 1.3
+++ easy_menu.h 30 Jan 2006 20:12:03 -0000 1.4
@@ -4,41 +4,43 @@
#define EASY_MENU_H
#include "e.h"
-struct _Menu_Item_Data {
- E_Menu_Item *item;
- char *name;
- char *action;
- char *edje; /* FIXME: make this similar to the
e_modapi_info() shit. */
- void *data;
+struct _Menu_Item_Data
+{
+ E_Menu_Item *item;
+ char *name;
+ char *action;
+ char *edje; /* FIXME: make this similar to the
e_modapi_info() shit. */
+ void *data;
struct _Menu_Item_Data *next;
};
-struct _Menu_Data {
- E_Menu *menu;
- int level;
- char *name;
- struct _Menu_Data *next;
+struct _Menu_Data
+{
+ E_Menu *menu;
+ int level;
+ char *name;
+ struct _Menu_Data *next;
struct _Menu_Item_Data *items;
};
typedef struct _Easy_Menu Easy_Menu;
-struct _Easy_Menu {
- struct _Menu_Data *menu;
+struct _Easy_Menu
+{
+ struct _Menu_Data *menu;
E_Menu_Category_Callback *category_cb;
- char *buffer;
+ char *buffer;
- char *name;
- char *category;
- E_Menu_Item *item;
- int valid; /* Probably just being paranoid. This
prevents this structure from being used when it isn't complete. */
+ char *name;
+ char *category;
+ E_Menu_Item *item;
+ int valid; /* Probably just being paranoid. This
prevents this structure from being used when it isn't complete. */
};
-EAPI Easy_Menu *easy_menu_add_menus(char *name, char *category, char
*input,
- int length, void (*func) (void *data,
- E_Menu * m,
- E_Menu_Item *
- mi),
- void *data);
+EAPI Easy_Menu *easy_menu_add_menus(char *name, char *category, char *input,
+ int length, void (*func) (void *data,
+ E_Menu *m,
+ E_Menu_Item *mi),
+ void *data);
#endif
#endif
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs