Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/entrance
Dir : e17/apps/entrance/src/client Modified Files: EvasTextEntry.c entrance_config.c entrance_config.h entrance_session.c main.c Log Message: don't delete the edje if you set a new text part in text entry smart object, fixed entrance_config_print, the config system was incorrectly handling the list/hash association for users, changed some of the internal structure of the config system, youll have to rebuild your config dbs =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/EvasTextEntry.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -3 -r1.6 -r1.7 --- EvasTextEntry.c 23 Feb 2004 00:36:05 -0000 1.6 +++ EvasTextEntry.c 7 Mar 2004 03:51:33 -0000 1.7 @@ -5,6 +5,7 @@ #include <stdlib.h> #include "EvasTextEntry.h" +#define DEBUG 1 static Evas_Smart *evas_text_entry_smart_get(void); static void evas_text_entry_text_fix(Evas_Object * o); @@ -71,13 +72,13 @@ { Evas_Text_Entry *e = NULL; - e = evas_object_smart_data_get(o); - if (e->edje.o) - evas_object_del(e->edje.o); - e->edje.o = edje; - if (e->edje.part) - free(e->edje.part); - e->edje.part = strdup(part); + if ((e = evas_object_smart_data_get(o))) + { + e->edje.o = edje; + if (e->edje.part) + free(e->edje.part); + e->edje.part = strdup(part); + } } void @@ -126,6 +127,9 @@ } e->buf.index = strlen(e->buf.text); evas_text_entry_text_fix(o); +#if DEBUG + fprintf(stderr, "Text Set (%d) %s\n", e->buf.index, e->buf.text); +#endif } } @@ -224,7 +228,7 @@ evas_text_entry_text_set(data, ""); break; default: -#if 0 +#if DEBUG fprintf(stderr, "(%d) is the key value\n", (int) evx->keyname[0]); #endif @@ -256,13 +260,19 @@ break; case 13: /* \r */ if (entry->return_key.func) + { entry->return_key.func(entry->return_key.arg, entry->buf.text); +#if DEBUG + fprintf(stderr, "Buffer Length %d\n", + strlen(entry->buf.text)); +#endif + } break; default: evas_text_entry_buffer_char_append(data, evx->key_compose[0]); -#if 0 +#if DEBUG fprintf(stderr, "(%d) is the key_compose value\n", (int) evx->key_compose[0]); #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- entrance_config.c 3 Mar 2004 20:08:47 -0000 1.18 +++ entrance_config.c 7 Mar 2004 03:51:33 -0000 1.19 @@ -40,11 +40,6 @@ return; /* strings 'n things */ - if ((str = e_db_str_get(db, "/entrance/engine"))) - e->engine = str; - else - e->engine = strdup("software"); - if ((str = e_db_str_get(db, "/entrance/theme"))) e->theme = str; else @@ -72,6 +67,17 @@ e->time.string = str; else e->time.string = strdup("%l:%M:%S %p"); + /* ints */ + if (!e_db_int_get(db, "/entrance/user/remember", &e->users.remember)) + e->users.remember = 1; + if (!e_db_int_get(db, "/entrance/user/remember_n", &e->users.remember_n)) + e->users.remember_n = 5; + if (!e_db_int_get(db, "/entrance/engine", &e->engine)) + e->engine = 0; + if (!e_db_int_get(db, "/entrance/system/reboot", &(e->reboot))) + e->reboot = 0; + if (!e_db_int_get(db, "/entrance/system/halt", &(e->halt))) + e->halt = 0; if (e_db_int_get(db, "/entrance/user/count", &num_user)) { Entrance_User *eu = NULL; @@ -92,7 +98,7 @@ if ((eu = entrance_user_new(user, icon, session))) { e->users.hash = evas_hash_add(e->users.hash, user, eu); - e->users.keys = evas_list_append(e->users.keys, eu); + e->users.keys = evas_list_append(e->users.keys, user); } else { @@ -110,10 +116,6 @@ { syslog(LOG_WARNING, "Warning: No users found."); } - if (!e_db_int_get(db, "/entrance/user/remember", &e->users.remember)) - e->users.remember = 1; - if (!e_db_int_get(db, "/entrance/user/remember_n", &e->users.remember_n)) - e->users.remember_n = 5; /* session hash and font list */ if (e_db_int_get(db, "/entrance/session/count", &num_session)) @@ -168,13 +170,9 @@ /* auth info */ + 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; - if (!e_db_int_get(db, "/entrance/system/halt", &(e->halt.allow))) - e->halt.allow = 0; - if (e->auth != ENTRANCE_USE_PAM) { /* check whether /etc/shadow can be used for authentication */ @@ -218,21 +216,64 @@ return (e); } -/*void -entrance_config_print(Entrance_Config e) +void +entrance_config_print(Entrance_Config * e) { - fprintf(stderr, - "%s is the background\n" - "%s is the welcomeage\n%s is the message fontname\n" - "%d is the fontsize{%d,%d,%d,%d}\n" - "%s is the passwdage\n%s is the passwd fontname\n" - "%d is the fontsize{%d,%d,%d,%d}\n", e->bg, e->welcome, - e->welcome.font.name, e->welcome.font.size, e->welcome.font.r, - e->welcome.font.g, e->welcome.font.b, e->welcome.font.a, - e->passwd, e->passwd.font.name, e->passwd.font.size, - e->passwd.font.r, e->passwd.font.g, e->passwd.font.b, - e->passwd.font.a); -}*/ + int i = 0; + char *str = NULL; + Entrance_User *eu; + Evas_List *l = NULL; + char *strings[] = { "Theme Edje %s\n", + "Pointer Image %s\n", "Date Format %s\n", "Time Format %s\n", + "Greeting Before %s\n", "Greeting After %s\n" + }; + char *values[] = { e->theme, e->pointer, e->date.string, + e->time.string, e->before.string, e->after.string + }; + int ssize = sizeof(strings) / sizeof(char *); + + char *intstrings[] = { "Use Evas GL %d\n", "Allow reboot %d\n", + "Allow Shutdown %d\n", + "Remember Users who login %d\n", + "Number of users to remember %d\n", + "Authentication Mode %d\n" + }; + int intvalues[] = { e->engine, e->reboot, e->halt, e->users.remember, + e->users.remember_n, e->auth + }; + int intsize = sizeof(intstrings) / sizeof(int); + + char *userstrings[] = { "\nUsername %s\n", "XSession %s\n", + "Icon file %s\n" + }; + + for (i = 0; i < ssize; i++) + { + printf(strings[i], values[i]); + } + for (i = 0; i < intsize; i++) + { + printf(intstrings[i], intvalues[i]); + } + for (l = e->users.keys; l; l = l->next) + { + if ((eu = evas_hash_find(e->users.hash, (char *) l->data))) + { + printf(userstrings[0], eu->name); + printf(userstrings[1], eu->session); + printf(userstrings[2], eu->icon); + + } + } + for (l = e->sessions.keys; l; l = l->next) + { + printf("\n%s\n", (char *) l->data); + if ((str = evas_hash_find(e->sessions.icons, (char *) l->data))) + printf("Session Icon File: %s\n", str); + if ((str = evas_hash_find(e->sessions.hash, (char *) l->data))) + printf("XSession exec string %s\n", str); + } +} /** * entrance_config_free Free up an Entrance_Config struct =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_config.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -3 -r1.12 -r1.13 --- entrance_config.h 3 Mar 2004 19:31:37 -0000 1.12 +++ entrance_config.h 7 Mar 2004 03:51:33 -0000 1.13 @@ -24,12 +24,6 @@ struct _Entrance_Config { /** - * engine - the evas rendering engine to use - * gl - OpenGL rendering engine - * software - The software rendering engine (default) - */ - char *engine; - /** * theme - the theme we want entrance ui to use */ char *theme; @@ -63,11 +57,25 @@ * ENTRANCE_USE_SHADOW- if set to use shadow auth if pam is not avail */ int auth; + /** + * engine - the evas rendering engine to use + * 1 - OpenGL rendering engine + * 0 - The software rendering engine (default) + */ + int engine; - struct - { - int allow; - } reboot, halt; + /** + * reboot - whether or not to allow themeable rebooting + * 1 - Allow Rebooting + * 0 - Disable theme rebooting + */ + int reboot; + /** + * halt - whether or not to allow themeable halting + * 1 - Allow Halting + * 0 - Disable theme halting + */ + int halt; /** * fonts - available font paths for fonts =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -3 -r1.36 -r1.37 --- entrance_session.c 3 Mar 2004 20:08:47 -0000 1.36 +++ entrance_session.c 7 Mar 2004 03:51:33 -0000 1.37 @@ -494,6 +494,7 @@ void entrance_session_user_list_add(Entrance_Session * e) { + char *str = NULL; Evas_Coord w, h; Entrance_User *key = NULL; Evas_List *l = NULL; @@ -520,10 +521,11 @@ } for (l = e->config->users.keys; l; l = l->next) { - key = (Entrance_User *) l->data; - if ((edje = entrance_user_edje_get(key, e->edje))) + str = (char *) l->data; + if ((key = evas_hash_find(e->config->users.hash, str))) { - e_container_element_append(container, edje); + if ((edje = entrance_user_edje_get(key, e->edje))) + e_container_element_append(container, edje); } } edje_object_part_swallow(e->edje, "EntranceUserList", container); @@ -692,7 +694,7 @@ { e->config->users.keys = evas_list_prepend(evas_list_remove - (e->config->users.keys, eu), eu); + (e->config->users.keys, eu), eu->name); entrance_config_user_list_write(e->config); return; } @@ -701,7 +703,8 @@ snprintf(buf, PATH_MAX, "default.eet"); if ((eu = entrance_user_new(e->auth->user, buf, e->session))) { - e->config->users.keys = evas_list_prepend(e->config->users.keys, eu); + e->config->users.keys = + evas_list_prepend(e->config->users.keys, eu->name); entrance_config_user_list_write(e->config); } } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v retrieving revision 1.39 retrieving revision 1.40 diff -u -3 -r1.39 -r1.40 --- main.c 5 Mar 2004 08:01:18 -0000 1.39 +++ main.c 7 Mar 2004 03:51:33 -0000 1.40 @@ -159,8 +159,8 @@ if (!entrance_auth_set_user(session->auth, str)) { edje_object_signal_emit(e->edje.o, "EntranceUserAuth", ""); - if((eu = evas_hash_find(session->config->users.hash, str))) - entrance_session_user_set(session, eu); + if ((eu = evas_hash_find(session->config->users.hash, str))) + entrance_session_user_set(session, eu); focus_swap(o, 0); } @@ -366,7 +366,7 @@ reboot_cb(void *data, Evas_Object * o, const char *emission, const char *source) { - if (session->config->reboot.allow) + if (session->config->reboot) { pid_t pid; @@ -406,7 +406,7 @@ { pid_t pid; - if (session->config->halt.allow) + if (session->config->halt) { entrance_session_free(session); session = NULL; @@ -675,10 +675,10 @@ /* 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")) + if (!session->config->engine) e = ecore_evas_software_x11_new(NULL, 0, 0, 0, g_x, g_y); #ifdef HAVE_ECORE_GL_X11 - else if (!strcmp(session->config->engine, "gl")) + else if (session->config->engine) e = ecore_evas_gl_x11_new(NULL, 0, 0, 0, g_x, g_y); #endif else ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs