forked from enlightenment/efl
parent
3a4c333d9e
commit
048656c31f
|
@ -332,10 +332,18 @@ bg_cb_key_down(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
if (!strcmp(ev->keyname, "s"))
|
if (!strcmp(ev->keyname, "s"))
|
||||||
{
|
{
|
||||||
if (!ecore_evas_shaped_get(ee))
|
if (!ecore_evas_shaped_get(ee))
|
||||||
|
{
|
||||||
|
evas_object_hide(o_bg_rect);
|
||||||
|
evas_object_hide(o_bg);
|
||||||
ecore_evas_shaped_set(ee, 1);
|
ecore_evas_shaped_set(ee, 1);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
evas_object_show(o_bg_rect);
|
||||||
|
evas_object_show(o_bg);
|
||||||
ecore_evas_shaped_set(ee, 0);
|
ecore_evas_shaped_set(ee, 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (!strcmp(ev->keyname, "Up"))
|
if (!strcmp(ev->keyname, "Up"))
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ECORE_FB
|
#ifdef BUILD_ECORE_FB
|
||||||
|
|
|
@ -977,7 +977,18 @@ EAPI int ecore_x_window_prop_window_opacity_get(Ecore_X_Window win)
|
||||||
EAPI void ecore_x_window_prop_state_set(Ecore_X_Window win, Ecore_X_Window_State s);
|
EAPI void ecore_x_window_prop_state_set(Ecore_X_Window win, Ecore_X_Window_State s);
|
||||||
EAPI int ecore_x_window_prop_state_isset(Ecore_X_Window win, Ecore_X_Window_State s);
|
EAPI int ecore_x_window_prop_state_isset(Ecore_X_Window win, Ecore_X_Window_State s);
|
||||||
EAPI void ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s);
|
EAPI void ecore_x_window_prop_state_unset(Ecore_X_Window win, Ecore_X_Window_State s);
|
||||||
|
|
||||||
EAPI void ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask);
|
EAPI void ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask);
|
||||||
|
EAPI void ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win);
|
||||||
|
EAPI void ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y);
|
||||||
|
EAPI void ecore_x_window_shape_rectangle_set(Ecore_X_Window win, int x, int y, int w, int h);
|
||||||
|
EAPI void ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num);
|
||||||
|
EAPI void ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win);
|
||||||
|
EAPI void ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y);
|
||||||
|
EAPI void ecore_x_window_shape_rectangle_add(Ecore_X_Window win, int x, int y, int w, int h);
|
||||||
|
EAPI void ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num);
|
||||||
|
EAPI Ecore_X_Rectangle *ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret);
|
||||||
|
EAPI void ecore_x_window_shape_events_select(Ecore_X_Window win, int on);
|
||||||
|
|
||||||
EAPI Ecore_X_Pixmap ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep);
|
EAPI Ecore_X_Pixmap ecore_x_pixmap_new(Ecore_X_Window win, int w, int h, int dep);
|
||||||
EAPI void ecore_x_pixmap_del(Ecore_X_Pixmap pmap);
|
EAPI void ecore_x_pixmap_del(Ecore_X_Pixmap pmap);
|
||||||
|
|
|
@ -939,6 +939,7 @@ ecore_x_window_client_manage(Ecore_X_Window win)
|
||||||
VisibilityChangeMask |
|
VisibilityChangeMask |
|
||||||
StructureNotifyMask
|
StructureNotifyMask
|
||||||
);
|
);
|
||||||
|
XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -959,6 +960,7 @@ ecore_x_window_client_sniff(Ecore_X_Window win)
|
||||||
ColormapChangeMask |
|
ColormapChangeMask |
|
||||||
VisibilityChangeMask |
|
VisibilityChangeMask |
|
||||||
StructureNotifyMask);
|
StructureNotifyMask);
|
||||||
|
XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1382,7 +1382,15 @@ _ecore_x_event_handle_mapping_notify(XEvent *xevent __UNUSED__)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
_ecore_x_event_handle_shape_change(XEvent *xevent __UNUSED__)
|
_ecore_x_event_handle_shape_change(XEvent *xevent)
|
||||||
{
|
{
|
||||||
/* FIXME: handle this event type */
|
XShapeEvent *shape_event;
|
||||||
|
Ecore_X_Event_Window_Shape *e;
|
||||||
|
|
||||||
|
shape_event = (XShapeEvent *)xevent;
|
||||||
|
e = calloc(1, sizeof(Ecore_X_Event_Window_Shape));
|
||||||
|
if (!e) return;
|
||||||
|
e->win = shape_event->window;
|
||||||
|
e->time = shape_event->time;
|
||||||
|
ecore_event_add(ECORE_X_EVENT_WINDOW_SHAPE, e, NULL, NULL);
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,3 +21,127 @@ ecore_x_window_shape_mask_set(Ecore_X_Window win, Ecore_X_Pixmap mask)
|
||||||
{
|
{
|
||||||
XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
|
XShapeCombineMask(_ecore_x_disp, win, ShapeBounding, 0, 0, mask, ShapeSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_window_set(Ecore_X_Window win, Ecore_X_Window shape_win)
|
||||||
|
{
|
||||||
|
XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_window_set_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y)
|
||||||
|
{
|
||||||
|
XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeSet);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_rectangle_set(Ecore_X_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(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeSet, Unsorted);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_rectangles_set(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
|
||||||
|
{
|
||||||
|
XRectangle *rect = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (num > 0)
|
||||||
|
{
|
||||||
|
rect = alloca(sizeof(XRectangle) * num);
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
rect[i].x = rects[i].x;
|
||||||
|
rect[i].y = rects[i].y;
|
||||||
|
rect[i].width = rects[i].width;
|
||||||
|
rect[i].height = rects[i].height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, rect, num, ShapeSet, Unsorted);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_window_add(Ecore_X_Window win, Ecore_X_Window shape_win)
|
||||||
|
{
|
||||||
|
XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, 0, 0, shape_win, ShapeBounding, ShapeUnion);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_window_add_xy(Ecore_X_Window win, Ecore_X_Window shape_win, int x, int y)
|
||||||
|
{
|
||||||
|
XShapeCombineShape(_ecore_x_disp, win, ShapeBounding, x, y, shape_win, ShapeBounding, ShapeUnion);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_rectangle_add(Ecore_X_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(_ecore_x_disp, win, ShapeBounding, 0, 0, &rect, 1, ShapeUnion, Unsorted);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_rectangles_add(Ecore_X_Window win, Ecore_X_Rectangle *rects, int num)
|
||||||
|
{
|
||||||
|
XRectangle *rect = NULL;
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (num > 0)
|
||||||
|
{
|
||||||
|
rect = alloca(sizeof(XRectangle) * num);
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
rect[i].x = rects[i].x;
|
||||||
|
rect[i].y = rects[i].y;
|
||||||
|
rect[i].width = rects[i].width;
|
||||||
|
rect[i].height = rects[i].height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XShapeCombineRectangles(_ecore_x_disp, win, ShapeBounding, 0, 0, rect, num, ShapeUnion, Unsorted);
|
||||||
|
}
|
||||||
|
|
||||||
|
Ecore_X_Rectangle *
|
||||||
|
ecore_x_window_shape_rectangles_get(Ecore_X_Window win, int *num_ret)
|
||||||
|
{
|
||||||
|
XRectangle *rect;
|
||||||
|
Ecore_X_Rectangle *rects = NULL;
|
||||||
|
int i, num = 0, ord;
|
||||||
|
|
||||||
|
rect = XShapeGetRectangles(_ecore_x_disp, win, ShapeBounding, &num, &ord);
|
||||||
|
if (rect)
|
||||||
|
{
|
||||||
|
rects = malloc(sizeof(Ecore_X_Rectangle) * num);
|
||||||
|
if (rects)
|
||||||
|
{
|
||||||
|
for (i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
rects[i].x = rect[i].x;
|
||||||
|
rects[i].y = rect[i].y;
|
||||||
|
rects[i].width = rect[i].width;
|
||||||
|
rects[i].height = rect[i].height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
XFree(rect);
|
||||||
|
}
|
||||||
|
if (num_ret) *num_ret = num;
|
||||||
|
return rects;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_x_window_shape_events_select(Ecore_X_Window win, int on)
|
||||||
|
{
|
||||||
|
if (on)
|
||||||
|
XShapeSelectInput(_ecore_x_disp, win, ShapeNotifyMask);
|
||||||
|
else
|
||||||
|
XShapeSelectInput(_ecore_x_disp, win, 0);
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue