Enlightenment CVS committal Author : devilhorns Project : e17 Module : apps/e
Dir : e17/apps/e/src/bin Modified Files: e_toolbar.c Log Message: Populate the toolbar when it gets created. Added start of orientation support. =================================================================== RCS file: /cvs/e/e17/apps/e/src/bin/e_toolbar.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- e_toolbar.c 4 Nov 2007 21:40:39 -0000 1.2 +++ e_toolbar.c 9 Nov 2007 20:43:54 -0000 1.3 @@ -11,6 +11,7 @@ static void _e_toolbar_menu_cb_config(void *data, E_Menu *mn, E_Menu_Item *mi); 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); /* local vars */ static Evas_List *toolbars = NULL; @@ -38,6 +39,7 @@ e_toolbar_new(Evas *evas, const char *name) { E_Toolbar *tbar = NULL; + char buf[4096]; if (!name) return NULL; @@ -65,11 +67,15 @@ tbar->gadcon = e_gadcon_swallowed_new(tbar->name, tbar->id, tbar->o_base, "e.swallow.content"); e_gadcon_size_request_callback_set(tbar->gadcon, _e_toolbar_gadcon_size_request, tbar); /* FIXME: We want to implement "styles" here ? */ - + + snprintf(buf, sizeof(buf), "e,state,orientation,%s", + _e_toolbar_orient_string_get(tbar)); e_gadcon_orient(tbar->gadcon, E_GADCON_ORIENT_TOP); - /* TODO: Send signals to theme obj */ + edje_object_signal_emit(tbar->o_base, buf, "e"); + edje_object_message_signal_process(tbar->o_base); e_gadcon_toolbar_set(tbar->gadcon, tbar); + e_gadcon_populate(tbar->gadcon); toolbars = evas_list_append(toolbars, tbar); return tbar; @@ -270,9 +276,7 @@ E_Toolbar *tbar; tbar = data; -#if 0 if (!tbar->gadcon->config_dialog) e_int_gadcon_config(tbar->gadcon); -#endif } static void @@ -309,4 +313,35 @@ break; } e_toolbar_move_resize(tbar, nx, ny, nw, nh); +} + +static const char * +_e_toolbar_orient_string_get(E_Toolbar *tbar) +{ + const char *sig = ""; + + switch (tbar->gadcon->orient) + { + case E_GADCON_ORIENT_HORIZ: + sig = "horizontal"; + break; + case E_GADCON_ORIENT_VERT: + sig = "vertical"; + break; + case E_GADCON_ORIENT_LEFT: + sig = "left"; + break; + case E_GADCON_ORIENT_RIGHT: + sig = "right"; + break; + case E_GADCON_ORIENT_TOP: + sig = "top"; + break; + case E_GADCON_ORIENT_BOTTOM: + sig = "bottom"; + break; + default: + break; + } + return sig; } ------------------------------------------------------------------------- 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 enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs