diff --git a/legacy/ecore/src/Ecore.h b/legacy/ecore/src/Ecore.h index b31ddc93d2..2120553778 100644 --- a/legacy/ecore/src/Ecore.h +++ b/legacy/ecore/src/Ecore.h @@ -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); diff --git a/legacy/ecore/src/e_ev_x.c b/legacy/ecore/src/e_ev_x.c index 3c541e765e..ebbf99ec8c 100644 --- a/legacy/ecore/src/e_ev_x.c +++ b/legacy/ecore/src/e_ev_x.c @@ -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])); } diff --git a/legacy/ecore/src/e_events.c b/legacy/ecore/src/e_events.c index 4fe19b7ccc..981defa047 100644 --- a/legacy/ecore/src/e_events.c +++ b/legacy/ecore/src/e_events.c @@ -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; diff --git a/legacy/ecore/src/e_x.c b/legacy/ecore/src/e_x.c index 287081a618..4765586d9f 100644 --- a/legacy/ecore/src/e_x.c +++ b/legacy/ecore/src/e_x.c @@ -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) {