Conformant Example.

In this example we'll explain how to create applications to work with illume, considering space required for virtual keyboards, indicator and softkeys.

Illume is a module for Enlightenment that modifies the user interface to work cleanly and nicely on a mobile device. It has support for virtual keyboard, among other nice features.

Let's start creating a very simple window with a vertical box with multi-line entry between two buttons. This entry will expand filling all space on window not used by buttons.

elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
{
Evas_Object *win, *btn, *bx, *en;
win = elm_win_util_standard_add("conformant", "Conformant Example");
bx = elm_box_add(win);
btn = elm_button_add(win);
elm_object_text_set(btn, "Test Conformant");
elm_box_pack_end(bx, btn);
en = elm_entry_add(win);
elm_object_text_set(en,
"This is a multi-line entry at the bottom<br>"
"This can contain more than 1 line of text and be "
"scrolled around to allow for entering of lots of "
"content. It is also to test to see that autoscroll "
"moves to the right part of a larger multi-line "
"text entry that is inside of a scroller than can be "
"scrolled around, thus changing the expected position "
"as well as cursor changes updating auto-scroll when "
"it is enabled.");
btn = elm_button_add(win);
elm_object_text_set(btn, "Test Conformant");
elm_box_pack_end(bx, btn);
evas_object_resize(win, 240, 480);
return 0;
}

For information about how to create windows, boxes, buttons or entries, look for documentation for these widgets.

It will looks fine when you don't need a virtual keyboard, as you can see on the following image:

But if you call a virtual keyboard, the window will resize, changing widgets size and position. All the content will shrink.

If you don't want such behaviour, you will need a conformant to account for space taken up by the indicator, virtual keyboard and softkey.

In this case, using the conformant in a proper way, you will have a window like the following:

As you can see, it guess the space that will be required by the keyboard, indicator and softkey bars.

So, let's study each step required to transform our initial example on the second one.

First of all, we need to set the window as an illume conformant window:

Next, we'll add a conformant widget, and set it to resize with the window, instead of the box.

Finally, we'll set the box as conformant's content, just like this:

elm_object_content_set(conform, bx);

Compare both examples code: conformant_example_01.c conformant_example_02.c

ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
@ ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
quit when the application's last window is closed
Definition: elm_general.h:248
elm_win_resize_object_add
void elm_win_resize_object_add(Eo *obj, Evas_Object *subobj)
Add subobj as a resize object of window obj.
Definition: efl_ui_win.c:8995
EINA_UNUSED
#define EINA_UNUSED
Definition: eina_types.h:339
elm_button_add
EAPI Evas_Object * elm_button_add(Evas_Object *parent)
Add a new button to the parent's canvas.
Definition: efl_ui_button.c:459
EVAS_HINT_EXPAND
#define EVAS_HINT_EXPAND
Use with evas_object_size_hint_weight_set(), evas_object_size_hint_weight_get(), evas_object_size_hin...
Definition: Evas_Common.h:297
elm_conformant_add
EAPI Evas_Object * elm_conformant_add(Evas_Object *parent)
Add a new conformant widget to the given parent Elementary (container) object.
Definition: elm_conform.c:968
Evas_Object
Efl_Canvas_Object Evas_Object
Definition: Evas_Common.h:185
elm_box_pack_end
void elm_box_pack_end(Elm_Box *obj, Efl_Canvas_Object *subobj)
Add an object at the end of the pack list.
Definition: elm_box_eo.legacy.c:57
evas_object_resize
void evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
Changes the size of the given Evas object.
Definition: evas_object_main.c:1236
evas_object_size_hint_weight_set
void evas_object_size_hint_weight_set(Evas_Object *obj, double x, double y)
Sets the hints for an object's weight.
Definition: evas_object_main.c:2638
elm_run
void elm_run(void)
Run Elementary's main loop.
Definition: elm_main.c:1362
elm_entry_add
EAPI Evas_Object * elm_entry_add(Evas_Object *parent)
This adds an entry to parent object.
Definition: elm_entry.c:4150
evas_object_size_hint_align_set
void evas_object_size_hint_align_set(Evas_Object *obj, double x, double y)
Sets the hints for an object's alignment.
Definition: evas_object_main.c:2650
evas_object_show
void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1814
EVAS_HINT_FILL
#define EVAS_HINT_FILL
Use with evas_object_size_hint_align_set(), evas_object_size_hint_align_get(), evas_object_size_hint_...
Definition: Evas_Common.h:298
elm_box_add
EAPI Evas_Object * elm_box_add(Evas_Object *parent)
Add a new box to the parent.
Definition: elm_box.c:363
EINA_TRUE
#define EINA_TRUE
Definition: eina_types.h:539
elm_policy_set
Eina_Bool elm_policy_set(unsigned int policy, int value)
Set a new policy's value (for a given policy group/identifier).
Definition: elm_main.c:1385
elm_win_util_standard_add
Evas_Object * elm_win_util_standard_add(const char *name, const char *title)
Adds a window object with standard setup.
Definition: efl_ui_win.c:9579
elm_win_autodel_set
void elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
Set the window's autodel state.
Definition: efl_ui_win.c:6189
elm_entry_scrollable_set
void elm_entry_scrollable_set(Elm_Entry *obj, Eina_Bool scroll)
Enable or disable scrolling in entry.
Definition: elm_entry_eo.legacy.c:3
ELM_POLICY_QUIT
@ ELM_POLICY_QUIT
under which circumstances the application should quit automatically.
Definition: elm_general.h:227
elm_win_conformant_set
void elm_win_conformant_set(Evas_Object *obj, Eina_Bool conformant)
Set if this window is an illume conformant window.
Definition: efl_ui_win.c:8357