Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entrance
Dir : e17/apps/entrance/src/client
Modified Files:
entrance_config.c entrance_config.h entrance_session.c main.c
Log Message:
slight cleanup, i might be breaking things, but I'll fix em :)
move user_list_load to entrance_session_user_list_load
cleanup hashes/lists in entrance_session so they're more coherent
added util functions(that don't work) to load user icons
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- entrance_config.c 21 Oct 2003 10:19:10 -0000 1.9
+++ entrance_config.c 22 Oct 2003 06:58:15 -0000 1.10
@@ -90,7 +90,7 @@
/* session hash and font list */
if (e_db_int_get(db, "/entrance/session/count", &num_session))
{
- char *key = NULL, listkey;
+ char *key = NULL;
char *icon = NULL;
char *value = NULL;
@@ -103,9 +103,9 @@
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);
+ e->sessions.hash = evas_hash_add(e->sessions.hash, key, value);
+ e->sessions.icons = evas_hash_add(e->sessions.icons, key, icon);
+ e->sessions.keys = evas_list_append(e->sessions.keys, key);
}
}
if (e_db_int_get(db, "/entrance/fonts/count", &num_fonts))
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- entrance_config.h 21 Oct 2003 10:19:10 -0000 1.7
+++ entrance_config.h 22 Oct 2003 06:58:15 -0000 1.8
@@ -67,22 +67,25 @@
* fonts - available font paths for fonts
*/
Evas_List *fonts;
+
/**
* users - users known to the system
*/
- Evas_List *users;
+ struct
+ {
+ Evas_Hash *hash;
+ Evas_List *keys;
+ } users;
+
/**
- * sessions - a Title string to xsession mapping
+ * sessions - sessions known to the system
*/
- 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;
+ struct
+ {
+ Evas_Hash *hash;
+ Evas_Hash *icons;
+ Evas_List *keys;
+ } sessions;
};
typedef struct _Entrance_Config *Entrance_Config;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- entrance_session.c 21 Oct 2003 22:36:06 -0000 1.15
+++ entrance_session.c 22 Oct 2003 06:58:15 -0000 1.16
@@ -9,6 +9,8 @@
static Evas_Object *_entrance_session_icon_load(Evas_Object * o, char *file);
static Evas_Object *_entrance_session_load_session(Entrance_Session e,
char *key);
+static Evas_Object *_entrance_session_user_load(Entrance_Session e,
+ char *key);
/**
* entrance_session_new: allocate a new Entrance_Session
@@ -138,7 +140,7 @@
/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)))
+ (char *) evas_hash_find(e->config->sessions.hash, e->session)))
snprintf(buf, PATH_MAX, "%s %s", ENTRANCE_XSESSION, session_key);
else
snprintf(buf, PATH_MAX, "%s", ENTRANCE_XSESSION); /* Default
@@ -215,7 +217,7 @@
if (!e || !key)
return;
- if ((str = evas_hash_find(e->config->sessions, key)))
+ if ((str = evas_hash_find(e->config->sessions.hash, key)))
{
snprintf(buf, PATH_MAX, "%s", key);
if (strcmp(key, e->session))
@@ -270,7 +272,7 @@
e_container_direction_set(container, 1);
}
- for (l = e->config->keys; l; l = l->next)
+ for (l = e->config->sessions.keys; l; l = l->next)
{
key = (char *) l->data;
if ((edje = _entrance_session_load_session(e, key)))
@@ -281,6 +283,106 @@
edje_object_part_swallow(e->edje, "EntranceSessionList", container);
}
}
+void
+entrance_session_user_list_add(Entrance_Session e)
+{
+ Evas_Coord w, h;
+ char *key = NULL;
+ Evas_List *l = NULL;
+ Evas_Object *container = NULL, *edje;
+
+ if (!e || !e->edje)
+ return;
+ edje_object_part_geometry_get(e->edje, "EntranceUserList", 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);
+ }
+#if 0
+ entrance_swallow_users_to_container(container, cfg);
+#endif
+ for (l = e->config->users.keys; l; l = l->next)
+ {
+ key = (char *) l->data;
+ if ((edje = _entrance_session_user_load(e, key)))
+ {
+ e_container_element_append(container, edje);
+ }
+ }
+ edje_object_part_swallow(e->edje, "EntranceUserList", container);
+ }
+
+}
+
+/*
+ *
+ */
+static char *
+_entrance_session_path_resolve(Entrance_Session e, char *prefix, char *key)
+{
+ return (NULL);
+}
+
+static Evas_Object *
+_entrance_session_user_load(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);
+
+ if ((icon = evas_hash_find(e->config->users.hash, key)))
+ {
+ fprintf(stderr, "%s:%s\n", key, icon);
+ edje = edje_object_add(evas_object_evas_get(e->edje));
+ snprintf(buf, PATH_MAX, "%s/users/%s", PACKAGE_DATA_DIR, icon);
+ if ((result = edje_object_file_set(edje, buf, "User")) > 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, "EntranceUser"))
+ {
+ edje_object_part_text_set(edje, "EntranceUser", key);
+ }
+ else
+ {
+ if (o)
+ evas_object_del(o);
+ if (edje)
+ evas_object_del(edje);
+ edje = NULL;
+ }
+ 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);
+
+}
static Evas_Object *
_entrance_session_icon_load(Evas_Object * o, char *file)
{
@@ -335,7 +437,7 @@
if (edje_object_part_exists(edje, "EntranceSessionIcon"))
{
- icon = (char *) evas_hash_find(e->config->icons, key);
+ icon = (char *) evas_hash_find(e->config->sessions.icons, key);
o = _entrance_session_icon_load(e->edje, icon);
if (!strcmp(evas_object_type_get(o), "image"))
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- main.c 21 Oct 2003 10:19:10 -0000 1.13
+++ main.c 22 Oct 2003 06:58:15 -0000 1.14
@@ -452,38 +452,6 @@
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);
- }
-}
-
/**
* main - where it all starts !
*/
@@ -639,7 +607,7 @@
}
if (edje_object_part_exists(edje, "EntranceUserList"))
{
- entrance_user_list_add(edje, session->config);
+ entrance_session_user_list_add(session);
}
edje_object_signal_callback_add(edje, "EntranceUserAuthSuccessDone", "",
done_cb, e);
-------------------------------------------------------
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