Enlightenment CVS committal
Author : devilhorns
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_toolbar.h e_toolbar.c
Log Message:
Add callback signals for efm modules. Almost ready for primetime :)
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_toolbar.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_toolbar.h 9 Nov 2007 23:12:13 -0000 1.3
+++ e_toolbar.h 11 Nov 2007 15:46:06 -0000 1.4
@@ -26,18 +26,20 @@
Evas_Object *o_base, *o_event;
};
-EAPI int e_toolbar_init (void);
-EAPI int e_toolbar_shutdown (void);
-EAPI E_Toolbar *e_toolbar_new (Evas *evas, const char *name, E_Win
*fwin, Evas_Object *fm2);
-EAPI void e_toolbar_fwin_set (E_Toolbar *tbar, E_Win *fwin);
-EAPI void e_toolbar_fm2_set (E_Toolbar *tbar, Evas_Object *fm2);
-EAPI void e_toolbar_show (E_Toolbar *tbar);
-EAPI void e_toolbar_move (E_Toolbar *tbar, int x, int y);
-EAPI void e_toolbar_resize (E_Toolbar *tbar, int w, int h);
-EAPI void e_toolbar_move_resize (E_Toolbar *tbar, int x, int y, int w,
int h);
-EAPI void e_toolbar_orient (E_Toolbar *tbar, E_Gadcon_Orient
orient);
-EAPI void e_toolbar_position_calc (E_Toolbar *tbar);
-EAPI void e_toolbar_populate (E_Toolbar *tbar);
+EAPI int e_toolbar_init (void);
+EAPI int e_toolbar_shutdown (void);
+EAPI E_Toolbar *e_toolbar_new (Evas *evas, const char *name, E_Win
*fwin, Evas_Object *fm2);
+EAPI void e_toolbar_fwin_set (E_Toolbar *tbar, E_Win *fwin);
+EAPI E_Win *e_toolbar_fwin_get (E_Toolbar *tbar);
+EAPI void e_toolbar_fm2_set (E_Toolbar *tbar, Evas_Object *fm2);
+EAPI Evas_Object *e_toolbar_fm2_get (E_Toolbar *tbar);
+EAPI void e_toolbar_show (E_Toolbar *tbar);
+EAPI void e_toolbar_move (E_Toolbar *tbar, int x, int y);
+EAPI void e_toolbar_resize (E_Toolbar *tbar, int w, int h);
+EAPI void e_toolbar_move_resize (E_Toolbar *tbar, int x, int y, int
w, int h);
+EAPI void e_toolbar_orient (E_Toolbar *tbar, E_Gadcon_Orient
orient);
+EAPI void e_toolbar_position_calc (E_Toolbar *tbar);
+EAPI void e_toolbar_populate (E_Toolbar *tbar);
#endif
#endif
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_toolbar.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_toolbar.c 9 Nov 2007 23:53:38 -0000 1.6
+++ e_toolbar.c 11 Nov 2007 15:46:06 -0000 1.7
@@ -12,6 +12,12 @@
static void _e_toolbar_menu_cb_contents(void *data, E_Menu *mn, E_Menu_Item
*mi);
static void _e_toolbar_gadcon_size_request(void *data, E_Gadcon *gc,
Evas_Coord w, Evas_Coord h);
static const char *_e_toolbar_orient_string_get(E_Toolbar *tbar);
+static void _e_toolbar_fm2_changed(void *data, Evas_Object *obj, void
*event_info);
+static void _e_toolbar_fm2_dir_changed(void *data, Evas_Object *obj, void
*event_info);
+static void _e_toolbar_fm2_dir_deleted(void *data, Evas_Object *obj, void
*event_info);
+static void _e_toolbar_fm2_files_deleted(void *data, Evas_Object *obj, void
*event_info);
+static void _e_toolbar_fm2_selected(void *data, Evas_Object *obj, void
*event_info);
+static void _e_toolbar_fm2_selection_changed(void *data, Evas_Object *obj,
void *event_info);
/* local vars */
static Evas_List *toolbars = NULL;
@@ -55,6 +61,19 @@
tbar->fwin = fwin;
tbar->fm2 = fm2;
+ evas_object_smart_callback_add(tbar->fm2, "changed",
+ _e_toolbar_fm2_changed, tbar);
+ evas_object_smart_callback_add(tbar->fm2, "dir_changed",
+ _e_toolbar_fm2_dir_changed, tbar);
+ evas_object_smart_callback_add(tbar->fm2, "dir_deleted",
+ _e_toolbar_fm2_dir_deleted, tbar);
+ evas_object_smart_callback_add(tbar->fm2, "files_deleted",
+ _e_toolbar_fm2_files_deleted, tbar);
+ evas_object_smart_callback_add(tbar->fm2, "selected",
+ _e_toolbar_fm2_selected, tbar);
+ evas_object_smart_callback_add(tbar->fm2, "selection_change",
+ _e_toolbar_fm2_selection_changed, tbar);
+
tbar->o_event = evas_object_rectangle_add(evas);
evas_object_color_set(tbar->o_event, 0, 0, 0, 0);
evas_object_resize(tbar->o_event, tbar->w, tbar->h);
@@ -94,6 +113,14 @@
tbar->fwin = fwin;
}
+EAPI E_Win *
+e_toolbar_fwin_get(E_Toolbar *tbar)
+{
+ E_OBJECT_CHECK_RETURN(tbar, NULL);
+ E_OBJECT_TYPE_CHECK_RETURN(tbar, E_TOOLBAR_TYPE, NULL);
+ return tbar->fwin;
+}
+
EAPI void
e_toolbar_fm2_set(E_Toolbar *tbar, Evas_Object *fm2)
{
@@ -102,6 +129,14 @@
tbar->fm2 = fm2;
}
+EAPI Evas_Object *
+e_toolbar_fm2_get(E_Toolbar *tbar)
+{
+ E_OBJECT_CHECK_RETURN(tbar, NULL);
+ E_OBJECT_TYPE_CHECK_RETURN(tbar, E_TOOLBAR_TYPE, NULL);
+ return tbar->fm2;
+}
+
EAPI void
e_toolbar_show(E_Toolbar *tbar)
{
@@ -152,7 +187,7 @@
e_toolbar_orient(E_Toolbar *tbar, E_Gadcon_Orient orient)
{
char buf[4096];
-
+
E_OBJECT_CHECK(tbar);
E_OBJECT_TYPE_CHECK(tbar, E_TOOLBAR_TYPE);
e_gadcon_orient(tbar->gadcon, orient);
@@ -465,4 +500,112 @@
break;
}
return sig;
+}
+
+static void
+_e_toolbar_fm2_changed(void *data, Evas_Object *obj, void *event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "changed", tbar);
+ }
+}
+
+static void
+_e_toolbar_fm2_dir_changed(void *data, Evas_Object *obj, void *event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "dir_changed", tbar);
+ }
+}
+
+static void
+_e_toolbar_fm2_dir_deleted(void *data, Evas_Object *obj, void *event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "dir_deleted", tbar);
+ }
+}
+
+static void
+_e_toolbar_fm2_files_deleted(void *data, Evas_Object *obj, void *event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "files_deleted", tbar);
+ }
+}
+
+static void
+_e_toolbar_fm2_selected(void *data, Evas_Object *obj, void *event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "selected", tbar);
+ }
+}
+
+static void
+_e_toolbar_fm2_selection_changed(void *data, Evas_Object *obj, void
*event_info)
+{
+ E_Toolbar *tbar;
+ Evas_List *l = NULL;
+
+ tbar = data;
+ if (!tbar) return;
+ for (l = tbar->gadcon->clients; l; l = l->next)
+ {
+ E_Gadcon_Client *gcc = NULL;
+
+ gcc = l->data;
+ if (!gcc) continue;
+ evas_object_smart_callback_call(gcc->o_base, "selection_changed", tbar);
+ }
}
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs