Enlightenment CVS committal
Author : atmosphere
Project : e17
Module : apps/entrance
Dir : e17/apps/entrance/src/client
Modified Files:
entrance_login.c entrance_session.c entrance_session.h main.c
Log Message:
ran indent on raster's entrance_login code
fixup where default session was being incorrectly set if it was named
anything other than "Default"
explicitly use const in session funcs (they'll be around for the life
of the program and need not be copied or freed ever)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_login.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -3 -r1.1 -r1.2
--- entrance_login.c 3 Jan 2004 04:54:57 -0000 1.1
+++ entrance_login.c 4 Feb 2004 20:59:35 -0000 1.2
@@ -8,10 +8,12 @@
main(int argc, char **argv)
{
pid_t pid;
-
- if (argc != 2) return 0;
-
+
+ if (argc != 2)
+ return 0;
+
pid = atoi(argv[1]);
- if (waitpid(pid, NULL, 0) == pid) exit(0);
+ if (waitpid(pid, NULL, 0) == pid)
+ exit(0);
return -1;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- entrance_session.c 3 Jan 2004 04:54:57 -0000 1.29
+++ entrance_session.c 4 Feb 2004 20:59:35 -0000 1.30
@@ -19,11 +19,12 @@
const char *emission, const char *source);
extern void user_unselected_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_icon_load(Evas_Object * o,
+ const char *file);
static Evas_Object *_entrance_session_load_session(Entrance_Session * e,
- char *key);
+ const char *key);
static Evas_Object *_entrance_session_user_load(Entrance_Session * e,
- char *key);
+ const char *key);
extern int _entrance_test_en;
@@ -307,12 +308,13 @@
sleep(10);
/* replace this rpcoess with a clean small one that just waits for its */
/* child to exit.. passed on the cmd-line */
- snprintf(buf, sizeof(buf), "%s/entrance_login %i", PACKAGE_BIN_DIR, (int)pid);
+ snprintf(buf, sizeof(buf), "%s/entrance_login %i", PACKAGE_BIN_DIR,
+ (int) pid);
execl("/bin/sh", "/bin/sh", "-c", buf, NULL);
}
static void
-entrance_session_xsession_load(Entrance_Session * e, char *key)
+entrance_session_xsession_load(Entrance_Session * e, const char *key)
{
if (e && e->edje)
{
@@ -335,7 +337,7 @@
}
void
-entrance_session_xsession_set(Entrance_Session * e, char *key)
+entrance_session_xsession_set(Entrance_Session * e, const char *key)
{
char *str = NULL;
char buf[PATH_MAX];
@@ -373,7 +375,7 @@
entrance_session_list_add(Entrance_Session * e)
{
Evas_List *l = NULL;
- char *key = NULL;
+ const char *key = NULL;
Evas_Coord w, h;
Evas_Object *edje = NULL;
Evas_Object *container = NULL;
@@ -400,7 +402,7 @@
for (l = e->config->sessions.keys; l; l = l->next)
{
- key = (char *) l->data;
+ key = (const char *) l->data;
if ((edje = _entrance_session_load_session(e, key)))
{
e_container_element_append(container, edje);
@@ -449,8 +451,23 @@
}
+const char *
+entrance_session_default_xsession_get(Entrance_Session * e)
+{
+ Evas_List *l = NULL;
+ const char *result = NULL;
+
+ if (e && e->config)
+ {
+ if ((l = e->config->sessions.keys))
+ {
+ result = (const char *) l->data;
+ }
+ }
+ return (result);
+}
static Evas_Object *
-_entrance_session_user_load(Entrance_Session * e, char *key)
+_entrance_session_user_load(Entrance_Session * e, const char *key)
{
int result = 0;
char *icon = NULL;
@@ -482,9 +499,9 @@
edje_object_part_text_set(edje, "EntranceUser", key);
evas_object_show(edje);
edje_object_signal_callback_add(edje, "UserSelected", "",
- user_selected_cb, key);
+ user_selected_cb, (char *) key);
edje_object_signal_callback_add(edje, "UserUnSelected", "",
- user_unselected_cb, key);
+ user_unselected_cb, (char *) key);
}
else
{
@@ -507,7 +524,7 @@
}
static Evas_Object *
-_entrance_session_icon_load(Evas_Object * o, char *file)
+_entrance_session_icon_load(Evas_Object * o, const char *file)
{
Evas_Object *result = NULL;
char buf[PATH_MAX];
@@ -538,7 +555,7 @@
}
static Evas_Object *
-_entrance_session_load_session(Entrance_Session * e, char *key)
+_entrance_session_load_session(Entrance_Session * e, const char *key)
{
int result = 0;
char *icon = NULL;
@@ -590,7 +607,7 @@
edje_object_part_text_set(edje, "EntranceSessionTitle", key);
}
edje_object_signal_callback_add(edje, "SessionSelected", "",
- session_item_selected_cb, key);
+ session_item_selected_cb, (char *) key);
evas_object_show(edje);
}
else
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- entrance_session.h 23 Dec 2003 02:43:12 -0000 1.10
+++ entrance_session.h 4 Feb 2004 20:59:35 -0000 1.11
@@ -36,10 +36,12 @@
void entrance_session_user_reset(Entrance_Session * e);
void entrance_session_user_set(Entrance_Session * e, char *user);
void entrance_session_start_user_session(Entrance_Session * e);
-void entrance_session_xsession_set(Entrance_Session * e, char *xsession);
+void entrance_session_xsession_set(Entrance_Session * e,
+ const char *xsession);
void entrance_session_edje_object_set(Entrance_Session * e,
Evas_Object * obj);
void entrance_session_list_add(Entrance_Session * e);
void entrance_session_user_list_add(Entrance_Session * e);
+const char *entrance_session_default_xsession_get(Entrance_Session * e);
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -3 -r1.31 -r1.32
--- main.c 14 Jan 2004 17:18:33 -0000 1.31
+++ main.c 4 Feb 2004 20:59:35 -0000 1.32
@@ -726,7 +726,9 @@
}
if (edje_object_part_exists(edje, "EntranceSession"))
{
- entrance_session_xsession_set(session, "Default");
+ entrance_session_xsession_set(session,
+ entrance_session_default_xsession_get
+ (session));
}
if (edje_object_part_exists(edje, "EntranceSessionList"))
{
-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs