Enlightenment CVS committal

Author  : onefang
Project : e_modules
Module  : emu

Dir     : e_modules/emu/src/modules/emu


Modified Files:
        Makefile.am e_mod_config.c e_mod_config.h e_mod_main.c 
        easy_menu.c easy_menu.h 
Added Files:
        .indent.pro border_props.c border_props.h 


Log Message:
Start of parameter substitution in menu actions from border menus.  Also, a
tool to help emu client script writers find out what those substitutions
are likely to be. 

===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- Makefile.am 27 Jan 2006 23:36:40 -0000      1.3
+++ Makefile.am 5 Feb 2006 04:39:40 -0000       1.4
@@ -33,6 +33,8 @@
                          e_mod_main.h \
                         easy_menu.c \
                         easy_menu.h \
+                        border_props.c \
+                        border_props.h \
                          e_mod_config.c \
                          e_mod_config.h
 module_la_LIBADD       = @e_libs@
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_config.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- e_mod_config.c      30 Jan 2006 20:12:03 -0000      1.4
+++ e_mod_config.c      5 Feb 2006 04:39:40 -0000       1.5
@@ -21,17 +21,13 @@
 /* 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 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_View *v;
@@ -52,7 +48,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;
@@ -86,8 +82,7 @@
 }
 
 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;
@@ -143,8 +138,7 @@
 }
 
 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;
@@ -159,14 +153,12 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_label_add(evas, _("Follow Speed"));
    e_widget_framelist_object_append(of, ob);
-   ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0,
-                            &(cfdata->follow_speed), NULL, 200);
+   ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0, 
&(cfdata->follow_speed), NULL, 200);
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
 
    of = e_widget_framelist_add(evas, _("Icon Size"), 0);
-   ob = e_widget_slider_add(evas, 1, 0, _("%3.0f pixels"), 8.0, 128.0, 1.0, 0,
-                            NULL, &(cfdata->iconsize), 200);
+   ob = e_widget_slider_add(evas, 1, 0, _("%3.0f pixels"), 8.0, 128.0, 1.0, 0, 
NULL, &(cfdata->iconsize), 200);
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
 
@@ -175,8 +167,7 @@
    e_widget_framelist_object_append(of, ob);
    ob = e_widget_label_add(evas, _("Autoscroll Speed:"));
    e_widget_framelist_object_append(of, ob);
-   ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0,
-                            &(cfdata->autoscroll_speed), NULL, 200);
+   ob = e_widget_slider_add(evas, 1, 0, _("%1.2f px/s"), 0.0, 1.0, 0.01, 0, 
&(cfdata->autoscroll_speed), NULL, 200);
    e_widget_framelist_object_append(of, ob);
    e_widget_list_object_append(o, of, 1, 1, 0.5);
 
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/e_mod_config.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_mod_config.h      30 Jan 2006 20:12:03 -0000      1.3
+++ e_mod_config.h      5 Feb 2006 04:39:40 -0000       1.4
@@ -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.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_mod_main.c        30 Jan 2006 20:12:03 -0000      1.6
+++ e_mod_main.c        5 Feb 2006 04:39:40 -0000       1.7
@@ -28,30 +28,22 @@
 };
 
 /* 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);
@@ -59,20 +51,17 @@
 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_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 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);
 
 /* 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)
+emu_gadget_face_theme_set(E_Gadget_Face *face, char *category, char *file, 
char *group)
 {
    Evas_Object *o;
    Evas_Coord x, y, w, h;
@@ -160,8 +149,7 @@
                         _
                         ("Experimental generic scriptable module for 
E17.<br><br>"
                          "Keep an eye out for the emu's.<br>"
-                         "Don't even try to run away, they're fast 
buggers.<br>"
-                         "Hiding in your dunny doesn't help, they can kick 
dunnies down."));
+                         "Don't even try to run away, they're fast 
buggers.<br>" "Hiding in your dunny doesn't help, they can kick dunnies 
down."));
    return 1;
 }
 
@@ -197,9 +185,7 @@
         emu->api.data = emu;
         emu->gad = e_gadget_new(&emu->api);
 
-        emu->del =
-           ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _emu_cb_exe_del,
-                                   emu->gad);
+        emu->del = ecore_event_handler_add(ECORE_EXE_EVENT_DEL, 
_emu_cb_exe_del, emu->gad);
 
         if ((emu->gad == NULL) || (emu->del == NULL))
           {
@@ -286,7 +272,7 @@
  * @ingroup Emu_Module_Gadget_Group
  */
 static void
-_emu_face_init(void *data, E_Gadget_Face * face)
+_emu_face_init(void *data, E_Gadget_Face *face)
 {
    Emu *emu;
    Emu_Face *emu_face;
@@ -294,6 +280,7 @@
    emu = data;
 
    emu_face = E_NEW(Emu_Face, 1);
+
    if (emu_face)
      {
         face->data = emu_face;
@@ -305,29 +292,19 @@
         emu_face->command = evas_stringshare_add("emu_client");
         if (emu_face->command)
           {
-             emu_face->add =
-                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);
-             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);
+             emu_face->add = 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);
+             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);
              if (!emu_face->exe)
-                e_module_dialog_show(_("Enlightenment Emu Module - error"),
-                                     _("There is no emu."));
+                e_module_dialog_show(_("Enlightenment Emu Module - error"), 
_("There is no emu."));
           }
      }
 
    if (_emu_module_edje)
-      emu_gadget_face_theme_set(face, "base/theme/modules/emu",
-                                (char *)_emu_module_edje, "emu/main");
+      emu_gadget_face_theme_set(face, "base/theme/modules/emu", (char 
*)_emu_module_edje, "emu/main");
 
-   evas_object_event_callback_add(face->event_obj, EVAS_CALLBACK_MOUSE_DOWN,
-                                  _emu_face_cb_mouse_down, emu_face);
+   evas_object_event_callback_add(face->event_obj, EVAS_CALLBACK_MOUSE_DOWN, 
_emu_face_cb_mouse_down, emu_face);
 }
 
 /**
@@ -340,7 +317,7 @@
  * @ingroup Emu_Module_Gadget_Group
  */
 static void
-_emu_face_menu_init(void *data, E_Gadget_Face * face)
+_emu_face_menu_init(void *data, E_Gadget_Face *face)
 {
    _emu_add_face_menu(face, face->menu);
 }
@@ -357,8 +334,7 @@
  * @ingroup Emu_Module_Gadget_Group
  */
 static void
-_emu_face_change(void *data, E_Gadget_Face * face, E_Gadman_Client *gmc,
-                 E_Gadman_Change change)
+_emu_face_change(void *data, E_Gadget_Face *face, E_Gadman_Client *gmc, 
E_Gadman_Change change)
 {
    printf("change face!\n");
 }
@@ -373,7 +349,7 @@
  * @ingroup Emu_Module_Gadget_Group
  */
 static void
-_emu_face_free(void *data, E_Gadget_Face * face)
+_emu_face_free(void *data, E_Gadget_Face *face)
 {
    Emu *emu;
    Emu_Face *emu_face;
@@ -422,8 +398,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_command(Emu_Face * emu_face, int command, char *name, int start,
-                   int end)
+_emu_parse_command(Emu_Face *emu_face, int command, char *name, int start, int 
end)
 {
    switch (command)
      {
@@ -462,7 +437,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_dropzone(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_dropzone(Emu_Face *emu_face, char *name, int start, int end)
 {
    int i;
 
@@ -488,7 +463,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_icon(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_icon(Emu_Face *emu_face, char *name, int start, int end)
 {
    int i;
 
@@ -514,7 +489,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_dialog(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_dialog(Emu_Face *emu_face, char *name, int start, int end)
 {
    int i;
 
@@ -540,7 +515,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_text(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_text(Emu_Face *emu_face, char *name, int start, int end)
 {
    int i;
 
@@ -566,7 +541,7 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_graph(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_graph(Emu_Face *emu_face, char *name, int start, int end)
 {
    int i;
 
@@ -594,15 +569,13 @@
  * @ingroup Emu_Module_Parser_Group
  */
 static void
-_emu_parse_menu(Emu_Face * emu_face, char *name, int start, int end)
+_emu_parse_menu(Emu_Face *emu_face, char *name, int start, int end)
 {
    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;
+   length = (emu_face->lines[end].line + emu_face->lines[end].size) - 
emu_face->lines[start].line;
 
    if (length > 0)
      {
@@ -622,9 +595,7 @@
           }
 
         /* 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);
+        menu = 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;
@@ -633,14 +604,12 @@
              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);
+                  emu_face->menus = 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);
+             emu_face->menus = evas_hash_direct_add(emu_face->menus, 
menu->category, menu);
           }
      }
 }
@@ -661,7 +630,7 @@
  * @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;
 
@@ -794,8 +763,7 @@
 
              face = l->data;
              emu_face = face->data;
-             if ((emu_face->exe == event->exe)
-                 && (ecore_exe_data_get(event->exe) == emu_face))
+             if ((emu_face->exe == event->exe) && 
(ecore_exe_data_get(event->exe) == emu_face))
                {                /* This is the event we are interested in. */
                   emu_face->exe = NULL;
 
@@ -827,8 +795,7 @@
 
    event = ev;
    emu_face = data;
-   if ((emu_face->exe == event->exe)
-       && (ecore_exe_data_get(event->exe) == emu_face))
+   if ((emu_face->exe == event->exe) && (ecore_exe_data_get(event->exe) == 
emu_face))
      {                          /* This is the event we are interested in. */
         char *data;
 
@@ -845,15 +812,11 @@
 
              /* Find out how many lines there are and make room for the new 
lines. */
              if (emu_face->lines)
-                for (old_size = 0; emu_face->lines[old_size].line != NULL;
-                     old_size++)
+                for (old_size = 0; emu_face->lines[old_size].line != NULL; 
old_size++)
                    ;
              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));
+             emu_face->lines = realloc(emu_face->lines, (old_size + new_size + 
1) * sizeof(Ecore_Exe_Event_Data_Line));
              if (emu_face->lines)
                {
                   int i;
@@ -882,14 +845,11 @@
                          {
                             for (j = 0; _commands[j][0] != '\0'; j++)
                               {
-                                 if (strncasecmp
-                                     (emu_face->lines[i].line, _commands[j],
-                                      strlen(_commands[j])) == 0)
+                                 if (strncasecmp(emu_face->lines[i].line, 
_commands[j], strlen(_commands[j])) == 0)
                                    {    /* Found the beginning of a command. */
                                       unsigned char *s;
 
-                                      s = &(emu_face->lines[i].
-                                            line[strlen(_commands[j])]);
+                                      s = 
&(emu_face->lines[i].line[strlen(_commands[j])]);
                                       if ((s[0] == '\0') || isspace(s[0]))
                                         {       /* Double check that it wasn't 
part of a word. */
                                            if (isspace(s[0]))
@@ -906,8 +866,7 @@
                             if (strcasecmp(emu_face->lines[i].line, "end") == 
0)
                               { /* Found a command. */
                                  if ((i - old_size) > 1)        /* Ignore this 
if there is no data. */
-                                    _emu_parse_command(emu_face, j / 2, name,
-                                                       old_size + 1, i - 1);
+                                    _emu_parse_command(emu_face, j / 2, name, 
old_size + 1, i - 1);
                                  looking = TRUE;
                                  name = NULL;
                                  old_size = i;
@@ -922,17 +881,14 @@
                        /* Remave old data. */
                        for (i = 0; i < old_size; i++)
                           new_size += emu_face->lines[i].size + 1;
-                       memmove(emu_face->data, &data[new_size],
-                               emu_face->size - new_size);
+                       memmove(emu_face->data, &data[new_size], emu_face->size 
- new_size);
                        emu_face->size -= new_size;
                        /* Adjust lines accordingly. */
                        new_size = 0;
                        for (i = old_size; new_size < emu_face->size; i++)
                          {
-                            emu_face->lines[i - old_size].line =
-                               &data[new_size];
-                            emu_face->lines[i - old_size].size =
-                               emu_face->lines[i].size;
+                            emu_face->lines[i - old_size].line = 
&data[new_size];
+                            emu_face->lines[i - old_size].size = 
emu_face->lines[i].size;
                             new_size += emu_face->lines[i].size + 1;
                          }
                        emu_face->lines[i - old_size].line = NULL;
@@ -983,9 +939,7 @@
    if ((ev->button == 3) && emu_face->face->menu)
      {                          /* Right clirk configuration menu. */
         e_menu_activate_mouse(emu_face->face->menu,
-                              e_zone_current_get(emu_face->face->con),
-                              ev->output.x, ev->output.y, 1, 1,
-                              E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
+                              e_zone_current_get(emu_face->face->con), 
ev->output.x, ev->output.y, 1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
         e_util_container_fake_mouse_up_all_later(emu_face->face->con);
      }
    else if (ev->button == 1)
@@ -996,13 +950,9 @@
         menu = evas_hash_find(emu_face->menus, "");
         if (menu && menu->valid)
           {
-             e_menu_post_deactivate_callback_set(menu->menu->menu,
-                                                 _emu_menu_cb_post_deactivate,
-                                                 emu_face);
+             e_menu_post_deactivate_callback_set(menu->menu->menu, 
_emu_menu_cb_post_deactivate, emu_face);
              e_menu_activate_mouse(menu->menu->menu,
-                                   e_zone_current_get(emu_face->face->con),
-                                   ev->output.x, ev->output.y, 1, 1,
-                                   E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
+                                   e_zone_current_get(emu_face->face->con), 
ev->output.x, ev->output.y, 1, 1, E_MENU_POP_DIRECTION_AUTO, ev->timestamp);
              e_util_container_fake_mouse_up_all_later(emu_face->face->con);
              edje_object_signal_emit(emu_face->face->main_obj, "active", "");
           }
@@ -1042,10 +992,47 @@
    if (item->data)
      {
         Ecore_Exe *exe;
+        char *action;
 
         exe = item->data;
-        ecore_exe_send(exe, item->action, strlen(item->action));
-        ecore_exe_send(exe, "\n", 1);
+        action = item->action;
+        if (item->easy_menu->category_data)
+          {
+             /* Check the category, if its border or fileman, do some % subs 
on action. */
+             if ((item->easy_menu->category) && 
(strncmp(item->easy_menu->category, "border", 6) == 0))
+               {
+                  E_Border *bd;
+
+                  bd = item->easy_menu->category_data;
+                  if (strcmp(action, "Properties") == 0)
+                    {
+                       action = NULL;
+                       border_props_dialog(m->zone->container, bd);
+                    }
+                  else
+                    {
+                       /* Do some % subs on action. */
+                    }
+               }
+             else if ((item->easy_menu->category) && 
(strncmp(item->easy_menu->category, "fileman/action", 14) == 0))
+               {
+                  E_Fm_Icon *icon;
+
+                  icon = item->easy_menu->category_data;
+               }
+             else if ((item->easy_menu->category) && 
(strncmp(item->easy_menu->category, "fileman", 7) == 0))
+               {
+                  E_Fm_Smart_Data *sd;
+
+                  sd = item->easy_menu->category_data;
+               }
+          }
+        if ((action) && (action[0] != '\0'))
+          {
+             printf("_emu_menu_cb_action() -> %s\n", action);
+             ecore_exe_send(exe, action, strlen(action));
+             ecore_exe_send(exe, "\n", 1);
+          }
      }
 }
 
@@ -1062,8 +1049,7 @@
  * @ingroup Emu_Module_Menu_Group
  */
 static Evas_Bool
-_emu_menus_hash_cb_free(Evas_Hash * hash, const char *key, void *data,
-                        void *fdata)
+_emu_menus_hash_cb_free(Evas_Hash *hash, const char *key, void *data, void 
*fdata)
 {
    Easy_Menu *menu;
 
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/easy_menu.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- easy_menu.c 30 Jan 2006 20:12:03 -0000      1.4
+++ easy_menu.c 5 Feb 2006 04:39:40 -0000       1.5
@@ -1,14 +1,9 @@
 #include "easy_menu.h"
 
-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);
-static void _easy_menu_menu_cb_create(E_Menu *m, void *category_data,
-                                      void *data);
+static struct _Menu_Data *_easy_menu_add_menus_real(Easy_Menu * easy_menu,
+                                                    char *input, char *end,
+                                                    int *i, int level, void 
(*func) (void *data, 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);
 
@@ -25,9 +20,7 @@
  * @param   data the pointer to your face.
  */
 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)
+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)
 {
    Easy_Menu *menu = NULL;
 
@@ -45,23 +38,16 @@
              if (category == NULL)
                 category = "";
              menu->category = strdup(category);
-             menu->menu =
-                _easy_menu_add_menus_real(menu->buffer, menu->buffer + length,
-                                          &i, 0, func, data);
+             menu->menu = _easy_menu_add_menus_real(menu, menu->buffer, 
menu->buffer + length, &i, 0, func, data);
 
              if (menu->menu)
                {
                   e_object_data_set(E_OBJECT(menu->menu->menu), menu);
-                  e_object_del_attach_func_set(E_OBJECT(menu->menu->menu),
-                                               _easy_menu_menu_cb_free);
+                  e_object_del_attach_func_set(E_OBJECT(menu->menu->menu), 
_easy_menu_menu_cb_free);
 
                   /* 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);
+                     menu->category_cb = 
e_menu_category_callback_add(menu->category, _easy_menu_menu_cb_create, 
_easy_menu_menu_cb_destroy, menu);
 
                   menu->valid = 1;
                }
@@ -74,9 +60,7 @@
 }
 
 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)
+_easy_menu_add_menus_real(Easy_Menu * easy_menu, char *input, char *end, int 
*i, int level, 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));
@@ -109,26 +93,24 @@
              item->name = input;
              item->action = input;
              item->data = data;
+             item->easy_menu = easy_menu;
 
              /* Parse the options. */
-             while ((input < end) && (*input != '|') && (*input != '\0')
-                    && (*input != '\n'))
+             while ((input < end) && (*input != '|') && (*input != '\0') && 
(*input != '\n'))
                 input++;
              if ((input < end) && (*input == '|'))
                {                /* Found an action. */
                   *(input++) = '\0';
                   item->action = input;
                   /* Keep parsing. */
-                  while ((input < end) && (*input != '|') && (*input != '\0')
-                         && (*input != '\n'))
+                  while ((input < end) && (*input != '|') && (*input != '\0') 
&& (*input != '\n'))
                      input++;
                   if ((input < end) && (*input == '|'))
                     {           /* Found an edje. */
                        *(input++) = '\0';
                        item->edje = input;
                        /* Now we are just looking for the end of the edge. */
-                       while ((input < end) && (*input != '\0')
-                              && (*input != '\n'))
+                       while ((input < end) && (*input != '\0') && (*input != 
'\n'))
                           input++;
                     }
                }
@@ -159,8 +141,7 @@
                 last_menu = last_menu->next;
 
              /* A recursing we will go. */
-             last_menu->next =
-                _easy_menu_add_menus_real(input, end, i, level + 1, func, 
data);
+             last_menu->next = _easy_menu_add_menus_real(easy_menu, 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);
@@ -191,7 +172,8 @@
    menu = data;
    if ((menu) && (m) && (menu->valid))
      {
-        /* Since this is created relative to the possed in menu, we need to 
create it each time. */
+        /* Since this is created relative to the passed in menu, we need to 
create it each time. */
+        menu->category_data = category_data;
         menu->item = e_menu_item_new(m);
         if (menu->item)
           {
@@ -216,6 +198,7 @@
    menu = data;
    if (menu)
      {
+        menu->category_data = NULL;
         if (menu->item)
           {
              e_object_del(E_OBJECT(menu->item));
===================================================================
RCS file: /cvsroot/enlightenment/e_modules/emu/src/modules/emu/easy_menu.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- easy_menu.h 30 Jan 2006 20:12:03 -0000      1.4
+++ easy_menu.h 5 Feb 2006 04:39:40 -0000       1.5
@@ -4,6 +4,8 @@
 #define EASY_MENU_H
 #include "e.h"
 
+typedef struct _Easy_Menu Easy_Menu;
+
 struct _Menu_Item_Data
 {
    E_Menu_Item *item;
@@ -12,6 +14,7 @@
    char *edje;                  /* FIXME: make this similar to the 
e_modapi_info() shit. */
    void *data;
    struct _Menu_Item_Data *next;
+   struct _Easy_Menu *easy_menu;
 };
 
 struct _Menu_Data
@@ -23,11 +26,11 @@
    struct _Menu_Item_Data *items;
 };
 
-typedef struct _Easy_Menu Easy_Menu;
 struct _Easy_Menu
 {
    struct _Menu_Data *menu;
    E_Menu_Category_Callback *category_cb;
+   void *category_data;
    char *buffer;
 
    char *name;
@@ -36,11 +39,7 @@
    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
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to