From 9f9fb168c28ca8d77b2fe2d2a009c6d598413c8f Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 25 Apr 2005 08:29:53 +0000 Subject: [PATCH] work in multihead again! :) SVN revision: 14342 --- src/bin/e_bindings.c | 31 ++++++++++++++++++++++ src/bin/e_bindings.h | 12 +++++++++ src/bin/e_box.c | 18 +++++++++++++ src/bin/e_container.c | 60 ++++++++++++++++++++++++++++--------------- src/bin/e_init.c | 55 ++++++++++++++++++++++++--------------- 5 files changed, 135 insertions(+), 41 deletions(-) diff --git a/src/bin/e_bindings.c b/src/bin/e_bindings.c index 2ea769bc0..1118d902e 100644 --- a/src/bin/e_bindings.c +++ b/src/bin/e_bindings.c @@ -21,15 +21,46 @@ e_bindings_shutdown(void) return 1; } +void +e_bindings_mouse_add(E_Binding_Context ctxt, int button, E_Binding_Modifier mod, int any_mod, char *action, char *param) +{ +} + +void +e_bindings_mouse_grab(Ecore_X_Window win) +{ +} + +void +e_bindings_mouse_ungrab(Ecore_X_Window win) +{ +} + int e_bindings_mouse_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Mouse_Button_Down *ev) { + E_Binding_Modifier mod = 0; + Evas_List *l; + + if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT; + if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL; + if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT; + if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN; + return 0; } int e_bindings_key_down_event_handle(E_Binding_Context ctxt, E_Object *obj, Ecore_X_Event_Key_Down *ev) { + E_Binding_Modifier mod = 0; + Evas_List *l; + + if (ev->modifiers & ECORE_X_MODIFIER_SHIFT) mod |= E_BINDING_MODIFIER_SHIFT; + if (ev->modifiers & ECORE_X_MODIFIER_CTRL) mod |= E_BINDING_MODIFIER_CTRL; + if (ev->modifiers & ECORE_X_MODIFIER_ALT) mod |= E_BINDING_MODIFIER_ALT; + if (ev->modifiers & ECORE_X_MODIFIER_WIN) mod |= E_BINDING_MODIFIER_WIN; + return 0; } diff --git a/src/bin/e_bindings.h b/src/bin/e_bindings.h index 57fd52bb9..bc1032128 100644 --- a/src/bin/e_bindings.h +++ b/src/bin/e_bindings.h @@ -11,6 +11,18 @@ typedef enum _E_Binding_Context E_BINDING_CONTEXT_ZONE } E_Binding_Context; +/* why do we do this? config stored bindings must be fixed. x's modifier masks + * may change from time to time, xserver to xserver - so we cant do a + * simple match without translating to fixed values + */ +typedef enum _E_Binding_Modifier +{ + E_BINDING_MODIFIER_SHIFT = (1 << 0), + E_BINDING_MODIFIER_CTRL = (1 << 1), + E_BINDING_MODIFIER_ALT = (1 << 2), + E_BINDING_MODIFIER_WIN = (1 << 3) +} E_Binding_Modifier; + #else #ifndef E_BINDINGS_H #define E_BINDINGS_H diff --git a/src/bin/e_box.c b/src/bin/e_box.c index 65b606a42..99e026b35 100644 --- a/src/bin/e_box.c +++ b/src/bin/e_box.c @@ -80,6 +80,7 @@ e_box_freeze(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; sd->frozen++; return sd->frozen; } @@ -90,6 +91,7 @@ e_box_thaw(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; sd->frozen--; if (sd->frozen <= 0) _e_box_smart_reconfigure(sd); return sd->frozen; @@ -101,6 +103,7 @@ e_box_orientation_set(Evas_Object *obj, int horizontal) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if (((sd->horizontal) && (horizontal)) || ((!sd->horizontal) && (!horizontal))) return; sd->horizontal = horizontal; @@ -114,6 +117,7 @@ e_box_orientation_get(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; return sd->horizontal; } @@ -123,6 +127,7 @@ e_box_homogenous_set(Evas_Object *obj, int homogenous) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if (sd->homogenous == homogenous) return; sd->homogenous = homogenous; sd->changed = 1; @@ -135,6 +140,7 @@ e_box_pack_start(Evas_Object *obj, Evas_Object *child) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; _e_box_smart_adopt(sd, child); sd->items = evas_list_prepend(sd->items, child); sd->changed = 1; @@ -148,6 +154,7 @@ e_box_pack_end(Evas_Object *obj, Evas_Object *child) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; _e_box_smart_adopt(sd, child); sd->items = evas_list_append(sd->items, child); sd->changed = 1; @@ -163,6 +170,7 @@ e_box_pack_before(Evas_Object *obj, Evas_Object *child, Evas_Object *before) Evas_List *l; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; _e_box_smart_adopt(sd, child); sd->items = evas_list_prepend_relative(sd->items, child, before); for (i = 0, l = sd->items; l; l = l->next, i++) @@ -182,6 +190,7 @@ e_box_pack_after(Evas_Object *obj, Evas_Object *child, Evas_Object *after) Evas_List *l; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; _e_box_smart_adopt(sd, child); sd->items = evas_list_append_relative(sd->items, child, after); for (i = 0, l = sd->items; l; l = l->next, i++) @@ -199,6 +208,7 @@ e_box_pack_count_get(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return 0; return evas_list_count(sd->items); } @@ -208,6 +218,7 @@ e_box_pack_object_nth(Evas_Object *obj, int n) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return NULL; return evas_list_nth(sd->items, n); } @@ -217,6 +228,7 @@ e_box_pack_object_first(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return NULL; return evas_list_data(sd->items); } @@ -226,6 +238,7 @@ e_box_pack_object_last(Evas_Object *obj) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return NULL; return evas_list_data(evas_list_last(sd->items)); } @@ -259,6 +272,7 @@ e_box_unpack(Evas_Object *obj) bi = evas_object_data_get(obj, "e_box_data"); if (!bi) return; sd = bi->sd; + if (!sd) return; sd->items = evas_list_remove(sd->items, obj); _e_box_smart_disown(obj); sd->changed = 1; @@ -271,6 +285,7 @@ e_box_min_size_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if (sd->changed) _e_box_smart_extents_calcuate(sd); if (minw) *minw = sd->min.w; if (minh) *minh = sd->min.h; @@ -282,6 +297,7 @@ e_box_max_size_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if (sd->changed) _e_box_smart_extents_calcuate(sd); if (maxw) *maxw = sd->max.w; if (maxh) *maxh = sd->max.h; @@ -293,6 +309,7 @@ e_box_align_get(Evas_Object *obj, double *ax, double *ay) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if (ax) *ax = sd->align.x; if (ay) *ay = sd->align.y; } @@ -303,6 +320,7 @@ e_box_align_set(Evas_Object *obj, double ax, double ay) E_Smart_Data *sd; sd = evas_object_smart_data_get(obj); + if (!sd) return; if ((sd->align.x == ax) && (sd->align.y == ay)) return; sd->align.x = ax; sd->align.y = ay; diff --git a/src/bin/e_container.c b/src/bin/e_container.c index 2d2407374..3fc43ce7e 100644 --- a/src/bin/e_container.c +++ b/src/bin/e_container.c @@ -99,12 +99,19 @@ e_container_new(E_Manager *man) con->name = strdup(name); screens = (Evas_List *)e_xinerama_screens_get(); - for (l = screens; l; l = l->next) + if (screens) { - E_Screen *scr; - - scr = l->data; - zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h); + for (l = screens; l; l = l->next) + { + E_Screen *scr; + + scr = l->data; + zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h); + } + } + else + { + zone = e_zone_new(con, 0, 0, 0, con->w, con->h); } con->gadman = e_gadman_new(con); @@ -525,25 +532,36 @@ _e_container_resize_handle(E_Container *con) e_xinerama_update(); screens = (Evas_List *)e_xinerama_screens_get(); - for (l = screens; l; l = l->next) + if (screens) + { + for (l = screens; l; l = l->next) + { + E_Screen *scr; + E_Zone *zone; + + scr = l->data; + zone = e_container_zone_number_get(con, scr->screen); + if (zone) + { + e_zone_move(zone, scr->x, scr->y); + e_zone_resize(zone, scr->w, scr->h); + } + else + { + zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h); + } + /* FIXME: what if a zone exists for a screen that doesn't exist? + * not sure this will ever happen... + */ + } + } + else { - E_Screen *scr; E_Zone *zone; - scr = l->data; - zone = e_container_zone_number_get(con, scr->screen); - if (zone) - { - e_zone_move(zone, scr->x, scr->y); - e_zone_resize(zone, scr->w, scr->h); - } - else - { - zone = e_zone_new(con, scr->screen, scr->x, scr->y, scr->w, scr->h); - } - /* FIXME: what if a zone exists for a screen that doesn't exist? - * not sure this will ever happen... - */ + zone = e_container_zone_number_get(con, 0); + e_zone_move(zone, 0, 0); + e_zone_resize(zone, con->w, con->h); } e_gadman_container_resize(con->gadman); diff --git a/src/bin/e_init.c b/src/bin/e_init.c index 4deb24417..8a7cff09d 100644 --- a/src/bin/e_init.c +++ b/src/bin/e_init.c @@ -51,29 +51,44 @@ e_init_init(void) ecore_evas_show(_e_init_ecore_evas); screens = (Evas_List *)e_xinerama_screens_get(); - for (l = screens; l; l = l->next) + if (screens) { - E_Screen *scr; - - scr = l->data; - o = edje_object_add(_e_init_evas); - /* first screen */ - if (l == screens) + for (l = screens; l; l = l->next) { - edje_object_file_set(o, - /* FIXME: "init.edj" needs to come from config */ - e_path_find(path_init, "init.edj"), - "init/splash"); - _e_init_object = o; + E_Screen *scr; + + scr = l->data; + o = edje_object_add(_e_init_evas); + /* first screen */ + if (l == screens) + { + edje_object_file_set(o, + /* FIXME: "init.edj" needs to come from config */ + e_path_find(path_init, "init.edj"), + "init/splash"); + _e_init_object = o; + } + /* other screens */ + else + edje_object_file_set(o, + /* FIXME: "init.edj" needs to come from config */ + e_path_find(path_init, "init.edj"), + "init/extra_screen"); + evas_object_move(o, scr->x, scr->y); + evas_object_resize(o, scr->w, scr->h); + evas_object_show(o); } - /* other screens */ - else - edje_object_file_set(o, - /* FIXME: "init.edj" needs to come from config */ - e_path_find(path_init, "init.edj"), - "init/extra_screen"); - evas_object_move(o, scr->x, scr->y); - evas_object_resize(o, scr->w, scr->h); + } + else + { + o = edje_object_add(_e_init_evas); + edje_object_file_set(o, + /* FIXME: "init.edj" needs to come from config */ + e_path_find(path_init, "init.edj"), + "init/splash"); + _e_init_object = o; + evas_object_move(o, 0, 0); + evas_object_resize(o, w, h); evas_object_show(o); }