What is elementary?

Elementary is a the high level toolkit based on the underlying efl technologies (Evas, Edje, Ecore, etc…). It provide all the widget you need to build a full application.

It is meant to make the programmers work almost brainless but give them lots of flexibility.

Callbacks

Widget callbacks

Widget callbacks are set with callback_*_add methods which take a callable, and optional args, kwargs as data.

The callbacks have a signature of either:

obj, *args, **kwargs

or:

obj, event_info, *args, **kwargs

Event callbacks

Event callbacks have signature of:

object, source_object, event_type, event_info, *args, **kwargs

A sample Python Elementary program

#!/usr/bin/env python
# encoding: utf-8

from efl.evas import EVAS_HINT_EXPAND, EVAS_HINT_FILL, EXPAND_BOTH
from efl import elementary
from efl.elementary.window import StandardWindow, DialogWindow
from efl.elementary.box import Box
from efl.elementary.button import Button
from efl.elementary.label import Label


def clicked_cb(btn, parent):
    dia = DialogWindow(parent, "window-dia", "DialogWindow",
                       size=(200,150), autodel=True)

    lb = Label(dia, text="This is a DialogWindow",
               size_hint_weight=EXPAND_BOTH)
    dia.resize_object_add(lb)
    lb.show()

    dia.show()

def window_dialog_clicked(obj):
    win = StandardWindow("window-states", "This is a StandardWindow",
                         autodel=True, size=(400, 400))
    if obj is None:
        win.callback_delete_request_add(lambda o: elementary.exit())

    box = Box(win, size_hint_weight=EXPAND_BOTH)
    win.resize_object_add(box)
    box.show()
    
    bt = Button(win, text="Create a new dialog")
    bt.callback_clicked_add(clicked_cb, win)
    box.pack_end(bt)
    bt.show()

    win.show()


if __name__ == "__main__":

    window_dialog_clicked(None)

    elementary.run()

API Reference

Enumerations

Object layers

Added in version 1.14.

efl.elementary.ELM_OBJECT_LAYER_BACKGROUND

where to place backgrounds

efl.elementary.ELM_OBJECT_LAYER_DEFAULT

Evas_Object default layer (and thus for Elementary)

efl.elementary.ELM_OBJECT_LAYER_FOCUS

where focus object visualization is

efl.elementary.ELM_OBJECT_LAYER_TOOLTIP

where to show tooltips

efl.elementary.ELM_OBJECT_LAYER_CURSOR

where to show cursors

efl.elementary.ELM_OBJECT_LAYER_LAST

last layer known by Elementary

Policy types

efl.elementary.ELM_POLICY_QUIT

Under which circumstances the application should quit automatically.

efl.elementary.ELM_POLICY_EXIT

Defines elm_exit() behaviour. (since 1.8)

efl.elementary.ELM_POLICY_THROTTLE

Defines how throttling should work (since 1.8)

Quit policy types

efl.elementary.ELM_POLICY_QUIT_NONE

Never quit the application automatically

efl.elementary.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED

Quit when the application’s last window is closed

efl.elementary.ELM_POLICY_QUIT_LAST_WINDOW_HIDDEN

Quit when the application’s last window is hidden

Added in version 1.15.

Exit policy types

Possible values for the ELM_POLICY_EXIT policy.

efl.elementary.ELM_POLICY_EXIT_NONE

Just quit the main loop on exit().

efl.elementary.ELM_POLICY_EXIT_WINDOWS_DEL

Delete all the windows after quitting the main loop.

Throttle policy types

Possible values for the #ELM_POLICY_THROTTLE policy.

efl.elementary.ELM_POLICY_THROTTLE_CONFIG

Do whatever elementary config is configured to do.

efl.elementary.ELM_POLICY_THROTTLE_HIDDEN_ALWAYS

Always throttle when all windows are no longer visible.

efl.elementary.ELM_POLICY_THROTTLE_NEVER

Never throttle when windows are all hidden, regardless of config settings.

Object multi select policy values

Possible values for the #ELM_OBJECT_MULTI_SELECT_MODE policy.

Added in version 1.18.

efl.elementary.ELM_OBJECT_MULTI_SELECT_MODE_DEFAULT

Default multiple select mode.

efl.elementary.ELM_OBJECT_MULTI_SELECT_MODE_WITH_CONTROL

Disallow mutiple selection when clicked without control key pressed.

Elm_Process_State

efl.elementary.ELM_PROCESS_STATE_FOREGROUND

The process is in a foreground/active/running state - work as normal.

Added in version 1.12.

efl.elementary.ELM_PROCESS_STATE_BACKGROUND

The process is in the bacgkround, so you may want to stop animating, fetching data as often etc.

Added in version 1.12.

Notify close reasons

The reason the notification was closed

efl.elementary.ELM_SYS_NOTIFY_CLOSED_EXPIRED

The notification expired.

Added in version 1.10.

efl.elementary.ELM_SYS_NOTIFY_CLOSED_DISMISSED

The notification was dismissed by the user.

Added in version 1.10.

efl.elementary.ELM_SYS_NOTIFY_CLOSED_REQUESTED

The notification was closed by a call to CloseNotification method.

Added in version 1.10.

efl.elementary.ELM_SYS_NOTIFY_CLOSED_UNDEFINED

Undefined/reserved reasons.

Added in version 1.10.

Notify urgency levels

Urgency levels of a notification

see:

sys_notify_send()

efl.elementary.ELM_SYS_NOTIFY_URGENCY_LOW

Low

Added in version 1.10.

efl.elementary.ELM_SYS_NOTIFY_URGENCY_NORMAL

Normal

Added in version 1.10.

efl.elementary.ELM_SYS_NOTIFY_URGENCY_CRITICAL

Critical

Added in version 1.10.

Glob matching

Glob matching bitfiled flags

efl.elementary.ELM_GLOB_MATCH_NO_ESCAPE

Treat backslash as an ordinary character instead of escape.

Added in version 1.11.

efl.elementary.ELM_GLOB_MATCH_PATH

Match a slash in string only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash.

Added in version 1.11.

efl.elementary.ELM_GLOB_MATCH_PERIOD

Leading period in string has to be matched exactly by a period in pattern. A period is considered to be leading if it is the first character in string, or if both ELM_GLOB_MATCH_PATH is set and the period immediately follows a slash.

Added in version 1.11.

efl.elementary.ELM_GLOB_MATCH_NOCASE

The pattern is matched case-insensitively.

Added in version 1.11.

General

General Elementary API. Functions that don’t relate to Elementary objects specifically.

Here are documented functions which init/shutdown the library, that apply to generic Elementary objects, that deal with configuration, et cetera.

Fingers

Elementary is designed to be finger-friendly for touchscreens, and so in addition to scaling for display resolution, it can also scale based on finger “resolution” (or size). You can then customize the granularity of the areas meant to receive clicks on touchscreens.

Different profiles may have pre-set values for finger sizes.

Caches

These are functions which let one fine-tune some cache values for Elementary applications, thus allowing for performance adjustments.

Fonts

These are functions dealing with font rendering, selection and the like for Elementary applications. One might fetch which system fonts are there to use and set custom fonts for individual classes of UI items containing text (text classes).

Debug

Don’t use them unless you are sure.

Sys Notify

Widgets

Inheritance diagram