2 * @defgroup General General
5 * @brief General Elementary API. Functions that don't relate to
6 * Elementary objects specifically.
8 * Here are documented functions which init/shutdown the library,
9 * that apply to generic Elementary objects, that deal with
10 * configuration, et cetera.
12 * @ref general_functions_example_page "This" example contemplates
13 * some of these functions.
22 * Defines couple of standard Evas_Object layers to be used
23 * with evas_object_layer_set().
25 * @note whenever extending with new values, try to keep some padding
26 * to siblings so there is room for further extensions.
30 ELM_OBJECT_LAYER_BACKGROUND = EVAS_LAYER_MIN + 64, /**< where to place backgrounds */
31 ELM_OBJECT_LAYER_DEFAULT = 0, /**< Evas_Object default layer (and thus for Elementary) */
32 ELM_OBJECT_LAYER_FOCUS = EVAS_LAYER_MAX - 128, /**< where focus object visualization is */
33 ELM_OBJECT_LAYER_TOOLTIP = EVAS_LAYER_MAX - 64, /**< where to show tooltips */
34 ELM_OBJECT_LAYER_CURSOR = EVAS_LAYER_MAX - 32, /**< where to show cursors */
35 ELM_OBJECT_LAYER_LAST /**< last layer known by Elementary */
38 /**************************************************************************/
39 EAPI extern int ELM_ECORE_EVENT_ETHUMB_CONNECT;
42 * Emitted when the application has reconfigured elementary settings due
43 * to an external configuration tool asking it to.
45 EAPI extern int ELM_EVENT_CONFIG_ALL_CHANGED;
48 * Emitted when any Elementary's policy value is changed.
50 EAPI extern int ELM_EVENT_POLICY_CHANGED;
53 * @typedef Elm_Event_Policy_Changed
55 * Data on the event when an Elementary policy has changed
57 typedef struct _Elm_Event_Policy_Changed Elm_Event_Policy_Changed;
60 * @struct _Elm_Event_Policy_Changed
62 * Data on the event when an Elementary policy has changed
64 struct _Elm_Event_Policy_Changed
66 unsigned int policy; /**< the policy identifier */
67 int new_value; /**< value the policy had before the change */
68 int old_value; /**< new value the policy got */
76 ELM_POLICY_QUIT, /**< under which circumstances the application
77 * should quit automatically. @see
80 ELM_POLICY_EXIT, /**< defines elm_exit() behaviour. @see Elm_Policy_Exit.
83 ELM_POLICY_THROTTLE, /**< defines how throttling should work @see Elm_Policy_Throttle
87 } Elm_Policy; /**< Elementary policy identifiers/groups enumeration. @see elm_policy_set() */
90 * Possible values for the #ELM_POLICY_QUIT policy
94 ELM_POLICY_QUIT_NONE = 0, /**< never quit the application
96 ELM_POLICY_QUIT_LAST_WINDOW_CLOSED /**< quit when the
102 * Possible values for the #ELM_POLICY_EXIT policy.
107 ELM_POLICY_EXIT_NONE = 0, /**< just quit the main loop on elm_exit() */
108 ELM_POLICY_EXIT_WINDOWS_DEL /**< delete all the windows after quitting
113 * Possible values for the #ELM_POLICY_THROTTLE policy.
118 ELM_POLICY_THROTTLE_CONFIG = 0, /**< do whatever elementary config is configured to do */
119 ELM_POLICY_THROTTLE_HIDDEN_ALWAYS, /**< always throttle when all windows are no longer visible */
120 ELM_POLICY_THROTTLE_NEVER /**< never throttle when windows are all hidden, regardless of config settings */
121 } Elm_Policy_Throttle;
125 ELM_OBJECT_SELECT_MODE_DEFAULT = 0, /**< default select mode */
126 ELM_OBJECT_SELECT_MODE_ALWAYS, /**< always select mode */
127 ELM_OBJECT_SELECT_MODE_NONE, /**< no select mode */
128 ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, /**< no select mode with no finger size rule*/
129 ELM_OBJECT_SELECT_MODE_MAX
130 } Elm_Object_Select_Mode;
133 * @typedef Elm_Object_Item
134 * An Elementary Object item handle.
137 typedef struct _Elm_Object_Item Elm_Object_Item;
139 typedef Eina_Bool (*Elm_Event_Cb)(void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); /**< Function prototype definition for callbacks on input events happening on Elementary widgets. @a data will receive the user data pointer passed to elm_object_event_callback_add(). @a src will be a pointer to the widget on which the input event took place. @a type will get the type of this event and @a event_info, the struct with details on this event. */
141 #ifndef ELM_LIB_QUICKLAUNCH
142 #define ELM_MAIN() int main(int argc, char **argv) {elm_init(argc, argv); return elm_main(argc, argv); } /**< macro to be used after the elm_main() function */
144 #define ELM_MAIN() int main(int argc, char **argv) {return elm_quicklaunch_fallback(argc, argv); } /**< macro to be used after the elm_main() function */
147 /**************************************************************************/
151 * Initialize Elementary
153 * @param[in] argc System's argument count value
154 * @param[in] argv System's pointer to array of argument strings
155 * @return The init counter value.
157 * This function initializes Elementary and increments a counter of
158 * the number of calls to it. It returns the new counter's value.
160 * @warning This call is exported only for use by the @c ELM_MAIN()
161 * macro. There is no need to use this if you use this macro (which
162 * is highly advisable). An elm_main() should contain the entry
163 * point code for your application, having the same prototype as
164 * elm_init(), and @b not being static (putting the @c EAPI_MAIN symbol
165 * in front of its type declaration is advisable). The @c
166 * ELM_MAIN() call should be placed just after it.
169 * @dontinclude bg_example_01.c
173 * See the full @ref bg_example_01_c "example".
175 * @see elm_shutdown().
178 EAPI int elm_init(int argc, char **argv);
181 * Shut down Elementary
183 * @return The init counter value.
185 * This should be called at the end of your application, just
186 * before it ceases to do any more processing. This will clean up
187 * any permanent resources your application may have allocated via
188 * Elementary that would otherwise persist.
190 * @see elm_init() for an example
192 * @note elm_shutdown() will iterate main loop until all ecore_evas are freed.
193 * There is a possibility to call your ecore callbacks(timer, animator, event,
194 * job, and etc.) in elm_shutdown()
198 EAPI int elm_shutdown(void);
201 * Run Elementary's main loop
203 * This call should be issued just after all initialization is
204 * completed. This function will not return until elm_exit() is
205 * called. It will keep looping, running the main
206 * (event/processing) loop for Elementary.
208 * @see elm_init() for an example
212 EAPI void elm_run(void);
215 * Ask to exit Elementary's main loop
217 * If this call is issued, it will flag the main loop to cease
218 * processing and return back to its parent function (usually your
219 * elm_main() function). This does not mean the main loop instantly quits.
220 * So your ecore callbacks(timer, animator, event, job, and etc.) have chances
221 * to be called even after elm_exit().
223 * @see elm_init() for an example. There, just after a request to
224 * close the window comes, the main loop will be left.
226 * @note By using the appropriate #ELM_POLICY_QUIT on your Elementary
227 * applications, you'll be able to get this function called automatically for you.
231 EAPI void elm_exit(void);
234 * Exposed symbol used only by macros and should not be used by apps
236 EAPI void elm_quicklaunch_mode_set(Eina_Bool ql_on);
239 * Exposed symbol used only by macros and should not be used by apps
241 EAPI Eina_Bool elm_quicklaunch_mode_get(void);
244 * Exposed symbol used only by macros and should not be used by apps
246 EAPI int elm_quicklaunch_init(int argc, char **argv);
249 * Exposed symbol used only by macros and should not be used by apps
251 EAPI int elm_quicklaunch_sub_init(int argc, char **argv);
254 * Exposed symbol used only by macros and should not be used by apps
256 EAPI int elm_quicklaunch_sub_shutdown(void);
259 * Exposed symbol used only by macros and should not be used by apps
261 EAPI int elm_quicklaunch_shutdown(void);
264 * Exposed symbol used only by macros and should not be used by apps
266 EAPI void elm_quicklaunch_seed(void);
269 * Exposed symbol used only by macros and should not be used by apps
271 EAPI Eina_Bool elm_quicklaunch_prepare(int argc, char **argv);
274 * Exposed symbol used only by macros and should not be used by apps
276 EAPI Eina_Bool elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (postfork_func) (void *data), void *postfork_data);
279 * Exposed symbol used only by macros and should not be used by apps
281 EAPI void elm_quicklaunch_cleanup(void);
284 * Exposed symbol used only by macros and should not be used by apps
286 EAPI int elm_quicklaunch_fallback(int argc, char **argv);
289 * Exposed symbol used only by macros and should not be used by apps
291 EAPI char *elm_quicklaunch_exe_path_get(const char *exe);
294 * Set a new policy's value (for a given policy group/identifier).
296 * @param policy policy identifier, as in @ref Elm_Policy.
297 * @param value policy value, which depends on the identifier
299 * @return @c EINA_TRUE on success or @c EINA_FALSE, on error.
301 * Elementary policies define applications' behavior,
302 * somehow. These behaviors are divided in policy groups
303 * (see #Elm_Policy enumeration). This call will emit the Ecore
304 * event #ELM_EVENT_POLICY_CHANGED, which can be hooked at with
305 * handlers. An #Elm_Event_Policy_Changed struct will be passed,
308 * @note Currently, we have only one policy identifier/group
309 * (#ELM_POLICY_QUIT), which has two possible values.
313 EAPI Eina_Bool elm_policy_set(unsigned int policy, int value);
316 * Gets the policy value for given policy identifier.
318 * @param policy policy identifier, as in #Elm_Policy.
319 * @return The currently set policy value, for that
320 * identifier. Will be @c 0 if @p policy passed is invalid.
324 EAPI int elm_policy_get(unsigned int policy);
327 * Change the language of the current application
329 * The @p lang passed must be the full name of the locale to use, for
330 * example "en_US.utf8" or "es_ES@euro".
332 * Changing language with this function will make Elementary run through
333 * all its widgets, translating strings set with
334 * elm_object_domain_translatable_text_part_set(). This way, an entire
335 * UI can have its language changed without having to restart the program.
337 * For more complex cases, like having formatted strings that need
338 * translation, widgets will also emit a "language,changed" signal that
339 * the user can listen to to manually translate the text.
341 * @param lang Language to set, must be the full name of the locale
345 EAPI void elm_language_set(const char *lang);