From 6a77df16f22faa2eb752c5e02770314a8a605254 Mon Sep 17 00:00:00 2001 From: Michael Bouchaud Date: Wed, 8 Jan 2014 22:27:54 +0100 Subject: [PATCH] entrance: manage user wallpaper transition --- src/bin/entrance_gui.c | 45 ++++++++++++++++++++++++++++++++++++++++ src/bin/entrance_gui.h | 1 + src/bin/entrance_login.c | 7 ++++++- 3 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/bin/entrance_gui.c b/src/bin/entrance_gui.c index d3d7cd2..a539a31 100644 --- a/src/bin/entrance_gui.c +++ b/src/bin/entrance_gui.c @@ -15,6 +15,7 @@ static void _entrance_gui_actions_populate(); static void _entrance_gui_conf_clicked_cb(void *data, Evas_Object *obj, void *event_info); static void _entrance_gui_update(void); static void _entrance_gui_auth_cb(void *data, const char *user, Eina_Bool granted); +static void _entrance_gui_user_bg_cb(void *data, Evas_Object *obj, const char *signal, const char *source); static Entrance_Gui *_gui; @@ -100,6 +101,8 @@ entrance_gui_init(const char *theme) /* layout */ o = entrance_gui_theme_get(_gui->win, "entrance/wallpaper/default"); screen->transition = o; + elm_object_signal_callback_add(o, "entrance,wallpaper,end", "", + _entrance_gui_user_bg_cb, screen); ol = entrance_gui_theme_get(_gui->win, "entrance"); screen->edj = ol; if (!ol) @@ -379,6 +382,31 @@ entrance_gui_vkbd_enabled_get(void) return _gui->vkbd_enabled; } +void +entrance_gui_user_bg_set(const char *path, const char *group) +{ + Eina_List *l; + Entrance_Screen *screen; + Evas_Object *o; + + EINA_LIST_FOREACH(_gui->screens, l, screen) + { + if (path && group) + { + o = elm_layout_add(screen->background); + elm_layout_file_set(o, path, group); + elm_object_part_content_set(screen->transition, + "entrance.wallpaper.user.start", o); + evas_object_show(o); + elm_object_signal_emit(screen->transition, + "entrance,wallpaper,user", ""); + } + else + elm_object_signal_emit(screen->transition, + "entrance,wallpaper,default", ""); + } +} + static void _entrance_gui_update(void) { @@ -485,6 +513,7 @@ _entrance_gui_user_sel_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_ entrance_login_login_set(data, eu->login); } + static char * _entrance_gui_user_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) { @@ -610,6 +639,22 @@ _entrance_gui_auth_cb(void *data, const char *user EINA_UNUSED, Eina_Bool grante */ } +static void +_entrance_gui_user_bg_cb(void *data, Evas_Object *obj, const char *signal, const char *source) +{ + Evas_Object *o; + Entrance_Screen *screen; + screen = data; + o = elm_object_part_content_get(screen->transition, + "entrance.wallpaper.user"); + evas_object_del(o); + o = elm_object_part_content_get(screen->transition, + "entrance.wallpaper.user.start"); + if (o) + elm_object_part_content_set(screen->transition, + "entrance.wallpaper.user", o); +} + static Eina_Bool _entrance_gui_cb_window_property(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info) { diff --git a/src/bin/entrance_gui.h b/src/bin/entrance_gui.h index 4b2eb6d..789d726 100644 --- a/src/bin/entrance_gui.h +++ b/src/bin/entrance_gui.h @@ -24,6 +24,7 @@ void entrance_gui_theme_name_set(const char *theme); void entrance_gui_background_get(const char **path, const char **group); Eina_Bool entrance_gui_vkbd_enabled_get(void); const char *entrance_gui_theme_path_get(void); +void entrance_gui_user_bg_set(const char *path, const char *group); /* char *entrance_gui_user_get(); diff --git a/src/bin/entrance_login.c b/src/bin/entrance_login.c index d06ce20..25654c3 100644 --- a/src/bin/entrance_login.c +++ b/src/bin/entrance_login.c @@ -331,11 +331,16 @@ _login_xsession_guess(void *data, const char *user) if (!strcmp(eu->login, user)) { _entrance_login_session_set(data, eu->lsess); + entrance_gui_user_bg_set(eu->bg.path, eu->bg.group); break; } } - if (!l) _entrance_login_session_set(data, NULL); + if (!l) + { + _entrance_login_session_set(data, NULL); + entrance_gui_user_bg_set(NULL, NULL); + } } static void