Enlightenment CVS committal Author : atmosphere Project : e17 Module : apps/entrance
Dir : e17/apps/entrance/src/client Modified Files: entrance_session.c entrance_session.h main.c Log Message: o hush ipc when in testing mode o add scroller support for lists that are larger than list area. untested, but will in the next day or two, if it doesn't work yet, ignore it :) entrance.xsessions.list.scroller - xsession list edje dragable part entrance.users.list.scroller - user list edje dragable part (why the namespace change? DefinedPartsLikeThisAreMakingMeSick) (expect your entrance edjes to break soon and start to use the dot) o add container direction support for the user and xsession lists, default to vertical, possibly could hook it into a signal so you could toggle between the two, would be really easy actually. i'll do it when i update the namespace, keys go in your "Main" group btw data { item: "entrance.xsessions.list.orientation" "horizontal"; item: "entrance.users.list.orientation" "horizontal"; } o add xsession and user Evas_Object members to the Entrance_Session struct o entrance_session_list_add -> entrance_session_xsession_list_add o remove padding from user list fixups and more work to come this week. =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -3 -r1.62 -r1.63 --- entrance_session.c 6 Dec 2004 10:32:08 -0000 1.62 +++ entrance_session.c 7 Dec 2004 02:45:30 -0000 1.63 @@ -480,13 +480,13 @@ } /** - * entrance_session_list_add : fine the "EntranceSessionList" part in the + * entrance_session_xsession_list_add : fine the "EntranceSessionList" part in the * main edje, setup the container to hold the elements, and create session * edjes for the container based on our session list in the config * @param e - the entrance session you want to add the xsession list to */ void -entrance_session_list_add(Entrance_Session * e) +entrance_session_xsession_list_add(Entrance_Session * e) { Evas_Coord w, h; Evas_List *l = NULL; @@ -530,6 +530,23 @@ } } edje_object_part_swallow(e->edje, "EntranceSessionList", container); + e->session_container = container; + } +} +void +entrance_session_list_direction_set(Entrance_Session * e, + Evas_Object * container, + const char *direction) +{ + if (!e || !e->edje || !container || !direction) + return; + if (!strcmp(direction, "horizontal")) + { + esmart_container_direction_set(container, 0); + } + else + { + esmart_container_direction_set(container, 1); } } @@ -555,8 +572,8 @@ &h); if ((container = esmart_container_new(evas_object_evas_get(e->edje)))) { - esmart_container_padding_set(container, 4, 4, 4, 4); - esmart_container_spacing_set(container, 4); + esmart_container_padding_set(container, 0, 0, 0, 0); + esmart_container_spacing_set(container, 0); esmart_container_move_button_set(container, 2); if (w > h) { @@ -581,6 +598,7 @@ } } edje_object_part_swallow(e->edje, "EntranceUserList", container); + e->user_container = container; } } =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/entrance_session.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -3 -r1.19 -r1.20 --- entrance_session.h 4 Dec 2004 19:47:10 -0000 1.19 +++ entrance_session.h 7 Dec 2004 02:45:30 -0000 1.20 @@ -29,6 +29,8 @@ char *session; /* the current session in context */ Ecore_Evas *ee; /* the ecore_evas */ Evas_Object *edje; /* the main theme edje */ + Evas_Object *user_container; + Evas_Object *session_container; Entrance_Auth *auth; /* encapsulated auth info */ Entrance_Config *config; /* configuration options */ @@ -52,7 +54,10 @@ void entrance_session_start_user_session(Entrance_Session * e); void entrance_session_edje_object_set(Entrance_Session * e, Evas_Object * obj); -void entrance_session_list_add(Entrance_Session * e); +void entrance_session_xsession_list_add(Entrance_Session * e); +void entrance_session_list_direction_set(Entrance_Session * e, + Evas_Object * container, + const char *orient); void entrance_session_user_list_add(Entrance_Session * e); Entrance_X_Session *entrance_session_x_session_default_get(Entrance_Session * e); =================================================================== RCS file: /cvsroot/enlightenment/e17/apps/entrance/src/client/main.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -3 -r1.60 -r1.61 --- main.c 6 Dec 2004 12:41:39 -0000 1.60 +++ main.c 7 Dec 2004 02:45:30 -0000 1.61 @@ -10,6 +10,7 @@ #include <string.h> #include <Edje.h> #include <Esmart/Esmart_Text_Entry.h> +#include <Esmart/Esmart_Container.h> #include "entrance.h" #include "entrance_session.h" #include "entrance_x_session.h" @@ -33,7 +34,7 @@ edje_freeze(); return 1; } - + /** * get the hostname of the machine, surrounded by the before and after @@ -473,6 +474,36 @@ } } +static void +_container_scroll(void *data, Evas_Object * o, const char *emission, + const char *source) +{ + double sx = 0.0, sy = 0.0; + Evas_Object *container = NULL; + + if ((container = data)) + { + double container_length = 0.0; + + container_length = esmart_container_elements_length_get(container); + edje_object_part_drag_value_get(session->edje, source, &sx, &sy); + switch (esmart_container_direction_get(container)) + { + case CONTAINER_DIRECTION_HORIZONTAL: + esmart_container_scroll_offset_set(container, + (int) (sx * container_length)); + break; + case CONTAINER_DIRECTION_VERTICAL: + esmart_container_scroll_offset_set(container, + (int) (sy * container_length)); + break; + default: + fprintf(stderr, "Unknown Container Orientation\n"); + break; + } + } +} + /** * print the "Help" associated with the app, shows cli args etc * @param argv the argv that was passed from the application @@ -578,6 +609,7 @@ Evas_Coord x, y, w, h; char *entries[] = { "EntranceUserEntry", "EntrancePassEntry" }; int entries_count = 2; + const char *container_orientation = NULL; int c; struct option d_opt[] = { {"help", 0, 0, 'h'}, @@ -671,15 +703,18 @@ } } - if (!entrance_ipc_init(server_pid)) - return -1; + if (!testing) + if (!entrance_ipc_init(server_pid)) + return -1; session = entrance_session_new(config, display, testing); if (config) free(config); +#if 0 printf("entrance: main: XAUTHORITY = %s\n", getenv("XAUTHORITY")); +#endif #if 1 if (!ecore_x_init(display)) @@ -698,7 +733,7 @@ #endif ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, exit_cb, NULL); ecore_idle_enterer_add(idler_before_cb, NULL); - + if (ecore_evas_init()) { edje_init(); @@ -837,13 +872,36 @@ the session list if it exists. */ if (edje_object_part_exists(edje, "EntranceSessionList")) { - entrance_session_list_add(session); + entrance_session_xsession_list_add(session); + if ((container_orientation = + edje_object_data_get(edje, + "entrance.xsessions.list.orientation"))) + { + entrance_session_list_direction_set(session, + session->session_container, + container_orientation); + } + edje_object_signal_callback_add(edje, "drag", + "entrance.xsessions.list.scroller", + _container_scroll, + session->session_container); } /* See if we have an EntranceUserList part, tell the session to load the user list if it exists. */ if (edje_object_part_exists(edje, "EntranceUserList")) { entrance_session_user_list_add(session); + if ((container_orientation = + edje_object_data_get(edje, "entrance.users.list.orientation"))) + { + entrance_session_list_direction_set(session, + session->user_container, + container_orientation); + } + edje_object_signal_callback_add(edje, "drag", + "entrance.users.list.scroller", + _container_scroll, + session->user_container); } /** @@ -884,7 +942,8 @@ entrance_session_free(session); ecore_evas_shutdown(); } - entrance_ipc_shutdown(); + if (!testing) + entrance_ipc_shutdown(); edje_shutdown(); ecore_x_shutdown(); ecore_shutdown(); ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/ _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs