Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_dnd.c ewl_engines.c ewl_misc.c ewl_misc.h Log Message: - handle x11 engine initialization failure a bit better - couple small bugs fixed - cleanup dead code - set functions static if possible =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.c,v retrieving revision 1.30 retrieving revision 1.31 diff -u -3 -r1.30 -r1.31 --- ewl_dnd.c 26 Oct 2006 16:11:56 -0000 1.30 +++ ewl_dnd.c 27 Oct 2006 04:26:56 -0000 1.31 @@ -2,8 +2,10 @@ #include "ewl_debug.h" #include "ewl_macros.h" #include "ewl_private.h" +#if 0 #include <Ecore_Evas.h> #include <Ecore_X.h> +#endif #define EWL_DND_WINDOW_ROOT 0 @@ -15,8 +17,10 @@ static int ewl_dragging_current = 0; static int ewl_dnd_move_count = 0; +#if 0 static Ecore_Evas *ewl_dnd_drag_canvas; static Ecore_X_Window ewl_dnd_drag_win = 0; +#endif static Ewl_Widget *ewl_dnd_widget = NULL; @@ -33,8 +37,10 @@ static char * ewl_dnd_type_stpcpy(char *dst, const char *src); static int ewl_dnd_types_encoded_contains(char *types, char *type); +#if 0 static int ewl_dnd_event_mouse_up(void *data, int type, void *event); static int ewl_dnd_event_dnd_move(void *data, int type, void *event); +#endif static void ewl_dnd_cb_render(Ewl_Widget *w, void *event, void *data); @@ -392,7 +398,7 @@ } static void -ewl_dnd_cb_render(Ewl_Widget *w, void *event, void *data) +ewl_dnd_cb_render(Ewl_Widget *w, void *event __UNUSED__, void *data) { int handle; Ewl_Embed *embed = EWL_EMBED(data); @@ -497,6 +503,7 @@ return dst; } +#if 0 static int ewl_dnd_event_dnd_move(void *data __UNUSED__, int type __UNUSED__, void *event) @@ -557,4 +564,5 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } +#endif =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_engines.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_engines.c 26 Oct 2006 16:11:56 -0000 1.19 +++ ewl_engines.c 27 Oct 2006 04:26:56 -0000 1.20 @@ -163,6 +163,8 @@ Ewl_Engine *parent; parent = ewl_engine_new(name); + if (!parent) DRETURN_PTR(NULL, DLEVEL_STABLE); + ecore_dlist_append(deps, parent); } ecore_list_destroy(dep_list); @@ -178,7 +180,7 @@ engine = EWL_ENGINE(create_engine()); if (!engine) { - DWARNING("Unable to create engine.\n"); + fprintf(stderr, "Unable to create engine.\n"); DRETURN_PTR(NULL, DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_misc.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -3 -r1.71 -r1.72 --- ewl_misc.c 26 Oct 2006 15:10:04 -0000 1.71 +++ ewl_misc.c 27 Oct 2006 04:26:56 -0000 1.72 @@ -13,8 +13,6 @@ /* * Configuration and option related flags. */ -static unsigned int phase_status = 0; - static Ecore_Idle_Enterer *idle_enterer = NULL; static Ecore_Idler *ewl_garbage_collect = NULL; static int ewl_init_count = 0; @@ -40,10 +38,13 @@ static Ecore_List *free_evas_list = NULL; static Ecore_List *free_evas_object_list = NULL; -int ewl_idle_render(void *data); +static int ewl_idle_render(void *data); static void ewl_init_parse_options(int *argc, char **argv); static void ewl_init_remove_option(int *argc, char **argv, int i); -int ewl_ecore_exit(void *data, int type, void *event); +static void ewl_configure_queue(void); +static void ewl_realize_queue(void); +static int ewl_garbage_collect_idler(void *data); +static void ewl_configure_cancel_request(Ewl_Widget *w); /** * @return Returns no value. @@ -355,7 +356,7 @@ * 8. Render the display. * 9. Repeat steps 2-6 until program exits. */ -int +static int ewl_idle_render(void *data __UNUSED__) { Ewl_Widget *w; @@ -387,7 +388,7 @@ !ecore_list_is_empty(free_evas_list) || !ecore_list_is_empty(free_evas_object_list)) ewl_garbage_collect = ecore_idler_add(ewl_garbage_collect_idler, - NULL);; + NULL); if (!ecore_list_is_empty(realize_list)) ewl_realize_queue(); @@ -430,7 +431,7 @@ */ ecore_list_goto_first(ewl_embed_list); while ((emb = ecore_list_next(ewl_embed_list)) != NULL) { - if (REALIZED(emb) && emb->evas) { + if (REALIZED(emb)) { double render_time = 0; ewl_embed_thaw(emb); @@ -483,8 +484,7 @@ static void ewl_init_parse_options(int *argc, char **argv) { - int i; - int matched = 0; + int i, matched = 0; Ecore_List *engines; DENTER_FUNCTION(DLEVEL_STABLE); @@ -533,7 +533,7 @@ matched++; } else if (!strcmp(argv[i], "--ewl-debug")) { - if (i + i < *argc) { + if ((i + 1) < *argc) { ewl_config_int_set(ewl_config, EWL_CONFIG_DEBUG_LEVEL, atoi(argv[i + 1]), EWL_STATE_TRANSIENT); @@ -556,9 +556,12 @@ } else if (!strcmp(argv[i], "--ewl-help")) { ewl_print_help(); - ecore_list_destroy(engines); - exit(0); matched ++; + + /* this has to exit. otherwise we end up returning + * FALSE from ewl_init which triggers the app to + * spit out an error */ + exit(0); } else if (!strncmp(argv[i], "--ewl-", 6)) { unsigned int len; @@ -603,7 +606,7 @@ } ecore_list_destroy(engines); - DLEAVE_FUNCTION(DLEVEL_STABLE); + DRETURN(DLEVEL_STABLE); } static void @@ -644,8 +647,7 @@ " AVAILABLE ENGINES\n"); names = ewl_engine_names_get(); - ecore_list_goto_first(names); - while ((name = ecore_list_next(names))) + while ((name = ecore_list_remove_first(names))) { char *t; while ((t = strchr(name, '_'))) @@ -724,7 +726,7 @@ * @return Returns no value * @brief Configure all the widgets that need to be configured */ -void +static void ewl_configure_queue(void) { Ewl_Widget *w; @@ -782,7 +784,7 @@ * * Remove the widget @a w from the list of widgets that need to be configured. */ -void +static void ewl_configure_cancel_request(Ewl_Widget *w) { DENTER_FUNCTION(DLEVEL_TESTING); @@ -861,22 +863,19 @@ * @return Returns no value * @brief Realize all widgets that need to be realized */ -void +static void ewl_realize_queue(void) { Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); - ewl_realize_phase_enter(); - /* * First realize any widgets that require it, this looping should * avoid deep recursion, and works from top to bottom since widgets * can't be placed on this list unless their parent has been realized * or they are a toplevel widget. */ - ecore_list_goto_first(realize_list); while ((w = ecore_list_remove_first(realize_list))) { if (VISIBLE(w) && !REALIZED(w)) { ewl_object_queued_add(EWL_OBJECT(w), @@ -916,56 +915,11 @@ EWL_FLAG_QUEUED_RSCHEDULED); } - ewl_realize_phase_exit(); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** - * @internal - * @return Returns no value. - * @brief Marks that EWL is currently realizing a widget. - */ -void -ewl_realize_phase_enter(void) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - phase_status |= EWL_FLAG_QUEUED_RSCHEDULED; - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** - * @internal - * @return Returns no value. - * @brief Marks that EWL is not realizing a widget. - */ -void -ewl_realize_phase_exit(void) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - phase_status &= ~EWL_FLAG_QUEUED_RSCHEDULED; - DLEAVE_FUNCTION(DLEVEL_STABLE); } /** * @internal - * @return Returns TRUE if currently realizing a widget, FALSE otherwise. - * @brief Checks if EWL is currently in the process of realizing widgets. - */ -int -ewl_in_realize_phase(void) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - DRETURN_INT((phase_status & EWL_FLAG_QUEUED_RSCHEDULED), DLEVEL_STABLE); -} - -/** - * @internal * @param w: The widget to destroy * @return Returns no value * @brief Queues the widget to be destroyed. @@ -1043,7 +997,7 @@ * @return Returns TRUE if objects remain to be freed, otherwise false. * @brief Free's all widgets that have been marked for destruction. */ -int +static int ewl_garbage_collect_idler(void *data __UNUSED__) { Evas *evas; @@ -1098,17 +1052,6 @@ ewl_garbage_collect = NULL; DRETURN_INT(ecore_list_nodes(destroy_list), DLEVEL_STABLE); -} - -int -ewl_ecore_exit(void *data __UNUSED__, int type __UNUSED__, - void *event __UNUSED__) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - ewl_main_quit(); - - DRETURN_INT(TRUE, DLEVEL_STABLE); } #ifdef DEBUG_MALLOCDEBUG =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_misc.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -3 -r1.16 -r1.17 --- ewl_misc.h 30 Sep 2006 22:31:36 -0000 1.16 +++ ewl_misc.h 27 Oct 2006 04:26:56 -0000 1.17 @@ -15,13 +15,9 @@ void ewl_main(void); void ewl_main_quit(void); void ewl_configure_request(Ewl_Widget *w); -void ewl_configure_queue(void); -void ewl_configure_cancel_request(Ewl_Widget *w); void ewl_realize_request(Ewl_Widget *w); void ewl_realize_cancel_request(Ewl_Widget *w); -void ewl_realize_queue(void); void ewl_destroy_request(Ewl_Widget *w); -int ewl_garbage_collect_idler(void *data); void ewl_realize_phase_enter(void); void ewl_realize_phase_exit(void); int ewl_in_realize_phase(void); ------------------------------------------------------------------------- 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