Enlightenment CVS committal
Author : rephorm
Project : e17
Module : apps/e
Dir : e17/apps/e/src/bin
Modified Files:
Makefile.am e.h e_border.c e_border.h e_container.c
e_container.h e_int_menus.c e_main.c
Added Files:
e_iconify.c e_iconify.h
Log Message:
Fix shading to pull window contents in the right direction again.
Add a "clients" submenu to the right click menu to show the current container's
clients and all iconified clients (so you can actually un-iconify now)
Add "iconify" subsystem to keep track of iconic windows. This will be used be
used by modules to do things like taskbars and icon boxes.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/Makefile.am,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -3 -r1.7 -r1.8
--- Makefile.am 9 Dec 2004 19:33:51 -0000 1.7
+++ Makefile.am 21 Dec 2004 03:01:18 -0000 1.8
@@ -35,7 +35,9 @@
e_focus.h \
e_place.h \
e_resist.h \
-e_startup.h
+e_startup.h \
+e_iconify.h
+
enlightenment_SOURCES = \
e_file.c \
@@ -65,6 +67,7 @@
e_place.c \
e_resist.c \
e_startup.c \
+e_iconify.c \
$(ENLIGHTENMENTHEADERS)
enlightenment_LDFLAGS = -export-dynamic @e_libs@ @dlopen_libs@
@@ -83,3 +86,4 @@
installed_headersdir = $(prefix)/include/enlightenment
installed_headers_DATA = $(ENLIGHTENMENTHEADERS)
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -3 -r1.5 -r1.6
--- e.h 9 Dec 2004 13:56:06 -0000 1.5
+++ e.h 21 Dec 2004 03:01:19 -0000 1.6
@@ -68,6 +68,7 @@
#include "e_place.h"
#include "e_resist.h"
#include "e_startup.h"
+#include "e_iconify.h"
typedef struct _E_Before_Idler E_Before_Idler;
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -3 -r1.25 -r1.26
--- e_border.c 20 Dec 2004 21:33:31 -0000 1.25
+++ e_border.c 21 Dec 2004 03:01:19 -0000 1.26
@@ -250,11 +250,15 @@
{
E_OBJECT_CHECK(bd);
if (!bd->visible) return;
+
ecore_x_window_hide(bd->client.win);
e_container_shape_hide(bd->shape);
- /* FIXME: might be iconic too - need to do this elsewhere */
- ecore_x_icccm_state_set(bd->client.win,
ECORE_X_WINDOW_STATE_HINT_WITHDRAWN);
- /* ecore_x_icccm_state_set(bd->client.win,
ECORE_X_WINDOW_STATE_HINT_ICONIC); */
+
+ if (bd->iconic)
+ ecore_x_icccm_state_set(bd->client.win,
ECORE_X_WINDOW_STATE_HINT_WITHDRAWN);
+ else
+ ecore_x_icccm_state_set(bd->client.win,
ECORE_X_WINDOW_STATE_HINT_WITHDRAWN);
+
bd->visible = 0;
bd->changed = 1;
bd->changes.visible = 1;
@@ -571,15 +575,10 @@
{
E_OBJECT_CHECK(bd);
if ((bd->shading)) return;
- if (!bd->iconified)
+ if (!bd->iconic)
{
- printf("ICONIFY!!\n");
-
- /* FIXME add to list of iconified windows */
+ bd->iconic = 1;
e_border_hide(bd);
-
- bd->iconified = 1;
-
edje_object_signal_emit(bd->bg_object, "iconify", "");
}
}
@@ -589,19 +588,15 @@
{
E_OBJECT_CHECK(bd);
if ((bd->shading)) return;
- if (bd->iconified)
+ if (bd->iconic)
{
- printf("UNICONIFY!!\n");
- /* FIXME remove from list of iconified windows */
+ bd->iconic = 0;
e_border_show(bd);
-
- bd->iconified = 1;
-
+ e_iconify_border_remove(bd);
edje_object_signal_emit(bd->bg_object, "uniconify", "");
}
}
-
E_Border *
e_border_find_by_client_window(Ecore_X_Window win)
{
@@ -699,7 +694,8 @@
{
E_Border *bd;
Ecore_X_Event_Window_Hide *e;
-
+
+ printf("in hide cb\n");
bd = data;
e = ev;
bd = e_border_find_by_client_window(e->win);
@@ -709,7 +705,8 @@
bd->ignore_first_unmap--;
return 1;
}
- e_object_del(E_OBJECT(bd));
+ if (!(bd->iconic)) e_object_del(E_OBJECT(bd));
+
return 1;
}
@@ -1195,7 +1192,7 @@
}
else if (!strcmp(source, "iconify"))
{
- if (bd->iconified) e_border_uniconify(bd);
+ if (bd->iconic) e_border_uniconify(bd);
else e_border_iconify(bd);
}
@@ -1914,14 +1911,9 @@
printf("border move resize\n");
if (bd->shaded && !bd->shading)
{
- printf("******** move resize, shaded!\n");
evas_obscured_clear(bd->bg_evas);
ecore_x_window_move_resize(bd->win, bd->x, bd->y, bd->w, bd->h);
ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
- /* FIXME: this assumes shading upwards */
- /* the client is hidden, why move it? --rephorm */
-/* ecore_x_window_move_resize(bd->client.win, 0, bd->h -
(bd->client_inset.t + bd->client_inset.b) - bd->client.h,
- bd->client.w, bd->client.h);*/
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@@ -1940,8 +1932,25 @@
bd->client_inset.l, bd->client_inset.t,
bd->w - (bd->client_inset.l +
bd->client_inset.r),
bd->h - (bd->client_inset.t +
bd->client_inset.b));
- ecore_x_window_move_resize(bd->client.win, 0, 0,
- bd->client.w, bd->client.h);
+ if (bd->shading)
+ {
+ if (bd->shade.dir == E_DIRECTION_UP)
+ ecore_x_window_move_resize(bd->client.win, 0,
+ bd->h - (bd->client_inset.t + bd->client_inset.b) -
+ bd->client.h,
+ bd->client.w, bd->client.h);
+ else if (bd->shade.dir == E_DIRECTION_LEFT)
+ ecore_x_window_move_resize(bd->client.win,
+ bd->w - (bd->client_inset.l + bd->client_inset.r) -
+ bd->client.h,
+ 0, bd->client.w, bd->client.h);
+ else
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
+ }
+ else
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@@ -1962,14 +1971,9 @@
printf("border move resize\n");
if (bd->shaded && !bd->shading)
{
- printf("******** resize, shaded!\n");
evas_obscured_clear(bd->bg_evas);
ecore_x_window_move_resize(bd->event_win, 0, 0, bd->w, bd->h);
ecore_x_window_resize(bd->win, bd->w, bd->h);
- /* FIXME: this assumes shading upwards */
- /* the client is hidden, why move it? --rephorm */
-/* ecore_x_window_move_resize(bd->client.win, 0, bd->h -
(bd->client_inset.t + bd->client_inset.b) - bd->client.h,
- bd->client.w, bd->client.h);*/
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
@@ -1986,8 +1990,25 @@
bd->client_inset.l, bd->client_inset.t,
bd->w - (bd->client_inset.l +
bd->client_inset.r),
bd->h - (bd->client_inset.t +
bd->client_inset.b));
- ecore_x_window_move_resize(bd->client.win, 0, 0,
- bd->client.w, bd->client.h);
+ if (bd->shading)
+ {
+ if (bd->shade.dir == E_DIRECTION_UP)
+ ecore_x_window_move_resize(bd->client.win, 0,
+ bd->h - (bd->client_inset.t + bd->client_inset.b) -
+ bd->client.h,
+ bd->client.w, bd->client.h);
+ else if (bd->shade.dir == E_DIRECTION_LEFT)
+ ecore_x_window_move_resize(bd->client.win,
+ bd->w - (bd->client_inset.l + bd->client_inset.r) -
+ bd->client.h,
+ 0, bd->client.w, bd->client.h);
+ else
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
+ }
+ else
+ ecore_x_window_move_resize(bd->client.win, 0, 0,
+ bd->client.w, bd->client.h);
ecore_evas_move_resize(bd->bg_ecore_evas, 0, 0, bd->w, bd->h);
evas_object_resize(bd->bg_object, bd->w, bd->h);
e_container_shape_resize(bd->shape, bd->w, bd->h);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_border.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- e_border.h 20 Dec 2004 21:33:31 -0000 1.10
+++ e_border.h 21 Dec 2004 03:01:19 -0000 1.11
@@ -135,7 +135,7 @@
unsigned char shading : 1;
unsigned char shaded : 1;
unsigned char maximized : 1;
- unsigned char iconified : 1;
+ unsigned char iconic : 1;
unsigned char changed : 1;
@@ -195,4 +195,6 @@
EAPI void e_border_idler_before(void);
+EAPI void e_border_iconified_list(void);
+
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_container.c 5 Dec 2004 07:43:51 -0000 1.2
+++ e_container.c 21 Dec 2004 03:01:19 -0000 1.3
@@ -178,6 +178,13 @@
}
+Evas_List *
+e_container_clients_list_get(E_Container *con)
+{
+ E_OBJECT_CHECK(con);
+ return con->clients;
+}
+
E_Container_Shape *
e_container_shape_add(E_Container *con)
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_container.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_container.h 25 Nov 2004 05:31:20 -0000 1.2
+++ e_container.h 21 Dec 2004 03:01:19 -0000 1.3
@@ -66,6 +66,8 @@
EAPI void e_container_lower(E_Container *con);
EAPI void e_container_bg_reconfigure(E_Container *con);
+EAPI Evas_List *e_container_clients_list_get(E_Container *con);
+
EAPI E_Container_Shape *e_container_shape_add(E_Container *con);
EAPI void e_container_shape_show(E_Container_Shape *es);
EAPI void e_container_shape_hide(E_Container_Shape *es);
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_int_menus.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- e_int_menus.c 25 Nov 2004 04:07:48 -0000 1.2
+++ e_int_menus.c 21 Dec 2004 03:01:19 -0000 1.3
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
#include "e.h"
typedef struct _About_Data About_Data;
@@ -18,6 +21,8 @@
static void _e_int_menus_apps_end (void *data, E_Menu *m);
static void _e_int_menus_apps_free_hook(void *obj);
static void _e_int_menus_apps_run (void *data, E_Menu *m, E_Menu_Item
*mi);
+static void _e_int_menus_clients_pre_cb(void *data, E_Menu *m);
+static void _e_int_menus_clients_item_cb (void *data, E_Menu *m, E_Menu_Item
*mi);
/* externally accessible functions */
E_Menu *
@@ -43,7 +48,13 @@
mi = e_menu_item_new(m);
e_menu_item_label_set(mi, "Modules");
e_menu_item_submenu_set(mi, subm);
-
+
+ subm = e_menu_new();
+ e_menu_pre_activate_callback_set(subm, _e_int_menus_clients_pre_cb, NULL);
+ mi = e_menu_item_new(m);
+ e_menu_item_label_set(mi, "Clients");
+ e_menu_item_submenu_set(mi, subm);
+
mi = e_menu_item_new(m);
e_menu_item_separator_set(mi, 1);
@@ -76,6 +87,16 @@
return m;
}
+E_Menu *
+e_int_menus_clients_new(char *dir, int top)
+{
+ E_Menu *m;
+ E_Menu_Item *mi;
+
+ m = e_menu_new();
+
+}
+
/* local subsystem functions */
static void
_e_int_menus_about_end(void *data, E_Menu *m)
@@ -187,3 +208,71 @@
a = data;
e_app_exec(a);
}
+
+static void
+_e_int_menus_clients_pre_cb(void *data, E_Menu *m)
+{
+ E_Menu_Item *mi;
+ Evas_List *l, *borders = NULL;
+
+ if (m->realized) return;
+
+ /* clear the list */
+ if (m->items)
+ {
+ Evas_List *l;
+ for (l = m->items; l; l = l->next)
+ {
+ E_Menu_Item *mi = l->data;
+ e_object_free(E_OBJECT(mi));
+ }
+
+ }
+
+ /* get the current containers clients */
+ if (m->parent_item && m->parent_item->menu && m->parent_item->menu->con)
+ {
+ for (l = e_container_clients_list_get(m->parent_item->menu->con); l; l
= l->next)
+ {
+ borders = evas_list_append(borders, l->data);
+ }
+ }
+
+ /* get the iconified clients from other containers */
+ for (l = e_iconify_clients_list_get(); l; l = l->next)
+ {
+ if (!evas_list_find(borders, l->data))
+ borders = evas_list_append(borders, l->data);
+ }
+
+ for (l = borders; l; l = l->next)
+ {
+ E_Border *bd = l->data;
+ E_App *a;
+
+ mi = e_menu_item_new(m);
+ e_menu_item_check_set(mi, 1);
+ e_menu_item_label_set(mi, bd->client.icccm.title);
+ e_menu_item_callback_set(mi, _e_int_menus_clients_item_cb, bd);
+ if (!bd->iconic) e_menu_item_toggle_set(mi, 1);
+
+ a = e_app_window_name_class_find(bd->client.icccm.name,
+ bd->client.icccm.class);
+ if (a)
+ {
+ e_menu_item_icon_edje_set(mi, a->path, "icon");
+ }
+ }
+ evas_list_free(borders);
+}
+
+static void
+_e_int_menus_clients_item_cb (void *data, E_Menu *m, E_Menu_Item *mi)
+{
+ E_Border *bd = data;
+
+ if (bd->iconic) e_border_uniconify(bd);
+
+ e_border_raise(bd);
+ e_border_focus_set(bd, 1, 1);
+}
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/bin/e_main.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- e_main.c 11 Dec 2004 04:02:26 -0000 1.12
+++ e_main.c 21 Dec 2004 03:01:19 -0000 1.13
@@ -1,3 +1,6 @@
+/*
+ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
+ */
#include "e.h"
struct _E_Before_Idler
@@ -243,6 +246,14 @@
/* setup module loading etc. FIXME: check return value */
e_module_init();
+ if (!e_iconify_init())
+ {
+ e_error_message_show("Enlightenment cannot setup its iconify system.");
+ _e_main_shutdown(-1);
+ }
+ else
+ _e_main_shutdown_push(e_iconify_shutdown);
+
if (!nowelcome)
{
/* explicitly show a gui dialog */
-------------------------------------------------------
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