forked from enlightenment/efl
Elm Toolbar Item: Migrate to Eo
This commit is contained in:
parent
fffa035895
commit
d1db1d81dc
|
@ -618,7 +618,8 @@ elm_multibuttonentry_item.eo \
|
|||
elm_naviframe_item.eo \
|
||||
elm_genlist_item.eo \
|
||||
elm_gengrid_item.eo \
|
||||
elm_list_item.eo
|
||||
elm_list_item.eo \
|
||||
elm_toolbar_item.eo
|
||||
|
||||
elm_eolian_c = $(elm_eolian_files:%.eo=%.eo.c)
|
||||
elm_eolian_h = $(elm_eolian_files:%.eo=%.eo.h)
|
||||
|
@ -744,7 +745,8 @@ elementaryeolianfiles_DATA = \
|
|||
elm_naviframe_item.eo \
|
||||
elm_genlist_item.eo \
|
||||
elm_gengrid_item.eo \
|
||||
elm_list_item.eo
|
||||
elm_list_item.eo \
|
||||
elm_toolbar_item.eo
|
||||
|
||||
EXTRA_DIST += ${elementaryeolianfiles_DATA}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -41,322 +41,42 @@ typedef enum
|
|||
|
||||
typedef struct _Elm_Toolbar_Item_State Elm_Toolbar_Item_State; /**< State of a Elm_Toolbar_Item. Can be created with elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). */
|
||||
|
||||
/**
|
||||
* Get the item after @p item in toolbar.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The item after @p item, or @c NULL if none or on failure.
|
||||
*
|
||||
* @note If it is the last item, @c NULL will be returned.
|
||||
*
|
||||
* @see elm_toolbar_item_append()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Object_Item *elm_toolbar_item_next_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the item before @p item in toolbar.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The item before @p item, or @c NULL if none or on failure.
|
||||
*
|
||||
* @note If it is the first item, @c NULL will be returned.
|
||||
*
|
||||
* @see elm_toolbar_item_prepend()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Object_Item *elm_toolbar_item_prev_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Set the priority of a toolbar item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param priority The item priority. The default is zero.
|
||||
*
|
||||
* This is used only when the toolbar shrink mode is set
|
||||
* to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
|
||||
* When space is less than required, items with low priority
|
||||
* will be removed from the toolbar and added to a dynamically-created menu,
|
||||
* while items with higher priority will remain on the toolbar,
|
||||
* with the same order they were added.
|
||||
*
|
||||
* @see elm_toolbar_item_priority_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_priority_set(Elm_Object_Item *it, int priority);
|
||||
|
||||
/**
|
||||
* Get the priority of a toolbar item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The @p item priority, or @c 0 on failure.
|
||||
*
|
||||
* @see elm_toolbar_item_priority_set() for details.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI int elm_toolbar_item_priority_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get whether the @p item is selected or not.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
|
||||
* it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
|
||||
*
|
||||
* @see elm_toolbar_selected_item_set() for details.
|
||||
* @see elm_toolbar_item_selected_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Set the selected state of an item.
|
||||
*
|
||||
* @param it The toolbar item
|
||||
* @param selected The selected state
|
||||
*
|
||||
* This sets the selected state of the given item @p it.
|
||||
* @c EINA_TRUE for selected, @c EINA_FALSE for not selected.
|
||||
*
|
||||
* If a new item is selected the previously selected will be unselected.
|
||||
* Previously selected item can be get with function
|
||||
* elm_toolbar_selected_item_get().
|
||||
*
|
||||
* Selected items will be highlighted.
|
||||
*
|
||||
* @see elm_toolbar_item_selected_get()
|
||||
* @see elm_toolbar_selected_item_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_selected_set(Elm_Object_Item *it, Eina_Bool selected);
|
||||
|
||||
/**
|
||||
* Set the icon associated with @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param icon A string with icon name or the absolute path of an image file.
|
||||
*
|
||||
* Toolbar will load icon image from fdo or current theme.
|
||||
* This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
|
||||
* If an absolute path is provided it will load it direct from a file.
|
||||
*
|
||||
* @note This function does not accept relative icon path.
|
||||
*
|
||||
* @see elm_toolbar_icon_order_lookup_set()
|
||||
* @see elm_toolbar_icon_order_lookup_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_icon_set(Elm_Object_Item *it, const char *icon);
|
||||
|
||||
/**
|
||||
* Get the string used to set the icon of @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The string associated with the icon object.
|
||||
*
|
||||
* @see elm_toolbar_item_icon_set() for details.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI const char *elm_toolbar_item_icon_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the real Evas(Edje) object created to implement the view of a given
|
||||
* toolbar @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The base Edje object associated with @p it.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Evas_Object *elm_toolbar_item_object_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the icon object of @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The icon object
|
||||
*
|
||||
* @see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
|
||||
* or elm_toolbar_item_icon_memfile_set() for details.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Evas_Object *elm_toolbar_item_icon_object_get(Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Set the icon associated with @p item to an image in a binary buffer.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param img The binary data that will be used as an image
|
||||
* @param size The size of binary data @p img
|
||||
* @param format Optional format of @p img to pass to the image loader
|
||||
* @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
|
||||
*
|
||||
* @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
|
||||
*
|
||||
* @note The icon image set by this function can be changed by
|
||||
* elm_toolbar_item_icon_set().
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_icon_memfile_set(Elm_Object_Item *it, const void *img, size_t size, const char *format, const char *key);
|
||||
|
||||
/**
|
||||
* Set the icon associated with @p item to an image in a binary buffer.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param file The file that contains the image
|
||||
* @param key Optional key of @p img to pass to the image loader (eg. if @p img is an edje file)
|
||||
*
|
||||
* @return (@c EINA_TRUE = success, @c EINA_FALSE = error)
|
||||
*
|
||||
* @note The icon image set by this function can be changed by
|
||||
* elm_toolbar_item_icon_set().
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Object_Item *it, const char *file, const char *key);
|
||||
|
||||
/**
|
||||
* Set or unset item as a separator.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param separator @c EINA_TRUE to set item @p item as separator or
|
||||
* @c EINA_FALSE to unset, i.e., item will be used as a regular item.
|
||||
*
|
||||
* Items aren't set as separator by default.
|
||||
*
|
||||
* If set as separator it will display separator theme, so won't display
|
||||
* icons or label.
|
||||
*
|
||||
* @see elm_toolbar_item_separator_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_separator_set(Elm_Object_Item *it, Eina_Bool separator);
|
||||
|
||||
/**
|
||||
* Get a value whether item is a separator or not.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
|
||||
* indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
|
||||
*
|
||||
* @see elm_toolbar_item_separator_set() for details.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Set whether the toolbar item opens a menu.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param menu If @c EINA_TRUE, @p item will opens a menu when selected.
|
||||
*
|
||||
* A toolbar item can be set to be a menu, using this function.
|
||||
*
|
||||
* Once it is set to be a menu, it can be manipulated through the
|
||||
* menu-like function elm_toolbar_menu_parent_set() and the other
|
||||
* elm_menu functions, using the Evas_Object @c menu returned by
|
||||
* elm_toolbar_item_menu_get().
|
||||
*
|
||||
* So, items to be displayed in this item's menu should be added with
|
||||
* elm_menu_item_add().
|
||||
*
|
||||
* The following code exemplifies the most basic usage:
|
||||
* @code
|
||||
* tb = elm_toolbar_add(win)
|
||||
* item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
|
||||
* elm_toolbar_item_menu_set(item, EINA_TRUE);
|
||||
* elm_toolbar_menu_parent_set(tb, win);
|
||||
* menu = elm_toolbar_item_menu_get(item);
|
||||
* elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
|
||||
* menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
|
||||
* NULL);
|
||||
* @endcode
|
||||
*
|
||||
* @see elm_toolbar_item_menu_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_menu_set(Elm_Object_Item *it, Eina_Bool menu);
|
||||
|
||||
/**
|
||||
* Get toolbar item's menu.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return Item's menu object or @c NULL on failure.
|
||||
*
|
||||
* If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
|
||||
* this function will set it.
|
||||
*
|
||||
* @see elm_toolbar_item_menu_set() for details.
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Evas_Object *elm_toolbar_item_menu_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Add a new state to @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param icon A string with icon name or the absolute path of an image file.
|
||||
* @param label The label of the new state.
|
||||
* @param func The function to call when the item is clicked when this
|
||||
* state is selected.
|
||||
* @param data The data to associate with the state.
|
||||
* @return The toolbar item state, or @c NULL upon failure.
|
||||
*
|
||||
* Toolbar will load icon image from fdo or current theme.
|
||||
* This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
|
||||
* If an absolute path is provided it will load it direct from a file.
|
||||
*
|
||||
* States created with this function can be removed with
|
||||
* elm_toolbar_item_state_del().
|
||||
*
|
||||
* @see elm_toolbar_item_state_del()
|
||||
* @see elm_toolbar_item_state_sel()
|
||||
* @see elm_toolbar_item_state_get()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Object_Item *it, const char *icon, const char *label, Evas_Smart_Cb func, const void *data);
|
||||
|
||||
/**
|
||||
* Delete a previously added state to @p item.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param state The state to be deleted.
|
||||
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
|
||||
*
|
||||
* @see elm_toolbar_item_state_add()
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
|
||||
|
||||
/**
|
||||
* Set @p state as the current state of @p it.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @param state The state to use.
|
||||
* @return @c EINA_TRUE on success or @c EINA_FALSE on failure.
|
||||
*
|
||||
* If @p state is @c NULL, it won't select any state and the default item's
|
||||
* icon and label will be used. It's the same behaviour than
|
||||
* elm_toolbar_item_state_unset().
|
||||
*
|
||||
* @see elm_toolbar_item_state_unset()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it, Elm_Toolbar_Item_State *state);
|
||||
|
||||
/**
|
||||
|
@ -372,73 +92,13 @@ EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Object_Item *it
|
|||
*/
|
||||
EAPI void elm_toolbar_item_state_unset(Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the current state of @p it.
|
||||
*
|
||||
* @param it The toolbar item.
|
||||
* @return The selected state or @c NULL if none is selected or on failure.
|
||||
*
|
||||
* @see elm_toolbar_item_state_set() for details.
|
||||
* @see elm_toolbar_item_state_unset()
|
||||
* @see elm_toolbar_item_state_add()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the state after selected state in toolbar's @p item.
|
||||
*
|
||||
* @param it The toolbar item to change state.
|
||||
* @return The state after current state, or @c NULL on failure.
|
||||
*
|
||||
* If last state is selected, this function will return first state.
|
||||
*
|
||||
* @see elm_toolbar_item_state_set()
|
||||
* @see elm_toolbar_item_state_add()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Get the state before selected state in toolbar's @p item.
|
||||
*
|
||||
* @param it The toolbar item to change state.
|
||||
* @return The state before current state, or @c NULL on failure.
|
||||
*
|
||||
* If first state is selected, this function will return last state.
|
||||
*
|
||||
* @see elm_toolbar_item_state_set()
|
||||
* @see elm_toolbar_item_state_add()
|
||||
*
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Object_Item *it);
|
||||
|
||||
/**
|
||||
* Show a specific item, when the toolbar can be scrolled.
|
||||
*
|
||||
* @param it the toolbar item
|
||||
* @param scrollto the position the item should appear at
|
||||
*
|
||||
* see elm_toolbar_item_bring_in()
|
||||
*
|
||||
* @since 1.8
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_show(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type scrollto);
|
||||
|
||||
/**
|
||||
* Show a specific item with scroll animation, when the toolbar can be scrolled.
|
||||
*
|
||||
* @param it the toolbar item
|
||||
* @param scrollto the position the item should appear at
|
||||
*
|
||||
* see elm_toolbar_item_show()
|
||||
*
|
||||
* @since 1.8
|
||||
* @ingroup Toolbar
|
||||
*/
|
||||
EAPI void elm_toolbar_item_bring_in(Elm_Object_Item *it, Elm_Toolbar_Item_Scrollto_Type scrollto);
|
||||
|
||||
|
|
|
@ -0,0 +1,429 @@
|
|||
class Elm_Toolbar_Item(Elm_Widget_Item)
|
||||
{
|
||||
legacy_prefix: null;
|
||||
eo_prefix: elm_obj_toolbar_item;
|
||||
properties {
|
||||
prev {
|
||||
get {
|
||||
/*@
|
||||
Get the item before @p item in toolbar.
|
||||
|
||||
@note If it is the first item, @c NULL will be returned.
|
||||
|
||||
@see elm_toolbar_item_prepend()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Elm_Object_Item *item; /*@ The item before @p item, or @c NULL if none or on failure. */
|
||||
}
|
||||
}
|
||||
next {
|
||||
get {
|
||||
/*@
|
||||
Get the item after @p item in toolbar.
|
||||
|
||||
@note If it is the last item, @c NULL will be returned.
|
||||
|
||||
@see elm_toolbar_item_append()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Elm_Object_Item *item; /*@ The item after @p item, or @c NULL if none or on failure. */
|
||||
}
|
||||
}
|
||||
priority {
|
||||
get {
|
||||
/*@
|
||||
Get the priority of a toolbar item.
|
||||
|
||||
@see elm_toolbar_item_priority_set() for details.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
set {
|
||||
/*@
|
||||
Set the priority of a toolbar item.
|
||||
|
||||
This is used only when the toolbar shrink mode is set
|
||||
to #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE.
|
||||
When space is less than required, items with low priority
|
||||
will be removed from the toolbar and added to a dynamically-created menu,
|
||||
while items with higher priority will remain on the toolbar,
|
||||
with the same order they were added.
|
||||
|
||||
@see elm_toolbar_item_priority_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
int priority; /* The @p item priority. The default is zero for set and 0 is returned on failure. */
|
||||
}
|
||||
}
|
||||
selected {
|
||||
get {
|
||||
/*@
|
||||
Get whether the @p item is selected or not.
|
||||
|
||||
@return @c EINA_TRUE means item is selected. @c EINA_FALSE indicates
|
||||
it's not. If @p obj is @c NULL, @c EINA_FALSE is returned.
|
||||
|
||||
@see elm_toolbar_selected_item_set() for details.
|
||||
@see elm_toolbar_item_selected_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
set {
|
||||
/*@
|
||||
Set the selected state of an item.
|
||||
|
||||
This sets the selected state of the given item @p it.
|
||||
@c EINA_TRUE for selected, @c EINA_FALSE for not selected.
|
||||
|
||||
If a new item is selected the previously selected will be unselected.
|
||||
Previously selected item can be get with function
|
||||
elm_toolbar_selected_item_get().
|
||||
|
||||
Selected items will be highlighted.
|
||||
|
||||
@see elm_toolbar_item_selected_get()
|
||||
@see elm_toolbar_selected_item_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Eina_Bool selected; /*@ The selected state */
|
||||
}
|
||||
}
|
||||
icon {
|
||||
get {
|
||||
/*@
|
||||
Get the string used to set the icon of @p item.
|
||||
|
||||
@return The string associated with the icon object.
|
||||
|
||||
@see elm_toolbar_item_icon_set() for details.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
set {
|
||||
/*@
|
||||
Set the icon associated with @p item.
|
||||
|
||||
@param icon A string with icon name or the absolute path of an image file.
|
||||
|
||||
Toolbar will load icon image from fdo or current theme.
|
||||
This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
|
||||
If an absolute path is provided it will load it direct from a file.
|
||||
|
||||
@note This function does not accept relative icon path.
|
||||
|
||||
@see elm_toolbar_icon_order_lookup_set()
|
||||
@see elm_toolbar_icon_order_lookup_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
const (char) *icon;
|
||||
}
|
||||
}
|
||||
object {
|
||||
get {
|
||||
/*@
|
||||
Get the real Evas(Edje) object created to implement the view of a given
|
||||
toolbar @p item.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Evas_Object *obj; /*@ The base Edje object associated with @p it. */
|
||||
}
|
||||
}
|
||||
icon_object {
|
||||
get {
|
||||
/*@
|
||||
Get the icon object of @p item.
|
||||
|
||||
@see elm_toolbar_item_icon_set(), elm_toolbar_item_icon_file_set(),
|
||||
or elm_toolbar_item_icon_memfile_set() for details.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Evas_Object *obj; /*@ The icon object */
|
||||
}
|
||||
}
|
||||
separator {
|
||||
get {
|
||||
/*@
|
||||
Get a value whether item is a separator or not.
|
||||
|
||||
@return @c EINA_TRUE means item @p it is a separator. @c EINA_FALSE
|
||||
indicates it's not. If @p it is @c NULL, @c EINA_FALSE is returned.
|
||||
|
||||
@see elm_toolbar_item_separator_set() for details.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
set {
|
||||
/*@
|
||||
Set or unset item as a separator.
|
||||
|
||||
@param separator @c EINA_TRUE to set item @p item as separator or
|
||||
@c EINA_FALSE to unset, i.e., item will be used as a regular item.
|
||||
|
||||
Items aren't set as separator by default.
|
||||
|
||||
If set as separator it will display separator theme, so won't display
|
||||
icons or label.
|
||||
|
||||
@see elm_toolbar_item_separator_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Eina_Bool separator;
|
||||
}
|
||||
}
|
||||
menu {
|
||||
get {
|
||||
/*@
|
||||
Get toolbar item's menu.
|
||||
|
||||
If @p item wasn't set as menu item with elm_toolbar_item_menu_set(),
|
||||
this function will set it.
|
||||
|
||||
@see elm_toolbar_item_menu_set() for details.
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
values {
|
||||
Evas_Object *menu; /*@ Item's menu object or @c NULL on failure. */
|
||||
}
|
||||
}
|
||||
state {
|
||||
get {
|
||||
/*@
|
||||
Get the current state of @p it.
|
||||
|
||||
@return The selected state or @c NULL if none is selected or on failure.
|
||||
|
||||
@see elm_toolbar_item_state_set() for details.
|
||||
@see elm_toolbar_item_state_unset()
|
||||
@see elm_toolbar_item_state_add()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
}
|
||||
set {
|
||||
/*@
|
||||
Set @p state as the current state of @p it.
|
||||
|
||||
@param state The state to use.
|
||||
@return @c EINA_TRUE on success or @c EINA_FALSE on failure.
|
||||
|
||||
If @p state is @c NULL, it won't select any state and the default item's
|
||||
icon and label will be used. It's the same behaviour than
|
||||
elm_toolbar_item_state_unset().
|
||||
|
||||
@see elm_toolbar_item_state_unset()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
return: bool;
|
||||
}
|
||||
values {
|
||||
Elm_Toolbar_Item_State *state;
|
||||
}
|
||||
}
|
||||
}
|
||||
methods {
|
||||
/* init { FIXME
|
||||
params {
|
||||
Evas_Smart_Cb func;
|
||||
const(void)* data;
|
||||
}
|
||||
}*/
|
||||
icon_memfile_set {
|
||||
/*@
|
||||
Set the icon associated with @p item to an image in a binary buffer.
|
||||
|
||||
@note The icon image set by this function can be changed by
|
||||
elm_toolbar_item_icon_set().
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in const (void) *img; /*@ The binary data that will be used as an image */
|
||||
@in size_t size; /*@ The size of binary data @p img */
|
||||
@in const (char) *format; /*@ Optional format of @p img to pass to the image loader */
|
||||
@in const (char) *key; /*@ Optional key of @p img to pass to the image loader (eg. if @p img is an edje file) */
|
||||
}
|
||||
return: bool; /*@ (@c EINA_TRUE = success, @c EINA_FALSE = error) */
|
||||
}
|
||||
icon_file_set {
|
||||
/*@
|
||||
Set the icon associated with @p item to an image in a binary buffer.
|
||||
|
||||
@note The icon image set by this function can be changed by
|
||||
elm_toolbar_item_icon_set().
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in const (char) *file; /*@ The file that contains the image */
|
||||
@in const (char) *key; /*@ Optional key of @p img to pass to the image loader (eg. if @p img is an edje file) */
|
||||
}
|
||||
return: bool; /*@ (@c EINA_TRUE = success, @c EINA_FALSE = error) */
|
||||
}
|
||||
state_add {
|
||||
/*@
|
||||
Add a new state to @p item.
|
||||
|
||||
Toolbar will load icon image from fdo or current theme.
|
||||
This behavior can be set by elm_toolbar_icon_order_lookup_set() function.
|
||||
If an absolute path is provided it will load it direct from a file.
|
||||
|
||||
States created with this function can be removed with
|
||||
elm_toolbar_item_state_del().
|
||||
|
||||
@see elm_toolbar_item_state_del()
|
||||
@see elm_toolbar_item_state_sel()
|
||||
@see elm_toolbar_item_state_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in const (char) *icon; /*@ A string with icon name or the absolute path of an image file. */
|
||||
@in const (char) *label; /*@ The label of the new state. */
|
||||
@in Evas_Smart_Cb func; /*@ The function to call when the item is clicked when this * state is selected. */
|
||||
@in const (void) *data; /*@ The data to associate with the state. */
|
||||
}
|
||||
return: Elm_Toolbar_Item_State *; /*@ The toolbar item state, or @c NULL upon failure. */
|
||||
}
|
||||
state_del {
|
||||
/*@
|
||||
Delete a previously added state to @p item.
|
||||
|
||||
@see elm_toolbar_item_state_add()
|
||||
*/
|
||||
params {
|
||||
@in Elm_Toolbar_Item_State *state; /*@ The state to be deleted. */
|
||||
}
|
||||
return: bool; /*@ @c EINA_TRUE on success or @c EINA_FALSE on failure. */
|
||||
}
|
||||
state_next {
|
||||
/*@
|
||||
Get the state after selected state in toolbar's @p item.
|
||||
|
||||
If last state is selected, this function will return first state.
|
||||
|
||||
@see elm_toolbar_item_state_set()
|
||||
@see elm_toolbar_item_state_add()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
return: Elm_Toolbar_Item_State *; /*@ The state after current state, or @c NULL on failure. */
|
||||
}
|
||||
state_prev {
|
||||
/*@
|
||||
Get the state before selected state in toolbar's @p item.
|
||||
|
||||
|
||||
If first state is selected, this function will return last state.
|
||||
|
||||
@see elm_toolbar_item_state_set()
|
||||
@see elm_toolbar_item_state_add()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
return: Elm_Toolbar_Item_State *; /*@ The state before current state, or @c NULL on failure. */
|
||||
}
|
||||
show {
|
||||
/*@
|
||||
Show a specific item, when the toolbar can be scrolled.
|
||||
|
||||
see elm_toolbar_item_bring_in()
|
||||
|
||||
@since 1.8
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in Elm_Toolbar_Item_Scrollto_Type scrollto; /*@ the position the item should appear at */
|
||||
}
|
||||
}
|
||||
bring_in {
|
||||
/*@
|
||||
Show a specific item with scroll animation, when the toolbar can be scrolled.
|
||||
|
||||
see elm_toolbar_item_show()
|
||||
|
||||
@since 1.8
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in Elm_Toolbar_Item_Scrollto_Type scrollto; /*@ the position the item should appear at */
|
||||
}
|
||||
}
|
||||
menu_set {
|
||||
/*@
|
||||
Set whether the toolbar item opens a menu.
|
||||
|
||||
A toolbar item can be set to be a menu, using this function.
|
||||
|
||||
Once it is set to be a menu, it can be manipulated through the
|
||||
menu-like function elm_toolbar_menu_parent_set() and the other
|
||||
elm_menu functions, using the Evas_Object @c menu returned by
|
||||
elm_toolbar_item_menu_get().
|
||||
|
||||
So, items to be displayed in this item's menu should be added with
|
||||
elm_menu_item_add().
|
||||
|
||||
The following code exemplifies the most basic usage:
|
||||
@code
|
||||
tb = elm_toolbar_add(win)
|
||||
item = elm_toolbar_item_append(tb, "refresh", "Menu", NULL, NULL);
|
||||
elm_toolbar_item_menu_set(item, EINA_TRUE);
|
||||
elm_toolbar_menu_parent_set(tb, win);
|
||||
menu = elm_toolbar_item_menu_get(item);
|
||||
elm_menu_item_add(menu, NULL, "edit-cut", "Cut", NULL, NULL);
|
||||
menu_item = elm_menu_item_add(menu, NULL, "edit-copy", "Copy", NULL,
|
||||
NULL);
|
||||
@endcode
|
||||
|
||||
@see elm_toolbar_item_menu_get()
|
||||
|
||||
@ingroup Toolbar
|
||||
*/
|
||||
params {
|
||||
@in Eina_Bool menu; /*@ If @c EINA_TRUE, @p item will opens a menu when selected. */
|
||||
}
|
||||
}
|
||||
}
|
||||
implements {
|
||||
Eo.Base.constructor;
|
||||
Elm_Widget_Item.disable;
|
||||
Elm_Widget_Item.del_pre;
|
||||
Elm_Widget_Item.focus.set;
|
||||
Elm_Widget_Item.focus.get;
|
||||
Elm_Widget_Item.part_text.get;
|
||||
Elm_Widget_Item.part_text.set;
|
||||
Elm_Widget_Item.part_content.get;
|
||||
Elm_Widget_Item.part_content.set;
|
||||
Elm_Widget_Item.part_content_unset;
|
||||
}
|
||||
}
|
|
@ -9,6 +9,7 @@
|
|||
* IT AT RUNTIME.
|
||||
*/
|
||||
|
||||
#include "elm_object_item_migration_temp.h"
|
||||
/**
|
||||
* @addtogroup Widget
|
||||
* @{
|
||||
|
@ -20,7 +21,7 @@
|
|||
* widgets which are a toolbar with some more logic on top.
|
||||
*/
|
||||
|
||||
typedef struct _Elm_Toolbar_Item Elm_Toolbar_Item;
|
||||
typedef struct _Elm_Toolbar_Item_Data Elm_Toolbar_Item_Data;
|
||||
|
||||
/**
|
||||
* Base widget smart data extended with toolbar instance data.
|
||||
|
@ -33,11 +34,11 @@ struct _Elm_Toolbar_Data
|
|||
Evas_Object *bx, *more, *bx_more, *bx_more2;
|
||||
Evas_Object *menu_parent;
|
||||
Eina_Inlist *items;
|
||||
Elm_Toolbar_Item *more_item;
|
||||
Elm_Toolbar_Item *selected_item; /**< a selected item by mouse click, return key, api, and etc. */
|
||||
Elm_Toolbar_Item_Data *more_item;
|
||||
Elm_Object_Item *selected_item; /**< a selected item by mouse click, return key, api, and etc. */
|
||||
Elm_Object_Item *focused_item; /**< a focused item by keypad arrow or mouse. This is set to NULL if widget looses focus. */
|
||||
Elm_Object_Item *last_focused_item; /**< This records the last focused item when widget looses focus. This is required to set the focus on last focused item when widgets gets focus. */
|
||||
Elm_Toolbar_Item *reorder_empty, *reorder_item;
|
||||
Elm_Toolbar_Item_Data *reorder_empty, *reorder_item;
|
||||
Elm_Toolbar_Shrink_Mode shrink_mode;
|
||||
Elm_Icon_Lookup_Order lookup_order;
|
||||
int theme_icon_size, priv_icon_size,
|
||||
|
@ -59,9 +60,9 @@ struct _Elm_Toolbar_Data
|
|||
Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the toolbar at the moment. This flag is set to true on mouse and reset to false on mouse up. */
|
||||
};
|
||||
|
||||
struct _Elm_Toolbar_Item
|
||||
struct _Elm_Toolbar_Item_Data
|
||||
{
|
||||
ELM_WIDGET_ITEM;
|
||||
Elm_Widget_Item_Data *base;
|
||||
EINA_INLIST;
|
||||
|
||||
const char *label;
|
||||
|
@ -73,7 +74,7 @@ struct _Elm_Toolbar_Item
|
|||
Evas_Object *proxy;
|
||||
Evas_Smart_Cb func;
|
||||
Elm_Transit *trans;
|
||||
Elm_Toolbar_Item *reorder_to;
|
||||
Elm_Toolbar_Item_Data *reorder_to;
|
||||
struct
|
||||
{
|
||||
int priority;
|
||||
|
@ -128,15 +129,18 @@ struct _Elm_Toolbar_Item_State
|
|||
return
|
||||
|
||||
#define ELM_TOOLBAR_ITEM_CHECK(it) \
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, ); \
|
||||
ELM_TOOLBAR_CHECK(it->base.widget);
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, ); \
|
||||
ELM_TOOLBAR_CHECK(it->base->widget);
|
||||
|
||||
#define ELM_TOOLBAR_ITEM_CHECK_OR_RETURN(it, ...) \
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN((Elm_Widget_Item_Data *)it, __VA_ARGS__); \
|
||||
ELM_TOOLBAR_CHECK(it->base.widget) __VA_ARGS__;
|
||||
ELM_WIDGET_ITEM_CHECK_OR_RETURN(it->base, __VA_ARGS__); \
|
||||
ELM_TOOLBAR_CHECK(it->base->widget) __VA_ARGS__;
|
||||
|
||||
#define ELM_TOOLBAR_ITEM_CHECK_OR_GOTO(it, label) \
|
||||
ELM_WIDGET_ITEM_CHECK_OR_GOTO((Elm_Widget_Item_Data *)it, label); \
|
||||
if (!it->base.widget || !eo_isa ((it->base.widget), ELM_TOOLBAR_CLASS)) goto label;
|
||||
ELM_WIDGET_ITEM_CHECK_OR_GOTO(it->base, label); \
|
||||
if (!it->base->widget || !eo_isa ((it->base->widget), ELM_TOOLBAR_CLASS)) goto label;
|
||||
|
||||
#define ELM_TOOLBAR_ITEM_DATA_GET(o, sd) \
|
||||
Elm_Toolbar_Item_Data* sd = eo_data_scope_get((Eo *)o, ELM_TOOLBAR_ITEM_CLASS)
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue