Widgets Extension Infrastructure

Data Structures | Typedefs | Enumerations
Widgets Extension Infrastructure

This section is intended for people willing to create custom Elementary widgets or to contribute new (useful, unique) widgets upstream. More...

## Data Structures
struct | _Elm_Widget_Smart_Class
| Base widget smart class. More...
struct | _Elm_Widget_Smart_Data
| Base widget smart data. More...
struct | _Elm_Button_Data
| Base widget smart data extended with button instance data. More...
struct | _Elm_Layout_Part_Alias_Description
| Elementary Layout-based widgets may declare part proxies, i.e., aliases for real theme part names to expose to the API calls: More...
struct | _Elm_Layout_Smart_Data
| Base widget smart data extended with layout instance data. More...

## Typedefs
typedef struct _Elm_Pan_Smart_Data | Elm_Pan_Smart_Data
| Elementary scroller panning base smart data.
typedef void(* | Elm_Interface_Scrollable_Cb) (Evas_Object *, void *data)
| Elementary scrollable interface base data.
typedef struct _Elm_Widget_Smart_Class | Elm_Widget_Smart_Class
| Base widget smart class. More...
typedef struct _Elm_Widget_Smart_Data | Elm_Widget_Smart_Data
| Base widget smart data. More...
typedef struct _Elm_Actionslider_Data | Elm_Actionslider_Data
| Base layout smart data extended with actionslider instance data.
typedef struct _Elm_Bg_Data | Elm_Bg_Data
| Base layout smart data extended with bg instance data.
typedef struct _Elm_Box_Data | Elm_Box_Data
| Base widget smart data extended with box instance data.
typedef struct _Elm_Bubble_Data | Elm_Bubble_Data
| Base layout smart data extended with bubble instance data.
typedef struct _Elm_Button_Data | Elm_Button_Data
| Base widget smart data extended with button instance data.
typedef struct _Elm_Calendar_Data | Elm_Calendar_Data
| Base layout smart data extended with calendar instance data.
typedef struct _Elm_Check_Data | Elm_Check_Data
| Base layout smart data extended with check instance data.
typedef struct _Elm_Clock_Data | Elm_Clock_Data
| Base layout smart data extended with clock instance data.
typedef struct _Elm_Colorselector_Data | Elm_Colorselector_Data
| Base layout smart data extended with colorselector instance data.
typedef struct _Elm_Combobox_Data | Elm_Combobox_Data
| Base button smart data extended with combobox instance data.
typedef struct _Elm_Conformant_Data | Elm_Conformant_Data
| Base layout smart data extended with conformant instance data.
typedef struct _Elm_Ctxpopup_Data | Elm_Ctxpopup_Data
| Base widget smart data extended with ctxpopup instance data.
typedef struct _Elm_Datetime_Module_Data | Elm_Datetime_Module_Data
| Base layout smart data extended with datetime instance data.
typedef struct _Elm_Dayselector_Data | Elm_Dayselector_Data
| Base layout smart data extended with dayselector instance data.
typedef struct _Elm_Diskselector_Data | Elm_Diskselector_Data
| Base widget smart data extended with diskselector instance data.
typedef struct _Elm_Entry_Data | Elm_Entry_Data
| Base widget smart data extended with entry instance data.
typedef struct _Elm_Fileselector_Data | Elm_Fileselector_Data
| Base layout smart data extended with fileselector instance data.
typedef struct _Elm_Fileselector_Button_Data | Elm_Fileselector_Button_Data
| Base button smart data extended with fileselector_button instance data.
typedef struct _Elm_Fileselector_Entry_Data | Elm_Fileselector_Entry_Data
| Base entry smart data extended with fileselector_entry instance data.
typedef struct _Elm_Flip_Data | Elm_Flip_Data
| Base widget smart data extended with flip instance data.
typedef struct _Elm_Flipselector_Data | Elm_Flipselector_Data
| Base layout smart data extended with flipselector instance data.
typedef struct _Elm_Frame_Data | Elm_Frame_Data
| Base layout smart data extended with frame instance data.
typedef struct _Elm_Gengrid_Data | Elm_Gengrid_Data
| Base widget smart data extended with gengrid instance data.
typedef struct _Elm_Genlist_Data | Elm_Genlist_Data
| Base widget smart data extended with genlist instance data.
typedef struct _Elm_Genlist_Filter | Elm_Genlist_Filter
| Structure added to genlist for internal filter iterator implementation Can be extended to genlist as a whole in future if needed.
typedef struct _Elm_Glview_Data | Elm_Glview_Data
| Base widget smart data extended with glview instance data.
typedef struct _Elm_Hover_Data | Elm_Hover_Data
| Base widget smart data extended with hover instance data.
typedef struct _Elm_Hoversel_Data | Elm_Hoversel_Data
| Base button smart data extended with hoversel instance data.
typedef struct _Elm_Image_Data | Elm_Image_Data
| Base widget smart data extended with image instance data.
typedef struct _Elm_Index_Data | Elm_Index_Data
| Base layout smart data extended with index instance data.
typedef struct _Elm_Inwin_Smart_Data | Elm_Inwin_Smart_Data
| Base layout smart data extended with inwin instance data.
typedef struct _Elm_Layout_Smart_Data | Elm_Layout_Smart_Data
| Base widget smart data extended with layout instance data.
typedef struct _Elm_List_Data | Elm_List_Data
| Base widget smart data extended with list instance data.
typedef struct _Elm_Map_Data | Elm_Map_Data
| Base widget smart data extended with map instance data.
typedef struct _Elm_Mapbuf_Data | Elm_Mapbuf_Data
| Base widget smart data extended with mapbuf instance data.
typedef struct _Elm_Menu_Data | Elm_Menu_Data
| Base widget smart data extended with menu instance data.
typedef enum _Multibuttonentry_Pos | Multibuttonentry_Pos
| Base widget smart data extended with multibuttonentry instance data.
typedef struct _Elm_Naviframe_Data | Elm_Naviframe_Data
| Base layout smart data extended with naviframe instance data.
typedef struct _Elm_Notify_Data | Elm_Notify_Data
| Base widget smart data extended with notify instance data.
typedef struct _Elm_Panel_Data | Elm_Panel_Data
| Base layout smart data extended with panel instance data.
typedef struct _Elm_Panes_Data | Elm_Panes_Data
| Base layout smart data extended with panes instance data.
typedef struct _Elm_Photo_Data | Elm_Photo_Data
| Base widget smart data extended with photo instance data.
typedef struct _Elm_Photocam_Data | Elm_Photocam_Data
| Base widget smart data extended with photocam instance data.
typedef struct _Elm_Player_Data | Elm_Player_Data
| Base layout smart data extended with player instance data.
typedef struct _Elm_Popup_Data | Elm_Popup_Data
| Base layout smart data extended with popup instance data.
typedef struct _Elm_Progressbar_Data | Elm_Progressbar_Data
| Base layout smart data extended with progressbar instance data.
typedef struct _Elm_Radio_Data | Elm_Radio_Data
| Base layout smart data extended with radio instance data.
typedef struct _Elm_Route_Data | Elm_Route_Data
| Base widget smart data extended with route instance data.
typedef struct _Elm_Scroller_Data | Elm_Scroller_Data
| Base widget smart data extended with scroller instance data.
typedef struct _Elm_Segment_Control_Data | Elm_Segment_Control_Data
| Base layout smart data extended with segment control instance data.
typedef struct _Elm_Separator_Data | Elm_Separator_Data
| Base layout smart data extended with separator instance data.
typedef struct _Elm_Slider_Data | Elm_Slider_Data
| Base layout smart data extended with slider instance data.
typedef struct _Elm_Slideshow_Data | Elm_Slideshow_Data
| Base layout smart data extended with slideshow instance data.
typedef struct _Elm_Spinner_Data | Elm_Spinner_Data
| Base layout smart data extended with spinner instance data.
typedef struct _Elm_Thumb_Data | Elm_Thumb_Data
| Base widget smart data extended with thumb instance data.
typedef struct _Elm_Toolbar_Data | Elm_Toolbar_Data
| Base widget smart data extended with toolbar instance data.
typedef struct _Elm_Video_Data | Elm_Video_Data
| Base layout smart data extended with video instance data.
typedef struct _Elm_Web_Data | Elm_Web_Data
| Base widget smart data extended with web instance data.

## Enumerations
enum | _Multibuttonentry_Pos
| Base widget smart data extended with multibuttonentry instance data.

## Detailed Description

This section is intended for people willing to create custom Elementary widgets or to contribute new (useful, unique) widgets upstream.

If neither is your case, this text won't be of any use for you.

Elementary widgets are built in a hierarchical fashion. The idea is to factorize as much code as possible between widgets with behavioral similarities, as long as to facilitate the creation of custom, new widgets, may the user need them.

It all starts with a base class, which aggregates behaviour every Elementary widget is supposed to have: Elm_Widget_Smart_Class. Every Elementary widget will be of that type, be it directly or by means of inheriting from it.

Elm_Widget_Smart_Class happens to be an `Evas_Smart_Class`. If you check out Evas' documentation on it, you'll see it's how one is supposed to create custom Evas objects, what Elementary widgets are.

Once one instantiates an Elementary widget, since it inherits from Elm_Widget_Smart_Class, the system will raise a class instance of that type for you. But that happens only once: the first time you ask for an Elementary widget (of a given type). All subsequent ones will only point to the very same class instance. Since it's the class which points to the functions implementing the behavior of objects of that type, all of the live instances of Elementary widgets (of that type) will share the same blob of code loaded in memory to execute their routines.

Now go and take a look at Elm_Widget_Smart_Class's fields. Because it inherits from Evas' base smart class, we got a field of that type as the first member, so that Evas can handle Elementary objects internally as if they were 'normal' Evas objects. Evas has the Evas-only behavior function pointers in there, so it's all it needs.

Then, comes a version field, so that whenever we got to update or change the fields on our base smart class, there'll be a runtime check of the version expected by Elementary and the one provided by any code linking with it. A mismatch will show the developer of that code he/she needs to recompile and link its code to a newer version of Elementary.

The next fields are the class functions themselves. We call them 'virtual' because, as in object-oriented languages, one is supposed here to override them on inheriting classes. On most of inheritances you'll probably want to call the parent's version of the class function too: you must analyse each case to tell.

Take a look at Elm_Widget_Smart_Data. That's private data bound to each Elementary object instance. It aggregates data needed for all widgets, since it's meant for the Elm_Widget_Smart_Class-typed ones.

When inheriting from that base type, instance data for this new class has to have, as the first member, a field of type Elm_Widget_Smart_Data. This has to be respected recursively – if a third class is to be created inheriting from the one that is a direct 'child' of Elm_Widget_Smart_Class, then the private data on this third class has to have, as its first field, a variable of the type of the private data of the second class (its parent), direct child of Elm_Widget_Smart_Class.

It is from the base private data, Elm_Widget_Smart_Data, that we reach an object's class functions, by the given object instance. This is the reason of the first field of that struct: a pointer set to point to its class when the object is instantiated.

The following figure illustrates the widget inheritance schema.

# Elementary Widgets Hierarchy Tree

The following figure illustrates the Elementary widget inheritance tree.

# The Elementary Scrollable Interface

This is a common interface for widgets having scrollable views. Widgets using/implementing this must use the `EVAS_SMART_SUBCLASS_IFACE_NEW` macro (instead of the `EVAS_SMART_SUBCLASS_NEW` one) when declaring its smart class, so an interface is also declared.

The scrollable interface comes built with Elementary and is exposed as #ELM_SCROLLABLE_IFACE.

The interface API is explained in details at #Elm_Scrollable_Smart_Interface.

An Elementary scrollable interface will handle an internal panning object. It has the function of clipping and moving the actual scrollable content around, by the command of the scrollable interface calls. Though it's not the common case, one might want/have to change some aspects of the internal panning object behavior. For that, we have it also exposed here – #Elm_Pan_Smart_Class. Use elm_pan_smart_class_get() to build your custom panning object, when creating a scrollable widget (again, only if you need a custom panning object) and set it with Elm_Scrollable_Smart_Interface::extern_pan_set.

# The Elementary Actionslider Class

Elementary, besides having the Actionslider widget, exposes its foundation – the Elementary Actionslider Class – in order to create other widgets which are a actionslider with some more logic on top.

# The Elementary Bg Class

Elementary, besides having the Bg widget, exposes its foundation – the Elementary Bg Class – in order to create other widgets which are a bg with some more logic on top.

# The Elementary Box Class

Elementary, besides having the Box widget, exposes its foundation – the Elementary Box Class – in order to create other widgets which are a box with some more logic on top.

# The Elementary Bubble Class

Elementary, besides having the Bubble widget, exposes its foundation – the Elementary Bubble Class – in order to create other widgets which are a bubble with some more logic on top.

# The Elementary Button Class

Elementary, besides having the Button widget, exposes its foundation – the Elementary Button Class – in order to create other widgets which are, basically, a button with some more logic on top.

# The Elementary Calendar Class

Elementary, besides having the Calendar widget, exposes its foundation – the Elementary Calendar Class – in order to create other widgets which are a calendar with some more logic on top.

# The Elementary Check Class

Elementary, besides having the Check widget, exposes its foundation – the Elementary Check Class – in order to create other widgets which are a check with some more logic on top.

# The Elementary Clock Class

Elementary, besides having the Clock widget, exposes its foundation – the Elementary Clock Class – in order to create other widgets which are a clock with some more logic on top.

# The Elementary Colorselector Class

Elementary, besides having the Colorselector widget, exposes its foundation – the Elementary Colorselector Class – in order to create other widgets which are a colorselector with some more logic on top.

# The Elementary Combobox Class

Elementary, besides having the Combobox widget, exposes its foundation – the Elementary Combobox Class – in order to create other widgets which are a combobox with some more logic on top.

# The Elementary Conformant Class

Elementary, besides having the Conformant widget, exposes its foundation – the Elementary Conformant Class – in order to create other widgets which are a conformant with some more logic on top.

# The Elementary Container Class

This class defines a common interface for objects acting like containers, i.e. objects parenting others and displaying their childs "inside" of them somehow.

The container must define "parts" (or spots) into which child objects will be placed, inside of it. This is a way of handling more the one content object, by naming content locations properly. This is the role of the `name` argument of the virtual functions in the class.

The following object functions are meant to be used with all container objects and derived ones:

- elm_object_part_content_set()
- elm_object_part_content_get()
- elm_object_part_content_unset()

# The Elementary Ctxpopup Class

Elementary, besides having the Ctxpopup widget, exposes its foundation – the Elementary Ctxpopup Class – in order to create other widgets which are a ctxpopup with some more logic on top.

# The Elementary Datetime Class

Elementary, besides having the Datetime widget, exposes its foundation – the Elementary Datetime Class – in order to create other widgets which are a datetime with some more logic on top.

# The Elementary Dayselector Class

Elementary, besides having the Dayselector widget, exposes its foundation – the Elementary Dayselector Class – in order to create other widgets which are a dayselector with some more logic on top.

# The Elementary Diskselector Class

Elementary, besides having the Diskselector widget, exposes its foundation – the Elementary Diskselector Class – in order to create other widgets which are a diskselector with some more logic on top.

# The Elementary Entry Class

Elementary, besides having the Entry widget, exposes its foundation – the Elementary Entry Class – in order to create other widgets which are a entry with some more logic on top.

# The Elementary Fileselector Class

Elementary, besides having the Fileselector widget, exposes its foundation – the Elementary Fileselector Class – in order to create other widgets which are a fileselector with some more logic on top.

# The Elementary Fileselector Button Class

Elementary, besides having the Fileselector_Button widget, exposes its foundation – the Elementary Fileselector Button Class – in order to create other widgets which are a fileselector_button with some more logic on top.

# The Elementary Fileselector Entry Class

Elementary, besides having the Fileselector_Entry widget, exposes its foundation – the Elementary Fileselector Entry Class – in order to create other widgets which are a fileselector_entry with some more logic on top.

# The Elementary Flip Class

Elementary, besides having the Flip widget, exposes its foundation – the Elementary Flip Class – in order to create other widgets which are a flip with some more logic on top.

# The Elementary Flipselector Class

Elementary, besides having the Flipselector widget, exposes its foundation – the Elementary Flipselector Class – in order to create other widgets which are a flipselector with some more logic on top.

# The Elementary Frame Class

Elementary, besides having the Frame widget, exposes its foundation – the Elementary Frame Class – in order to create other widgets which are a frame with some more logic on top.

# The Elementary Gengrid Class

Elementary, besides having the Gengrid widget, exposes its foundation – the Elementary Gengrid Class – in order to create other widgets which are a gengrid with some more logic on top.

# The Elementary Genlist Class

Elementary, besides having the Genlist widget, exposes its foundation – the Elementary Genlist Class – in order to create other widgets which are a genlist with some more logic on top.

# The Elementary Glview Class

Elementary, besides having the Glview widget, exposes its foundation – the Elementary Glview Class – in order to create other widgets which are a glview with some more logic on top.

# The Elementary Grid Class

Elementary, besides having the Grid widget, exposes its foundation – the Elementary Grid Class – in order to create other widgets which are a grid with some more logic on top.

# The Elementary Hover Class

Elementary, besides having the Hover widget, exposes its foundation – the Elementary Hover Class – in order to create other widgets which are a hover with some more logic on top.

# The Elementary Hoversel Class

Elementary, besides having the Hoversel widget, exposes its foundation – the Elementary Hoversel Class – in order to create other widgets which are a hoversel with some more logic on top.

# The Elementary Icon Class

This class defines a common interface for icon objects having an icon as their basic graphics.

# The Elementary Image Class

This class defines a common interface for image objects having an image as their basic graphics. This interface is so that one can tune various properties of the image, like:

- smooth scaling,
- orientation,
- aspect ratio during resizes, etc.

Image files may be set via memory buffers, image files, EET files with image data or Edje files. On the last case (which is exceptional), most of the properties cited above will not be changeable anymore.

# The Elementary Index Class

Elementary, besides having the Index widget, exposes its foundation – the Elementary Index Class – in order to create other widgets which are a index with some more logic on top.

# The Elementary Inwin Class

Elementary, besides having the Inwin widget, exposes its foundation – the Elementary Inwin Class – in order to create other widgets which are a inwin with some more logic on top.

# The Elementary Layout Class

Elementary, besides having the Layout widget, exposes its foundation – the Elementary Layout Class – in order to create other widgets which are, basically, a certain layout with some more logic on top.

The idea is to make the creation of that widgets as easy as possible, factorizing code on this common base. For example, a button is a layout (that looks like push button) that happens to react on clicks and keyboard events in a special manner, calling its user back on those events. That's no surprise, then, that the Button implementation relies on #Elm_Layout_Smart_Class, if you go to check it.

The Layout class inherits from #Elm_Container_Smart_Class. Container parts, here, map directly to Edje parts from the layout's Edje group. Besides that, there's a whole infrastructure around Edje files:

- interfacing by signals,
- setting/retrieving text part values,
- dealing with table and box parts directly,
- etc.

Take a look at #Elm_Layout_Smart_Class's 'virtual' functions to understand the whole interface. Finally, layout objects will do part aliasing for you, if you set it up properly. For that, take a look at Elm_Layout_Part_Alias_Description, where it's explained in detail.

# The Elementary List Class

Elementary, besides having the List widget, exposes its foundation – the Elementary List Class – in order to create other widgets which are a list with some more logic on top.

# The Elementary Map Class

Elementary, besides having the Map widget, exposes its foundation – the Elementary Map Class – in order to create other widgets which are a map with some more logic on top.

# The Elementary Mapbuf Class

Elementary, besides having the Mapbuf widget, exposes its foundation – the Elementary Mapbuf Class – in order to create other widgets which are a mapbuf with some more logic on top.

# The Elementary Menu Class

Elementary, besides having the Menu widget, exposes its foundation – the Elementary Menu Class – in order to create other widgets which are a menu with some more logic on top.

# The Elementary Multi Button Entry Class

Elementary, besides having the Multibuttonentry widget, exposes its foundation – the Elementary Multi Button Entry Class – in order to create other widgets which are a multi button entry with some more logic on top.

# The Elementary Naviframe Class

Elementary, besides having the Naviframe widget, exposes its foundation – the Elementary Naviframe Class – in order to create other widgets which are a naviframe with some more logic on top.

# The Elementary Notify Class

Elementary, besides having the Notify widget, exposes its foundation – the Elementary Notify Class – in order to create other widgets which are a notify with some more logic on top.

# The Elementary Panel Class

Elementary, besides having the Panel widget, exposes its foundation – the Elementary Panel Class – in order to create other widgets which are a panel with some more logic on top.

# The Elementary Panes Class

Elementary, besides having the Panes widget, exposes its foundation – the Elementary Panes Class – in order to create other widgets which are a panes with some more logic on top.

# The Elementary Photo Class

Elementary, besides having the Photo widget, exposes its foundation – the Elementary Photo Class – in order to create other widgets which are a photo with some more logic on top.

# The Elementary Photocam Class

Elementary, besides having the Photocam widget, exposes its foundation – the Elementary Photocam Class – in order to create other widgets which are a photocam with some more logic on top.

# The Elementary Player Class

Elementary, besides having the Player widget, exposes its foundation – the Elementary Player Class – in order to create other widgets which are a player with some more logic on top.

# The Elementary Plug Class

Elementary, besides having the Plug widget, exposes its foundation – the Elementary Plug Class – in order to create other widgets which are a plug with some more logic on top.

# The Elementary Popup Class

Elementary, besides having the Popup widget, exposes its foundation – the Elementary Popup Class – in order to create other widgets which are a popup with some more logic on top.

# The Elementary Prefs Class

Elementary, besides having the Prefs widget, exposes its foundation – the Elementary Prefs Class – in order to create other widgets which are a prefs with some more logic on top.

# The Elementary Progressbar Class

Elementary, besides having the Progressbar widget, exposes its foundation – the Elementary Progressbar Class – in order to create other widgets which are a progressbar with some more logic on top.

# The Elementary Radio Class

Elementary, besides having the Radio widget, exposes its foundation – the Elementary Radio Class – in order to create other widgets which are a radio with some more logic on top.

# The Elementary Route Class

Elementary, besides having the Route widget, exposes its foundation – the Elementary Route Class – in order to create other widgets which are a route with some more logic on top.

# The Elementary Scroller Class

Elementary, besides having the Scroller widget, exposes its foundation – the Elementary Scroller Class – in order to create other widgets which are a scroller with some more logic on top.

# The Elementary Segment control Class

Elementary, besides having the SegmentControl widget, exposes its foundation – the Elementary Segment control Class – in order to create other widgets which are a segment control with some more logic on top.

# The Elementary Separator Class

Elementary, besides having the Separator widget, exposes its foundation – the Elementary Separator Class – in order to create other widgets which are a separator with some more logic on top.

# The Elementary Slider Class

Elementary, besides having the Slider widget, exposes its foundation – the Elementary Slider Class – in order to create other widgets which are a slider with some more logic on top.

# The Elementary Slideshow Class

Elementary, besides having the Slideshow widget, exposes its foundation – the Elementary Slideshow Class – in order to create other widgets which are a slideshow with some more logic on top.

# The Elementary Spinner Class

Elementary, besides having the Spinner widget, exposes its foundation – the Elementary Spinner Class – in order to create other widgets which are a spinner with some more logic on top.

# The Elementary Table Class

Elementary, besides having the Table widget, exposes its foundation – the Elementary Table Class – in order to create other widgets which are a table with some more logic on top.

# The Elementary Thumb Class

Elementary, besides having the Thumb widget, exposes its foundation – the Elementary Thumb Class – in order to create other widgets which are a thumb with some more logic on top.

# The Elementary Toolbar Class

Elementary, besides having the Toolbar widget, exposes its foundation – the Elementary Toolbar Class – in order to create other widgets which are a toolbar with some more logic on top.

# The Elementary Video Class

Elementary, besides having the Video widget, exposes its foundation – the Elementary Video Class – in order to create other widgets which are a video with some more logic on top.

# The Elementary Web Class

Elementary, besides having the Web widget, exposes its foundation – the Elementary Web Class – in order to create other widgets which are a web view with some more logic on top.

## Typedef Documentation

## ◆ Elm_Widget_Smart_Class

typedef struct _Elm_Widget_Smart_Class Elm_Widget_Smart_Class

Base widget smart class.

It has the 'virtual' functions for all general, common actions on Elementary widgets.

## ◆ Elm_Widget_Smart_Data

typedef struct _Elm_Widget_Smart_Data Elm_Widget_Smart_Data

Base widget smart data.

This is data bound to an Elementary object instance, so its particular to that specific object and not shared between all objects in its class. It is here, though, that we got a pointer to the object's class, the first field – `'api'`.