Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : apps/e
Dir : e17/apps/e/src
Modified Files:
Tag: SPLIT
border.c
Log Message:
A little more shuffling of border code. This allows for borders to overlap
window contents, so anyone working on themes be sure you are aware of the
inset settings for your bits.
===================================================================
RCS file: /cvsroot/enlightenment/e17/apps/e/src/border.c,v
retrieving revision 1.72.2.8
retrieving revision 1.72.2.9
diff -u -3 -r1.72.2.8 -r1.72.2.9
--- border.c 11 Sep 2002 03:24:34 -0000 1.72.2.8
+++ border.c 23 Sep 2002 20:22:49 -0000 1.72.2.9
@@ -1914,7 +1914,9 @@
if ((win == b->win.main) ||
(win == b->win.client) ||
(win == b->win.container) ||
- (win == b->win.input) || (win == b->win.b))
+ (win == b->win.input) ||
+ (win == b->win.b) ||
+ (ecore_window_get_parent(win) == b->win.main))
D_RETURN_(b);
}
@@ -2157,7 +2159,7 @@
e_border_update_render(E_Border * b)
{
GC gc1, gc2;
- Evas_List *up, *hp;
+ Evas_List *up, *hp, *owin;
Window window;
Pixmap pmap, mask, temp;
int pl, pr, pt, pb;
@@ -2174,27 +2176,60 @@
info->info.mask = mask;
evas_engine_info_set(b->evas, (Evas_Engine_Info *) info);
- e_border_cleanup_window_list(b->windows);
- b->windows = NULL;
+ if (b->bits.b)
+ {
+ ebits_hide(b->bits.b);
+ }
+ /* Force a render of the evas to clear large updates from resizing */
+ evas_render(b->evas);
- ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
+ if (b->bits.b)
+ {
+ ebits_move(b->bits.b, 0, 0);
+ ebits_resize(b->bits.b, b->current.w, b->current.h);
+ ebits_get_insets(b->bits.b, &pl, &pr, &pt, &pb);
+ ebits_show(b->bits.b);
+ }
- /* First get the shape masks for the outer border */
+ if (b->obj.title)
+ {
+ double tx, ty, tw, th;
+
+ ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw,
+ &th);
+ e_text_move(b->obj.title, tx, ty);
+ e_text_set_layer(b->obj.title, 1);
+
+ evas_object_move(b->obj.title_clip, tx, ty);
+ evas_object_resize(b->obj.title_clip, tw, th);
+ }
+
+/*
evas_obscured_clear(b->evas);
evas_obscured_rectangle_add(b->evas, pl, pt,
b->current.w - pl - pr,
b->current.h - pt - pb);
-
evas_damage_rectangle_add(b->evas, 0, 0, b->current.w, b->current.h);
+*/
hp = up = evas_render_updates(b->evas);
+/*
evas_obscured_clear(b->evas);
+*/
+ owin = b->windows;
+ b->windows = NULL;
+
+ D("Rendering %d rectangles for border %p { w = %d, h = %d }\n", up->count, b,
+ b->current.w, b->current.h);
while (up)
{
Evas_Rectangle *u;
u = up->data;
+ D("\tRectangle { x = %d, y = %d, w = %d, h = %d }\n",
+ u->x, u->y, u->w, u->h);
+
/* Copy the large pixmap to a series of small pixmaps. */
temp = ecore_pixmap_new(b->win.b, u->w, u->h, 0);
ecore_gc_set_fg(gc1, 0);
@@ -2203,9 +2238,10 @@
ecore_area_copy(pmap, temp, gc1, u->x, u->y, u->w, u->h, 0, 0);
/* Setup small windows for borders, with the pixmaps as backgrounds */
- window = ecore_window_override_new(b->win.b, u->x, u->y, u->w, u->h);
- ecore_window_set_events(window, XEV_IN_OUT);
- ecore_window_show(window);
+ window = ecore_window_override_new(b->win.main, u->x, u->y, u->w, u->h);
+ ecore_window_set_events_propagate(window, 1);
+ ecore_window_set_events(window, XEV_IN_OUT | XEV_MOUSE_MOVE |
+ XEV_BUTTON);
ecore_window_set_background_pixmap(window, temp);
ecore_pixmap_free(temp);
@@ -2224,6 +2260,7 @@
}
evas_render_updates_free(hp);
+ e_border_cleanup_window_list(owin);
ecore_gc_free(gc1);
ecore_gc_free(gc2);
@@ -2231,7 +2268,19 @@
ecore_pixmap_free(pmap);
ecore_pixmap_free(mask);
+ /* Update the display all at once. */
+ owin = b->windows;
+ while (owin)
+ {
+ window = (Window)owin->data;
+ ecore_window_raise(window);
+ ecore_window_show(window);
+ owin = owin->next;
+ }
+
e_border_redraw_region(b, 0, 0, b->current.w, b->current.h);
+
+ D("Finished rendering update\n");
}
void
@@ -2239,7 +2288,6 @@
{
int location_changed = 0;
int size_changed = 0;
- int shape_changed = 0;
int border_changed = 0;
int visibility_changed = 0;
int state_changed = 0;
@@ -2258,7 +2306,7 @@
if ((b->current.w != b->previous.w) || (b->current.h != b->previous.h))
size_changed = 1;
if ((size_changed) && (b->current.has_shape))
- shape_changed = 1;
+ b->shape_changed = 1;
if (b->current.selected != b->previous.selected)
state_changed = 1;
if (state_changed)
@@ -2277,7 +2325,7 @@
border_changed = 1;
}
if ((border_changed) && (b->current.has_shape))
- shape_changed = 1;
+ b->shape_changed = 1;
if (b->current.visible != b->previous.visible)
visibility_changed = 1;
@@ -2344,11 +2392,6 @@
0, -b->current.shaded,
b->client.w, b->client.h);
- if (b->bits.b)
- {
- ebits_resize(b->bits.b, b->current.w, b->current.h);
- }
-
e_icccm_move_resize(b->win.client,
b->current.x + pl,
b->current.y + pt - b->current.shaded, b->client.w,
@@ -2357,12 +2400,6 @@
}
if ((b->client.title) && (b->bits.b))
{
- double tx, ty, tw, th;
- double ox, oy, ow, oh;
-
- ebits_get_named_bit_geometry(b->bits.b, "Title_Area", &tx, &ty, &tw,
- &th);
-
if (b->obj.title)
{
if (strcmp(b->client.title, b->obj.title->text))
@@ -2370,29 +2407,10 @@
e_text_set_text(b->obj.title, b->client.title);
b->shape_changed = 1;
}
- e_text_get_geometry(b->obj.title, &ox, &oy, &ow, &oh);
- if (tx != ox || ty != oy)
- {
- e_text_move(b->obj.title, tx, ty);
- b->shape_changed = 1;
- }
if (b->current.selected)
e_text_set_state(b->obj.title, "selected");
else
e_text_set_state(b->obj.title, "normal");
- }
- evas_object_geometry_get(b->obj.title_clip, &ox, &oy, &ow, &oh);
- if (tx != ox || ty != oy || tw != ow || th != oh)
- {
- evas_object_move(b->obj.title_clip, tx, ty);
- evas_object_resize(b->obj.title_clip, tw, th);
- b->shape_changed = 1;
- }
-
- if (b->obj.title && b->obj.title->layer != 1)
- {
- e_text_set_layer(b->obj.title, 1);
- b->shape_changed = 1;
}
}
if (visibility_changed)
|