more stuff to support shape handling for e17... :)

SVN revision: 4005
This commit is contained in:
Carsten Haitzler 2000-12-18 21:26:17 +00:00
parent f6caa2df4d
commit 25a9c709bd
4 changed files with 102 additions and 4 deletions

View File

@ -90,6 +90,17 @@ Pixmap e_pixmap_new(Window win, int w, int h, int dep);
void e_pixmap_free(Pixmap pmap);
void e_window_set_background_pixmap(Window win, Pixmap pmap);
void e_window_set_shape_mask(Window win, Pixmap mask);
void e_window_add_shape_mask(Window win, Pixmap mask);
void e_window_set_shape_window(Window win, Window src, int x, int y);
void e_window_add_shape_window(Window win, Window src, int x, int y);
void e_window_set_shape_rectangle(Window win, int x, int y, int w, int h);
void e_window_add_shape_rectangle(Window win, int x, int y, int w, int h);
void e_window_set_shape_rectangles(Window win, XRectangle *rect, int num);
void e_window_add_shape_rectangles(Window win, XRectangle *rect, int num);
void e_window_clip_shape_by_rectangle(Window win, int x, int y, int w, int h);
XRectangle *e_window_get_shape_rectangles(Window win, int *num);
void e_window_select_shape_events(Window win);
void e_window_unselect_shape_events(Window win);
void e_window_clear(Window win);
void e_window_clear_area(Window win, int x, int y, int w, int h);
void e_pointer_xy(Window win, int *x, int *y);

View File

@ -97,11 +97,12 @@ e_ev_x_init(void)
event_translator[ClientMessage] = e_ev_x_handle_client_message;
event_translator[SelectionNotify] = e_ev_x_handle_selection_notify;
event_translator[SelectionRequest] = e_ev_x_handle_selection_request;
for (i = SelectionRequest + 1; i < shape_event_id; i++) event_translator[i] = NULL;
event_translator[shape_event_id] = e_ev_x_handle_shape_change;
lock_mask_scroll = e_lock_mask_num_get();
lock_mask_scroll = e_lock_mask_scroll_get();
lock_mask_num = e_lock_mask_num_get();
lock_mask_caps = e_lock_mask_scroll_get();
lock_mask_caps = e_lock_mask_caps_get();
mod_mask_shift = e_mod_mask_shift_get();
mod_mask_ctrl = e_mod_mask_ctrl_get();
@ -176,7 +177,7 @@ e_ev_x_translate_events(XEvent * events, int num_events)
for (i = 0; i < num_events; i++)
{
if ((events[i].type < max_event_id) &&
if ((events[i].type <= max_event_id) &&
(event_translator[events[i].type]))
(*(event_translator[events[i].type])) (&(events[i]));
}

View File

@ -346,7 +346,7 @@ e_del_event_timer(char *name)
while (ptr)
{
timer = ptr;
if (strcmp(timer->name, name))
if (!strcmp(timer->name, name))
{
void *data;

View File

@ -414,6 +414,92 @@ e_window_set_shape_mask(Window win, Pixmap mask)
XShapeCombineMask(disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
}
void
e_window_add_shape_mask(Window win, Pixmap mask)
{
XShapeCombineMask(disp, win, ShapeBounding, 0, 0, mask, ShapeUnion);
}
void
e_window_set_shape_window(Window win, Window src, int x, int y)
{
XShapeCombineShape(disp, win, ShapeBounding, x, y, src, ShapeBounding, ShapeSet);
}
void
e_window_add_shape_window(Window win, Window src, int x, int y)
{
XShapeCombineShape(disp, win, ShapeBounding, x, y, src, ShapeBounding, ShapeUnion);
}
void
e_window_set_shape_rectangle(Window win, int x, int y, int w, int h)
{
XRectangle rect;
rect.x = x;
rect.y = y;
rect.width = w;
rect.height = h;
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, Unsorted);
}
void
e_window_add_shape_rectangle(Window win, int x, int y, int w, int h)
{
XRectangle rect;
rect.x = x;
rect.y = y;
rect.width = w;
rect.height = h;
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeUnion, Unsorted);
}
void
e_window_set_shape_rectangles(Window win, XRectangle *rect, int num)
{
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rect, num, ShapeSet, Unsorted);
}
void
e_window_add_shape_rectangles(Window win, XRectangle *rect, int num)
{
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, rect, num, ShapeUnion, Unsorted);
}
void
e_window_clip_shape_by_rectangle(Window win, int x, int y, int w, int h)
{
XRectangle rect;
rect.x = x;
rect.y = y;
rect.width = w;
rect.height = h;
XShapeCombineRectangles(disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeIntersect, Unsorted);
}
XRectangle *
e_window_get_shape_rectangles(Window win, int *num)
{
int ord;
return XShapeGetRectangles(disp, win, ShapeBounding, num, &ord);
}
void
e_window_select_shape_events(Window win)
{
XShapeSelectInput(disp, win, ShapeNotifyMask);
}
void
e_window_unselect_shape_events(Window win)
{
XShapeSelectInput(disp, win, 0);
}
void
e_window_clear(Window win)
{