Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entrance
Dir : e17/apps/entrance/src/client
Modified Files:
Makefile.am entrance_config.c entrance_config.h
entrance_session.c entrance_session.h main.c
Log Message:
Here's the new session handling code, it shouldn't interfere with the
default theme for now. Sorry I ran indent. xcomp don't shoot me :)
Should have more tastey things and cleanups tomorrow
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- Makefile.am 25 Jul 2003 05:20:02 -0000 1.4
+++ Makefile.am 21 Oct 2003 10:19:10 -0000 1.5
@@ -1,6 +1,7 @@
## Process this file with automake to produce Makefile.in
-INCLUDES = @edje_cflags@ @ecore_cflags@ @edb_cflags@ @evas_cflags@
+INCLUDES = @edje_cflags@ @ecore_cflags@ @edb_cflags@ @evas_cflags@ \
[EMAIL PROTECTED]@
bin_PROGRAMS = entrance
@@ -12,4 +13,5 @@
util.c util.h \
main.c
-entrance_LDADD = @edje_libs@ @ecore_libs@ @edb_libs@ @evas_libs@
+entrance_LDADD = @edje_libs@ @ecore_libs@ @edb_libs@ @evas_libs@ \
[EMAIL PROTECTED]@
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -3 -r1.8 -r1.9
--- entrance_config.c 19 Oct 2003 19:41:02 -0000 1.8
+++ entrance_config.c 21 Oct 2003 10:19:10 -0000 1.9
@@ -39,9 +39,9 @@
e->theme = strdup("default.eet");
if ((str = e_db_str_get(db, "/entrance/pointer")))
- e->pointer = str;
+ e->pointer = str;
else
- e->pointer = strdup(PACKAGE_DATA_DIR"/images/pointer.png");
+ e->pointer = strdup(PACKAGE_DATA_DIR "/images/pointer.png");
if ((str = e_db_str_get(db, "/entrance/greeting/before")))
e->before.string = str;
@@ -52,14 +52,14 @@
else
e->after.string = strdup(":");
if ((str = e_db_str_get(db, "/entrance/date_format")))
- e->date.string = str;
+ e->date.string = str;
else
- e->date.string = strdup("%A %B %e, %Y");
+ e->date.string = strdup("%A %B %e, %Y");
if ((str = e_db_str_get(db, "/entrance/time_format")))
- e->time.string = str;
+ e->time.string = str;
else
- e->time.string = strdup("%l:%M:%S %p");
+ e->time.string = strdup("%l:%M:%S %p");
#if 0
if (e_db_int_get(db, "/entrance/user/count", &num_user))
{
@@ -90,31 +90,36 @@
/* session hash and font list */
if (e_db_int_get(db, "/entrance/session/count", &num_session))
{
- char *key = NULL;
- char *value = NULL;
+ char *key = NULL, listkey;
+ char *icon = NULL;
+ char *value = NULL;
for (i = 0; i < num_session; i++)
{
- snprintf(buf, PATH_MAX, "/entrance/session/%d/value", i);
- value = e_db_str_get(db, buf);
- snprintf(buf, PATH_MAX, "/entrance/session/%d/key", i);
+ snprintf(buf, PATH_MAX, "/entrance/session/%d/title", i);
key = e_db_str_get(db, buf);
-
- e->sessions = evas_hash_add(e->sessions, key, value);
- free(key);
+ snprintf(buf, PATH_MAX, "/entrance/session/%d/session", i);
+ value = e_db_str_get(db, buf);
+ snprintf(buf, PATH_MAX, "/entrance/session/%d/icon", i);
+ icon = e_db_str_get(db, buf);
+
+ e->sessions = evas_hash_add(e->sessions, key, value);
+ e->icons = evas_hash_add(e->icons, key, icon);
+ e->keys = evas_list_append(e->keys, key);
}
}
if (e_db_int_get(db, "/entrance/fonts/count", &num_fonts))
{
char *value = NULL;
+
for (i = 0; i < num_fonts; i++)
{
snprintf(buf, PATH_MAX, "/entrance/fonts/%d/str", i);
- if((value = e_db_str_get(db, buf)))
- {
- e->fonts = evas_list_append(e->fonts, value);
- }
-
+ if ((value = e_db_str_get(db, buf)))
+ {
+ e->fonts = evas_list_append(e->fonts, value);
+ }
+
}
}
@@ -134,24 +139,26 @@
if (!e_db_int_get(db, "/entrance/auth", &(e->auth)))
e->auth = 0;
if (!e_db_int_get(db, "/entrance/system/reboot", &(e->reboot.allow)))
- e->reboot.allow = 0;
+ e->reboot.allow = 0;
if (!e_db_int_get(db, "/entrance/system/halt", &(e->halt.allow)))
- e->halt.allow = 0;
+ e->halt.allow = 0;
if (e->auth != ENTRANCE_USE_PAM)
{
- /* check whether /etc/shadow can be used for authentication */
- if (!access("/etc/shadow", R_OK))
- e->auth = ENTRANCE_USE_SHADOW;
- else if (!access("/etc/shadow", F_OK))
- {
- syslog(LOG_CRIT, "/etc/shadow was found but couldn't be read. Run entrance
as root.");
+ /* check whether /etc/shadow can be used for authentication */
+ if (!access("/etc/shadow", R_OK))
+ e->auth = ENTRANCE_USE_SHADOW;
+ else if (!access("/etc/shadow", F_OK))
+ {
+ syslog(LOG_CRIT,
+ "/etc/shadow was found but couldn't be read. Run entrance as root.");
exit(-1);
- }
+ }
}
#ifndef HAVE_PAM
else
- syslog(LOG_WARNING, "Entrance has been built without PAM support, so PAM isn't
used for authentication!");
+ syslog(LOG_WARNING,
+ "Entrance has been built without PAM support, so PAM isn't used for
authentication!");
#endif
}
@@ -200,13 +207,13 @@
if (e->pointer)
free(e->pointer);
if (e->date.string)
- free(e->date.string);
+ free(e->date.string);
if (e->time.string)
- free(e->time.string);
- if(e->before.string)
- free(e->before.string);
- if(e->after.string)
- free(e->after.string);
+ free(e->time.string);
+ if (e->before.string)
+ free(e->before.string);
+ if (e->after.string)
+ free(e->after.string);
free(e);
}
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- entrance_config.h 19 Oct 2003 19:41:03 -0000 1.6
+++ entrance_config.h 21 Oct 2003 10:19:10 -0000 1.7
@@ -31,24 +31,26 @@
* pointer - path to the file on disk we want to use as the pointer
*/
char *pointer;
-
+
/**
* before - the string before the hostname in "EntranceHostname"
* after - the string to append after hostname in "EntranceHostname"
* date - the date format fed to strftime for "EntranceDate"
* time - the time format fed to strftime for "EntranceTime"
*/
- struct {
- char *string;
+ struct
+ {
+ char *string;
} before, after, date, time;
/**
* don't know how applicable these are anymore, since layout is left
* up to the edje the variables are currently unused
*/
- struct {
+ struct
+ {
int w, h;
- } screens, display;
+ } screens, display;
/**
* ENTRANCE_USE_PAM - if set to use pam authentication
@@ -56,8 +58,9 @@
*/
int auth;
- struct {
- int allow;
+ struct
+ {
+ int allow;
} reboot, halt;
/**
@@ -69,9 +72,17 @@
*/
Evas_List *users;
/**
- * sessions - a themable string to xsession string hash
+ * sessions - a Title string to xsession mapping
*/
Evas_Hash *sessions;
+ /**
+ * sessions - a Title string to iconfile mapping
+ */
+ Evas_List *keys;
+ /**
+ * keys - a listing of the keys in our hashes
+ */
+ Evas_Hash *icons;
};
typedef struct _Entrance_Config *Entrance_Config;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- entrance_session.c 17 Sep 2003 04:36:57 -0000 1.12
+++ entrance_session.c 21 Oct 2003 10:19:10 -0000 1.13
@@ -1,6 +1,14 @@
#include "entrance.h"
#include "entrance_session.h"
#include <X11/Xlib.h>
+#include <Esmart/container.h>
+
+extern void session_item_selected_cb(void *data, Evas_Object * o,
+ const char *emission,
+ const char *source);
+static Evas_Object *_entrance_session_icon_load(Evas_Object * o, char *file);
+static Evas_Object *_entrance_session_load_session(Entrance_Session e,
+ char *key);
/**
* entrance_session_new: allocate a new Entrance_Session
@@ -14,43 +22,47 @@
char theme_path[PATH_MAX];
e = (Entrance_Session) malloc(sizeof(struct _Entrance_Session));
- memset(e, 0, sizeof(struct _Entrance_Session));
+ memset(e, 0, sizeof(struct _Entrance_Session));
e->auth = entrance_auth_new();
e->config = entrance_config_parse(PACKAGE_CFG_DIR "/entrance_config.db");
if (!e->config)
{
- fprintf(stderr, "%s\n", PACKAGE_CFG_DIR "/entrance_config.db");
+ fprintf(stderr, "%s\n", PACKAGE_CFG_DIR "/entrance_config.db");
syslog(LOG_CRIT, "Fatal Error: Unable to read configuration.");
exit(1);
}
snprintf(theme_path, PATH_MAX, PACKAGE_DATA_DIR "/themes/%s",
e->config->theme);
e->theme = strdup(e->config->theme);
+ e->session = strdup("");
/* ?
e->theme->path = strdup(theme_path);
*/
- return(e);
+ return (e);
}
void
-entrance_session_ecore_evas_set(Entrance_Session e, Ecore_Evas *ee)
+entrance_session_ecore_evas_set(Entrance_Session e, Ecore_Evas * ee)
{
- Evas *evas = NULL;
- if(!e || !ee) return;
-
- e->ee = ee;
- if((evas = ecore_evas_get(ee)))
- {
- Evas_List *l;
- /* free the font list when we're done */
- for(l = e->config->fonts; l; l = l->next)
- {
- evas_font_path_append(evas, (char*)l->data);
- free(l->data);
- }
- e->config->fonts = evas_list_free(e->config->fonts);
- }
+ Evas *evas = NULL;
+
+ if (!e || !ee)
+ return;
+
+ e->ee = ee;
+ if ((evas = ecore_evas_get(ee)))
+ {
+ Evas_List *l;
+
+ /* free the font list when we're done */
+ for (l = e->config->fonts; l; l = l->next)
+ {
+ evas_font_path_append(evas, (char *) l->data);
+ free(l->data);
+ }
+ e->config->fonts = evas_list_free(e->config->fonts);
+ }
}
/**
@@ -74,7 +86,7 @@
static void
init_user_edje(Entrance_Session e, char *user)
{
- fprintf(stderr, "I should load /home/%s/.entrance.eet\n", user);
+ fprintf(stderr, "I should load /home/%s/.entrance.eet\n", user);
}
#endif
@@ -85,8 +97,8 @@
void
entrance_session_run(Entrance_Session e)
{
- ecore_evas_show(e->ee);
- ecore_main_loop_begin();
+ ecore_evas_show(e->ee);
+ ecore_main_loop_begin();
}
/**
@@ -113,21 +125,25 @@
entrance_auth_free(e->auth);
e->auth = entrance_auth_new();
}
+
void
entrance_session_start_user_session(Entrance_Session e)
{
char buf[PATH_MAX];
char *session_key = NULL;
-
+
entrance_auth_setup_environment(e->auth);
- /* Assumption is that most common distributions have Xsession in
- * /etc/X11. A notable exception is Gentoo, but there is a customized
- * ebuild for this distribution. Please comment. */
- if((session_key = (char*)evas_hash_find(e->config->sessions, e->session)))
- snprintf(buf, PATH_MAX, "%s %s", ENTRANCE_XSESSION, session_key);
+ /* Assumption is that most common distributions have Xsession in *
+ /etc/X11. A notable exception is Gentoo, but there is a customized *
+ ebuild for this distribution. Please comment. */
+ if ((session_key =
+ (char *) evas_hash_find(e->config->sessions, e->session)))
+ snprintf(buf, PATH_MAX, "%s %s", ENTRANCE_XSESSION, session_key);
else
- snprintf(buf, PATH_MAX, "%s", ENTRANCE_XSESSION);/* Default session */
+ snprintf(buf, PATH_MAX, "%s", ENTRANCE_XSESSION); /* Default
+ session
+ */
/* If a path was specified for the session, use that path instead of
passing the session name to Xsession */
@@ -147,21 +163,202 @@
/* Tell PAM that session has begun */
if (pam_open_session(e->auth->pam.handle, 0) != PAM_SUCCESS)
{
- syslog(LOG_CRIT, "Unable to open PAM session. Aborting.");
- exit(1);
+ syslog(LOG_CRIT, "Unable to open PAM session. Aborting.");
+ exit(1);
}
}
#endif
-
+
if (initgroups(e->auth->pw->pw_name, e->auth->pw->pw_gid))
- syslog(LOG_CRIT, "Unable to initialize group (is entrance running as root?).");
+ syslog(LOG_CRIT,
+ "Unable to initialize group (is entrance running as root?).");
if (setgid(e->auth->pw->pw_gid))
syslog(LOG_CRIT, "Unable to set group id.");
-
+
if (setuid(e->auth->pw->pw_uid))
syslog(LOG_CRIT, "Unable to set user id.");
- entrance_auth_free(e->auth); /* clear users's password out of memory */
+ entrance_auth_free(e->auth); /* clear users's password out of memory */
execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
+}
+
+static void
+entrance_session_xsession_load(Entrance_Session e, char *key)
+{
+ if (e && e->edje)
+ {
+ Evas_Object *o = NULL, *old_o = NULL;
+
+ if ((o = _entrance_session_load_session(e, key)))
+ {
+ if (e->session)
+ free(e->session);
+ e->session = strdup(key);
+ old_o = edje_object_part_swallow_get(e->edje,
+ "EntranceSession");
+ if(old_o)
+ {
+ edje_object_part_unswallow(e->edje, old_o);
+ evas_object_del(old_o);
+ }
+ edje_object_part_swallow(e->edje, "EntranceSession", o);
+ }
+ }
+}
+
+void
+entrance_session_xsession_set(Entrance_Session e, char *key)
+{
+ char *str = NULL;
+ char buf[PATH_MAX];
+
+ if(!e || !key) return;
+
+ if ((str = evas_hash_find(e->config->sessions, key)))
+ {
+ snprintf(buf, PATH_MAX, "%s", key);
+ if (strcmp(key, e->session))
+ {
+ entrance_session_xsession_load(e, key);
+ }
+ edje_object_signal_emit(e->edje, "SessionSelected", "");
+ }
+ else
+ {
+ fprintf(stderr, "Unable to find %s\n", key);
+ }
+}
+
+void
+entrance_session_edje_object_set(Entrance_Session e, Evas_Object * obj)
+{
+ if (e)
+ {
+ if(e->edje) evas_object_del(e->edje);
+ e->edje = obj;
+ }
+}
+
+void
+entrance_session_list_add(Entrance_Session e)
+{
+ Evas_List *l = NULL;
+ char *key = NULL;
+ Evas_Coord w, h;
+ Evas_Object *edje = NULL;
+ Evas_Object *container = NULL;
+
+ if (!e || !e->edje || !e->config)
+ return;
+ edje_object_part_geometry_get(e->edje, "EntranceSessionList", NULL, NULL,
+ &w, &h);
+ if ((container = e_container_new(evas_object_evas_get(e->edje))))
+ {
+ e_container_padding_set(container, 4, 4, 4, 4);
+ e_container_spacing_set(container, 4);
+ e_container_move_button_set(container, 2);
+ if (w > h)
+ {
+ e_container_fill_policy_set(container, CONTAINER_FILL_POLICY_FILL_Y);
+ e_container_direction_set(container, 0);
+ }
+ else
+ {
+ e_container_fill_policy_set(container, CONTAINER_FILL_POLICY_FILL_X);
+ e_container_direction_set(container, 1);
+ }
+
+ for (l = e->config->keys; l; l = l->next)
+ {
+ key = (char *) l->data;
+ if ((edje = _entrance_session_load_session(e, key)))
+ {
+ e_container_element_append(container, edje);
+ }
+ }
+ edje_object_part_swallow(e->edje, "EntranceSessionList", container);
+ }
+}
+static Evas_Object *
+_entrance_session_icon_load(Evas_Object * o, char *file)
+{
+ Evas_Object *result = NULL;
+ char buf[PATH_MAX];
+
+ if (!o || !file)
+ return (NULL);
+
+ result = edje_object_add(evas_object_evas_get(o));
+ snprintf(buf, PATH_MAX, "%s/images/sessions/%s", PACKAGE_DATA_DIR, file);
+ if (!edje_object_file_set(result, buf, "Icon") > 0)
+ {
+ evas_object_del(result);
+ result = evas_object_image_add(evas_object_evas_get(o));
+ evas_object_image_file_set(result, buf, NULL);
+ if (evas_object_image_load_error_get(result))
+ {
+ snprintf(buf, PATH_MAX, "%s/images/sessions/default.png",
+ PACKAGE_DATA_DIR);
+ result = evas_object_image_add(evas_object_evas_get(o));
+ }
+ }
+ evas_object_move(result, -999, -999);
+ evas_object_resize(result, 48, 48);
+ evas_object_layer_set(result, 0);
+ evas_object_show(result);
+ return (result);
+}
+
+static Evas_Object *
+_entrance_session_load_session(Entrance_Session e, char *key)
+{
+ int result = 0;
+ char *icon = NULL;
+ char buf[PATH_MAX];
+ Evas_Object *o = NULL;
+ Evas_Object *edje = NULL;
+
+ if (!e || !e->edje || !key)
+ return (NULL);
+
+ edje = edje_object_add(evas_object_evas_get(e->edje));
+ snprintf(buf, PATH_MAX, "%s/themes/%s", PACKAGE_DATA_DIR,
+ e->config->theme);
+ if ((result = edje_object_file_set(edje, buf, "Session")) > 0)
+ {
+ evas_object_move(edje, 0, 0);
+ evas_object_resize(edje, 48, 48);
+ evas_object_layer_set(edje, 0);
+
+ if (edje_object_part_exists(edje, "EntranceSessionIcon"))
+ {
+ icon = (char *) evas_hash_find(e->config->icons, key);
+ o = _entrance_session_icon_load(e->edje, icon);
+ if (!strcmp(evas_object_type_get(o), "image"))
+ {
+ Evas_Coord w, h;
+
+ edje_object_part_geometry_get(edje, "EntranceSessionIcon", NULL,
+ NULL, &w, &h);
+ evas_object_image_fill_set(o, 0.0, 0.0, w, h);
+ }
+ edje_object_part_swallow(edje, "EntranceSessionIcon", o);
+ }
+ if (edje_object_part_exists(edje, "EntranceSessionTitle"))
+ {
+ edje_object_part_text_set(edje, "EntranceSessionTitle", key);
+ }
+ edje_object_signal_callback_add(edje, "SessionSelected", "",
+ session_item_selected_cb, key);
+ evas_object_show(edje);
+ }
+ else
+ {
+ fprintf(stderr, "Failed on: %s(%d)\n", key, result);
+ evas_object_del(edje);
+ evas_object_del(o);
+ edje = NULL;
+ }
+ return (edje);
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- entrance_session.h 25 Jul 2003 05:20:02 -0000 1.4
+++ entrance_session.h 21 Oct 2003 10:19:10 -0000 1.5
@@ -17,9 +17,10 @@
struct _Entrance_Session
{
- char *theme; /* Theme eet */
- char *session; /* Theme eet */
+ char *theme; /* Theme eet */
+ char *session; /* Theme eet */
Ecore_Evas *ee; /* the ecore_evas */
+ Evas_Object *edje; /* main theme edje */
Entrance_Auth auth; /* encapsulated auth shit */
Entrance_Config config; /* configuration options */
@@ -30,11 +31,14 @@
typedef struct _Entrance_Session *Entrance_Session;
Entrance_Session entrance_session_new(void);
-void entrance_session_ecore_evas_set(Entrance_Session e, Ecore_Evas *ee);
+void entrance_session_ecore_evas_set(Entrance_Session e, Ecore_Evas * ee);
void entrance_session_free(Entrance_Session e);
void entrance_session_run(Entrance_Session e);
int entrance_session_auth_user(Entrance_Session e);
void entrance_session_reset_user(Entrance_Session e);
void entrance_session_start_user_session(Entrance_Session e);
+void entrance_session_xsession_set(Entrance_Session e, char *xsession);
+void entrance_session_edje_object_set(Entrance_Session e, Evas_Object *obj);
+void entrance_session_list_add(Entrance_Session e);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- main.c 19 Oct 2003 19:41:03 -0000 1.12
+++ main.c 21 Oct 2003 10:19:10 -0000 1.13
@@ -73,6 +73,8 @@
#include <time.h>
#include <sys/types.h>
#include <signal.h>
+#include <Edje.h>
+#include <Esmart/container.h>
#include "entrance.h"
#include "entrance_session.h"
#include "EvasTextEntry.h"
@@ -95,18 +97,17 @@
if (!(gethostname(buf, 255)))
{
- /* Ensure that hostname is in short form */
- dot = strstr(buf, ".");
- if(dot)
- *dot = '\0';
-
- snprintf(message, PATH_MAX, "%s %s %s", session->config->before.string,
- buf, session->config->after.string);
+ /* Ensure that hostname is in short form */
+ dot = strstr(buf, ".");
+ if (dot)
+ *dot = '\0';
+
+ snprintf(message, PATH_MAX, "%s %s %s", session->config->before.string,
+ buf, session->config->after.string);
}
else
- snprintf(message, PATH_MAX, "%s Localhost %s",
- session->config->before.string,
- session->config->after.string);
+ snprintf(message, PATH_MAX, "%s Localhost %s",
+ session->config->before.string, session->config->after.string);
result = strdup(message);
return (result);
}
@@ -121,19 +122,19 @@
static int
exit_cb(void *data, int ev_type, void *ev)
{
- ecore_main_loop_quit();
+ ecore_main_loop_quit();
// exit(0);
- return 1;
+ return 1;
}
/**
* window_del_cb - what to do when we receive a window delete event
* @ee - the Ecore_Evas that received the event
*/
-static void
-window_del_cb(Ecore_Evas *ee)
+static void
+window_del_cb(Ecore_Evas * ee)
{
- ecore_main_loop_quit();
+ ecore_main_loop_quit();
// exit(0);
}
@@ -142,16 +143,17 @@
* @ee - The Ecore_Evas we're resizing
*/
static void
-window_resize_cb(Ecore_Evas *ee)
+window_resize_cb(Ecore_Evas * ee)
{
- Evas_Object *o = NULL;
-
- if((o = evas_object_name_find(ecore_evas_get(ee), "ui")))
- {
- int w, h;
- ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
- evas_object_resize(o, w, h);
- }
+ Evas_Object *o = NULL;
+
+ if ((o = evas_object_name_find(ecore_evas_get(ee), "ui")))
+ {
+ int w, h;
+
+ ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
+ evas_object_resize(o, w, h);
+ }
}
/**
@@ -159,39 +161,44 @@
* entries
* @o - the object we want to swap focus with
* @selecto - whether to focus on o, or the other entry
- */
+ */
static void
-focus_swap(Evas_Object *o, int selecto)
+focus_swap(Evas_Object * o, int selecto)
{
- Evas_Object *oo = NULL;
- Evas_Text_Entry *e = NULL;
-
- if((e = evas_object_smart_data_get(o)))
- {
- if(!strcmp(e->edje.part, "EntrancePassEntry"))
- {
- if((oo = evas_object_name_find(evas_object_evas_get(o),
- "EntranceUserEntry")))
- {
- evas_text_entry_text_set(oo, "");
- }
- evas_text_entry_text_set(o, "");
- }
- else if(!strcmp(e->edje.part, "EntranceUserEntry"))
- {
- oo = evas_object_name_find(evas_object_evas_get(o),
- "EntrancePassEntry");
- }
- }
- if(oo)
- {
- selecto ?
- evas_text_entry_focus_set(oo, 0) : evas_text_entry_focus_set(o, 0);
-
- selecto ?
- evas_text_entry_focus_set(o, 1): evas_text_entry_focus_set(oo, 1);
- }
+ Evas_Object *oo = NULL;
+ Evas_Text_Entry *e = NULL;
+
+ if ((e = evas_object_smart_data_get(o)))
+ {
+ if (!strcmp(e->edje.part, "EntrancePassEntry"))
+ {
+ if ((oo =
+ evas_object_name_find(evas_object_evas_get(o),
+ "EntranceUserEntry")))
+ {
+ evas_text_entry_text_set(oo, "");
+ }
+ evas_text_entry_text_set(o, "");
+ }
+ else if (!strcmp(e->edje.part, "EntranceUserEntry"))
+ {
+ oo =
+ evas_object_name_find(evas_object_evas_get(o),
+ "EntrancePassEntry");
+ }
+ }
+ if (oo)
+ {
+ selecto ? evas_text_entry_focus_set(oo,
+ 0) : evas_text_entry_focus_set(o,
+ 0);
+
+ selecto ? evas_text_entry_focus_set(o,
+ 1) : evas_text_entry_focus_set(oo,
+ 1);
+ }
}
+
/**
* interp_return_key - when Enter is hit on the keyboard we end up here
* @data - The smart object that is this Entry
@@ -200,60 +207,60 @@
static void
interp_return_key(void *data, const char *str)
{
- Evas_Object *o = NULL;
- Evas_Text_Entry *e = NULL;
-
- o = (Evas_Object*)data;
-
- if((e = evas_object_smart_data_get(o)))
- {
- if(!strcmp(e->edje.part, "EntranceUserEntry"))
- {
- if(!entrance_auth_set_user(session->auth, str))
- {
- edje_object_signal_emit(e->edje.o,
- "EntranceUserAuth", "");
- focus_swap(o, 0);
- }
- else
- {
- evas_text_entry_text_set(o, "");
- entrance_session_reset_user(session);
- edje_object_signal_emit(e->edje.o,
- "EntranceUserFail", "");
- focus_swap(o, 1);
- }
- }
- if(!strcmp(e->edje.part, "EntrancePassEntry"))
- {
- if(session->auth->user && strlen(session->auth->user) > 0)
- {
- const char *sessionname = NULL;
- entrance_auth_set_pass(session->auth, str);
- if(edje_object_part_exists(e->edje.o, "EntranceSession"))
- {
- sessionname = edje_object_part_text_get(e->edje.o,
- "EntranceSession");
- if(session->session) free(session->session);
- session->session = strdup(sessionname);
- }
- if(!entrance_session_auth_user(session))
- {
- edje_object_signal_emit(e->edje.o,
- "EntranceUserAuthSuccess", "");
- session->authed = 1;
- }
- else
- {
- entrance_session_reset_user(session);
- edje_object_signal_emit(e->edje.o,
- "EntranceUserAuthFail", "");
- focus_swap(o, 0);
- }
- }
- }
- }
+ Evas_Object *o = NULL;
+ Evas_Text_Entry *e = NULL;
+
+ o = (Evas_Object *) data;
+
+ if ((e = evas_object_smart_data_get(o)))
+ {
+ if (!strcmp(e->edje.part, "EntranceUserEntry"))
+ {
+ if (!entrance_auth_set_user(session->auth, str))
+ {
+ edje_object_signal_emit(e->edje.o, "EntranceUserAuth", "");
+ focus_swap(o, 0);
+ }
+ else
+ {
+ evas_text_entry_text_set(o, "");
+ entrance_session_reset_user(session);
+ edje_object_signal_emit(e->edje.o, "EntranceUserFail", "");
+ focus_swap(o, 1);
+ }
+ }
+ if (!strcmp(e->edje.part, "EntrancePassEntry"))
+ {
+ if (session->auth->user && strlen(session->auth->user) > 0)
+ {
+ const char *sessionname = NULL;
+
+ entrance_auth_set_pass(session->auth, str);
+ if (edje_object_part_exists(e->edje.o, "EntranceSession"))
+ {
+ sessionname =
+ edje_object_part_text_get(e->edje.o, "EntranceSession");
+ if (session->session)
+ free(session->session);
+ session->session = strdup(sessionname);
+ }
+ if (!entrance_session_auth_user(session))
+ {
+ edje_object_signal_emit(e->edje.o, "EntranceUserAuthSuccess",
+ "");
+ session->authed = 1;
+ }
+ else
+ {
+ entrance_session_reset_user(session);
+ edje_object_signal_emit(e->edje.o, "EntranceUserAuthFail", "");
+ focus_swap(o, 0);
+ }
+ }
+ }
+ }
}
+
/**
* focus - an edje signal emission
* @data - the data passed when the callback was added
@@ -262,30 +269,32 @@
* @source - the signal originated from this "part"
*/
static void
-focus(void *data, Evas_Object *o, const char *emission, const char *source)
+focus(void *data, Evas_Object * o, const char *emission, const char *source)
{
- Evas_Object *oo = NULL; /* in nexus this looks in infinity !*/
- if((oo = (Evas_Object*)data))
- {
- if(!strcmp(emission, "In"))
- {
- if(!evas_text_entry_is_focused(oo))
- {
- evas_text_entry_focus_set(oo, 1);
- }
- }
- else if(!strcmp(emission, "Out"))
- {
- if(evas_text_entry_is_focused(oo))
- {
- evas_text_entry_focus_set(oo, 1);
- evas_text_entry_focus_set(oo, 0);
- }
- }
- else
- fprintf(stderr, "Unknown signal Emission(%s)", emission);
- }
+ Evas_Object *oo = NULL; /* in nexus this looks in infinity ! */
+
+ if ((oo = (Evas_Object *) data))
+ {
+ if (!strcmp(emission, "In"))
+ {
+ if (!evas_text_entry_is_focused(oo))
+ {
+ evas_text_entry_focus_set(oo, 1);
+ }
+ }
+ else if (!strcmp(emission, "Out"))
+ {
+ if (evas_text_entry_is_focused(oo))
+ {
+ evas_text_entry_focus_set(oo, 1);
+ evas_text_entry_focus_set(oo, 0);
+ }
+ }
+ else
+ fprintf(stderr, "Unknown signal Emission(%s)", emission);
+ }
}
+
/**
* set_date - an edje signal emission
* @data - the data passed when the callback was added
@@ -297,19 +306,21 @@
* the theme and not statically bound to a value.
*/
static void
-set_date(void *data, Evas_Object *o, const char *emission, const char *source)
+set_date(void *data, Evas_Object * o, const char *emission,
+ const char *source)
{
- if(edje_object_part_exists(o, "EntranceDate"))
- {
- struct tm *now;
- char buf[PATH_MAX];
- time_t _t = time(NULL);
-
- now = localtime(&_t);
- strftime(buf, PATH_MAX, session->config->date.string, now);
- edje_object_part_text_set(o, "EntranceDate", buf);
- }
+ if (edje_object_part_exists(o, "EntranceDate"))
+ {
+ struct tm *now;
+ char buf[PATH_MAX];
+ time_t _t = time(NULL);
+
+ now = localtime(&_t);
+ strftime(buf, PATH_MAX, session->config->date.string, now);
+ edje_object_part_text_set(o, "EntranceDate", buf);
+ }
}
+
/**
* set_time - an edje signal emission
* @data - the data passed when the callback was added
@@ -321,18 +332,19 @@
* the theme and not statically bound to a value.
*/
static void
-set_time(void *data, Evas_Object *o, const char *emission, const char *source)
+set_time(void *data, Evas_Object * o, const char *emission,
+ const char *source)
{
- if(edje_object_part_exists(o, "EntranceTime"))
- {
- struct tm *now;
- char buf[PATH_MAX];
- time_t _t = time(NULL);
-
- now = localtime(&_t);
- strftime(buf, PATH_MAX, session->config->time.string, now);
- edje_object_part_text_set(o, "EntranceTime", buf);
- }
+ if (edje_object_part_exists(o, "EntranceTime"))
+ {
+ struct tm *now;
+ char buf[PATH_MAX];
+ time_t _t = time(NULL);
+
+ now = localtime(&_t);
+ strftime(buf, PATH_MAX, session->config->time.string, now);
+ edje_object_part_text_set(o, "EntranceTime", buf);
+ }
}
/**
@@ -346,16 +358,36 @@
* the theme and not statically bound to a value.
*/
static void
-done_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+done_cb(void *data, Evas_Object * o, const char *emission, const char *source)
+{
+ if (session->authed)
+ {
+ entrance_session_start_user_session(session);
+ }
+ else
+ {
+ exit(0);
+ }
+}
+
+/**
+ * session_item_selected_cb - Executed when a Session is selected
+ * @data - the data passed when the callback was added
+ * @o - the evas object(Edje) that created the signal
+ * @emission - the signal "type" that was emitted
+ * @source - the signal originated from this "part"
+ * Attempt to set the Part named "EntranceTime" to the results of
+ * localtime. This way the interval is configurable via a program in
+ * the theme and not statically bound to a value.
+ */
+void
+session_item_selected_cb(void *data, Evas_Object * o, const char *emission,
+ const char *source)
{
- if(session->authed)
- {
- entrance_session_start_user_session(session);
- }
- else
- {
- exit(0);
- }
+ if (session && data)
+ {
+ entrance_session_xsession_set(session, (char *) data);
+ }
}
/**
@@ -369,14 +401,16 @@
* the theme and not statically bound to a value.
*/
static void
-reboot_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+reboot_cb(void *data, Evas_Object * o, const char *emission,
+ const char *source)
{
- if(session->config->reboot.allow)
- {
- pid_t ppid = getppid();
- execl("/bin/sh", "/bin/sh", "-c", "/sbin/shutdown -r now", NULL);
- kill(ppid, SIGQUIT);
- }
+ if (session->config->reboot.allow)
+ {
+ pid_t ppid = getppid();
+
+ execl("/bin/sh", "/bin/sh", "-c", "/sbin/shutdown -r now", NULL);
+ kill(ppid, SIGQUIT);
+ }
}
/**
@@ -390,14 +424,16 @@
* the theme and not statically bound to a value.
*/
static void
-shutdown_cb(void *data, Evas_Object *o, const char *emission, const char *source)
+shutdown_cb(void *data, Evas_Object * o, const char *emission,
+ const char *source)
{
- if(session->config->halt.allow)
- {
- pid_t ppid = getppid();
- execl("/bin/sh", "/bin/sh", "-c", "/sbin/shutdown -h now", NULL);
- kill(ppid, SIGQUIT);
- }
+ if (session->config->halt.allow)
+ {
+ pid_t ppid = getppid();
+
+ execl("/bin/sh", "/bin/sh", "-c", "/sbin/shutdown -h now", NULL);
+ kill(ppid, SIGQUIT);
+ }
}
/**
@@ -406,13 +442,46 @@
int
timer_cb(void *data)
{
- Evas_Object *o = NULL;
- if((o = (Evas_Object*)data))
- {
- set_date(NULL, o, NULL, NULL);
- set_time(NULL, o, NULL, NULL);
- }
- return(1);
+ Evas_Object *o = NULL;
+
+ if ((o = (Evas_Object *) data))
+ {
+ set_date(NULL, o, NULL, NULL);
+ set_time(NULL, o, NULL, NULL);
+ }
+ return (1);
+}
+
+void
+entrance_user_list_add(Evas_Object * edje, Entrance_Config cfg)
+{
+ Evas_Coord w, h;
+ Evas_Object *container = NULL;
+
+ if (!edje || !cfg)
+ return;
+ edje_object_part_geometry_get(edje, "EntranceUserList", NULL, NULL, &w,
+ &h);
+ if ((container = e_container_new(evas_object_evas_get(edje))))
+ {
+ e_container_padding_set(container, 4, 4, 4, 4);
+ e_container_spacing_set(container, 4);
+ e_container_move_button_set(container, 2);
+ if (w > h)
+ {
+ e_container_fill_policy_set(container, CONTAINER_FILL_POLICY_FILL_Y);
+ e_container_direction_set(container, 0);
+ }
+ else
+ {
+ e_container_fill_policy_set(container, CONTAINER_FILL_POLICY_FILL_X);
+ e_container_direction_set(container, 1);
+ }
+#if 0
+ entrance_swallow_users_to_container(container, cfg);
+#endif
+ edje_object_part_swallow(edje, "EntranceUserList", container);
+ }
}
/**
@@ -421,164 +490,183 @@
int
main(int argc, char *argv[])
{
- int i = 0;
- char buf[PATH_MAX];
- char *str = NULL;
- Ecore_X_Window ew;
- Evas *evas = NULL;
- Ecore_Evas *e = NULL;
- Ecore_Timer *timer = NULL;
- Evas_Object *o = NULL, *edje = NULL;
- Evas_Coord x, y, w, h;
- char *entries[] = { "EntranceUserEntry", "EntrancePassEntry" };
- int entries_count = 2;
-
- openlog("entrance", LOG_NOWAIT, LOG_DAEMON);
- if(argv[1]) snprintf(buf, PATH_MAX, "%s", argv[1]);
- /* Basic ecore initialization */
- if(!ecore_init()) return(-1);
- ecore_app_args_set(argc, (const char **)argv);
+ int i = 0;
+ char buf[PATH_MAX];
+ char *str = NULL;
+ Ecore_X_Window ew;
+ Evas *evas = NULL;
+ Ecore_Evas *e = NULL;
+ Ecore_Timer *timer = NULL;
+ Evas_Object *o = NULL, *edje = NULL;
+ Evas_Coord x, y, w, h;
+ char *entries[] = { "EntranceUserEntry", "EntrancePassEntry" };
+ int entries_count = 2;
+
+ openlog("entrance", LOG_NOWAIT, LOG_DAEMON);
+ if (argv[1])
+ snprintf(buf, PATH_MAX, "%s", argv[1]);
+ /* Basic ecore initialization */
+ if (!ecore_init())
+ return (-1);
+ ecore_app_args_set(argc, (const char **) argv);
#if 0
- if(!ecore_x_init(buf))
- {
- if((str = getenv("DISPLAY")))
- syslog(LOG_CRIT, "Cannot initialize default display \"%s\". Exiting.", str);
- else
+ if (!ecore_x_init(buf))
+ {
+ if ((str = getenv("DISPLAY")))
+ syslog(LOG_CRIT,
+ "Cannot initialize default display \"%s\". Exiting.", str);
+ else
syslog(LOG_CRIT, "No DISPLAY variable set! Exiting.");
- return(-1);
- }
+ return (-1);
+ }
#endif
- ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_cb, NULL);
+ ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_cb, NULL);
- session = entrance_session_new();
- if(ecore_evas_init())
- {
- /* init edje and set frametime to 60 fps ? */
- edje_init();
- edje_frametime_set(1.0/60.0);
-
- /* setup our ecore_evas */
- /* testing mode decides entrance window size
- *
- * Use rendering engine specified in config. On systems with
- * hardware acceleration, GL should improve performance appreciably
- */
- if(!strcmp(session->config->engine, "software"))
- e = ecore_evas_software_x11_new(NULL, 0, 0, 0, WINW, WINH);
- else if(!strcmp(session->config->engine, "gl"))
- e = ecore_evas_gl_x11_new(NULL, 0, 0, 0, WINW, WINH);
- else {
- fprintf(stderr, "Warning: Invalid Evas engine specified in config. Defaulting
to software engine.\n");
- e = ecore_evas_software_x11_new(NULL, 0, 0, 0, WINW, WINH);
- }
-
- ew = ecore_evas_software_x11_window_get(e);
- ecore_evas_title_set(e, "Entrance");
- ecore_evas_callback_delete_request_set(e, window_del_cb);
- ecore_evas_callback_resize_set(e, window_resize_cb);
- ecore_evas_cursor_set(e, session->config->pointer, 12, 0, 0);
- ecore_evas_move(e, 0, 0);
-
- /* Evas specific callbacks */
- evas = ecore_evas_get(e);
- evas_image_cache_set(evas, 8 * 1024 * 1024);
- evas_font_cache_set(evas, 1 * 1024 * 1024);
- evas_font_path_append(evas, PACKAGE_DATA_DIR"/fonts");
- evas_font_path_append(evas, PACKAGE_DATA_DIR"/data/fonts");
- evas_key_modifier_add(evas, "Control_L");
- evas_key_modifier_add(evas, "Control_R");
- evas_key_modifier_add(evas, "Shift_L");
- evas_key_modifier_add(evas, "Shift_R");
- evas_key_modifier_add(evas, "Alt_L");
- evas_key_modifier_add(evas, "Alt_R");
-
- /* Load our theme as an edje */
- edje = edje_object_add(evas);
- snprintf(buf, PATH_MAX, "%s/themes/%s", PACKAGE_DATA_DIR,
- session->theme);
- edje_object_file_set(edje, buf, "main");
- evas_object_move(edje, 0, 0);
- evas_object_resize(edje, WINW, WINH);
- evas_object_name_set(edje, "ui");
- evas_object_layer_set(edje, 0);
-
- for(i = 0; i < entries_count; i++)
- {
- if(edje_object_part_exists(edje, entries[i]))
- {
- edje_object_part_geometry_get(edje, entries[i] ,
- &x, &y, &w, &h);
- o = evas_text_entry_new(evas);
- evas_object_move(o, x, y);
- evas_object_resize(o, w, h);
- evas_object_layer_set(o, 1);
- evas_text_entry_max_chars_set(o, 32);
- evas_text_entry_is_password_set(o, i);
- evas_object_name_set(o, entries[i]);
- evas_text_entry_edje_part_set(o, edje, entries[i]);
-
- evas_text_entry_return_key_callback_set(o, interp_return_key, o);
-
- edje_object_signal_callback_add(edje, "In", entries[i],
- focus, o);
-
- edje_object_signal_callback_add(edje, "Out", entries[i],
- focus, o);
- edje_object_part_swallow(edje, entries[i], o);
- evas_object_show(o);
- }
- o = NULL;
- }
-
- /* See if we have a EntranceHostname part, set it */
- if(edje_object_part_exists(edje, "EntranceHostname"))
- {
- if ((str = get_my_hostname()))
- {
- edje_object_part_text_set(edje, "EntranceHostname", str);
- free(str);
- }
- }
- if(edje_object_part_exists(edje, "EntranceTime"))
- {
- edje_object_signal_callback_add(edje, "Go", "EntranceTime",
- set_time, o);
- edje_object_signal_emit(edje, "Go", "EntranceTime");
- timer = ecore_timer_add(0.5, timer_cb, edje);
- }
- if(edje_object_part_exists(edje, "EntranceDate"))
- {
- edje_object_signal_callback_add(edje, "Go", "EntranceDate",
- set_date, o);
- edje_object_signal_emit(edje, "Go", "EntranceDate");
- if(!timer) timer = ecore_timer_add(0.5, timer_cb, edje);
- }
- edje_object_signal_callback_add(edje, "EntranceUserAuthSuccessDone", "",
- done_cb, e);
- edje_object_signal_callback_add(edje, "EntranceSystemReboot", "",
- reboot_cb, e);
- edje_object_signal_callback_add(edje, "EntranceSystemHalt", "",
- shutdown_cb, e);
- /*
- * It's useful to delay showing of your edje till all your
- * callbacks have been added, otherwise show might trigger all
- * the desired events
- */
- evas_object_show(edje);
- /* set focus to user input */
- edje_object_signal_emit(edje, "In", "EntranceUserEntry");
+ session = entrance_session_new();
+ if (ecore_evas_init())
+ {
+ /* init edje and set frametime to 60 fps ? */
+ edje_init();
+ edje_frametime_set(1.0 / 60.0);
+
+ /* setup our ecore_evas */
+ /* testing mode decides entrance window size * * Use rendering engine
+ specified in config. On systems with * hardware acceleration, GL
+ should improve performance appreciably */
+ if (!strcmp(session->config->engine, "software"))
+ e = ecore_evas_software_x11_new(NULL, 0, 0, 0, WINW, WINH);
+ else if (!strcmp(session->config->engine, "gl"))
+ e = ecore_evas_gl_x11_new(NULL, 0, 0, 0, WINW, WINH);
+ else
+ {
+ fprintf(stderr,
+ "Warning: Invalid Evas engine specified in config. Defaulting to
software engine.\n");
+ e = ecore_evas_software_x11_new(NULL, 0, 0, 0, WINW, WINH);
+ }
+
+ ew = ecore_evas_software_x11_window_get(e);
+ ecore_evas_title_set(e, "Entrance");
+ ecore_evas_callback_delete_request_set(e, window_del_cb);
+ ecore_evas_callback_resize_set(e, window_resize_cb);
+ ecore_evas_cursor_set(e, session->config->pointer, 12, 0, 0);
+ ecore_evas_move(e, 0, 0);
+
+ /* Evas specific callbacks */
+ evas = ecore_evas_get(e);
+ evas_image_cache_set(evas, 8 * 1024 * 1024);
+ evas_font_cache_set(evas, 1 * 1024 * 1024);
+ evas_font_path_append(evas, PACKAGE_DATA_DIR "/fonts");
+ evas_font_path_append(evas, PACKAGE_DATA_DIR "/data/fonts");
+ evas_key_modifier_add(evas, "Control_L");
+ evas_key_modifier_add(evas, "Control_R");
+ evas_key_modifier_add(evas, "Shift_L");
+ evas_key_modifier_add(evas, "Shift_R");
+ evas_key_modifier_add(evas, "Alt_L");
+ evas_key_modifier_add(evas, "Alt_R");
+
+ /* Load our theme as an edje */
+ edje = edje_object_add(evas);
+ snprintf(buf, PATH_MAX, "%s/themes/%s", PACKAGE_DATA_DIR,
+ session->theme);
+ if (!edje_object_file_set(edje, buf, "Main"))
+ {
+ fprintf(stderr, "Failed to set %s\n", buf);
+ exit(1);
+ }
+ evas_object_move(edje, 0, 0);
+ evas_object_resize(edje, WINW, WINH);
+ evas_object_name_set(edje, "ui");
+ evas_object_layer_set(edje, 0);
+ entrance_session_edje_object_set(session, edje);
+
+ for (i = 0; i < entries_count; i++)
+ {
+ if (edje_object_part_exists(edje, entries[i]))
+ {
+ edje_object_part_geometry_get(edje, entries[i], &x, &y, &w, &h);
+ o = evas_text_entry_new(evas);
+ evas_object_move(o, x, y);
+ evas_object_resize(o, w, h);
+ evas_object_layer_set(o, 1);
+ evas_text_entry_max_chars_set(o, 32);
+ evas_text_entry_is_password_set(o, i);
+ evas_object_name_set(o, entries[i]);
+ evas_text_entry_edje_part_set(o, edje, entries[i]);
+
+ evas_text_entry_return_key_callback_set(o, interp_return_key, o);
+
+ edje_object_signal_callback_add(edje, "In", entries[i], focus, o);
+
+ edje_object_signal_callback_add(edje, "Out", entries[i], focus,
+ o);
+ edje_object_part_swallow(edje, entries[i], o);
+ evas_object_show(o);
+ }
+ o = NULL;
+ }
+
+ /* See if we have a EntranceHostname part, set it */
+ if (edje_object_part_exists(edje, "EntranceHostname"))
+ {
+ if ((str = get_my_hostname()))
+ {
+ edje_object_part_text_set(edje, "EntranceHostname", str);
+ free(str);
+ }
+ }
+ if (edje_object_part_exists(edje, "EntranceTime"))
+ {
+ edje_object_signal_callback_add(edje, "Go", "EntranceTime", set_time,
+ o);
+ edje_object_signal_emit(edje, "Go", "EntranceTime");
+ timer = ecore_timer_add(0.5, timer_cb, edje);
+ }
+ if (edje_object_part_exists(edje, "EntranceDate"))
+ {
+ edje_object_signal_callback_add(edje, "Go", "EntranceDate", set_date,
+ o);
+ edje_object_signal_emit(edje, "Go", "EntranceDate");
+ if (!timer)
+ timer = ecore_timer_add(0.5, timer_cb, edje);
+ }
+ if (edje_object_part_exists(edje, "EntranceSession"))
+ {
+ entrance_session_xsession_set(session, "Enlightenment");
+ }
+ if (edje_object_part_exists(edje, "EntranceSessionList"))
+ {
+ entrance_session_list_add(session);
+ }
+ if (edje_object_part_exists(edje, "EntranceUserList"))
+ {
+ entrance_user_list_add(edje, session->config);
+ }
+ edje_object_signal_callback_add(edje, "EntranceUserAuthSuccessDone", "",
+ done_cb, e);
+ edje_object_signal_callback_add(edje, "EntranceSystemReboot", "",
+ reboot_cb, e);
+ edje_object_signal_callback_add(edje, "EntranceSystemHalt", "",
+ shutdown_cb, e);
+ /*
+ * It's useful to delay showing of your edje till all your
+ * callbacks have been added, otherwise show might trigger all
+ * the desired events
+ */
+ evas_object_show(edje);
+ /* set focus to user input */
+ edje_object_signal_emit(edje, "In", "EntranceUserEntry");
#if (X_TESTING == 0)
- ecore_evas_resize(e, WINW, WINH);
- ecore_evas_fullscreen_set(e, 1);
+ ecore_evas_resize(e, WINW, WINH);
+ ecore_evas_fullscreen_set(e, 1);
#elif (X_TESTING == 1)
- ecore_evas_resize(e, WINW, WINH);
+ ecore_evas_resize(e, WINW, WINH);
#endif
-
- entrance_session_ecore_evas_set(session, e);
- entrance_session_run(session);
- entrance_session_free(session);
- closelog();
- }
- return(0);
+
+ entrance_session_ecore_evas_set(session, e);
+ entrance_session_run(session);
+ entrance_session_free(session);
+ closelog();
+ }
+ return (0);
}
-------------------------------------------------------
This SF.net email is sponsored by OSDN developer relations
Here's your chance to show off your extensive product knowledge
We want to know what you know. Tell us and you have a chance to win $100
http://www.zoomerang.com/survey.zgi?HRPT1X3RYQNC5V4MLNSV3E54
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs