commit e1773b0

Michael Forney  ·  2016-04-06 06:29:14 +0000 UTC
parent 882003c
Use xdg-shell protocol from wayland-protocols
8 files changed,  +29, -20
+2, -2
 1@@ -6,8 +6,8 @@ protocol/swc-protocol.c
 2 protocol/swc-server-protocol.h
 3 protocol/wayland-drm-protocol.c
 4 protocol/wayland-drm-server-protocol.h
 5-protocol/xdg-shell-protocol.c
 6-protocol/xdg-shell-server-protocol.h
 7+protocol/xdg-shell-unstable-v5-protocol.c
 8+protocol/xdg-shell-unstable-v5-server-protocol.h
 9 
10 /.deps/
11 /swc.pc
+7, -6
 1@@ -26,12 +26,13 @@ CLEAN_FILES     := $(TARGETS)
 2 include config.mk
 3 
 4 # Dependencies
 5-PACKAGES :=         \
 6-    libdrm          \
 7-    libevdev        \
 8-    pixman-1        \
 9-    wayland-server  \
10-    wld             \
11+PACKAGES :=           \
12+    libdrm            \
13+    libevdev          \
14+    pixman-1          \
15+    wayland-server    \
16+    wayland-protocols \
17+    wld               \
18     xkbcommon
19 
20 ifeq ($(ENABLE_XWAYLAND),1)
+1, -0
1@@ -12,6 +12,7 @@ notable features include:
2 Dependencies
3 ------------
4 * wayland
5+* wayland-protocols
6 * libdrm
7 * libevdev
8 * libxkbcommon
+2, -2
 1@@ -56,7 +56,7 @@ SWC_SOURCES =                       \
 2     libswc/xdg_surface.c            \
 3     protocol/swc-protocol.c         \
 4     protocol/wayland-drm-protocol.c \
 5-    protocol/xdg-shell-protocol.c
 6+    protocol/xdg-shell-unstable-v5-protocol.c
 7 
 8 ifeq ($(ENABLE_LIBINPUT),1)
 9 $(dir)_CFLAGS += -DENABLE_LIBINPUT
10@@ -81,7 +81,7 @@ SWC_SHARED_OBJECTS = $(SWC_SOURCES:%.c=%.lo)
11 objects = $(foreach obj,$(1),$(dir)/$(obj).o $(dir)/$(obj).lo)
12 $(call objects,compositor panel_manager panel screen): protocol/swc-server-protocol.h
13 $(call objects,drm drm_buffer): protocol/wayland-drm-server-protocol.h
14-$(call objects,xdg_shell xdg_surface xdg_popup): protocol/xdg-shell-server-protocol.h
15+$(call objects,xdg_shell xdg_surface xdg_popup): protocol/xdg-shell-unstable-v5-server-protocol.h
16 $(call objects,pointer): cursor/cursor_data.h
17 
18 $(dir)/libswc-internal.o: $(SWC_STATIC_OBJECTS)
+1, -1
1@@ -26,7 +26,7 @@
2 #include "surface.h"
3 #include "util.h"
4 #include "window.h"
5-#include "protocol/xdg-shell-server-protocol.h"
6+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
7 
8 #include <stdlib.h>
9 
+1, -1
1@@ -28,7 +28,7 @@
2 
3 #include <assert.h>
4 #include <wayland-server.h>
5-#include "protocol/xdg-shell-server-protocol.h"
6+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
7 
8 #define XDG_SHELL_VERSION 5
9 
+1, -1
1@@ -29,7 +29,7 @@
2 #include "util.h"
3 #include "view.h"
4 #include "window.h"
5-#include "protocol/xdg-shell-server-protocol.h"
6+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
7 
8 #include <stdlib.h>
9 
+14, -7
 1@@ -1,21 +1,28 @@
 2 # swc: protocol/local.mk
 3 
 4 dir := protocol
 5+wayland_protocols := $(call pkgconfig,wayland-protocols,variable=pkgdatadir,DATADIR)
 6 
 7 PROTOCOL_EXTENSIONS =           \
 8     $(dir)/swc.xml              \
 9     $(dir)/wayland-drm.xml      \
10-    $(dir)/xdg-shell.xml
11+    $(wayland_protocols)/unstable/xdg-shell/xdg-shell-unstable-v5.xml
12 
13-$(dir)_TARGETS := $(PROTOCOL_EXTENSIONS:%.xml=%-protocol.c) \
14-                  $(PROTOCOL_EXTENSIONS:%.xml=%-server-protocol.h)
15 $(dir)_PACKAGES := wayland-server
16 
17-$(dir)/%-protocol.c: $(dir)/%.xml
18-	$(Q_GEN)$(WAYLAND_SCANNER) code <$< >$@
19+define protocol_rules
20 
21-$(dir)/%-server-protocol.h: $(dir)/%.xml
22-	$(Q_GEN)$(WAYLAND_SCANNER) server-header <$< >$@
23+$(dir)/$$(basename $$(notdir $(1)))-protocol.c: $(1)
24+	$$(Q_GEN)$$(WAYLAND_SCANNER) code <$$< >$$@
25+$(dir)/$$(basename $$(notdir $(1)))-server-protocol.h: $(1)
26+	$$(Q_GEN)$$(WAYLAND_SCANNER) server-header <$$< >$$@
27+
28+CLEAN_FILES += $(foreach type,protocol.c server-protocol.h, \
29+                 $(dir)/$$(basename $$(notdir $(1)))-$(type))
30+
31+endef
32+
33+$(eval $(foreach extension,$(PROTOCOL_EXTENSIONS),$(call protocol_rules,$(extension))))
34 
35 install-$(dir): | $(DESTDIR)$(DATADIR)/swc
36 	install -m 644 protocol/swc.xml $(DESTDIR)$(DATADIR)/swc