elm_tooltip_movement_lock_set() ?

how about _freeze_set() ?
we already use the freeze word entirely.

------------------------------------
-Regards, Hermet-

-----Original Message-----
From: "abhi"<a.aryadi...@samsung.com> 
To: <g...@lists.enlightenment.org>; 
Cc: 
Sent: 2014-01-13 (월) 15:47:26
Subject: [EGIT] [core/elementary] master 01/06: Adding 
elm_tooltip_movement_lock_set() and elm_tooltip_movement_lock_get()

raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=1832450176b188773557c39e5cf1eee0f47a8858

commit 1832450176b188773557c39e5cf1eee0f47a8858
Author: abhi <a.aryadipta>@samsung.com>
Date:   Mon Jan 13 15:22:47 2014 +0900

    Adding elm_tooltip_movement_lock_set() and elm_tooltip_movement_lock_get()
    
    Summary: These APIs allow to enable/disable a tooltip to move with respect 
to mouse pointer
    
    Test Plan: elm_tooltip_movement_lock_set(), 
elm_tooltip_movement_lock_get(), elementary_test -to tooltip
    
    Reviewers: singh.amitesh, seoz, raster
    
    Reviewed By: raster
    
    CC: raster
    
    Differential Revision: https://phab.enlightenment.org/D369
---
 ChangeLog                4 ++++
 NEWS                     2 ++
 src/bin/test_tooltip.c  24 ++++++++++++++++++++++++
 src/lib/elm_tooltip.h   32 ++++++++++++++++++++++++++++++++
 src/lib/els_tooltip.c   29 ++++++++++++++++++++++++-----
 5 files changed, 86 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 56975bb..f845744 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1772,3 +1772,7 @@
 2013-12-01  Mike Blumenkrantz
 
         * fix mouse eventing on e border theme
+
+2013-12-09  Abhinandan Aryadipta (aryarockstar)
+
+        * tooltip: Added elm_tooltip_move_lock_set() and 
elm_tooltip_move_lock_get().
diff --git a/NEWS b/NEWS
index 85da746..a32848f 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ Changes since Elementary 1.8.0:
 
 Additions:
 
+   * Add elm_tooltip_move_lock_set() and elm_tooltip_move_lock_get()
+
 Improvements:
 
 Fixes:
diff --git a/src/bin/test_tooltip.c b/src/bin/test_tooltip.c
index 332eced..d5ac0af 100644
--- a/src/bin/test_tooltip.c
+++ b/src/bin/test_tooltip.c
@@ -200,6 +200,23 @@ _tt_text_replace(void *data       EINA_UNUSED,
 }
 
 static void
+_tt_move_lock(void *data       EINA_UNUSED,
+              Evas_Object     *obj,
+              void *event_info EINA_UNUSED)
+{
+   if (!elm_tooltip_move_lock_get(obj))
+     {
+        elm_tooltip_move_lock_set(obj, EINA_TRUE);
+        elm_object_tooltip_text_set(obj, "Locked");
+     }
+   else
+     {
+        elm_tooltip_move_lock_set(obj, EINA_FALSE);
+        elm_object_tooltip_text_set(obj, "Free");
+     }
+}
+
+static void
 _tt_orient_text_replace(void *data       EINA_UNUSED,
                         Evas_Object     *obj,
                         void *event_info EINA_UNUSED)
@@ -489,6 +506,13 @@ test_tooltip(void *data       EINA_UNUSED,
    evas_object_show(bt);
 
    bt = elm_button_add(win);
+   elm_object_text_set(bt, "Movement Lock Tooltip, click to change");
+   elm_object_tooltip_text_set(bt, "Free");
+   evas_object_smart_callback_add(bt, "clicked", _tt_move_lock, NULL);
+   elm_box_pack_end(bx, bt);
+   evas_object_show(bt);
+
+   bt = elm_button_add(win);
    elm_object_text_set(bt, "Orient Tooltip, click to change");
    elm_object_tooltip_text_set(bt, "Top Left");
    elm_object_tooltip_orient_set(bt, ELM_TOOLTIP_ORIENT_TOP_LEFT);
diff --git a/src/lib/elm_tooltip.h b/src/lib/elm_tooltip.h
index 21bbfcd..3b1c76a 100644
--- a/src/lib/elm_tooltip.h
+++ b/src/lib/elm_tooltip.h
@@ -33,6 +33,38 @@ typedef enum
  } Elm_Tooltip_Orient;
 
 /**
+ * @def elm_tooltip_move_lock_set
+ * @since 1.9
+ *
+ * @brief Enable/Disable tooltip movement with respect to mouse pointer
+ *
+ * @param[in] obj The tooltip's anchor object
+ * @param[in] lock If EINA_TRUE, tooltip movement with respect to mouse 
pointer is disabled
+ *
+ * This function allows to enable/disable a tooltip to move with respect to 
mouse pointer
+ *
+ * @ingroup Tooltips
+ * @see elm_tooltip_move_lock_get
+ */
+EAPI void elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock);
+
+/**
+ * @def elm_tooltip_move_lock_get
+ * @since 1.9
+ *
+ * @brief Get the lock status of tooltip movement with respect to mouse pointer
+ *
+ * @param[in] obj The tooltip's anchor object
+ * @return The lock status of tooltip movement with respect to mouse pointer
+ *
+ * This function returns the status of tooltip movement with respect to mouse 
pointer
+ *
+ * @ingroup Tooltips
+ * @see elm_tooltip_move_lock_set
+ */
+EAPI Eina_Bool elm_tooltip_move_lock_get(const Evas_Object *obj);
+
+/**
  * @def elm_object_tooltip_orient_set
  * @since 1.9
  *
diff --git a/src/lib/els_tooltip.c b/src/lib/els_tooltip.c
index 5606123..867ad84 100644
--- a/src/lib/els_tooltip.c
+++ b/src/lib/els_tooltip.c
@@ -58,6 +58,7 @@ struct _Elm_Tooltip
      } rel_pos;
    Elm_Tooltip_Orient       orient; /** orientation for tooltip */
    double                   hide_timeout; /* from theme */
+   Eina_Bool                move_lock : 1; /* set/reset tooltip movement with 
respect to mouse pointer*/
    Eina_Bool                visible_lock:1;
    Eina_Bool                changed_style:1;
    Eina_Bool                free_size : 1;
@@ -156,13 +157,15 @@ _elm_tooltip_show(Elm_Tooltip *tt)
      (tt->eventarea, EVAS_CALLBACK_MOVE, _elm_tooltip_obj_move_cb, tt);
    evas_object_event_callback_add
      (tt->eventarea, EVAS_CALLBACK_RESIZE, _elm_tooltip_obj_resize_cb, tt);
-   //No movement of tooltip upon mouse move if orientation set
-   if ((tt->orient <= ELM_TOOLTIP_ORIENT_NONE)  (tt->orient >= 
ELM_TOOLTIP_ORIENT_LAST))
+   if (!tt->move_lock)
      {
-        evas_object_event_callback_add
-        (tt->eventarea, EVAS_CALLBACK_MOUSE_MOVE, 
(Evas_Object_Event_Cb)_elm_tooltip_obj_mouse_move_cb, tt);
+      //No movement of tooltip upon mouse move if orientation set
+      if ((tt->orient <= ELM_TOOLTIP_ORIENT_NONE)  (tt->orient >= 
ELM_TOOLTIP_ORIENT_LAST))
+        {
+           evas_object_event_callback_add
+           (tt->eventarea, EVAS_CALLBACK_MOUSE_MOVE, 
(Evas_Object_Event_Cb)_elm_tooltip_obj_mouse_move_cb, tt);
+        }
      }
-
    tt->changed_style = EINA_TRUE;
    _elm_tooltip_reconfigure_job_start(tt);
 }
@@ -724,6 +727,22 @@ _elm_tooltip_data_clean(Elm_Tooltip *tt)
 }
 
 EAPI void
+elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock)
+{
+   ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
+
+   tt->move_lock = lock;
+}
+
+EAPI Eina_Bool
+elm_tooltip_move_lock_get(const Evas_Object *obj)
+{
+   ELM_TOOLTIP_GET_OR_RETURN(tt, obj, EINA_FALSE);
+
+   return tt->move_lock;
+}
+
+EAPI void
 elm_object_tooltip_orient_set(Evas_Object *obj, Elm_Tooltip_Orient orient)
 {
    ELM_TOOLTIP_GET_OR_RETURN(tt, obj);

-- 



------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to