e_slot and e_splitlayout are not used anymore.
They are deprecated.
Change-Id: I4434c0db552779fda4f976b99f9fabd19ec18748
src/bin/e_scale.h \
src/bin/e_screensaver.h \
src/bin/e_signals.h \
-src/bin/e_slot.h \
-src/bin/e_splitlayout.h \
src/bin/e_test_helper.h \
src/bin/e_theme.h \
src/bin/e_user.h \
src/bin/e_scale.c \
src/bin/e_screensaver.c \
src/bin/e_signals.c \
-src/bin/e_slot.c \
-src/bin/e_splitlayout.c \
src/bin/e_test_helper.c \
src/bin/e_theme.c \
src/bin/e_user.c \
unsigned char visible : 1;
unsigned int deskshow_toggle : 1;
Eina_List *fullscreen_clients;
- Evas_Object *layout; /* Desk's splitlayout*/
Evas_Object *bg_object;
Evas_Object *smart_obj;
#include "e_appinfo.h"
#include "e_magnifier.h"
#include "e_process.h"
-#include "e_splitlayout.h"
-#include "e_slot.h"
#include "e_privilege.h"
#include "e_security.h"
#include "e_main.h"
}
static void
-_cb_window_proc_slot_get(const Eldbus_Message *msg)
-{
- const char *name = NULL, *text = NULL;
- Eina_Bool res;
- Eldbus_Message_Iter *array, *ec;
-
- res = eldbus_message_error_get(msg, &name, &text);
- EINA_SAFETY_ON_TRUE_GOTO(res, finish);
-
- res = eldbus_message_arguments_get(msg, "a(ss)", &array);
- EINA_SAFETY_ON_FALSE_GOTO(res, finish);
-
- printf("--------------------------------------[ slot info ]-----------------------------------------------------\n");
- int cnt = 0;
- int client_cnt = 0;
- while (eldbus_message_iter_get_and_next(array, 'r', &ec))
- {
- const char *title;
- const char *value;
- res = eldbus_message_iter_arguments_get(ec,
- "ss",
- &title,
- &value);
- if (!res)
- {
- printf("Failed to get slot info\n");
- continue;
- }
-
- if (!strcmp(title, "[SLOT LIST]"))
- {
- printf("[%02d] %s\n", ++cnt, value ? value : " ");
- client_cnt = 0;
- }
- else if (!strcmp(title, "[SLOT CLIENT]"))
- {
- printf("\t\t|---[%02d] %s\n", ++client_cnt, value ? value : " ");
- }
- else if (!strcmp(title, "[SLOT INFO]"))
- {
- printf("::: %s\n", value ? value : " ");
- }
- }
-finish:
- if ((name) || (text ))
- {
- printf("errname:%s errmsg:%s\n", name, text);
- }
-}
-
-
-static void
-_e_info_client_proc_slot_set(int argc, char **argv)
-{
- int32_t param[5];
- int i;
- int mode = 0;
- const char *value = NULL;
- Eina_Bool res = EINA_FALSE;
-
- if (argc < 3)
- {
- printf("\t\t\t %s\n", USAGE_SLOT);
- return;
- }
-
- /* check mode */
- if (strlen(argv[2]) > 2)
- {
- mode = -1;
- if (!strncmp(argv[2], "start", strlen("start"))) mode = E_INFO_CMD_MESSAGE_START;
- if (!strncmp(argv[2], "list", strlen("list"))) mode = E_INFO_CMD_MESSAGE_LIST;
- if (!strncmp(argv[2], "create", strlen("create"))) mode = E_INFO_CMD_MESSAGE_CREATE;
- if (!strncmp(argv[2], "modify", strlen("modify"))) mode = E_INFO_CMD_MESSAGE_MODIFY;
- if (!strncmp(argv[2], "del", strlen("del"))) mode = E_INFO_CMD_MESSAGE_DEL;
- if (!strncmp(argv[2], "raise", strlen("raise"))) mode = E_INFO_CMD_MESSAGE_RAISE;
- if (!strncmp(argv[2], "lower", strlen("lower"))) mode = E_INFO_CMD_MESSAGE_LOWER;
- if (!strncmp(argv[2], "add_ec_t", strlen("add_ec_t"))) mode = E_INFO_CMD_MESSAGE_ADD_EC_TRANSFORM;
- if (!strncmp(argv[2], "add_ec_r", strlen("add_ec_r"))) mode = E_INFO_CMD_MESSAGE_ADD_EC_RESIZE;
- if (!strncmp(argv[2], "del_ec", strlen("del_ec"))) mode = E_INFO_CMD_MESSAGE_DEL_EC;
- if (!strncmp(argv[2], "focus", strlen("focus"))) mode = E_INFO_CMD_MESSAGE_FOCUS;
- }
- else
- {
- printf("Error Check Args!\n");
- return;
- }
-
- param[0] = 0;
- param[1] = 0;
- param[2] = 0;
- param[3] = 0;
- param[4] = 0;
-
- for (i = 0; (i < 5) && ((i+3) < argc); ++i)
- {
- param[i] = atoi(argv[i+3]);
- }
-
- if (mode == E_INFO_CMD_MESSAGE_ADD_EC_TRANSFORM ||
- mode == E_INFO_CMD_MESSAGE_ADD_EC_RESIZE ||
- mode == E_INFO_CMD_MESSAGE_DEL_EC)
- {
- value = argv[4];
- uint32_t value_number;
- if (strlen(value) >= 2 && value[0] == '0' && value[1] == 'x')
- res = _util_string_to_uint(value, &value_number, 16);
- else
- res = _util_string_to_uint(value, &value_number, 10);
-
- EINA_SAFETY_ON_FALSE_RETURN(res);
-
- param[1] = (int32_t)value_number;
- }
-
- if (!_e_info_client_eldbus_message_with_args("slot_message", _cb_window_proc_slot_get, "iiiiii",
- mode, param[0] , param[1], param[2],
- param[3], param[4]))
- {
- printf("_e_info_client_eldbus_message_with_args error");
- return;
- }
-}
-
-static void
_e_info_client_proc_desk(int argc, char **argv)
{
const int offset = 2, cmd_len = 1;
_e_info_client_proc_scrsaver
},
{
- "slot",
- USAGE_SLOT,
- "Set slot in runtime",
- _e_info_client_proc_slot_set
- },
- {
"desk",
USAGE_DESK,
"Set geometry or zoom for current desktop",
}
static Eldbus_Message *
-e_info_server_cb_slot_message(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
-{
- Eldbus_Message *reply = eldbus_message_method_return_new(msg);
- int32_t param[5];
-
- uint32_t slot_id = 0;
- uint32_t x, y, w, h, mode;
- int32_t win_id = 0;
- Eina_Bool start_split = EINA_FALSE;
- Evas_Object *o, *slot;
- E_Client *ec = NULL;
- Ecore_Window win = 0;
-
- Eldbus_Message_Iter* struct_of_ec;
- Eldbus_Message_Iter *array_of_ec;
- Eldbus_Message_Iter *iter;
-
- if (!eldbus_message_arguments_get(msg, "iiiiii", &mode, ¶m[0], ¶m[1], ¶m[2], ¶m[3], ¶m[4]))
- {
- ERR("Error getting arguments.");
- return reply;
- }
-
- if (mode == E_INFO_CMD_MESSAGE_CREATE)
- {
- x = param[0];
- y = param[1];
- w = param[2];
- h = param[3];
- }
- else if (mode == E_INFO_CMD_MESSAGE_MODIFY)
- {
- slot_id = param[0];
- x = param[1];
- y = param[2];
- w = param[3];
- h = param[4];
- }
- else if (mode == E_INFO_CMD_MESSAGE_ADD_EC_TRANSFORM ||
- mode == E_INFO_CMD_MESSAGE_ADD_EC_RESIZE ||
- mode == E_INFO_CMD_MESSAGE_DEL_EC)
- {
- slot_id = param[0];
- win_id = param[1];
- }
- else if (mode == E_INFO_CMD_MESSAGE_START)
- {
- start_split = !!param[0];
- }
- else
- {
- slot_id = param[0];
- }
-
- iter = eldbus_message_iter_get(reply);
- eldbus_message_iter_arguments_append(iter, "a(ss)", &array_of_ec);
-#define __SLOT_ARG_APPEND_TYPE(title, str, x...) ({ \
- char __temp[128] = {0,}; \
- snprintf(__temp, sizeof(__temp), str, ##x); \
- eldbus_message_iter_arguments_append(array_of_ec, "(ss)", &struct_of_ec); \
- eldbus_message_iter_arguments_append(struct_of_ec, "ss", (title), (__temp)); \
- eldbus_message_iter_container_close(array_of_ec, struct_of_ec);})
-
- if (mode == E_INFO_CMD_MESSAGE_LIST)
- {
- Eina_List *slot_list;
- slot_list = e_slot_list_get();
-
- if (slot_list)
- {
- Eina_List *l;
- EINA_LIST_FOREACH(slot_list, l, slot)
- {
- if (slot)
- {
- int id = e_slot_find_id(slot);
- int eo_x, eo_y, eo_w, eo_h;
- evas_object_geometry_get(slot,&eo_x,&eo_y,&eo_w,&eo_h);
- __SLOT_ARG_APPEND_TYPE("[SLOT LIST]", "slot_id:%02d (%04d,%04d,%04dx%04d) \n", id, eo_x, eo_y, eo_w, eo_h);
-
- if (id)
- {
- Eina_List *ll, *clist;
- E_Client *ec = NULL;
- clist = e_slot_client_list_get(slot);
- EINA_LIST_FOREACH(clist, ll, ec)
- {
- if (ec)
- __SLOT_ARG_APPEND_TYPE("[SLOT CLIENT]", "slot_client win:%08zx name:%s \n", e_client_util_win_get(ec), e_client_util_name_get(ec) ?: "NO NAME");
- }
- }
- }
- }
- }
- else
- {
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "No slot.....\n");
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_CREATE)
- {
- E_Zone *zone = e_zone_current_get();
- E_Desk *desk = e_desk_current_get(zone);
- EINA_SAFETY_ON_NULL_GOTO(desk, finish);
-
- slot = e_slot_new(desk->layout);
- evas_object_move(slot, x, y);
- evas_object_resize(slot, w, h);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT CREATE] slot_id:%02d (%04d,%04d,%04dx%04d)\n", e_slot_find_id(slot), x, y, w, h );
- }
- else if (mode == E_INFO_CMD_MESSAGE_MODIFY)
- {
- slot = e_slot_find_by_id(slot_id);
- if (!slot) __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "no such slot(id %d)\n",slot_id);
- else
- {
- evas_object_move(slot, x, y);
- evas_object_resize(slot, w, h);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT MODIFY] slot_id:%02d (%04d,%04d,%04dx%04d)\n", slot_id, x, y, w, h );
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_DEL)
- {
- slot = e_slot_find_by_id(slot_id);
- if (!slot) __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "no such slot(id %d)\n", slot_id);
- else
- {
- //e_object_del(E_OBJECT(slot));
- e_slot_del(slot);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]","[SLOT DEL] slot_id:%02d\n", slot_id);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_RAISE)
- {
- slot = e_slot_find_by_id(slot_id);
- if (!slot) __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "no such slot(id %d)\n", slot_id);
- else
- {
- e_slot_raise(slot);
- e_slot_update(slot);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]","[SLOT RAISE] slot_id:%02d\n", slot_id);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_LOWER)
- {
- slot = e_slot_find_by_id(slot_id);
- if (!slot) __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "no such slot(id %d)\n", slot_id);
- else
- {
- e_slot_lower(slot);
- e_slot_update(slot);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]","[SLOT LOWER] slot_id:%02d\n", slot_id);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_ADD_EC_TRANSFORM)
- {
- slot = e_slot_find_by_id(slot_id);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- win = e_client_util_win_get(ec);
- if (win != win_id) continue;
- break;
- }
-
- if (ec)
- {
- e_slot_client_add(slot, ec, 0);
- e_slot_client_update(ec);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT ADD EC as transform] slot_id:%02d (%08zx)\n", slot_id, win);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_DEL_EC)
- {
- slot = e_slot_find_by_id(slot_id);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- win = e_client_util_win_get(ec);
- if (win != win_id) continue;
- break;
- }
-
- if (ec)
- {
- e_slot_client_remove(slot, ec);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT DEL EC] slot_id:%02d (%08zx)\n", slot_id, win);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_ADD_EC_RESIZE)
- {
- slot = e_slot_find_by_id(slot_id);
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- win = e_client_util_win_get(ec);
- if (win != win_id) continue;
- break;
- }
-
- if (ec)
- {
- e_slot_client_add(slot, ec, 1);
- e_slot_client_update(ec);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT ADD EC as resize] slot_id:%02d (%08zx)\n", slot_id, win);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_FOCUS)
- {
- slot = e_slot_find_by_id(slot_id);
- if (!slot) __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "no such slot(id %d)\n", slot_id);
- else
- {
- e_slot_focus_set(slot);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT FOCUS SET] slot_id:%02d\n", slot_id);
- }
- }
- else if (mode == E_INFO_CMD_MESSAGE_START)
- {
- E_Zone *zone = e_zone_current_get();
- E_Desk *desk = e_desk_current_get(zone);
- EINA_SAFETY_ON_NULL_GOTO(desk, finish);
-
- if (start_split) evas_object_raise(desk->layout);
- else evas_object_lower(desk->layout);
- //evas_object_show(desk->layout);
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "[SLOT %s]", start_split ? "START" : "STOP");
- }
- else
- {
- __SLOT_ARG_APPEND_TYPE("[SLOT INFO]", "Wrong command........\n");
- }
-
-finish:
- eldbus_message_iter_container_close(iter, array_of_ec);
- return reply;
-}
-
-static Eldbus_Message *
_e_info_server_cb_desktop_geometry_set(const Eldbus_Service_Interface *iface EINA_UNUSED, const Eldbus_Message *msg)
{
Eldbus_Message *reply = eldbus_message_method_return_new(msg);
{ "aux_hint_add", ELDBUS_ARGS({"s","window id" }, {"u", "hint id"}, {"s", "hint"}, {"s", "value"}), NULL, e_info_server_cb_aux_hint_add, 0},
{ "aux_hint_del", ELDBUS_ARGS({"s","window id" }, {"u", "hint id"}), NULL, e_info_server_cb_aux_hint_del, 0},
{ "scrsaver", ELDBUS_ARGS({SIGNATURE_SCRSAVER_CLIENT, "scrsaver_params"}), ELDBUS_ARGS({SIGNATURE_SCRSAVER_SERVER, "scrsaver_result"}), _e_info_server_cb_scrsaver, 0},
- { "slot_message", ELDBUS_ARGS({"iiiiii", "slot_message"}), ELDBUS_ARGS({"a(ss)", "array of ec"}), e_info_server_cb_slot_message, 0},
{ "desktop_geometry_set", ELDBUS_ARGS({"iiii", "Geometry"}), NULL, _e_info_server_cb_desktop_geometry_set, 0},
{ "desktop_window_control", ELDBUS_ARGS({"i", "Window Control option"}), NULL, _e_info_server_cb_desktop_window_control, 0},
{ "desk_zoom", ELDBUS_ARGS({"ddii", "Zoom"}), NULL, _e_info_server_cb_desk_zoom, 0},
*/
-#define USAGE_SLOT \
- "(start | list | create | modify | del \n" \
- "\t\t\t raise | lower | add_ec_t | add_ec_r | del_ec | focus\n" \
- "\n" \
- "Commands:\n" \
- "\tstart : Raise split layout [0:off, 1:on]\n" \
- "\tlist : List up slot objects and clients belong to\n" \
- "\tcreate : Create slot object according to geometry [x][y][w][h]\n" \
- "\tmodify : Modify given id's slot geometry [slot_id][x][y][w][h]\n" \
- "\tdel : Delete given id's slot object [slot_id]\n" \
- "\traise : Raise Clients stack in the slot [slot_id]\n" \
- "\tlower : Lower Clients stack in the slot [slot_id]\n" \
- "\tadd_ec_t : Add Client in the slot transforming [slot_id] [win_id]\n" \
- "\tadd_ec_r : Add Client in the slot resizing [slot_id] [win_id]\n" \
- "\tdel_ec : Delete Client in the slot [slot_id] [win_id]\n" \
- "\tfocus : Set foucs on top most Client in the slot [slot_id]\n" \
- "Example:\n" \
- "\tenlightenment_info -slot create 0 0 720 300\n" \
- "\tenlightenment_info -slot raise 1\n" \
- "\tenlightenment_info -slot add_ec_r 1 0xb88ffaa0\n"
-
-typedef enum
-{
- E_INFO_CMD_MESSAGE_LIST,
- E_INFO_CMD_MESSAGE_CREATE,
- E_INFO_CMD_MESSAGE_MODIFY,
- E_INFO_CMD_MESSAGE_DEL,
- E_INFO_CMD_MESSAGE_RAISE,
- E_INFO_CMD_MESSAGE_LOWER,
- E_INFO_CMD_MESSAGE_ADD_EC_TRANSFORM,
- E_INFO_CMD_MESSAGE_ADD_EC_RESIZE,
- E_INFO_CMD_MESSAGE_DEL_EC,
- E_INFO_CMD_MESSAGE_FOCUS,
- E_INFO_CMD_MESSAGE_START,
-} E_Info_Slot_Message;
-
#define USAGE_FORCE_RENDER \
"(all | cls | canvas)\n" \
"Commands:\n" \
e_screensaver_preinit();
e_zone_init();
e_desk_init();
- e_slot_init();
e_magnifier_init();
TRACE_DS_BEGIN(MAIN:WAIT /dev/dri/card0);
e_client_shutdown();
e_magnifier_shutdown();
- e_slot_shutdown();
e_desk_shutdown();
e_zone_shutdown();
return 1;
+++ /dev/null
-#include "e.h"
-
-/* global variables */
-#define SLOT_SMART_ENTRY Slot_Smart_Data *sd; sd = evas_object_smart_data_get(obj); if (!sd) return;
-#define SPLIT_DEBUG 0
-
-typedef enum _Slot_Client_Type
-{
- E_SLOT_CLIENT_TYPE_NORMAL = 0,
- E_SLOT_CLIENT_TYPE_TRANSFORM = 1
-}E_Slot_Client_Type;
-
-typedef struct _Slot_Smart_Data
-{
- Evas_Object *parent_obj; // smart_obj belong to
-
- Evas_Object *clip;
- Evas_Object *slot_layout;
- Evas_Object *bg_object; // for test
-
- Eina_List *clist; // E_Client list added on slot
-
- int x, y, w, h;
- int id;
- Eina_Bool changed;
-}Slot_Smart_Data;
-
-typedef struct _E_Slot_Client
-{
- E_Client *ec;
- Evas_Object *slot;
-
- struct
- {
- int x, y, w, h;
- } orig;
- int type;
- E_Util_Transform *transform;
-}E_Slot_Client;
-
-typedef struct _E_Slot_G
-{
- Eina_List *slot_objs;
- Eina_Hash *hash_slot_objs; // data : smart object , key: slot id
- Eina_Hash *hash_slot_clients; // data : E_Slot_Client, key: ec
-}E_Slot_G;
-
-static E_Slot_G *_e_slot_g = NULL;
-
-static int id = 0;
-
-static Evas_Smart *_e_slot_smart = NULL;
-
-
-/* static functions */
-static int _e_slot_generate_id(void);
-static E_Slot_Client* _e_slot_client_new(Evas_Object *obj, E_Client* ec, E_Slot_Client_Type type);
-static void _e_slot_client_del(E_Slot_Client* slot_client);
-static void _e_slot_client_restore_all(Evas_Object *obj);
-static Eina_Bool _e_slot_client_type_restore(E_Slot_Client* slot_client);
-
-static void
-_slot_smart_add(Evas_Object *obj)
-{
- Slot_Smart_Data *sd;
- Evas *e = evas_object_evas_get(obj);
-
- sd = E_NEW(Slot_Smart_Data, 1);
- if (EINA_UNLIKELY(!sd)) return;
-
- sd->clip = evas_object_rectangle_add(e);
- evas_object_move(sd->clip, 0, 0);
- evas_object_resize(sd->clip, 200002, 200002);
- evas_object_smart_member_add(sd->clip, obj);
-
- sd->slot_layout = e_layout_add(e);
- evas_object_clip_set(sd->slot_layout, sd->clip);
- e_layout_virtual_size_set(sd->slot_layout, e_comp->w, e_comp->h); // FIXME:
- evas_object_smart_member_add(sd->slot_layout, obj);
- evas_object_name_set(sd->slot_layout, "e_slot->slot_layout");
- evas_object_show(sd->slot_layout);
-
- sd->bg_object = evas_object_rectangle_add(e);
- evas_object_name_set(sd->bg_object, "e_slot->bg_object");
- evas_object_color_set(sd->bg_object, 0, 0, 0, 255);
-
- e_layout_pack(sd->slot_layout, sd->bg_object);
- e_layout_child_move(sd->bg_object, 0, 0);
-
- evas_object_show(sd->bg_object);
- evas_object_smart_data_set(obj, sd);
-}
-
-static void
-_slot_smart_del(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
-
- _e_slot_g->slot_objs = eina_list_remove(_e_slot_g->slot_objs, obj);
-
- _e_slot_client_restore_all(obj);
-
- eina_list_free(sd->clist);
- sd->clist = NULL;
-
- evas_object_del(sd->bg_object);
- evas_object_del(sd->slot_layout);
- if (sd->clip)
- {
- evas_object_clip_unset(sd->clip);
- evas_object_del(sd->clip);
- }
-
- free(sd);
-}
-
-static void
-_slot_smart_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
-{
- SLOT_SMART_ENTRY
-
- if ((sd->x == x) && (sd->y == y)) return;
-
- sd->x = x;
- sd->y = y;
-
- evas_object_move(sd->clip, x, y);
- evas_object_move(sd->slot_layout, x, y);
- evas_object_move(sd->bg_object, x, y);
-}
-
-static void
-_slot_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
-{
- SLOT_SMART_ENTRY
-
- sd->w = w;
- sd->h = h;
-
- evas_object_resize(sd->clip, w, h);
- evas_object_resize(sd->slot_layout, w, h);
- evas_object_resize(sd->bg_object, w, h);
-}
-
-static void
-_slot_smart_show(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
-
- evas_object_show(sd->bg_object);
- evas_object_show(sd->slot_layout);
- evas_object_show(sd->clip);
-}
-
-static void
-_slot_smart_hide(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
-
- evas_object_hide(sd->bg_object);
- evas_object_hide(sd->slot_layout);
- evas_object_hide(sd->clip);
-}
-
-static void
-_slot_smart_init(void)
-{
- if (_e_slot_smart) return;
- {
- static const Evas_Smart_Class sc =
- {
- "slot_smart",
- EVAS_SMART_CLASS_VERSION,
- _slot_smart_add,
- _slot_smart_del,
- _slot_smart_move,
- _slot_smart_resize,
- _slot_smart_show,
- _slot_smart_hide,
- NULL, /* color_set */
- NULL, /* clip_set */
- NULL, /* clip_unset */
- NULL, /* calculate */
- NULL, /* member_add */
- NULL, /* member_del */
-
- NULL, /* parent */
- NULL, /* callbacks */
- NULL, /* interfaces */
- NULL /* data */
- };
- _e_slot_smart = evas_smart_class_new(&sc);
- }
-}
-
-static void
-e_slot_layout_cb(void)
-{
- Eina_List *l;
- Evas_Object *obj = NULL;
- Slot_Smart_Data *sd = NULL;
-
- EINA_LIST_FOREACH(_e_slot_g->slot_objs, l, obj)
- {
- sd = evas_object_smart_data_get(obj);
- if (sd && sd->changed) e_slot_update(obj);
- }
-}
-
-EINTERN void
-e_slot_init(void)
-{
- ELOGF("SLOT", "e_slot_init", NULL);
- E_Slot_G *g = NULL;
- g = E_NEW(E_Slot_G, 1);
-
- EINA_SAFETY_ON_NULL_RETURN(g);
-
- g->hash_slot_objs = eina_hash_int32_new(NULL);
- g->hash_slot_clients = eina_hash_pointer_new(NULL);
- e_client_layout_cb_set(e_slot_layout_cb);
-
- _e_slot_g = g;
-}
-
-EINTERN int
-e_slot_shutdown(void)
-{
- ELOGF("SLOT", "e_slot_shutdown", NULL);
-
- E_FREE_FUNC(_e_slot_g->slot_objs, eina_list_free);
-
- E_FREE_FUNC(_e_slot_g->hash_slot_objs, eina_hash_free);
- E_FREE_FUNC(_e_slot_g->hash_slot_clients, eina_hash_free);
- E_FREE(_e_slot_g);
-
- return 1;
-}
-
-E_API Evas_Object *
-e_slot_new(Evas_Object *parent)
-{
- Evas_Object *o;
- Slot_Smart_Data *sd;
-
- _slot_smart_init();
- o = evas_object_smart_add(e_comp->evas, _e_slot_smart);
- sd = evas_object_smart_data_get(o);
- EINA_SAFETY_ON_NULL_RETURN_VAL(sd, NULL);
- sd->id = _e_slot_generate_id();
- sd->parent_obj = parent;
-
-#if SPLIT_DEBUG
- int r =100, b = 100, g = 100;
- if (sd->id % 2) {
- r = 255;
- evas_object_name_set(o, "red_slot->smart_obj");
- INF("------------------------------- RED RED RED %s (%d)", __FUNCTION__, __LINE__);
- }
- else {
- b = 255;
- INF("------------------------------- BLUE BLUE BLUE %s (%d)", __FUNCTION__, __LINE__);
- evas_object_name_set(o, "blue_slot->smart_obj");
- }
- evas_object_color_set(sd->bg_object, r, g, b, 255);
- evas_object_show(sd->bg_object);
- e_layout_child_move(sd->bg_object, 0, 0);
-#endif
-
- _e_slot_g->slot_objs = eina_list_append(_e_slot_g->slot_objs, o);
-
- eina_hash_add(_e_slot_g->hash_slot_objs, &sd->id, o);
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_add", o);
-
- evas_object_show(o);
-
- ELOGF("SLOT", "|Create new slot - id:%d ", NULL, sd->id);
- evas_object_data_set(o, "e_slot_object", (void*)1);
-
- return o;
-}
-
-E_API void
-e_slot_del(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
- ELOGF("SLOT", "|Remove slot - id:%d ", NULL, sd->id);
-
- eina_hash_del_by_key(_e_slot_g->hash_slot_objs, &sd->id);
- evas_object_del(obj);
-}
-
-E_API void
-e_slot_move(Evas_Object *obj, int x, int y)
-{
- SLOT_SMART_ENTRY
-
- if (sd->x == x && sd->y == y) return;
-
- ELOGF("SLOT", "|Move slot - id:%d (%d, %d) -> (%d, %d)", NULL,
- sd->id, sd->x, sd->y, x, y);
-
- evas_object_move(obj, x, y);
- sd->changed = 1;
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_move", obj);
-}
-
-E_API void
-e_slot_resize(Evas_Object *obj, int w, int h)
-{
- SLOT_SMART_ENTRY
-
- if (sd->w == w && sd->h == h) return;
-
- ELOGF("SLOT", "|Resize slot - id:%d (%dx%d) -> (%dx%d)", NULL,
- sd->id, sd->w, sd->h, w, h);
-
- evas_object_resize(obj, w, h);
- sd->changed = 1;
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_resize", obj);
-}
-
-E_API void
-e_slot_raise(Evas_Object *obj)
-//e_slot_client_raise
-{
- SLOT_SMART_ENTRY
-
- Eina_List *l = NULL;
- Evas_Object *o = NULL;
- E_Client *ec = NULL;
- E_Client *ec2 = NULL;
- E_Client *top_ec = NULL;
- E_Client *below_ec = NULL;
- int cnt = 0;
-
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->layout.s_id != sd->id) continue;
- ELOGF("SLOT", "|raise ec[list add] - id:%d [cnt:%d]pid:%d", ec, sd->id, cnt++, ec->netwm.pid);
- if (!top_ec) top_ec = ec;
- l = eina_list_append(l, ec);
- }
-
- if (!top_ec) return;
-
- below_ec = top_ec;
- cnt = 0;
- EINA_LIST_FREE(l, ec2)
- {
- ELOGF("SLOT", "e_slot_raise |raise ec - id:%d [cnt:%d]pid:%d", ec2, sd->id, cnt++, ec2->netwm.pid);
- if (top_ec == ec2) e_client_raise(ec2);
- else e_client_stack_below(ec2, below_ec);
- below_ec = ec2;
- }
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_raise", obj);
-}
-
-E_API void
-e_slot_lower(Evas_Object *obj)
-//e_slot_client_lower
-{
- SLOT_SMART_ENTRY
-
- Eina_List *l = NULL;
- Evas_Object *o = NULL;
- E_Client *ec = NULL;
- E_Client *ec2 = NULL;
- int cnt = 0;
-
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->layout.s_id != sd->id) continue;
- ELOGF("SLOT", "e_slot_lower |lower ec[list add] - id:%d [cnt:%d]", ec, sd->id, cnt++);
- l = eina_list_append(l, ec);
- }
-
- cnt = 0;
- EINA_LIST_FREE(l, ec2)
- {
- ELOGF("SLOT", "e_slot_lower |lower ec - id:%d [cnt:%d]", ec2, sd->id, cnt++);
- e_client_lower(ec2);
- }
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_lower", obj);
-}
-
-E_API void
-e_slot_focus_set(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
-
- Evas_Object *o = NULL;
- E_Client *ec = NULL;
- int cnt = 0;
-
- if (sd->parent_obj)
- evas_object_smart_callback_call(sd->parent_obj, "slot_focus", obj);
-
- for(o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->layout.s_id != sd->id) continue;
- ELOGF("SLOT", "e_slot_focus_set |ec foucsed set - id:%d [cnt:%d]", ec, sd->id, cnt++);
- e_client_raise(ec);
- break;
- }
-}
-
-E_API void
-e_slot_update(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
-
- Eina_List *l = NULL;
- E_Slot_Client *slot_client = NULL;
- E_Client *ec;
- int x, y, w, h;
- int cnt = 0;
-
- if (sd->clist)
- {
- Eina_List *clist = NULL;
- Evas_Object *o = NULL;
-
- o = evas_object_top_get(e_comp->evas);
- for (; o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->layout.s_id != sd->id) continue;
- clist = eina_list_append(clist, ec);
- }
-
- EINA_LIST_FOREACH(clist, l, ec)
- {
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (!e_client_cdata_get(ec)) continue;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (!slot_client) continue;
- if (e_object_is_del(E_OBJECT(slot_client->ec))) continue;
-
- e_client_geometry_get(slot_client->ec, &x, &y, &w, &h);
-
- if (slot_client->type == E_SLOT_CLIENT_TYPE_TRANSFORM)
- {
- if (slot_client->transform)
- {
- e_util_transform_move(slot_client->transform, (double)sd->x, (double)sd->y, 0);
- e_util_transform_scale(slot_client->transform, (double)sd->w /(double)slot_client->ec->w, (double)sd->h /(double)slot_client->ec->h, 1.0);
- e_client_transform_core_update(slot_client->ec);
-
- ELOGF("SLOT", "e_slot_update |transform update - id:%d (%d,%d) (%lf x %lf) [cnt:%d] [pid:%d]", slot_client->ec,
- sd->id, sd->x, sd->y, (double)sd->w/(double)slot_client->ec->w, (double)sd->h /(double)slot_client->ec->h, cnt++, ec->netwm.pid);
- }
- }
- else
- {
- if (slot_client->ec->frame)
- {
- evas_object_move(slot_client->ec->frame, sd->x, sd->y);
- evas_object_resize(slot_client->ec->frame, sd->w, sd->h);
- ELOGF("SLOT", "e_slot_update |resize update - id:%d (%d,%d,%dx%d) [cnt:%d] [pid:%d]", slot_client->ec,
- sd->id, sd->x, sd->y, sd->w, sd->h, cnt++, ec->netwm.pid);
- }
- }
- }
- }
-
- sd->changed = 0;
- e_client_visibility_calculate();
-}
-
-E_API Eina_List*
-e_slot_list_get(void)
-{
- return _e_slot_g->slot_objs;
-}
-
-E_API Evas_Object *
-e_slot_find_by_id(int slot_id)
-{
- Evas_Object *obj = NULL;
-
- obj = eina_hash_find(_e_slot_g->hash_slot_objs, &slot_id);
-
- return obj;
-}
-
-E_API E_Client *
-e_slot_client_top_find(Evas_Object *obj)
-{
- Slot_Smart_Data *sd;
- Evas_Object *o = NULL;
- E_Client *ec = NULL;
- sd = evas_object_smart_data_get(obj);
- if (!sd) return NULL;
-
- for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
- {
- ec = evas_object_data_get(o, "E_Client");
- if (!ec) continue;
- if (e_object_is_del(E_OBJECT(ec))) continue;
- if (e_client_util_ignored_get(ec)) continue;
- if (ec->layout.s_id != sd->id) continue;
- if ((!ec->visible) || (ec->hidden) || (!evas_object_visible_get(ec->frame))) continue;
- return ec;
- }
-
- return NULL;
-}
-
-E_API Eina_Bool
-e_slot_client_add(Evas_Object *obj, E_Client *ec, Eina_Bool resizable)
-{
- Slot_Smart_Data *sd;
- E_Slot_Client* slot_client = NULL;
- int type = resizable ? E_SLOT_CLIENT_TYPE_NORMAL : E_SLOT_CLIENT_TYPE_TRANSFORM;
-
- if (!obj) return EINA_FALSE;
- if (!ec) return EINA_FALSE;
-
- sd = evas_object_smart_data_get(obj);
- if (!sd) return EINA_FALSE;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (slot_client)
- {
- ELOGF("SLOT", "%s | Remove already allocated in other slot", slot_client->ec, __FUNCTION__);
- e_slot_client_remove(slot_client->slot, ec);
- }
-
- slot_client = _e_slot_client_new(obj, ec, type);
- if (!slot_client) return EINA_FALSE;
-
- sd->clist = eina_list_append(sd->clist, ec);
- eina_hash_add(_e_slot_g->hash_slot_clients, &ec, slot_client);
-
- ec->layout.s_id = sd->id;
- ec->layout.splited = EINA_TRUE;
- sd->changed = EINA_TRUE;
- ELOGF("SLOT", "%s | Add - id:%d type:%d", ec, __FUNCTION__, sd->id, type);
-
- return EINA_TRUE;
-}
-
-E_API Eina_Bool
-e_slot_client_remove(Evas_Object *obj, E_Client *ec)
-{
- Slot_Smart_Data *sd;
- E_Slot_Client* slot_client = NULL;
-
- if (!obj) return EINA_FALSE;
- if (!ec) return EINA_FALSE;
-
- sd = evas_object_smart_data_get(obj);
- if (!sd) return EINA_FALSE;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (!slot_client) return EINA_FALSE;
-
- _e_slot_client_type_restore(slot_client);
-
- eina_hash_del_by_key(_e_slot_g->hash_slot_clients, &ec);
-
- _e_slot_client_del(slot_client);
-
- sd->clist = eina_list_remove(sd->clist, ec);
-
- ec->layout.s_id = 0;
- ec->layout.splited = EINA_FALSE;
- sd->changed = EINA_TRUE;
-
- return EINA_TRUE;
-}
-
-E_API int
-e_slot_client_type_get(E_Client *ec)
-{
- E_Slot_Client *slot_client = NULL;
- int type = -1;
-
- if (!ec) return type;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (slot_client) type = slot_client->type;
-
- return type;
-}
-
-E_API void
-e_slot_client_update(E_Client *ec)
-{
- Slot_Smart_Data *sd;
- E_Slot_Client *slot_client = NULL;
- int x, y, w, h;
-
- if (!ec) return;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (!slot_client) return;
-
- sd = evas_object_smart_data_get(slot_client->slot);
- if (!sd) return;
-
- if (slot_client)
- {
- if (e_object_is_del(E_OBJECT(slot_client->ec))) return;
- if (e_client_util_ignored_get(slot_client->ec)) return;
- if (!e_client_cdata_get(slot_client->ec)) return;
-
- e_client_geometry_get(slot_client->ec, &x, &y, &w, &h);
-
- if (slot_client->type == E_SLOT_CLIENT_TYPE_TRANSFORM)
- {
- if (slot_client->transform)
- {
- e_util_transform_move(slot_client->transform, (double)sd->x, (double)sd->y, 0);
- e_util_transform_scale(slot_client->transform, (double)sd->w/(double)slot_client->ec->w, (double)sd->h /(double)slot_client->ec->h, 1.0);
- e_client_transform_core_update(slot_client->ec);
-
- ELOGF("SLOT", "e_slot_client_update |transform update - id:%d (%d,%d) (%lf x %lf) ", slot_client->ec,
- ec->layout.s_id, sd->x, sd->y, (double)sd->w/(double)slot_client->ec->w, (double)sd->h /(double)slot_client->ec->h);
- }
- }
- else
- {
- if (slot_client->ec->frame)
- {
- evas_object_move(slot_client->ec->frame, sd->x, sd->y);
- evas_object_resize(slot_client->ec->frame, sd->w, sd->h);
- ELOGF("SLOT", "e_slot_client_update |resize update - id:%d (%d,%d,%dx%d)", slot_client->ec,
- ec->layout.s_id, sd->x, sd->y, sd->w, sd->h);
- }
- }
- }
-}
-
-E_API int
-e_slot_find_id(Evas_Object *obj)
-{
- Slot_Smart_Data *sd;
-
- if (!obj) return -1;
-
- sd = evas_object_smart_data_get(obj);
- if (!sd) return -1;
-
- return sd->id;
-}
-
-/* static functions */
-static int
-_e_slot_generate_id(void)
-{
- /* FIXME: */
- return ++id;
-}
-
-static E_Slot_Client*
-_e_slot_client_new(Evas_Object *obj, E_Client* ec, E_Slot_Client_Type type)
-{
- E_Slot_Client *slot_client = NULL;
-
- if (!ec) return NULL;
- slot_client = E_NEW(E_Slot_Client, 1);
- if (!slot_client) return NULL;
-
- slot_client->ec = ec;
- slot_client->slot = obj;
- slot_client->orig.x = ec->x;
- slot_client->orig.y = ec->y;
- slot_client->orig.w = ec->w;
- slot_client->orig.h = ec->h;
-
- if (slot_client->orig.x == 0 &&
- slot_client->orig.y == 0 &&
- slot_client->orig.w == 1 &&
- slot_client->orig.h == 1 &&
- ec->zone)
- {
- slot_client->orig.x = ec->zone->x;
- slot_client->orig.y = ec->zone->y;
- slot_client->orig.w = ec->zone->w;
- slot_client->orig.h = ec->zone->h;
- }
-
- slot_client->transform = NULL;
- slot_client->type = type;
- if (type == E_SLOT_CLIENT_TYPE_TRANSFORM)
- {
- slot_client->transform = e_util_transform_new();
- e_client_transform_core_add(slot_client->ec, slot_client->transform);
- }
-
- ELOGF("SLOT", "|Create slot client - type:%d orig: %d,%d,%dx%d", ec,
- type, ec->x, ec->y, ec->w, ec->h);
-
- return slot_client;
-}
-
-static void
-_e_slot_client_del(E_Slot_Client* slot_client)
-{
- if (!slot_client) return;
- E_FREE(slot_client);
-}
-
-static Eina_Bool
-_e_slot_client_type_restore(E_Slot_Client* slot_client)
-{
- Eina_Bool ret = EINA_FALSE;
-
- if (!slot_client) return EINA_FALSE;
- if (e_object_is_del(E_OBJECT(slot_client->ec))) return EINA_FALSE;
-
- switch (slot_client->type)
- {
- case E_SLOT_CLIENT_TYPE_TRANSFORM:
- if (slot_client->transform)
- {
- e_client_transform_core_remove(slot_client->ec, slot_client->transform);
- e_util_transform_del(slot_client->transform);
- slot_client->transform = NULL;
-
- ELOGF("SLOT", "Restore client |unset transform ", slot_client->ec);
-
- ret = EINA_TRUE;
- }
- break;
-
- default:
- case E_SLOT_CLIENT_TYPE_NORMAL:
- if (slot_client->ec->frame)
- {
- /* restore to its origin size when remove from slot */
- evas_object_move(slot_client->ec->frame, slot_client->orig.x, slot_client->orig.y);
- evas_object_resize(slot_client->ec->frame, slot_client->orig.w, slot_client->orig.h);
-
- ELOGF("SLOT", "Restore client |restore its origin size: %d,%d,%dx%d", slot_client->ec,
- slot_client->orig.x, slot_client->orig.y, slot_client->orig.w, slot_client->orig.h);
- ret = EINA_TRUE;
- }
- break;
- }
-
- if (!ret) ELOGF("SLOT", "Restore client |failed", slot_client->ec);
- return ret;
-}
-
-static void
-_e_slot_client_restore_all(Evas_Object *obj)
-{
- SLOT_SMART_ENTRY
- E_Slot_Client* slot_client = NULL;
- E_Client *ec;
- Eina_List *l;
-
- EINA_LIST_FOREACH(sd->clist, l, ec)
- {
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (slot_client)
- {
- _e_slot_client_type_restore(slot_client);
- eina_hash_del_by_key(_e_slot_g->hash_slot_clients, &ec);
- _e_slot_client_del(slot_client);
- }
- }
-}
-
-E_API Eina_List*
-e_slot_client_list_get(Evas_Object *obj)
-{
- Slot_Smart_Data *sd;
-
- sd = evas_object_smart_data_get(obj);
- if (!sd) return NULL;
-
- return sd->clist;
-}
-
-E_API int
-e_slot_client_count_get(Evas_Object *obj)
-{
- Slot_Smart_Data *sd;
-
- sd = evas_object_smart_data_get(obj);
- if (!sd) return 0;
-
- return eina_list_count(sd->clist);
-}
-
-E_API int
-e_slot_client_slot_id_get(E_Client *ec)
-{
- E_Slot_Client *slot_client = NULL;
- Slot_Smart_Data *sd;
-
- if (!ec) return -1;
-
- slot_client = eina_hash_find(_e_slot_g->hash_slot_clients, &ec);
- if (!slot_client) return -1;
-
- sd = evas_object_smart_data_get(slot_client->slot);
- if (!sd) return -1;
-
- return sd->id;
-}
+++ /dev/null
-#ifdef E_TYPEDEFS
-
-
-#else
-
-#ifndef E_SLOT_H_
-#define E_SLOT_H_
-
-
-EINTERN void e_slot_init(void);
-EINTERN int e_slot_shutdown(void);
-
-E_API Evas_Object *e_slot_new(Evas_Object *parent);
-E_API void e_slot_del(Evas_Object *obj);
-E_API void e_slot_move(Evas_Object *obj, int x, int y);
-E_API void e_slot_resize(Evas_Object *obj, int w, int h);
-
-E_API Evas_Object *e_slot_find_by_id(int slot_id);
-E_API int e_slot_find_id(Evas_Object *obj);
-E_API void e_slot_update(Evas_Object *obj);
-
-E_API Eina_Bool e_slot_client_add(Evas_Object *obj, E_Client *ec, Eina_Bool resizable);
-E_API Eina_Bool e_slot_client_remove(Evas_Object *obj, E_Client *ec);
-E_API Eina_List *e_slot_client_list_get(Evas_Object *obj);
-E_API int e_slot_client_count_get(Evas_Object *obj);
-E_API int e_slot_client_slot_id_get(E_Client* ec);
-E_API int e_slot_client_type_get(E_Client* ec);
-E_API void e_slot_client_update(E_Client *ec);
-E_API E_Client *e_slot_client_top_find(Evas_Object *obj);
-
-
-E_API void e_slot_raise(Evas_Object *obj);
-E_API void e_slot_lower(Evas_Object *obj);
-E_API void e_slot_focus_set(Evas_Object *obj);
-
-
-E_API Eina_List *e_slot_list_get(void); // list of e_slot smart obj
-
-#endif
-#endif
+++ /dev/null
-#include "e.h"
-
-/* global variables */
-#define SMART_NAME "splitlayout"
-#define SLAYOUT_ENTRY \
- Splitlayout_Data *sd; \
- sd = evas_object_smart_data_get(obj); \
- if (!sd) return;
-
-
-typedef struct _Splitlayout_Data Splitlayout_Data;
-typedef struct _Splitlayout_Item Splitlayout_Item;
-
-struct _Splitlayout_Data
-{
- E_Desk *desk;
-
- Evas_Object *obj;
- Evas_Object *clip;
- Evas_Object *bg; // background color
- Evas_Object *fg; // splitter
-
- int x, y, w, h;
- int layer;
-
- int frozen;
- unsigned char changed : 1;
- Eina_Inlist *items;
-};
-
-struct _Splitlayout_Item
-{
- EINA_INLIST;
- Splitlayout_Data *sd;
- Evas_Coord x, y, w, h;
- Evas_Object *obj; // e_slot smart objs
-};
-
-static Evas_Smart *_splitlayout_smart = NULL;
-
-/* static functions */
-static void
-_layout_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *event_info)
-{
- e_splitlayout_unpack(obj);
-}
-
-static Splitlayout_Item *
-_layout_smart_adopt(Splitlayout_Data *sd, Evas_Object *obj)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (li) e_splitlayout_unpack(obj);
- li = calloc(1, sizeof(Splitlayout_Item));
- if (!li) return NULL;
- li->sd = sd;
- li->obj = obj;
- /* defaults */
- li->x = 0;
- li->y = 0;
- li->w = 0;
- li->h = 0;
- evas_object_clip_set(obj, sd->clip);
- evas_object_smart_member_add(obj, li->sd->obj);
- evas_object_data_set(obj, "e_slot_data", li);
- evas_object_layer_set(obj, evas_object_layer_get(sd->obj));
- evas_object_event_callback_add(obj, EVAS_CALLBACK_FREE,
- _layout_smart_item_del_hook, NULL);
- if ((!evas_object_visible_get(sd->clip)) &&
- (evas_object_visible_get(sd->obj)))
- evas_object_show(sd->clip);
- return li;
-}
-
-static void
-_layout_smart_disown(Evas_Object *obj)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
- if (!li->sd->items)
- {
- if (evas_object_visible_get(li->sd->clip))
- evas_object_hide(li->sd->clip);
- }
- evas_object_event_callback_del(obj,
- EVAS_CALLBACK_FREE,
- _layout_smart_item_del_hook);
- evas_object_smart_member_del(obj);
- evas_object_data_del(obj, "e_slot_data");
- free(li);
-}
-
-static void
-_layout_smart_move_resize_item(Splitlayout_Item *li)
-{
-#ifdef SPLIT_DEBUG
- int eo_x, eo_y, eo_w, eo_h;
-#endif
-
- evas_object_move(li->obj, li->sd->x + li->x, li->sd->y + li->y);
- evas_object_resize(li->obj, li->w, li->h);
-
-#ifdef SPLIT_DEBUG
- evas_object_geometry_get(li->obj,&eo_x,&eo_y,&eo_w,&eo_h);
- INF(" %s obj- x(%d) y(%d) w(%d) h(%d)", __FUNCTION__, eo_x, eo_y, eo_w, eo_h);
-#endif
-
-}
-
-static void
-_layout_smart_reconfigure(Splitlayout_Data *sd)
-{
- Splitlayout_Item *li;
-
- if (!sd->changed) return;
-
- EINA_INLIST_FOREACH(sd->items, li)
- _layout_smart_move_resize_item(li);
- sd->changed = 0;
-}
-
-static void
-_layout_intercept_layer_set(void *data, Evas_Object *obj, int layer)
-{
- Splitlayout_Data *sd = data;
- Splitlayout_Item *li;
-
- EINA_INLIST_FOREACH(sd->items, li)
- {
- evas_object_layer_set(li->obj, layer);
- }
-
- evas_object_layer_set(obj, layer);
-}
-
-static void
-_layout_smart_add(Evas_Object *obj)
-{
- Splitlayout_Data *sd;
-
- sd = E_NEW(Splitlayout_Data, 1);
- if (EINA_UNLIKELY(!sd)) return;
-
- sd->obj = obj;
- sd->x = sd->y = sd->w = sd->h = 0;
- sd->clip = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_smart_member_add(sd->clip, obj);
- evas_object_move(sd->clip, 0, 0);
- evas_object_resize(sd->clip, 200002, 200002);
- evas_object_smart_data_set(obj, sd);
-
- sd->bg = evas_object_rectangle_add(evas_object_evas_get(obj));
- evas_object_clip_set(sd->bg, sd->clip);
-#ifdef SPLIT_DEBUG
- evas_object_color_set(sd->bg, 255, 255, 0, 255); // (yellow) background color can be configed
-#else
- evas_object_color_set(sd->bg, 255, 255, 255, 255);
-#endif
- evas_object_name_set(sd->bg, "e_splitlayout->bg");
- evas_object_smart_member_add(sd->bg, sd->obj);
- evas_object_show(sd->bg);
-
- evas_object_intercept_layer_set_callback_add(obj, _layout_intercept_layer_set, sd);
-}
-
-static void
-_layout_smart_del(Evas_Object *obj)
-{
- SLAYOUT_ENTRY;
-
- while (sd->items)
- {
- Splitlayout_Item *li = (Splitlayout_Item*)sd->items;
- sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(li));
- _layout_smart_disown(li->obj);
- }
- if (sd->bg) evas_object_del(sd->bg);
- if (sd->clip) evas_object_del(sd->clip);
- free(sd);
-}
-
-static void
-_layout_smart_show(Evas_Object *obj)
-{
- SLAYOUT_ENTRY;
-#ifdef SPLIT_DEBUG
- int eo_x, eo_y, eo_w, eo_h;
-#endif
-
- evas_object_show(sd->bg);
- evas_object_show(sd->clip);
-
-#ifdef SPLIT_DEBUG
- EINA_INLIST_FOREACH(sd->items, li)
- {
- INF("%s child %s", __FUNCTION__, evas_object_name_get(li->obj));
- evas_object_geometry_get(li->obj, &eo_x, &eo_y, &eo_w, &eo_h);
- INF("%s child - x(%d) y(%d) w(%d) h(%d)", __FUNCTION__, eo_x,eo_y,eo_w,eo_h);
- }
-
- evas_object_geometry_get(sd->clip, &eo_x, &eo_y, &eo_w, &eo_h);
- INF("%s clip- x(%d) y(%d) w(%d) h(%d)", __FUNCTION__, eo_x,eo_y,eo_w,eo_h);
- evas_object_geometry_get(sd->bg,&eo_x,&eo_y,&eo_w,&eo_h);
- INF("%s bg - x(%d) y(%d) w(%d) h(%d)", __FUNCTION__, eo_x,eo_y,eo_w,eo_h);
-#endif
-}
-
-static void
-_layout_smart_hide(Evas_Object *obj)
-{
- SLAYOUT_ENTRY;
-
- evas_object_hide(sd->bg);
- evas_object_hide(sd->clip);
-}
-
-static void
-_layout_smart_move(Evas_Object *obj, int x, int y)
-{
- SLAYOUT_ENTRY;
- Splitlayout_Item *li;
- Evas_Coord dx, dy;
-
- if ((x == sd->x) && (y == sd->y)) return;
- dx = x - sd->x;
- dy = y - sd->y;
-
- evas_object_move(sd->clip, x, y);
- evas_object_move(sd->bg, x, y);
- EINA_INLIST_FOREACH(sd->items, li)
- {
- Evas_Coord ox, oy;
-
- evas_object_geometry_get(li->obj, &ox, &oy, NULL, NULL);
- evas_object_move(li->obj, ox + dx, oy + dy);
- }
- sd->x = x;
- sd->y = y;
-}
-
-static void
-_layout_smart_resize(Evas_Object *obj, int w, int h)
-{
- SLAYOUT_ENTRY;
-
- if ((w == sd->w) && (h == sd->h)) return;
- sd->w = w;
- sd->h = h;
- sd->changed = 1;
-
- evas_object_resize(sd->clip, w, h);
- evas_object_resize(sd->bg, w, h);
- if (sd->frozen <= 0) _layout_smart_reconfigure(sd);
-}
-
-static void
-_layout_smart_init(void)
-{
- if (_splitlayout_smart) return;
- {
- static const Evas_Smart_Class sc =
- {
- SMART_NAME,
- EVAS_SMART_CLASS_VERSION,
- _layout_smart_add,
- _layout_smart_del,
- _layout_smart_move,
- _layout_smart_resize,
- _layout_smart_show,
- _layout_smart_hide,
- NULL, /* color_set */
- NULL, /* clip_set */
- NULL, /* clip_unset */
- NULL, /* calculate */
- NULL, /* member_add */
- NULL, /* member_del */
-
- NULL, /* parent */
- NULL, /* callbacks */
- NULL, /* interfaces */
- NULL /* data */
- };
- _splitlayout_smart = evas_smart_class_new(&sc);
- }
-}
-
-#ifdef SPLIT_DEBUG
-static void
-_e_splitlayout_cb_slot_add(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-static void
-_e_splitlayout_cb_slot_del(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-static void
-_e_splitlayout_cb_slot_move(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-
-static void
-_e_splitlayout_cb_slot_resize(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-
-static void
-_e_splitlayout_cb_slot_lower(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-
-static void
-_e_splitlayout_cb_slot_raise(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-
-
-static void
-_e_splitlayout_cb_slot_update(void *data, Evas_Object *obj EINA_UNUSED, void *event_info)
-{
- Splitlayout_Data *sd;
- Evas_Object *obj;
-
- EINA_SAFETY_ON_NULL_RETURN(data);
- sd = data;
-
- EINA_SAFETY_ON_NULL_RETURN(event_info);
- obj = event_info;
-}
-#endif
-
-E_API Evas_Object *
-e_splitlayout_add(E_Desk *desk)
-{
- Splitlayout_Data *sd;
- Evas_Object *o;
- Evas *e;
-#ifdef SPLIT_DEBUG
- int eo_x, eo_y, eo_w, eo_h;
-#endif
- e = e_comp->evas;
-
- _layout_smart_init();
- o = evas_object_smart_add(e, _splitlayout_smart);
- sd = evas_object_smart_data_get(o);
- if (!sd) SMARTERR(NULL);
- sd->desk = desk;
- e_object_ref(E_OBJECT(desk));
-
- evas_object_name_set(sd->obj, "e_splitlayout:obj");
-
-#ifdef SPLIT_DEBUG
- evas_object_smart_callback_add(sd->obj, "slot_add", (Evas_Smart_Cb)_e_splitlayout_cb_slot_add, sd);
- evas_object_smart_callback_add(sd->obj, "slot_del", (Evas_Smart_Cb)_e_splitlayout_cb_slot_del, sd);
- evas_object_smart_callback_add(sd->obj, "slot_move", (Evas_Smart_Cb)_e_splitlayout_cb_slot_move, sd);
- evas_object_smart_callback_add(sd->obj, "slot_resize", (Evas_Smart_Cb)_e_splitlayout_cb_slot_resize, sd);
- evas_object_smart_callback_add(sd->obj, "slot_lower", (Evas_Smart_Cb)_e_splitlayout_cb_slot_lower, sd);
- evas_object_smart_callback_add(sd->obj, "slot_raise", (Evas_Smart_Cb)_e_splitlayout_cb_slot_raise, sd);
- evas_object_smart_callback_add(sd->obj, "slot_update", (Evas_Smart_Cb)_e_splitlayout_cb_slot_update, sd);
-
- evas_object_geometry_get(sd->clip, &eo_x, &eo_y, &eo_w, &eo_h);
- INF("%s clip- x(%d) y(%d) w(%d) h(%d)", __FUNCTION__, eo_x, eo_y, eo_w, eo_h);
- evas_object_geometry_get(sd->bg, &eo_x, &eo_y, &eo_w, &eo_h);
- INF("%s bg - x(%d) y(%d) w(%d) h(%d)", __FUNCTION__ , eo_x, eo_y, eo_w, eo_h);
-#endif
-
- ELOGF("SPLIT", "Added Split layout", NULL);
-
- return sd->obj;
-}
-
-E_API int
-e_splitlayout_freeze(Evas_Object *obj)
-{
- Splitlayout_Data *sd;
-
- if (evas_object_smart_smart_get(obj) != _splitlayout_smart) SMARTERR(0);
- sd = evas_object_smart_data_get(obj);
- if (!sd) SMARTERR(0);
- sd->frozen++;
- return sd->frozen;
-}
-
-E_API int
-e_splitlayout_thaw(Evas_Object *obj)
-{
- Splitlayout_Data *sd;
-
- if (evas_object_smart_smart_get(obj) != _splitlayout_smart) SMARTERR(0);
- sd = evas_object_smart_data_get(obj);
- if (!sd) SMARTERR(0);
- sd->frozen--;
- if (sd->frozen <= 0) _layout_smart_reconfigure(sd);
- return sd->frozen;
-}
-
-E_API void
-e_splitlayout_pack(Evas_Object *obj, Evas_Object *child)
-{
- Splitlayout_Data *sd;
- Splitlayout_Item *li;
-
- if (evas_object_smart_smart_get(obj) != _splitlayout_smart) SMARTERRNR();
- sd = evas_object_smart_data_get(obj);
- if (!sd) SMARTERRNR();
- li = _layout_smart_adopt(sd, child);
- sd->items = eina_inlist_append(sd->items, EINA_INLIST_GET(li));
- evas_object_lower(child);
- if (sd->frozen <= 0) _layout_smart_move_resize_item(li);
-}
-
-E_API void
-e_splitlayout_child_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
-
- if ((li->x == x) && (li->y == y)) return;
- li->x = x;
- li->y = y;
- if (li->sd->frozen <= 0) _layout_smart_move_resize_item(li);
-}
-
-E_API void
-e_splitlayout_child_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
-
- if (w < 0) w = 0;
- if (h < 0) h = 0;
- if ((li->w == w) && (li->h == h)) return;
- li->w = w;
- li->h = h;
- if (li->sd->frozen <= 0) _layout_smart_move_resize_item(li);
-}
-
-E_API void
-e_splitlayout_child_raise(Evas_Object *obj)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
- if (!li->sd->items) return;
- li->sd->items = eina_inlist_demote(li->sd->items, EINA_INLIST_GET(li));
- evas_object_raise(obj);
-}
-
-E_API void
-e_splitlayout_child_lower(Evas_Object *obj)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
- if (!li->sd->items) return;
- li->sd->items = eina_inlist_promote(li->sd->items, EINA_INLIST_GET(li));
- evas_object_lower(obj);
-}
-
-E_API void
-e_splitlayout_child_raise_above(Evas_Object *obj, Evas_Object *above)
-{
- Splitlayout_Item *li, *li2;
-
- EINA_SAFETY_ON_NULL_RETURN(obj);
- EINA_SAFETY_ON_NULL_RETURN(above);
- if (obj == above) return;
- li = evas_object_data_get(obj, "e_slot_data");
- li2 = evas_object_data_get(above, "e_slot_data");
- if ((!li) || (!li2) || (li->sd != li2->sd)) return;
- li->sd->items = eina_inlist_remove(li->sd->items, EINA_INLIST_GET(li));
- evas_object_stack_above(obj, above);
- li->sd->items = eina_inlist_append_relative(li->sd->items, EINA_INLIST_GET(li), EINA_INLIST_GET(li2));
-}
-
-E_API void
-e_splitlayout_child_lower_below(Evas_Object *obj, Evas_Object *below)
-{
- Splitlayout_Item *li, *li2;
-
- EINA_SAFETY_ON_NULL_RETURN(obj);
- EINA_SAFETY_ON_NULL_RETURN(below);
- if (obj == below) return;
- li = evas_object_data_get(obj, "e_slot_data");
- li2 = evas_object_data_get(below, "e_slot_data");
- if ((!li) || (!li2) || (li->sd != li2->sd)) return;
- li->sd->items = eina_inlist_remove(li->sd->items, EINA_INLIST_GET(li));
- evas_object_stack_below(obj, below);
- li->sd->items = eina_inlist_prepend_relative(li->sd->items, EINA_INLIST_GET(li), EINA_INLIST_GET(li2));
-}
-
-E_API void
-e_splitlayout_child_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
-{
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
-
- if (x) *x = li->x;
- if (y) *y = li->y;
- if (w) *w = li->w;
- if (h) *h = li->h;
-}
-
-E_API void
-e_splitlayout_unpack(Evas_Object *obj)
-{
- Splitlayout_Data *sd;
- Splitlayout_Item *li;
-
- li = evas_object_data_get(obj, "e_slot_data");
- if (!li) return;
- sd = li->sd;
- sd->items = eina_inlist_remove(sd->items, EINA_INLIST_GET(li));
- _layout_smart_disown(obj);
-}
-
-E_API Eina_List *
-e_splitlayout_children_get(Evas_Object *obj)
-{
- Splitlayout_Data *sd;
- Eina_List *l = NULL;
- Splitlayout_Item *li;
-
- if (evas_object_smart_smart_get(obj) != _splitlayout_smart) SMARTERRNR() NULL;
- sd = evas_object_smart_data_get(obj);
- if (!sd) SMARTERR(NULL);
- EINA_INLIST_FOREACH(sd->items, li)
- l = eina_list_append(l, li->obj);
- return l;
-}
-
+++ /dev/null
-#ifdef E_TYPEDEFS
-
-
-#else
-#ifndef E_SPLITLAYOUT_H
-#define E_SPLITLAYOUT_H
-
-
-E_API Evas_Object *e_splitlayout_add (E_Desk *desk);
-E_API int e_splitlayout_freeze (Evas_Object *obj);
-E_API int e_splitlayout_thaw (Evas_Object *obj);
-E_API void e_splitlayout_unpack (Evas_Object *obj);
-E_API void e_splitlayout_pack (Evas_Object *obj, Evas_Object *child);
-E_API void e_splitlayout_child_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y);
-E_API void e_splitlayout_child_resize (Evas_Object *obj, Evas_Coord w, Evas_Coord h);
-E_API void e_splitlayout_child_raise (Evas_Object *obj);
-E_API void e_splitlayout_child_lower (Evas_Object *obj);
-E_API void e_splitlayout_child_raise_above (Evas_Object *obj, Evas_Object *above);
-E_API void e_splitlayout_child_lower_below (Evas_Object *obj, Evas_Object *below);
-E_API void e_splitlayout_child_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
-E_API Eina_List *e_splitlayout_children_get (Evas_Object *obj);
-
-#endif
-#endif