Etk
Main Page Object Hierarchy Data Structures Related Pages
Etk

etk_widget.h File Reference


Detailed Description


Data Structures

struct  Etk_Widget
 [Widget] The base class for all the widgets of Etk More...

Defines

#define ETK_WIDGET_TYPE   (etk_widget_type_get())
#define ETK_WIDGET(obj)   (ETK_OBJECT_CAST((obj), ETK_WIDGET_TYPE, Etk_Widget))
#define ETK_IS_WIDGET(obj)   (ETK_OBJECT_CHECK_TYPE((obj), ETK_WIDGET_TYPE))

Enumerations

enum  Etk_Widget_Swallow_Error {
  ETK_SWALLOW_ERROR_NONE,
  ETK_SWALLOW_ERROR_INCOMPATIBLE_PARENT,
  ETK_SWALLOW_ERROR_NO_THEME_OBJECT,
  ETK_SWALLOW_ERROR_NO_PART
}
 The code corresponding to the error that occured during the last call of etk_widget_swallow_widget() or etk_widget_swallow_object(). More...

Functions

Etk_Widget * etk_widget_new (Etk_Type *widget_type, const char *first_property,...)
 Creates a new widget: it calls the corresponding constructors (from the constructor of the base class to the constructor of the more derived class) and then sets the values of the given properties.
void etk_widget_show (Etk_Widget *widget)
 Shows the widget.
void etk_widget_show_all (Etk_Widget *widget)
 Recursively shows the widget and its children.
void etk_widget_hide (Etk_Widget *widget)
 Hides the widget.
void etk_widget_hide_all (Etk_Widget *widget)
 Recursively hides the widget and its children.
Etk_Bool etk_widget_is_visible (Etk_Widget *widget)
 Checks if the object is visible.
void etk_widget_internal_set (Etk_Widget *widget, Etk_Bool internal)
 Sets whether or not the widget is an internal widget: an internal widget is not affected by etk_widget_show_all() and etk_widget_hide_all(). It prevents visibility issues when one calls etk_widget_hide_all(widget) and then etk_widget_show(widget).
For example, if the label of a button wasn't an internal widget, calling etk_widget_hide_all(button) would hide the button and the label, and etk_widget_show(button) would only make the button reappear. The label would be invisible while it should be visible.
Etk_Bool etk_widget_internal_get (Etk_Widget *widget)
 Gets whether the widget is an internal widget. See etk_widget_internal_set() for more info about internal widgets.
void etk_widget_focus (Etk_Widget *widget)
 Focuses the widget. The focused widget is the one which receives the keyboard events.
void etk_widget_unfocus (Etk_Widget *widget)
 Unfocuses the widget.
Etk_Bool etk_widget_is_focused (Etk_Widget *widget)
 Gets whether the widget is focused.
void etk_widget_focusable_set (Etk_Widget *widget, Etk_Bool focusable)
 Sets whether or not the widget can be focused.
Etk_Bool etk_widget_focusable_get (Etk_Widget *widget)
 Gets whether the widget can be focused or not.
void etk_widget_disabled_set (Etk_Widget *widget, Etk_Bool disabled)
 Sets whether or not the widget is disabled. When a widget is disabled, the user can't interact with it anymore until it's enabled again. The widget's look will also change to make it look inactive.
void etk_widget_disabled_set_all (Etk_Widget *widget, Etk_Bool disabled)
 Recursively disables or enables the widget and its children.
Etk_Bool etk_widget_disabled_get (Etk_Widget *widget)
 Gets whether or not the widget is disabled.
Etk_Bool etk_widget_enter (Etk_Widget *widget)
 Emits the "entered" signal on the widget. The widget will look like if the mouse had entered the widget.
Etk_Bool etk_widget_leave (Etk_Widget *widget)
 Emits the "left" signal on the widget. The widget will look like if the mouse had left the widget.
void etk_widget_raise (Etk_Widget *widget)
 Raises a widget: it will be moved above all the other widgets that have the same parent as widget.
void etk_widget_lower (Etk_Widget *widget)
 Lowers a widget: it will be moved below all the other widgets that have the same parent as widget.
void etk_widget_repeat_mouse_events_set (Etk_Widget *widget, Etk_Bool repeat_mouse_events)
 Sets whether the mouse-events received by the widget should be propagated to its parent. By default, mouse-events are not propagated (when you click a button, the window containing the button doesn't receive the click event).
Etk_Bool etk_widget_repeat_mouse_events_get (Etk_Widget *widget)
 Checks whether the mouse-events received by the widget are propagated to its parent.
void etk_widget_pass_mouse_events_set (Etk_Widget *widget, Etk_Bool pass_mouse_events)
 Sets whether the widget should ignore the mouse-events it receives. In this case, the mouse-events will be directly passed to its parent.
Etk_Bool etk_widget_pass_mouse_events_get (Etk_Widget *widget)
 Checks whether the mouse-events received by the widget are ignored by the widget and passed directly to its parent.
void etk_widget_has_event_object_set (Etk_Widget *widget, Etk_Bool has_event_object)
 Sets whether or not the widget has an event-object. An event-object is an invisible rectangle that is used to grab the mouse events on the widget. It can be useful for example if you want a container with no theme-object (a table, a box, ...) to still receive the mouse events.
If widget already has a theme-object, this function has no effect (the theme-object is indeed already used to grab the mouse events).
Etk_Bool etk_widget_has_event_object_get (Etk_Widget *widget)
 Gets whether the widget has an event-object.
void etk_widget_parent_set (Etk_Widget *widget, Etk_Widget *parent)
 Sets the parent of the widget. If the widget has already a parent, it will be reparented.
Etk_Widget * etk_widget_parent_get (Etk_Widget *widget)
 Gets the parent of the widget.
Etk_Toplevel * etk_widget_toplevel_parent_get (Etk_Widget *widget)
 Gets the toplevel widget that contains widget.
Evas * etk_widget_toplevel_evas_get (Etk_Widget *widget)
 Gets the evas of the toplevel widget that contains widget.
void etk_widget_theme_set (Etk_Widget *widget, const char *theme_file, const char *theme_group)
 Changes the theme of the widget: it sets both the theme-file and the theme-group in a more optimized way than just calling etk_widget_theme_file_set() and then etk_widget_theme_group_set(). But if you only want to change the theme-file OR the theme-group, you should better call directly the corresponding function (etk_widget_theme_file_set() or etk_widget_theme_group_set()).
void etk_widget_theme_file_set (Etk_Widget *widget, const char *theme_file)
 Sets the theme-file used by the widget. The widget will be automatically re-realized.
const char * etk_widget_theme_file_get (Etk_Widget *widget)
 Gets the theme-file used by the widget.
void etk_widget_theme_group_set (Etk_Widget *widget, const char *theme_group)
 Sets the theme-group of the widget. The theme-group of a widget is also used by the theme-children of the widget. For example, the theme-group of a tree is "tree", and the theme-group of its rows is "row". Since the rows are theme-children of the tree, the edje-group really loaded for the rows is "etk/tree/rows". It also means that if you change the theme-group of the tree later to "new_tree" in order to change its appearance, the appearance of the rows will also be updated (the rows will use automatically the edje-group called "etk/new_tree/rows").
const char * etk_widget_theme_group_get (Etk_Widget *widget)
 Gets the full theme-group of the widget.
void etk_widget_theme_parent_set (Etk_Widget *widget, Etk_Widget *theme_parent)
 Sets the theme-parent of the widget. The widget will automatically inherit the theme-group from the theme-parent. See etk_widget_theme_group_set() for more info.
Etk_Widget * etk_widget_theme_parent_get (Etk_Widget *widget)
 Gets the theme-parent of the widget.
void etk_widget_color_set (Etk_Widget *widget, int r, int g, int b, int a)
 Sets the color of the widget. By default, the color change is also propagated automatically to the children of the widget. To change this behavior, see etk_widget_propagate_color_set().
void etk_widget_color_get (Etk_Widget *widget, int *r, int *g, int *b, int *a)
 Gets the current color of the widget.
void etk_widget_propagate_color_set (Etk_Widget *widget, Etk_Bool propagate_color)
 Sets whether or not a color change on the widget should be propagated to its children. If the color change is propagated, the color of the widget's children will be multiplied by the color of the widget.
Etk_Bool etk_widget_propagate_color_get (Etk_Widget *widget)
 Gets whether or not a color change on the widget is propagated to its children.
void etk_widget_padding_set (Etk_Widget *widget, int left, int right, int top, int bottom)
 Sets the padding on the different sides of the widget. Padding is a blank space on the sides of the widget.
void etk_widget_padding_get (Etk_Widget *widget, int *left, int *right, int *top, int *bottom)
 Gets the padding on the different sides of the widget.
void etk_widget_geometry_get (Etk_Widget *widget, int *x, int *y, int *w, int *h)
 Gets the geometry of the widget, relative to the top-left corner of the Evas where it is drawn.
void etk_widget_inner_geometry_get (Etk_Widget *widget, int *x, int *y, int *w, int *h)
 Gets the inner geometry of the widget, relative to the top-left corner of the Evas where it is drawn.
The inner geometry corresponds to the rectangle in which the widget's children are rendered. This rectangle may be smaller than the geometry of the widget because inset values can be set by the theme.
void etk_widget_size_recalc_queue (Etk_Widget *widget)
 Queues a size recalculation request: during the next main-loop iteration, the size of the widget will be recalculated, and the widget will be redrawn.
void etk_widget_redraw_queue (Etk_Widget *widget)
 Queues a redraw request: during the next main-loop iteration, the widget and its children will be redrawn (i.e. etk_widget_size_allocate() will be called on them).
void etk_widget_size_request_set (Etk_Widget *widget, int w, int h)
 Sets the size-request of the widget. Use this function to request Etk to resize the widget to the given size.
It does not mean the widget will be allocated this size: in some cases, the widget may be allocated less than its size-request, and often the allocated size can be larger than the size-request (if the widget expands for example).
You can use this function to force a widget to be smaller or larger than its default size.
void etk_widget_size_request (Etk_Widget *widget, Etk_Size *size_requisition)
 Calculates the size-request of the widget.
void etk_widget_size_request_full (Etk_Widget *widget, Etk_Size *size_requisition, Etk_Bool hidden_has_no_size)
 Calculates the size-request of the widget.
void etk_widget_size_allocate (Etk_Widget *widget, Etk_Geometry geometry)
 Moves and resizes the widget to the given geometry.
void etk_widget_theme_signal_emit (Etk_Widget *widget, const char *signal_name, Etk_Bool size_recalc)
 Sends a signal to the theme-object of the widget.
void etk_widget_theme_part_text_set (Etk_Widget *widget, const char *part_name, const char *text)
 Sets the text of a text-part of the widget's theme-object.
int etk_widget_theme_data_get (Etk_Widget *widget, const char *data_name, const char *format,...)
 Gets the data called data_name from the theme of the widget.
Etk_Bool etk_widget_member_object_add (Etk_Widget *widget, Evas_Object *object)
 Adds an evas object to the list of member-objects of the widget.
A member-object is an object which is automatically shown/hidden when the widget is shown/hidden, which is clipped against the clip-object of the widget, and which is used by the widget to receive the mouse events. A member-object is also stacked on the same level as the widget.
The object will be automatically deleted when the object is unrealized, unless you remove it from the list with etk_widget_member_object_del() before the widget is unrealized.
void etk_widget_member_object_del (Etk_Widget *widget, Evas_Object *object)
 Removes an evas object from the list of member-objects of the widget. See etk_widget_member_object_add() for more info about member-objects.
void etk_widget_member_object_raise (Etk_Widget *widget, Evas_Object *object)
 Stacks object above all the other member-objects of the widget.
void etk_widget_member_object_lower (Etk_Widget *widget, Evas_Object *object)
 Stacks object below all the other member-objects of the widget.
void etk_widget_member_object_stack_above (Etk_Widget *widget, Evas_Object *object, Evas_Object *above)
 Stacks the member-object object above the member-object above.
void etk_widget_member_object_stack_below (Etk_Widget *widget, Evas_Object *object, Evas_Object *below)
 Stacks the member-object object below the member-object below.
Etk_Bool etk_widget_swallow_widget (Etk_Widget *swallower, const char *part, Etk_Widget *to_swallow)
 Makes the widget swallow another widget in a part of its theme-object.
void etk_widget_unswallow_widget (Etk_Widget *swallower, Etk_Widget *swallowed)
 Makes the widget swallower unswallow another widget.
Etk_Bool etk_widget_is_swallowed (Etk_Widget *widget)
 Checks if the widget is swallowed by its parent.
Etk_Bool etk_widget_swallow_object (Etk_Widget *swallower, const char *part, Evas_Object *to_swallow)
 Makes the widget swallow an Evas_Object in a part of its theme-object.
void etk_widget_unswallow_object (Etk_Widget *swallower, Evas_Object *object)
 Makes the widget unswallow an Evas_Object.
Etk_Widget_Swallow_Error etk_widget_swallow_error_get (void)
 Gets the code corresponding to the error that occurs during the last call of etk_widget_swallow_widget() or etk_widget_swallow_object().
void etk_widget_clip_set (Etk_Widget *widget, Evas_Object *clip)
 Sets the clip-object of the widget. The theme-object and the member-objects of the widget will be automatically clipped against clip.
void etk_widget_clip_unset (Etk_Widget *widget)
 Unsets the clip-object of the widget. The theme-object and the member-objects won't be clipped anymore.
Evas_Object * etk_widget_clip_get (Etk_Widget *widget)
 Gets the clip-object of the widget.
void etk_widget_dnd_dest_set (Etk_Widget *widget, Etk_Bool on)
 Sets whether the widget is dnd destination.
Etk_Bool etk_widget_dnd_dest_get (Etk_Widget *widget)
 Checks whether the widget is a dnd destination.
Evas_List * etk_widget_dnd_dest_widgets_get (void)
 Gets the list of the widgets that are dnd destinations.
void etk_widget_dnd_source_set (Etk_Widget *widget, Etk_Bool on)
 Sets whether the widget is dnd source.
Etk_Bool etk_widget_dnd_source_get (Etk_Widget *widget)
 Checks whether the widget is a dnd source.
void etk_widget_dnd_drag_widget_set (Etk_Widget *widget, Etk_Widget *drag_widget)
 Sets the visual data for the drag (the widget to be displayed).
Etk_Widget * etk_widget_dnd_drag_widget_get (Etk_Widget *widget)
 Gets the visual data for the drag (the widget to be displayed).
void etk_widget_dnd_types_set (Etk_Widget *widget, const char **types, int num)
 Sets the possible types for dnd.
const char ** etk_widget_dnd_types_get (Etk_Widget *widget, int *num)
 Gets the possible types for dnd.
Etk_Bool etk_widget_dnd_internal_get (Etk_Widget *widget)
 Checks whether the widget wants to handle its own dnd or not.
void etk_widget_dnd_internal_set (Etk_Widget *widget, Etk_Bool on)
 Set whether the widget wants to handle its own dnd or not.