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.
This commit is contained in:
ChunEon Park 2014-02-20 20:44:19 +09:00
parent d95f67d9c9
commit 390d70d95b
3 changed files with 52 additions and 35 deletions

View File

@ -200,18 +200,18 @@ _tt_text_replace(void *data EINA_UNUSED,
}
static void
_tt_move_lock(void *data EINA_UNUSED,
_tt_move_freeze(void *data EINA_UNUSED,
Evas_Object *obj,
void *event_info EINA_UNUSED)
{
if (!elm_tooltip_move_lock_get(obj))
if (elm_tooltip_move_freeze_get(obj) == 0)
{
elm_tooltip_move_lock_set(obj, EINA_TRUE);
elm_object_tooltip_text_set(obj, "Locked");
elm_tooltip_move_freeze_push(obj);
elm_object_tooltip_text_set(obj, "Fronzen");
}
else
{
elm_tooltip_move_lock_set(obj, EINA_FALSE);
elm_tooltip_move_freeze_pop(obj);
elm_object_tooltip_text_set(obj, "Free");
}
}
@ -506,9 +506,9 @@ 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_text_set(bt, "Movement Freeze Tooltip, click to change");
elm_object_tooltip_text_set(bt, "Free");
evas_object_smart_callback_add(bt, "clicked", _tt_move_lock, NULL);
evas_object_smart_callback_add(bt, "clicked", _tt_move_freeze, NULL);
elm_box_pack_end(bx, bt);
evas_object_show(bt);

View File

@ -33,36 +33,42 @@ typedef enum
} Elm_Tooltip_Orient;
/**
* @def elm_tooltip_move_lock_set
* @since 1.9
* This increments the tooltip movement freeze count by one. If the count
* is more than 0, the tooltip position will be fixed.
*
* @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
* @param obj The tooltip's anchor object
*
* @ingroup Tooltips
* @see elm_tooltip_move_lock_get
* @see elm_tooltip_move_freeze_pop()
* @see elm_tooltio_move_freeze_get()
* @since 1.9
*/
EAPI void elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock);
EAPI void elm_tooltip_move_freeze_push(Evas_Object *obj);
/**
* @def elm_tooltip_move_lock_get
* @since 1.9
* This decrements the tooltip freeze count by one.
*
* @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
* @param obj The tooltip's anchor object
*
* @ingroup Tooltips
* @see elm_tooltip_move_lock_set
* @see elm_tooltip_move_freeze_push()
* @since 1.9
*/
EAPI Eina_Bool elm_tooltip_move_lock_get(const Evas_Object *obj);
EAPI void elm_tooltip_move_freeze_pop(Evas_Object *obj);
/**
* Get the movement freeze by 1
*
* This gets the movement freeze count by one.
*
* @param obj The tooltip's anchor object
* @return The movement freeze count
*
* @ingroup Tooltips
* @see elm_tooltip_move_freeze_push()
* @since 1.9
*/
EAPI int elm_tooltip_move_freeze_get(const Evas_Object *obj);
/**
* @def elm_object_tooltip_orient_set

View File

@ -57,8 +57,9 @@ struct _Elm_Tooltip
double x, y;
} rel_pos;
Elm_Tooltip_Orient orient; /** orientation for tooltip */
int move_freeze;
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;
@ -157,7 +158,8 @@ _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);
if (!tt->move_lock)
if (tt->move_freeze == 0)
{
//No movement of tooltip upon mouse move if orientation set
if ((tt->orient <= ELM_TOOLTIP_ORIENT_NONE) || (tt->orient >= ELM_TOOLTIP_ORIENT_LAST))
@ -726,19 +728,28 @@ _elm_tooltip_data_clean(Elm_Tooltip *tt)
}
EAPI void
elm_tooltip_move_lock_set(Evas_Object *obj, Eina_Bool lock)
elm_tooltip_move_freeze_push(Evas_Object *obj)
{
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
tt->move_lock = lock;
tt->move_freeze++;
}
EAPI Eina_Bool
elm_tooltip_move_lock_get(const Evas_Object *obj)
EAPI void
elm_tooltip_move_freeze_pop(Evas_Object *obj)
{
ELM_TOOLTIP_GET_OR_RETURN(tt, obj, EINA_FALSE);
ELM_TOOLTIP_GET_OR_RETURN(tt, obj);
return tt->move_lock;
tt->move_freeze--;
if (tt->move_freeze < 0) tt->move_freeze = 0;
}
EAPI int
elm_tooltip_move_freeze_get(const Evas_Object *obj)
{
ELM_TOOLTIP_GET_OR_RETURN(tt, obj, 0);
return tt->move_freeze;
}
EAPI void