diff options
author | Tiago Vignatti <tiago.vignatti@intel.com> | 2012-12-19 12:47:55 -0200 |
---|---|---|
committer | Tiago Vignatti <tiago.vignatti@intel.com> | 2012-12-28 14:26:17 -0200 |
commit | f0ad69123576e856380ba0133c00632437bbbb43 (patch) | |
tree | 2ee930340e1741a2f88e418dd8a50630e9a931b2 | |
parent | 00c2d43ee783a26fd3920c32e8022a6487fe2f9b (diff) |
clients: xwm: Remove all references for weston
No functional changes.
Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com>
-rw-r--r-- | clients/xwm.c | 248 | ||||
-rw-r--r-- | clients/xwm.h | 13 |
2 files changed, 129 insertions, 132 deletions
diff --git a/clients/xwm.c b/clients/xwm.c index 2d665aa..754ae62 100644 --- a/clients/xwm.c +++ b/clients/xwm.c @@ -43,11 +43,11 @@ struct xwm { struct wm_xwin *wm_xwin; struct display *display; - struct weston_wm *weston_wm; + struct xwm_wm *xwm_wm; }; -struct weston_wm_window { - struct weston_wm *wm; +struct xwm_window { + struct xwm_wm *wm; xcb_window_t id; xcb_window_t frame_id; struct wm_xwin *xwin; @@ -58,7 +58,7 @@ struct weston_wm_window { char *machine; char *class; char *name; - struct weston_wm_window *transient_for; + struct xwm_window *transient_for; uint32_t protocols; xcb_atom_t type; int width, height; @@ -117,7 +117,7 @@ struct motif_wm_hints { #define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */ static void -weston_wm_window_draw_decoration(struct weston_wm_window *window); +xwm_window_draw_decoration(struct xwm_window *window); const char * get_atom_name(xcb_connection_t *c, xcb_atom_t atom) @@ -141,7 +141,7 @@ get_atom_name(xcb_connection_t *c, xcb_atom_t atom) } static xcb_cursor_t -xcb_cursor_image_load_cursor(struct weston_wm *wm, const XcursorImage *img) +xcb_cursor_image_load_cursor(struct xwm_wm *wm, const XcursorImage *img) { xcb_connection_t *c = wm->conn; xcb_screen_iterator_t s = xcb_setup_roots_iterator(xcb_get_setup(c)); @@ -176,7 +176,7 @@ xcb_cursor_image_load_cursor(struct weston_wm *wm, const XcursorImage *img) } static xcb_cursor_t -xcb_cursor_images_load_cursor(struct weston_wm *wm, const XcursorImages *images) +xcb_cursor_images_load_cursor(struct xwm_wm *wm, const XcursorImages *images) { /* TODO: treat animated cursors as well */ if (images->nimage != 1) @@ -186,7 +186,7 @@ xcb_cursor_images_load_cursor(struct weston_wm *wm, const XcursorImages *images) } static xcb_cursor_t -xcb_cursor_library_load_cursor(struct weston_wm *wm, const char *file) +xcb_cursor_library_load_cursor(struct xwm_wm *wm, const char *file) { xcb_cursor_t cursor; XcursorImages *images; @@ -214,7 +214,7 @@ xcb_cursor_library_load_cursor(struct weston_wm *wm, const char *file) } void -dump_property(struct weston_wm *wm, +dump_property(struct xwm_wm *wm, xcb_atom_t property, xcb_get_property_reply_t *reply) { int32_t *incr_value; @@ -267,7 +267,7 @@ dump_property(struct weston_wm *wm, } static void -read_and_dump_property(struct weston_wm *wm, +read_and_dump_property(struct xwm_wm *wm, xcb_window_t window, xcb_atom_t property) { xcb_get_property_reply_t *reply; @@ -287,11 +287,11 @@ read_and_dump_property(struct weston_wm *wm, #define TYPE_MOTIF_WM_HINTS XCB_ATOM_CUT_BUFFER1 static void -weston_wm_window_read_properties(struct weston_wm_window *window) +xwm_window_read_properties(struct xwm_window *window) { - struct weston_wm *wm = window->wm; + struct xwm_wm *wm = window->wm; -#define F(field) offsetof(struct weston_wm_window, field) +#define F(field) offsetof(struct xwm_window, field) const struct { xcb_atom_t atom; xcb_atom_t type; @@ -356,7 +356,7 @@ weston_wm_window_read_properties(struct weston_wm_window *window) break; case XCB_ATOM_WINDOW: xid = xcb_get_property_value(reply); - *(struct weston_wm_window **) p = + *(struct xwm_window **) p = hash_table_lookup(wm->window_hash, *xid); break; case XCB_ATOM_CARDINAL: @@ -379,7 +379,7 @@ weston_wm_window_read_properties(struct weston_wm_window *window) } static void -weston_wm_window_get_frame_size(struct weston_wm_window *window, +xwm_window_get_frame_size(struct xwm_window *window, int *width, int *height) { struct theme *t = window->wm->theme; @@ -395,7 +395,7 @@ weston_wm_window_get_frame_size(struct weston_wm_window *window, } static void -weston_wm_window_get_child_position(struct weston_wm_window *window, +xwm_window_get_child_position(struct xwm_window *window, int *x, int *y) { struct theme *t = window->wm->theme; @@ -410,11 +410,11 @@ weston_wm_window_get_child_position(struct weston_wm_window *window, } static void -weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_configure_request(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_configure_request_event_t *configure_request = (xcb_configure_request_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; uint32_t mask, values[16]; int x, y, width, height, i = 0; @@ -430,7 +430,7 @@ weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *ev if (configure_request->value_mask & XCB_CONFIG_WINDOW_HEIGHT) window->height = configure_request->height; - weston_wm_window_get_child_position(window, &x, &y); + xwm_window_get_child_position(window, &x, &y); values[i++] = x; values[i++] = y; values[i++] = window->width; @@ -450,21 +450,21 @@ weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *ev xcb_configure_window(wm->conn, window->id, mask, values); - weston_wm_window_get_frame_size(window, &width, &height); + xwm_window_get_frame_size(window, &width, &height); values[0] = width; values[1] = height; mask = XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT; xcb_configure_window(wm->conn, window->frame_id, mask, values); - weston_wm_window_draw_decoration(window); + xwm_window_draw_decoration(window); } static void -weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_configure_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_configure_notify_event_t *configure_notify = (xcb_configure_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; int x, y; window = hash_table_lookup(wm->window_hash, configure_notify->window); @@ -479,7 +479,7 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve if (configure_notify->window != window->id) return; - weston_wm_window_get_child_position(window, &x, &y); + xwm_window_get_child_position(window, &x, &y); window->x = configure_notify->x - x; window->y = configure_notify->y - y; @@ -490,7 +490,7 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve } static int -our_resource(struct weston_wm *wm, uint32_t id) +our_resource(struct xwm_wm *wm, uint32_t id) { const xcb_setup_t *setup; @@ -504,9 +504,9 @@ our_resource(struct weston_wm *wm, uint32_t id) #define ICCCM_ICONIC_STATE 3 static void -weston_wm_window_set_state(struct weston_wm_window *window, int32_t state) +xwm_window_set_state(struct xwm_window *window, int32_t state) { - struct weston_wm *wm = window->wm; + struct xwm_wm *wm = window->wm; uint32_t property[2]; property[0] = state; @@ -525,8 +525,8 @@ static void handle_configure(void *data, struct wm_xwin *xwin, uint32_t edges, int width, int height) { - struct weston_wm_window *window = data; - struct weston_wm *wm = window->wm; + struct xwm_window *window = data; + struct xwm_wm *wm = window->wm; struct theme *t = wm->theme; uint32_t values[2]; @@ -547,7 +547,7 @@ handle_configure(void *data, struct wm_xwin *xwin, uint32_t edges, XCB_CONFIG_WINDOW_HEIGHT, values); - weston_wm_window_get_frame_size(window, &width, &height); + xwm_window_get_frame_size(window, &width, &height); values[0] = width; values[1] = height; xcb_configure_window(wm->conn, @@ -557,13 +557,13 @@ handle_configure(void *data, struct wm_xwin *xwin, uint32_t edges, values); xcb_flush(wm->conn); - weston_wm_window_draw_decoration(window); + xwm_window_draw_decoration(window); } static void -set_state_activate(struct xwm *xwm, struct weston_wm_window *window) +set_state_activate(struct xwm *xwm, struct xwm_window *window) { - struct weston_wm *wm = xwm->weston_wm; + struct xwm_wm *wm = xwm->xwm_wm; xcb_client_message_event_t client_message; if (window) { @@ -588,14 +588,14 @@ set_state_activate(struct xwm *xwm, struct weston_wm_window *window) } if (wm->focus_window) - weston_wm_window_draw_decoration(wm->focus_window); + xwm_window_draw_decoration(wm->focus_window); wm->focus_window = window; if (wm->focus_window) - weston_wm_window_draw_decoration(wm->focus_window); + xwm_window_draw_decoration(wm->focus_window); } static void -set_state_kill(struct weston_wm_window *window) +set_state_kill(struct xwm_window *window) { char name[1024]; @@ -611,7 +611,7 @@ set_state_kill(struct weston_wm_window *window) static void handle_state(void *data, struct wm_xwin *xwin, enum wm_xwin_state state) { - struct weston_wm_window *window = data; + struct xwm_window *window = data; switch (state) { case WM_XWIN_STATE_ACTIVATE: @@ -629,11 +629,11 @@ static const struct wm_xwin_listener wm_xwin_listener = { }; static void -weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_map_request(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_map_request_event_t *map_request = (xcb_map_request_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; uint32_t values[1]; int x, y, width, height; @@ -648,10 +648,10 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) if (window->frame_id) return; - weston_wm_window_read_properties(window); + xwm_window_read_properties(window); - weston_wm_window_get_frame_size(window, &width, &height); - weston_wm_window_get_child_position(window, &x, &y); + xwm_window_get_frame_size(window, &width, &height); + xwm_window_get_child_position(window, &x, &y); values[0] = XCB_EVENT_MASK_KEY_PRESS | @@ -694,7 +694,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) xcb_map_window(wm->conn, map_request->window); xcb_map_window(wm->conn, window->frame_id); - weston_wm_window_set_state(window, ICCCM_NORMAL_STATE); + xwm_window_set_state(window, ICCCM_NORMAL_STATE); window->cairo_surface = cairo_xcb_surface_create_with_xrender_format(wm->conn, @@ -705,7 +705,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event) } static void -weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_map_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_map_notify_event_t *map_notify = (xcb_map_notify_event_t *) event; @@ -719,11 +719,11 @@ weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event) } static void -weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_unmap_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_unmap_notify_event_t *unmap_notify = (xcb_unmap_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; fprintf(stderr, "XCB_UNMAP_NOTIFY (window %d, event %d%s)\n", unmap_notify->window, @@ -745,7 +745,7 @@ weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event) if (window->frame_id) { xcb_reparent_window(wm->conn, window->id, wm->wm_window, 0, 0); xcb_destroy_window(wm->conn, window->frame_id); - weston_wm_window_set_state(window, ICCCM_WITHDRAWN_STATE); + xwm_window_set_state(window, ICCCM_WITHDRAWN_STATE); hash_table_remove(wm->window_hash, window->frame_id); window->frame_id = XCB_WINDOW_NONE; } @@ -756,9 +756,9 @@ weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event) } static void -weston_wm_window_draw_decoration(struct weston_wm_window *window) +xwm_window_draw_decoration(struct xwm_window *window) { - struct weston_wm *wm = window->wm; + struct xwm_wm *wm = window->wm; struct theme *t = wm->theme; cairo_t *cr; int x, y, width, height; @@ -777,10 +777,10 @@ weston_wm_window_draw_decoration(struct weston_wm_window *window) return; } - weston_wm_window_read_properties(window); + xwm_window_read_properties(window); - weston_wm_window_get_frame_size(window, &width, &height); - weston_wm_window_get_child_position(window, &x, &y); + xwm_window_get_frame_size(window, &width, &height); + xwm_window_get_child_position(window, &x, &y); cairo_xcb_surface_set_size(window->cairo_surface, width, height); cr = cairo_create(window->cairo_surface); @@ -831,11 +831,11 @@ weston_wm_window_draw_decoration(struct weston_wm_window *window) } static void -weston_wm_handle_property_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_property_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_property_notify_event_t *property_notify = (xcb_property_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; window = hash_table_lookup(wm->window_hash, property_notify->window); if (window) @@ -851,14 +851,14 @@ weston_wm_handle_property_notify(struct weston_wm *wm, xcb_generic_event_t *even if (property_notify->atom == wm->atom.net_wm_name || property_notify->atom == XCB_ATOM_WM_NAME) - weston_wm_window_draw_decoration(window); + xwm_window_draw_decoration(window); } static void -weston_wm_window_create(struct weston_wm *wm, +xwm_window_create(struct xwm_wm *wm, xcb_window_t id, int width, int height, int override) { - struct weston_wm_window *window; + struct xwm_window *window; uint32_t values[1]; window = malloc(sizeof *window); @@ -888,14 +888,14 @@ weston_wm_window_create(struct weston_wm *wm, } static void -weston_wm_window_destroy(struct weston_wm_window *window) +xwm_window_destroy(struct xwm_window *window) { hash_table_remove(window->wm->window_hash, window->id); free(window); } static void -weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_create_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_create_notify_event_t *create_notify = (xcb_create_notify_event_t *) event; @@ -909,17 +909,17 @@ weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event) if (our_resource(wm, create_notify->window)) return; - weston_wm_window_create(wm, create_notify->window, + xwm_window_create(wm, create_notify->window, create_notify->width, create_notify->height, create_notify->override_redirect); } static void -weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_destroy_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_destroy_notify_event_t *destroy_notify = (xcb_destroy_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; fprintf(stderr, "XCB_DESTROY_NOTIFY, win %d, event %d%s\n", destroy_notify->window, @@ -930,15 +930,15 @@ weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event return; window = hash_table_lookup(wm->window_hash, destroy_notify->window); - weston_wm_window_destroy(window); + xwm_window_destroy(window); } static void -weston_wm_handle_reparent_notify(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_reparent_notify(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_reparent_notify_event_t *reparent_notify = (xcb_reparent_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; fprintf(stderr, "XCB_REPARENT_NOTIFY (window %d, parent %d, event %d)\n", reparent_notify->window, @@ -946,17 +946,17 @@ weston_wm_handle_reparent_notify(struct weston_wm *wm, xcb_generic_event_t *even reparent_notify->event); if (reparent_notify->parent == wm->screen->root) { - weston_wm_window_create(wm, reparent_notify->window, 10, 10, + xwm_window_create(wm, reparent_notify->window, 10, 10, reparent_notify->override_redirect); } else if (!our_resource(wm, reparent_notify->parent)) { window = hash_table_lookup(wm->window_hash, reparent_notify->window); - weston_wm_window_destroy(window); + xwm_window_destroy(window); } } static void -weston_wm_window_handle_moveresize(struct weston_wm_window *window, +xwm_window_handle_moveresize(struct xwm_window *window, xcb_client_message_event_t *client_message) { static const int map[] = { @@ -992,12 +992,11 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window, } static void -weston_wm_handle_client_message(struct weston_wm *wm, - xcb_generic_event_t *event) +xwm_handle_client_message(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_client_message_event_t *client_message = (xcb_client_message_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; window = hash_table_lookup(wm->window_hash, client_message->window); @@ -1010,7 +1009,7 @@ weston_wm_handle_client_message(struct weston_wm *wm, client_message->data.data32[4]); if (client_message->type == wm->atom.net_wm_moveresize) - weston_wm_window_handle_moveresize(window, client_message); + xwm_window_handle_moveresize(window, client_message); } enum xwm_cursor_type { @@ -1038,7 +1037,7 @@ static const char *cursors[] = { }; static void -weston_wm_create_cursors(struct weston_wm *wm) +xwm_create_cursors(struct xwm_wm *wm) { int i, count = ARRAY_LENGTH(cursors); @@ -1052,7 +1051,7 @@ weston_wm_create_cursors(struct weston_wm *wm) } static void -weston_wm_destroy_cursors(struct weston_wm *wm) +xwm_destroy_cursors(struct xwm_wm *wm) { uint8_t i; @@ -1092,8 +1091,7 @@ get_cursor_for_location(struct theme *t, int width, int height, int x, int y) } static void -weston_wm_window_set_cursor(struct weston_wm *wm, xcb_window_t window_id, - int cursor) +xwm_window_set_cursor(struct xwm_wm *wm, xcb_window_t window_id, int cursor) { uint32_t cursor_value_list; @@ -1109,10 +1107,10 @@ weston_wm_window_set_cursor(struct weston_wm *wm, xcb_window_t window_id, } static void -weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_button(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_button_press_event_t *button = (xcb_button_press_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; enum theme_location location; struct theme *t = wm->theme; int width, height; @@ -1122,7 +1120,7 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) "PRESS" : "RELEASE", button->detail); window = hash_table_lookup(wm->window_hash, button->event); - weston_wm_window_get_frame_size(window, &width, &height); + xwm_window_get_frame_size(window, &width, &height); if (button->response_type == XCB_BUTTON_PRESS && button->detail == 1) { @@ -1152,64 +1150,64 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event) } static void -weston_wm_handle_motion(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_motion(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_motion_notify_event_t *motion = (xcb_motion_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; int cursor, width, height; window = hash_table_lookup(wm->window_hash, motion->event); if (!window || !window->decorate) return; - weston_wm_window_get_frame_size(window, &width, &height); + xwm_window_get_frame_size(window, &width, &height); cursor = get_cursor_for_location(wm->theme, width, height, motion->event_x, motion->event_y); - weston_wm_window_set_cursor(wm, window->frame_id, cursor); + xwm_window_set_cursor(wm, window->frame_id, cursor); } static void -weston_wm_handle_enter(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_enter(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_enter_notify_event_t *enter = (xcb_enter_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; int cursor, width, height; window = hash_table_lookup(wm->window_hash, enter->event); if (!window || !window->decorate) return; - weston_wm_window_get_frame_size(window, &width, &height); + xwm_window_get_frame_size(window, &width, &height); cursor = get_cursor_for_location(wm->theme, width, height, enter->event_x, enter->event_y); - weston_wm_window_set_cursor(wm, window->frame_id, cursor); + xwm_window_set_cursor(wm, window->frame_id, cursor); } static void -weston_wm_handle_leave(struct weston_wm *wm, xcb_generic_event_t *event) +xwm_handle_leave(struct xwm_wm *wm, xcb_generic_event_t *event) { xcb_leave_notify_event_t *leave = (xcb_leave_notify_event_t *) event; - struct weston_wm_window *window; + struct xwm_window *window; window = hash_table_lookup(wm->window_hash, leave->event); if (!window || !window->decorate) return; - weston_wm_window_set_cursor(wm, window->frame_id, XWM_CURSOR_LEFT_PTR); + xwm_window_set_cursor(wm, window->frame_id, XWM_CURSOR_LEFT_PTR); } static int -weston_wm_handle_event(int fd, uint32_t mask, void *data) +xwm_handle_event(int fd, uint32_t mask, void *data) { - struct weston_wm *wm = data; + struct xwm_wm *wm = data; xcb_generic_event_t *event; int count = 0; while (event = xcb_poll_for_event(wm->conn), event != NULL) { #if 0 - if (weston_wm_handle_selection_event(wm, event)) { + if (xwm_handle_selection_event(wm, event)) { free(event); count++; continue; @@ -1218,49 +1216,49 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data) switch (event->response_type & ~0x80) { case XCB_BUTTON_PRESS: case XCB_BUTTON_RELEASE: - weston_wm_handle_button(wm, event); + xwm_handle_button(wm, event); break; case XCB_ENTER_NOTIFY: - weston_wm_handle_enter(wm, event); + xwm_handle_enter(wm, event); break; case XCB_LEAVE_NOTIFY: - weston_wm_handle_leave(wm, event); + xwm_handle_leave(wm, event); break; case XCB_MOTION_NOTIFY: - weston_wm_handle_motion(wm, event); + xwm_handle_motion(wm, event); break; case XCB_CREATE_NOTIFY: - weston_wm_handle_create_notify(wm, event); + xwm_handle_create_notify(wm, event); break; case XCB_MAP_REQUEST: - weston_wm_handle_map_request(wm, event); + xwm_handle_map_request(wm, event); break; case XCB_MAP_NOTIFY: - weston_wm_handle_map_notify(wm, event); + xwm_handle_map_notify(wm, event); break; case XCB_UNMAP_NOTIFY: - weston_wm_handle_unmap_notify(wm, event); + xwm_handle_unmap_notify(wm, event); break; case XCB_REPARENT_NOTIFY: - weston_wm_handle_reparent_notify(wm, event); + xwm_handle_reparent_notify(wm, event); break; case XCB_CONFIGURE_REQUEST: - weston_wm_handle_configure_request(wm, event); + xwm_handle_configure_request(wm, event); break; case XCB_CONFIGURE_NOTIFY: - weston_wm_handle_configure_notify(wm, event); + xwm_handle_configure_notify(wm, event); break; case XCB_DESTROY_NOTIFY: - weston_wm_handle_destroy_notify(wm, event); + xwm_handle_destroy_notify(wm, event); break; case XCB_MAPPING_NOTIFY: fprintf(stderr, "XCB_MAPPING_NOTIFY\n"); break; case XCB_PROPERTY_NOTIFY: - weston_wm_handle_property_notify(wm, event); + xwm_handle_property_notify(wm, event); break; case XCB_CLIENT_MESSAGE: - weston_wm_handle_client_message(wm, event); + xwm_handle_client_message(wm, event); break; } @@ -1274,10 +1272,10 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data) } static void -weston_wm_get_resources(struct weston_wm *wm) +xwm_get_resources(struct xwm_wm *wm) { -#define F(field) offsetof(struct weston_wm, field) +#define F(field) offsetof(struct xwm_wm, field) static const struct { const char *name; int offset; } atoms[] = { { "WM_PROTOCOLS", F(atom.wm_protocols) }, @@ -1395,7 +1393,7 @@ weston_wm_get_resources(struct weston_wm *wm) } static void -weston_wm_create_wm_window(struct weston_wm *wm) +xwm_create_wm_window(struct xwm_wm *wm) { static const char name[] = "Weston WM"; @@ -1446,17 +1444,17 @@ weston_wm_create_wm_window(struct weston_wm *wm) static void wm_func(struct task *task, uint32_t events) { - struct weston_wm *wm = - container_of(task, struct weston_wm, wm_task); + struct xwm_wm *wm = + container_of(task, struct xwm_wm, wm_task); - weston_wm_handle_event(0, 0, wm); + xwm_handle_event(0, 0, wm); } static void -weston_wm_create(struct xwm *xwm, int fd) +xwm_create(struct xwm *xwm, int fd) { struct display *display = xwm->display; - struct weston_wm *wm; + struct xwm_wm *wm; xcb_screen_iterator_t s; uint32_t values[1]; xcb_atom_t supported[1]; @@ -1488,7 +1486,7 @@ weston_wm_create(struct xwm *xwm, int fd) s = xcb_setup_roots_iterator(xcb_get_setup(wm->conn)); wm->screen = s.data; - weston_wm_get_resources(wm); + xwm_get_resources(wm); values[0] = XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | @@ -1498,7 +1496,7 @@ weston_wm_create(struct xwm *xwm, int fd) XCB_CW_EVENT_MASK, values); wm->theme = theme_create(); - weston_wm_create_wm_window(wm); + xwm_create_wm_window(wm); supported[0] = wm->atom.net_wm_moveresize; xcb_change_property(wm->conn, @@ -1509,26 +1507,26 @@ weston_wm_create(struct xwm *xwm, int fd) 32, /* format */ ARRAY_LENGTH(supported), supported); #if 0 - weston_wm_selection_init(wm); + xwm_selection_init(wm); #endif xcb_flush(wm->conn); - weston_wm_create_cursors(wm); - weston_wm_window_set_cursor(wm, wm->screen->root, XWM_CURSOR_LEFT_PTR); + xwm_create_cursors(wm); + xwm_window_set_cursor(wm, wm->screen->root, XWM_CURSOR_LEFT_PTR); wm->xwm = xwm; - xwm->weston_wm = wm; + xwm->xwm_wm = wm; fprintf(stderr, "weston-xwm: connected to X\n"); wm_is_ready(wm->xwm->wm); } static void -weston_wm_destroy(struct weston_wm *wm) +xwm_destroy(struct xwm_wm *wm) { /* FIXME: Free windows in hash. */ hash_table_destroy(wm->window_hash); - weston_wm_destroy_cursors(wm); + xwm_destroy_cursors(wm); xcb_disconnect(wm->conn); free(wm); @@ -1539,7 +1537,7 @@ wm_handle_xserver(void *data, struct wm *w, int32_t fd) { struct xwm *xwm = data; - weston_wm_create(xwm, fd); + xwm_create(xwm, fd); } static void @@ -1603,7 +1601,7 @@ main(int argc, char **argv) display_run(xwm.display); - weston_wm_destroy(xwm.weston_wm); + xwm_destroy(xwm.xwm_wm); display_destroy(xwm.display); return 0; diff --git a/clients/xwm.h b/clients/xwm.h index 8862fc4..14cccb4 100644 --- a/clients/xwm.h +++ b/clients/xwm.h @@ -26,7 +26,7 @@ #include "window.h" -struct weston_wm { +struct xwm_wm { struct xwm *xwm; struct task wm_task; xcb_connection_t *conn; @@ -34,7 +34,7 @@ struct weston_wm { xcb_screen_t *screen; struct hash_table *window_hash; xcb_window_t wm_window; - struct weston_wm_window *focus_window; + struct xwm_window *focus_window; struct theme *theme; xcb_cursor_t *cursors; int last_cursor; @@ -104,16 +104,15 @@ struct weston_wm { }; void -dump_property(struct weston_wm *wm, xcb_atom_t property, +dump_property(struct xwm_wm *wm, xcb_atom_t property, xcb_get_property_reply_t *reply); const char * get_atom_name(xcb_connection_t *c, xcb_atom_t atom); void -weston_wm_selection_init(struct weston_wm *wm); +xwm_selection_init(struct xwm_wm *wm); int -weston_wm_handle_selection_event(struct weston_wm *wm, - xcb_generic_event_t *event); +xwm_handle_selection_event(struct xwm_wm *wm, xcb_generic_event_t *event); struct weston_seat * -weston_wm_pick_seat(struct weston_wm *wm); +xwm_pick_seat(struct xwm_wm *wm); |