[PATCH weston 14/17] clients: xwm: Remove all references for weston

Tiago Vignatti tiago.vignatti at intel.com
Fri Nov 30 11:20:11 PST 2012


No functional changes.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 clients/xwm.c |  251 ++++++++++++++++++++++++++++-----------------------------
 clients/xwm.h |   12 +--
 2 files changed, 131 insertions(+), 132 deletions(-)

diff --git a/clients/xwm.c b/clients/xwm.c
index 0d0a413..41d446b 100644
--- a/clients/xwm.c
+++ b/clients/xwm.c
@@ -42,7 +42,7 @@ struct xwm {
 	struct wm *wm;
 	struct display *display;
 
-	struct weston_wm *weston_wm;
+	struct xwm_wm *xwm_wm;
 };
 
 struct motif_wm_hints {
@@ -96,8 +96,8 @@ struct motif_wm_hints {
 
 
 
-struct weston_wm_window {
-	struct weston_wm *wm;
+struct xwm_window {
+	struct xwm_wm *wm;
 	xcb_window_t id;
 	xcb_window_t frame_id;
 	cairo_surface_t *cairo_surface;
@@ -106,7 +106,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;
@@ -116,7 +116,7 @@ struct weston_wm_window {
 };
 
 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)
@@ -140,7 +140,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));
@@ -175,7 +175,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)
@@ -185,7 +185,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;
@@ -213,7 +213,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;
@@ -266,7 +266,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;
@@ -286,11 +286,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;
@@ -355,7 +355,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:
@@ -378,8 +378,7 @@ weston_wm_window_read_properties(struct weston_wm_window *window)
 }
 
 static void
-weston_wm_window_get_frame_size(struct weston_wm_window *window,
-				int *width, int *height)
+xwm_window_get_frame_size(struct xwm_window *window, int *width, int *height)
 {
 	struct theme *t = window->wm->theme;
 
@@ -394,7 +393,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;
@@ -409,11 +408,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;
 
@@ -429,7 +428,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;
@@ -449,21 +448,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);
@@ -478,7 +477,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;
 
@@ -491,8 +490,8 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve
 static void
 set_state_activate(struct xwm *xwm, uint32_t id)
 {
-	struct weston_wm *wm = xwm->weston_wm;
-	struct weston_wm_window *window;
+	struct xwm_wm *wm = xwm->xwm_wm;
+	struct xwm_window *window;
 	xcb_client_message_event_t client_message;
 
 	window = hash_table_lookup(wm->window_hash, id);
@@ -518,17 +517,17 @@ set_state_activate(struct xwm *xwm, uint32_t id)
 	}
 
 	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 xwm *xwm, uint32_t id)
 {
-        struct weston_wm *wm = xwm->weston_wm;
-        struct weston_wm_window *window;
+        struct xwm_wm *wm = xwm->xwm_wm;
+        struct xwm_window *window;
         char name[1024];
 
         window = hash_table_lookup(wm->window_hash, id);
@@ -562,7 +561,7 @@ get_window_state(void *data, struct wm *w, uint32_t id, enum wm_state state)
 	}
 }
 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;
 
@@ -576,9 +575,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;
@@ -594,11 +593,11 @@ weston_wm_window_set_state(struct weston_wm_window *window, int32_t state)
 }
 
 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;
 
@@ -613,10 +612,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 |
@@ -656,7 +655,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,
@@ -667,7 +666,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;
 
@@ -681,11 +680,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,
@@ -707,7 +706,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;
 	}
@@ -718,9 +717,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;
@@ -739,10 +738,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);
@@ -793,11 +792,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)
@@ -813,14 +812,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);
@@ -847,14 +846,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;
@@ -868,17 +867,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,
@@ -889,15 +888,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,
@@ -905,17 +904,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[] = {
@@ -928,7 +927,7 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window,
 		THEME_LOCATION_RESIZING_BOTTOM_LEFT,
 		THEME_LOCATION_RESIZING_LEFT
 	};
-	struct weston_wm *wm = window->wm;
+	struct xwm_wm *wm = window->wm;
 	int detail;
 
 	detail = client_message->data.data32[2];
@@ -952,12 +951,12 @@ weston_wm_window_handle_moveresize(struct weston_wm_window *window,
 }
 
 static void
-weston_wm_handle_client_message(struct weston_wm *wm,
+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);
 
@@ -970,7 +969,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 {
@@ -998,7 +997,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);
 
@@ -1012,7 +1011,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;
 
@@ -1052,7 +1051,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,
+xwm_window_set_cursor(struct xwm_wm *wm, xcb_window_t window_id,
 			    int cursor)
 {
 	uint32_t cursor_value_list;
@@ -1069,10 +1068,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;
@@ -1082,7 +1081,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) {
@@ -1112,64 +1111,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;
@@ -1178,49 +1177,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;
 		}
 
@@ -1234,10 +1233,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) },
@@ -1355,9 +1354,9 @@ 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";
+	static const char name[] = "Weston XWM";
 
 	wm->wm_window = xcb_generate_id(wm->conn);
 	xcb_create_window(wm->conn,
@@ -1406,17 +1405,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];
@@ -1448,7 +1447,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 |
@@ -1458,7 +1457,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,
@@ -1469,26 +1468,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);
@@ -1499,9 +1498,9 @@ get_configure(void *data, struct wm *w, uint32_t id, uint32_t edges,
 	      int width, int height)
 {
 	struct xwm *xwm = data;
-	struct weston_wm *wm = xwm->weston_wm;
+	struct xwm_wm *wm = xwm->xwm_wm;
 	struct theme *t = wm->theme;
-	struct weston_wm_window *window;
+	struct xwm_window *window;
 	uint32_t values[2];
 
 	window = hash_table_lookup(wm->window_hash, id);
@@ -1523,7 +1522,7 @@ get_configure(void *data, struct wm *w, uint32_t id, 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,
@@ -1533,7 +1532,7 @@ get_configure(void *data, struct wm *w, uint32_t id, uint32_t edges,
 			     values);
 	xcb_flush(wm->conn);
 
-	weston_wm_window_draw_decoration(window);
+	xwm_window_draw_decoration(window);
 }
 
 static void
@@ -1541,7 +1540,7 @@ get_xserver(void *data, struct wm *w, int32_t fd)
 {
 	struct xwm *xwm = data;
 
-	weston_wm_create(xwm, fd);
+	xwm_create(xwm, fd);
 }
 
 static const struct wm_listener wm_listener = {
@@ -1598,7 +1597,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..aac124d 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,16 @@ 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_wm_selection_init(struct xwm_wm *wm);
 int
-weston_wm_handle_selection_event(struct weston_wm *wm,
+xwm_wm_handle_selection_event(struct xwm_wm *wm,
 				 xcb_generic_event_t *event);
 struct weston_seat *
-weston_wm_pick_seat(struct weston_wm *wm);
+xwm_wm_pick_seat(struct xwm_wm *wm);
-- 
1.7.9.5



More information about the wayland-devel mailing list