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)
#define EINA_UNUSED
Used to indicate that a function parameter is purposely unused.
Definition: eina_types.h:339
{
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;
}
#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
#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
#define EINA_TRUE
boolean value TRUE (numerical value 1)
Definition: eina_types.h:539
Evas_Object * elm_box_add(Evas_Object *parent)
Add a new box to the parent.
Definition: elm_box.c:363
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 * elm_button_add(Evas_Object *parent)
Add a new button to the parent's canvas.
Definition: efl_ui_button.c:459
void elm_entry_scrollable_set(Elm_Entry *obj, Eina_Bool scroll)
Enable or disable scrolling in entry.
Definition: elm_entry_eo.legacy.c:3
Evas_Object * elm_entry_add(Evas_Object *parent)
This adds an entry to parent object.
Definition: elm_entry.c:4184
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:1380
void elm_run(void)
Run Elementary's main loop.
Definition: elm_main.c:1357
@ ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
quit when the application's last window is closed
Definition: elm_general.h:248
@ ELM_POLICY_QUIT
under which circumstances the application should quit automatically.
Definition: elm_general.h:227
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:9582
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:8997
void elm_win_autodel_set(Eo *obj, Eina_Bool autodel)
Set the window's autodel state.
Definition: efl_ui_win.c:6194
EVAS_API void evas_object_show(Evas_Object *eo_obj)
Makes the given Evas object visible.
Definition: evas_object_main.c:1814
EVAS_API 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
Efl_Canvas_Object Evas_Object
An Evas Object handle.
Definition: Evas_Common.h:185
EVAS_API 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_API 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

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:

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:8355

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

conform = elm_conformant_add(win);
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_show(conform);

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