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.
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.
Under which circumstances the application should quit automatically.
Defines elm_exit() behaviour. (since 1.8)
Defines how throttling should work (since 1.8)
Never quit the application automatically
Quit when the application’s last window is closed
Possible values for the ELM_POLICY_EXIT policy.
Just quit the main loop on exit().
Delete all the windows after quitting the main loop.
Possible values for the #ELM_POLICY_THROTTLE policy.
Do whatever elementary config is configured to do.
Always throttle when all windows are no longer visible.
Never throttle when windows are all hidden, regardless of config settings.
Bases: object
Elementary font properties
| Type : | unicode |
|---|
| Type : | list of strings |
|---|
Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje’s, Evas’ and Eet’s cache.
Note
Evas caches are flushed for every canvas associated with a window.
New in version 1.8.
Adjust size of an element for finger usage.
| Parameters: |
|
|---|---|
| Returns: | The adjusted width and height |
| Return type: | (int w, int h) |
This takes width and height sizes (in pixels) as input and a size multiple (which is how many fingers you want to place within the area, being “finger” the size set by elm_config_finger_size_set()), and adjusts the size to be large enough to accommodate the resulting size – if it doesn’t already accommodate it.
Note
This is kind of low level Elementary call, most useful on size evaluation times for widgets. An external user wouldn’t be calling, most of the time.
Ask to exit Elementary’s main loop
If this call is issued, it will flag the main loop to cease processing and return back to its parent function (usually your elm_main() function). This does not mean the main loop instantly quits. So your ecore callbacks(timer, animator, event, job, and etc.) have chances to be called even after exit().
Note
By using the appropriate #ELM_POLICY_QUIT on your Elementary applications, you’ll be able to get this function called automatically for you.
Translate a font name, bound to a style, into fontconfig’s font names syntax.
| Parameters: |
|
|---|---|
| Returns: | the font name and style string |
Note
The reverse translation can be achieved with font_properties_get(), for one style only (single font instance, not family).
New in version 1.8.
Free font properties return by font_properties_get().
| Parameters: | fp – the font properties struct |
|---|
New in version 1.8.
Translate a font (family) name string in fontconfig’s font names syntax into a FontProperties object.
| Parameters: | font – The font name and styles string |
|---|---|
| Returns: | the font properties object |
Note
The reverse translation can be achieved with font_fontconfig_name_get(), for one style only (single font instance, not family).
New in version 1.8.
Initialize Elementary
| Return int: | The init counter value. |
|---|
This function initializes Elementary and increments a counter of the number of calls to it. It returns the new counter’s value.
Change the language of the current application
The lang passed must be the full name of the locale to use, for example en_US.utf8 or es_ES@euro.
Changing language with this function will make Elementary run through all its widgets, translating strings set with elm_object_domain_translatable_part_text_set(). This way, an entire UI can have its language changed without having to restart the program.
For more complex cases, like having formatted strings that need translation, widgets will also emit a “language,changed” signal that the user can listen to and manually translate the text.
| Parameters: | lang – Language to set, must be the full name of the locale |
|---|
Print Elm Objects tree hierarchy in file as dot(graphviz) syntax.
| Parameters: |
|
|---|
New in version 1.8.
Print Tree object hierarchy in stdout
| Parameters: | top – The root object |
|---|
New in version 1.8.
Gets the policy value set for given identifier.
| Parameters: | policy (Policy types) – policy identifier as in Elm_Policy. |
|---|---|
| Returns: | policy value. Will be 0 if policy identifier is invalid. |
| Return type: | Quit policy types |
Set new policy value.
This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main loop giving the event information Elm_Event_Policy_Changed with policy identifier, new and old values.
| Parameters: |
|
|---|---|
| Returns: | True on success or False on error (right now just invalid policy identifier, but in future policy value might be enforced). |
Run Elementary’s main loop
This call should be issued just after all initialization is completed. This function will not return until exit() is called. It will keep looping, running the main (event/processing) loop for Elementary.
Shut down Elementary
| Return int: | The init counter value. |
|---|
This should be called at the end of your application, just before it ceases to do any more processing. This will clean up any permanent resources your application may have allocated via Elementary that would otherwise persist.
Note
shutdown() will iterate main loop until all ecore_evas are freed. There is a possibility to call your ecore callbacks(timer, animator, event, job, and etc.) in shutdown()