diff -Nru entrance-0.0.4~201312021541/.arcconfig entrance-0.0.5~201401231204/.arcconfig --- entrance-0.0.4~201312021541/.arcconfig 1970-01-01 00:00:00.000000000 +0000 +++ entrance-0.0.5~201401231204/.arcconfig 2014-01-21 17:12:02.000000000 +0000 @@ -0,0 +1,4 @@ +{ + "project_id" : "entrance", + "conduit_uri" : "https://phab.enlightenment.org/" +} diff -Nru entrance-0.0.4~201312021541/AUTHORS entrance-0.0.5~201401231204/AUTHORS --- entrance-0.0.4~201312021541/AUTHORS 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/AUTHORS 2014-01-21 17:12:02.000000000 +0000 @@ -2,3 +2,5 @@ Carsten Haitzler Maxime Villard Cedric Bail +Andrew Williams +Marcel Hollerbach diff -Nru entrance-0.0.4~201312021541/README entrance-0.0.5~201401231204/README --- entrance-0.0.4~201312021541/README 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/README 2014-01-21 17:12:02.000000000 +0000 @@ -1,10 +1,10 @@ -What entrance do: +What entrance can do: open session with pam User can choose the WM to open Admin can make a script who are called to open session (/etc/X11/xinit/xinitrc) Everything can be configured in entrance.conf -You could put an customized icon for your user in +You could put a customized icon for your user in /var/cache/entrance/users/(username).edj with groupname "entrance/user/icon" BIG THX to http://tux.crystalxp.net for tux g1 ! Specificaly to all authors of each tux present in this build. diff -Nru entrance-0.0.4~201312021541/TODO entrance-0.0.5~201401231204/TODO --- entrance-0.0.4~201312021541/TODO 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/TODO 2014-01-21 17:12:02.000000000 +0000 @@ -10,5 +10,3 @@ Study possibility to use it with wayland so we can have transition when switching from one terminal to another. white and black users list virtual keyboard support - - diff -Nru entrance-0.0.4~201312021541/configure.ac entrance-0.0.5~201401231204/configure.ac --- entrance-0.0.4~201312021541/configure.ac 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/configure.ac 2014-01-21 17:12:02.000000000 +0000 @@ -1,10 +1,8 @@ -AC_INIT([entrance], [0.0.5], [enlightenment-devel@lists.sourceforge.net]) +AC_INIT([entrance], [0.0.99], [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ([2.59]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_MACRO_DIR([m4]) -AC_CANONICAL_HOST - AM_INIT_AUTOMAKE([1.6 dist-bzip2]) AC_CONFIG_HEADERS([config.h]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) @@ -89,6 +87,10 @@ AC_MSG_RESULT([${enable_consolekit}]) +### Checks for programs +AC_PROG_CC +PKG_PROG_PKG_CONFIG + # Set edje_cc path AC_ARG_WITH([edje-cc], [AC_HELP_STRING([--with-edje-cc=PATH], [specify a specific path to edje_cc])], @@ -97,18 +99,11 @@ edje_cc=$v echo " Enlightenment edje_cc explicitly set to "$edje_cc; ], - [edje_cc=$(pkg-config --variable=prefix edje)/bin/edje_cc]) + [edje_cc=$($PKG_CONFIG --variable=prefix edje)/bin/edje_cc]) AC_SUBST(edje_cc) -### Checks for programs -AC_PROG_CC - ### Checks for compiler characteristics AC_USE_SYSTEM_EXTENSIONS -AC_ISC_POSIX -AC_PROG_CC_STDC -AC_HEADER_STDC -AC_C_CONST AC_C___ATTRIBUTE__ ### Checks for libraries @@ -148,7 +143,6 @@ [have_pam="no"]) fi - ### Checks for header files # Pam @@ -177,8 +171,7 @@ ### Checks for library functions AC_FUNC_MALLOC -AC_CHECK_FUNCS(strndup) - +AC_FUNC_ALLOCA AC_OUTPUT([ Makefile diff -Nru entrance-0.0.4~201312021541/data/themes/default/default.edc entrance-0.0.5~201401231204/data/themes/default/default.edc --- entrance-0.0.4~201312021541/data/themes/default/default.edc 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/data/themes/default/default.edc 2014-01-21 17:12:02.000000000 +0000 @@ -48,9 +48,9 @@ description { state: "default" 0.0; visible: 1; color: 255 255 255 255; - rel2 { + rel1 { to: "cur"; - relative: 0.0 1.0; + relative: 1.0 0.0; } } } @@ -59,9 +59,10 @@ description { state: "default" 0.0; visible: 1; color: 255 255 255 255; - rel1 { + rel2 { to: "cur"; - relative: 1.0 0.0; + relative: 0.0 1.0; + offset: 0 -1; } } } @@ -71,11 +72,11 @@ min: 1 0; max: 1 99999; visible: 0; - align: 1.0 0.5; + align: 0.0 0.5; } description { state: "user" 0.0; inherit: "default" 0.0; - align: 0.0 0.5; + align: 1.0 0.5; } } part { name: "entrance.wallpaper.default"; @@ -92,6 +93,13 @@ visible: 1; } } + part { name: "entrance.wallpaper.user.start"; + clip_to: "clip2"; + type: SWALLOW; + description { state: "default" 0.0; + visible: 1; + } + } part { name: "entrance.screen"; type: SWALLOW; description { state: "default" 0.0; @@ -104,13 +112,20 @@ signal: "entrance,wallpaper,user"; source: ""; action: STATE_SET "user" 0.0; + transition: LINEAR 0.7; target: "cur"; + after: "wallpaper_transition_end"; } program { name: "wallpaper_default"; signal: "entrance,wallpaper,default"; source: ""; action: STATE_SET "default" 0.0; + transition: LINEAR 0.7; target: "cur"; + after: "wallpaper_transition_end"; + } + program { name: "wallpaper_transition_end"; + action: SIGNAL_EMIT "entrance,wallpaper,end" ""; } } } diff -Nru entrance-0.0.4~201312021541/debian/changelog entrance-0.0.5~201401231204/debian/changelog --- entrance-0.0.4~201312021541/debian/changelog 2013-12-02 11:41:55.000000000 +0000 +++ entrance-0.0.5~201401231204/debian/changelog 2014-01-23 08:05:04.000000000 +0000 @@ -1,4 +1,4 @@ -entrance (0.0.4~201312021541-1ppa1~saucy) saucy; urgency=high +entrance (0.0.5~201401231204-1ppa1~saucy) saucy; urgency=high * Autobuild. diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_client.h entrance-0.0.5~201401231204/src/bin/entrance_client.h --- entrance-0.0.4~201312021541/src/bin/entrance_client.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_client.h 2014-01-21 17:12:02.000000000 +0000 @@ -33,6 +33,6 @@ extern struct tm *local_time; extern char entrance_time_d[4096]; -int entrance_client_main(); +int entrance_client_main(void); #endif /* ENTRANCE_H_ */ diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_conf.c entrance-0.0.5~201401231204/src/bin/entrance_conf.c --- entrance-0.0.4~201312021541/src/bin/entrance_conf.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_conf.c 2014-01-21 17:12:02.000000000 +0000 @@ -19,6 +19,7 @@ const char *elm_profile; Eina_Bool vkbd_enabled : 1; double scale; + Eina_Bool update : 1; struct { @@ -36,6 +37,7 @@ } image; const char *lsess; Eina_Bool remember_session : 1; + Eina_Bool update : 1; } user; struct @@ -43,7 +45,6 @@ Evas_Object *btn_ok; Evas_Object *btn_apply; } gui; - } Entrance_Int_Conf; @@ -54,13 +55,15 @@ static Eina_Bool _entrance_conf_bg_state_get(void *data, Evas_Object *obj, const char *part); static void _entrance_conf_bg_sel(void *data, Evas_Object *obj, void *event_info); static Eina_Bool _entrance_conf_bg_fill_cb(void *data, Elm_Object_Item *it); +static Eina_Bool _entrance_conf_user_bg_fill_cb(void *data, Elm_Object_Item *it); static void _entrance_conf_user_bg_sel(void *data, Evas_Object *obj, void *event_info); -static void _entrance_conf_changed(); -static void _entrance_conf_apply(); +static void _entrance_conf_changed(void); +static void _entrance_conf_apply(void); static Evas_Object *_entrance_conf_user_build(Evas_Object *obj); -static void _entrance_conf_user_build_cb(Evas_Object *t, const char *user); +static void _entrance_conf_user_build_cb(Evas_Object *t, Entrance_Login *eu); static Entrance_Fill *_entrance_background_fill = NULL; +static Entrance_Fill *_entrance_session_fill = NULL; static Entrance_Int_Conf *_entrance_int_conf = NULL; static char * @@ -159,6 +162,50 @@ _entrance_conf_changed(); } +static Eina_Bool +_entrance_conf_user_bg_fill_cb(void *data, Elm_Object_Item *it) +{ + Entrance_Conf_Background *cbg; + const char *bg_path, *bg_group; + cbg = data; + + bg_path = _entrance_int_conf->user.orig->bg.path; + bg_group = _entrance_int_conf->user.orig->bg.group; + if ((cbg->path) + && (cbg->group) + && (bg_path) + && (bg_group) + && (!strcmp(cbg->path, bg_path)) + && (!strcmp(cbg->group, bg_group))) + { + elm_genlist_item_selected_set(it, EINA_TRUE); + return EINA_TRUE; + } + return EINA_FALSE; +} +static char * +_entrance_conf_session_text_get(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) +{ + return NULL; +} + +static Evas_Object * +_entrance_conf_session_content_get(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) +{ + return NULL; +} + +static Eina_Bool +_entrance_conf_session_state_get(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) +{ + return EINA_FALSE; +} + +static void +_entrance_conf_session_del(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED) +{ +} + /* vkbd */ static void _entrance_conf_vkbd_changed(void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED) @@ -270,7 +317,7 @@ } static void -_entrance_conf_apply() +_entrance_conf_apply(void) { Entrance_Conf_Gui_Event conf; @@ -278,17 +325,53 @@ conf.bg.group = _entrance_int_conf->bg.group; conf.vkbd_enabled = _entrance_int_conf->vkbd_enabled; - if (_entrance_int_conf->scale != elm_config_scale_get()) + if (_entrance_int_conf->update) { - elm_config_scale_set(_entrance_int_conf->scale); - elm_config_all_flush(); + if (_entrance_int_conf->scale != elm_config_scale_get()) + { + elm_config_scale_set(_entrance_int_conf->scale); + elm_config_all_flush(); + elm_config_save(); + } + if (_entrance_int_conf->theme != entrance_gui_theme_name_get()) + { + entrance_gui_theme_name_set(_entrance_int_conf->theme); + } + entrance_gui_conf_set(&conf); + entrance_connect_conf_gui_send(&conf); } - if (_entrance_int_conf->theme != entrance_gui_theme_name_get()) + + if (_entrance_int_conf->user.update) { - entrance_gui_theme_name_set(_entrance_int_conf->theme); + Entrance_Login *eu; + eu = _entrance_int_conf->user.orig; + if (eu->bg.path != _entrance_int_conf->user.bg.path) + eina_stringshare_replace(&eu->bg.path, + _entrance_int_conf->user.bg.path); + if (eu->bg.group != _entrance_int_conf->user.bg.group) + eina_stringshare_replace(&eu->bg.group, + _entrance_int_conf->user.bg.group); + if (eu->image.path != _entrance_int_conf->user.image.path) + eina_stringshare_replace(&eu->image.path, + _entrance_int_conf->user.image.path); + if (eu->image.group != _entrance_int_conf->user.image.group) + eina_stringshare_replace(&eu->image.group, + _entrance_int_conf->user.image.group); + if (eu->remember_session != _entrance_int_conf->user.remember_session) + eu->remember_session = _entrance_int_conf->user.remember_session; + if (eu->lsess != _entrance_int_conf->user.lsess) + eina_stringshare_replace(&eu->lsess, _entrance_int_conf->user.lsess); + entrance_connect_conf_user_send(eu); + /* + printf("%s | %s\n%s | %s\n%s | %s\n%s | %s\n%d | %d\n%s | %s\n", + eu->bg.path, _entrance_int_conf->user.bg.path, + eu->bg.group, _entrance_int_conf->user.bg.group, + eu->image.path, _entrance_int_conf->user.image.path, + eu->image.group, _entrance_int_conf->user.image.group, + eu->remember_session, _entrance_int_conf->user.remember_session, + eu->lsess, _entrance_int_conf->user.lsess); + */ } - entrance_gui_conf_set(&conf); - entrance_connect_conf_send(&conf); } /* Build it */ @@ -377,7 +460,7 @@ evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); elm_table_pack(t, o, 0, j, 1, 1); evas_object_show(o); - o = elm_button_add(t); + o = elm_hoversel_add(t); elm_object_text_set(o, _entrance_int_conf->elm_profile); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); @@ -419,11 +502,42 @@ _entrance_conf_user_auth(void *data, const char *user, Eina_Bool granted) { Evas_Object *t; + const Eina_List *users, *l; + Entrance_Login *eu; + if (granted) { t = elm_object_part_content_get(data, "entrance.conf"); - _entrance_conf_user_build_cb(t, user); - elm_object_signal_emit(data, "entrance,conf_user,enabled", ""); + users = entrance_gui_users_get(); + EINA_LIST_FOREACH(users, l, eu) + { + if (!strcmp(eu->login, user)) + { + _entrance_int_conf->user.orig = eu; + _entrance_int_conf->user.bg.path = eu->bg.path; + _entrance_int_conf->user.bg.group = eu->bg.group; + _entrance_int_conf->user.image.path = eu->image.path; + _entrance_int_conf->user.image.group = eu->image.group; + _entrance_int_conf->user.lsess = eu->lsess; + _entrance_int_conf->user.remember_session + = eu->remember_session; + /* + printf("init %s %s | %s %s | %s | %d\n", + _entrance_int_conf->user.bg.path, + _entrance_int_conf->user.bg.group, + _entrance_int_conf->user.image.path, + _entrance_int_conf->user.image.group, + _entrance_int_conf->user.lsess, + _entrance_int_conf->user.remember_session); + */ + break; + } + } + if (eu) + { + _entrance_conf_user_build_cb(t, eu); + elm_object_signal_emit(data, "entrance,conf_user,enabled", ""); + } } } @@ -449,12 +563,10 @@ } static void -_entrance_conf_user_build_cb(Evas_Object *t, const char *user) +_entrance_conf_user_build_cb(Evas_Object *t, Entrance_Login *eu) { - Evas_Object *o, *bx, *hbx; - Entrance_Login *eu; + Evas_Object *o, *gl, *bx, *hbx; Eina_List *l; - const Eina_List *users, *ll; int j = 0; /* Background */ @@ -471,16 +583,12 @@ ++j; evas_object_size_hint_weight_set(hbx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(hbx, EVAS_HINT_FILL, EVAS_HINT_FILL); - o = elm_genlist_add(hbx); - elm_scroller_bounce_set(o, EINA_FALSE, EINA_TRUE); - evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); - l = _entrance_conf_backgrounds_get(o, user); - entrance_fill(o, _entrance_background_fill, - l, NULL, _entrance_conf_user_bg_sel, o); - eina_list_free(l); - elm_box_pack_end(hbx, o); - evas_object_show(o); + gl = elm_genlist_add(hbx); + elm_scroller_bounce_set(gl, EINA_FALSE, EINA_TRUE); + evas_object_size_hint_weight_set(gl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(gl, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_box_pack_end(hbx, gl); + evas_object_show(gl); bx = elm_box_add(hbx); elm_box_pack_end(hbx, bx); evas_object_show(bx); @@ -496,6 +604,11 @@ elm_box_pack_end(bx, o); evas_object_show(o); evas_object_show(hbx); + l = _entrance_conf_backgrounds_get(o, eu->login); + entrance_fill(gl, _entrance_background_fill, + l, _entrance_conf_user_bg_fill_cb, + _entrance_conf_user_bg_sel, o); + eina_list_free(l); /* Icon */ @@ -529,23 +642,9 @@ ++j; evas_object_show(t); - - users = entrance_gui_users_get(); - EINA_LIST_FOREACH(users, ll, eu) - { - if (!strcmp(eu->login, user)) - { - _entrance_int_conf->user.orig = eu; - _entrance_int_conf->user.bg.path = eu->bg.path; - _entrance_int_conf->user.bg.group = eu->bg.group; - _entrance_int_conf->user.image.path = eu->image.path; - _entrance_int_conf->user.image.group = eu->image.group; - break; - } - - } } + static void _entrance_conf_control_changed(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event) { @@ -565,20 +664,23 @@ const char *bg_group; entrance_gui_background_get(&bg_path, &bg_group); - if (((_entrance_int_conf->theme != entrance_gui_theme_name_get()) - || (_entrance_int_conf->bg.path != bg_path) - || (_entrance_int_conf->bg.group != bg_group) - || (_entrance_int_conf->scale != elm_config_scale_get()) - || (_entrance_int_conf->elm_profile != elm_config_profile_get()) - || (_entrance_int_conf->vkbd_enabled != entrance_gui_vkbd_enabled_get())) - || ((_entrance_int_conf->user.orig) && - ((_entrance_int_conf->user.orig->bg.path != _entrance_int_conf->user.bg.path) - || (_entrance_int_conf->user.orig->bg.group != _entrance_int_conf->user.bg.group) - || (_entrance_int_conf->user.orig->image.path != _entrance_int_conf->user.image.path) - || (_entrance_int_conf->user.orig->image.path != _entrance_int_conf->user.image.group) - || (_entrance_int_conf->user.orig->remember_session != _entrance_int_conf->user.remember_session) - || (_entrance_int_conf->user.orig->lsess != _entrance_int_conf->user.lsess)))) - + _entrance_int_conf->update = + !!((_entrance_int_conf->theme != entrance_gui_theme_name_get()) + || (_entrance_int_conf->bg.path != bg_path) + || (_entrance_int_conf->bg.group != bg_group) + || (_entrance_int_conf->scale != elm_config_scale_get()) + || (_entrance_int_conf->elm_profile != elm_config_profile_get()) + || (_entrance_int_conf->vkbd_enabled != entrance_gui_vkbd_enabled_get())); + + if (_entrance_int_conf->user.orig) + _entrance_int_conf->user.update = + !!((_entrance_int_conf->user.orig->bg.path != _entrance_int_conf->user.bg.path) + || (_entrance_int_conf->user.orig->bg.group != _entrance_int_conf->user.bg.group) + || (_entrance_int_conf->user.orig->image.path != _entrance_int_conf->user.image.path) + || (_entrance_int_conf->user.orig->image.group != _entrance_int_conf->user.image.group) + || (_entrance_int_conf->user.orig->remember_session != _entrance_int_conf->user.remember_session) + || (_entrance_int_conf->user.orig->lsess != _entrance_int_conf->user.lsess)); + if (_entrance_int_conf->update || _entrance_int_conf->user.update) { elm_object_disabled_set(_entrance_int_conf->gui.btn_ok, EINA_FALSE); elm_object_disabled_set(_entrance_int_conf->gui.btn_apply, EINA_FALSE); @@ -601,6 +703,13 @@ _entrance_conf_bg_content_get, _entrance_conf_bg_state_get, _entrance_conf_bg_del); + _entrance_session_fill = + entrance_fill_new("default", + _entrance_conf_session_text_get, + _entrance_conf_session_content_get, + _entrance_conf_session_state_get, + _entrance_conf_session_del); + _entrance_int_conf = calloc(1, sizeof(Entrance_Int_Conf)); _entrance_int_conf->theme = entrance_gui_theme_name_get(); entrance_gui_background_get(&(_entrance_int_conf->bg.path), @@ -615,6 +724,7 @@ { PT("conf shutdown\n"); entrance_fill_del(_entrance_background_fill); + entrance_fill_del(_entrance_session_fill); free(_entrance_int_conf); } diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_connect.c entrance-0.0.5~201401231204/src/bin/entrance_connect.c --- entrance-0.0.4~201312021541/src/bin/entrance_connect.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_connect.c 2014-01-21 17:12:02.000000000 +0000 @@ -140,10 +140,10 @@ } void -entrance_connect_conf_send(Entrance_Conf_Gui_Event *ev) +entrance_connect_conf_gui_send(Entrance_Conf_Gui_Event *ev) { Entrance_Event eev; - PT("Send config\n"); + PT("Send gui config\n"); eev.event.conf_gui.bg.path = ev->bg.path; eev.event.conf_gui.bg.group = ev->bg.group; @@ -151,6 +151,22 @@ entrance_event_send(&eev); } +void +entrance_connect_conf_user_send(Entrance_Login *el) +{ + Entrance_Event eev; + PT("Send user config\n"); + eev.event.conf_user.login = el->login; + eev.event.conf_user.lsess = el->lsess; + eev.event.conf_user.image.group = el->image.group; + eev.event.conf_user.image.path = el->image.path; + eev.event.conf_user.bg.path = el->bg.path; + eev.event.conf_user.bg.group = el->bg.group; + eev.event.conf_user.remember_session = el->remember_session; + eev.type = ENTRANCE_EVENT_CONF_USER; + entrance_event_send(&eev); +} + void * entrance_connect_auth_cb_add(Entrance_Connect_Auth_Cb func, void *data) { @@ -171,7 +187,7 @@ } void -entrance_connect_init() +entrance_connect_init(void) { Ecore_Event_Handler *h; ecore_con_init(); @@ -196,7 +212,7 @@ } void -entrance_connect_shutdown() +entrance_connect_shutdown(void) { Ecore_Event_Handler *h; EINA_LIST_FREE(_handlers, h) diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_connect.h entrance-0.0.5~201401231204/src/bin/entrance_connect.h --- entrance-0.0.4~201312021541/src/bin/entrance_connect.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_connect.h 2014-01-21 17:12:02.000000000 +0000 @@ -3,11 +3,12 @@ typedef void (*Entrance_Connect_Auth_Cb)(void *data, const char *login, Eina_Bool granted); -void entrance_connect_init(); +void entrance_connect_init(void); void entrance_connect_auth_send(const char *login, const char *password, const char *session, Eina_Bool open_session); void entrance_connect_action_send(unsigned char id); -void entrance_connect_conf_send(Entrance_Conf_Gui_Event *conf); +void entrance_connect_conf_gui_send(Entrance_Conf_Gui_Event *conf); +void entrance_connect_conf_user_send(Entrance_Login *el); void *entrance_connect_auth_cb_add(Entrance_Connect_Auth_Cb func, void *data); void entrance_connect_auth_cb_del(void *list); -void entrance_connect_shutdown(); +void entrance_connect_shutdown(void); #endif /* ENTRANCE_CONNECT_ */ diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_gui.c entrance-0.0.5~201401231204/src/bin/entrance_gui.c --- entrance-0.0.4~201312021541/src/bin/entrance_gui.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_gui.c 2014-01-21 17:12:02.000000000 +0000 @@ -15,19 +15,9 @@ 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 *sig, const char *src); -/* -static void _entrance_gui_session_update(Entrance_Xsession *xsession); -static void _entrance_gui_login_activated_cb(void *data, Evas_Object *obj, void *event_info); -static void _entrance_gui_password_activated_cb(void *data, Evas_Object *obj, void *event_info); -static void _entrance_gui_shutdown(void *data, Evas_Object *obj, void *event_info); -static void _entrance_gui_focus(void *data, Evas_Object *obj, void *event_info); -static void _entrance_gui_session_update(Entrance_Xsession *xsession); -static Eina_Bool _entrance_gui_auth_enable(void *data); -static void _entrance_gui_action_clicked_cb(void *data, Evas_Object *obj, void *event_info); -static Ecore_Timer *_gui_login_timeout; -*/ static Entrance_Gui *_gui; enum { @@ -111,6 +101,8 @@ /* 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) @@ -167,7 +159,7 @@ } void -entrance_gui_shutdown() +entrance_gui_shutdown(void) { Entrance_Screen *screen; Entrance_Xsession *xsession; @@ -389,273 +381,32 @@ { return _gui->vkbd_enabled; } -/* -static void -_entrance_gui_login_activated_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - char *txt; - Eina_List *l, *ll; - Entrance_Xsession *xsess; - Entrance_Login *eu = NULL; - Entrance_Screen *screen; - PT("login activated\n"); - txt = elm_entry_markup_to_utf8(elm_entry_entry_get(obj)); - if (!txt || !strcmp(txt, "")) - { - free(txt); - return; - } - EINA_LIST_FOREACH(_gui->users, ll, eu) - if (!strcmp(txt, eu->login)) break; - free(txt); - - if (eu && eu->lsess) - { - EINA_LIST_FOREACH(_gui->xsessions, l, xsess) - { - if (!strcmp(xsess->name, eu->lsess)) - { - _entrance_gui_session_update(xsess); - break; - } - } - } - else if (_gui->xsessions) - _entrance_gui_session_update(_gui->xsessions->data); - elm_object_focus_set(data, EINA_TRUE); - EINA_LIST_FOREACH(_gui->screens, l, screen) - edje_object_signal_emit(elm_layout_edje_get(screen->edj), - "entrance,auth,enable", ""); -} - -static void -_entrance_gui_shutdown(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - elm_exit(); - PT("shutdown cb\n"); -} - - -static void -_entrance_gui_focus(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +void +entrance_gui_user_bg_set(const char *path, const char *group) { Eina_List *l; Entrance_Screen *screen; - - EINA_LIST_FOREACH(_gui->screens, l, screen) - elm_object_focus_set(ENTRANCE_GUI_GET(screen->edj, "entrance.login"), - EINA_TRUE); -} - -static void -_entrance_gui_login_cancel_cb(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) -{ Evas_Object *o; - Entrance_Screen *screen; - Eina_List *l; - - EINA_LIST_FOREACH(_gui->screens, l, screen) - { - o = ENTRANCE_GUI_GET(screen->edj, "entrance.login"); - elm_entry_entry_set(o, ""); - elm_object_focus_set(o, EINA_TRUE); - o = ENTRANCE_GUI_GET(screen->edj, "entrance.password"); - elm_entry_entry_set(o, ""); - edje_object_signal_emit(elm_layout_edje_get(screen->edj), - "entrance,auth,disable", ""); - } -} - -static Eina_Bool -_entrance_gui_login_timeout(void *data EINA_UNUSED) -{ - Evas_Object *popup, *o, *bx; - Entrance_Screen *screen; - Eina_List *l; - - EINA_LIST_FOREACH(_gui->screens, l, screen) - { - popup = elm_popup_add(screen->win); - evas_object_size_hint_weight_set(popup, - EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - elm_object_text_set(popup, "Something wrong happened ... " - "No window manager detected after a lapse of time. " - "See your debug below."); - - bx = elm_box_add(popup); - elm_object_content_set(popup, bx); - evas_object_show(bx); - - o = elm_entry_add(popup); - elm_entry_scrollable_set(o, EINA_TRUE); - elm_object_text_set(o, "Test !!!!!"); - elm_box_pack_end(bx, o); - evas_object_show(o); - - o = evas_object_rectangle_add(evas_object_evas_get(popup)); - evas_object_size_hint_min_set(o, 0, 260); - elm_box_pack_end(bx, o); - - - o = elm_button_add(popup); - elm_object_text_set(o, "Close"); - elm_object_part_content_set(popup, "button1", o); - evas_object_smart_callback_add(o, "clicked", - _entrance_gui_shutdown, NULL); - evas_object_show(popup); - } - _gui_login_timeout = NULL; - - return ECORE_CALLBACK_CANCEL; -} - -static void -_entrance_gui_login(Entrance_Screen *screen) -{ - Eina_List *l; - char *h, *s; - h = entrance_gui_user_get(screen); - s = entrance_gui_password_get(screen); - if (h && s) - { - if (strcmp(h, "") && strcmp(s, "")) - { - if (_gui->selected_session) - entrance_connect_auth_send(h, s, _gui->selected_session->name); - else - entrance_connect_auth_send(h, s, NULL); - } - } - free(h); - free(s); - EINA_LIST_FOREACH(_gui->screens, l, screen) - { - elm_object_focus_set(ENTRANCE_GUI_GET(screen->edj, "entrance.password"), EINA_TRUE); - edje_object_signal_emit(elm_layout_edje_get(screen->edj), - "entrance,auth,enable", ""); - } -} - -static void -_entrance_gui_login_request_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) -{ - _entrance_gui_login(data); -} -static void -_entrance_gui_password_activated_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) -{ - PT("password activated\n"); - _entrance_gui_login(data); -} - -static void -_entrance_gui_xsessions_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) -{ - Evas_Object *icon; - Eina_List *l; - Entrance_Screen *screen; - - _gui->selected_session = data; EINA_LIST_FOREACH(_gui->screens, l, screen) { - elm_object_text_set(obj, _gui->selected_session->name); - icon = elm_icon_add(screen->win); - elm_image_file_set(icon, _gui->selected_session->icon, NULL); - elm_object_content_set(obj, icon); - evas_object_show(icon); - } -} - - - - -static void -_entrance_gui_callback_add(Entrance_Screen *screen) -{ - Evas_Object *host, *pwd; - Evas_Object *edj; - - evas_object_smart_callback_add(screen->win, "delete,request", - _entrance_gui_shutdown, NULL); - evas_object_smart_callback_add(screen->win, "focus,in", - _entrance_gui_focus, NULL); - - edj = elm_layout_edje_get(screen->edj); - host = ENTRANCE_GUI_GET(screen->edj, "entrance.login"); - pwd = ENTRANCE_GUI_GET(screen->edj, "entrance.password"); - edje_object_signal_callback_add(edj, "entrance.auth.cancel", "", - _entrance_gui_login_cancel_cb, NULL); - edje_object_signal_callback_add(edj, "entrance.auth.request", "", - _entrance_gui_login_request_cb, screen); - elm_entry_single_line_set(host, EINA_TRUE); - elm_entry_single_line_set(pwd, EINA_TRUE); -} - -static void -_entrance_gui_session_update(Entrance_Xsession *xsession) -{ - Evas_Object *o, *icon; - Eina_List *l; - Entrance_Screen *screen; - - if (!xsession) return; - _gui->selected_session = xsession; - EINA_LIST_FOREACH(_gui->screens, l, screen) - { - o = ENTRANCE_GUI_GET(screen->edj, "entrance.xsessions"); - elm_object_text_set(o, _gui->selected_session->name); - icon = elm_icon_add(screen->win); - elm_image_file_set(icon, _gui->selected_session->icon, NULL); - elm_object_content_set(o, icon); - } -} - -static void -_entrance_gui_sessions_populate() -{ - Evas_Object *o; - - Entrance_Xsession *xsession; - Eina_List *l, *ll; - Entrance_Screen *screen; - - EINA_LIST_FOREACH(_gui->screens, ll, screen) - { - o = ENTRANCE_GUI_GET(screen->edj, "entrance.xsessions"); - - EINA_LIST_FOREACH(_gui->xsessions, l, xsession) + if (path && group) { - elm_hoversel_item_add(o, xsession->name, xsession->icon, - ELM_ICON_FILE, - _entrance_gui_xsessions_clicked_cb, xsession); + 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", ""); } - edje_object_signal_emit(elm_layout_edje_get(screen->edj), - "entrance,xsession,enabled", ""); - } - if (_gui->xsessions) - _entrance_gui_session_update(_gui->xsessions->data); -} - -static Eina_Bool -_entrance_gui_auth_enable(void *data EINA_UNUSED) -{ - Evas_Object *o; - Eina_List *l; - Entrance_Screen *screen; - - EINA_LIST_FOREACH(_gui->screens, l, screen) - { - o = ENTRANCE_GUI_GET(screen->edj, "entrance.login"); - elm_object_disabled_set(o, EINA_FALSE); - o = ENTRANCE_GUI_GET(screen->edj, "entrance.password"); - elm_object_disabled_set(o, EINA_FALSE); + else + elm_object_signal_emit(screen->transition, + "entrance,wallpaper,default", ""); } - return ECORE_CALLBACK_CANCEL; } -*/ static void _entrance_gui_update(void) { @@ -760,9 +511,9 @@ Entrance_Login *eu; eu = elm_object_item_data_get(event_info); entrance_login_login_set(data, eu->login); - entrance_login_session_set(data, eu->lsess); } + static char * _entrance_gui_user_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) { @@ -798,7 +549,10 @@ { const char *path, *group; ic = _entrance_gui_user_icon_random_get(obj); - edje_object_file_get(elm_layout_edje_get(ic), &path, &group); + edje_object_file_get( + elm_layout_edje_get( + elm_object_part_content_get(ic, "entrance.icon")), + &path, &group); eu->image.path = eina_stringshare_add(path); eu->image.group = eina_stringshare_add(group); } @@ -862,7 +616,7 @@ //////////////////////////////////////////////////////////////////////////////// static void -_entrance_gui_auth_cb(void *data, const char *user EINA_UNUSED, Eina_Bool granted) +_entrance_gui_auth_cb(void *data EINA_UNUSED, const char *user EINA_UNUSED, Eina_Bool granted) { Eina_List *l; Entrance_Screen *screen; @@ -888,6 +642,22 @@ */ } +static void +_entrance_gui_user_bg_cb(void *data, Evas_Object *obj EINA_UNUSED, const char *sig EINA_UNUSED, const char *src EINA_UNUSED) +{ + 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 -Nru entrance-0.0.4~201312021541/src/bin/entrance_gui.h entrance-0.0.5~201401231204/src/bin/entrance_gui.h --- entrance-0.0.4~201312021541/src/bin/entrance_gui.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_gui.h 2014-01-21 17:12:02.000000000 +0000 @@ -24,6 +24,7 @@ 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 -Nru entrance-0.0.4~201312021541/src/bin/entrance_login.c entrance-0.0.5~201401231204/src/bin/entrance_login.c --- entrance-0.0.4~201312021541/src/bin/entrance_login.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_login.c 2014-01-21 17:12:02.000000000 +0000 @@ -13,13 +13,16 @@ static void _login_password_catch(Evas_Object *widget, Eina_Bool catch); static Eina_Bool _login_key_down_cb(void *data, int type, void *event); static void _login_xsession_update(Evas_Object *obj); +static void _login_xsession_guess(void *data, const char *user); static void _login_xsession_clicked_cb(void *data, Evas_Object *obj, void *event_info); static Eina_Bool _login_input_event_cb(void *data EINA_UNUSED, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type type, void *event_info); +static void _login_login_unfocused_cb(void *data, Evas_Object *obj, void *event); static void _login_password_focused_cb(void *data, Evas_Object *obj, void *event); static void _login_password_unfocused_cb(void *data, Evas_Object *obj, void *event); static void _login_login_activated_cb(void *data, Evas_Object *obj, void *event); static char *_login_xsession_text_get(void *data, Evas_Object *obj, const char *part); static void _login_auth_cb(void *data, const char *user, Eina_Bool granted); +static void _entrance_login_session_set(Evas_Object *widget, const char *name); static Entrance_Fill *_login_fill; @@ -254,6 +257,19 @@ } static void +_login_login_unfocused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) +{ + Evas_Object *o; + const char *hostname; + LOGIN_GET(data); + + o = elm_object_part_content_get(data, "entrance.login"); + hostname = elm_entry_markup_to_utf8(elm_object_text_get(o)); + + _login_xsession_guess(data, hostname); +} + +static void _login_password_focused_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { _login_password_catch(data, EINA_TRUE); @@ -264,6 +280,7 @@ { _login_password_catch(data, EINA_FALSE); } + static void _login_login_activated_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) { @@ -302,6 +319,31 @@ } static void +_login_xsession_guess(void *data, const char *user) +{ + const Eina_List *users, *l; + Entrance_Login *eu; + LOGIN_GET(data); + + users = entrance_gui_users_get(); + EINA_LIST_FOREACH(users, l, eu) + { + 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); + entrance_gui_user_bg_set(NULL, NULL); + } +} + +static void _login_xsession_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { LOGIN_GET(data); @@ -345,6 +387,31 @@ } } +static void +_entrance_login_session_set(Evas_Object *widget, const char *name) +{ + Entrance_Xsession *sess; + const Eina_List *l = NULL; + LOGIN_GET(widget); + if (name) + { + EINA_LIST_FOREACH(entrance_gui_xsessions_get(), l, sess) + { + if ((sess->name) && + (!strcmp(sess->name, name))) + { + break; + } + } + } + if (l) + login->session = sess; + else + login->session = eina_list_data_get(entrance_gui_xsessions_get()); + _login_xsession_update(widget); +} + + //////////////////////////////////////////////////////////////////////////////// @@ -352,7 +419,7 @@ entrance_login_init(void) { _login_fill = entrance_fill_new(NULL, _login_xsession_text_get, - NULL, NULL, NULL); + NULL, NULL, NULL); } void @@ -397,6 +464,8 @@ elm_object_event_callback_add(o, _login_input_event_cb, o); evas_object_smart_callback_add(h, "activated", _login_login_activated_cb, p); + evas_object_smart_callback_add(h, "unfocused", + _login_login_unfocused_cb, o); evas_object_smart_callback_add(p, "focused", _login_password_focused_cb, o); evas_object_smart_callback_add(p, "unfocused", @@ -435,28 +504,8 @@ "entrance,auth,enable", ""); o = elm_object_part_content_get(widget, "entrance.password"); elm_object_focus_set(o, EINA_TRUE); -} -void -entrance_login_session_set(Evas_Object *widget, const char *name) -{ - Entrance_Xsession *sess; - const Eina_List *l = NULL; - LOGIN_GET(widget); - if (name) - { - EINA_LIST_FOREACH(entrance_gui_xsessions_get(), l, sess) - { - if ((sess->name) && - (!strcmp(sess->name, name))) - { - break; - } - } - } - if (l) - login->session = sess; - _login_xsession_update(widget); + _login_xsession_guess(widget, user); } void diff -Nru entrance-0.0.4~201312021541/src/bin/entrance_login.h entrance-0.0.5~201401231204/src/bin/entrance_login.h --- entrance-0.0.4~201312021541/src/bin/entrance_login.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/bin/entrance_login.h 2014-01-21 17:12:02.000000000 +0000 @@ -8,7 +8,6 @@ Evas_Object *entrance_login_add(Evas_Object *win, Entrance_Login_Cb login_cb, void *data); void entrance_login_xsessions_populate(Evas_Object *widget, Eina_List *xsessions); void entrance_login_login_set(Evas_Object *widget, const char *user); -void entrance_login_session_set(Evas_Object *widget, const char *user); void entrance_login_open_session_set(Evas_Object *obj, Eina_Bool open_session); void entrance_login_callback_set(Entrance_Login_Cb greater_cb, void *data); diff -Nru entrance-0.0.4~201312021541/src/daemon/Makefile.am entrance-0.0.5~201401231204/src/daemon/Makefile.am --- entrance-0.0.4~201312021541/src/daemon/Makefile.am 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/Makefile.am 2014-01-21 17:12:02.000000000 +0000 @@ -43,7 +43,7 @@ entrance_LDFLAGS = -entrance_LDADD = @ENTRANCE_LIBS@ -lrt +entrance_LDADD = @ENTRANCE_LIBS@ entrance_wait_SOURCES = \ entrance_wait.c diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance.c entrance-0.0.5~201401231204/src/daemon/entrance.c --- entrance-0.0.4~201312021541/src/daemon/entrance.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance.c 2014-01-21 17:12:02.000000000 +0000 @@ -154,11 +154,10 @@ char buf[PATH_MAX]; ecore_event_handler_add(ECORE_EXE_EVENT_DEL, _entrance_client_del, NULL); - PT("Exec entrance_client: "); snprintf(buf, sizeof(buf), PACKAGE_BIN_DIR"/entrance_client -d %s -t %s", dname, entrance_config->theme); - printf("%s\n", buf); + PT("Exec entrance_client: %s\n", buf); _entrance_client = ecore_exe_run(buf, NULL); } @@ -307,7 +306,9 @@ if (entrance_user) { char *quit; + entrance_session_init(dname); entrance_session_end(entrance_user); + entrance_session_shutdown(); sleep(2); entrance_xserver_end(); quit = getenv("ENTRANCE_QUIT"); @@ -340,6 +341,7 @@ PT("session init\n"); entrance_session_init(dname); + entrance_session_cookie(); if (!_xephyr) { PT("xserver init\n"); diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_action.c entrance-0.0.5~201401231204/src/daemon/entrance_action.c --- entrance-0.0.4~201312021541/src/daemon/entrance_action.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_action.c 2014-01-21 17:12:02.000000000 +0000 @@ -1,5 +1,31 @@ #include "entrance.h" +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# ifndef HAVE_ALLOCA +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + typedef void (*Entrance_Action_Cb)(void *data); static void _entrance_action_shutdown(void *data); diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_config.c entrance-0.0.5~201401231204/src/daemon/entrance_config.c --- entrance-0.0.4~201312021541/src/daemon/entrance_config.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_config.c 2014-01-21 17:12:02.000000000 +0000 @@ -4,9 +4,9 @@ #define ENTRANCE_CONFIG_KEY "config" static void _defaults_set(Entrance_Config *config); -static void _users_get(); +static void _users_get(void); static void _config_free(Entrance_Config *config); -static Entrance_Config *_cache_get(); +static Entrance_Config *_cache_get(void); static Eet_Data_Descriptor *_entrance_config_descriptor; @@ -36,7 +36,7 @@ static void -_users_get() +_users_get(void) { Eet_File *ef; FILE *f; @@ -85,7 +85,7 @@ } static Entrance_Config * -_cache_get() +_cache_get(void) { Entrance_Config *config = NULL; Eet_File *file; diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_config.h entrance-0.0.5~201401231204/src/daemon/entrance_config.h --- entrance-0.0.4~201312021541/src/daemon/entrance_config.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_config.h 2014-01-21 17:12:02.000000000 +0000 @@ -45,8 +45,8 @@ Eina_Bool vkbd_enabled; }; -void entrance_config_init(); -void entrance_config_shutdown(); +void entrance_config_init(void); +void entrance_config_shutdown(void); void entrance_config_set(const Entrance_Conf_Gui_Event *conf); Entrance_Config *entrance_config; diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_history.c entrance-0.0.5~201401231204/src/daemon/entrance_history.c --- entrance-0.0.4~201312021541/src/daemon/entrance_history.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_history.c 2014-01-21 17:12:02.000000000 +0000 @@ -3,11 +3,12 @@ #define ENTRANCE_SESSION_KEY "session" #define ENTRANCE_HISTORY_FILE "entrance.hst" -static void _entrance_history_read(); -static void _entrance_history_write(); -static void _entrance_user_init(); -static void _entrance_user_shutdown(); -const char *_entrance_history_match(const char *login); +static void _entrance_history_read(void); +static void _entrance_history_write(void); +static void _entrance_user_init(void); +static void _entrance_user_shutdown(void); +Entrance_Login *_entrance_history_match(const char *login); +static void _entrance_history_user_set(Entrance_Login *el, const Entrance_Login *eu); static Eet_Data_Descriptor *_eddh; @@ -16,7 +17,7 @@ static Eina_Bool _history_update = EINA_FALSE; void -entrance_history_init() +entrance_history_init(void) { Eet_Data_Descriptor *edd; Eet_Data_Descriptor_Class eddc; @@ -35,26 +36,39 @@ } Eina_List -*entrance_history_get() +*entrance_history_get(void) { return _lusers; } void -entrance_history_shutdown() +entrance_history_shutdown(void) { + Entrance_Login *el; + _entrance_history_write(); _entrance_user_shutdown(); + EINA_LIST_FREE(_entrance_history->history, el) + { + eina_stringshare_del(el->login); + eina_stringshare_del(el->image.path); + eina_stringshare_del(el->image.group); + eina_stringshare_del(el->bg.path); + eina_stringshare_del(el->bg.group); + eina_stringshare_del(el->lsess); + } + free(_entrance_history); } static void -_entrance_history_read() +_entrance_history_read(void) { Eet_File *ef; ef = eet_open("/var/cache/"PACKAGE"/"ENTRANCE_HISTORY_FILE, EET_FILE_MODE_READ_WRITE); - if (!(ef) || !(_entrance_history = eet_data_read(ef, _eddh, ENTRANCE_SESSION_KEY))) + if (!(ef) + || !(_entrance_history = eet_data_read(ef, _eddh, ENTRANCE_SESSION_KEY))) { PT("Error on reading last session login\n"); _entrance_history = calloc(1, sizeof(Entrance_History)); @@ -63,10 +77,9 @@ } static void -_entrance_history_write() +_entrance_history_write(void) { Eet_File *ef; - Entrance_Login *el; if (_history_update) { @@ -83,15 +96,6 @@ eet_close(ef); } - EINA_LIST_FREE(_entrance_history->history, el) - { - eina_stringshare_del(el->login); - eina_stringshare_del(el->image.path); - eina_stringshare_del(el->image.group); - eina_stringshare_del(el->bg.path); - eina_stringshare_del(el->bg.group); - eina_stringshare_del(el->lsess); - } } void @@ -129,7 +133,6 @@ { el->login = eina_stringshare_add(login); if (session) el->lsess = eina_stringshare_add(session); - else el->lsess = NULL; el->remember_session = EINA_TRUE; _entrance_history->history = eina_list_append(_entrance_history->history, el); @@ -138,23 +141,73 @@ } } +static void +_entrance_history_user_set(Entrance_Login *el, const Entrance_Login *eu) +{ + if (eu->lsess != el->lsess) + eina_stringshare_replace(&el->lsess, eu->lsess); + if (eu->image.path != el->image.path) + eina_stringshare_replace(&el->image.path, eu->image.path); + if (eu->image.group != el->image.group) + eina_stringshare_replace(&el->image.group, eu->image.group); + if (eu->bg.path != el->bg.path) + eina_stringshare_replace(&el->bg.path, eu->bg.path); + if (eu->bg.group != el->bg.group) + eina_stringshare_replace(&el->bg.group, eu->bg.group); + if (eu->remember_session != el->remember_session) + el->remember_session = eu->remember_session; +} -const char * -_entrance_history_match(const char *login) +void +entrance_history_user_update(const Entrance_Login *eu) { Eina_List *l; Entrance_Login *el; - const char *ret = NULL; + + PT("Updating user info\n"); + + EINA_LIST_FOREACH(_entrance_history->history, l, el) + { + if (!strcmp(eu->login, el->login)) + { + PT("Find user in history\n"); + _entrance_history_user_set(el, eu); + break; + } + } + if (!l) + { + EINA_LIST_FOREACH(_lusers, l, el) + { + if (!strcmp(eu->login, el->login)) + { + PT("Append user in history\n"); + _entrance_history_user_set(el, eu); + break; + } + } + } + _history_update = !!l; + _entrance_history_write(); +} + +Entrance_Login * +_entrance_history_match(const char *login) +{ + Eina_List *l; + Entrance_Login *el = NULL; + EINA_LIST_FOREACH(_entrance_history->history, l, el) { - if (!strcmp(el->login, login)) - ret = el->lsess; +// if (!strcmp(el->login, login)) + if (el->login == login) + break; } - return ret; + return el; } static void -_entrance_user_init() +_entrance_user_init(void) { char buf[PATH_MAX]; FILE *f; @@ -181,30 +234,40 @@ } EINA_LIST_FREE(lu, user) { - if ((eu = (Entrance_Login *) calloc(1, sizeof(Entrance_Login)))) + eu = _entrance_history_match(user); + if (!eu) { - eu->login = eina_stringshare_add(user); - snprintf(buf, sizeof(buf), - "/var/cache/"PACKAGE"/users/%s.edj", user); - if (ecore_file_exists(buf)) - eu->image.path = eina_stringshare_add(buf); - eu->lsess = _entrance_history_match(user); - eu->remember_session = EINA_TRUE; - eina_stringshare_del(user); - _lusers = eina_list_append(_lusers, eu); + if ((eu = (Entrance_Login *) calloc(1, sizeof(Entrance_Login)))) + { + eu->login = eina_stringshare_add(user); + snprintf(buf, sizeof(buf), + "/var/cache/"PACKAGE"/users/%s.edj", user); + if (ecore_file_exists(buf)) + eu->image.path = eina_stringshare_add(buf); + eu->remember_session = EINA_TRUE; + } } + eina_stringshare_del(user); + _lusers = eina_list_append(_lusers, eu); } } static void -_entrance_user_shutdown() +_entrance_user_shutdown(void) { Entrance_Login *eu; EINA_LIST_FREE(_lusers, eu) { - eina_stringshare_del(eu->login); - free(eu); + if (!_entrance_history_match(eu->login)) + { + eina_stringshare_del(eu->login); + eina_stringshare_del(eu->lsess); + eina_stringshare_del(eu->image.path); + eina_stringshare_del(eu->image.group); + eina_stringshare_del(eu->bg.path); + eina_stringshare_del(eu->bg.group); + free(eu); + } } - free(_entrance_history); } diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_history.h entrance-0.0.5~201401231204/src/daemon/entrance_history.h --- entrance-0.0.4~201312021541/src/daemon/entrance_history.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_history.h 2014-01-21 17:12:02.000000000 +0000 @@ -1,10 +1,11 @@ #ifndef ENTRANCE_HISTORY_ #define ENTRANCE_HISTORY_ -void entrance_history_init(); -void entrance_history_shutdown(); +void entrance_history_init(void); +void entrance_history_shutdown(void); void entrance_history_push(const char *login, const char *session); -Eina_List *entrance_history_get(); +Eina_List *entrance_history_get(void); +void entrance_history_user_update(const Entrance_Login *el); typedef struct _Entrance_History Entrance_History; diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_pam.c entrance-0.0.5~201401231204/src/daemon/entrance_pam.c --- entrance-0.0.4~201312021541/src/daemon/entrance_pam.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_pam.c 2014-01-21 17:12:02.000000000 +0000 @@ -35,49 +35,53 @@ static int _entrance_pam_conv(int num_msg, const struct pam_message **msg, - struct pam_response **resp, void *appdata_ptr EINA_UNUSED) { - int i, result = PAM_SUCCESS; - *resp = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response)); - for (i = 0; i < num_msg; ++i){ - resp[i]->resp=0; - resp[i]->resp_retcode=0; - switch(msg[i]->msg_style){ - case PAM_PROMPT_ECHO_ON: - // We assume PAM is asking for the username - PT("echo on\n"); - resp[i]->resp = _login; - break; - - case PAM_PROMPT_ECHO_OFF: - PT("echo off\n"); - resp[i]->resp = _passwd; - _passwd = NULL; - break; - case PAM_ERROR_MSG: - PT("error msg\n"); - case PAM_TEXT_INFO: - PT("info "); - fprintf(stderr, "%s\n", msg[i]->msg); - break; - case PAM_SUCCESS: - PT("success :)\n"); - break; - default: - PT("default\n"); - - } - if (result != PAM_SUCCESS) break; + struct pam_response **resp, void *appdata_ptr EINA_UNUSED) +{ + int i, result = PAM_SUCCESS; + *resp = (struct pam_response *) calloc(num_msg, sizeof(struct pam_response)); + for (i = 0; i < num_msg; ++i) + { + resp[i]->resp=0; + resp[i]->resp_retcode=0; + switch(msg[i]->msg_style) + { + case PAM_PROMPT_ECHO_ON: + // We assume PAM is asking for the username + PT("echo on\n"); + resp[i]->resp = _login; + break; + + case PAM_PROMPT_ECHO_OFF: + PT("echo off\n"); + resp[i]->resp = _passwd; + _passwd = NULL; + break; + case PAM_ERROR_MSG: + PT("error msg\n"); + case PAM_TEXT_INFO: + PT("info "); + fprintf(stderr, "%s\n", msg[i]->msg); + break; + case PAM_SUCCESS: + PT("success :)\n"); + break; + default: + PT("default\n"); + } + if (result != PAM_SUCCESS) break; } - if (result != PAM_SUCCESS) { - for (i = 0; i < num_msg; ++i){ + if (result != PAM_SUCCESS) + { + for (i = 0; i < num_msg; ++i) + { if (resp[i]->resp==0) continue; free(resp[i]->resp); resp[i]->resp=0; - }; - free(*resp); - *resp=0; + } + free(*resp); + *resp=0; } - return result; + return result; } static char * @@ -93,7 +97,7 @@ int -entrance_pam_open_session() +entrance_pam_open_session(void) { last_result = pam_setcred(_pam_handle, PAM_ESTABLISH_CRED); switch (last_result) @@ -126,33 +130,40 @@ } void -entrance_pam_close_session() { +entrance_pam_close_session(const Eina_Bool opened) +{ PT("PAM close session\n"); last_result = pam_close_session(_pam_handle, PAM_SILENT); - switch (last_result) { + switch (last_result) + { default: //case PAM_SESSION_ERROR: + PT("error on close session"); pam_setcred(_pam_handle, PAM_DELETE_CRED); entrance_pam_end(); case PAM_SUCCESS: break; - }; - last_result = pam_setcred(_pam_handle, PAM_DELETE_CRED); - switch(last_result) { - default: - case PAM_CRED_ERR: - case PAM_CRED_UNAVAIL: - case PAM_CRED_EXPIRED: - case PAM_USER_UNKNOWN: - entrance_pam_end(); - case PAM_SUCCESS: - break; - }; - return; + } + if (opened) + { + last_result = pam_setcred(_pam_handle, PAM_DELETE_CRED); + switch(last_result) + { + default: + case PAM_CRED_ERR: + case PAM_CRED_UNAVAIL: + case PAM_CRED_EXPIRED: + case PAM_USER_UNKNOWN: + entrance_pam_end(); + case PAM_SUCCESS: + break; + } + } } int -entrance_pam_end() { +entrance_pam_end(void) +{ int result; result = pam_end(_pam_handle, last_result); _pam_handle = NULL; @@ -160,7 +171,7 @@ } int -entrance_pam_authenticate() +entrance_pam_authenticate(void) { last_result = pam_authenticate(_pam_handle, 0); switch (last_result) @@ -216,11 +227,12 @@ } int -entrance_pam_init(const char *service, const char *display, const char *user) { +entrance_pam_init(const char *service, const char *display, const char *user) +{ int status; - if (!service && !*service) goto pam_error; - if (!display && !*display) goto pam_error; + if (!service || !*service) goto pam_error; + if (!display || !*display) goto pam_error; _pam_conversation.conv = _entrance_pam_conv; _pam_conversation.appdata_ptr = NULL; @@ -255,7 +267,8 @@ } const void * -entrance_pam_item_get(ENTRANCE_PAM_ITEM_TYPE type) { +entrance_pam_item_get(ENTRANCE_PAM_ITEM_TYPE type) +{ const void *data; last_result = pam_get_item(_pam_handle, type, &data); switch (last_result) { @@ -271,12 +284,14 @@ } int -entrance_pam_env_set(const char *env, const char *value) { +entrance_pam_env_set(const char *env, const char *value) +{ char buf[1024]; if (!env || !value) return 1; snprintf(buf, sizeof(buf), "%s=%s", env, value); last_result = pam_putenv(_pam_handle, buf); - switch (last_result) { + switch (last_result) + { default: case PAM_PERM_DENIED: case PAM_ABORT: @@ -285,18 +300,20 @@ return 1; case PAM_SUCCESS: break; - }; + } return 0; } char ** -entrance_pam_env_list_get() { +entrance_pam_env_list_get(void) +{ return pam_getenvlist(_pam_handle); } void -entrance_pam_shutdown() { +entrance_pam_shutdown(void) +{ } int @@ -309,3 +326,4 @@ _passwd = strdup(passwd); return 0; } + diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_pam.h entrance-0.0.5~201401231204/src/daemon/entrance_pam.h --- entrance-0.0.4~201312021541/src/daemon/entrance_pam.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_pam.h 2014-01-21 17:12:02.000000000 +0000 @@ -16,13 +16,13 @@ int entrance_pam_item_set(ENTRANCE_PAM_ITEM_TYPE type, const void *value); const void *entrance_pam_item_get(ENTRANCE_PAM_ITEM_TYPE); int entrance_pam_env_set(const char *env, const char *value); -char **entrance_pam_env_list_get(); +char **entrance_pam_env_list_get(void); int entrance_pam_init(const char *service, const char *display, const char *user); -void entrance_pam_shutdown(); -int entrance_pam_open_session(); -void entrance_pam_close_session(); -int entrance_pam_authenticate(); +void entrance_pam_shutdown(void); +int entrance_pam_open_session(void); +void entrance_pam_close_session(Eina_Bool opened); +int entrance_pam_authenticate(void); int entrance_pam_auth_set(const char *login, const char *passwd); -int entrance_pam_end(); +int entrance_pam_end(void); #endif /* ENTRANCE_PAM_H_ */ diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_server.c entrance-0.0.5~201401231204/src/daemon/entrance_server.c --- entrance-0.0.4~201312021541/src/daemon/entrance_server.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_server.c 2014-01-21 17:12:02.000000000 +0000 @@ -39,9 +39,6 @@ eev.event.conf_gui.enabled = EINA_TRUE; eev.event.conf_gui.bg.path = entrance_config->bg.path; eev.event.conf_gui.bg.group = entrance_config->bg.group; - - printf("sending %s %s\n", entrance_config->bg.path, - entrance_config->bg.group); entrance_event_send(&eev); } return ECORE_CALLBACK_RENEW; @@ -90,11 +87,11 @@ entrance_session_login(eev->event.auth.session, EINA_TRUE); } else - entrance_session_close(); + entrance_session_close(EINA_FALSE); } else { - entrance_session_close(); + entrance_session_close(EINA_FALSE); neev.event.status.login = NULL; neev.event.status.granted = EINA_FALSE; PT("server authenticate error\n"); @@ -112,6 +109,11 @@ PT("Conf Gui received\n"); entrance_config_set(&eev->event.conf_gui); } + else if (eev->type == ENTRANCE_EVENT_CONF_USER) + { + PT("Conf user received\n"); + entrance_history_user_update(&eev->event.conf_user); + } else PT("UNKNOW signal server\n"); return EINA_TRUE; @@ -129,7 +131,7 @@ } void -entrance_server_init() +entrance_server_init(void) { Ecore_Event_Handler *h; ecore_con_init(); @@ -154,7 +156,7 @@ } void -entrance_server_shutdown() +entrance_server_shutdown(void) { Ecore_Event_Handler *h; if (_entrance_server) @@ -166,7 +168,7 @@ } void -entrance_server_client_wait() +entrance_server_client_wait(void) { Entrance_Event eev; eev.type = ENTRANCE_EVENT_MAXTRIES; diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_server.h entrance-0.0.5~201401231204/src/daemon/entrance_server.h --- entrance-0.0.4~201312021541/src/daemon/entrance_server.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_server.h 2014-01-21 17:12:02.000000000 +0000 @@ -1,8 +1,8 @@ #ifndef ENTRANCE_SERVER_ #define ENTRANCE_SERVER_ -void entrance_server_init(); -void entrance_server_client_wait(); -void entrance_server_shutdown(); +void entrance_server_init(void); +void entrance_server_client_wait(void); +void entrance_server_shutdown(void); #endif /* ENTRANCE_SERVER_ */ diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_session.c entrance-0.0.5~201401231204/src/daemon/entrance_session.c --- entrance-0.0.4~201312021541/src/daemon/entrance_session.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_session.c 2014-01-21 17:12:02.000000000 +0000 @@ -24,13 +24,13 @@ static void _entrance_session_desktops_scan_file(const char *path); static void _entrance_session_desktops_scan(const char *dir); -static void _entrance_session_desktops_init(); -//static void _entrance_session_desktops_shutdown(); +static void _entrance_session_desktops_init(void); +//static void _entrance_session_desktops_shutdown(void); static const char *_entrance_session_find_command(const char *path, const char *session); static struct passwd *_entrance_session_session_open(); long -entrance_session_seed_get() +entrance_session_seed_get(void) { struct timespec ts; long pid = getpid(); @@ -184,6 +184,7 @@ snprintf(buf, sizeof(buf), "%s > %s/.entrance_session.log 2>&1", cmd, pwd->pw_dir); #endif + PT("Executing: %s --login -c %s \n", pwd->pw_shell, buf); execle(pwd->pw_shell, pwd->pw_shell, "--login", "-c", buf, NULL, env); PT("The Xsessions are not launched :(\n"); } @@ -200,14 +201,14 @@ "%s %s ", entrance_config->command.session_stop, user); if (-1 == system(buf)) PT("Error on session stop command\n"); - entrance_session_close(); + entrance_session_close(EINA_TRUE); } void -entrance_session_close(void) +entrance_session_close(const Eina_Bool opened) { #ifdef HAVE_PAM - entrance_pam_close_session(); + entrance_pam_close_session(opened); entrance_pam_end(); entrance_pam_shutdown(); #endif @@ -221,15 +222,21 @@ } pid_t -entrance_session_pid_get() +entrance_session_pid_get(void) { return _session_pid; } +void +entrance_session_init(const char *dname) +{ + _dname = dname; +} + static const char *dig = "0123456789abcdef"; void -entrance_session_init(const char *dname) +entrance_session_cookie(void) { uint16_t word; uint8_t hi, lo; @@ -255,15 +262,14 @@ entrance_config->command.xauth_file); putenv(strdup(buf)); //PT("cookie %s \n", _mcookie); - _entrance_session_cookie_add(_mcookie, dname, + _entrance_session_cookie_add(_mcookie, _dname, entrance_config->command.xauth_path, entrance_config->command.xauth_file); _entrance_session_desktops_init(); - _dname = dname; } void -entrance_session_shutdown() +entrance_session_shutdown(void) { Entrance_Xsession *xsession; @@ -313,7 +319,7 @@ } static struct passwd * -_entrance_session_session_open() +_entrance_session_session_open(void) { #ifdef HAVE_PAM if (!entrance_pam_open_session()) @@ -350,6 +356,8 @@ } PT("launching session %s for user %s\n", cmd, _login); _entrance_session_run(pwd, cmd, buf); + snprintf(buf, sizeof(buf), "ENTRANCE_USER=%s", pwd->pw_name); + putenv(buf); return ECORE_CALLBACK_CANCEL; } @@ -398,35 +406,35 @@ { if (xsession) { - snprintf(buf, sizeof(buf), "/etc/X11/xinit/xinitrc %s", + snprintf(buf, sizeof(buf), "sh /etc/X11/xinit/xinitrc %s", xsession->command); return eina_stringshare_add(buf); } - return eina_stringshare_add("/etc/X11/xinit/xinitrc"); + return eina_stringshare_add("sh /etc/X11/xinit/xinitrc"); } return NULL; } char * -entrance_session_login_get() +entrance_session_login_get(void) { return _login; } int -entrance_session_logged_get() +entrance_session_logged_get(void) { return !!_logged; } Eina_List * -entrance_session_list_get() +entrance_session_list_get(void) { return _xsessions; } static void -_entrance_session_desktops_init() +_entrance_session_desktops_init(void) { char buf[PATH_MAX]; Eina_List *dirs; diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_session.h entrance-0.0.5~201401231204/src/daemon/entrance_session.h --- entrance-0.0.4~201312021541/src/daemon/entrance_session.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_session.h 2014-01-21 17:12:02.000000000 +0000 @@ -3,16 +3,17 @@ #include void entrance_session_init(const char *dname); +void entrance_session_cookie(void); void entrance_session_end(const char *login); -void entrance_session_shutdown(); +void entrance_session_shutdown(void); Eina_Bool entrance_session_authenticate(const char *login, const char *pwd); -void entrance_session_close(void); +void entrance_session_close(Eina_Bool opened); Eina_Bool entrance_session_login(const char *command, Eina_Bool push); void entrance_session_pid_set(pid_t pid); -pid_t entrance_session_pid_get(); -long entrance_session_seed_get(); -char *entrance_session_login_get(); -int entrance_session_logged_get(); -Eina_List *entrance_session_list_get(); +pid_t entrance_session_pid_get(void); +long entrance_session_seed_get(void); +char *entrance_session_login_get(void); +int entrance_session_logged_get(void); +Eina_List *entrance_session_list_get(void); #endif /* ENTRANCE_SESSION_H_ */ diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_wait.c entrance-0.0.5~201401231204/src/daemon/entrance_wait.c --- entrance-0.0.4~201312021541/src/daemon/entrance_wait.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_wait.c 2014-01-21 17:12:02.000000000 +0000 @@ -22,7 +22,7 @@ } static void -kill_wait() +kill_wait(void) { kill(_x_pid, SIGTERM); } diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_xserver.c entrance-0.0.5~201401231204/src/daemon/entrance_xserver.c --- entrance-0.0.4~201312021541/src/daemon/entrance_xserver.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_xserver.c 2014-01-21 17:12:02.000000000 +0000 @@ -29,7 +29,7 @@ } static int -_xserver_start() +_xserver_start(void) { char *buf = NULL; char **args = NULL; @@ -124,14 +124,14 @@ } void -entrance_xserver_end() +entrance_xserver_end(void) { PT("xserver end\n"); unsetenv("ENTRANCE_XPID"); } void -entrance_xserver_shutdown() +entrance_xserver_shutdown(void) { eina_stringshare_del(_xserver->dname); free(_xserver); diff -Nru entrance-0.0.4~201312021541/src/daemon/entrance_xserver.h entrance-0.0.5~201401231204/src/daemon/entrance_xserver.h --- entrance-0.0.4~201312021541/src/daemon/entrance_xserver.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/daemon/entrance_xserver.h 2014-01-21 17:12:02.000000000 +0000 @@ -2,7 +2,7 @@ #define ENTRANCE_XLIB_H_ typedef Eina_Bool (*Entrance_X_Cb)(const char *data); int entrance_xserver_init(Entrance_X_Cb start, const char *dname); -void entrance_xserver_wait(); -void entrance_xserver_end(); -void entrance_xserver_shutdown(); +void entrance_xserver_wait(void); +void entrance_xserver_end(void); +void entrance_xserver_shutdown(void); #endif /* ENTRANCE_XLIB_H_ */ diff -Nru entrance-0.0.4~201312021541/src/event/entrance_event.c entrance-0.0.5~201401231204/src/event/entrance_event.c --- entrance-0.0.4~201312021541/src/event/entrance_event.c 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/event/entrance_event.c 2014-01-21 17:12:02.000000000 +0000 @@ -8,10 +8,10 @@ #define ENTRANCE_EVENT_XSESSIONS_NAME "EntranceEventSession" #define ENTRANCE_EVENT_STATUS_NAME "EntranceEventStatus" #define ENTRANCE_EVENT_USERS_NAME "EntranceEventUsers" -#define ENTRANCE_EVENT_USER_NAME "EntranceEventUser" #define ENTRANCE_EVENT_ACTIONS_NAME "EntranceEventActions" #define ENTRANCE_EVENT_ACTION_NAME "EntranceEventAction" #define ENTRANCE_EVENT_CONF_GUI_NAME "EntranceEventConfGui" +#define ENTRANCE_EVENT_CONF_USER_NAME "EntranceEventConfUser" static Eina_Bool _entrance_event_type_set(const char *type, void *data, Eina_Bool unknow); static const char *_entrance_event_type_get(const void *data, Eina_Bool *unknow); @@ -21,7 +21,7 @@ static Eet_Data_Descriptor *_entrance_event_conf_gui_dd(void); static Eet_Data_Descriptor *_entrance_event_maxtries_dd(void); static Eet_Data_Descriptor *_entrance_event_users_dd(void); -static Eet_Data_Descriptor *_entrance_event_user_dd(void); +static Eet_Data_Descriptor *_entrance_event_conf_user_dd(void); static Eet_Data_Descriptor *_entrance_event_actions_dd(void); static Eet_Data_Descriptor *_entrance_event_action_dd(void); static Eet_Data_Descriptor *_entrance_event_new(void); @@ -52,8 +52,8 @@ *ev = ENTRANCE_EVENT_XSESSIONS; else if (!strcmp(type, ENTRANCE_EVENT_USERS_NAME)) *ev = ENTRANCE_EVENT_USERS; - else if (!strcmp(type, ENTRANCE_EVENT_USER_NAME)) - *ev = ENTRANCE_EVENT_USER; + else if (!strcmp(type, ENTRANCE_EVENT_CONF_USER_NAME)) + *ev = ENTRANCE_EVENT_CONF_USER; else if (!strcmp(type, ENTRANCE_EVENT_ACTIONS_NAME)) *ev = ENTRANCE_EVENT_ACTIONS; else if (!strcmp(type, ENTRANCE_EVENT_ACTION_NAME)) @@ -62,7 +62,7 @@ *ev = ENTRANCE_EVENT_CONF_GUI; else { - printf("error on type set\n"); + printf("error on type set %s\n", type); *ev = ENTRANCE_EVENT_UNKNOWN; return EINA_FALSE; } @@ -83,8 +83,8 @@ return ENTRANCE_EVENT_XSESSIONS_NAME; else if (*ev == ENTRANCE_EVENT_USERS) return ENTRANCE_EVENT_USERS_NAME; - else if (*ev == ENTRANCE_EVENT_USER) - return ENTRANCE_EVENT_USER_NAME; + else if (*ev == ENTRANCE_EVENT_CONF_USER) + return ENTRANCE_EVENT_CONF_USER_NAME; else if (*ev == ENTRANCE_EVENT_ACTIONS) return ENTRANCE_EVENT_ACTIONS_NAME; else if (*ev == ENTRANCE_EVENT_ACTION) @@ -93,7 +93,7 @@ return ENTRANCE_EVENT_CONF_GUI_NAME; else { - printf("error on type get\n"); + printf("error on type get %d\n", *ev); if (unknow) *unknow = EINA_TRUE; } @@ -191,7 +191,7 @@ Eet_Data_Descriptor *edd, *eddl; Eet_Data_Descriptor_Class eddc, eddcl; EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Entrance_Login); - edd = _entrance_event_user_dd(); + edd = _entrance_event_conf_user_dd(); EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddcl, Entrance_Users_Event); eddl = eet_data_descriptor_stream_new(&eddcl); EET_DATA_DESCRIPTOR_ADD_LIST(eddl, Entrance_Users_Event, "users", @@ -200,7 +200,7 @@ } static Eet_Data_Descriptor * -_entrance_event_user_dd(void) +_entrance_event_conf_user_dd(void) { Eet_Data_Descriptor *edd; Eet_Data_Descriptor_Class eddc; @@ -276,8 +276,8 @@ _entrance_event_status_dd()); EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_USERS_NAME, _entrance_event_users_dd()); - EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_USER_NAME, - _entrance_event_user_dd()); + EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_CONF_USER_NAME, + _entrance_event_conf_user_dd()); EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_ACTIONS_NAME, _entrance_event_actions_dd()); EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_ACTION_NAME, @@ -333,7 +333,7 @@ } Eet_Data_Descriptor * -entrance_event_user_dd() +entrance_event_user_dd(void) { - return _entrance_event_user_dd(); + return _entrance_event_conf_user_dd(); } diff -Nru entrance-0.0.4~201312021541/src/event/entrance_event.h entrance-0.0.5~201401231204/src/event/entrance_event.h --- entrance-0.0.4~201312021541/src/event/entrance_event.h 2013-11-15 23:53:01.000000000 +0000 +++ entrance-0.0.5~201401231204/src/event/entrance_event.h 2014-01-21 17:12:02.000000000 +0000 @@ -8,7 +8,7 @@ ENTRANCE_EVENT_STATUS, ENTRANCE_EVENT_XSESSIONS, ENTRANCE_EVENT_USERS, - ENTRANCE_EVENT_USER, + ENTRANCE_EVENT_CONF_USER, ENTRANCE_EVENT_ACTIONS, ENTRANCE_EVENT_ACTION, ENTRANCE_EVENT_MAXTRIES, @@ -105,7 +105,7 @@ Entrance_Maxtries_Event maxtries; Entrance_Status_Event status; Entrance_Users_Event users; - Entrance_Login user; + Entrance_Login conf_user; Entrance_Actions_Event actions; Entrance_Action_Event action; Entrance_Conf_Gui_Event conf_gui; @@ -116,5 +116,5 @@ void entrance_event_shutdown(void); void entrance_event_send(const Entrance_Event *data); void entrance_event_received(const void *data, size_t size); -Eet_Data_Descriptor *entrance_event_user_dd(); +Eet_Data_Descriptor *entrance_event_user_dd(void); #endif /* ENTRANCE_EVENT_ */