#include <elm_finger.h> //Done
#include <elm_flip.h> //Done. There are many TODOs in flip.c
#include <elm_flipselector.h> //Done + XXX in header. There are many TODOs in flipselector.c
-#include <elm_focus.h>
+#include <elm_focus.h> //Done + XXX in header
#include <elm_fonts.h> //Done + XXX in header
#include <elm_frame.h> //Done + XXX in header
#include <elm_gengrid.h>
* Flush all config settings then apply those settings to all applications
* using elementary on the current display.
* Following functions will update the config settings
- * @li elm_scale_set()
- * @li elm_finger_size_set()
- * @li elm_profile_set()
- * @li elm_font_overlay_set()
* @li elm_cache_flush_interval_set()
* @li elm_cache_flush_enabled_set()
- * @li elm_font_cache_set()
- * @li elm_image_cache_set()
* @li elm_edje_file_cache_set()
* @li elm_edje_collection_cache_set()
+ * @li elm_finger_size_set()
+ * @li elm_focus_highlight_enabled_set()
+ * @li elm_focus_highlight_animate_set()
+ * @li elm_font_overlay_set()
+ * @li elm_font_cache_set()
+ * @li elm_image_cache_set()
+ * @li elm_profile_set()
+ * @li elm_scale_set()
* @li elm_scroll_bounce_enabled_set()
* @li elm_scroll_bounce_friction_set()
* @li elm_scroll_page_scroll_friction_set()
EINA_DEPRECATED EAPI void elm_object_unfocus(Evas_Object *obj);
/**
+ * Give focus to near object in one direction.
+ *
+ * Give focus to near object in direction of one object.
+ * If none focusable object in given direction, the focus will not change.
+ *
+ * @param obj The reference object
+ * @param x Horizontal component of direction to focus
+ * @param y Vertical component of direction to focus
+ *
+ * @deprecated Support it later.
+ * @ingroup Focus
+ */
+EINA_DEPRECATED EAPI void elm_object_focus_direction_go(Evas_Object *obj, int x, int y);
+
+/**
* @brief Set the frame label
*
* @param obj The frame object
*
* @param engine The rendering engine's name
*
- * This sets global rendering engine that is applied to all Elementary
- * applications. Note that it will take effect only to Elementary windows
- * created after this is called.
+ * Note that it will take effect only to Elementary windows created after
+ * this is called.
*
* @see elm_win_add()
*/
* Get the enable status of the focus highlight
*
* This gets whether the highlight on focused objects is enabled or not
+ *
+ * @see elm_focus_highlight_enabled_set()
* @ingroup Focus
*/
EAPI Eina_Bool elm_focus_highlight_enabled_get(void);
* @param enable Enable highlight if EINA_TRUE, disable otherwise
*
* Set whether to show or not the highlight on focused objects
+ *
+ * Note that it will take effect only to Elementary windows created after
+ * this is called.
+ *
+ * @see elm_win_add()
+ *
* @ingroup Focus
*/
EAPI void elm_focus_highlight_enabled_set(Eina_Bool enable);
* Set whether the focus highlight, if enabled, will animate its switch from
* one object to the next
*
+ * Note that it will take effect only to Elementary windows created after
+ * this is called.
+ *
+ * @see elm_win_add()
+ *
* @ingroup Focus
*/
EAPI void elm_focus_highlight_animate_set(Eina_Bool animate);
EAPI void elm_object_focus_set(Evas_Object *obj, Eina_Bool focus);
/**
- * Set the ability for an Element object to be focused
+ * Set the ability for an Elmentary object to be focused
*
* @param obj The Elementary object to operate on
* @param enable @c EINA_TRUE if the object can be focused, @c
*
* @ingroup Focus
*/
+//XXX: How about elm_object_focus_move()? focus_next() ?
EAPI void elm_object_focus_cycle(Evas_Object *obj, Elm_Focus_Direction dir);
/**
- * Give focus to near object in one direction.
- *
- * Give focus to near object in direction of one object.
- * If none focusable object in given direction, the focus will not change.
- *
- * @param obj The reference object
- * @param x Horizontal component of direction to focus
- * @param y Vertical component of direction to focus
- *
- * @ingroup Focus
- */
-EAPI void elm_object_focus_direction_go(Evas_Object *obj, int x, int y);
-
-/**
* Make the elementary object and its children to be unfocusable
* (or focusable).
*
* @see elm_object_tree_unfocusable_get()
*
* @ingroup Focus
+ *
*/
+ //XXX: How about elm_object_tree_focus_allow_set()?
EAPI void elm_object_tree_unfocusable_set(Evas_Object *obj, Eina_Bool tree_unfocusable);
/**
*
* @ingroup Focus
*/
+//XXX: How about elm_object_tree_focus_allow_get()?
EAPI Eina_Bool elm_object_tree_unfocusable_get(const Evas_Object *obj);
Eina_Bool focus)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
+
+ if (focus == elm_widget_focus_get(obj)) return;
+
if (focus)
- {
- if (elm_widget_focus_get(obj)) return;
- elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
- }
+ elm_widget_focus_cycle(obj, ELM_FOCUS_NEXT);
else
- {
- if (!elm_widget_can_focus_get(obj)) return;
- elm_widget_focused_object_clear(obj);
- }
+ elm_widget_focused_object_clear(obj);
}
EAPI void
{
EINA_SAFETY_ON_NULL_RETURN(obj);
elm_widget_can_focus_set(obj, enable);
+/*FIXME: According to the elm_object_focus_allow_get(), child_can_focus field
+of the parent should be updated. Otherwise, the checking of it's child focus allow states should not be in elm_object_focus_allow_get() */
}
EAPI Eina_Bool
Evas_Object *relative_child)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
- EINA_SAFETY_ON_NULL_RETURN(child);
elm_widget_focus_custom_chain_append(obj, child, relative_child);
}
Evas_Object *relative_child)
{
EINA_SAFETY_ON_NULL_RETURN(obj);
- EINA_SAFETY_ON_NULL_RETURN(child);
elm_widget_focus_custom_chain_prepend(obj, child, relative_child);
}
Eina_Bool can_focus)
{
API_ENTRY return;
- sd->can_focus = can_focus;
+
+ can_focus = !!can_focus;
+
+ if (sd->can_focus == can_focus) return;
+
if (can_focus)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
{
API_ENTRY return;
+ tree_unfocusable = !!tree_unfocusable;
if (sd->tree_unfocusable == tree_unfocusable) return;
- sd->tree_unfocusable = !!tree_unfocusable;
+ sd->tree_unfocusable = tree_unfocusable;
elm_widget_focus_tree_unfocusable_handle(obj);
}
elm_widget_focus_custom_chain_get(const Evas_Object *obj)
{
API_ENTRY return NULL;
- return (const Eina_List *)sd->focus_chain;
+ return (const Eina_List *) sd->focus_chain;
}
/**
{
API_ENTRY return;
EINA_SAFETY_ON_NULL_RETURN(child);
- if (!sd->focus_next_func)
- return;
+ if (!sd->focus_next_func) return;
evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL,
_elm_object_focus_chain_del_cb, sd);
if (!relative_child)
- {
- sd->focus_chain = eina_list_append(sd->focus_chain, child);
- return;
- }
-
- sd->focus_chain = eina_list_append_relative(sd->focus_chain, child, relative_child);
- return;
+ sd->focus_chain = eina_list_append(sd->focus_chain, child);
+ else
+ sd->focus_chain = eina_list_append_relative(sd->focus_chain,
+ child, relative_child);
}
/**
{
API_ENTRY return;
EINA_SAFETY_ON_NULL_RETURN(child);
- if (!sd->focus_next_func)
- return;
+
+ if (!sd->focus_next_func) return;
evas_object_event_callback_del_full(child, EVAS_CALLBACK_DEL,
_elm_object_focus_chain_del_cb, sd);
if (!relative_child)
- {
- sd->focus_chain = eina_list_prepend(sd->focus_chain, child);
- return;
- }
-
- sd->focus_chain = eina_list_prepend_relative(sd->focus_chain, child, relative_child);
- return;
+ sd->focus_chain = eina_list_prepend(sd->focus_chain, child);
+ else
+ sd->focus_chain = eina_list_prepend_relative(sd->focus_chain,
+ child, relative_child);
}
/**
*
* @ingroup Widget
*/
+//XXX: If x, y indicates the elements of the directional vector,
+//It would be better if these values are the normalized value(float x, float y)
+//or degree.
EAPI void
elm_widget_focus_direction_go(Evas_Object *obj __UNUSED__,
int x __UNUSED__,
{
API_ENTRY return;
+ //FIXME: Need to check whether the object is unfocusable or not.
+
if (!elm_widget_parent_get(obj))
elm_widget_focused_object_clear(obj);
else