entrance: added new fields to the events

Those fields are here to sent the pools seperated from config.
This commit is contained in:
Marcel Hollerbach 2014-05-14 11:54:07 +02:00
parent 9cb1f109e2
commit 12bc0f45c9
2 changed files with 58 additions and 0 deletions

View File

@ -12,6 +12,7 @@
#define ENTRANCE_EVENT_ACTION_NAME "EntranceEventAction"
#define ENTRANCE_EVENT_CONF_GUI_NAME "EntranceEventConfGui"
#define ENTRANCE_EVENT_CONF_USER_NAME "EntranceEventConfUser"
#define ENTRANCE_EVENT_POOLS_NAME "EntranceEventPools"
static Eina_Bool _entrance_event_type_set(const char *type, void *data, Eina_Bool unknow);
static const char *_entrance_event_type_get(const void *data, Eina_Bool *unknow);
@ -61,6 +62,8 @@ _entrance_event_type_set(const char *type, void *data, Eina_Bool unknow)
*ev = ENTRANCE_EVENT_ACTION;
else if (!strcmp(type, ENTRANCE_EVENT_CONF_GUI_NAME))
*ev = ENTRANCE_EVENT_CONF_GUI;
else if (!strcmp(type, ENTRANCE_EVENT_POOLS_NAME))
*ev = ENTRANCE_EVENT_POOLS;
else
{
printf("error on type set %s\n", type);
@ -92,6 +95,8 @@ _entrance_event_type_get(const void *data, Eina_Bool *unknow)
return ENTRANCE_EVENT_ACTION_NAME;
else if (*ev == ENTRANCE_EVENT_CONF_GUI)
return ENTRANCE_EVENT_CONF_GUI_NAME;
else if (*ev == ENTRANCE_EVENT_POOLS)
return ENTRANCE_EVENT_POOLS_NAME;
else
{
printf("error on type get %d\n", *ev);
@ -279,6 +284,41 @@ _entrance_event_action_dd(void)
action, EET_T_UCHAR);
return edd;
}
static Eet_Data_Descriptor *
_entrance_event_user_pool_dd(void)
{
Eet_Data_Descriptor *edd, *eddi;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Entrance_User_Pool);
edd = eet_data_descriptor_stream_new(&eddc);
eddi = _entrance_event_image_dd();
EET_DATA_DESCRIPTOR_ADD_BASIC(edd, Entrance_User_Pool, "name",
name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_LIST(edd, Entrance_User_Pool, "icon_pool",
icon_pool, eddi);
EET_DATA_DESCRIPTOR_ADD_LIST(edd, Entrance_User_Pool, "background_pool",
background_pool, eddi);
return edd;
}
static Eet_Data_Descriptor *
_entrance_event_pools_dd(void)
{
Eet_Data_Descriptor *edd, *eddi, *eddup;
Eet_Data_Descriptor_Class eddc;
EET_EINA_STREAM_DATA_DESCRIPTOR_CLASS_SET(&eddc, Entrance_Pools);
edd = eet_data_descriptor_stream_new(&eddc);
eddi = _entrance_event_image_dd();
eddup = _entrance_event_user_pool_dd();
EET_DATA_DESCRIPTOR_ADD_LIST(edd, Entrance_Pools, "icon_pool",
icon_pool, eddi);
EET_DATA_DESCRIPTOR_ADD_LIST(edd, Entrance_Pools, "background_pool",
background_pool, eddi);
EET_DATA_DESCRIPTOR_ADD_LIST(edd, Entrance_Pools, "user_pools",
user_pools, eddup);
return edd;
}
static Eet_Data_Descriptor *
_entrance_event_new(void)
@ -313,6 +353,8 @@ _entrance_event_new(void)
_entrance_event_action_dd());
EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_CONF_GUI_NAME,
_entrance_event_conf_gui_dd());
EET_DATA_DESCRIPTOR_ADD_MAPPING(unified, ENTRANCE_EVENT_POOLS_NAME,
_entrance_event_pools_dd());
EET_DATA_DESCRIPTOR_ADD_UNION(edd, Entrance_Event, "event",
event, type, unified);

View File

@ -13,6 +13,7 @@ typedef enum Entrance_Event_Type_
ENTRANCE_EVENT_ACTION,
ENTRANCE_EVENT_MAXTRIES,
ENTRANCE_EVENT_CONF_GUI,
ENTRANCE_EVENT_POOLS
} Entrance_Event_Type;
typedef struct Entrance_Xsession_
@ -99,6 +100,20 @@ typedef struct Entrance_Login_
Eina_List *background_pool;
} Entrance_Login;
typedef struct Entrance_User_Pool_
{
const char *name;
Eina_List *icon_pool;
Eina_List *background_pool;
} Entrance_User_Pool;
typedef struct Entrance_Pools_
{
Eina_List *icon_pool;
Eina_List *background_pool;
Eina_List *user_pools;
} Entrance_Pools;
typedef struct Entrance_Event_
{
Entrance_Event_Type type;
@ -113,6 +128,7 @@ typedef struct Entrance_Event_
Entrance_Actions_Event actions;
Entrance_Action_Event action;
Entrance_Conf_Gui_Event conf_gui;
Entrance_Pools pools;
} event;
} Entrance_Event;