Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_text.c ewl_text_trigger.c ewl_text_trigger.h Log Message: - move the trigger area show/hide into the trigger code as a callback =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text.c,v retrieving revision 1.168 retrieving revision 1.169 diff -u -3 -r1.168 -r1.169 --- ewl_text.c 17 Jul 2007 22:38:20 -0000 1.168 +++ ewl_text.c 18 Jul 2007 14:30:04 -0000 1.169 @@ -3757,7 +3757,6 @@ void ewl_text_triggers_show(Ewl_Text *t) { - Ewl_Widget *area; Ewl_Text_Trigger *cur; DENTER_FUNCTION(DLEVEL_STABLE); @@ -3768,21 +3767,10 @@ { ecore_list_goto_first(t->triggers); while ((cur = ecore_list_next(t->triggers))) - { - if (!cur->areas) continue; - - ecore_list_goto_first(cur->areas); - while ((area = ecore_list_next(cur->areas))) - ewl_widget_show(area); - } + ewl_widget_show(EWL_WIDGET(cur)); } - if (t->selection) - { - ecore_list_goto_first(EWL_TEXT_TRIGGER(t->selection)->areas); - while ((area = ecore_list_next(EWL_TEXT_TRIGGER(t->selection)->areas))) - ewl_widget_show(area); - } + if (t->selection) ewl_widget_show(t->selection); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -3796,7 +3784,6 @@ void ewl_text_triggers_hide(Ewl_Text *t) { - Ewl_Widget *area; Ewl_Text_Trigger *cur; DENTER_FUNCTION(DLEVEL_STABLE); @@ -3808,22 +3795,11 @@ { ecore_list_goto_first(t->triggers); while ((cur = ecore_list_next(t->triggers))) - { - if (!cur->areas) continue; - - ecore_list_goto_first(cur->areas); - while ((area = ecore_list_next(cur->areas))) - ewl_widget_hide(area); - } + ewl_widget_hide(EWL_WIDGET(cur)); } /* hide the selection */ - if (t->selection && EWL_TEXT_TRIGGER(t->selection)->areas) - { - ecore_list_goto_first(EWL_TEXT_TRIGGER(t->selection)->areas); - while ((area = ecore_list_next(EWL_TEXT_TRIGGER(t->selection)->areas))) - ewl_widget_hide(area); - } + if (t->selection) ewl_widget_hide(t->selection); DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -3914,3 +3890,4 @@ DLEAVE_FUNCTION(DLEVEL_STABLE); } + =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text_trigger.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -3 -r1.2 -r1.3 --- ewl_text_trigger.c 4 Jun 2007 20:37:41 -0000 1.2 +++ ewl_text_trigger.c 18 Jul 2007 14:30:04 -0000 1.3 @@ -83,7 +83,11 @@ ewl_widget_inherit(EWL_WIDGET(trigger), EWL_TEXT_TRIGGER_TYPE); ewl_callback_prepend(EWL_WIDGET(trigger), EWL_CALLBACK_DESTROY, - ewl_text_trigger_cb_destroy, NULL); + ewl_text_trigger_cb_destroy, NULL); + ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_SHOW, + ewl_text_trigger_cb_show, NULL); + ewl_callback_append(EWL_WIDGET(trigger), EWL_CALLBACK_HIDE, + ewl_text_trigger_cb_hide, NULL); trigger->areas = ecore_list_new(); trigger->type = type; @@ -130,7 +134,6 @@ ecore_list_remove(t->text_parent->triggers); t->text_parent = NULL; - t->areas = NULL; DLEAVE_FUNCTION(DLEVEL_STABLE); } @@ -443,6 +446,62 @@ ewl_callback_call_with_event_data(EWL_WIDGET(trigger), EWL_CALLBACK_MOUSE_DOWN, ev); + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param w: The trigger to work with + * @param ev: UNUSED + * @param data: UNUSED + * @return Returns no value + * @brief Hides the trigger + */ +void +ewl_text_trigger_cb_hide(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) +{ + Ewl_Widget *area; + Ewl_Text_Trigger *trig; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, EWL_TEXT_TRIGGER_TYPE); + + trig = EWL_TEXT_TRIGGER(w); + if (!trig->areas) DRETURN(DLEVEL_STABLE);; + + ecore_list_goto_first(trig->areas); + while ((area = ecore_list_next(trig->areas))) + ewl_widget_hide(area); + + DLEAVE_FUNCTION(DLEVEL_STABLE); +} + +/** + * @param w: The trigger to work with + * @param ev: UNUSED + * @param data: UNUSED + * @return Returns no value + * @brief Shows the trigger + */ +void +ewl_text_trigger_cb_show(Ewl_Widget *w, void *ev __UNUSED__, + void *data __UNUSED__) +{ + Ewl_Widget *area; + Ewl_Text_Trigger *trig; + + DENTER_FUNCTION(DLEVEL_STABLE); + DCHECK_PARAM_PTR("w", w); + DCHECK_TYPE("w", w, EWL_TEXT_TRIGGER_TYPE); + + trig = EWL_TEXT_TRIGGER(w); + if (!trig->areas) DRETURN(DLEVEL_STABLE); + + ecore_list_goto_first(trig->areas); + while ((area = ecore_list_next(trig->areas))) + ewl_widget_show(area); + DLEAVE_FUNCTION(DLEVEL_STABLE); } =================================================================== RCS file: /cvs/e/e17/libs/ewl/src/lib/ewl_text_trigger.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -3 -r1.1 -r1.2 --- ewl_text_trigger.h 4 Jun 2007 18:37:34 -0000 1.1 +++ ewl_text_trigger.h 18 Jul 2007 14:30:04 -0000 1.2 @@ -86,6 +86,8 @@ void ewl_text_triggers_show(Ewl_Text *t); void ewl_text_triggers_hide(Ewl_Text *t); +void ewl_text_trigger_cb_show(Ewl_Widget *w, void *ev, void *data); +void ewl_text_trigger_cb_hide(Ewl_Widget *w, void *ev, void *data); void ewl_text_trigger_cb_mouse_in(Ewl_Widget *w, void *ev, void *data); void ewl_text_trigger_cb_mouse_out(Ewl_Widget *w, void *ev, void *data); void ewl_text_trigger_cb_mouse_up(Ewl_Widget *w, void *ev, void *data); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs