Enlightenment CVS committal
Author : handyande
Project : misc
Module : engage
Dir : misc/engage/src
Modified Files:
config.c dock.c engage.h tray.c
Log Message:
Yay, the system tray actually looks like a tray now :)
almost usable :) :)
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/config.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -3 -r1.37 -r1.38
--- config.c 24 Aug 2004 15:04:32 -0000 1.37
+++ config.c 21 Sep 2004 13:26:38 -0000 1.38
@@ -89,7 +89,7 @@
ecore_config_int_create("engage.options.width", 1024, 'W', "width",
"The overall width of the application area");
- ecore_config_int_create("engage.options.height", 100, 'H', "height",
+ ecore_config_int_create("engage.options.height", 110, 'H', "height",
"The overall height of the application area");
ecore_config_theme_create("engage.options.theme", "gentoo", 't', "theme",
"The theme name to use (minus path and extension)");
@@ -112,7 +112,7 @@
ecore_config_int_create_bound("engage.options.auto_hide", 0, 0, 1, 1, 'A',
"auto-hide", "Auto hide the engage bar");
- ecore_config_int_create("engage.options.size", 32, 's', "size",
+ ecore_config_int_create("engage.options.size", 40, 's', "size",
"Size of icons in default state");
ecore_config_int_create("engage.options.spacing", 4, 'S', "spacing",
"Space in pixels between each icon");
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/dock.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- dock.c 5 Aug 2004 17:43:06 -0000 1.9
+++ dock.c 21 Sep 2004 13:26:38 -0000 1.10
@@ -86,6 +86,7 @@
if (dock.sysicons)
width += options.spacing + 1.0; // another spacer
}
+ width += tray_width + 4;
#define POSITION(__icons) \
{ \
@@ -95,7 +96,6 @@
x += 0.5 * (__icon->scale * options.size +
options.spacing); \
__icon->x = x; \
__icon->y = y; \
- if (__icon->type == system_icon) od_tray_move(__icon);\
x += 0.5 * (__icon->scale * options.size +
options.spacing); \
__item = __item->next; \
} \
@@ -116,6 +116,7 @@
dock.left_pos = 0.5 * (options.width - width) - 1.0;
dock.right_pos = 0.5 * (options.width - width) + width + 1.0;
+ od_tray_move(dock.right_pos - tray_width - 2);
need_redraw = true;
}
@@ -208,6 +209,8 @@
options.height - options.size - 2.0 * options.arrow_size);
}
+ od_tray_move(dock.right_end - tray_width - 2);
+
}
void
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/engage.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -3 -r1.17 -r1.18
--- engage.h 5 Aug 2004 17:43:06 -0000 1.17
+++ engage.h 21 Sep 2004 13:26:38 -0000 1.18
@@ -28,6 +28,7 @@
extern Evas *evas;
extern Ecore_X_Window od_window;
extern bool need_redraw;
+extern int tray_width;
int od_config_init();
void od_config_menu_draw(Evas_Coord x, Evas_Coord y);
@@ -46,7 +47,7 @@
void od_dock_zoom_out();
void od_tray_init();
-void od_tray_move(OD_Icon *icon);
+void od_tray_move(double x);
void od_icon_mapping_add(const char *winclass, const char *name,
const char *icon_name);
===================================================================
RCS file: /cvsroot/enlightenment/misc/engage/src/tray.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- tray.c 20 Sep 2004 18:01:30 -0000 1.6
+++ tray.c 21 Sep 2004 13:26:38 -0000 1.7
@@ -19,6 +19,9 @@
};
int tray_count = 0;
+double tray_x = 0.0;
+/* negative so as to not use up space if tray not enabled */
+int tray_width = -4;
Window_List *tray_list = NULL;
/*
@@ -46,7 +49,7 @@
}
static Display *display;
-static Window root;
+static Window root, tray_container;
static int tray_init;
void
@@ -55,13 +58,16 @@
int xpos;
int oddflag;
+ tray_width = ((tray_count + 1) / 2) * 24;
+ ecore_x_window_resize(tray_container, tray_width, 48);
+
tmp = tray_list;
xpos = 0;
oddflag = 0;
while(tmp) {
/* this line sets some (skype...) to the correct position in the engage win
but others (psi...) to the same position rel to the main screen - bum */
- ecore_x_window_prop_xy_set(tmp->win, xpos, options.height - oddflag - 24);
+ ecore_x_window_prop_xy_set(tmp->win, xpos, 24 - oddflag);
tmp = tmp->next;
if (oddflag) {
@@ -71,7 +77,6 @@
oddflag = 24;
}
}
-
}
void
@@ -96,7 +101,7 @@
printf("adding icon %x for %s\n", win, new->title);
ecore_x_event_mask_set(win, ECORE_X_EVENT_MASK_WINDOW_CONFIGURE);
- XReparentWindow (display, win, od_window, 0, 0);
+ XReparentWindow (display, win, tray_container, 0, 0);
ecore_x_window_resize(win, 24, 24);
od_tray_layout();
@@ -147,6 +152,7 @@
ecore_x_client_message_send(ev->data.l[2], ecore_x_atom_get("_XEMBED"),
CurrentTime, XEMBED_EMBEDDED_NOTIFY,
0, od_window, /*proto*/1);
+
} else if (ev->message_type == ecore_x_atom_get("_NET_SYSTEM_TRAY_MESSAGE_DATA"))
{
printf("got message\n");
}
@@ -160,31 +166,17 @@
}
void
-od_tray_move(OD_Icon *icon)
+od_tray_move(double xx)
{
- int x, y, w, h;
- Screen *scr;
- int def;
- int res_x, res_y;
-
/* small check, as we are not really integrating yet */
if (!tray_init)
return;
- // ecore_x_window_geometry_get(od_window, &x, &y, &w, &h); // no work :(
- def = DefaultScreen(display);
- scr = ScreenOfDisplay(display, def);
- res_x = scr->width;
- res_y = scr->height;
- x = (res_x - options.width) / 2;
- y = res_y - options.height;
-
- if (icon->data.minwin.window) {
- ecore_x_window_prop_xy_set(icon->data.minwin.window, x + (int) icon->x -
options.size + 4, y + (int) icon->y - (options.size / 2));
- /* hack to update icon background */
- ecore_x_window_resize(icon->data.minwin.window, 0, 0);
- ecore_x_window_resize(icon->data.minwin.window, options.size, options.size);
- }
+ if (xx == tray_x)
+ return;
+
+ ecore_x_window_prop_xy_set(tray_container, xx, options.height - 48);
+ tray_x = xx;
}
void
@@ -208,6 +200,15 @@
od_window, 0, 0);
}
+ tray_container = ecore_x_window_new(od_window, 0, options.height - 48, 96,
+ 48);
+ ecore_x_window_container_manage(tray_container);
+ ecore_x_window_background_color_set(tray_container, 0xcccccc);
+ ecore_x_window_show(tray_container);
+
ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, od_tray_msg_cb, NULL);
ecore_event_handler_add(ECORE_X_EVENT_WINDOW_DESTROY, od_tray_msg_cb, NULL);
+
+ od_tray_layout();
}
+
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs