Enlightenment CVS committal Author : handyande Project : misc Module : engage
Dir : misc/engage/src Modified Files: Makefile.am config.c e_apps.c e_apps.h e_intl.c e_utils.c e_utils.h main.c window.c Added Files: e_includes.h Log Message: Move menu to ETK, as it works much better in an embedded environment Also fix a few isues with includes from the cached e code =================================================================== RCS file: /cvs/e/misc/engage/src/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -u -3 -r1.17 -r1.18 --- Makefile.am 3 Sep 2006 08:24:06 -0000 1.17 +++ Makefile.am 3 Sep 2006 15:14:51 -0000 1.18 @@ -8,14 +8,14 @@ @edje_cflags@ \ @ecore_cflags@ \ @esmart_cflags@ \ [EMAIL PROTECTED]@ \ [EMAIL PROTECTED]@ \ [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ \ [EMAIL PROTECTED]@ bin_PROGRAMS = engage engage_SOURCES = \ e.h \ +e_includes.h \ e_apps.h \ e_apps_cache.h \ e_icon.h \ @@ -45,10 +45,10 @@ e_intl.c if XINERAMA -engage_LDADD = @evas_libs@ @edje_libs@ @ecore_libs@ @imlib2_libs@ @ewl_libs@ \ +engage_LDADD = @evas_libs@ @edje_libs@ @ecore_libs@ @imlib2_libs@ @etk_libs@ \ @esmart_libs@ -lesmart_trans_x11 -lXinerama engage_CFLAGS = -DXINERAMA else -engage_LDADD = @evas_libs@ @edje_libs@ @ecore_libs@ @imlib2_libs@ @ewl_libs@ \ +engage_LDADD = @evas_libs@ @edje_libs@ @ecore_libs@ @imlib2_libs@ @etk_libs@ \ @esmart_libs@ -lesmart_trans_x11 endif =================================================================== RCS file: /cvs/e/misc/engage/src/config.c,v retrieving revision 1.59 retrieving revision 1.60 diff -u -3 -r1.59 -r1.60 --- config.c 9 Aug 2006 21:38:13 -0000 1.59 +++ config.c 3 Sep 2006 15:14:51 -0000 1.60 @@ -4,13 +4,11 @@ #include "dmalloc.h" #endif -#ifdef HAVE_EWL -#include <Ewl.h> -Ewl_Widget *menu, *menu_win, *menu_app_name; -Evas_Object *embed; -int init; +#ifdef HAVE_ETK +#include <Etk.h> -void od_config_menu_hide(void); +Etk_Widget *_od_config_menu = NULL; +Etk_Widget *_od_config_menu_app; #endif typedef enum od_config_colors { @@ -189,149 +187,58 @@ return ret; } -#ifdef HAVE_EWL -int menu_height, menu_width; -Evas_Coord menu_x, menu_y; - -void -od_config_menu_move_cb(Ewl_Widget * w, void *ev_data, void *user_data) -{ - ewl_object_position_request(EWL_OBJECT(user_data), CURRENT_X(menu_win), - CURRENT_Y(menu_win)); -} - -void -od_config_menu_out_cb(Ewl_Widget * w, void *ev_data, void *user_data) -{ - int x, y; - evas_pointer_output_xy_get(evas, &x, &y); - if (x <= menu_x + 1 || x >= (menu_x + menu_width) || - y <= menu_y + 1 || y >= (menu_y + menu_height)) - od_config_menu_hide(); -} - -void -od_config_menu_zoom_cb(Ewl_Widget * w, void *ev_data, void *user_data) -{ +#ifdef HAVE_ETK +void _od_config_menu_zooming_cb(Etk_Object *object, void *data) { ecore_config_int_set("engage.options.zoom", options.zoom ? 0 : 1); - od_config_menu_hide(); } -void -od_config_menu_config_cb(Ewl_Widget * w, void *ev_data, void *user_data) -{ +void _od_config_menu_config_cb(Etk_Object *object, void *data) { if (!ecore_exe_run("examine engage", NULL)) - fprintf(stderr, "'examine' could not be launched - is it in your path?\n"); - od_config_menu_hide(); + fprintf(stderr, "'examine' could not be launched - is it in your path?\n"); } -void -od_config_menu_quit_cb(Ewl_Widget * w, void *ev_data, void *user_data) -{ - od_config_menu_hide(); +void _od_config_menu_quit_cb(Etk_Object *object, void *data) { ecore_main_loop_quit(); } -void -od_config_menu_init(void) -{ - Ewl_Widget *menu_box, *item; - - if (init) - return; - init = 1; - /* FIXME: nasty nasty, we need to request the size, not code it in */ - menu_height = 87; //121; - menu_width = 100; - - menu_win = ewl_embed_new(); - ewl_object_fill_policy_set((Ewl_Object *) menu_win, EWL_FLAG_FILL_FILL); - - embed = - ewl_embed_evas_set(EWL_EMBED(menu_win), evas, - EWL_EMBED_EVAS_WINDOW(ecore_evas_software_x11_window_get(ee))); - evas_object_layer_set(embed, 999); - - /* FIXME: this should not be needed */ - evas_object_resize(embed, menu_width, menu_height); - evas_object_show(embed); - ewl_widget_show(menu_win); - - menu_box = ewl_vbox_new(); - ewl_object_fill_policy_set(EWL_OBJECT(menu_box), EWL_FLAG_FILL_FILL); - ewl_container_child_append(EWL_CONTAINER(menu_win), menu_box); - ewl_widget_show(menu_box); - - menu = ewl_imenu_new(); - ewl_button_label_set(EWL_BUTTON(menu), "config menu"); - ewl_callback_append(EWL_WIDGET(menu_win), EWL_CALLBACK_CONFIGURE, - od_config_menu_move_cb, EWL_MENU_BASE(menu)->popup); - ewl_callback_append(EWL_MENU_BASE(menu)->popup, EWL_CALLBACK_FOCUS_OUT, - od_config_menu_out_cb, NULL); - ewl_container_child_append(EWL_CONTAINER(menu_box), menu); - /* *don't* show the menu, we only want the popup */ -/* - item = ewl_menu_item_new(NULL, "<name goes here>"); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_callback_append(item, EWL_CALLBACK_FOCUS_IN, od_config_menu_config_cb, NULL); - ewl_widget_show(item); - menu_app_name = item; - - item = ewl_menu_separator_new(); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_widget_show(item); -*/ - - - item = ewl_menu_item_new(); - ewl_button_label_set(EWL_BUTTON(item), "Icon Zooming"); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_callback_append(item, EWL_CALLBACK_FOCUS_IN, od_config_menu_zoom_cb, NULL); - ewl_widget_show(item); - - item = ewl_menu_item_new(); - ewl_button_label_set(EWL_BUTTON(item), "Configuration"); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_callback_append(item, EWL_CALLBACK_FOCUS_IN, od_config_menu_config_cb, NULL); - ewl_widget_show(item); - - item = ewl_separator_new(); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_widget_show(item); - - item = ewl_menu_item_new(); - ewl_button_label_set(EWL_BUTTON(item), "Quit"); - ewl_container_child_append(EWL_CONTAINER(menu), item); - ewl_callback_append(item, EWL_CALLBACK_FOCUS_IN, od_config_menu_quit_cb, NULL); - ewl_widget_show(item); -} +void od_config_menu_init(void) { + Etk_Widget *menu, *menu_item; -void -od_config_menu_hide(void) -{ - evas_object_move(embed, -1 * CURRENT_W(menu_win), 0); - ewl_widget_hide(menu); + menu = etk_menu_new(); + menu_item = etk_menu_item_new_with_label("<App name here>"); + etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item)); +// etk_signal_connect("activated", ETK_OBJECT(menu_item), ETK_CALLBACK(_od_config_menu_app_cb), NULL); + _od_config_menu_app = menu_item; + + menu_item = etk_menu_item_new_with_label("Icon Zooming"); + etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item)); + etk_signal_connect("activated", ETK_OBJECT(menu_item), ETK_CALLBACK(_od_config_menu_zooming_cb), NULL); + menu_item = etk_menu_item_new_with_label("Configuration"); + etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item)); + etk_signal_connect("activated", ETK_OBJECT(menu_item), ETK_CALLBACK(_od_config_menu_config_cb), NULL); + menu_item = etk_menu_item_separator_new(); + etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item)); + menu_item = etk_menu_item_new_with_label("Quit"); + etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item)); + etk_signal_connect("activated", ETK_OBJECT(menu_item), ETK_CALLBACK(_od_config_menu_quit_cb), NULL); + etk_widget_show(menu); + _od_config_menu = menu; } -void -od_config_menu_draw(Evas_Coord x, Evas_Coord y) -{ - Evas_Coord menu_off_x, menu_off_y; +void od_config_menu_draw(Evas_Coord x, Evas_Coord y) { Evas_List *l; Evas_Coord minx, maxx; - char *menu_text_launcher, *menu_text_not_launcher; + char *label; - menu_off_x = 5; - menu_off_y = 5; + if (_od_config_menu == NULL) + od_config_menu_init(); - od_config_menu_init(); - - minx = x - options.size / 2 ; + minx = x - options.size / 2; maxx = x + options.size / 2; + label = "Not over icon"; + etk_widget_hide(_od_config_menu_app); - menu_text_launcher = "don't keep \"%s\" in docker"; - menu_text_not_launcher = "keep \"%s\" in docker"; l = dock.icons; while (l) { OD_Icon *icon; @@ -339,37 +246,16 @@ if (icon->x >= minx && icon->x <= maxx) { int len; char *full; - if (icon->launcher) { - len = strlen(menu_text_launcher) + strlen(icon->name) - 1; - full = malloc(len); - snprintf(full, len, menu_text_launcher, icon->name); - } else { - len = strlen(menu_text_not_launcher) + strlen(icon->name) - 1; - full = malloc(len); - snprintf(full, len, menu_text_not_launcher, icon->name); - } - printf("context menu on %s\n", icon->name); -// ewl_button_label_set(EWL_BUTTON(menu_app_name), full); - free(full); + label = icon->a->name; + etk_widget_show(_od_config_menu_app); break; } l = l->next; } - if (x - menu_off_x + menu_width > options.width) - menu_x = options.width - menu_width; - else if (x < menu_off_x) - menu_x = 0; - else - menu_x = x - menu_off_x; - if (y - menu_off_y + menu_height > options.height) - menu_y = options.height - menu_height; - else if (y < menu_off_y) - menu_y = 0; - else - menu_y = y - menu_off_y; - evas_object_move(embed, menu_x, menu_y); - ewl_callback_call(menu, EWL_CALLBACK_FOCUS_IN); + etk_menu_item_label_set(ETK_MENU_ITEM(_od_config_menu_app), label); + etk_menu_popup(ETK_MENU(_od_config_menu)); } #endif + =================================================================== RCS file: /cvs/e/misc/engage/src/e_apps.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- e_apps.c 1 Sep 2006 16:03:58 -0000 1.6 +++ e_apps.c 3 Sep 2006 15:14:51 -0000 1.7 @@ -2215,7 +2215,7 @@ _e_app_change(a, E_APP_EXIT); return 1; } - +/* static int _e_app_cb_event_border_add(void *data, int type, void *event) { @@ -2262,7 +2262,7 @@ } return 1; } - +*/ static int _e_app_cb_expire_timer(void *data) { =================================================================== RCS file: /cvs/e/misc/engage/src/e_apps.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -3 -r1.4 -r1.5 --- e_apps.h 1 Sep 2006 16:03:58 -0000 1.4 +++ e_apps.h 3 Sep 2006 15:14:51 -0000 1.5 @@ -85,7 +85,7 @@ E_App *app; Ecore_Exe_Event_Del del; - E_Config_Dialog *error_dialog; +// E_Config_Dialog *error_dialog; Ecore_Exe_Event_Data *error, *read; }; =================================================================== RCS file: /cvs/e/misc/engage/src/e_intl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_intl.c 1 Sep 2006 16:03:58 -0000 1.1 +++ e_intl.c 3 Sep 2006 15:14:51 -0000 1.2 @@ -63,14 +63,14 @@ { char *s; -// _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config); +/* _e_intl_input_method_config_edd = E_CONFIG_DD_NEW("input_method_config", E_Input_Method_Config); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, version, INT); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_name, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, gtk_im_module, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, qt_im_module, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, xmodifiers, STR); E_CONFIG_VAL(_e_intl_input_method_config_edd, E_Input_Method_Config, e_im_exec, STR); - + */ if ((s = getenv("LC_MESSAGES"))) _e_intl_orig_lc_messages = strdup(s); if ((s = getenv("LANGUAGE"))) _e_intl_orig_language = strdup(s); @@ -97,7 +97,7 @@ E_FREE(_e_intl_orig_qt_im_module); E_FREE(_e_intl_orig_xmodifiers); - E_CONFIG_DD_FREE(_e_intl_input_method_config_edd); +// E_CONFIG_DD_FREE(_e_intl_input_method_config_edd); return 1; } =================================================================== RCS file: /cvs/e/misc/engage/src/e_utils.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_utils.c 1 Sep 2006 16:03:58 -0000 1.1 +++ e_utils.c 3 Sep 2006 15:14:51 -0000 1.2 @@ -17,7 +17,7 @@ EAPI int good = 0; EAPI int evil = 0; EAPI int starting = 1; - +/* typedef struct _E_Util_Fake_Mouse_Up_Info E_Util_Fake_Mouse_Up_Info; struct _E_Util_Fake_Mouse_Up_Info @@ -25,7 +25,7 @@ E_Container *con; int button; }; - +*/ /* local subsystem functions */ static void _e_util_container_fake_mouse_up_cb(void *data); static int _e_util_wakeup_cb(void *data); @@ -34,7 +34,7 @@ static Ecore_Timer *_e_util_dummy_timer = NULL; /* externally accessible functions */ -EAPI void +/*EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button) { E_Util_Fake_Mouse_Up_Info *info; @@ -62,7 +62,7 @@ e_util_container_fake_mouse_up_later(con, 2); e_util_container_fake_mouse_up_later(con, 3); } - +*/ EAPI void e_util_wakeup(void) { @@ -667,7 +667,7 @@ } /* local subsystem functions */ -static void +/*static void _e_util_container_fake_mouse_up_cb(void *data) { E_Util_Fake_Mouse_Up_Info *info; @@ -680,7 +680,7 @@ free(info); } } - +*/ static int _e_util_wakeup_cb(void *data) { =================================================================== RCS file: /cvs/e/misc/engage/src/e_utils.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- e_utils.h 1 Sep 2006 16:03:58 -0000 1.1 +++ e_utils.h 3 Sep 2006 15:14:51 -0000 1.2 @@ -15,8 +15,8 @@ } -EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button); -EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con); +/*EAPI void e_util_container_fake_mouse_up_later(E_Container *con, int button); +EAPI void e_util_container_fake_mouse_up_all_later(E_Container *con);*/ EAPI void e_util_wakeup(void); EAPI void e_util_env_set(const char *var, const char *val); /*EAPI E_Zone *e_util_zone_current_get(E_Manager *man);*/ =================================================================== RCS file: /cvs/e/misc/engage/src/main.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- main.c 10 Jun 2005 19:55:03 -0000 1.14 +++ main.c 3 Sep 2006 15:14:51 -0000 1.15 @@ -1,6 +1,8 @@ #include "engage.h" #include "Ecore_X.h" -#include "Ewl.h" +#ifdef HAVE_ETK +#include <Etk.h> +#endif #ifdef DMALLOC #include "dmalloc.h" #endif @@ -45,7 +47,9 @@ ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_cb, NULL); ecore_evas_init(); - ewl_init(&argc, argv); +#ifdef HAVE_ETK + etk_init(&argc, &argv); +#endif edje_init(); edje_frametime_set(1.0 / 30.0); @@ -66,7 +70,9 @@ ecore_main_loop_begin(); edje_shutdown(); - ewl_shutdown(); +#ifdef HAVE_ETK + etk_shutdown(); +#endif ecore_evas_shutdown(); e_app_shutdown(); ecore_config_save(); =================================================================== RCS file: /cvs/e/misc/engage/src/window.c,v retrieving revision 1.34 retrieving revision 1.35 diff -u -3 -r1.34 -r1.35 --- window.c 18 Aug 2006 11:47:05 -0000 1.34 +++ window.c 3 Sep 2006 15:14:51 -0000 1.35 @@ -474,7 +474,7 @@ { Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event; -#ifdef HAVE_EWL +#ifdef HAVE_ETK if (ev->button == 3) od_config_menu_draw(ev->canvas.x, ev->canvas.y); #endif ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs