Enlightenment CVS committal Author : dj2 Project : e17 Module : libs/ewl
Dir : e17/libs/ewl/src/lib Modified Files: ewl_entry.c ewl_entry.h Log Message: - remove the cursor blinking code - make the edje handle cursor blinking. Blink as you want, when ewl thinks you shouldn't it will send a 'noblink' signal. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- ewl_entry.c 17 Nov 2005 06:44:17 -0000 1.36 +++ ewl_entry.c 21 Nov 2005 22:10:36 -0000 1.37 @@ -3,12 +3,6 @@ #include "ewl_macros.h" #include "ewl_private.h" -#define EWL_ENTRY_CURSOR_ON_TIME 0.9 -#define EWL_ENTRY_CURSOR_OFF_TIME 0.25 - -static int ewl_entry_cursor_cb_flash_timer(void *data); -static void ewl_entry_cursor_timer_set(Ewl_Entry_Cursor *c, double time); - /** * @param text: The text to set into the entry * @return Returns a new Ewl_Widget on success or NULL on failure @@ -292,9 +286,8 @@ event = ev; e = EWL_ENTRY(w); - /* reset the cursor blink on key down */ - ewl_entry_cursor_timer_set(EWL_ENTRY_CURSOR(e->cursor), - EWL_ENTRY_CURSOR_ON_TIME); + /* reset the cursor blink */ + ewl_widget_state_set(EWL_WIDGET(e->cursor), "noblink"); if (!strcmp(event->keyname, "Left")) ewl_entry_cursor_move_left(e); @@ -551,11 +544,6 @@ ewl_widget_inherit(EWL_WIDGET(c), "cursor"); c->parent = parent; - ewl_callback_append(EWL_WIDGET(c), EWL_CALLBACK_SHOW, - ewl_entry_cursor_cb_show, NULL); - ewl_callback_append(EWL_WIDGET(c), EWL_CALLBACK_HIDE, - ewl_entry_cursor_cb_hide, NULL); - DRETURN_INT(TRUE, DLEVEL_STABLE); } @@ -582,77 +570,3 @@ DLEVEL_STABLE); } -void -ewl_entry_cursor_cb_show(Ewl_Widget *w, void *ev __UNUSED__, - void *data __UNUSED__) -{ - Ewl_Entry_Cursor *c; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - DCHECK_TYPE("w", w, "widget"); - - c = EWL_ENTRY_CURSOR(w); - ewl_entry_cursor_timer_set(c, EWL_ENTRY_CURSOR_ON_TIME); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -void -ewl_entry_cursor_cb_hide(Ewl_Widget *w, void *ev __UNUSED__, - void *data __UNUSED__) -{ - Ewl_Entry_Cursor *c; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("w", w); - DCHECK_TYPE("w", w, "widget"); - - c = EWL_ENTRY_CURSOR(w); - ewl_entry_cursor_timer_set(c, 0.0); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - -static int -ewl_entry_cursor_cb_flash_timer(void *data) -{ - Ewl_Entry_Cursor *c; - - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR_RET("data", data, 0); - - c = data; - - if (c && VISIBLE(c)) - { - ewl_widget_hide(EWL_WIDGET(c)); - ewl_entry_cursor_timer_set(c, EWL_ENTRY_CURSOR_OFF_TIME); - } - else if (c) - ewl_widget_show(EWL_WIDGET(c)); - - - DRETURN_INT(0, DLEVEL_STABLE); -} - -/* - * This will setup the timer for the cursor blink. If you pass 0.0 it will - * just remove the timer - */ -static void -ewl_entry_cursor_timer_set(Ewl_Entry_Cursor *c, double time) -{ - DENTER_FUNCTION(DLEVEL_STABLE); - DCHECK_PARAM_PTR("c", c); - DCHECK_TYPE("c", c, "cursor"); - - if (c->timer) ecore_timer_del(c->timer); - c->timer = NULL; - - if (time > 0) - c->timer = ecore_timer_add(time, ewl_entry_cursor_cb_flash_timer, c); - - DLEAVE_FUNCTION(DLEVEL_STABLE); -} - =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_entry.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- ewl_entry.h 3 Nov 2005 01:05:56 -0000 1.12 +++ ewl_entry.h 21 Nov 2005 22:10:36 -0000 1.13 @@ -62,8 +62,5 @@ void ewl_entry_cursor_position_set(Ewl_Entry_Cursor *c, unsigned int pos); unsigned int ewl_entry_cursor_position_get(Ewl_Entry_Cursor *c); -void ewl_entry_cursor_cb_show(Ewl_Widget *w, void *ev, void *data); -void ewl_entry_cursor_cb_hide(Ewl_Widget *w, void *ev, void *data); - #endif /* __EWL_ENTRY_H__ */ ------------------------------------------------------- This SF.Net email is sponsored by the JBoss Inc. Get Certified Today Register for a JBoss Training Course. Free Certification Exam for All Training Attendees Through End of 2005. For more info visit: http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs