From d9e7644f7c2f319f76de802dc3ae67f2929d2716 Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 16 May 2013 15:46:44 -0400 Subject: Add more window stubs --- src/test.c | 23 +++++++++++------------ src/window.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 12 deletions(-) diff --git a/src/test.c b/src/test.c index 1078528..4c516b9 100644 --- a/src/test.c +++ b/src/test.c @@ -13,27 +13,27 @@ print_event(XEvent *e) break; case ReparentNotify: printf("got ReparentNotify event: window %d\n", - e->xmap.window); + e->xreparent.window); break; case MotionNotify: printf("got MotionNotify event: window %d\n", - e->xmap.window); + e->xmotion.window); break; case ButtonPress: printf("got ButtonPress event: window %d\n", - e->xmap.window); + e->xbutton.window); break; case ButtonRelease: printf("got ButtonRelease event: window %d\n", - e->xmap.window); + e->xbutton.window); break; case EnterNotify: printf("got EnterNotify event: window %d\n", - e->xmap.window); + e->xcrossing.window); break; case LeaveNotify: printf("got LeaveaNotify event: window %d\n", - e->xmap.window); + e->xcrossing.window); break; default: printf("got event type %d\n", e->type); @@ -42,16 +42,17 @@ print_event(XEvent *e) } static void -wait_for(Display *display, int type) +run(Display *display) { XEvent e; while (1) { XNextEvent(display, &e); print_event(&e); - if (e.type == MapNotify) + switch (e.type) { + case ButtonPress: break; - + } } } @@ -81,9 +82,7 @@ int main(int argc, char *argv[]) XMapWindow(display, win); XFlush(display); - wait_for(display, MapNotify); - - wait_for(display, MapNotify); + run(display); XCloseDisplay(display); diff --git a/src/window.c b/src/window.c index cfdd764..a379ee5 100644 --- a/src/window.c +++ b/src/window.c @@ -243,6 +243,47 @@ XConfigureWindow(Display *xdisplay, Window xwindow, } } +WL_EXPORT int +XReparentWindow(Display *xdisplay, Window xwindow, + Window xparent, int x, int y) +{ + struct csx_display *display = csx_display(xdisplay); + struct csx_window *window, *parent; + + window = csx_display_lookup_resource(display, xwindow); + if (window == NULL) { + csx_display_bad_window(display); + return 0; /* what's the return value? */ + } + + parent = csx_display_lookup_resource(display, xparent); + if (parent == NULL) { + csx_display_bad_window(display); + return 0; /* what's the return value? */ + } + + /* FIXME: Lot more to do here... */ + wl_list_remove(&window->link); + wl_list_insert(&parent->child_list, &window->link); +} + +WL_EXPORT int +XResizeWindow(Display *display, Window xwindow, + unsigned int width, unsigned int height) +{ +} + +WL_EXPORT int +XMoveResizeWindow(Display *display, Window xwindow, + int x, int y, unsigned int width, unsigned int height) +{ +} + +WL_EXPORT int +XMoveWindow(Display *display, Window xwindow, int x, int y) +{ +} + WL_EXPORT int XLowerWindow(Display *xdisplay, Window xwindow) { @@ -256,6 +297,11 @@ XLowerWindow(Display *xdisplay, Window xwindow) } } +WL_EXPORT int +XRaiseWindow(Display *display, Window xwindow) +{ +} + WL_EXPORT int XMapRaised(Display *xdisplay, Window xwindow) { -- cgit v1.2.3