Enlightenment CVS committal
Author : raster
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
e_container.c e_container.h e_main.c e_manager.c
Log Message:
we support... xrandr... :) feelfree to change resolution on the fly in e17...
it all works. :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- e_container.c 23 Dec 2004 15:31:47 -0000 1.6
+++ e_container.c 25 Dec 2004 15:33:48 -0000 1.7
@@ -16,11 +16,16 @@
static void _e_container_shape_del(E_Container_Shape *es);
static void _e_container_shape_free(E_Container_Shape *es);
static void _e_container_shape_change_call(E_Container_Shape *es,
E_Container_Shape_Change ch);
+static void _e_container_resize_handle(E_Container *con);
+static void _e_container_event_container_resize_free(void *data, void *ev);
+
+int E_EVENT_CONTAINER_RESIZE = 0;
/* externally accessible functions */
int
e_container_init(void)
{
+ E_EVENT_CONTAINER_RESIZE = ecore_event_type_new();
return 1;
}
@@ -132,7 +137,7 @@
con->h = h;
ecore_x_window_resize(con->win, con->w, con->h);
ecore_evas_resize(con->bg_ecore_evas, con->w, con->h);
-}
+}
void
e_container_move_resize(E_Container *con, int x, int y, int w, int h)
@@ -396,6 +401,7 @@
con = evas_object_data_get(o, "e_container");
evas_object_resize(con->bg_object, w, h);
evas_object_resize(con->bg_event_object, w, h);
+ _e_container_resize_handle(con);
}
static void
@@ -432,3 +438,33 @@
cb->func(cb->data, es, ch);
}
}
+
+static void
+_e_container_resize_handle(E_Container *con)
+{
+ E_Event_Container_Resize *ev;
+ Evas_List *l;
+
+ ev = calloc(1, sizeof(E_Event_Container_Resize));
+ ev->container = con;
+ e_object_ref(E_OBJECT(con));
+ ecore_event_add(E_EVENT_CONTAINER_RESIZE, ev,
_e_container_event_container_resize_free, NULL);
+ for (l = con->clients; l; l = l->next)
+ {
+ E_Border *b;
+
+ b = l->data;
+ if ((b->x + b->w) > con->w) e_border_move(b, con->w - b->w, b->y);
+ if ((b->y + b->h) > con->h) e_border_move(b, b->x, con->h - b->h);
+ }
+}
+
+static void
+ _e_container_event_container_resize_free(void *data, void *ev)
+{
+ E_Event_Container_Resize *e;
+
+ e = ev;
+ e_object_unref(E_OBJECT(e->container));
+ free(e);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_container.h 21 Dec 2004 03:01:19 -0000 1.3
+++ e_container.h 25 Dec 2004 15:33:48 -0000 1.4
@@ -15,6 +15,7 @@
typedef struct _E_Container E_Container;
typedef struct _E_Container_Shape E_Container_Shape;
typedef struct _E_Container_Shape_Callback E_Container_Shape_Callback;
+typedef struct _E_Event_Container_Resize E_Event_Container_Resize;
struct _E_Container
{
@@ -53,6 +54,11 @@
void *data;
};
+struct _E_Event_Container_Resize
+{
+ E_Container *container;
+};
+
EAPI int e_container_init(void);
EAPI int e_container_shutdown(void);
@@ -80,4 +86,6 @@
EAPI void e_container_shape_change_callback_del(E_Container
*con, void (*func) (void *data, E_Container_Shape *es, E_Container_Shape_Change
ch), void *data);
EAPI Evas_List *e_container_shape_rects_get(E_Container_Shape *es);
+extern EAPI int E_EVENT_CONTAINER_RESIZE;
+
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -3 -r1.16 -r1.17
--- e_main.c 24 Dec 2004 04:44:05 -0000 1.16
+++ e_main.c 25 Dec 2004 15:33:48 -0000 1.17
@@ -460,6 +460,7 @@
int num, i;
if (!e_manager_init()) return 0;
+ if (!e_container_init()) return 0;
num = 0;
roots = ecore_x_window_root_list(&num);
@@ -526,6 +527,7 @@
static int
_e_main_screens_shutdown(void)
{
+ e_container_shutdown();
e_manager_shutdown();
return 1;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_manager.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_manager.c 23 Dec 2004 06:38:27 -0000 1.2
+++ e_manager.c 25 Dec 2004 15:33:48 -0000 1.3
@@ -4,13 +4,13 @@
static void _e_manager_free(E_Manager *man);
static int _e_manager_cb_window_show_request(void *data, int ev_type, void
*ev);
+static int _e_manager_cb_window_configure(void *data, int ev_type, void *ev);
#if 0 /* use later - maybe */
static int _e_manager_cb_window_destroy(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_reparent(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_create(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_configure_request(void *data, int ev_type,
void *ev);
-static int _e_manager_cb_window_configure(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_gravity(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_stack(void *data, int ev_type, void *ev);
static int _e_manager_cb_window_stack_request(void *data, int ev_type, void
*ev);
@@ -60,6 +60,8 @@
ecore_x_icccm_title_set(man->win, "Enlightenment Manager");
h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_SHOW_REQUEST,
_e_manager_cb_window_show_request, man);
if (h) man->handlers = evas_list_append(man->handlers, h);
+ h = ecore_event_handler_add(ECORE_X_EVENT_WINDOW_CONFIGURE,
_e_manager_cb_window_configure, man);
+ if (h) man->handlers = evas_list_append(man->handlers, h);
return man;
}
@@ -96,16 +98,28 @@
void
e_manager_resize(E_Manager *man, int w, int h)
{
+ Evas_List *l;
+
E_OBJECT_CHECK(man);
if ((w == man->w) && (h == man->h)) return;
man->w = w;
man->h = h;
ecore_x_window_resize(man->win, man->w, man->h);
+
+ for (l = man->containers; l; l = l->next)
+ {
+ E_Container *con;
+
+ con = l->data;
+ e_container_resize(con, man->w, man->h);
+ }
}
void
e_manager_move_resize(E_Manager *man, int x, int y, int w, int h)
{
+ Evas_List *l;
+
E_OBJECT_CHECK(man);
if ((x == man->x) && (y == man->y) && (w == man->w) && (h == man->h))
return;
man->x = x;
@@ -113,6 +127,14 @@
man->w = w;
man->h = h;
ecore_x_window_move_resize(man->win, man->x, man->y, man->w, man->h);
+
+ for (l = man->containers; l; l = l->next)
+ {
+ E_Container *con;
+
+ con = l->data;
+ e_container_resize(con, man->w, man->h);
+ }
}
void
@@ -178,6 +200,19 @@
return 1;
}
+static int
+_e_manager_cb_window_configure(void *data, int ev_type, void *ev)
+{
+ E_Manager *man;
+ Ecore_X_Event_Window_Configure *e;
+
+ man = data;
+ e = ev;
+ if (e->win != man->root) return 1;
+ e_manager_resize(man, e->w, e->h);
+ return 1;
+}
+
#if 0 /* use later - maybe */
static int _e_manager_cb_window_destroy(void *data, int ev_type, void
*ev){return 1;}
static int _e_manager_cb_window_hide(void *data, int ev_type, void *ev){return
1;}
-------------------------------------------------------
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