Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_calendar.c ewl_cursor.c ewl_datepicker.c ewl_dnd.c ewl_dnd.h ewl_embed.c ewl_expansion.c ewl_highlight.c ewl_icon.c ewl_icon.h ewl_media.c Log Message: - Various cleanups - Change the calendar to use icons instead of buttons so we can attach alternate text to the icons incase the image isn't there. Probably needs to be themed better. =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_calendar.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -3 -r1.25 -r1.26 --- ewl_calendar.c 6 Feb 2007 13:42:16 -0000 1.25 +++ ewl_calendar.c 11 Mar 2007 22:35:56 -0000 1.26 @@ -1,7 +1,7 @@ /* vim: set sw=8 ts=8 sts=8 noexpandtab: */ #include "ewl_base.h" #include "ewl_calendar.h" -#include "ewl_button.h" +#include "ewl_icon.h" #include "ewl_grid.h" #include "ewl_icon_theme.h" #include "ewl_label.h" @@ -13,9 +13,9 @@ static int ewl_calendar_leap_year_detect(unsigned int year); static void ewl_calendar_highlight_today(struct tm *now, Ewl_Label *day, Ewl_Calendar *cal); -static void ewl_calendar_day_select(Ewl_Widget *w, void *ev_data, +static void ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data, void *user_data); -static void ewl_calendar_day_pick(Ewl_Widget *w, void *ev_data, +static void ewl_calendar_day_pick_cb(Ewl_Widget *w, void *ev_data, void *user_data); static void ewl_calendar_prev_month_cb(Ewl_Widget *w, void *ev_data, void *user_data); @@ -43,9 +43,8 @@ DENTER_FUNCTION(DLEVEL_STABLE); ib = NEW(Ewl_Calendar, 1); - if (!ib) { + if (!ib) DRETURN_PTR(NULL, DLEVEL_STABLE); - } if (!ewl_calendar_init(ib)) { ewl_widget_destroy(EWL_WIDGET(ib)); @@ -63,7 +62,7 @@ int ewl_calendar_init(Ewl_Calendar* ib) { - Ewl_Widget *w, *vbox, *top_hbox, *prev_button, *next_button; + Ewl_Widget *w, *vbox, *top_hbox, *o; struct tm *ptr; time_t tm; @@ -71,35 +70,36 @@ DCHECK_PARAM_PTR_RET("ib", ib, FALSE); w = EWL_WIDGET(ib); - - if (!ewl_box_init(EWL_BOX(ib))) { + if (!ewl_box_init(EWL_BOX(ib))) DRETURN_INT(FALSE, DLEVEL_STABLE); - } ewl_box_orientation_set(EWL_BOX(ib), EWL_ORIENTATION_HORIZONTAL); - ewl_widget_appearance_set(EWL_WIDGET(ib), EWL_CALENDAR_TYPE); - ewl_widget_inherit(EWL_WIDGET(w), EWL_CALENDAR_TYPE); + ewl_widget_appearance_set(w, EWL_CALENDAR_TYPE); + ewl_widget_inherit(w, EWL_CALENDAR_TYPE); ewl_object_fill_policy_set(EWL_OBJECT(ib), EWL_FLAG_FILL_FILL); vbox = ewl_vbox_new(); ewl_container_child_append(EWL_CONTAINER(ib), vbox); + ewl_widget_internal_set(vbox, TRUE); ewl_widget_show(vbox); top_hbox = ewl_hbox_new(); ewl_container_child_append(EWL_CONTAINER(vbox), top_hbox); + ewl_widget_internal_set(top_hbox, TRUE); ewl_widget_show(top_hbox); - prev_button = ewl_button_new(); - ewl_container_child_append(EWL_CONTAINER(top_hbox), prev_button); - ewl_object_fill_policy_set(EWL_OBJECT(prev_button), EWL_FLAG_FILL_NONE); - ewl_object_alignment_set(EWL_OBJECT(prev_button), EWL_FLAG_ALIGN_LEFT); - ewl_button_image_set(EWL_BUTTON(prev_button), + o = ewl_icon_new(); + ewl_container_child_append(EWL_CONTAINER(top_hbox), o); + ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE); + ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT); + ewl_icon_image_set(EWL_ICON(o), ewl_icon_theme_icon_path_get(EWL_ICON_GO_PREVIOUS, EWL_ICON_SIZE_SMALL), EWL_ICON_GO_PREVIOUS); - ewl_callback_append(prev_button, EWL_CALLBACK_MOUSE_DOWN, + ewl_icon_alt_text_set(EWL_ICON(o), "<<"); + ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_calendar_prev_month_cb, ib); - ewl_widget_show(prev_button); + ewl_widget_show(o); ib->month_label = ewl_label_new(); ewl_object_fill_policy_set(EWL_OBJECT(ib->month_label), @@ -107,20 +107,20 @@ ewl_object_alignment_set(EWL_OBJECT(ib->month_label), EWL_FLAG_ALIGN_CENTER); ewl_container_child_append(EWL_CONTAINER(top_hbox), ib->month_label); - ewl_label_text_set(EWL_LABEL(ib->month_label), "Disp"); ewl_widget_show(ib->month_label); - next_button = ewl_button_new(); - ewl_object_fill_policy_set(EWL_OBJECT(next_button), EWL_FLAG_FILL_NONE); - ewl_object_alignment_set(EWL_OBJECT(next_button), EWL_FLAG_ALIGN_RIGHT); - ewl_container_child_append(EWL_CONTAINER(top_hbox), next_button); - ewl_button_image_set(EWL_BUTTON(next_button), + o = ewl_icon_new(); + ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE); + ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_RIGHT); + ewl_container_child_append(EWL_CONTAINER(top_hbox), o); + ewl_icon_image_set(EWL_ICON(o), ewl_icon_theme_icon_path_get(EWL_ICON_GO_NEXT, EWL_ICON_SIZE_SMALL), EWL_ICON_GO_NEXT); - ewl_callback_append(next_button, EWL_CALLBACK_MOUSE_DOWN, + ewl_icon_alt_text_set(EWL_ICON(o), ">>"); + ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_calendar_next_month_cb, ib); - ewl_widget_show(next_button); + ewl_widget_show(o); ib->grid = ewl_grid_new(); ewl_grid_dimensions_set(EWL_GRID(ib->grid), 7, 7); @@ -143,7 +143,8 @@ /** * @param cal: The calendar to get the date frm - * @return none + * @return Returns the string representing the selected date. This string + * must be free'd * @brief Returns an ASCII formatted representation of the selected date * the user must freet this string. */ @@ -218,11 +219,9 @@ static void ewl_calendar_grid_setup(Ewl_Calendar *cal) { - struct tm *month_start; - struct tm *now; + struct tm *date; char display_top[50]; time_t tm; - time_t now_tm; int today = 0; int cur_row, cur_col, cur_day, days = 30; Ewl_Widget *day_label; @@ -234,30 +233,31 @@ ewl_container_reset(EWL_CONTAINER(cal->grid)); ewl_calendar_add_day_labels(cal); - /* Make the initial display.. */ - sprintf(display_top, "%s %d", months[cal->cur_month], cal->cur_year); + /* Make the initial display */ + snprintf(display_top, sizeof(display_top), "%s %d", + months[cal->cur_month], cal->cur_year); ewl_label_text_set(EWL_LABEL(cal->month_label), display_top); today = cal->cur_day; - /* Get the DOW of the first day of this month */ + /* Get the DAY of the first day of this month */ tm = time(NULL); - month_start = localtime(&tm); - month_start->tm_mday = 0; - month_start->tm_mon = cal->cur_month; - month_start->tm_year = cal->cur_year - 1900; - mktime(month_start); + date = localtime(&tm); + date->tm_mday = 0; + date->tm_mon = cal->cur_month; + date->tm_year = cal->cur_year - 1900; + mktime(date); /* Now add the days to this month */ cur_row = 2; - cur_col = month_start->tm_wday + 1; + cur_col = date->tm_wday + 1; if (cur_col > 7) { cur_row = 2; cur_col = 1; } cur_day = 0; - now_tm = time(NULL); - now = localtime(&now_tm); + tm = time(NULL); + date = localtime(&tm); days = mdays[cal->cur_month]; /* If february, do leap years... */ @@ -276,22 +276,22 @@ cur_col = 1; } - sprintf(day, "%d", cur_day + 1); + snprintf(day, sizeof(day), "%d", cur_day + 1); day_label = ewl_label_new(); ewl_label_text_set(EWL_LABEL(day_label), day); ewl_callback_append(EWL_WIDGET(day_label), EWL_CALLBACK_MOUSE_DOWN, - ewl_calendar_day_select, cal); + ewl_calendar_day_select_cb, cal); ewl_callback_append(EWL_WIDGET(day_label), EWL_CALLBACK_CLICKED, - ewl_calendar_day_pick, cal); + ewl_calendar_day_pick_cb, cal); ewl_container_child_append(EWL_CONTAINER(cal->grid), day_label); ewl_grid_child_position_set(EWL_GRID(cal->grid), day_label, cur_col - 1, cur_col - 1, cur_row - 1, cur_row - 1); - ewl_calendar_highlight_today(now, EWL_LABEL(day_label), cal); + ewl_calendar_highlight_today(date, EWL_LABEL(day_label), cal); ewl_widget_show(day_label); cur_col++; @@ -304,7 +304,7 @@ static int ewl_calendar_leap_year_detect(unsigned int year) { - int leap; + int leap = FALSE; DENTER_FUNCTION(DLEVEL_STABLE); @@ -338,7 +338,7 @@ } static void -ewl_calendar_day_select(Ewl_Widget *w, void *ev_data __UNUSED__, +ewl_calendar_day_select_cb(Ewl_Widget *w, void *ev_data __UNUSED__, void *user_data) { struct tm *now; @@ -356,7 +356,8 @@ i = atoi(ewl_label_text_get(EWL_LABEL(w))); ewl_container_child_iterate_begin(EWL_CONTAINER(EWL_CALENDAR(user_data)->grid)); - while ((it = ewl_container_child_next(EWL_CONTAINER(EWL_CALENDAR(user_data)->grid))) != NULL) { + while ((it = ewl_container_child_next( + EWL_CONTAINER(EWL_CALENDAR(user_data)->grid))) != NULL) { ewl_widget_color_set(EWL_WIDGET(it), 255, 255, 255, 255); ewl_calendar_highlight_today(now, EWL_LABEL(it), EWL_CALENDAR(user_data)); } @@ -368,13 +369,14 @@ } static void -ewl_calendar_day_pick(Ewl_Widget *w __UNUSED__, void *ev_data, +ewl_calendar_day_pick_cb(Ewl_Widget *w __UNUSED__, void *ev_data, void *user_data) { Ewl_Event_Mouse_Down *ev; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("user_data", user_data); + DCHECK_TYPE("user_data", user_data, EWL_WIDGET_TYPE); ev = ev_data; if (ev->clicks == 2) @@ -392,6 +394,7 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("user_data", user_data); + DCHECK_TYPE("user_data", user_data, EWL_CALENDAR_TYPE); ib = EWL_CALENDAR(user_data); ib->cur_month -= 1; =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_cursor.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- ewl_cursor.c 12 Feb 2007 13:16:05 -0000 1.7 +++ ewl_cursor.c 11 Mar 2007 22:35:56 -0000 1.8 @@ -54,10 +54,11 @@ ewl_object_fill_policy_set(EWL_OBJECT(w), EWL_FLAG_FILL_ALL); ewl_object_size_request(EWL_OBJECT(w), 32, 32); ewl_embed_engine_name_set(EWL_EMBED(cursor), "evas_buffer"); + ewl_callback_append(w, EWL_CALLBACK_VALUE_CHANGED, - ewl_cursor_cb_render, NULL); - ewl_callback_append(w, EWL_CALLBACK_DESTROY, ewl_cursor_cb_destroy, - NULL); + ewl_cursor_cb_render, NULL); + ewl_callback_append(w, EWL_CALLBACK_DESTROY, + ewl_cursor_cb_destroy, NULL); DRETURN_INT(TRUE, DLEVEL_UNSTABLE); } @@ -74,9 +75,6 @@ DCHECK_PARAM_PTR("w", w); DCHECK_TYPE("w", w, EWL_CURSOR_TYPE); - width = ewl_object_current_w_get(EWL_OBJECT(cursor)); - height = ewl_object_current_h_get(EWL_OBJECT(cursor)); - /* * Find the widget setting the current cursor. */ @@ -90,6 +88,9 @@ if (cursor->handle) ewl_engine_pointer_free(EWL_EMBED(parent), cursor->handle); + width = ewl_object_current_w_get(EWL_OBJECT(cursor)); + height = ewl_object_current_h_get(EWL_OBJECT(cursor)); + handle = ewl_engine_pointer_data_new(EWL_EMBED(parent), EWL_EMBED(cursor)->canvas_window, width, height); @@ -107,10 +108,15 @@ { Ewl_Cursor *cursor = EWL_CURSOR(w); + DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, EWL_CURSOR_TYPE); + /* FIXME: Also needs to be handled for the correct engine refs if (cursor->handle) ewl_engine_pointer_free(parent, cursor->handle); */ cursor->handle = 0; + + DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_datepicker.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- ewl_datepicker.c 6 Feb 2007 13:42:17 -0000 1.19 +++ ewl_datepicker.c 11 Mar 2007 22:35:56 -0000 1.20 @@ -22,9 +22,8 @@ DENTER_FUNCTION(DLEVEL_STABLE); ib = NEW(Ewl_Datepicker, 1); - if (!ib) { + if (!ib) DRETURN_PTR(NULL, DLEVEL_STABLE); - } if (!ewl_datepicker_init(ib)) { ewl_widget_destroy(EWL_WIDGET(ib)); @@ -54,8 +53,8 @@ EWL_FLAG_FILL_NONE); dp->calendar_window = ewl_popup_new(); - ewl_widget_appearance_set(dp->calendar_window, EWL_DATEPICKER_TYPE"/" - EWL_POPUP_TYPE); + ewl_widget_appearance_set(dp->calendar_window, + EWL_DATEPICKER_TYPE"/"EWL_POPUP_TYPE); ewl_object_fill_policy_set(EWL_OBJECT(dp->calendar_window), EWL_FLAG_FILL_NONE); ewl_popup_type_set(EWL_POPUP(dp->calendar_window), @@ -176,5 +175,4 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } - =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.c,v retrieving revision 1.42 retrieving revision 1.43 diff -u -3 -r1.42 -r1.43 --- ewl_dnd.c 5 Mar 2007 11:52:54 -0000 1.42 +++ ewl_dnd.c 11 Mar 2007 22:35:56 -0000 1.43 @@ -19,14 +19,10 @@ static Ewl_Widget *ewl_dnd_widget; static Ewl_Widget *ewl_dnd_default_cursor; -static Ecore_Hash *ewl_dnd_position_hash; static Ecore_Hash *ewl_dnd_provided_hash; static Ecore_Hash *ewl_dnd_accepted_hash; static int ewl_dnd_status; -Ecore_Event_Handler *ewl_dnd_mouse_up_handler; -Ecore_Event_Handler *ewl_dnd_mouse_move_handler; - static char *ewl_dnd_types_encode(const char **types); static char **ewl_dnd_types_decode(const char *types); static char * ewl_dnd_type_stpcpy(char *dst, const char *src); @@ -60,20 +56,15 @@ ewl_dragging_current = 0; ewl_dnd_move_count = 0; - ewl_dnd_position_hash = ecore_hash_new(ecore_direct_hash, - ecore_direct_compare); - if (!ewl_dnd_position_hash) - goto position_error; - ewl_dnd_provided_hash = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); if (!ewl_dnd_provided_hash) - goto provided_error; + goto PROVIDED_ERROR; ewl_dnd_accepted_hash = ecore_hash_new(ecore_direct_hash, ecore_direct_compare); if (!ewl_dnd_accepted_hash) - goto accepted_error; + goto ACCEPTED_ERROR; ewl_dnd_default_cursor = NULL; @@ -85,11 +76,9 @@ /* * Error handlers. */ -accepted_error: +ACCEPTED_ERROR: IF_FREE_HASH(ewl_dnd_provided_hash); -provided_error: - IF_FREE_HASH(ewl_dnd_position_hash); -position_error: +PROVIDED_ERROR: DRETURN_INT(FALSE, DLEVEL_STABLE); } @@ -103,7 +92,6 @@ { DENTER_FUNCTION(DLEVEL_STABLE); - IF_FREE_HASH(ewl_dnd_position_hash); IF_FREE_HASH(ewl_dnd_provided_hash); IF_FREE_HASH(ewl_dnd_accepted_hash); @@ -111,23 +99,6 @@ } /** - * @param w: The widget to add - * @return Returns no value - * @brief: Adds the given widget @a w to the position hash - */ -void -ewl_dnd_position_windows_set(Ewl_Widget *w) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); - - ecore_hash_set(ewl_dnd_position_hash, w, (void *)1); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -/** * @param w: The widget to set provided types * @param types: A NULL terminated array of mimetypes widget provides for DND * @return Returns no value @@ -185,7 +156,6 @@ DRETURN_INT(ret, DLEVEL_STABLE); } - /** * @param w: The widget to retrieve provided types * @return Returns a NULL terminated array of mimetypes widget provides for DND @@ -201,6 +171,7 @@ DCHECK_TYPE_RET("w", w, EWL_WIDGET_TYPE, NULL); types = ecore_hash_get(ewl_dnd_provided_hash, w); + DRETURN_PTR(ewl_dnd_types_decode(types), DLEVEL_STABLE); } @@ -228,22 +199,24 @@ ewl_object_flags_add(EWL_OBJECT(w), EWL_FLAG_PROPERTY_DND_TARGET, EWL_FLAGS_PROPERTY_MASK); + if (REALIZED(w) && !OBSCURED(w)) { Ewl_Embed *emb; emb = ewl_embed_widget_find(w); - ewl_embed_dnd_aware_set(emb); + if (emb) ewl_embed_dnd_aware_set(emb); } } else { ewl_object_flags_remove(EWL_OBJECT(w), EWL_FLAG_PROPERTY_DND_TARGET, EWL_FLAGS_PROPERTY_MASK); + if (REALIZED(w) && !OBSCURED(w)) { Ewl_Embed *emb; emb = ewl_embed_widget_find(w); - ewl_embed_dnd_aware_remove(emb); + if (emb) ewl_embed_dnd_aware_remove(emb); } } @@ -312,6 +285,7 @@ DRETURN(DLEVEL_STABLE); emb = ewl_embed_widget_find(w); + if (!emb) DRETURN(DLEVEL_STABLE); ewl_dragging_current = 1; ewl_dnd_widget = w; @@ -321,7 +295,8 @@ /* * Count the number of mime types set on the widget. */ - for (i = 0; types && types[i]; i++); + for (i = 0; types && types[i]; i++) + ; /* * Flag the provided DND types on the embed and begin the DND process. @@ -366,17 +341,17 @@ DCHECK_PARAM_PTR("w", w); DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); - emb = ewl_embed_widget_find(w); - ewl_dragging_current = 0; ewl_dnd_widget = NULL; ewl_dnd_move_count = 0; + emb = ewl_embed_widget_find(w); + if (!emb) DRETURN(DLEVEL_STABLE); + /* * FIXME: Reset the cursor here. */ // ewl_embed_mouse_cursor_set(EWL_WIDGET(emb)); - ewl_engine_embed_dnd_drag_drop(emb); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -457,12 +432,10 @@ DENTER_FUNCTION(DLEVEL_STABLE); while (*types) { - int len; - - len = strlen(types); if (!(strcmp(types, type))) DRETURN_INT(TRUE, DLEVEL_STABLE); - types += len + 1; + + types += strlen(types) + 1; } DRETURN_INT(FALSE, DLEVEL_STABLE); @@ -549,67 +522,4 @@ return dst; } - -#if 0 -static int -ewl_dnd_event_dnd_move(void *data __UNUSED__, int type __UNUSED__, - void *event) -{ - Ecore_X_Event_Mouse_Move *ev; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("event", event, FALSE); - - ev = event; - - if (!ewl_dnd_status) DRETURN_INT(TRUE, DLEVEL_STABLE); - - ewl_dnd_move_count++; - if (ewl_dnd_move_count == 1) - ecore_evas_show(ewl_dnd_drag_canvas); - - if (ewl_dnd_drag_canvas) - ecore_evas_move(ewl_dnd_drag_canvas, ev->x - 15, ev->y - 15); - - DRETURN_INT(TRUE, DLEVEL_STABLE); -} - -static int -ewl_dnd_event_mouse_up(void *data __UNUSED__, int type __UNUSED__, - void *event __UNUSED__) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - if (ewl_dnd_drag_canvas && ewl_dragging_current) { - Ecore_List *pos; - void *val; - - ecore_x_pointer_ungrab(); - ecore_x_keyboard_ungrab(); - - ecore_event_handler_del(ewl_dnd_mouse_up_handler); - ecore_event_handler_del(ewl_dnd_mouse_move_handler); - - ecore_evas_free(ewl_dnd_drag_canvas); - ewl_dnd_drag_canvas = NULL; - ecore_x_window_del(ewl_dnd_drag_win); - ecore_x_dnd_drop(); - - /* Kill all last position references so they don't get - * carried over to the next drag */ - pos = ecore_hash_keys(ewl_dnd_position_hash); - ecore_list_goto_first(pos); - while ((val = ecore_list_remove_first(pos))) { - EWL_EMBED(val)->dnd_last_position = NULL; - ecore_hash_remove(ewl_dnd_position_hash, val); - } - IF_FREE_LIST(pos); - - ewl_dragging_current = 0; - ewl_widget_dnd_reset(); - } - - DRETURN_INT(TRUE, DLEVEL_STABLE); -} -#endif =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_dnd.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -3 -r1.21 -r1.22 --- ewl_dnd.h 4 Jan 2007 05:09:47 -0000 1.21 +++ ewl_dnd.h 11 Mar 2007 22:35:56 -0000 1.22 @@ -13,7 +13,6 @@ extern int EWL_CALLBACK_DND_LEAVE; extern int EWL_CALLBACK_DND_DROP; extern int EWL_CALLBACK_DND_DATA_RECEIVED; - extern int EWL_CALLBACK_DND_DATA_REQUEST; int ewl_dnd_init(void); @@ -25,8 +24,6 @@ Ewl_Widget *ewl_dnd_drag_widget_get(void); int ewl_dnd_status_get(void); - -void ewl_dnd_position_windows_set(Ewl_Widget *w); void ewl_dnd_provided_types_set(Ewl_Widget *w, const char **types); int ewl_dnd_provided_types_contains(Ewl_Widget *w, char *type); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_embed.c,v retrieving revision 1.115 retrieving revision 1.116 diff -u -3 -r1.115 -r1.116 --- ewl_embed.c 11 Mar 2007 07:25:06 -0000 1.115 +++ ewl_embed.c 11 Mar 2007 22:35:56 -0000 1.116 @@ -8,7 +8,6 @@ static Evas_Smart *embedded_smart = NULL; static Ewl_Embed *ewl_embed_active_embed = NULL; -static void ewl_embed_smart_cb_add(Evas_Object *obj); static void ewl_embed_smart_cb_del(Evas_Object *obj); static void ewl_embed_smart_cb_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); @@ -200,7 +199,6 @@ void * ewl_embed_canvas_set(Ewl_Embed *emb, void *canvas, Ewl_Embed_Window *canvas_window) { - Ewl_Widget *w; Ecore_List *paths; char *font_path; char *name = "EWL Embedded Smart Object"; @@ -215,7 +213,7 @@ if (!embedded_smart) { embedded_smart = evas_smart_new(name, - ewl_embed_smart_cb_add, + NULL, ewl_embed_smart_cb_del, NULL, NULL, NULL, NULL, NULL, ewl_embed_smart_cb_move, @@ -235,10 +233,8 @@ emb->smart = evas_object_smart_add(emb->canvas, embedded_smart); evas_object_smart_data_set(emb->smart, emb); - w = EWL_WIDGET(emb); - - if (VISIBLE(w)) - ewl_realize_request(w); + if (VISIBLE(emb)) + ewl_realize_request(EWL_WIDGET(emb)); paths = ewl_theme_font_path_get(); ecore_list_goto_first(paths); @@ -379,6 +375,7 @@ * check if this is a focus change key press and we are not ignoring * focus change events */ + /* FIXME This "Tab" should probably be made a config variable */ if ((!(embed->last.focused && ewl_widget_ignore_focus_change_get(embed->last.focused))) && (!strcmp(keyname, "Tab"))) @@ -454,6 +451,7 @@ /* handle tab focus change (we just drop it on the floor as the * actual focus change was done in key down */ + /* FIXME Should probably make this "Tab" a config variable */ if ((embed->last.focused && (!ewl_widget_ignore_focus_change_get(embed->last.focused))) && (!strcmp(keyname, "Tab"))) @@ -503,9 +501,9 @@ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); ewl_embed_active_set(embed, TRUE); + widget = ewl_container_child_at_recursive_get(EWL_CONTAINER(embed), x, y); - if (!widget) - widget = EWL_WIDGET(embed); + if (!widget) widget = EWL_WIDGET(embed); /* * Save the last selected widget for further reference, do this prior @@ -714,8 +712,7 @@ * 'embed->last.mouse_in' to have become null. Make sure this * pointer is still here */ - if (check) - check = EWL_OBJECT(EWL_WIDGET(check)->parent); + if (check) check = EWL_OBJECT(EWL_WIDGET(check)->parent); } /* @@ -740,18 +737,19 @@ * @param x: the x coordinate of the mouse drop * @param y: the y coordinate of the mouse drop * @param internal: Is this an internal drop? - * @return Returns no value. + * @return Returns the DND drop data type. * @brief Sends the event for a DND drop into an embed. */ const char * ewl_embed_dnd_drop_feed(Ewl_Embed *embed, int x, int y, int internal) { - Ewl_Widget *widget = NULL; + Ewl_Widget *widget = NULL, *parent = NULL; const char *result = NULL; + int i; DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("embed", embed, FALSE); - DCHECK_TYPE_RET("embed", embed, EWL_EMBED_TYPE, FALSE); + DCHECK_PARAM_PTR_RET("embed", embed, NULL); + DCHECK_TYPE_RET("embed", embed, EWL_EMBED_TYPE, NULL); ewl_embed_active_set(embed, TRUE); @@ -766,56 +764,51 @@ break; widget = widget->parent; } + if (!widget) DRETURN_PTR(NULL, DLEVEL_STABLE); - if (widget) { - int i; - Ewl_Widget *parent; - - /* Request a DND data request */ - for (i = 0; i < embed->dnd_types.num_types; i++) { - if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) { - result = embed->dnd_types.types[i]; - break; - } + /* Request a DND data request */ + for (i = 0; i < embed->dnd_types.num_types; i++) { + if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) { + result = embed->dnd_types.types[i]; + break; } + } + if (result) { + Ewl_Event_Dnd_Drop ev; - if (result) { - Ewl_Event_Dnd_Drop ev; - - ev.x = x; - ev.y = y; - - if (internal) { - Ewl_Widget_Drag cb; - - /* Retrieve the callback for widget's data */ - /* FIXME: We shouldn't use widget data like - * this, and there needs to be a data request / - * send protocol with widgets anyways */ - cb = (Ewl_Widget_Drag)ewl_widget_data_get(widget, "DROP_CB"); - if (cb) { - void *drop_data; - drop_data = (*cb)(); - ev.data = drop_data; - } - } else { - /* Handle external drops */ - ev.data = NULL; - } + ev.x = x; + ev.y = y; - embed->last.drop_widget = widget; - parent = widget; - while (parent) { - ewl_callback_call_with_event_data(parent, - EWL_CALLBACK_DND_DROP, &ev); - parent = parent->parent; + if (internal) { + Ewl_Widget_Drag cb; + + /* Retrieve the callback for widget's data */ + /* FIXME: We shouldn't use widget data like + * this, and there needs to be a data request / + * send protocol with widgets anyways */ + cb = (Ewl_Widget_Drag)ewl_widget_data_get(widget, "DROP_CB"); + if (cb) { + void *drop_data; + drop_data = (*cb)(); + ev.data = drop_data; } + } else { + /* Handle external drops */ + ev.data = NULL; } - ewl_dnd_drag_widget_clear(); + embed->last.drop_widget = widget; + parent = widget; + while (parent) { + ewl_callback_call_with_event_data(parent, + EWL_CALLBACK_DND_DROP, &ev); + parent = parent->parent; + } } + ewl_dnd_drag_widget_clear(); + DRETURN_PTR(result, DLEVEL_STABLE); } @@ -827,15 +820,16 @@ * @param py: Where to store the position y value * @param pw: Where to store the position width * @param ph: Where to store the position height - * @return Returns no value. + * @return Returns the type of the DND data * @brief Sends the event for a DND position into an embed. */ const char * ewl_embed_dnd_position_feed(Ewl_Embed *embed, int x, int y, int* px, int* py, int* pw, int* ph) { const char *result = NULL; - Ewl_Widget *widget = NULL; + Ewl_Widget *widget = NULL, *parent = NULL; Ewl_Event_Dnd_Position ev; + int i; DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR_RET("embed", embed, NULL); @@ -858,63 +852,58 @@ widget = widget->parent; } - if (widget) { - int i; - Ewl_Widget *parent; - - /* If the last position event was over a different widget, - * feed the leaving widget a 'null' */ - if (embed->dnd_last_position != widget) { - - if (embed->dnd_last_position) { - - parent = embed->dnd_last_position; - while (parent) { - ewl_callback_call_with_event_data(parent, - EWL_CALLBACK_DND_LEAVE, &ev); - parent = parent->parent; - } - } + if (!widget) { + DWARNING("Could not find widget for dnd position event."); + DRETURN_PTR(NULL, DLEVEL_STABLE); + } - parent = widget; + /* If the last position event was over a different widget, + * feed the leaving widget a 'null' */ + if (embed->dnd_last_position != widget) { + if (embed->dnd_last_position) { + parent = embed->dnd_last_position; while (parent) { ewl_callback_call_with_event_data(parent, - EWL_CALLBACK_DND_ENTER, &ev); + EWL_CALLBACK_DND_LEAVE, &ev); parent = parent->parent; } } - /* - * Pass the position event up the chain - */ parent = widget; - while (parent) { ewl_callback_call_with_event_data(parent, - EWL_CALLBACK_DND_POSITION, &ev); + EWL_CALLBACK_DND_ENTER, &ev); parent = parent->parent; } + } - embed->last.drop_widget = widget; - ewl_dnd_position_windows_set(EWL_WIDGET(embed)); - embed->dnd_last_position = widget; + /* + * Pass the position event up the chain + */ + parent = widget; + while (parent) { + ewl_callback_call_with_event_data(parent, + EWL_CALLBACK_DND_POSITION, &ev); + parent = parent->parent; + } - /* Request a DND data request */ - for (i = 0; i < embed->dnd_types.num_types; i++) { - if (ewl_dnd_accepted_types_contains(widget, embed->dnd_types.types[i])) { - result = embed->dnd_types.types[i]; - break; - } - } + embed->last.drop_widget = widget; + embed->dnd_last_position = widget; - if (px) *px = CURRENT_X(widget); - if (py) *py = CURRENT_Y(widget); - if (pw) *pw = CURRENT_W(widget); - if (ph) *ph = CURRENT_H(widget); - } else { - DWARNING("Could not find widget for dnd position event."); + /* Request a DND data request */ + for (i = 0; i < embed->dnd_types.num_types; i++) { + if (ewl_dnd_accepted_types_contains(widget, + embed->dnd_types.types[i])) { + result = embed->dnd_types.types[i]; + break; + } } + if (px) *px = CURRENT_X(widget); + if (py) *py = CURRENT_Y(widget); + if (pw) *pw = CURRENT_W(widget); + if (ph) *ph = CURRENT_H(widget); + DRETURN_PTR(result, DLEVEL_STABLE); } @@ -963,7 +952,8 @@ * @brief Sends a mouse out event to the last focused widget */ void -ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y, int z, int dir, unsigned int mods) +ewl_embed_mouse_wheel_feed(Ewl_Embed *embed, int x, int y, int z, int dir, + unsigned int mods) { Ewl_Widget *w; Ewl_Event_Mouse_Wheel ev; @@ -981,15 +971,13 @@ ev.dir = dir; w = embed->last.mouse_in; - if (!w) { + if (!w) ewl_callback_call_with_event_data(EWL_WIDGET(embed), - EWL_CALLBACK_MOUSE_WHEEL, - &ev); - } + EWL_CALLBACK_MOUSE_WHEEL, &ev); while (w) { - ewl_callback_call_with_event_data(w, EWL_CALLBACK_MOUSE_WHEEL, - &ev); + ewl_callback_call_with_event_data(w, + EWL_CALLBACK_MOUSE_WHEEL, &ev); w = w->parent; } @@ -998,7 +986,7 @@ /** * @param embed: the embed where the selection data event is to occur - * @param type: The type to feed + * @param type: The type to feed. * @param data: a pointer to the data received that generated the event * @param len: length of the data that generated the event * @param format: The bit format of the data @@ -1006,7 +994,8 @@ * @brief Sends the event for selection data received into an embed. */ void -ewl_embed_dnd_data_received_feed(Ewl_Embed *embed, char *type, void *data, unsigned int len, unsigned int format) +ewl_embed_dnd_data_received_feed(Ewl_Embed *embed, char *type, void *data, + unsigned int len, unsigned int format) { Ewl_Event_Dnd_Data_Received ev; @@ -1028,8 +1017,7 @@ ev.len = len; ev.format= format; ewl_callback_call_with_event_data(embed->last.drop_widget, - EWL_CALLBACK_DND_DATA_RECEIVED, - &ev); + EWL_CALLBACK_DND_DATA_RECEIVED, &ev); } } @@ -1062,8 +1050,7 @@ ev.handle = handle; ev.type = type; ewl_callback_call_with_event_data(embed->last.drag_widget, - EWL_CALLBACK_DND_DATA_REQUEST, - &ev); + EWL_CALLBACK_DND_DATA_REQUEST, &ev); } } @@ -1087,9 +1074,10 @@ DCHECK_PARAM_PTR("path", path); ecore_list_goto_first(ewl_embed_list); - while ((e = ecore_list_next(ewl_embed_list))) + while ((e = ecore_list_next(ewl_embed_list))) { if (REALIZED(e)) evas_font_path_append(e->canvas, path); + } ecore_list_append(ewl_theme_font_path_get(), strdup(path)); @@ -1110,7 +1098,6 @@ DCHECK_PARAM_PTR_RET("window", window, NULL); ecore_list_goto_first(ewl_embed_list); - while ((retemb = ecore_list_next(ewl_embed_list)) != NULL) { if (retemb->canvas_window == window) DRETURN_PTR(retemb, DLEVEL_STABLE); @@ -1149,8 +1136,6 @@ void ewl_embed_object_cache(Ewl_Embed *e, void *obj) { - const char *type; - Ecore_List *obj_list; const Evas_List *clippees; DENTER_FUNCTION(DLEVEL_STABLE); @@ -1171,6 +1156,9 @@ evas_object_clip_unset(clippees->data); if (e->obj_cache) { + Ecore_List *obj_list; + const char *type; + type = evas_object_type_get(obj); obj_list = ecore_hash_get(e->obj_cache, (void *)type); if (!obj_list) { @@ -1189,6 +1177,8 @@ * @param e: embed to request a cached object * @param type: the type of object requested * @return Returns an Evas_Object of the specified type on success. + * @brief Retrieves an object of type @a type from the embed cache, or NULL + * if none found */ void * ewl_embed_object_request(Ewl_Embed *e, char *type) @@ -1204,8 +1194,7 @@ if (!e->obj_cache) return NULL; obj_list = ecore_hash_get(e->obj_cache, type); - if (obj_list) - obj = ecore_list_remove_first(obj_list); + if (obj_list) obj = ecore_list_remove_first(obj_list); DRETURN_PTR(obj, DLEVEL_STABLE); } @@ -1508,7 +1497,7 @@ DCHECK_TYPE("embed", embed, EWL_EMBED_TYPE); DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); - if (embed->last.focused && embed->last.focused != w) + if (embed->last.focused && (embed->last.focused != w)) ewl_callback_call(embed->last.focused, EWL_CALLBACK_FOCUS_OUT); embed->last.focused = w; @@ -1574,7 +1563,6 @@ if ((w == e->last.focused) || (RECURSIVE(w) && ewl_widget_parent_of(w, e->last.focused))) - e->last.focused = ewl_embed_info_parent_find(w); if ((w == e->last.clicked) @@ -1617,11 +1605,9 @@ DCHECK_TYPE("e", e, EWL_EMBED_TYPE); if (e->canvas) { - if (x) - *x = (int)(evas_coord_world_x_to_screen(e->canvas, + if (x) *x = (int)(evas_coord_world_x_to_screen(e->canvas, (Evas_Coord)(xx))); - if (y) - *y = (int)(evas_coord_world_y_to_screen(e->canvas, + if (y) *y = (int)(evas_coord_world_y_to_screen(e->canvas, (Evas_Coord)(yy))); } @@ -1639,7 +1625,7 @@ void ewl_embed_mouse_cursor_set(Ewl_Widget *w) { - int pointer; + int pointer = 0; Ewl_Cursor *argb; Ewl_Embed *embed; @@ -1649,12 +1635,11 @@ embed = ewl_embed_widget_find(w); if (!embed) DRETURN(DLEVEL_STABLE); + if ((argb = ewl_attach_get(w, EWL_ATTACH_TYPE_MOUSE_ARGB_CURSOR))) { pointer = argb->handle; ewl_attach_mouse_cursor_set(w, pointer); } - else - pointer = 0; if (!pointer) { if (!(pointer = (int)ewl_attach_get(w, @@ -1729,7 +1714,7 @@ DENTER_FUNCTION(DLEVEL_STABLE); DCHECK_PARAM_PTR("e", e); DCHECK_TYPE("e", e, EWL_EMBED_TYPE); - + ewl_engine_desktop_size_get(e, w, h); DLEAVE_FUNCTION(DLEVEL_STABLE); @@ -1787,7 +1772,6 @@ DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); emb = EWL_EMBED(w); - ewl_embed_freeze(emb); if (!emb->ev_clip) { @@ -1797,6 +1781,7 @@ emb->ev_clip = ewl_embed_object_request(emb, "rectangle"); if (!emb->ev_clip) emb->ev_clip = evas_object_rectangle_add(emb->canvas); + evas_object_color_set(emb->ev_clip, 0, 0, 0, 0); evas_object_smart_member_add(emb->ev_clip, emb->smart); evas_object_show(emb->ev_clip); @@ -1859,7 +1844,6 @@ DCHECK_TYPE("w", w, EWL_WIDGET_TYPE); emb = EWL_EMBED(w); - if (emb->ev_clip) { ewl_canvas_object_destroy(emb->ev_clip); emb->ev_clip = NULL; @@ -1908,16 +1892,13 @@ while ((child = ecore_dlist_next(EWL_CONTAINER(w)->children))) { int size; - size = ewl_object_preferred_w_get(EWL_OBJECT(child)); if (size > PREFERRED_W(w)) - ewl_object_preferred_inner_w_set(EWL_OBJECT(w), - size); + ewl_object_preferred_inner_w_set(EWL_OBJECT(w), size); size = ewl_object_preferred_h_get(EWL_OBJECT(child)); if (size > PREFERRED_H(w)) - ewl_object_preferred_inner_h_set(EWL_OBJECT(w), - size); + ewl_object_preferred_inner_h_set(EWL_OBJECT(w), size); ewl_object_place(child, CURRENT_X(w), CURRENT_Y(w), CURRENT_W(w), CURRENT_H(w)); @@ -2034,7 +2015,6 @@ void ewl_embed_cache_cleanup(Ewl_Embed *emb) { - Evas_Object *obj; Ecore_List *key_list; DENTER_FUNCTION(DLEVEL_STABLE); @@ -2046,48 +2026,37 @@ key_list = ecore_hash_keys(emb->obj_cache); if (key_list) { char *key; + Evas_Object *obj; + Ecore_List *obj_list; + /* * Iterate over all object types destroying them as we go. No * need to free the key string. */ while ((key = ecore_list_remove_first(key_list))) { - Ecore_List *obj_list; - /* * Now queue all objects for destruction. */ obj_list = ecore_hash_remove(emb->obj_cache, key); while ((obj = ecore_list_remove_first(obj_list))) ewl_canvas_object_destroy(obj); + IF_FREE_LIST(obj_list); } - IF_FREE_LIST(key_list); } - IF_FREE_HASH(emb->obj_cache); DLEAVE_FUNCTION(DLEVEL_STABLE); } static void -ewl_embed_smart_cb_add(Evas_Object *obj __UNUSED__) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - - /* - * Nothing to see here! Move along... - */ - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static void ewl_embed_smart_cb_del(Evas_Object *obj) { Ewl_Embed *emb; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); if (emb) { @@ -2104,11 +2073,12 @@ Ewl_Embed *emb; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); if (emb) - ewl_object_position_request(EWL_OBJECT(emb), (int)(x), - (int)(y)); + ewl_object_position_request(EWL_OBJECT(emb), + (int)(x), (int)(y)); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2119,6 +2089,7 @@ Ewl_Embed *emb; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); if (emb) @@ -2133,10 +2104,10 @@ Ewl_Embed *emb; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); - if (emb) - ewl_widget_show(EWL_WIDGET(emb)); + if (emb) ewl_widget_show(EWL_WIDGET(emb)); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2147,10 +2118,10 @@ Ewl_Embed *emb; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); - if (emb) - ewl_widget_hide(EWL_WIDGET(emb)); + if (emb) ewl_widget_hide(EWL_WIDGET(emb)); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2162,11 +2133,12 @@ Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); w = EWL_WIDGET(emb); - if (emb && w->fx_clip_box && clip != w->fx_clip_box) - evas_object_clip_set(EWL_WIDGET(emb)->fx_clip_box, clip); + if (emb && w->fx_clip_box && (clip != w->fx_clip_box)) + evas_object_clip_set(w->fx_clip_box, clip); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2178,11 +2150,12 @@ Ewl_Widget *w; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("obj", obj); emb = evas_object_smart_data_get(obj); w = EWL_WIDGET(emb); if (emb && w->fx_clip_box) - evas_object_clip_unset(EWL_WIDGET(emb)->fx_clip_box); + evas_object_clip_unset(w->fx_clip_box); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2195,17 +2168,17 @@ Evas_Event_Mouse_Out *ev = event_info; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); embed = data; if (ev->canvas.x < CURRENT_X(embed) - || ev->canvas.x >= CURRENT_X(embed) + CURRENT_W(embed) - || ev->canvas.y < CURRENT_Y(embed) - || ev->canvas.y >= CURRENT_Y(embed) + CURRENT_H(embed)) - { + || ev->canvas.x >= (CURRENT_X(embed) + CURRENT_W(embed)) + || ev->canvas.y < CURRENT_Y(embed) + || ev->canvas.y >= (CURRENT_Y(embed) + CURRENT_H(embed))) ewl_embed_mouse_out_feed(embed, ev->canvas.x, ev->canvas.y, - ewl_ev_modifiers_get()); - } + ewl_ev_modifiers_get()); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2218,6 +2191,8 @@ Evas_Event_Mouse_Down *ev; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); ev = event_info; embed = data; @@ -2235,6 +2210,8 @@ Evas_Event_Mouse_Up *ev; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); ev = event_info; embed = data; @@ -2252,11 +2229,13 @@ Evas_Event_Mouse_Move *ev; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); ev = event_info; embed = data; ewl_embed_mouse_move_feed(embed, ev->cur.canvas.x, ev->cur.canvas.y, - ewl_ev_modifiers_get()); + ewl_ev_modifiers_get()); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -2270,6 +2249,8 @@ Evas_Event_Mouse_Wheel *ev; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); ev = event_info; embed = data; @@ -2289,6 +2270,8 @@ unsigned int key_modifiers = 0; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); ev = event_info; embed = data; @@ -2327,6 +2310,8 @@ unsigned int key_modifiers = 0; DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("data", data, EWL_EMBED_TYPE); embed = data; key_modifiers = ewl_ev_modifiers_get(); =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_expansion.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_expansion.c 14 Feb 2007 20:36:33 -0000 1.2 +++ ewl_expansion.c 11 Mar 2007 22:35:56 -0000 1.3 @@ -46,7 +46,6 @@ DCHECK_PARAM_PTR_RET("cb", cb, FALSE); w = EWL_WIDGET(cb); - if (!ewl_check_init(EWL_CHECK(w))) DRETURN_INT(FALSE, DLEVEL_STABLE); @@ -63,7 +62,6 @@ DRETURN_INT(TRUE, DLEVEL_STABLE); } - /** * @param cb: the expansion to change the status =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_highlight.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- ewl_highlight.c 6 Feb 2007 13:42:17 -0000 1.3 +++ ewl_highlight.c 11 Mar 2007 22:35:56 -0000 1.4 @@ -83,7 +83,6 @@ ewl_callback_prepend(EWL_WIDGET(h), EWL_CALLBACK_DESTROY, ewl_highlight_cb_destroy, w); - DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -136,6 +135,10 @@ ewl_highlight_cb_destroy(Ewl_Widget *w, void *ev __UNUSED__, void *data) { DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + DCHECK_PARAM_PTR("data", data); + DCHECK_TYPE("w", w, EWL_FLOATER_TYPE); + DCHECK_TYPE("data", data, EWL_WIDGET_TYPE); ewl_floater_follow_set(EWL_FLOATER(w), NULL); ewl_callback_del(EWL_WIDGET(data), EWL_CALLBACK_CONFIGURE, =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon.c,v retrieving revision 1.32 retrieving revision 1.33 diff -u -3 -r1.32 -r1.33 --- ewl_icon.c 6 Feb 2007 13:42:17 -0000 1.32 +++ ewl_icon.c 11 Mar 2007 22:35:56 -0000 1.33 @@ -640,12 +640,13 @@ ewl_container_child_prepend(EWL_CONTAINER(icon), icon->alt); /* if the image displayed is the loading image then we switch to the - * alt text */ + * alt text. Also switch to alt text if the image doesn't exist */ img = ewl_icon_theme_icon_path_get(EWL_ICON_IMAGE_LOADING, 0); file = ewl_icon_image_file_get(icon); - if (icon->image && !strcmp(img, file)) + if ((!file || !ecore_file_exists(ewl_icon_image_file_get(icon))) || + (icon->image && !strcmp(img, file))) { - ewl_widget_hide(icon->image); + if (icon->image) ewl_widget_hide(icon->image); ewl_widget_show(icon->alt); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_icon.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- ewl_icon.h 4 Mar 2007 00:52:01 -0000 1.15 +++ ewl_icon.h 11 Mar 2007 22:35:56 -0000 1.16 @@ -42,7 +42,7 @@ */ struct Ewl_Icon { - Ewl_Stock stock; /**< Inherit from Ewl_Box */ + Ewl_Stock stock; /**< Inherit from Ewl_Box */ Ewl_Widget *label; /**< The icons label */ Ewl_Widget *image; /**< The icons image */ Ewl_Widget *alt; /**< The icons alt text */ =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_media.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -3 -r1.26 -r1.27 --- ewl_media.c 12 Feb 2007 13:16:05 -0000 1.26 +++ ewl_media.c 11 Mar 2007 22:35:56 -0000 1.27 @@ -55,20 +55,20 @@ w = EWL_WIDGET(m); - if (!ewl_widget_init(EWL_WIDGET(w))) + if (!ewl_widget_init(w)) DRETURN_INT(FALSE, DLEVEL_STABLE); ewl_widget_appearance_set(w, EWL_MEDIA_TYPE); ewl_widget_inherit(EWL_WIDGET(w), EWL_MEDIA_TYPE); - ewl_callback_append(w, EWL_CALLBACK_REALIZE, ewl_media_cb_realize, - NULL); - ewl_callback_append(w, EWL_CALLBACK_REVEAL, ewl_media_cb_reveal, - NULL); - ewl_callback_append(w, EWL_CALLBACK_UNREALIZE, ewl_media_cb_unrealize, - NULL); - ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_media_cb_configure, - NULL); + ewl_callback_append(w, EWL_CALLBACK_REALIZE, + ewl_media_cb_realize, NULL); + ewl_callback_append(w, EWL_CALLBACK_REVEAL, + ewl_media_cb_reveal, NULL); + ewl_callback_append(w, EWL_CALLBACK_UNREALIZE, + ewl_media_cb_unrealize, NULL); + ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, + ewl_media_cb_configure, NULL); DRETURN_INT(TRUE, DLEVEL_STABLE); } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs