commit e1773b003414f2cfbe47a6a355007e34ade813fc
parent 882003c11e28dd9af03e307f198eedf90ef10f13
Author: Michael Forney <mforney@mforney.org>
Date: Wed, 6 Apr 2016 06:29:14 +0000
Use xdg-shell protocol from wayland-protocols
Diffstat:
8 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -6,8 +6,8 @@ protocol/swc-protocol.c
protocol/swc-server-protocol.h
protocol/wayland-drm-protocol.c
protocol/wayland-drm-server-protocol.h
-protocol/xdg-shell-protocol.c
-protocol/xdg-shell-server-protocol.h
+protocol/xdg-shell-unstable-v5-protocol.c
+protocol/xdg-shell-unstable-v5-server-protocol.h
/.deps/
/swc.pc
diff --git a/Makefile b/Makefile
@@ -26,12 +26,13 @@ CLEAN_FILES := $(TARGETS)
include config.mk
# Dependencies
-PACKAGES := \
- libdrm \
- libevdev \
- pixman-1 \
- wayland-server \
- wld \
+PACKAGES := \
+ libdrm \
+ libevdev \
+ pixman-1 \
+ wayland-server \
+ wayland-protocols \
+ wld \
xkbcommon
ifeq ($(ENABLE_XWAYLAND),1)
diff --git a/README.md b/README.md
@@ -12,6 +12,7 @@ notable features include:
Dependencies
------------
* wayland
+* wayland-protocols
* libdrm
* libevdev
* libxkbcommon
diff --git a/libswc/local.mk b/libswc/local.mk
@@ -56,7 +56,7 @@ SWC_SOURCES = \
libswc/xdg_surface.c \
protocol/swc-protocol.c \
protocol/wayland-drm-protocol.c \
- protocol/xdg-shell-protocol.c
+ protocol/xdg-shell-unstable-v5-protocol.c
ifeq ($(ENABLE_LIBINPUT),1)
$(dir)_CFLAGS += -DENABLE_LIBINPUT
@@ -81,7 +81,7 @@ SWC_SHARED_OBJECTS = $(SWC_SOURCES:%.c=%.lo)
objects = $(foreach obj,$(1),$(dir)/$(obj).o $(dir)/$(obj).lo)
$(call objects,compositor panel_manager panel screen): protocol/swc-server-protocol.h
$(call objects,drm drm_buffer): protocol/wayland-drm-server-protocol.h
-$(call objects,xdg_shell xdg_surface xdg_popup): protocol/xdg-shell-server-protocol.h
+$(call objects,xdg_shell xdg_surface xdg_popup): protocol/xdg-shell-unstable-v5-server-protocol.h
$(call objects,pointer): cursor/cursor_data.h
$(dir)/libswc-internal.o: $(SWC_STATIC_OBJECTS)
diff --git a/libswc/xdg_popup.c b/libswc/xdg_popup.c
@@ -26,7 +26,7 @@
#include "surface.h"
#include "util.h"
#include "window.h"
-#include "protocol/xdg-shell-server-protocol.h"
+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
#include <stdlib.h>
diff --git a/libswc/xdg_shell.c b/libswc/xdg_shell.c
@@ -28,7 +28,7 @@
#include <assert.h>
#include <wayland-server.h>
-#include "protocol/xdg-shell-server-protocol.h"
+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
#define XDG_SHELL_VERSION 5
diff --git a/libswc/xdg_surface.c b/libswc/xdg_surface.c
@@ -29,7 +29,7 @@
#include "util.h"
#include "view.h"
#include "window.h"
-#include "protocol/xdg-shell-server-protocol.h"
+#include "protocol/xdg-shell-unstable-v5-server-protocol.h"
#include <stdlib.h>
diff --git a/protocol/local.mk b/protocol/local.mk
@@ -1,21 +1,28 @@
# swc: protocol/local.mk
dir := protocol
+wayland_protocols := $(call pkgconfig,wayland-protocols,variable=pkgdatadir,DATADIR)
PROTOCOL_EXTENSIONS = \
$(dir)/swc.xml \
$(dir)/wayland-drm.xml \
- $(dir)/xdg-shell.xml
+ $(wayland_protocols)/unstable/xdg-shell/xdg-shell-unstable-v5.xml
-$(dir)_TARGETS := $(PROTOCOL_EXTENSIONS:%.xml=%-protocol.c) \
- $(PROTOCOL_EXTENSIONS:%.xml=%-server-protocol.h)
$(dir)_PACKAGES := wayland-server
-$(dir)/%-protocol.c: $(dir)/%.xml
- $(Q_GEN)$(WAYLAND_SCANNER) code <$< >$@
+define protocol_rules
-$(dir)/%-server-protocol.h: $(dir)/%.xml
- $(Q_GEN)$(WAYLAND_SCANNER) server-header <$< >$@
+$(dir)/$$(basename $$(notdir $(1)))-protocol.c: $(1)
+ $$(Q_GEN)$$(WAYLAND_SCANNER) code <$$< >$$@
+$(dir)/$$(basename $$(notdir $(1)))-server-protocol.h: $(1)
+ $$(Q_GEN)$$(WAYLAND_SCANNER) server-header <$$< >$$@
+
+CLEAN_FILES += $(foreach type,protocol.c server-protocol.h, \
+ $(dir)/$$(basename $$(notdir $(1)))-$(type))
+
+endef
+
+$(eval $(foreach extension,$(PROTOCOL_EXTENSIONS),$(call protocol_rules,$(extension))))
install-$(dir): | $(DESTDIR)$(DATADIR)/swc
install -m 644 protocol/swc.xml $(DESTDIR)$(DATADIR)/swc