[PATCH weston 05/17] xwayland: Split header file in WM specific and XWayland internals
Tiago Vignatti
tiago.vignatti at intel.com
Fri Nov 30 11:20:00 PST 2012
xwayland.h now has only private declarations to be shared between launcher.c,
selection.c and window-manager.c. window-manager.h is a new header containing
WM specific declarations.
The real motivate for this patch though is to serve in preparation for split
xwm as a client; in the future window-manager.h will be the xwm client header.
Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
src/xwayland/Makefile.am | 1 +
src/xwayland/selection.c | 1 +
src/xwayland/window-manager.c | 1 +
src/xwayland/window-manager.h | 121 +++++++++++++++++++++++++++++++++++++++++
src/xwayland/xwayland.h | 101 ----------------------------------
5 files changed, 124 insertions(+), 101 deletions(-)
create mode 100644 src/xwayland/window-manager.h
diff --git a/src/xwayland/Makefile.am b/src/xwayland/Makefile.am
index 6772f8d..681374f 100644
--- a/src/xwayland/Makefile.am
+++ b/src/xwayland/Makefile.am
@@ -15,6 +15,7 @@ xwayland_la_LIBADD = \
xwayland_la_CFLAGS = $(GCC_CFLAGS) $(COMPOSITOR_CFLAGS)
xwayland_la_SOURCES = \
xwayland.h \
+ window-manager.h \
window-manager.c \
selection.c \
launcher.c \
diff --git a/src/xwayland/selection.c b/src/xwayland/selection.c
index edc7ce6..2c43aff 100644
--- a/src/xwayland/selection.c
+++ b/src/xwayland/selection.c
@@ -28,6 +28,7 @@
#include <fcntl.h>
#include "xwayland.h"
+#include "window-manager.h"
static int
weston_wm_write_property(int fd, uint32_t mask, void *data)
diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 303ef15..9e0fdb2 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -34,6 +34,7 @@
#include <X11/Xcursor/Xcursor.h>
#include "xwayland.h"
+#include "window-manager.h"
#include "../../shared/cairo-util.h"
#include "../compositor.h"
diff --git a/src/xwayland/window-manager.h b/src/xwayland/window-manager.h
new file mode 100644
index 0000000..703976e
--- /dev/null
+++ b/src/xwayland/window-manager.h
@@ -0,0 +1,121 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#include <xcb/xcb.h>
+#include <xcb/xfixes.h>
+#include <cairo/cairo-xcb.h>
+
+struct weston_wm {
+ xcb_connection_t *conn;
+ const xcb_query_extension_reply_t *xfixes;
+ struct wl_event_source *source;
+ xcb_screen_t *screen;
+ struct hash_table *window_hash;
+ struct weston_xserver *server;
+ xcb_window_t wm_window;
+ struct weston_wm_window *focus_window;
+ struct weston_wm_window *focus_latest;
+ struct theme *theme;
+ xcb_cursor_t *cursors;
+ int last_cursor;
+ xcb_render_pictforminfo_t format_rgb, format_rgba;
+ struct wl_listener activate_listener;
+ struct wl_listener kill_listener;
+
+ xcb_window_t selection_window;
+ xcb_window_t selection_owner;
+ int incr;
+ int data_source_fd;
+ struct wl_event_source *property_source;
+ xcb_get_property_reply_t *property_reply;
+ int property_start;
+ struct wl_array source_data;
+ xcb_selection_request_event_t selection_request;
+ xcb_atom_t selection_target;
+ xcb_timestamp_t selection_timestamp;
+ int selection_property_set;
+ int flush_property_on_delete;
+ struct wl_listener selection_listener;
+
+ struct {
+ xcb_atom_t wm_protocols;
+ xcb_atom_t wm_take_focus;
+ xcb_atom_t wm_delete_window;
+ xcb_atom_t wm_state;
+ xcb_atom_t wm_s0;
+ xcb_atom_t wm_client_machine;
+ xcb_atom_t net_wm_name;
+ xcb_atom_t net_wm_pid;
+ xcb_atom_t net_wm_icon;
+ xcb_atom_t net_wm_state;
+ xcb_atom_t net_wm_state_fullscreen;
+ xcb_atom_t net_wm_user_time;
+ xcb_atom_t net_wm_icon_name;
+ xcb_atom_t net_wm_window_type;
+ xcb_atom_t net_wm_window_type_desktop;
+ xcb_atom_t net_wm_window_type_dock;
+ xcb_atom_t net_wm_window_type_toolbar;
+ xcb_atom_t net_wm_window_type_menu;
+ xcb_atom_t net_wm_window_type_utility;
+ xcb_atom_t net_wm_window_type_splash;
+ xcb_atom_t net_wm_window_type_dialog;
+ xcb_atom_t net_wm_window_type_dropdown;
+ xcb_atom_t net_wm_window_type_popup;
+ xcb_atom_t net_wm_window_type_tooltip;
+ xcb_atom_t net_wm_window_type_notification;
+ xcb_atom_t net_wm_window_type_combo;
+ xcb_atom_t net_wm_window_type_dnd;
+ xcb_atom_t net_wm_window_type_normal;
+ xcb_atom_t net_wm_moveresize;
+ xcb_atom_t net_supporting_wm_check;
+ xcb_atom_t net_supported;
+ xcb_atom_t motif_wm_hints;
+ xcb_atom_t clipboard;
+ xcb_atom_t clipboard_manager;
+ xcb_atom_t targets;
+ xcb_atom_t utf8_string;
+ xcb_atom_t wl_selection;
+ xcb_atom_t incr;
+ xcb_atom_t timestamp;
+ xcb_atom_t multiple;
+ xcb_atom_t compound_text;
+ xcb_atom_t text;
+ xcb_atom_t string;
+ xcb_atom_t text_plain_utf8;
+ xcb_atom_t text_plain;
+ } atom;
+};
+
+void
+dump_property(struct weston_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);
+int
+weston_wm_handle_selection_event(struct weston_wm *wm,
+ xcb_generic_event_t *event);
+struct weston_seat *
+weston_wm_pick_seat(struct weston_wm *wm);
diff --git a/src/xwayland/xwayland.h b/src/xwayland/xwayland.h
index 2230b97..f7e6216 100644
--- a/src/xwayland/xwayland.h
+++ b/src/xwayland/xwayland.h
@@ -21,10 +21,6 @@
*/
#include <wayland-server.h>
-#include <xcb/xcb.h>
-#include <xcb/xfixes.h>
-#include <cairo/cairo-xcb.h>
-
#include "../compositor.h"
struct weston_xserver {
@@ -44,106 +40,9 @@ struct weston_xserver {
struct wl_listener destroy_listener;
};
-struct weston_wm {
- xcb_connection_t *conn;
- const xcb_query_extension_reply_t *xfixes;
- struct wl_event_source *source;
- xcb_screen_t *screen;
- struct hash_table *window_hash;
- struct weston_xserver *server;
- xcb_window_t wm_window;
- struct weston_wm_window *focus_window;
- struct weston_wm_window *focus_latest;
- struct theme *theme;
- xcb_cursor_t *cursors;
- int last_cursor;
- xcb_render_pictforminfo_t format_rgb, format_rgba;
- struct wl_listener activate_listener;
- struct wl_listener kill_listener;
-
- xcb_window_t selection_window;
- xcb_window_t selection_owner;
- int incr;
- int data_source_fd;
- struct wl_event_source *property_source;
- xcb_get_property_reply_t *property_reply;
- int property_start;
- struct wl_array source_data;
- xcb_selection_request_event_t selection_request;
- xcb_atom_t selection_target;
- xcb_timestamp_t selection_timestamp;
- int selection_property_set;
- int flush_property_on_delete;
- struct wl_listener selection_listener;
-
- struct {
- xcb_atom_t wm_protocols;
- xcb_atom_t wm_take_focus;
- xcb_atom_t wm_delete_window;
- xcb_atom_t wm_state;
- xcb_atom_t wm_s0;
- xcb_atom_t wm_client_machine;
- xcb_atom_t net_wm_name;
- xcb_atom_t net_wm_pid;
- xcb_atom_t net_wm_icon;
- xcb_atom_t net_wm_state;
- xcb_atom_t net_wm_state_fullscreen;
- xcb_atom_t net_wm_user_time;
- xcb_atom_t net_wm_icon_name;
- xcb_atom_t net_wm_window_type;
- xcb_atom_t net_wm_window_type_desktop;
- xcb_atom_t net_wm_window_type_dock;
- xcb_atom_t net_wm_window_type_toolbar;
- xcb_atom_t net_wm_window_type_menu;
- xcb_atom_t net_wm_window_type_utility;
- xcb_atom_t net_wm_window_type_splash;
- xcb_atom_t net_wm_window_type_dialog;
- xcb_atom_t net_wm_window_type_dropdown;
- xcb_atom_t net_wm_window_type_popup;
- xcb_atom_t net_wm_window_type_tooltip;
- xcb_atom_t net_wm_window_type_notification;
- xcb_atom_t net_wm_window_type_combo;
- xcb_atom_t net_wm_window_type_dnd;
- xcb_atom_t net_wm_window_type_normal;
- xcb_atom_t net_wm_moveresize;
- xcb_atom_t net_supporting_wm_check;
- xcb_atom_t net_supported;
- xcb_atom_t motif_wm_hints;
- xcb_atom_t clipboard;
- xcb_atom_t clipboard_manager;
- xcb_atom_t targets;
- xcb_atom_t utf8_string;
- xcb_atom_t wl_selection;
- xcb_atom_t incr;
- xcb_atom_t timestamp;
- xcb_atom_t multiple;
- xcb_atom_t compound_text;
- xcb_atom_t text;
- xcb_atom_t string;
- xcb_atom_t text_plain_utf8;
- xcb_atom_t text_plain;
- } atom;
-};
-
-void
-dump_property(struct weston_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);
-int
-weston_wm_handle_selection_event(struct weston_wm *wm,
- xcb_generic_event_t *event);
-
extern const struct xserver_interface xserver_implementation;
struct weston_wm *
weston_wm_create(struct weston_xserver *wxs);
void
weston_wm_destroy(struct weston_wm *wm);
-
-struct weston_seat *
-weston_wm_pick_seat(struct weston_wm *wm);
--
1.7.9.5
More information about the wayland-devel
mailing list