forked from enlightenment/efl
elementary: add policy for elm exit
With ELM_POLICY_EXIT it's possible to request elementary to delete all the windows before shutdown instead of just quitting the main loop. SVN revision: 77328
This commit is contained in:
parent
f2f7c1deef
commit
322ceb0458
|
@ -77,6 +77,9 @@ typedef enum
|
||||||
* should quit automatically. @see
|
* should quit automatically. @see
|
||||||
* Elm_Policy_Quit.
|
* Elm_Policy_Quit.
|
||||||
*/
|
*/
|
||||||
|
ELM_POLICY_EXIT, /**< defines elm_exit() behaviour. @see Elm_Policy_Exit.
|
||||||
|
* @since 1.8
|
||||||
|
*/
|
||||||
ELM_POLICY_LAST
|
ELM_POLICY_LAST
|
||||||
} Elm_Policy; /**< Elementary policy identifiers/groups enumeration. @see elm_policy_set() */
|
} Elm_Policy; /**< Elementary policy identifiers/groups enumeration. @see elm_policy_set() */
|
||||||
|
|
||||||
|
@ -89,6 +92,13 @@ typedef enum
|
||||||
* window is closed */
|
* window is closed */
|
||||||
} Elm_Policy_Quit; /**< Possible values for the #ELM_POLICY_QUIT policy */
|
} Elm_Policy_Quit; /**< Possible values for the #ELM_POLICY_QUIT policy */
|
||||||
|
|
||||||
|
typedef enum
|
||||||
|
{
|
||||||
|
ELM_POLICY_EXIT_NONE = 0, /**< just quit the main loop on elm_exit() */
|
||||||
|
ELM_POLICY_EXIT_WINDOWS_DEL /**< delete all the windows after quitting
|
||||||
|
* the main loop */
|
||||||
|
} Elm_Policy_Exit; /**< Possible values for the #ELM_POLICY_EXIT policy */
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ELM_FOCUS_PREVIOUS,
|
ELM_FOCUS_PREVIOUS,
|
||||||
|
|
|
@ -847,6 +847,15 @@ EAPI void
|
||||||
elm_exit(void)
|
elm_exit(void)
|
||||||
{
|
{
|
||||||
ecore_main_loop_quit();
|
ecore_main_loop_quit();
|
||||||
|
|
||||||
|
if (elm_policy_get(ELM_POLICY_EXIT) == ELM_POLICY_EXIT_WINDOWS_DEL)
|
||||||
|
{
|
||||||
|
Eina_List *l, *l_next;
|
||||||
|
Evas_Object *win;
|
||||||
|
|
||||||
|
EINA_LIST_FOREACH_SAFE(_elm_win_list, l, l_next, win)
|
||||||
|
evas_object_del(win);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME: Use Elm_Policy Parameter when 2.0 is released.
|
//FIXME: Use Elm_Policy Parameter when 2.0 is released.
|
||||||
|
|
Loading…
Reference in New Issue