summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChunEon Park <hermet@hermet.pe.kr>2014-02-20 20:44:19 +0900
committerChunEon Park <hermet@hermet.pe.kr>2014-02-20 20:49:01 +0900
commita30fcf41ee3ec74efdc13621bb13937c060b86a6 (patch)
tree523c758ffadd6b12c124a8f0d7e84f69a96baa51
parent2e7e284dae053e552c49f77fd42b4a701737b488 (diff)
tooltip - renamed the new tooltip apis until 1.9 release.
Before elm_tooltip_move_lock_set() elm_tooltip_move_lock_get() After elm_tooltip_move_freeze_push() elm_tooltip_move_freeze_pop() elm_tooltip_move_freeze_get() we're likely to use the freeze rather than lock among the entire apis. it's already discussed in the mailing list.
-rw-r--r--src/bin/test_tooltip.c14
-rw-r--r--src/lib/elm_tooltip.h40
-rw-r--r--src/lib/els_tooltip.c27
3 files changed, 49 insertions, 32 deletions
diff --git a/src/bin/test_tooltip.c b/src/bin/test_tooltip.c
index d5ac0afd0..82c046572 100644
--- a/src/bin/test_tooltip.c
+++ b/src/bin/test_tooltip.c
@@ -200,18 +200,18 @@ _tt_text_replace(void *data EINA_UNUSED,
200} 200}
201 201
202static void 202static void
203_tt_move_lock(void *data EINA_UNUSED, 203_tt_move_freeze(void *data EINA_UNUSED,
204 Evas_Object *obj, 204 Evas_Object *obj,
205 void *event_info EINA_UNUSED) 205 void *event_info EINA_UNUSED)
206{ 206{
207 if (!elm_tooltip_move_lock_get(obj)) 207 if (elm_tooltip_move_freeze_get(obj) == 0)
208 { 208 {
209 elm_tooltip_move_lock_set(obj, EINA_TRUE); 209 elm_tooltip_move_freeze_push(obj);
210 elm_object_tooltip_text_set(obj, "Locked"); 210 elm_object_tooltip_text_set(obj, "Fronzen");
211 } 211 }
212 else 212 else
213 { 213 {
214 elm_tooltip_move_lock_set(obj, EINA_FALSE); 214 elm_tooltip_move_freeze_pop(obj);
215 elm_object_tooltip_text_set(obj, "Free"); 215 elm_object_tooltip_text_set(obj, "Free");
216 } 216 }
217} 217}
@@ -506,9 +506,9 @@ test_tooltip(void *data EINA_UNUSED,
506 evas_object_show(bt); 506 evas_object_show(bt);
507 507
508 bt = elm_button_add(win); 508 bt = elm_button_add(win);
509 elm_object_text_set(bt, "Movement Lock Tooltip, click to change"); 509 elm_object_text_set(bt, "Movement Freeze Tooltip, click to change");
510 elm_object_tooltip_text_set(bt, "Free"); 510 elm_object_tooltip_text_set(bt, "Free");
511 evas_object_smart_callback_add(bt, "clicked", _tt_move_lock, NULL); 511 evas_object_smart_callback_add(bt, "clicked", _tt_move_freeze, NULL);
512 elm_box_pack_end(bx, bt); 512 elm_box_pack_end(bx, bt);
513 evas_object_show(bt); 513 evas_object_show(bt);
514 514
diff --git a/src/lib/elm_tooltip.h b/src/lib/elm_tooltip.h
index 3b1c76a66..f6ffb2dad 100644
--- a/src/lib/elm_tooltip.h
+++ b/src/lib/elm_tooltip.h
@@ -33,36 +33,42 @@ typedef enum
33 } Elm_Tooltip_Orient; 33 } Elm_Tooltip_Orient;
34 34
35/** 35/**
36 * @def elm_tooltip_move_lock_set 36 * This increments the tooltip movement freeze count by one. If the count
37 * @since 1.9 37 * is more than 0, the tooltip position will be fixed.
38 * 38 *
39 * @brief Enable/Disable tooltip movement with respect to mouse pointer 39 * @param obj The tooltip's anchor object
40 * 40 *
41 * @param[in] obj The tooltip's anchor object 41 * @ingroup Tooltips
42 * @param[in] lock If EINA_TRUE, tooltip movement with respect to mouse pointer is disabled 42 * @see elm_tooltip_move_freeze_pop()
43 * @see elm_tooltio_move_freeze_get()
44 * @since 1.9
45 */
46EAPI void elm_tooltip_move_freeze_push(Evas_Object *obj);
47
48/**
49 * This decrements the tooltip freeze count by one.
43 * 50 *
44 * This function allows to enable/disable a tooltip to move with respect to mouse pointer 51 * @param obj The tooltip's anchor object
45 * 52 *
46 * @ingroup Tooltips 53 * @ingroup Tooltips
47 * @see elm_tooltip_move_lock_get 54 * @see elm_tooltip_move_freeze_push()
55 * @since 1.9
48 */ 56 */
49EAPI void elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock); 57EAPI void elm_tooltip_move_freeze_pop(Evas_Object *obj);
50 58
51/** 59/**
52 * @def elm_tooltip_move_lock_get 60 * Get the movement freeze by 1
53 * @since 1.9
54 * 61 *
55 * @brief Get the lock status of tooltip movement with respect to mouse pointer 62 * This gets the movement freeze count by one.
56 * 63 *
57 * @param[in] obj The tooltip's anchor object 64 * @param obj The tooltip's anchor object
58 * @return The lock status of tooltip movement with respect to mouse pointer 65 * @return The movement freeze count
59 *
60 * This function returns the status of tooltip movement with respect to mouse pointer
61 * 66 *
62 * @ingroup Tooltips 67 * @ingroup Tooltips
63 * @see elm_tooltip_move_lock_set 68 * @see elm_tooltip_move_freeze_push()
69 * @since 1.9
64 */ 70 */
65EAPI Eina_Bool elm_tooltip_move_lock_get(const Evas_Object *obj); 71EAPI int elm_tooltip_move_freeze_get(const Evas_Object *obj);
66 72
67/** 73/**
68 * @def elm_object_tooltip_orient_set 74 * @def elm_object_tooltip_orient_set
diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c
index dc899a50e..cdc7c989e 100644
--- a/src/lib/els_tooltip.c
+++ b/src/lib/els_tooltip.c
@@ -57,8 +57,9 @@ struct _Elm_Tooltip
57 double x, y; 57 double x, y;
58 } rel_pos; 58 } rel_pos;
59 Elm_Tooltip_Orient orient; /** orientation for tooltip */ 59 Elm_Tooltip_Orient orient; /** orientation for tooltip */
60 int move_freeze;
61
60 double hide_timeout; /* from theme */ 62 double hide_timeout; /* from theme */
61 Eina_Bool move_lock : 1; /* set/reset tooltip movement with respect to mouse pointer*/
62 Eina_Bool visible_lock:1; 63 Eina_Bool visible_lock:1;
63 Eina_Bool changed_style:1; 64 Eina_Bool changed_style:1;
64 Eina_Bool free_size : 1; 65 Eina_Bool free_size : 1;
@@ -157,7 +158,8 @@ _elm_tooltip_show(Elm_Tooltip *tt)
157 (tt->eventarea, EVAS_CALLBACK_MOVE, _elm_tooltip_obj_move_cb, tt); 158 (tt->eventarea, EVAS_CALLBACK_MOVE, _elm_tooltip_obj_move_cb, tt);
158 evas_object_event_callback_add 159 evas_object_event_callback_add
159 (tt->eventarea, EVAS_CALLBACK_RESIZE, _elm_tooltip_obj_resize_cb, tt); 160 (tt->eventarea, EVAS_CALLBACK_RESIZE, _elm_tooltip_obj_resize_cb, tt);
160 if (!tt->move_lock) 161
162 if (tt->move_freeze == 0)
161 { 163 {
162 //No movement of tooltip upon mouse move if orientation set 164 //No movement of tooltip upon mouse move if orientation set
163 if ((tt->orient <= ELM_TOOLTIP_ORIENT_NONE) || (tt->orient >= ELM_TOOLTIP_ORIENT_LAST)) 165 if ((tt->orient <= ELM_TOOLTIP_ORIENT_NONE) || (tt->orient >= ELM_TOOLTIP_ORIENT_LAST))
@@ -726,19 +728,28 @@ _elm_tooltip_data_clean(Elm_Tooltip *tt)
726} 728}
727 729
728EAPI void 730EAPI void
729elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock) 731elm_tooltip_move_freeze_push(Evas_Object *obj)
730{ 732{
731 ELM_TOOLTIP_GET_OR_RETURN(tt, obj); 733 ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
732 734
733 tt->move_lock = lock; 735 tt->move_freeze++;
734} 736}
735 737
736EAPI Eina_Bool 738EAPI void
737elm_tooltip_move_lock_get(const Evas_Object *obj) 739elm_tooltip_move_freeze_pop(Evas_Object *obj)
738{ 740{
739 ELM_TOOLTIP_GET_OR_RETURN(tt, obj, EINA_FALSE); 741 ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
742
743 tt->move_freeze--;
744 if (tt->move_freeze < 0) tt->move_freeze = 0;
745}
746
747EAPI int
748elm_tooltip_move_freeze_get(const Evas_Object *obj)
749{
750 ELM_TOOLTIP_GET_OR_RETURN(tt, obj, 0);
740 751
741 return tt->move_lock; 752 return tt->move_freeze;
742} 753}
743 754
744EAPI void 755EAPI void