[PATCH weston 10/17] xwm: Change weston_log by fprintf

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


In preparation for split xwm as a client.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 src/xwayland/window-manager.c |   68 ++++++++++++++++++++---------------------
 1 file changed, 34 insertions(+), 34 deletions(-)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 806cf8d..e228176 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -224,13 +224,13 @@ dump_property(struct weston_wm *wm,
 	int width, len;
 	uint32_t i;
 
-	width = weston_log_continue("%s: ", get_atom_name(wm->conn, property));
+	width = fprintf(stderr, "%s: ", get_atom_name(wm->conn, property));
 	if (reply == NULL) {
-		weston_log_continue("(no reply)\n");
+		fprintf(stderr, "(no reply)\n");
 		return;
 	}
 
-	width += weston_log_continue(
+	width += fprintf(stderr,
 			 "%s/%d, length %d (value_len %d): ",
 			 get_atom_name(wm->conn, reply->type),
 			 reply->format,
@@ -239,7 +239,7 @@ dump_property(struct weston_wm *wm,
 
 	if (reply->type == wm->atom.incr) {
 		incr_value = xcb_get_property_value(reply);
-		weston_log_continue("%d\n", *incr_value);
+		fprintf(stderr, "%d\n", *incr_value);
 	} else if (reply->type == wm->atom.utf8_string ||
 	      reply->type == wm->atom.string) {
 		text_value = xcb_get_property_value(reply);
@@ -247,23 +247,23 @@ dump_property(struct weston_wm *wm,
 			len = 40;
 		else
 			len = reply->value_len;
-		weston_log_continue("\"%.*s\"\n", len, text_value);
+		fprintf(stderr, "\"%.*s\"\n", len, text_value);
 	} else if (reply->type == XCB_ATOM_ATOM) {
 		atom_value = xcb_get_property_value(reply);
 		for (i = 0; i < reply->value_len; i++) {
 			name = get_atom_name(wm->conn, atom_value[i]);
 			if (width + strlen(name) + 2 > 78) {
-				weston_log_continue("\n    ");
+				fprintf(stderr, "\n    ");
 				width = 4;
 			} else if (i > 0) {
-				width +=  weston_log_continue(", ");
+				width +=  fprintf(stderr, ", ");
 			}
 
-			width +=  weston_log_continue("%s", name);
+			width +=  fprintf(stderr, "%s", name);
 		}
-		weston_log_continue("\n");
+		fprintf(stderr, "\n");
 	} else {
-		weston_log_continue("huh?\n");
+		fprintf(stderr, "huh?\n");
 	}
 }
 
@@ -419,7 +419,7 @@ weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *ev
 	uint32_t mask, values[16];
 	int x, y, width, height, i = 0;
 
-	weston_log("XCB_CONFIGURE_REQUEST (window %d) %d,%d @ %dx%d\n",
+	fprintf(stderr, "XCB_CONFIGURE_REQUEST (window %d) %d,%d @ %dx%d\n",
 		configure_request->window,
 		configure_request->x, configure_request->y,
 		configure_request->width, configure_request->height);
@@ -470,7 +470,7 @@ weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *eve
 
 	window = hash_table_lookup(wm->window_hash, configure_notify->window);
 
-	weston_log("XCB_CONFIGURE_NOTIFY (%s window %d) %d,%d @ %dx%d\n",
+	fprintf(stderr, "XCB_CONFIGURE_NOTIFY (%s window %d) %d,%d @ %dx%d\n",
 		configure_notify->window == window->id ? "client" : "frame",
 		configure_notify->window,
 		configure_notify->x, configure_notify->y,
@@ -583,7 +583,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
 	int x, y, width, height;
 
 	if (our_resource(wm, map_request->window)) {
-		weston_log("XCB_MAP_REQUEST (window %d, ours)\n",
+		fprintf(stderr, "XCB_MAP_REQUEST (window %d, ours)\n",
 			map_request->window);
 		return;
 	}
@@ -626,7 +626,7 @@ weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
 	xcb_configure_window(wm->conn, window->id,
 			     XCB_CONFIG_WINDOW_BORDER_WIDTH, values);
 
-	weston_log("XCB_MAP_REQUEST (window %d, %p, frame %d)\n",
+	fprintf(stderr, "XCB_MAP_REQUEST (window %d, %p, frame %d)\n",
 		window->id, window, window->frame_id);
 
 	xcb_map_window(wm->conn, map_request->window);
@@ -649,12 +649,12 @@ weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 	xcb_map_notify_event_t *map_notify = (xcb_map_notify_event_t *) event;
 
 	if (our_resource(wm, map_notify->window)) {
-			weston_log("XCB_MAP_NOTIFY (window %d, ours)\n",
+			fprintf(stderr, "XCB_MAP_NOTIFY (window %d, ours)\n",
 				map_notify->window);
 			return;
 	}
 
-	weston_log("XCB_MAP_NOTIFY (window %d)\n", map_notify->window);
+	fprintf(stderr, "XCB_MAP_NOTIFY (window %d)\n", map_notify->window);
 }
 
 static void
@@ -664,7 +664,7 @@ weston_wm_handle_unmap_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 		(xcb_unmap_notify_event_t *) event;
 	struct weston_wm_window *window;
 
-	weston_log("XCB_UNMAP_NOTIFY (window %d, event %d%s)\n",
+	fprintf(stderr, "XCB_UNMAP_NOTIFY (window %d, event %d%s)\n",
 		unmap_notify->window,
 		unmap_notify->event,
 		our_resource(wm, unmap_notify->window) ? ", ours" : "");
@@ -782,10 +782,10 @@ weston_wm_handle_property_notify(struct weston_wm *wm, xcb_generic_event_t *even
 	if (window)
 		window->properties_dirty = 1;
 
-	weston_log("XCB_PROPERTY_NOTIFY: window %d, ",
+	fprintf(stderr, "XCB_PROPERTY_NOTIFY: window %d, ",
 		property_notify->window);
 	if (property_notify->state == XCB_PROPERTY_DELETE)
-		weston_log("deleted\n");
+		fprintf(stderr, "deleted\n");
 	else
 		read_and_dump_property(wm, property_notify->window,
 				       property_notify->atom);
@@ -804,7 +804,7 @@ weston_wm_window_create(struct weston_wm *wm,
 
 	window = malloc(sizeof *window);
 	if (window == NULL) {
-		weston_log("failed to allocate window\n");
+		fprintf(stderr, "failed to allocate window\n");
 		return;
 	}
 
@@ -835,7 +835,7 @@ weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event)
 	xcb_create_notify_event_t *create_notify =
 		(xcb_create_notify_event_t *) event;
 
-	weston_log("XCB_CREATE_NOTIFY (window %d, width %d, height %d%s%s)\n",
+	fprintf(stderr, "XCB_CREATE_NOTIFY (window %d, width %d, height %d%s%s)\n",
 		create_notify->window,
 		create_notify->width, create_notify->height,
 		create_notify->override_redirect ? ", override" : "",
@@ -856,7 +856,7 @@ weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event
 		(xcb_destroy_notify_event_t *) event;
 	struct weston_wm_window *window;
 
-	weston_log("XCB_DESTROY_NOTIFY, win %d, event %d%s\n",
+	fprintf(stderr, "XCB_DESTROY_NOTIFY, win %d, event %d%s\n",
 		destroy_notify->window,
 		destroy_notify->event,
 		our_resource(wm, destroy_notify->window) ? ", ours" : "");
@@ -875,7 +875,7 @@ weston_wm_handle_reparent_notify(struct weston_wm *wm, xcb_generic_event_t *even
 		(xcb_reparent_notify_event_t *) event;
 	struct weston_wm_window *window;
 
-	weston_log("XCB_REPARENT_NOTIFY (window %d, parent %d, event %d)\n",
+	fprintf(stderr, "XCB_REPARENT_NOTIFY (window %d, parent %d, event %d)\n",
 		reparent_notify->window,
 		reparent_notify->parent,
 		reparent_notify->event);
@@ -952,7 +952,7 @@ weston_wm_handle_client_message(struct weston_wm *wm,
 
 	window = hash_table_lookup(wm->window_hash, client_message->window);
 
-	weston_log("XCB_CLIENT_MESSAGE (%s %d %d %d %d %d)\n",
+	fprintf(stderr, "XCB_CLIENT_MESSAGE (%s %d %d %d %d %d)\n",
 		get_atom_name(wm->conn, client_message->type),
 		client_message->data.data32[0],
 		client_message->data.data32[1],
@@ -1071,7 +1071,7 @@ weston_wm_handle_button(struct weston_wm *wm, xcb_generic_event_t *event)
 	struct theme *t = wm->theme;
 	int width, height;
 
-	weston_log("XCB_BUTTON_%s (detail %d)\n",
+	fprintf(stderr, "XCB_BUTTON_%s (detail %d)\n",
 		button->response_type == XCB_BUTTON_PRESS ?
 		"PRESS" : "RELEASE", button->detail);
 
@@ -1209,7 +1209,7 @@ weston_wm_handle_event(int fd, uint32_t mask, void *data)
 			weston_wm_handle_destroy_notify(wm, event);
 			break;
 		case XCB_MAPPING_NOTIFY:
-			weston_log("XCB_MAPPING_NOTIFY\n");
+			fprintf(stderr, "XCB_MAPPING_NOTIFY\n");
 			break;
 		case XCB_PROPERTY_NOTIFY:
 			weston_wm_handle_property_notify(wm, event);
@@ -1313,7 +1313,7 @@ weston_wm_get_resources(struct weston_wm *wm)
 
 	wm->xfixes = xcb_get_extension_data(wm->conn, &xcb_xfixes_id);
 	if (!wm->xfixes || !wm->xfixes->present)
-		weston_log("xfixes not available\n");
+		fprintf(stderr, "xfixes not available\n");
 
 	xfixes_cookie = xcb_xfixes_query_version(wm->conn,
 						 XCB_XFIXES_MAJOR_VERSION,
@@ -1321,7 +1321,7 @@ weston_wm_get_resources(struct weston_wm *wm)
 	xfixes_reply = xcb_xfixes_query_version_reply(wm->conn,
 						      xfixes_cookie, NULL);
 
-	weston_log("xfixes version: %d.%d\n",
+	fprintf(stderr, "xfixes version: %d.%d\n",
 	       xfixes_reply->major_version, xfixes_reply->minor_version);
 
 	free(xfixes_reply);
@@ -1421,7 +1421,7 @@ weston_wm_create(struct weston_xserver *wxs)
 	}
 
 	if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) {
-		weston_log("socketpair failed\n");
+		fprintf(stderr, "socketpair failed\n");
 		hash_table_destroy(wm->window_hash);
 		free(wm);
 		return NULL;
@@ -1434,7 +1434,7 @@ weston_wm_create(struct weston_xserver *wxs)
 	/* xcb_connect_to_fd takes ownership of the fd. */
 	wm->conn = xcb_connect_to_fd(sv[0], NULL);
 	if (xcb_connection_has_error(wm->conn)) {
-		weston_log("xcb_connect_to_fd failed\n");
+		fprintf(stderr, "xcb_connect_to_fd failed\n");
 		close(sv[0]);
 		hash_table_destroy(wm->window_hash);
 		free(wm);
@@ -1486,7 +1486,7 @@ weston_wm_create(struct weston_xserver *wxs)
 	weston_wm_create_cursors(wm);
 	weston_wm_window_set_cursor(wm, wm->screen->root, XWM_CURSOR_LEFT_PTR);
 
-	weston_log("created wm\n");
+	fprintf(stderr, "created wm\n");
 
 	return wm;
 }
@@ -1511,7 +1511,7 @@ surface_destroy(struct wl_listener *listener, void *data)
 		container_of(listener,
 			     struct weston_wm_window, surface_destroy_listener);
 
-	weston_log("surface for xid %d destroyed\n", window->id);
+	fprintf(stderr, "surface for xid %d destroyed\n", window->id);
 }
 
 static struct weston_wm_window *
@@ -1594,11 +1594,11 @@ xserver_set_window_id(struct wl_client *client, struct wl_resource *resource,
 
 	window = hash_table_lookup(wm->window_hash, id);
 	if (window == NULL) {
-		weston_log("set_window_id for unknown window %d\n", id);
+		fprintf(stderr, "set_window_id for unknown window %d\n", id);
 		return;
 	}
 
-	weston_log("set_window_id %d for surface %p\n", id, surface);
+	fprintf(stderr, "set_window_id %d for surface %p\n", id, surface);
 
 	weston_wm_window_read_properties(window);
 
-- 
1.7.9.5



More information about the wayland-devel mailing list