Discussion:
[PATCH weston 00/10] weston wayland-protocols migration
Jonas Ådahl
2015-11-04 08:49:49 UTC
Permalink
Hi,

This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.

I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.

Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.

Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.

Another protocol left to migrate is scalar.xml. I didn't do this yet
because Pekka had plans on renaming it, and I'll simply wait until he
has a name for it before migrating anything.

Other than that, the wayland-protocols have shaped up some, with the
pointer gestures protocol as well as the protocols of this series
migrated there. I wouldn't mind if people went and had a look to see if
there are any opinions of how things should work before we make an
initial release. The procedures and some details are explained in the
README file in the toplevel directory.

One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?


Jonas


Jonas Ådahl (10):
Use fullscreen-shell.xml from wayland-protocols
Use linux-dmabuf protocol from wayland-protocols
Use presentation timing protocol from wayland-protocols
Use text input protocol from wayland-protocols
Use input method protocol from wayland-protocols
Makefile.am: Make the external xml scanning rule version generic
Use xdg_shell protocol from wayland-protocols
desktop-shell: Rename protocol weston_desktop_shell
Rename screenshooter protocol to weston_screenshooter
Remove workspaces protocol

Makefile.am | 194 ++++++------
clients/desktop-shell.c | 79 ++---
clients/editor.c | 119 +++----
clients/fullscreen.c | 60 ++--
clients/keyboard.c | 186 +++++------
clients/presentation-shm.c | 65 ++--
clients/screenshot.c | 21 +-
clients/simple-damage.c | 18 +-
clients/simple-dmabuf.c | 74 ++---
clients/simple-shm.c | 18 +-
clients/weston-info.c | 19 +-
clients/weston-simple-im.c | 122 +++----
clients/window.c | 57 +---
configure.ac | 7 +
desktop-shell/input-panel.c | 14 +-
desktop-shell/shell.c | 183 +++--------
desktop-shell/shell.h | 4 +-
fullscreen-shell/fullscreen-shell.c | 54 ++--
ivi-shell/input-panel-ivi.c | 12 +-
protocol/desktop-shell.xml | 138 --------
protocol/fullscreen-shell.xml | 206 ------------
protocol/input-method.xml | 291 -----------------
protocol/linux-dmabuf.xml | 274 ----------------
protocol/presentation_timing.xml | 274 ----------------
protocol/screenshooter.xml | 12 -
protocol/text.xml | 374 ----------------------
protocol/weston-desktop-shell.xml | 134 ++++++++
protocol/weston-screenshooter.xml | 12 +
protocol/workspaces.xml | 27 --
protocol/xdg-shell.xml | 616 ------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 50 +--
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +-
src/gl-renderer.c | 6 +-
src/linux-dmabuf.c | 40 +--
src/screen-share.c | 34 +-
src/screenshooter.c | 12 +-
src/text-backend.c | 82 ++---
tests/presentation-test.c | 34 +-
tests/text-test.c | 52 +--
44 files changed, 921 insertions(+), 3108 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
delete mode 100644 protocol/fullscreen-shell.xml
delete mode 100644 protocol/input-method.xml
delete mode 100644 protocol/linux-dmabuf.xml
delete mode 100644 protocol/presentation_timing.xml
delete mode 100644 protocol/screenshooter.xml
delete mode 100644 protocol/text.xml
create mode 100644 protocol/weston-desktop-shell.xml
create mode 100644 protocol/weston-screenshooter.xml
delete mode 100644 protocol/workspaces.xml
delete mode 100644 protocol/xdg-shell.xml
--
2.4.3
Jonas Ådahl
2015-11-04 08:49:50 UTC
Permalink
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.

Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 44 +++++---
clients/fullscreen.c | 60 +++++------
clients/simple-damage.c | 18 ++--
clients/simple-dmabuf.c | 18 ++--
clients/simple-shm.c | 18 ++--
configure.ac | 7 ++
fullscreen-shell/fullscreen-shell.c | 54 +++++-----
protocol/fullscreen-shell.xml | 206 ------------------------------------
src/compositor-wayland.c | 48 ++++-----
src/screen-share.c | 34 +++---
10 files changed, 159 insertions(+), 348 deletions(-)
delete mode 100644 protocol/fullscreen-shell.xml

diff --git a/Makefile.am b/Makefile.am
index 55e3bcb..2524591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = \
src/compositor-wayland.c \
shared/helpers.h
nodist_wayland_backend_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif

if ENABLE_RPI_COMPOSITOR
@@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
@@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la

@@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-protocol.c \
protocol/linux-dmabuf-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
@@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

weston_fullscreen_SOURCES = clients/fullscreen.c
nodist_weston_fullscreen_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_fullscreen_LDADD = libtoytoolkit.la
weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

@@ -763,8 +763,8 @@ BUILT_SOURCES += \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
protocol/workspaces-protocol.c \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
@@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES = \
fullscreen-shell/fullscreen-shell.c \
shared/helpers.h
nodist_fullscreen_shell_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-server-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-server-protocol.h

BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
endif
@@ -931,8 +931,8 @@ screen_share_la_SOURCES = \
src/screen-share.c \
shared/helpers.h
nodist_screen_share_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h

endif

@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
- protocol/fullscreen-shell.xml \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
@@ -1417,6 +1416,17 @@ $(DOCDIRS):

doc: $(DOXYGEN_INDICES)

+.SECONDEXPANSION:
+
+protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@
+
+protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@
+
+protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@
+
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@

diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"

struct fs_output {
struct wl_list link;
@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
- struct _wl_fullscreen_shell *fshell;
- enum _wl_fullscreen_shell_present_method present_method;
+ struct zwl_fullscreen_shell1 *fshell;
+ enum zwl_fullscreen_shell1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;

@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;

/* Clear the current presentation */
- _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
- 0, wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell, NULL,
+ 0, wl_output);

if (fullscreen->current_output) {
if (fullscreen->current_output->link.next == &fullscreen->output_list)
@@ -324,10 +324,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,

fullscreen->current_output = fsout;
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;

@@ -338,10 +338,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = NULL;
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
- _wl_fullscreen_shell_mode_feedback_destroy(
- _wl_fullscreen_shell_present_surface_for_mode(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- wl_output, 0));
+ zwl_fullscreen_shell_mode_feedback1_destroy(
+ zwl_fullscreen_shell1_present_surface_for_mode(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ wl_output, 0));
window_schedule_redraw(window);
break;

@@ -420,13 +420,13 @@ touch_handler(struct widget *widget, struct input *input,
}

static void
-fshell_capability_handler(void *data, struct _wl_fullscreen_shell *fshell,
+fshell_capability_handler(void *data, struct zwl_fullscreen_shell1 *fshell,
uint32_t capability)
{
struct fullscreen *fullscreen = data;

switch (capability) {
- case _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE:
+ case ZWL_FULLSCREEN_SHELL1_CAPABILITY_CURSOR_PLANE:
fullscreen->draw_cursor = 0;
break;
default:
@@ -434,7 +434,7 @@ fshell_capability_handler(void *data, struct _wl_fullscreen_shell *fshell,
}
}

-struct _wl_fullscreen_shell_listener fullscreen_shell_listener = {
+struct zwl_fullscreen_shell1_listener fullscreen_shell_listener = {
fshell_capability_handler
};

@@ -471,13 +471,13 @@ global_handler(struct display *display, uint32_t id, const char *interface,
{
struct fullscreen *fullscreen = data;

- if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
fullscreen->fshell = display_bind(display, id,
- &_wl_fullscreen_shell_interface,
+ &zwl_fullscreen_shell1_interface,
1);
- _wl_fullscreen_shell_add_listener(fullscreen->fshell,
- &fullscreen_shell_listener,
- fullscreen);
+ zwl_fullscreen_shell1_add_listener(fullscreen->fshell,
+ &fullscreen_shell_listener,
+ fullscreen);
}
}

@@ -490,7 +490,7 @@ int main(int argc, char *argv[])
fullscreen.width = 640;
fullscreen.height = 480;
fullscreen.fullscreen = 0;
- fullscreen.present_method = _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT;
+ fullscreen.present_method = ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT;
wl_list_init(&fullscreen.output_list);
fullscreen.current_output = NULL;

@@ -525,10 +525,10 @@ int main(int argc, char *argv[])

if (fullscreen.fshell) {
fullscreen.window = window_create_custom(d);
- _wl_fullscreen_shell_present_surface(fullscreen.fshell,
- window_get_wl_surface(fullscreen.window),
- fullscreen.present_method,
- NULL);
+ zwl_fullscreen_shell1_present_surface(fullscreen.fshell,
+ window_get_wl_surface(fullscreen.window),
+ fullscreen.present_method,
+ NULL);
/* If we get the CURSOR_PLANE capability, we'll change this */
fullscreen.draw_cursor = 1;
} else {
diff --git a/clients/simple-damage.c b/clients/simple-damage.c
index 13e220a..c928ae4 100644
--- a/clients/simple-damage.c
+++ b/clients/simple-damage.c
@@ -38,7 +38,7 @@
#include <wayland-client.h>
#include "shared/os-compatibility.h"
#include "xdg-shell-client-protocol.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "scaler-client-protocol.h"

int print_debug = 0;
@@ -50,7 +50,7 @@ struct display {
struct wl_compositor *compositor;
struct wl_scaler *scaler;
struct xdg_shell *shell;
- struct _wl_fullscreen_shell *fshell;
+ struct zwl_fullscreen_shell1 *fshell;
struct wl_shm *shm;
uint32_t formats;
};
@@ -294,10 +294,10 @@ create_window(struct display *display, int width, int height,

xdg_surface_set_title(window->xdg_surface, "simple-damage");
} else if (display->fshell) {
- _wl_fullscreen_shell_present_surface(display->fshell,
- window->surface,
- _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
- NULL);
+ zwl_fullscreen_shell1_present_surface(display->fshell,
+ window->surface,
+ ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT,
+ NULL);
} else {
assert(0);
}
@@ -677,9 +677,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
- } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ } else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
d->fshell = wl_registry_bind(registry,
- id, &_wl_fullscreen_shell_interface, 1);
+ id, &zwl_fullscreen_shell1_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) {
d->shm = wl_registry_bind(registry,
id, &wl_shm_interface, 1);
@@ -742,7 +742,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);

if (display->fshell)
- _wl_fullscreen_shell_release(display->fshell);
+ zwl_fullscreen_shell1_release(display->fshell);

if (display->scaler)
wl_scaler_destroy(display->scaler);
diff --git a/clients/simple-dmabuf.c b/clients/simple-dmabuf.c
index b85f320..793aef2 100644
--- a/clients/simple-dmabuf.c
+++ b/clients/simple-dmabuf.c
@@ -41,7 +41,7 @@

#include <wayland-client.h>
#include "xdg-shell-client-protocol.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "linux-dmabuf-client-protocol.h"

struct display {
@@ -49,7 +49,7 @@ struct display {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct xdg_shell *shell;
- struct _wl_fullscreen_shell *fshell;
+ struct zwl_fullscreen_shell1 *fshell;
struct zlinux_dmabuf *dmabuf;
int xrgb8888_format_found;
};
@@ -336,10 +336,10 @@ create_window(struct display *display, int width, int height)

xdg_surface_set_title(window->xdg_surface, "simple-dmabuf");
} else if (display->fshell) {
- _wl_fullscreen_shell_present_surface(display->fshell,
- window->surface,
- _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
- NULL);
+ zwl_fullscreen_shell1_present_surface(display->fshell,
+ window->surface,
+ ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT,
+ NULL);
} else {
assert(0);
}
@@ -473,9 +473,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
- } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ } else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
d->fshell = wl_registry_bind(registry,
- id, &_wl_fullscreen_shell_interface, 1);
+ id, &zwl_fullscreen_shell1_interface, 1);
} else if (strcmp(interface, "zlinux_dmabuf") == 0) {
d->dmabuf = wl_registry_bind(registry,
id, &zlinux_dmabuf_interface, 1);
@@ -539,7 +539,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);

if (display->fshell)
- _wl_fullscreen_shell_release(display->fshell);
+ zwl_fullscreen_shell1_release(display->fshell);

if (display->compositor)
wl_compositor_destroy(display->compositor);
diff --git a/clients/simple-shm.c b/clients/simple-shm.c
index b2253c0..64a0c16 100644
--- a/clients/simple-shm.c
+++ b/clients/simple-shm.c
@@ -36,7 +36,7 @@
#include <wayland-client.h>
#include "shared/os-compatibility.h"
#include "xdg-shell-client-protocol.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"

#include <sys/types.h>
#include "ivi-application-client-protocol.h"
@@ -47,7 +47,7 @@ struct display {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct xdg_shell *shell;
- struct _wl_fullscreen_shell *fshell;
+ struct zwl_fullscreen_shell1 *fshell;
struct wl_shm *shm;
uint32_t formats;
struct ivi_application *ivi_application;
@@ -180,10 +180,10 @@ create_window(struct display *display, int width, int height)
xdg_surface_set_title(window->xdg_surface, "simple-shm");

} else if (display->fshell) {
- _wl_fullscreen_shell_present_surface(display->fshell,
- window->surface,
- _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT,
- NULL);
+ zwl_fullscreen_shell1_present_surface(display->fshell,
+ window->surface,
+ ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT,
+ NULL);
} else if (display->ivi_application ) {
uint32_t id_ivisurf = IVI_SURFACE_ID + (uint32_t)getpid();
window->ivi_surface =
@@ -374,9 +374,9 @@ registry_handle_global(void *data, struct wl_registry *registry,
id, &xdg_shell_interface, 1);
xdg_shell_use_unstable_version(d->shell, XDG_VERSION);
xdg_shell_add_listener(d->shell, &xdg_shell_listener, d);
- } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ } else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
d->fshell = wl_registry_bind(registry,
- id, &_wl_fullscreen_shell_interface, 1);
+ id, &zwl_fullscreen_shell1_interface, 1);
} else if (strcmp(interface, "wl_shm") == 0) {
d->shm = wl_registry_bind(registry,
id, &wl_shm_interface, 1);
@@ -483,7 +483,7 @@ destroy_display(struct display *display)
xdg_shell_destroy(display->shell);

if (display->fshell)
- _wl_fullscreen_shell_release(display->fshell);
+ zwl_fullscreen_shell1_release(display->fshell);

if (display->compositor)
wl_compositor_destroy(display->compositor);
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])

+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
+ [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`],
+ [ac_wayland_protocols_pkgdatadir=;])
+AS_IF([test "x$ac_wayland_protocols_pkgdatadir" = x],
+ [AC_MSG_ERROR([Couldn't find Wayland protocol directory])])
+AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
enable_wayland_compositor=yes)
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
diff --git a/fullscreen-shell/fullscreen-shell.c b/fullscreen-shell/fullscreen-shell.c
index 7748724..59f5ebb 100644
--- a/fullscreen-shell/fullscreen-shell.c
+++ b/fullscreen-shell/fullscreen-shell.c
@@ -33,7 +33,7 @@
#include <assert.h>

#include "compositor.h"
-#include "fullscreen-shell-server-protocol.h"
+#include "fullscreen-shell-unstable-v1-server-protocol.h"
#include "shared/helpers.h"

struct fullscreen_shell {
@@ -61,7 +61,7 @@ struct fs_output {
struct wl_resource *mode_feedback;

int presented_for_mode;
- enum _wl_fullscreen_shell_present_method method;
+ enum zwl_fullscreen_shell1_present_method method;
int32_t framerate;
} pending;

@@ -72,7 +72,7 @@ struct fs_output {
struct weston_transform transform; /* matrix from x, y */

int presented_for_mode;
- enum _wl_fullscreen_shell_present_method method;
+ enum zwl_fullscreen_shell1_present_method method;
uint32_t framerate;
};

@@ -198,7 +198,7 @@ create_black_surface(struct weston_compositor *ec, struct fs_output *fsout,

static void
fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface,
- enum _wl_fullscreen_shell_present_method method,
+ enum zwl_fullscreen_shell1_present_method method,
int32_t framerate, int presented_for_mode);
static void
fs_output_apply_pending(struct fs_output *fsout);
@@ -405,12 +405,12 @@ fs_output_configure_simple(struct fs_output *fsout,
surface_aspect = (float) surf_width / (float) surf_height;

switch (fsout->method) {
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT:
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_CENTER:
fs_output_center_view(fsout);
break;

- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_ZOOM:
if (output_aspect < surface_aspect)
fs_output_scale_view(fsout,
output->width,
@@ -421,7 +421,7 @@ fs_output_configure_simple(struct fs_output *fsout,
output->height);
break;

- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_ZOOM_CROP:
if (output_aspect < surface_aspect)
fs_output_scale_view(fsout,
output->height * surface_aspect,
@@ -432,7 +432,7 @@ fs_output_configure_simple(struct fs_output *fsout,
output->width / surface_aspect);
break;

- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_STRETCH:
fs_output_scale_view(fsout, output->width, output->height);
break;
default:
@@ -498,7 +498,7 @@ fs_output_configure_for_mode(struct fs_output *fsout,
/* The mode switch failed. Clear the pending and
* reconfigure as per normal */
if (fsout->pending.mode_feedback) {
- _wl_fullscreen_shell_mode_feedback_send_mode_failed(
+ zwl_fullscreen_shell_mode_feedback1_send_mode_failed(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
@@ -509,7 +509,7 @@ fs_output_configure_for_mode(struct fs_output *fsout,
}

if (fsout->pending.mode_feedback) {
- _wl_fullscreen_shell_mode_feedback_send_mode_successful(
+ zwl_fullscreen_shell_mode_feedback1_send_mode_successful(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
@@ -605,7 +605,7 @@ fs_output_clear_pending(struct fs_output *fsout)
return;

if (fsout->pending.mode_feedback) {
- _wl_fullscreen_shell_mode_feedback_send_present_cancelled(
+ zwl_fullscreen_shell_mode_feedback1_send_present_cancelled(
fsout->pending.mode_feedback);
wl_resource_destroy(fsout->pending.mode_feedback);
fsout->pending.mode_feedback = NULL;
@@ -617,7 +617,7 @@ fs_output_clear_pending(struct fs_output *fsout)

static void
fs_output_set_surface(struct fs_output *fsout, struct weston_surface *surface,
- enum _wl_fullscreen_shell_present_method method,
+ enum zwl_fullscreen_shell1_present_method method,
int32_t framerate, int presented_for_mode)
{
fs_output_clear_pending(fsout);
@@ -677,15 +677,15 @@ fullscreen_shell_present_surface(struct wl_client *client,
surface = surface_res ? wl_resource_get_user_data(surface_res) : NULL;

switch(method) {
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_DEFAULT:
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER:
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM:
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_ZOOM_CROP:
- case _WL_FULLSCREEN_SHELL_PRESENT_METHOD_STRETCH:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_DEFAULT:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_CENTER:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_ZOOM:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_ZOOM_CROP:
+ case ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_STRETCH:
break;
default:
wl_resource_post_error(resource,
- _WL_FULLSCREEN_SHELL_ERROR_INVALID_METHOD,
+ ZWL_FULLSCREEN_SHELL1_ERROR_INVALID_METHOD,
"Invalid presentation method");
}

@@ -745,7 +745,7 @@ fullscreen_shell_present_surface_for_mode(struct wl_client *client,

fsout->pending.mode_feedback =
wl_resource_create(client,
- &_wl_fullscreen_shell_mode_feedback_interface,
+ &zwl_fullscreen_shell_mode_feedback1_interface,
1, feedback_id);
wl_resource_set_implementation(fsout->pending.mode_feedback, NULL,
fsout, mode_feedback_destroyed);
@@ -759,7 +759,7 @@ fullscreen_shell_present_surface_for_mode(struct wl_client *client,
}
}

-struct _wl_fullscreen_shell_interface fullscreen_shell_implementation = {
+struct zwl_fullscreen_shell1_interface fullscreen_shell_implementation = {
fullscreen_shell_release,
fullscreen_shell_present_surface,
fullscreen_shell_present_surface_for_mode,
@@ -799,19 +799,19 @@ bind_fullscreen_shell(struct wl_client *client, void *data, uint32_t version,
wl_client_add_destroy_listener(client, &shell->client_destroyed);
}

- resource = wl_resource_create(client, &_wl_fullscreen_shell_interface,
+ resource = wl_resource_create(client, &zwl_fullscreen_shell1_interface,
1, id);
wl_resource_set_implementation(resource,
&fullscreen_shell_implementation,
shell, NULL);

if (shell->compositor->capabilities & WESTON_CAP_CURSOR_PLANE)
- _wl_fullscreen_shell_send_capability(resource,
- _WL_FULLSCREEN_SHELL_CAPABILITY_CURSOR_PLANE);
+ zwl_fullscreen_shell1_send_capability(resource,
+ ZWL_FULLSCREEN_SHELL1_CAPABILITY_CURSOR_PLANE);

if (shell->compositor->capabilities & WESTON_CAP_ARBITRARY_MODES)
- _wl_fullscreen_shell_send_capability(resource,
- _WL_FULLSCREEN_SHELL_CAPABILITY_ARBITRARY_MODES);
+ zwl_fullscreen_shell1_send_capability(resource,
+ ZWL_FULLSCREEN_SHELL1_CAPABILITY_ARBITRARY_MODES);
}

WL_EXPORT int
@@ -846,7 +846,7 @@ module_init(struct weston_compositor *compositor,
seat_created(NULL, seat);

wl_global_create(compositor->wl_display,
- &_wl_fullscreen_shell_interface, 1, shell,
+ &zwl_fullscreen_shell1_interface, 1, shell,
bind_fullscreen_shell);

return 0;
diff --git a/protocol/fullscreen-shell.xml b/protocol/fullscreen-shell.xml
deleted file mode 100644
index e2b994b..0000000
--- a/protocol/fullscreen-shell.xml
+++ /dev/null
@@ -1,206 +0,0 @@
-<protocol name="fullscreen_shell">
- <interface name="_wl_fullscreen_shell" version="1">
- <description summary="Displays a single surface per output">
- Displays a single surface per output.
-
- This interface provides a mechanism for a single client to display
- simple full-screen surfaces. While there technically may be multiple
- clients bound to this interface, only one of those clients should be
- shown at a time.
-
- To present a surface, the client uses either the present_surface or
- present_surface_for_mode requests. Presenting a surface takes effect
- on the next wl_surface.commit. See the individual requests for
- details about scaling and mode switches.
-
- The client can have at most one surface per output at any time.
- Requesting a surface be presented on an output that already has a
- surface replaces the previously presented surface. Presenting a null
- surface removes its content and effectively disables the output.
- Exactly what happens when an output is "disabled" is
- compositor-specific. The same surface may be presented on multiple
- outputs simultaneously.
-
- Once a surface is presented on an output, it stays on that output
- until either the client removes it or the compositor destroys the
- output. This way, the client can update the output's contents by
- simply attaching a new buffer.
- </description>
-
- <request name="release" type="destructor">
- <description summary="release the wl_fullscreen_shell interface">
- Release the binding from the wl_fullscreen_shell interface
-
- This destroys the server-side object and frees this binding. If
- the client binds to wl_fullscreen_shell multiple times, it may wish
- to free some of those bindings.
- </description>
- </request>
-
- <enum name="capability">
- <description summary="capabilities advertised by the compositor">
- Various capabilities that can be advertised by the compositor. They
- are advertised one-at-a-time when the wl_fullscreen_shell interface is
- bound. See the wl_fullscreen_shell.capability event for more details.
-
- ARBITRARY_MODE:
- This is a hint to the client that indicates that the compositor is
- capable of setting practically any mode on its outputs. If this
- capability is provided, wl_fullscreen_shell.present_surface_for_mode
- will almost never fail and clients should feel free to set whatever
- mode they like. If the compositor does not advertise this, it may
- still support some modes that are not advertised through wl_global.mode
- but it is less likely.
-
- CURSOR_PLANE:
- This is a hint to the client that indicates that the compositor can
- handle a cursor surface from the client without actually compositing.
- This may be because of a hardware cursor plane or some other mechanism.
- If the compositor does not advertise this capability then setting
- wl_pointer.cursor may degrade performance or be ignored entirely. If
- CURSOR_PLANE is not advertised, it is recommended that the client draw
- its own cursor and set wl_pointer.cursor(NULL).
- </description>
- <entry name="arbitrary_modes" value="1" summary="compositor is capable of almost any output mode"/>
- <entry name="cursor_plane" value="2" summary="compositor has a separate cursor plane"/>
- </enum>
-
- <event name="capability">
- <description summary="advertises a capability of the compositor">
- Advertises a single capability of the compositor.
-
- When the wl_fullscreen_shell interface is bound, this event is emitted
- once for each capability advertised. Valid capabilities are given by
- the wl_fullscreen_shell.capability enum. If clients want to take
- advantage of any of these capabilities, they should use a
- wl_display.sync request immediately after binding to ensure that they
- receive all the capability events.
- </description>
- <arg name="capabilty" type="uint"/>
- </event>
-
- <enum name="present_method">
- <description summary="different method to set the surface fullscreen">
- Hints to indicate to the compositor how to deal with a conflict
- between the dimensions of the surface and the dimensions of the
- output. The compositor is free to ignore this parameter.
- </description>
- <entry name="default" value="0" summary="no preference, apply default policy"/>
- <entry name="center" value="1" summary="center the surface on the output"/>
- <entry name="zoom" value="2" summary="scale the surface, preserving aspect ratio, to the largest size that will fit on the output" />
- <entry name="zoom_crop" value="3" summary="scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" />
- <entry name="stretch" value="4" summary="scale the surface to the size of the output ignoring aspect ratio" />
- </enum>
-
- <request name="present_surface">
- <description summary="present surface for display">
- Present a surface on the given output.
-
- If the output is null, the compositor will present the surface on
- whatever display (or displays) it thinks best. In particular, this
- may replace any or all surfaces currently presented so it should
- not be used in combination with placing surfaces on specific
- outputs.
-
- The method parameter is a hint to the compositor for how the surface
- is to be presented. In particular, it tells the compositor how to
- handle a size mismatch between the presented surface and the
- output. The compositor is free to ignore this parameter.
-
- The "zoom", "zoom_crop", and "stretch" methods imply a scaling
- operation on the surface. This will override any kind of output
- scaling, so the buffer_scale property of the surface is effectively
- ignored.
- </description>
- <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
- <arg name="method" type="uint"/>
- <arg name="output" type="object" interface="wl_output" allow-null="true"/>
- </request>
-
- <request name="present_surface_for_mode">
- <description summary="present surface for display at a particular mode">
- Presents a surface on the given output for a particular mode.
-
- If the current size of the output differs from that of the surface,
- the compositor will attempt to change the size of the output to
- match the surface. The result of the mode-switch operation will be
- returned via the provided wl_fullscreen_shell_mode_feedback object.
-
- If the current output mode matches the one requested or if the
- compositor successfully switches the mode to match the surface,
- then the mode_successful event will be sent and the output will
- contain the contents of the given surface. If the compositor
- cannot match the output size to the surface size, the mode_failed
- will be sent and the output will contain the contents of the
- previously presented surface (if any). If another surface is
- presented on the given output before either of these has a chance
- to happen, the present_cancelled event will be sent.
-
- Due to race conditions and other issues unknown to the client, no
- mode-switch operation is guaranteed to succeed. However, if the
- mode is one advertised by wl_output.mode or if the compositor
- advertises the ARBITRARY_MODES capability, then the client should
- expect that the mode-switch operation will usually succeed.
-
- If the size of the presented surface changes, the resulting output
- is undefined. The compositor may attempt to change the output mode
- to compensate. However, there is no guarantee that a suitable mode
- will be found and the client has no way to be notified of success
- or failure.
-
- The framerate parameter specifies the desired framerate for the
- output in mHz. The compositor is free to ignore this parameter. A
- value of 0 indicates that the client has no preference.
-
- If the value of wl_output.scale differs from wl_surface.buffer_scale,
- then the compositor may choose a mode that matches either the buffer
- size or the surface size. In either case, the surface will fill the
- output.
- </description>
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="framerate" type="int"/>
- <arg name="feedback" type="new_id" interface="_wl_fullscreen_shell_mode_feedback"/>
- </request>
-
- <enum name="error">
- <description summary="wl_fullscreen_shell error values">
- These errors can be emitted in response to wl_fullscreen_shell requests
- </description>
- <entry name="invalid_method" value="0" summary="present_method is not known"/>
- </enum>
- </interface>
-
- <interface name="_wl_fullscreen_shell_mode_feedback" version="1">
- <event name="mode_successful">
- <description summary="mode switch succeeded">
- This event indicates that the attempted mode switch operation was
- successful. A surface of the size requested in the mode switch
- will fill the output without scaling.
-
- Upon receiving this event, the client should destroy the
- wl_fullscreen_shell_mode_feedback object.
- </description>
- </event>
- <event name="mode_failed">
- <description summary="mode switch failed">
- This event indicates that the attempted mode switch operation
- failed. This may be because the requested output mode is not
- possible or it may mean that the compositor does not want to allow it.
-
- Upon receiving this event, the client should destroy the
- wl_fullscreen_shell_mode_feedback object.
- </description>
- </event>
- <event name="present_cancelled">
- <description summary="mode switch cancelled">
- This event indicates that the attempted mode switch operation was
- cancelled. Most likely this is because the client requested a
- second mode switch before the first one completed.
-
- Upon receiving this event, the client should destroy the
- wl_fullscreen_shell_mode_feedback object.
- </description>
- </event>
- </interface>
-</protocol>
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index a819867..dc39cbe 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -46,7 +46,7 @@
#include "shared/image-loader.h"
#include "shared/os-compatibility.h"
#include "shared/cairo-util.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
#include "presentation_timing-server-protocol.h"
#include "linux-dmabuf.h"

@@ -61,7 +61,7 @@ struct wayland_backend {
struct wl_registry *registry;
struct wl_compositor *compositor;
struct wl_shell *shell;
- struct _wl_fullscreen_shell *fshell;
+ struct zwl_fullscreen_shell1 *fshell;
struct wl_shm *shm;

struct wl_list output_list;
@@ -812,9 +812,9 @@ wayland_output_set_fullscreen(struct wayland_output *output,
wl_shell_surface_set_fullscreen(output->parent.shell_surface,
method, framerate, target);
} else if (b->parent.fshell) {
- _wl_fullscreen_shell_present_surface(b->parent.fshell,
- output->parent.surface,
- method, target);
+ zwl_fullscreen_shell1_present_surface(b->parent.fshell,
+ output->parent.surface,
+ method, target);
}
}

@@ -850,7 +850,7 @@ enum mode_status {

static void
mode_feedback_successful(void *data,
- struct _wl_fullscreen_shell_mode_feedback *fb)
+ struct zwl_fullscreen_shell_mode_feedback1 *fb)
{
enum mode_status *value = data;

@@ -860,7 +860,7 @@ mode_feedback_successful(void *data,
}

static void
-mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
+mode_feedback_failed(void *data, struct zwl_fullscreen_shell_mode_feedback1 *fb)
{
enum mode_status *value = data;

@@ -870,7 +870,7 @@ mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
}

static void
-mode_feedback_cancelled(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
+mode_feedback_cancelled(void *data, struct zwl_fullscreen_shell_mode_feedback1 *fb)
{
enum mode_status *value = data;

@@ -879,7 +879,7 @@ mode_feedback_cancelled(void *data, struct _wl_fullscreen_shell_mode_feedback *f
*value = MODE_STATUS_CANCEL;
}

-struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = {
+struct zwl_fullscreen_shell_mode_feedback1_listener mode_feedback_listener = {
mode_feedback_successful,
mode_feedback_failed,
mode_feedback_cancelled,
@@ -893,7 +893,7 @@ wayland_output_switch_mode(struct weston_output *output_base,
struct wayland_backend *b;
struct wl_surface *old_surface;
struct weston_mode *old_mode;
- struct _wl_fullscreen_shell_mode_feedback *mode_feedback;
+ struct zwl_fullscreen_shell_mode_feedback1 *mode_feedback;
enum mode_status mode_status;
int ret = 0;

@@ -930,11 +930,11 @@ wayland_output_switch_mode(struct weston_output *output_base,
wayland_output_resize_surface(output);

mode_feedback =
- _wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell,
+ zwl_fullscreen_shell1_present_surface_for_mode(b->parent.fshell,
output->parent.surface,
output->parent.output,
mode->refresh);
- _wl_fullscreen_shell_mode_feedback_add_listener(mode_feedback,
+ zwl_fullscreen_shell_mode_feedback1_add_listener(mode_feedback,
&mode_feedback_listener,
&mode_status);

@@ -946,7 +946,7 @@ wayland_output_switch_mode(struct weston_output *output_base,
while (mode_status == MODE_STATUS_UNKNOWN && ret >= 0)
ret = wl_display_dispatch(b->parent.wl_display);

- _wl_fullscreen_shell_mode_feedback_destroy(mode_feedback);
+ zwl_fullscreen_shell_mode_feedback1_destroy(mode_feedback);

if (mode_status == MODE_STATUS_FAIL) {
output->base.current_mode = old_mode;
@@ -1193,15 +1193,15 @@ wayland_output_create_for_parent_output(struct wayland_backend *b,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER,
mode->refresh, poutput->global);
} else if (b->parent.fshell) {
- _wl_fullscreen_shell_present_surface(b->parent.fshell,
- output->parent.surface,
- _WL_FULLSCREEN_SHELL_PRESENT_METHOD_CENTER,
- poutput->global);
- _wl_fullscreen_shell_mode_feedback_destroy(
- _wl_fullscreen_shell_present_surface_for_mode(b->parent.fshell,
- output->parent.surface,
- poutput->global,
- mode->refresh));
+ zwl_fullscreen_shell1_present_surface(b->parent.fshell,
+ output->parent.surface,
+ ZWL_FULLSCREEN_SHELL1_PRESENT_METHOD_CENTER,
+ poutput->global);
+ zwl_fullscreen_shell_mode_feedback1_destroy(
+ zwl_fullscreen_shell1_present_surface_for_mode(b->parent.fshell,
+ output->parent.surface,
+ poutput->global,
+ mode->refresh));
}

return output;
@@ -1817,10 +1817,10 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
b->parent.shell =
wl_registry_bind(registry, name,
&wl_shell_interface, 1);
- } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ } else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
b->parent.fshell =
wl_registry_bind(registry, name,
- &_wl_fullscreen_shell_interface, 1);
+ &zwl_fullscreen_shell1_interface, 1);
} else if (strcmp(interface, "wl_seat") == 0) {
display_add_seat(b, name, version);
} else if (strcmp(interface, "wl_output") == 0) {
diff --git a/src/screen-share.c b/src/screen-share.c
index d961c89..0df7585 100644
--- a/src/screen-share.c
+++ b/src/screen-share.c
@@ -42,7 +42,7 @@
#include "compositor.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"

struct shared_output {
struct weston_output *output;
@@ -55,11 +55,11 @@ struct shared_output {
struct wl_compositor *compositor;
struct wl_shm *shm;
uint32_t shm_formats;
- struct _wl_fullscreen_shell *fshell;
+ struct zwl_fullscreen_shell1 *fshell;
struct wl_output *output;
struct wl_surface *surface;
struct wl_callback *frame_cb;
- struct _wl_fullscreen_shell_mode_feedback *mode_feedback;
+ struct zwl_fullscreen_shell_mode_feedback1 *mode_feedback;
} parent;

struct wl_event_source *event_source;
@@ -697,10 +697,10 @@ registry_handle_global(void *data, struct wl_registry *registry,
wl_registry_bind(registry,
id, &wl_shm_interface, 1);
wl_shm_add_listener(so->parent.shm, &shm_listener, so);
- } else if (strcmp(interface, "_wl_fullscreen_shell") == 0) {
+ } else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
so->parent.fshell =
wl_registry_bind(registry,
- id, &_wl_fullscreen_shell_interface, 1);
+ id, &zwl_fullscreen_shell1_interface, 1);
}
}

@@ -750,25 +750,25 @@ output_destroyed(struct wl_listener *l, void *data)
}

static void
-mode_feedback_ok(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
+mode_feedback_ok(void *data, struct zwl_fullscreen_shell_mode_feedback1 *fb)
{
struct shared_output *so = data;

- _wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback);
+ zwl_fullscreen_shell_mode_feedback1_destroy(so->parent.mode_feedback);
}

static void
-mode_feedback_failed(void *data, struct _wl_fullscreen_shell_mode_feedback *fb)
+mode_feedback_failed(void *data, struct zwl_fullscreen_shell_mode_feedback1 *fb)
{
struct shared_output *so = data;

- _wl_fullscreen_shell_mode_feedback_destroy(so->parent.mode_feedback);
+ zwl_fullscreen_shell_mode_feedback1_destroy(so->parent.mode_feedback);

weston_log("Screen share failed: present_surface_for_mode failed\n");
shared_output_destroy(so);
}

-struct _wl_fullscreen_shell_mode_feedback_listener mode_feedback_listener = {
+struct zwl_fullscreen_shell_mode_feedback1_listener mode_feedback_listener = {
mode_feedback_ok,
mode_feedback_failed,
mode_feedback_ok,
@@ -919,17 +919,17 @@ shared_output_create(struct weston_output *output, int parent_fd)
}

so->parent.mode_feedback =
- _wl_fullscreen_shell_present_surface_for_mode(so->parent.fshell,
- so->parent.surface,
- so->parent.output,
- output->current_mode->refresh);
+ zwl_fullscreen_shell1_present_surface_for_mode(so->parent.fshell,
+ so->parent.surface,
+ so->parent.output,
+ output->current_mode->refresh);
if (!so->parent.mode_feedback) {
weston_log("Screen share failed: %m\n");
goto err_display;
}
- _wl_fullscreen_shell_mode_feedback_add_listener(so->parent.mode_feedback,
- &mode_feedback_listener,
- so);
+ zwl_fullscreen_shell_mode_feedback1_add_listener(so->parent.mode_feedback,
+ &mode_feedback_listener,
+ so);

loop = wl_display_get_event_loop(output->compositor->wl_display);
--
2.4.3
Pekka Paalanen
2015-11-05 11:19:27 UTC
Permalink
On Wed, 4 Nov 2015 16:49:50 +0800
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
---
Makefile.am | 44 +++++---
clients/fullscreen.c | 60 +++++------
clients/simple-damage.c | 18 ++--
clients/simple-dmabuf.c | 18 ++--
clients/simple-shm.c | 18 ++--
configure.ac | 7 ++
fullscreen-shell/fullscreen-shell.c | 54 +++++-----
protocol/fullscreen-shell.xml | 206 ------------------------------------
src/compositor-wayland.c | 48 ++++-----
src/screen-share.c | 34 +++---
10 files changed, 159 insertions(+), 348 deletions(-)
delete mode 100644 protocol/fullscreen-shell.xml
Hi Jonas,

I'm looking at this just to see how you hooked up the build. Nothing
too important here. The general idea of the patch is good.
Post by Jonas Ådahl
diff --git a/Makefile.am b/Makefile.am
index 55e3bcb..2524591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = \
src/compositor-wayland.c \
shared/helpers.h
nodist_wayland_backend_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
if ENABLE_RPI_COMPOSITOR
@@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
@@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
@@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-protocol.c \
protocol/linux-dmabuf-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
@@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_fullscreen_SOURCES = clients/fullscreen.c
nodist_weston_fullscreen_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_fullscreen_LDADD = libtoytoolkit.la
weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
@@ -763,8 +763,8 @@ BUILT_SOURCES += \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
protocol/workspaces-protocol.c \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
@@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES = \
fullscreen-shell/fullscreen-shell.c \
shared/helpers.h
nodist_fullscreen_shell_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-server-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
endif
@@ -931,8 +931,8 @@ screen_share_la_SOURCES = \
src/screen-share.c \
shared/helpers.h
nodist_screen_share_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
- protocol/fullscreen-shell.xml \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
doc: $(DOXYGEN_INDICES)
+
+protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
Slightly unfortunate to have "v1" hardcoded there. I wonder if it'd be
possible to have some sort of pattern rules and in addition define the
dependencies explicitly?

Something in the direction of:

.-server-protocol.h: .xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@

protocol/fullscreen-shell-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml

Oh that gets ugly and long fast, too... not to mention needing three
lines per xml file. Bleh, whatever works.
Post by Jonas Ådahl
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
+ [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`],
+ [ac_wayland_protocols_pkgdatadir=;])
Would it not be better to just omit ACTION-IF-NOT-FOUND so that
PKG_CHECK_MODULES gives the standard error in case wayland-protocols.pc
is missing?
Post by Jonas Ådahl
+AS_IF([test "x$ac_wayland_protocols_pkgdatadir" = x],
+ [AC_MSG_ERROR([Couldn't find Wayland protocol directory])])
+AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
enable_wayland_compositor=yes)
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
Thanks,
pq
Bryce Harrington
2015-11-05 19:36:09 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:50 +0800
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
---
Makefile.am | 44 +++++---
clients/fullscreen.c | 60 +++++------
clients/simple-damage.c | 18 ++--
clients/simple-dmabuf.c | 18 ++--
clients/simple-shm.c | 18 ++--
configure.ac | 7 ++
fullscreen-shell/fullscreen-shell.c | 54 +++++-----
protocol/fullscreen-shell.xml | 206 ------------------------------------
src/compositor-wayland.c | 48 ++++-----
src/screen-share.c | 34 +++---
10 files changed, 159 insertions(+), 348 deletions(-)
delete mode 100644 protocol/fullscreen-shell.xml
Hi Jonas,
I'm looking at this just to see how you hooked up the build. Nothing
too important here. The general idea of the patch is good.
Post by Jonas Ådahl
diff --git a/Makefile.am b/Makefile.am
index 55e3bcb..2524591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = \
src/compositor-wayland.c \
shared/helpers.h
nodist_wayland_backend_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
if ENABLE_RPI_COMPOSITOR
@@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
@@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
@@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-protocol.c \
protocol/linux-dmabuf-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
@@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_fullscreen_SOURCES = clients/fullscreen.c
nodist_weston_fullscreen_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_fullscreen_LDADD = libtoytoolkit.la
weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
@@ -763,8 +763,8 @@ BUILT_SOURCES += \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
protocol/workspaces-protocol.c \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
@@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES = \
fullscreen-shell/fullscreen-shell.c \
shared/helpers.h
nodist_fullscreen_shell_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-server-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
endif
@@ -931,8 +931,8 @@ screen_share_la_SOURCES = \
src/screen-share.c \
shared/helpers.h
nodist_screen_share_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
- protocol/fullscreen-shell.xml \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
doc: $(DOXYGEN_INDICES)
+
+protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
Slightly unfortunate to have "v1" hardcoded there. I wonder if it'd be
possible to have some sort of pattern rules and in addition define the
dependencies explicitly?
.-server-protocol.h: .xml
protocol/fullscreen-shell-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml
Oh that gets ugly and long fast, too... not to mention needing three
lines per xml file. Bleh, whatever works.
Well, we can always optimize these rules to cleanup repetition later,
those are easy refactoring patches. This is probably fine to take for
now just to get the change into place.

But I also wondered about the v1's everywhere, and how often those will
need changed. If it's going to be more frequently than hardly ever, we
might want to add a makefile variable so that future number changes are
one liners, and less search and replace exercises. However, adding this
variable could certainly wait until there is a v2 we have to actually
deal with.
Post by Pekka Paalanen
Post by Jonas Ådahl
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
+ [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`],
+ [ac_wayland_protocols_pkgdatadir=;])
Would it not be better to just omit ACTION-IF-NOT-FOUND so that
PKG_CHECK_MODULES gives the standard error in case wayland-protocols.pc
is missing?
Post by Jonas Ådahl
+AS_IF([test "x$ac_wayland_protocols_pkgdatadir" = x],
+ [AC_MSG_ERROR([Couldn't find Wayland protocol directory])])
+AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
enable_wayland_compositor=yes)
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
Thanks,
pq
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIVAwUBVjs7SCNf5bQRqqqnAQhmFg//ehJGusg65qw+9yuVwmZjtgz7LAiBsWGZ
rj0oklyZ96EbbB73e1qyRK+o/l0BpSeZQTsD+XhGrh9IHBWUpntjUgayGW16hFUR
UqbZi73f6/ynXpWA02FyLyCcVjgEuZfNywoJY9btduyA6KCGVDcbDp+vQXQmehbW
SMRKeJoLOw2Rhc/V7ifVWyaptlMzQQmJ+tpBz5oWMNtLdDpue88bHl0g60qNb069
GHYaHyrjzSFpxPgHLRT0zZsmDFQXiL55wVqF9YccIudmEgyNLmf4dGyt8+emO33p
rJnRCYq90mvMkfjnL4M6R3XiucEhuDMqTYd8v2OdoJeriGeuh/naR7q7ey6fIGmV
x+OUhHdXjB/I1NpIyqbEUnRb3YV3w6jJHwTLStUtmtJxQkfLgnSPZ6VfU49/y1fp
yBpovFhCs662iOnf/GA+u39dr/wKY06qu/brecx7nXPwVSCtpM0ySr0VuLfP31bt
nvAY4ESTu+2Ecn0Hen+c0w99kil6MqkXbosAJYLcF5i/5cP6g9efwy5y0C7N5EDt
k9w/YICN+v9G1alv4XZQ7lG3oHGHCt743MfzL1wnoW9zl+/5b1i8xDvdMio4pDfC
qoQQdtpkHlNoTHWqKrGEM9szc7uZFxyCp3+D1GLEvtOw+xZfNOzn+FtFpuOaeRMZ
T2WApCk7AJE=
=neS/
-----END PGP SIGNATURE-----
_______________________________________________
wayland-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Jonas Ådahl
2015-11-06 02:47:15 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:50 +0800
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
---
Makefile.am | 44 +++++---
clients/fullscreen.c | 60 +++++------
clients/simple-damage.c | 18 ++--
clients/simple-dmabuf.c | 18 ++--
clients/simple-shm.c | 18 ++--
configure.ac | 7 ++
fullscreen-shell/fullscreen-shell.c | 54 +++++-----
protocol/fullscreen-shell.xml | 206 ------------------------------------
src/compositor-wayland.c | 48 ++++-----
src/screen-share.c | 34 +++---
10 files changed, 159 insertions(+), 348 deletions(-)
delete mode 100644 protocol/fullscreen-shell.xml
Hi Jonas,
I'm looking at this just to see how you hooked up the build. Nothing
too important here. The general idea of the patch is good.
Post by Jonas Ådahl
diff --git a/Makefile.am b/Makefile.am
index 55e3bcb..2524591 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -309,8 +309,8 @@ wayland_backend_la_SOURCES = \
src/compositor-wayland.c \
shared/helpers.h
nodist_wayland_backend_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
if ENABLE_RPI_COMPOSITOR
@@ -475,8 +475,8 @@ weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
@@ -488,8 +488,8 @@ nodist_weston_simple_damage_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_simple_damage_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la
@@ -531,8 +531,8 @@ weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-protocol.c \
protocol/linux-dmabuf-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
@@ -649,8 +649,8 @@ weston_transformed_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_fullscreen_SOURCES = clients/fullscreen.c
nodist_weston_fullscreen_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_fullscreen_LDADD = libtoytoolkit.la
weston_fullscreen_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
@@ -763,8 +763,8 @@ BUILT_SOURCES += \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
protocol/workspaces-protocol.c \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h \
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
@@ -865,8 +865,8 @@ fullscreen_shell_la_SOURCES = \
fullscreen-shell/fullscreen-shell.c \
shared/helpers.h
nodist_fullscreen_shell_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-server-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-server-protocol.h
BUILT_SOURCES += $(nodist_fullscreen_shell_la_SOURCES)
endif
@@ -931,8 +931,8 @@ screen_share_la_SOURCES = \
src/screen-share.c \
shared/helpers.h
nodist_screen_share_la_SOURCES = \
- protocol/fullscreen-shell-protocol.c \
- protocol/fullscreen-shell-client-protocol.h
+ protocol/fullscreen-shell-unstable-v1-protocol.c \
+ protocol/fullscreen-shell-unstable-v1-client-protocol.h
endif
@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
- protocol/fullscreen-shell.xml \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
doc: $(DOXYGEN_INDICES)
+
+protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
+protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+
Slightly unfortunate to have "v1" hardcoded there. I wonder if it'd be
possible to have some sort of pattern rules and in addition define the
dependencies explicitly?
.-server-protocol.h: .xml
protocol/fullscreen-shell-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml
Oh that gets ugly and long fast, too... not to mention needing three
lines per xml file. Bleh, whatever works.
I fixed this in a later patch, replacing it with Makefile and regular
expression magic. In the end, for external protocols, it'll be just
three rules, one for eath generated file. See 'Makefile.am: Make the
external xml scanning rule version generic'.
Post by Pekka Paalanen
Post by Jonas Ådahl
protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
+ [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`],
+ [ac_wayland_protocols_pkgdatadir=;])
Would it not be better to just omit ACTION-IF-NOT-FOUND so that
PKG_CHECK_MODULES gives the standard error in case wayland-protocols.pc
is missing?
True. Will fix.


Jonas
Post by Pekka Paalanen
Post by Jonas Ådahl
+AS_IF([test "x$ac_wayland_protocols_pkgdatadir" = x],
+ [AC_MSG_ERROR([Couldn't find Wayland protocol directory])])
+AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
+
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
enable_wayland_compositor=yes)
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
Thanks,
pq
Bryce Harrington
2015-11-05 19:46:46 UTC
Permalink
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.

#include <fullscreen-shell-unstable-v1-client-protocol.h>
Post by Jonas Ådahl
struct fs_output {
struct wl_list link;
@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
- struct _wl_fullscreen_shell *fshell;
- enum _wl_fullscreen_shell_present_method present_method;
+ struct zwl_fullscreen_shell1 *fshell;
+ enum zwl_fullscreen_shell1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;
@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
/* Clear the current presentation */
- _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
- 0, wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell, NULL,
+ 0, wl_output);
Hmm. With l's and 1's looking so similar in certain fonts, "shell1" is
going to look like a typo to some users. IMO it would be better to
distinguish this version number with at least an underscore.
"_shell_v1_" would feel more consistent with the scheme being used in
the header file name, protocol file name, macro definitions, etc.
Post by Jonas Ådahl
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
Please also update RELEASING with a sentence or two about needing to
check and update this protocol package version number.

Bryce
Bill Spitzak
2015-11-06 01:34:51 UTC
Permalink
Post by Bryce Harrington
Hmm. With l's and 1's looking so similar in certain fonts, "shell1" is
going to look like a typo to some users. IMO it would be better to
distinguish this version number with at least an underscore.
"_shell_v1_" would feel more consistent with the scheme being used in
the header file name, protocol file name, macro definitions, etc.
I'm not very clear on why the '1' is necessary at all, but it seems to me
like it should be next to the 'z', rather than adding the odd stuff at both
ends. Also I notice the header filename is following a completely different
pattern of using "x-unstable-v1" rather than the "zx1" being used for the
symbols.

Can the plan be changed to make the protocols have names more like the
header file, ie wl_fullscreen_shell_unstable_v1 in this case? I think that
might be more readable and it would be nice if names matched. Using _
instead of - in the header filenames might be nice, too.

Pardon me for kind of glazing over all that discussion about protocol
versions, but I am not really seeing the reason for unstable protocols to
use different names than the final stable one. If it is unstable then the
meaning of a given symbol may change. This includes changing to the stable
one. Seems like the proposed final name could be used.
Jonas Ådahl
2015-11-06 02:51:09 UTC
Permalink
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Post by Bryce Harrington
Post by Jonas Ådahl
struct fs_output {
struct wl_list link;
@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
- struct _wl_fullscreen_shell *fshell;
- enum _wl_fullscreen_shell_present_method present_method;
+ struct zwl_fullscreen_shell1 *fshell;
+ enum zwl_fullscreen_shell1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;
@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
/* Clear the current presentation */
- _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
- 0, wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell, NULL,
+ 0, wl_output);
Hmm. With l's and 1's looking so similar in certain fonts, "shell1" is
going to look like a typo to some users. IMO it would be better to
distinguish this version number with at least an underscore.
"_shell_v1_" would feel more consistent with the scheme being used in
the header file name, protocol file name, macro definitions, etc.
A slight implicit point of it is to make it a bit awkward, so that it's
ever so slightly more obvious that this is intended to be temporary.

The other more important reason is I think we already have very long
names, and I tried to minimize the extra name length needed.

I guess I can be convinced otherwise, but personally I prefer the way it
is.
Post by Bryce Harrington
Post by Jonas Ådahl
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
Please also update RELEASING with a sentence or two about needing to
check and update this protocol package version number.
Will do.


Jonas
Post by Bryce Harrington
Bryce
_______________________________________________
wayland-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Bryce Harrington
2015-11-06 05:00:21 UTC
Permalink
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Post by Bryce Harrington
Post by Jonas Ådahl
struct fs_output {
struct wl_list link;
@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
- struct _wl_fullscreen_shell *fshell;
- enum _wl_fullscreen_shell_present_method present_method;
+ struct zwl_fullscreen_shell1 *fshell;
+ enum zwl_fullscreen_shell1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;
@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
/* Clear the current presentation */
- _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
- 0, wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell, NULL,
+ 0, wl_output);
Hmm. With l's and 1's looking so similar in certain fonts, "shell1" is
going to look like a typo to some users. IMO it would be better to
distinguish this version number with at least an underscore.
"_shell_v1_" would feel more consistent with the scheme being used in
the header file name, protocol file name, macro definitions, etc.
A slight implicit point of it is to make it a bit awkward, so that it's
ever so slightly more obvious that this is intended to be temporary.
The other more important reason is I think we already have very long
names, and I tried to minimize the extra name length needed.
Being intentionally awkward seems like an anti-pattern to me. But I
would point out that if it is a goal, then making the names overly long
certainly would achieve that.

Increasing the length of the names does seem like a valid problem,
though. I almost mentioned it but in thinking it out, I figure: a) the
symbols are intentionally temporary, and making them intentionally
longer might even encourage making the base names slightly shorter,
which is in everyone's interest; b) the scheme is already adding 2
characters, we'd be adding 4 instead, which doesn't seem *that*
excessive; c) clarity is more important to me than brevity; d) making
the names more consistent with header, macro names, etc. seems way more
important than typing convenience.

If increasing the length is still considered a problem, Bill's
suggestion to move the version to the prefix might be worth further
consideration. It addresses making things clearer without increasing
character count, although I'm uncertain about its usability since it'll
impact name searching and sorting.
Post by Jonas Ådahl
I guess I can be convinced otherwise, but personally I prefer the way it
is.
Well, we all are going to have to live with the scheme...
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
Please also update RELEASING with a sentence or two about needing to
check and update this protocol package version number.
Will do.
Jonas
Bryce
Jonas Ådahl
2015-11-06 05:58:16 UTC
Permalink
Post by Bryce Harrington
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Post by Bryce Harrington
Post by Jonas Ådahl
struct fs_output {
struct wl_list link;
@@ -46,8 +46,8 @@ struct fullscreen {
struct display *display;
struct window *window;
struct widget *widget;
- struct _wl_fullscreen_shell *fshell;
- enum _wl_fullscreen_shell_present_method present_method;
+ struct zwl_fullscreen_shell1 *fshell;
+ enum zwl_fullscreen_shell1_present_method present_method;
int width, height;
int fullscreen;
float pointer_x, pointer_y;
@@ -293,10 +293,10 @@ key_handler(struct window *window, struct input *input, uint32_t time,
if (fullscreen->current_output)
wl_output = output_get_wl_output(fullscreen->current_output->output);
fullscreen->present_method = (fullscreen->present_method + 1) % 5;
- _wl_fullscreen_shell_present_surface(fullscreen->fshell,
- window_get_wl_surface(fullscreen->window),
- fullscreen->present_method,
- wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell,
+ window_get_wl_surface(fullscreen->window),
+ fullscreen->present_method,
+ wl_output);
window_schedule_redraw(window);
break;
@@ -308,8 +308,8 @@ key_handler(struct window *window, struct input *input, uint32_t time,
wl_output = fsout ? output_get_wl_output(fsout->output) : NULL;
/* Clear the current presentation */
- _wl_fullscreen_shell_present_surface(fullscreen->fshell, NULL,
- 0, wl_output);
+ zwl_fullscreen_shell1_present_surface(fullscreen->fshell, NULL,
+ 0, wl_output);
Hmm. With l's and 1's looking so similar in certain fonts, "shell1" is
going to look like a typo to some users. IMO it would be better to
distinguish this version number with at least an underscore.
"_shell_v1_" would feel more consistent with the scheme being used in
the header file name, protocol file name, macro definitions, etc.
A slight implicit point of it is to make it a bit awkward, so that it's
ever so slightly more obvious that this is intended to be temporary.
The other more important reason is I think we already have very long
names, and I tried to minimize the extra name length needed.
Being intentionally awkward seems like an anti-pattern to me. But I
would point out that if it is a goal, then making the names overly long
certainly would achieve that.
Increasing the length of the names does seem like a valid problem,
though. I almost mentioned it but in thinking it out, I figure: a) the
symbols are intentionally temporary, and making them intentionally
longer might even encourage making the base names slightly shorter,
which is in everyone's interest; b) the scheme is already adding 2
characters, we'd be adding 4 instead, which doesn't seem *that*
excessive; c) clarity is more important to me than brevity; d) making
the names more consistent with header, macro names, etc. seems way more
important than typing convenience.
I see your points. I suppose zwp_..._vN does have more benefits than
zwp_...N, so I'm up for changing.
Post by Bryce Harrington
If increasing the length is still considered a problem, Bill's
suggestion to move the version to the prefix might be worth further
consideration. It addresses making things clearer without increasing
character count, although I'm uncertain about its usability since it'll
impact name searching and sorting.
Yea, not so sure about putting it in the beginning for the reasons you
already pointed out.


Jonas
Post by Bryce Harrington
Post by Jonas Ådahl
I guess I can be convinced otherwise, but personally I prefer the way it
is.
Well, we all are going to have to live with the scheme...
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
diff --git a/configure.ac b/configure.ac
index e5afbc0..cfac579 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,6 +181,13 @@ fi
PKG_CHECK_MODULES(LIBINPUT_BACKEND, [libinput >= 0.8.0])
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
+PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 0.1.0],
Please also update RELEASING with a sentence or two about needing to
check and update this protocol package version number.
Will do.
Jonas
Bryce
Pekka Paalanen
2015-11-06 08:24:21 UTC
Permalink
On Fri, 6 Nov 2015 10:51:09 +0800
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Is it, really?

These headers will not be found installed in the system, ever. They
will always be generated locally in the Weston build tree during the
build, the same way we used to do it without wayland-protocols repo.

wayland-protocols package is only ever meant to install XML files, not
headers.


Thanks,
pq
Jonas Ådahl
2015-11-06 08:31:38 UTC
Permalink
Post by Pekka Paalanen
On Fri, 6 Nov 2015 10:51:09 +0800
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Is it, really?
Gah, mind blurb. Yes, of course.


Jonas
Post by Pekka Paalanen
These headers will not be found installed in the system, ever. They
will always be generated locally in the Weston build tree during the
build, the same way we used to do it without wayland-protocols repo.
wayland-protocols package is only ever meant to install XML files, not
headers.
Thanks,
pq
Bryce Harrington
2015-11-06 18:17:23 UTC
Permalink
Post by Pekka Paalanen
On Fri, 6 Nov 2015 10:51:09 +0800
Post by Jonas Ådahl
Post by Bryce Harrington
Post by Jonas Ådahl
Use the fullscreen-shell protocol XML from the wayland-protocols
installation, and remove the one we provide ourself.
diff --git a/clients/fullscreen.c b/clients/fullscreen.c
index 4fcca3d..be316d0 100644
--- a/clients/fullscreen.c
+++ b/clients/fullscreen.c
@@ -35,7 +35,7 @@
#include <linux/input.h>
#include <wayland-client.h>
#include "window.h"
-#include "fullscreen-shell-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
Angle brackets should be used here and elsewhere, since with this change
the header file now is located externally from the system rather than
being locally present in the codebase.
#include <fullscreen-shell-unstable-v1-client-protocol.h>
Good point.
Is it, really?
These headers will not be found installed in the system, ever. They
will always be generated locally in the Weston build tree during the
build, the same way we used to do it without wayland-protocols repo.
Oh! In that case yeah quotes are fine. Forgot that they're generated
files.

Bryce
Post by Pekka Paalanen
wayland-protocols package is only ever meant to install XML files, not
headers.
Thanks,
pq
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIVAwUBVjxjvSNf5bQRqqqnAQjK4Q/+M8za5+kttG0rjQqqG34wX7GC0ADmcRme
nUWz7DO5AWAQv/n3Ct8veuYWVnAhKBSJQEPmDvNCw2xNXrzEs11hispY1tlimt2m
NU5e7x87p29Vid9pEAclqrYXD1m3dM9wp2MWQIxZwco3DW5/0sep+cOAu9XDygpC
Z0gtzL2WUGi7KgbqPjceBcC/GgRx7aGm2KwSLM6HN2K0E2HeMcBYnBjnnqNe6fBm
98wYVW6ohnxu2kk3C4HdvexMlB5frH7LURaFXsWGc2CQyN+kLwBQgAeapHuG68Dk
QE6XYYYVN6bTiJNYgWcVlN22ZYPoZeS6eAEyfVmbBVmPJ6atpr0w44L534npB4jO
ekmUgsnk0NVNfZcLK/uxFrGaPPIbyR5FmbyI1FIYeDDn5VOePVzjjAK2aB/Cu+5s
R471bTKAbvQVwvTnxHBG0MZC8Nobgm0oRseiXbkOwP2hkH3v/A42S7nP6Rf62CUp
qimV3K4zlL1zKcV/l8XMSpI9HP3Xrs/7Mc9FViZaLpOEW5Q/NK3RQfhjlLI+NoFR
9w25yEvRvwap7Z9ZM/ZAeC2UT2ZklSvmwfTw/8lmzkp6dW/TAwbRrZFtkDuNc3T9
Virw1asKxGxstaEBs5SEcJV2v6oB5yjEWvDfMqEeEMeD1dDjLbwrcRL1vBYiMgQN
BqA995O6OcY=
=3Qrz
-----END PGP SIGNATURE-----
Jonas Ådahl
2015-11-04 08:49:51 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 13 +--
clients/simple-dmabuf.c | 56 +++++-----
protocol/linux-dmabuf.xml | 274 ----------------------------------------------
src/gl-renderer.c | 6 +-
src/linux-dmabuf.c | 40 +++----
5 files changed, 57 insertions(+), 332 deletions(-)
delete mode 100644 protocol/linux-dmabuf.xml

diff --git a/Makefile.am b/Makefile.am
index 2524591..9f7cc9d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -127,8 +127,8 @@ nodist_weston_SOURCES = \
protocol/presentation_timing-server-protocol.h \
protocol/scaler-protocol.c \
protocol/scaler-server-protocol.h \
- protocol/linux-dmabuf-protocol.c \
- protocol/linux-dmabuf-server-protocol.h
+ protocol/linux-dmabuf-unstable-v1-protocol.c \
+ protocol/linux-dmabuf-unstable-v1-server-protocol.h

BUILT_SOURCES += $(nodist_weston_SOURCES)

@@ -533,11 +533,11 @@ nodist_weston_simple_dmabuf_SOURCES = \
protocol/xdg-shell-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
- protocol/linux-dmabuf-protocol.c \
- protocol/linux-dmabuf-client-protocol.h
+ protocol/linux-dmabuf-unstable-v1-protocol.c \
+ protocol/linux-dmabuf-unstable-v1-client-protocol.h
weston_simple_dmabuf_CFLAGS = $(AM_CFLAGS) $(SIMPLE_DMABUF_CLIENT_CFLAGS)
weston_simple_dmabuf_LDADD = $(SIMPLE_DMABUF_CLIENT_LIBS) libshared.la
-BUILT_SOURCES += protocol/linux-dmabuf-client-protocol.h
+BUILT_SOURCES += protocol/linux-dmabuf-unstable-v1-client-protocol.h
endif

noinst_LTLIBRARIES += libtoytoolkit.la
@@ -1351,8 +1351,7 @@ EXTRA_DIST += \
protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
- protocol/ivi-hmi-controller.xml \
- protocol/linux-dmabuf.xml
+ protocol/ivi-hmi-controller.xml

#
# manual test modules in tests subdirectory
diff --git a/clients/simple-dmabuf.c b/clients/simple-dmabuf.c
index 793aef2..f9d794d 100644
--- a/clients/simple-dmabuf.c
+++ b/clients/simple-dmabuf.c
@@ -42,7 +42,7 @@
#include <wayland-client.h>
#include "xdg-shell-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
-#include "linux-dmabuf-client-protocol.h"
+#include "linux-dmabuf-unstable-v1-client-protocol.h"

struct display {
struct wl_display *display;
@@ -50,7 +50,7 @@ struct display {
struct wl_compositor *compositor;
struct xdg_shell *shell;
struct zwl_fullscreen_shell1 *fshell;
- struct zlinux_dmabuf *dmabuf;
+ struct zlinux_dmabuf1 *dmabuf;
int xrgb8888_format_found;
};

@@ -187,7 +187,7 @@ unmap_bo(struct buffer *my_buf)

static void
create_succeeded(void *data,
- struct zlinux_buffer_params *params,
+ struct zlinux_buffer_params1 *params,
struct wl_buffer *new_buffer)
{
struct buffer *buffer = data;
@@ -195,22 +195,22 @@ create_succeeded(void *data,
buffer->buffer = new_buffer;
wl_buffer_add_listener(buffer->buffer, &buffer_listener, buffer);

- zlinux_buffer_params_destroy(params);
+ zlinux_buffer_params1_destroy(params);
}

static void
-create_failed(void *data, struct zlinux_buffer_params *params)
+create_failed(void *data, struct zlinux_buffer_params1 *params)
{
struct buffer *buffer = data;

buffer->buffer = NULL;

- zlinux_buffer_params_destroy(params);
+ zlinux_buffer_params1_destroy(params);

fprintf(stderr, "Error: zlinux_buffer_params.create failed.\n");
}

-static const struct zlinux_buffer_params_listener params_listener = {
+static const struct zlinux_buffer_params1_listener params_listener = {
create_succeeded,
create_failed
};
@@ -219,7 +219,7 @@ static int
create_dmabuf_buffer(struct display *display, struct buffer *buffer,
int width, int height)
{
- struct zlinux_buffer_params *params;
+ struct zlinux_buffer_params1 *params;
uint64_t modifier;
uint32_t flags;

@@ -259,20 +259,20 @@ create_dmabuf_buffer(struct display *display, struct buffer *buffer,
modifier = 0;
flags = 0;

- params = zlinux_dmabuf_create_params(display->dmabuf);
- zlinux_buffer_params_add(params,
- buffer->dmabuf_fd,
- 0, /* plane_idx */
- 0, /* offset */
- buffer->stride,
- modifier >> 32,
- modifier & 0xffffffff);
- zlinux_buffer_params_add_listener(params, &params_listener, buffer);
- zlinux_buffer_params_create(params,
- buffer->width,
- buffer->height,
- DRM_FORMAT_XRGB8888,
- flags);
+ params = zlinux_dmabuf1_create_params(display->dmabuf);
+ zlinux_buffer_params1_add(params,
+ buffer->dmabuf_fd,
+ 0, /* plane_idx */
+ 0, /* offset */
+ buffer->stride,
+ modifier >> 32,
+ modifier & 0xffffffff);
+ zlinux_buffer_params1_add_listener(params, &params_listener, buffer);
+ zlinux_buffer_params1_create(params,
+ buffer->width,
+ buffer->height,
+ DRM_FORMAT_XRGB8888,
+ flags);

/* params is destroyed by the event handlers */

@@ -430,7 +430,7 @@ static const struct wl_callback_listener frame_listener = {
};

static void
-dmabuf_format(void *data, struct zlinux_dmabuf *zlinux_dmabuf, uint32_t format)
+dmabuf_format(void *data, struct zlinux_dmabuf1 *zlinux_dmabuf, uint32_t format)
{
struct display *d = data;

@@ -438,7 +438,7 @@ dmabuf_format(void *data, struct zlinux_dmabuf *zlinux_dmabuf, uint32_t format)
d->xrgb8888_format_found = 1;
}

-static const struct zlinux_dmabuf_listener dmabuf_listener = {
+static const struct zlinux_dmabuf1_listener dmabuf_listener = {
dmabuf_format
};

@@ -476,10 +476,10 @@ registry_handle_global(void *data, struct wl_registry *registry,
} else if (strcmp(interface, "zwl_fullscreen_shell1") == 0) {
d->fshell = wl_registry_bind(registry,
id, &zwl_fullscreen_shell1_interface, 1);
- } else if (strcmp(interface, "zlinux_dmabuf") == 0) {
+ } else if (strcmp(interface, "zlinux_dmabuf1") == 0) {
d->dmabuf = wl_registry_bind(registry,
- id, &zlinux_dmabuf_interface, 1);
- zlinux_dmabuf_add_listener(d->dmabuf, &dmabuf_listener, d);
+ id, &zlinux_dmabuf1_interface, 1);
+ zlinux_dmabuf1_add_listener(d->dmabuf, &dmabuf_listener, d);
}
}

@@ -533,7 +533,7 @@ static void
destroy_display(struct display *display)
{
if (display->dmabuf)
- zlinux_dmabuf_destroy(display->dmabuf);
+ zlinux_dmabuf1_destroy(display->dmabuf);

if (display->shell)
xdg_shell_destroy(display->shell);
diff --git a/protocol/linux-dmabuf.xml b/protocol/linux-dmabuf.xml
deleted file mode 100644
index 0382be6..0000000
--- a/protocol/linux-dmabuf.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="linux_dmabuf">
-
- <copyright>
- Copyright © 2014, 2015 Collabora, Ltd.
-
- 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.
- </copyright>
-
- <interface name="zlinux_dmabuf" version="1">
- <description summary="factory for creating dmabuf-based wl_buffers">
- Following the interfaces from:
- https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
- and the Linux DRM sub-system's AddFb2 ioctl.
-
- This interface offers a way to create generic dmabuf-based
- wl_buffers. Immediately after a client binds to this interface,
- the set of supported formats is sent with 'format' events.
-
- The following are required from clients:
-
- - Clients must ensure that either all data in the dma-buf is
- coherent for all subsequent read access or that coherency is
- correctly handled by the underlying kernel-side dma-buf
- implementation.
-
- - Don't make any more attachments after sending the buffer to the
- compositor. Making more attachments later increases the risk of
- the compositor not being able to use (re-import) an existing
- dmabuf-based wl_buffer.
-
- The underlying graphics stack must ensure the following:
-
- - The dmabuf file descriptors relayed to the server will stay valid
- for the whole lifetime of the wl_buffer. This means the server may
- at any time use those fds to import the dmabuf into any kernel
- sub-system that might accept it.
-
- To create a wl_buffer from one or more dmabufs, a client creates a
- zlinux_dmabuf_params object with zlinux_dmabuf.create_params
- request. All planes required by the intended format are added with
- the 'add' request. Finally, 'create' request is issued. The server
- will reply with either 'created' event which provides the final
- wl_buffer or 'failed' event saying that it cannot use the dmabufs
- provided.
- </description>
-
- <request name="destroy" type="destructor">
- <description summary="unbind the factory">
- Objects created through this interface, especially wl_buffers, will
- remain valid.
- </description>
- </request>
-
- <request name="create_params">
- <description summary="create a temporary object for buffer parameters">
- This temporary object is used to collect multiple dmabuf handles into
- a single batch to create a wl_buffer. It can only be used once and
- should be destroyed after an 'created' or 'failed' event has been
- received.
- </description>
- <arg name="params_id" type="new_id" interface="zlinux_buffer_params"
- summary="the new temporary"/>
- </request>
-
- <event name="format">
- <description summary="supported buffer format">
- This event advertises one buffer format that the server supports.
- All the supported formats are advertised once when the client
- binds to this interface. A roundtrip after binding guarantees,
- that the client has received all supported formats.
-
- For the definition of the format codes, see create request.
-
- XXX: Can a compositor ever enumerate them?
- </description>
- <arg name="format" type="uint" summary="DRM_FORMAT code"/>
- </event>
-
- </interface>
-
- <interface name="zlinux_buffer_params" version="1">
- <description summary="parameters for creating a dmabuf-based wl_buffer">
- This temporary object is a collection of dmabufs and other
- parameters that together form a single logical buffer. The temporary
- object may eventually create one wl_buffer unless cancelled by
- destroying it before requesting 'create'.
-
- Single-planar formats only require one dmabuf, however
- multi-planar formats may require more than one dmabuf. For all
- formats, 'add' request must be called once per plane (even if the
- underlying dmabuf fd is identical).
-
- You must use consecutive plane indices ('plane_idx' argument for 'add')
- from zero to the number of planes used by the drm_fourcc format code.
- All planes required by the format must be given exactly once, but can
- be given in any order. Each plane index can be set only once.
- </description>
-
- <enum name="error">
- <entry name="already_used" value="0"
- summary="the dmabuf_batch object has already been used to create a wl_buffer"/>
-
- <entry name="plane_idx" value="1"
- summary="plane index out of bounds"/>
-
- <entry name="plane_set" value="2"
- summary="the plane index was already set"/>
-
- <entry name="incomplete" value="3"
- summary="missing or too many planes to create a buffer"/>
-
- <entry name="invalid_format" value="4"
- summary="format not supported"/>
-
- <entry name="invalid_dimensions" value="5"
- summary="invalid width or height"/>
-
- <entry name="out_of_bounds" value="6"
- summary="offset + stride * height goes out of dmabuf bounds"/>
- </enum>
-
- <request name="destroy" type="destructor">
- <description summary="delete this object, used or not">
- Cleans up the temporary data sent to the server for dmabuf-based
- wl_buffer creation.
- </description>
- </request>
-
- <request name="add">
- <description summary="add a dmabuf to the temporary set">
- This request adds one dmabuf to the set in this zlinux_buffer_params.
-
- The 64-bit unsigned value combined from modifier_hi and modifier_lo
- is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the
- fb modifier, which is defined in drm_mode.h of Linux UAPI.
- This is an opaque token. Drivers use this token to express tiling,
- compression, etc. driver-specific modifications to the base format
- defined by the DRM fourcc code.
-
- This request raises the PLANE_IDX error if plane_idx is too large.
- The error PLANE_SET is raised if attempting to set a plane that
- was already set.
- </description>
-
- <arg name="fd" type="fd" summary="dmabuf fd"/>
- <arg name="plane_idx" type="uint" summary="plane index"/>
- <arg name="offset" type="uint" summary="offset in bytes"/>
- <arg name="stride" type="uint" summary="stride in bytes"/>
- <arg name="modifier_hi" type="uint"
- summary="high 32 bits of layout modifier"/>
- <arg name="modifier_lo" type="uint"
- summary="low 32 bits of layout modifier"/>
- </request>
-
- <enum name="flags">
- <entry name="y_invert" value="1" summary="contents are y-inverted"/>
- <entry name="interlaced" value="2" summary="content is interlaced"/>
- <entry name="bottom_first" value="4" summary="bottom field first"/>
- </enum>
-
- <request name="create">
- <description summary="create a wl_buffer from the given dmabufs">
- This asks for creation of a wl_buffer from the added dmabuf
- buffers. The wl_buffer is not created immediately but returned via
- the 'created' event if the dmabuf sharing succeeds. The sharing
- may fail at runtime for reasons a client cannot predict, in
- which case the 'failed' event is triggered.
-
- The 'format' argument is a DRM_FORMAT code, as defined by the
- libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
- authoritative source on how the format codes should work.
-
- The 'flags' is a bitfield of the flags defined in enum "flags".
- 'y_invert' means the that the image needs to be y-flipped.
-
- Flag 'interlaced' means that the frame in the buffer is not
- progressive as usual, but interlaced. An interlaced buffer as
- supported here must always contain both top and bottom fields.
- The top field always begins on the first pixel row. The temporal
- ordering between the two fields is top field first, unless
- 'bottom_first' is specified. It is undefined whether 'bottom_first'
- is ignored if 'interlaced' is not set.
-
- This protocol does not convey any information about field rate,
- duration, or timing, other than the relative ordering between the
- two fields in one buffer. A compositor may have to estimate the
- intended field rate from the incoming buffer rate. It is undefined
- whether the time of receiving wl_surface.commit with a new buffer
- attached, applying the wl_surface state, wl_surface.frame callback
- trigger, presentation, or any other point in the compositor cycle
- is used to measure the frame or field times. There is no support
- for detecting missed or late frames/fields/buffers either, and
- there is no support whatsoever for cooperating with interlaced
- compositor output.
-
- The composited image quality resulting from the use of interlaced
- buffers is explicitly undefined. A compositor may use elaborate
- hardware features or software to deinterlace and create progressive
- output frames from a sequence of interlaced input buffers, or it
- may produce substandard image quality. However, compositors that
- cannot guarantee reasonable image quality in all cases are recommended
- to just reject all interlaced buffers.
-
- Any argument errors, including non-positive width or height,
- mismatch between the number of planes and the format, bad
- format, bad offset or stride, may be indicated by fatal protocol
- errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
- OUT_OF_BOUNDS.
-
- Dmabuf import errors in the server that are not obvious client
- bugs are returned via the 'failed' event as non-fatal. This
- allows attempting dmabuf sharing and falling back in the client
- if it fails.
-
- This request can be sent only once in the object's lifetime, after
- which the only legal request is destroy. This object should be
- destroyed after issuing 'create' request. Attempting to use this
- object after issuing 'create' raises ALREADY_USED protocol error.
-
- It is not mandatory to issue 'create'. If a client wants to
- cancel the buffer creation, it can just destroy this object.
- </description>
- <arg name="width" type="int" summary="base plane width in pixels"/>
- <arg name="height" type="int" summary="base plane height in pixels"/>
- <arg name="format" type="uint" summary="DRM_FORMAT code"/>
- <arg name="flags" type="uint" summary="see enum flags"/>
- </request>
-
- <event name="created">
- <description summary="buffer creation succeeded">
- This event indicates that the attempted buffer creation was
- successful. It provides the new wl_buffer referencing the dmabuf(s).
-
- Upon receiving this event, the client should destroy the
- zlinux_dmabuf_params object.
- </description>
- <arg name="buffer" type="new_id" interface="wl_buffer"
- summary="the newly created wl_buffer"/>
- </event>
-
- <event name="failed">
- <description summary="buffer creation failed">
- This event indicates that the attempted buffer creation has
- failed. It usually means that one of the dmabuf constraints
- has not been fulfilled.
-
- Upon receiving this event, the client should destroy the
- zlinux_buffer_params object.
- </description>
- </event>
-
- </interface>
-
-</protocol>
diff --git a/src/gl-renderer.c b/src/gl-renderer.c
index d7231f4..9e53490 100644
--- a/src/gl-renderer.c
+++ b/src/gl-renderer.c
@@ -41,7 +41,7 @@
#include "gl-renderer.h"
#include "vertex-clipping.h"
#include "linux-dmabuf.h"
-#include "linux-dmabuf-server-protocol.h"
+#include "linux-dmabuf-unstable-v1-server-protocol.h"

#include "shared/helpers.h"
#include "weston-egl-ext.h"
@@ -1514,7 +1514,7 @@ gl_renderer_import_dmabuf(struct weston_compositor *ec,
}

/* reject all flags we do not recognize or handle */
- if (dmabuf->flags & ~ZLINUX_BUFFER_PARAMS_FLAGS_Y_INVERT)
+ if (dmabuf->flags & ~ZLINUX_BUFFER_PARAMS1_FLAGS_Y_INVERT)
return false;

image = import_dmabuf(gr, dmabuf);
@@ -1563,7 +1563,7 @@ gl_renderer_attach_dmabuf(struct weston_surface *surface,
buffer->width = dmabuf->width;
buffer->height = dmabuf->height;
buffer->y_inverted =
- !!(dmabuf->flags & ZLINUX_BUFFER_PARAMS_FLAGS_Y_INVERT);
+ !!(dmabuf->flags & ZLINUX_BUFFER_PARAMS1_FLAGS_Y_INVERT);

for (i = 0; i < gs->num_images; i++)
egl_image_unref(gs->images[i]);
diff --git a/src/linux-dmabuf.c b/src/linux-dmabuf.c
index 90c9757..a2b6c72 100644
--- a/src/linux-dmabuf.c
+++ b/src/linux-dmabuf.c
@@ -28,7 +28,7 @@

#include "compositor.h"
#include "linux-dmabuf.h"
-#include "linux-dmabuf-server-protocol.h"
+#include "linux-dmabuf-unstable-v1-server-protocol.h"

static void
linux_dmabuf_buffer_destroy(struct linux_dmabuf_buffer *buffer)
@@ -78,7 +78,7 @@ params_add(struct wl_client *client,
buffer = wl_resource_get_user_data(params_resource);
if (!buffer) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_ALREADY_USED,
+ ZLINUX_BUFFER_PARAMS1_ERROR_ALREADY_USED,
"params was already used to create a wl_buffer");
close(name_fd);
return;
@@ -89,7 +89,7 @@ params_add(struct wl_client *client,

if (plane_idx >= MAX_DMABUF_PLANES) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_PLANE_IDX,
+ ZLINUX_BUFFER_PARAMS1_ERROR_PLANE_IDX,
"plane index %u is too high", plane_idx);
close(name_fd);
return;
@@ -97,7 +97,7 @@ params_add(struct wl_client *client,

if (buffer->dmabuf_fd[plane_idx] != -1) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_PLANE_SET,
+ ZLINUX_BUFFER_PARAMS1_ERROR_PLANE_SET,
"a dmabuf has already been added for plane %u",
plane_idx);
close(name_fd);
@@ -153,7 +153,7 @@ params_create(struct wl_client *client,

if (!buffer) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_ALREADY_USED,
+ ZLINUX_BUFFER_PARAMS1_ERROR_ALREADY_USED,
"params was already used to create a wl_buffer");
return;
}
@@ -169,7 +169,7 @@ params_create(struct wl_client *client,

if (!buffer->n_planes) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_INCOMPLETE,
+ ZLINUX_BUFFER_PARAMS1_ERROR_INCOMPLETE,
"no dmabuf has been added to the params");
goto err_out;
}
@@ -178,7 +178,7 @@ params_create(struct wl_client *client,
for (i = 0; i < buffer->n_planes; i++) {
if (buffer->dmabuf_fd[i] == -1) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_INCOMPLETE,
+ ZLINUX_BUFFER_PARAMS1_ERROR_INCOMPLETE,
"no dmabuf has been added for plane %i", i);
goto err_out;
}
@@ -191,7 +191,7 @@ params_create(struct wl_client *client,

if (width < 1 || height < 1) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_INVALID_DIMENSIONS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_INVALID_DIMENSIONS,
"invalid width %d or height %d", width, height);
goto err_out;
}
@@ -201,7 +201,7 @@ params_create(struct wl_client *client,

if ((uint64_t) buffer->offset[i] + buffer->stride[i] > UINT32_MAX) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_OUT_OF_BOUNDS,
"size overflow for plane %i", i);
goto err_out;
}
@@ -210,7 +210,7 @@ params_create(struct wl_client *client,
(uint64_t) buffer->offset[i] +
(uint64_t) buffer->stride[i] * height > UINT32_MAX) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_OUT_OF_BOUNDS,
"size overflow for plane %i", i);
goto err_out;
}
@@ -223,7 +223,7 @@ params_create(struct wl_client *client,

if (buffer->offset[i] >= size) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_OUT_OF_BOUNDS,
"invalid offset %i for plane %i",
buffer->offset[i], i);
goto err_out;
@@ -231,7 +231,7 @@ params_create(struct wl_client *client,

if (buffer->offset[i] + buffer->stride[i] > size) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_OUT_OF_BOUNDS,
"invalid stride %i for plane %i",
buffer->stride[i], i);
goto err_out;
@@ -242,7 +242,7 @@ params_create(struct wl_client *client,
if (i == 0 &&
buffer->offset[i] + buffer->stride[i] * height > size) {
wl_resource_post_error(params_resource,
- ZLINUX_BUFFER_PARAMS_ERROR_OUT_OF_BOUNDS,
+ ZLINUX_BUFFER_PARAMS1_ERROR_OUT_OF_BOUNDS,
"invalid buffer stride or height for plane %i", i);
goto err_out;
}
@@ -269,7 +269,7 @@ params_create(struct wl_client *client,
&linux_dmabuf_buffer_implementation,
buffer, destroy_linux_dmabuf_wl_buffer);

- zlinux_buffer_params_send_created(params_resource,
+ zlinux_buffer_params1_send_created(params_resource,
buffer->buffer_resource);

return;
@@ -279,13 +279,13 @@ err_buffer:
buffer->user_data_destroy_func(buffer);

err_failed:
- zlinux_buffer_params_send_failed(params_resource);
+ zlinux_buffer_params1_send_failed(params_resource);

err_out:
linux_dmabuf_buffer_destroy(buffer);
}

-static const struct zlinux_buffer_params_interface
+static const struct zlinux_buffer_params1_interface
zlinux_buffer_params_implementation = {
params_destroy,
params_add,
@@ -321,7 +321,7 @@ linux_dmabuf_create_params(struct wl_client *client,
buffer->compositor = compositor;
buffer->params_resource =
wl_resource_create(client,
- &zlinux_buffer_params_interface,
+ &zlinux_buffer_params1_interface,
version, params_id);
if (!buffer->params_resource)
goto err_dealloc;
@@ -411,7 +411,7 @@ linux_dmabuf_buffer_get_user_data(struct linux_dmabuf_buffer *buffer)
return buffer->user_data;
}

-static const struct zlinux_dmabuf_interface linux_dmabuf_implementation = {
+static const struct zlinux_dmabuf1_interface linux_dmabuf_implementation = {
linux_dmabuf_destroy,
linux_dmabuf_create_params
};
@@ -423,7 +423,7 @@ bind_linux_dmabuf(struct wl_client *client,
struct weston_compositor *compositor = data;
struct wl_resource *resource;

- resource = wl_resource_create(client, &zlinux_dmabuf_interface,
+ resource = wl_resource_create(client, &zlinux_dmabuf1_interface,
version, id);
if (resource == NULL) {
wl_client_post_no_memory(client);
@@ -453,7 +453,7 @@ WL_EXPORT int
linux_dmabuf_setup(struct weston_compositor *compositor)
{
if (!wl_global_create(compositor->wl_display,
- &zlinux_dmabuf_interface, 1,
+ &zlinux_dmabuf1_interface, 1,
compositor, bind_linux_dmabuf))
return -1;
--
2.4.3
Pekka Paalanen
2015-11-05 11:25:43 UTC
Permalink
On Wed, 4 Nov 2015 16:49:51 +0800
Post by Jonas Ådahl
---
Makefile.am | 13 +--
clients/simple-dmabuf.c | 56 +++++-----
protocol/linux-dmabuf.xml | 274 ----------------------------------------------
src/gl-renderer.c | 6 +-
src/linux-dmabuf.c | 40 +++----
5 files changed, 57 insertions(+), 332 deletions(-)
delete mode 100644 protocol/linux-dmabuf.xml
Acked-by: Pekka Paalanen <***@collabora.co.uk>

Subject to the question of whether non-global interfaces should have
the renaming treatment. The non-global interface in this extension did
have the 'z' prefix already, but I don't think it was thought through
much.


Thanks,
pq
Jonas Ådahl
2015-11-04 08:49:52 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 21 ++-
clients/presentation-shm.c | 65 +++++-----
clients/weston-info.c | 19 +--
protocol/presentation_timing.xml | 274 ---------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 2 +-
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +++--
tests/presentation-test.c | 34 ++---
12 files changed, 101 insertions(+), 369 deletions(-)
delete mode 100644 protocol/presentation_timing.xml

diff --git a/Makefile.am b/Makefile.am
index 9f7cc9d..175e924 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -123,8 +123,8 @@ nodist_weston_SOURCES = \
protocol/input-method-server-protocol.h \
protocol/workspaces-protocol.c \
protocol/workspaces-server-protocol.h \
- protocol/presentation_timing-protocol.c \
- protocol/presentation_timing-server-protocol.h \
+ protocol/presentation-timing-unstable-v1-protocol.c \
+ protocol/presentation-timing-unstable-v1-server-protocol.h \
protocol/scaler-protocol.c \
protocol/scaler-server-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
@@ -503,8 +503,8 @@ weston_presentation_shm_SOURCES = \
clients/presentation-shm.c \
shared/helpers.h
nodist_weston_presentation_shm_SOURCES = \
- protocol/presentation_timing-protocol.c \
- protocol/presentation_timing-client-protocol.h
+ protocol/presentation-timing-unstable-v1-protocol.c \
+ protocol/presentation-timing-unstable-v1-client-protocol.h
weston_presentation_shm_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
weston_presentation_shm_LDADD = $(SIMPLE_CLIENT_LIBS) libshared.la -lm -lrt

@@ -554,8 +554,8 @@ nodist_libtoytoolkit_la_SOURCES = \
protocol/scaler-client-protocol.h \
protocol/workspaces-protocol.c \
protocol/workspaces-client-protocol.h \
- protocol/presentation_timing-protocol.c \
- protocol/presentation_timing-client-protocol.h \
+ protocol/presentation-timing-unstable-v1-protocol.c \
+ protocol/presentation-timing-unstable-v1-client-protocol.h \
protocol/xdg-shell-protocol.c \
protocol/xdg-shell-client-protocol.h \
protocol/ivi-application-protocol.c \
@@ -712,8 +712,8 @@ weston_info_SOURCES = \
clients/weston-info.c \
shared/helpers.h
nodist_weston_info_SOURCES = \
- protocol/presentation_timing-protocol.c \
- protocol/presentation_timing-client-protocol.h
+ protocol/presentation-timing-unstable-v1-protocol.c \
+ protocol/presentation-timing-unstable-v1-client-protocol.h
weston_info_LDADD = $(WESTON_INFO_LIBS) libshared.la
weston_info_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

@@ -1225,8 +1225,8 @@ presentation_weston_SOURCES = \
tests/presentation-test.c \
shared/helpers.h
nodist_presentation_weston_SOURCES = \
- protocol/presentation_timing-protocol.c \
- protocol/presentation_timing-client-protocol.h
+ protocol/presentation-timing-unstable-v1-protocol.c \
+ protocol/presentation-timing-unstable-v1-client-protocol.h
presentation_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
presentation_weston_LDADD = libtest-client.la

@@ -1348,7 +1348,6 @@ EXTRA_DIST += \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/xdg-shell.xml \
- protocol/presentation_timing.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
protocol/ivi-hmi-controller.xml
diff --git a/clients/presentation-shm.c b/clients/presentation-shm.c
index 120c40c..9083d8e 100644
--- a/clients/presentation-shm.c
+++ b/clients/presentation-shm.c
@@ -38,7 +38,7 @@
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
-#include "presentation_timing-client-protocol.h"
+#include "presentation-timing-unstable-v1-client-protocol.h"

enum run_mode {
RUN_MODE_FEEDBACK,
@@ -67,7 +67,7 @@ struct display {
struct wl_shm *shm;
uint32_t formats;

- struct presentation *presentation;
+ struct zwl_presentation1 *presentation;
clockid_t clk_id;

struct wl_list output_list; /* struct output::link */
@@ -76,7 +76,7 @@ struct display {
struct feedback {
struct window *window;
unsigned frame_no;
- struct presentation_feedback *feedback;
+ struct zwl_presentation_feedback1 *feedback;
struct timespec commit;
struct timespec target;
uint32_t frame_stamp;
@@ -251,7 +251,7 @@ static void
destroy_feedback(struct feedback *feedback)
{
if (feedback->feedback)
- presentation_feedback_destroy(feedback->feedback);
+ zwl_presentation_feedback1_destroy(feedback->feedback);

wl_list_remove(&feedback->link);
free(feedback);
@@ -344,7 +344,7 @@ paint_pixels(void *image, int width, int height, uint32_t phase)

static void
feedback_sync_output(void *data,
- struct presentation_feedback *presentation_feedback,
+ struct zwl_presentation_feedback1 *presentation_feedback,
struct wl_output *output)
{
/* not interested */
@@ -357,10 +357,10 @@ pflags_to_str(uint32_t flags, char *str, unsigned len)
uint32_t flag;
char sym;
} desc[] = {
- { PRESENTATION_FEEDBACK_KIND_VSYNC, 's' },
- { PRESENTATION_FEEDBACK_KIND_HW_CLOCK, 'c' },
- { PRESENTATION_FEEDBACK_KIND_HW_COMPLETION, 'e' },
- { PRESENTATION_FEEDBACK_KIND_ZERO_COPY, 'z' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_VSYNC, 's' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_HW_CLOCK, 'c' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_HW_COMPLETION, 'e' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_ZERO_COPY, 'z' },
};
unsigned i;

@@ -400,7 +400,7 @@ timespec_diff_to_usec(const struct timespec *a, const struct timespec *b)

static void
feedback_presented(void *data,
- struct presentation_feedback *presentation_feedback,
+ struct zwl_presentation_feedback1 *presentation_feedback,
uint32_t tv_sec_hi,
uint32_t tv_sec_lo,
uint32_t tv_nsec,
@@ -456,7 +456,7 @@ feedback_presented(void *data,

static void
feedback_discarded(void *data,
- struct presentation_feedback *presentation_feedback)
+ struct zwl_presentation_feedback1 *presentation_feedback)
{
struct feedback *feedback = data;

@@ -465,7 +465,7 @@ feedback_discarded(void *data,
destroy_feedback(feedback);
}

-static const struct presentation_feedback_listener feedback_listener = {
+static const struct zwl_presentation_feedback1_listener feedback_listener = {
feedback_sync_output,
feedback_presented,
feedback_discarded
@@ -492,7 +492,7 @@ static void
window_create_feedback(struct window *window, uint32_t frame_stamp)
{
static unsigned seq;
- struct presentation *pres = window->display->presentation;
+ struct zwl_presentation1 *pres = window->display->presentation;
struct feedback *feedback;

seq++;
@@ -505,9 +505,9 @@ window_create_feedback(struct window *window, uint32_t frame_stamp)
return;

feedback->window = window;
- feedback->feedback = presentation_feedback(pres, window->surface);
- presentation_feedback_add_listener(feedback->feedback,
- &feedback_listener, feedback);
+ feedback->feedback = zwl_presentation1_feedback(pres, window->surface);
+ zwl_presentation_feedback1_add_listener(feedback->feedback,
+ &feedback_listener, feedback);

feedback->frame_no = seq;

@@ -559,21 +559,21 @@ static const struct wl_callback_listener frame_listener_mode_feedback = {
redraw_mode_feedback
};

-static const struct presentation_feedback_listener feedkick_listener;
+static const struct zwl_presentation_feedback1_listener feedkick_listener;

static void
window_feedkick(struct window *window)
{
- struct presentation *pres = window->display->presentation;
- struct presentation_feedback *fback;
+ struct zwl_presentation1 *pres = window->display->presentation;
+ struct zwl_presentation_feedback1 *fback;

- fback = presentation_feedback(pres, window->surface);
- presentation_feedback_add_listener(fback, &feedkick_listener, window);
+ fback = zwl_presentation1_feedback(pres, window->surface);
+ zwl_presentation_feedback1_add_listener(fback, &feedkick_listener, window);
}

static void
feedkick_presented(void *data,
- struct presentation_feedback *presentation_feedback,
+ struct zwl_presentation_feedback1 *presentation_feedback,
uint32_t tv_sec_hi,
uint32_t tv_sec_lo,
uint32_t tv_nsec,
@@ -584,7 +584,7 @@ feedkick_presented(void *data,
{
struct window *window = data;

- presentation_feedback_destroy(presentation_feedback);
+ zwl_presentation_feedback1_destroy(presentation_feedback);
window->refresh_nsec = refresh_nsec;

switch (window->mode) {
@@ -602,11 +602,11 @@ feedkick_presented(void *data,

static void
feedkick_discarded(void *data,
- struct presentation_feedback *presentation_feedback)
+ struct zwl_presentation_feedback1 *presentation_feedback)
{
struct window *window = data;

- presentation_feedback_destroy(presentation_feedback);
+ zwl_presentation_feedback1_destroy(presentation_feedback);

switch (window->mode) {
case RUN_MODE_PRESENT:
@@ -621,7 +621,7 @@ feedkick_discarded(void *data,
}
}

-static const struct presentation_feedback_listener feedkick_listener = {
+static const struct zwl_presentation_feedback1_listener feedkick_listener = {
feedback_sync_output,
feedkick_presented,
feedkick_discarded
@@ -687,7 +687,8 @@ display_add_output(struct display *d, uint32_t name, uint32_t version)
}

static void
-presentation_clock_id(void *data, struct presentation *presentation,
+presentation_clock_id(void *data,
+ struct zwl_presentation1 *presentation,
uint32_t clk_id)
{
struct display *d = data;
@@ -695,7 +696,7 @@ presentation_clock_id(void *data, struct presentation *presentation,
d->clk_id = clk_id;
}

-static const struct presentation_listener presentation_listener = {
+static const struct zwl_presentation1_listener presentation_listener = {
presentation_clock_id
};

@@ -730,12 +731,12 @@ registry_handle_global(void *data, struct wl_registry *registry,
wl_shm_add_listener(d->shm, &shm_listener, d);
} else if (strcmp(interface, "wl_output") == 0) {
display_add_output(d, name, version);
- } else if (strcmp(interface, "presentation") == 0) {
+ } else if (strcmp(interface, "zwl_presentation1") == 0) {
d->presentation =
wl_registry_bind(registry,
- name, &presentation_interface, 1);
- presentation_add_listener(d->presentation,
- &presentation_listener, d);
+ name, &zwl_presentation1_interface, 1);
+ zwl_presentation1_add_listener(d->presentation,
+ &presentation_listener, d);
}
}

diff --git a/clients/weston-info.c b/clients/weston-info.c
index f22781c..f885e27 100644
--- a/clients/weston-info.c
+++ b/clients/weston-info.c
@@ -34,7 +34,7 @@

#include "shared/helpers.h"
#include "shared/os-compatibility.h"
-#include "presentation_timing-client-protocol.h"
+#include "presentation-timing-unstable-v1-client-protocol.h"

typedef void (*print_info_t)(void *info);
typedef void (*destroy_info_t)(void *info);
@@ -102,7 +102,7 @@ struct seat_info {

struct presentation_info {
struct global_info global;
- struct presentation *presentation;
+ struct zwl_presentation1 *presentation;

clockid_t clk_id;
};
@@ -567,7 +567,7 @@ destroy_presentation_info(void *info)
{
struct presentation_info *prinfo = info;

- presentation_destroy(prinfo->presentation);
+ zwl_presentation1_destroy(prinfo->presentation);
}

static const char *
@@ -602,7 +602,8 @@ print_presentation_info(void *info)
}

static void
-presentation_handle_clock_id(void *data, struct presentation *presentation,
+presentation_handle_clock_id(void *data,
+ struct zwl_presentation1 *presentation,
uint32_t clk_id)
{
struct presentation_info *prinfo = data;
@@ -610,7 +611,7 @@ presentation_handle_clock_id(void *data, struct presentation *presentation,
prinfo->clk_id = clk_id;
}

-static const struct presentation_listener presentation_listener = {
+static const struct zwl_presentation1_listener presentation_listener = {
presentation_handle_clock_id
};

@@ -625,9 +626,11 @@ add_presentation_info(struct weston_info *info, uint32_t id, uint32_t version)

prinfo->clk_id = -1;
prinfo->presentation = wl_registry_bind(info->registry, id,
- &presentation_interface, 1);
- presentation_add_listener(prinfo->presentation, &presentation_listener,
- prinfo);
+ &zwl_presentation1_interface,
+ 1);
+ zwl_presentation1_add_listener(prinfo->presentation,
+ &presentation_listener,
+ prinfo);

info->roundtrip_needed = true;
}
diff --git a/protocol/presentation_timing.xml b/protocol/presentation_timing.xml
deleted file mode 100644
index 10a5f14..0000000
--- a/protocol/presentation_timing.xml
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="presentation_timing">
-<!-- wrap:70 -->
-
- <copyright>
- Copyright © 2013-2014 Collabora, Ltd.
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="presentation" version="1">
- <description summary="timed presentation related wl_surface requests">
-
-<!-- Introduction -->
-
- The main feature of this interface is accurate presentation
- timing feedback to ensure smooth video playback while maintaining
- audio/video synchronization. Some features use the concept of a
- presentation clock, which is defined in presentation.clock_id
- event.
-
- Request 'feedback' can be regarded as an additional wl_surface
- method. It is part of the double-buffered surface state update
- mechanism, where other requests first set up the state and then
- wl_surface.commit atomically applies the state into use. In
- other words, wl_surface.commit submits a content update.
-
-<!-- Completing presentation -->
-
- When the final realized presentation time is available, e.g.
- after a framebuffer flip completes, the requested
- presentation_feedback.presented events are sent. The final
- presentation time can differ from the compositor's predicted
- display update time and the update's target time, especially
- when the compositor misses its target vertical blanking period.
- </description>
-
- <enum name="error">
- <description summary="fatal presentation errors">
- These fatal protocol errors may be emitted in response to
- illegal presentation requests.
- </description>
- <entry name="invalid_timestamp" value="0"
- summary="invalid value in tv_nsec"/>
- <entry name="invalid_flag" value="1"
- summary="invalid flag"/>
- </enum>
-
- <request name="destroy" type="destructor">
- <description summary="unbind from the presentation interface">
- Informs the server that the client will not be using this
- protocol object anymore. This does not affect any existing
- objects created by this interface.
- </description>
- </request>
-
- <request name="feedback">
- <description summary="request presentation feedback information">
- Request presentation feedback for the current content submission
- on the given surface. This creates a new presentation_feedback
- object, which will deliver the feedback information once. If
- multiple presentation_feedback objects are created for the same
- submission, they will all deliver the same information.
-
- For details on what information is returned, see
- presentation_feedback interface.
- </description>
-
- <arg name="surface" type="object" interface="wl_surface"
- summary="target surface"/>
- <arg name="callback" type="new_id" interface="presentation_feedback"
- summary="new feedback object"/>
- </request>
-
- <event name="clock_id">
- <description summary="clock ID for timestamps">
- This event tells the client in which clock domain the
- compositor interprets the timestamps used by the presentation
- extension. This clock is called the presentation clock.
-
- The compositor sends this event when the client binds to the
- presentation interface. The presentation clock does not change
- during the lifetime of the client connection.
-
- The clock identifier is platform dependent. Clients must be
- able to query the current clock value directly, not by asking
- the compositor.
-
- On Linux/glibc, the identifier value is one of the clockid_t
- values accepted by clock_gettime(). clock_gettime() is defined
- by POSIX.1-2001.
-
- Compositors should prefer a clock which does not jump and is
- not slewed e.g. by NTP. The absolute value of the clock is
- irrelevant. Precision of one millisecond or better is
- recommended.
-
- Timestamps in this clock domain are expressed as tv_sec_hi,
- tv_sec_lo, tv_nsec triples, each component being an unsigned
- 32-bit value. Whole seconds are in tv_sec which is a 64-bit
- value combined from tv_sec_hi and tv_sec_lo, and the
- additional fractional part in tv_nsec as nanoseconds. Hence,
- for valid timestamps tv_nsec must be in [0, 999999999].
-
- Note that clock_id applies only to the presentation clock,
- and implies nothing about e.g. the timestamps used in the
- Wayland core protocol input events.
- </description>
-
- <arg name="clk_id" type="uint" summary="platform clock identifier"/>
- </event>
-
- </interface>
-
- <interface name="presentation_feedback" version="1">
- <description summary="presentation time feedback event">
- A presentation_feedback object returns an indication that a
- wl_surface content update has become visible to the user.
- One object corresponds to one content update submission
- (wl_surface.commit). There are two possible outcomes: the
- content update is presented to the user, and a presentation
- timestamp delivered; or, the user did not see the content
- update because it was superseded or its surface destroyed,
- and the content update is discarded.
-
- Once a presentation_feedback object has delivered an 'presented'
- or 'discarded' event it is automatically destroyed.
- </description>
-
- <event name="sync_output">
- <description summary="presentation synchronized to this output">
- As presentation can be synchronized to only one output at a
- time, this event tells which output it was. This event is only
- sent prior to the presented event.
-
- As clients may bind to the same global wl_output multiple
- times, this event is sent for each bound instance that matches
- the synchronized output. If a client has not bound to the
- right wl_output global at all, this event is not sent.
- </description>
-
- <arg name="output" type="object" interface="wl_output"
- summary="presentation output"/>
- </event>
-
- <enum name="kind">
- <description summary="bitmask of flags in presented event">
- These flags provide information about how the presentation of
- the related content update was done. The intent is to help
- clients assess the reliability of the feedback and the visual
- quality with respect to possible tearing and timings. The
- flags are:
-
- VSYNC:
- The presentation was synchronized to the "vertical retrace" by
- the display hardware such that tearing does not happen.
- Relying on user space scheduling is not acceptable for this
- flag. If presentation is done by a copy to the active
- frontbuffer, then it must guarantee that tearing cannot
- happen.
-
- HW_CLOCK:
- The display hardware provided measurements that the hardware
- driver converted into a presentation timestamp. Sampling a
- clock in user space is not acceptable for this flag.
-
- HW_COMPLETION:
- The display hardware signalled that it started using the new
- image content. The opposite of this is e.g. a timer being used
- to guess when the display hardware has switched to the new
- image content.
-
- ZERO_COPY:
- The presentation of this update was done zero-copy. This means
- the buffer from the client was given to display hardware as
- is, without copying it. Compositing with OpenGL counts as
- copying, even if textured directly from the client buffer.
- Possible zero-copy cases include direct scanout of a
- fullscreen surface and a surface on a hardware overlay.
- </description>
-
- <entry name="vsync" value="0x1" summary="presentation was vsync'd"/>
- <entry name="hw_clock" value="0x2"
- summary="hardware provided the presentation timestamp"/>
- <entry name="hw_completion" value="0x4"
- summary="hardware signalled the start of the presentation"/>
- <entry name="zero_copy" value="0x8"
- summary="presentation was done zero-copy"/>
- </enum>
-
- <event name="presented">
- <description summary="the content update was displayed">
- The associated content update was displayed to the user at the
- indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of
- the timestamp, see presentation.clock_id event.
-
- The timestamp corresponds to the time when the content update
- turned into light the first time on the surface's main output.
- Compositors may approximate this from the framebuffer flip
- completion events from the system, and the latency of the
- physical display path if known.
-
- This event is preceded by all related sync_output events
- telling which output's refresh cycle the feedback corresponds
- to, i.e. the main output for the surface. Compositors are
- recommended to choose the output containing the largest part
- of the wl_surface, or keeping the output they previously
- chose. Having a stable presentation output association helps
- clients predict future output refreshes (vblank).
-
- Argument 'refresh' gives the compositor's prediction of how
- many nanoseconds after tv_sec, tv_nsec the very next output
- refresh may occur. This is to further aid clients in
- predicting future refreshes, i.e., estimating the timestamps
- targeting the next few vblanks. If such prediction cannot
- usefully be done, the argument is zero.
-
- The 64-bit value combined from seq_hi and seq_lo is the value
- of the output's vertical retrace counter when the content
- update was first scanned out to the display. This value must
- be compatible with the definition of MSC in
- GLX_OML_sync_control specification. Note, that if the display
- path has a non-zero latency, the time instant specified by
- this counter may differ from the timestamp's.
-
- If the output does not have a constant refresh rate, explicit
- video mode switches excluded, then the refresh argument must
- be zero.
-
- If the output does not have a concept of vertical retrace or a
- refresh cycle, or the output device is self-refreshing without
- a way to query the refresh count, then the arguments seq_hi
- and seq_lo must be zero.
- </description>
-
- <arg name="tv_sec_hi" type="uint"
- summary="high 32 bits of the seconds part of the presentation timestamp"/>
- <arg name="tv_sec_lo" type="uint"
- summary="low 32 bits of the seconds part of the presentation timestamp"/>
- <arg name="tv_nsec" type="uint"
- summary="nanoseconds part of the presentation timestamp"/>
- <arg name="refresh" type="uint" summary="nanoseconds till next refresh"/>
- <arg name="seq_hi" type="uint"
- summary="high 32 bits of refresh counter"/>
- <arg name="seq_lo" type="uint"
- summary="low 32 bits of refresh counter"/>
- <arg name="flags" type="uint" summary="combination of 'kind' values"/>
- </event>
-
- <event name="discarded">
- <description summary="the content update was not displayed">
- The content update was never displayed to the user.
- </description>
- </event>
- </interface>
-
-</protocol>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index 41f9a82..aee7ad7 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -55,7 +55,7 @@
#include "libinput-seat.h"
#include "launcher-util.h"
#include "vaapi-recorder.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"
#include "linux-dmabuf.h"

#ifndef DRM_CAP_TIMESTAMP_MONOTONIC
@@ -821,8 +821,8 @@ vblank_handler(int fd, unsigned int frame, unsigned int sec, unsigned int usec,
struct drm_sprite *s = (struct drm_sprite *)data;
struct drm_output *output = s->output;
struct timespec ts;
- uint32_t flags = PRESENTATION_FEEDBACK_KIND_HW_COMPLETION |
- PRESENTATION_FEEDBACK_KIND_HW_CLOCK;
+ uint32_t flags = ZWL_PRESENTATION_FEEDBACK1_KIND_HW_COMPLETION |
+ ZWL_PRESENTATION_FEEDBACK1_KIND_HW_CLOCK;

drm_output_update_msc(output, frame);
output->vblank_pending = 0;
@@ -847,9 +847,9 @@ page_flip_handler(int fd, unsigned int frame,
{
struct drm_output *output = (struct drm_output *) data;
struct timespec ts;
- uint32_t flags = PRESENTATION_FEEDBACK_KIND_VSYNC |
- PRESENTATION_FEEDBACK_KIND_HW_COMPLETION |
- PRESENTATION_FEEDBACK_KIND_HW_CLOCK;
+ uint32_t flags = ZWL_PRESENTATION_FEEDBACK1_KIND_VSYNC |
+ ZWL_PRESENTATION_FEEDBACK1_KIND_HW_COMPLETION |
+ ZWL_PRESENTATION_FEEDBACK1_KIND_HW_CLOCK;

drm_output_update_msc(output, frame);

@@ -1281,7 +1281,7 @@ drm_assign_planes(struct weston_output *output_base)
/* All other planes are a direct scanout of a
* single client buffer.
*/
- ev->psf_flags = PRESENTATION_FEEDBACK_KIND_ZERO_COPY;
+ ev->psf_flags = ZWL_PRESENTATION_FEEDBACK1_KIND_ZERO_COPY;
}

pixman_region32_fini(&surface_overlap);
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 57c54c2..490718c 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -48,7 +48,7 @@
#include "pixman-renderer.h"
#include "libinput-seat.h"
#include "gl-renderer.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"

struct fbdev_backend {
struct weston_backend base;
diff --git a/src/compositor-headless.c b/src/compositor-headless.c
index ba0d8d7..323e2be 100644
--- a/src/compositor-headless.c
+++ b/src/compositor-headless.c
@@ -34,7 +34,7 @@
#include "shared/helpers.h"
#include "compositor.h"
#include "pixman-renderer.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"

struct headless_backend {
struct weston_backend base;
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index 4d7ea7b..e8c3172 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -51,7 +51,7 @@
#include "rpi-renderer.h"
#include "launcher-util.h"
#include "libinput-seat.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"

#if 0
#define DBG(...) \
@@ -258,8 +258,8 @@ static void
rpi_output_update_complete(struct rpi_output *output,
const struct timespec *stamp)
{
- uint32_t flags = PRESENTATION_FEEDBACK_KIND_VSYNC |
- PRESENTATION_FEEDBACK_KIND_HW_COMPLETION;
+ uint32_t flags = ZWL_PRESENTATION_FEEDBACK1_KIND_VSYNC |
+ ZWL_PRESENTATION_FEEDBACK1_KIND_HW_COMPLETION;

DBG("frame update complete(%ld.%09ld)\n",
(long)stamp->tv_sec, (long)stamp->tv_nsec);
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index dc39cbe..1558a79 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -47,7 +47,7 @@
#include "shared/os-compatibility.h"
#include "shared/cairo-util.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"
#include "linux-dmabuf.h"

#define WINDOW_TITLE "Weston Compositor"
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index ccb7867..b465433 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -55,7 +55,7 @@
#include "shared/config-parser.h"
#include "shared/helpers.h"
#include "shared/image-loader.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"
#include "linux-dmabuf.h"

#define DEFAULT_AXIS_STEP_DISTANCE wl_fixed_from_int(10)
diff --git a/src/compositor.c b/src/compositor.c
index f8437e8..80cd983 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -55,7 +55,7 @@

#include "compositor.h"
#include "scaler-server-protocol.h"
-#include "presentation_timing-server-protocol.h"
+#include "presentation-timing-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "shared/timespec-util.h"
@@ -443,7 +443,7 @@ static void
weston_presentation_feedback_discard(
struct weston_presentation_feedback *feedback)
{
- presentation_feedback_send_discarded(feedback->resource);
+ zwl_presentation_feedback1_send_discarded(feedback->resource);
wl_resource_destroy(feedback->resource);
}

@@ -473,16 +473,17 @@ weston_presentation_feedback_present(
if (wl_resource_get_client(o) != client)
continue;

- presentation_feedback_send_sync_output(feedback->resource, o);
+ zwl_presentation_feedback1_send_sync_output(feedback->resource,
+ o);
}

secs = ts->tv_sec;
- presentation_feedback_send_presented(feedback->resource,
- secs >> 32, secs & 0xffffffff,
- ts->tv_nsec,
- refresh_nsec,
- seq >> 32, seq & 0xffffffff,
- flags | feedback->psf_flags);
+ zwl_presentation_feedback1_send_presented(feedback->resource,
+ secs >> 32, secs & 0xffffffff,
+ ts->tv_nsec,
+ refresh_nsec,
+ seq >> 32, seq & 0xffffffff,
+ flags | feedback->psf_flags);
wl_resource_destroy(feedback->resource);
}

@@ -4353,7 +4354,7 @@ presentation_feedback(struct wl_client *client,
goto err_calloc;

feedback->resource = wl_resource_create(client,
- &presentation_feedback_interface,
+ &zwl_presentation_feedback1_interface,
1, callback);
if (!feedback->resource)
goto err_create;
@@ -4372,7 +4373,7 @@ err_calloc:
wl_client_post_no_memory(client);
}

-static const struct presentation_interface presentation_implementation = {
+static const struct zwl_presentation1_interface presentation_implementation = {
presentation_destroy,
presentation_feedback
};
@@ -4384,7 +4385,7 @@ bind_presentation(struct wl_client *client,
struct weston_compositor *compositor = data;
struct wl_resource *resource;

- resource = wl_resource_create(client, &presentation_interface,
+ resource = wl_resource_create(client, &zwl_presentation1_interface,
MIN(version, 1), id);
if (resource == NULL) {
wl_client_post_no_memory(client);
@@ -4393,7 +4394,7 @@ bind_presentation(struct wl_client *client,

wl_resource_set_implementation(resource, &presentation_implementation,
compositor, NULL);
- presentation_send_clock_id(resource, compositor->presentation_clock);
+ zwl_presentation1_send_clock_id(resource, compositor->presentation_clock);
}

static void
@@ -4502,7 +4503,7 @@ weston_compositor_create(struct wl_display *display, void *user_data)
ec, bind_scaler))
goto fail;

- if (!wl_global_create(ec->wl_display, &presentation_interface, 1,
+ if (!wl_global_create(ec->wl_display, &zwl_presentation1_interface, 1,
ec, bind_presentation))
goto fail;

diff --git a/tests/presentation-test.c b/tests/presentation-test.c
index 27f33da..6d4fc3e 100644
--- a/tests/presentation-test.c
+++ b/tests/presentation-test.c
@@ -33,14 +33,14 @@

#include "shared/helpers.h"
#include "weston-test-client-helper.h"
-#include "presentation_timing-client-protocol.h"
+#include "presentation-timing-unstable-v1-client-protocol.h"

-static struct presentation *
+static struct zwl_presentation1 *
get_presentation(struct client *client)
{
struct global *g;
struct global *global_pres = NULL;
- static struct presentation *pres;
+ static struct zwl_presentation1 *pres;

if (pres)
return pres;
@@ -60,7 +60,7 @@ get_presentation(struct client *client)
assert(global_pres->version == 1);

pres = wl_registry_bind(client->wl_registry, global_pres->name,
- &presentation_interface, 1);
+ &zwl_presentation1_interface, 1);
assert(pres);

return pres;
@@ -68,7 +68,7 @@ get_presentation(struct client *client)

struct feedback {
struct client *client;
- struct presentation_feedback *obj;
+ struct zwl_presentation_feedback1 *obj;

enum {
FB_PENDING = 0,
@@ -93,7 +93,7 @@ timespec_from_proto(struct timespec *tm, uint32_t tv_sec_hi,

static void
feedback_sync_output(void *data,
- struct presentation_feedback *presentation_feedback,
+ struct zwl_presentation_feedback1 *presentation_feedback,
struct wl_output *output)
{
struct feedback *fb = data;
@@ -106,7 +106,7 @@ feedback_sync_output(void *data,

static void
feedback_presented(void *data,
- struct presentation_feedback *presentation_feedback,
+ struct zwl_presentation_feedback1 *presentation_feedback,
uint32_t tv_sec_hi,
uint32_t tv_sec_lo,
uint32_t tv_nsec,
@@ -127,7 +127,7 @@ feedback_presented(void *data,

static void
feedback_discarded(void *data,
- struct presentation_feedback *presentation_feedback)
+ struct zwl_presentation_feedback1 *presentation_feedback)
{
struct feedback *fb = data;

@@ -135,7 +135,7 @@ feedback_discarded(void *data,
fb->result = FB_DISCARDED;
}

-static const struct presentation_feedback_listener feedback_listener = {
+static const struct zwl_presentation_feedback1_listener feedback_listener = {
feedback_sync_output,
feedback_presented,
feedback_discarded
@@ -148,8 +148,10 @@ feedback_create(struct client *client, struct wl_surface *surface)

fb = xzalloc(sizeof *fb);
fb->client = client;
- fb->obj = presentation_feedback(get_presentation(client), surface);
- presentation_feedback_add_listener(fb->obj, &feedback_listener, fb);
+ fb->obj = zwl_presentation1_feedback(get_presentation(client), surface);
+ zwl_presentation_feedback1_add_listener(fb->obj,
+ &feedback_listener,
+ fb);

return fb;
}
@@ -169,10 +171,10 @@ pflags_to_str(uint32_t flags, char *str, unsigned len)
uint32_t flag;
char sym;
} desc[] = {
- { PRESENTATION_FEEDBACK_KIND_VSYNC, 's' },
- { PRESENTATION_FEEDBACK_KIND_HW_CLOCK, 'c' },
- { PRESENTATION_FEEDBACK_KIND_HW_COMPLETION, 'e' },
- { PRESENTATION_FEEDBACK_KIND_ZERO_COPY, 'z' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_VSYNC, 's' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_HW_CLOCK, 'c' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_HW_COMPLETION, 'e' },
+ { ZWL_PRESENTATION_FEEDBACK1_KIND_ZERO_COPY, 'z' },
};
unsigned i;

@@ -212,7 +214,7 @@ feedback_print(struct feedback *fb)
static void
feedback_destroy(struct feedback *fb)
{
- presentation_feedback_destroy(fb->obj);
+ zwl_presentation_feedback1_destroy(fb->obj);
free(fb);
}
--
2.4.3
Pekka Paalanen
2015-11-05 11:57:45 UTC
Permalink
On Wed, 4 Nov 2015 16:49:52 +0800
Post by Jonas Ådahl
---
Makefile.am | 21 ++-
clients/presentation-shm.c | 65 +++++-----
clients/weston-info.c | 19 +--
protocol/presentation_timing.xml | 274 ---------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 2 +-
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +++--
tests/presentation-test.c | 34 ++---
12 files changed, 101 insertions(+), 369 deletions(-)
delete mode 100644 protocol/presentation_timing.xml
diff --git a/clients/presentation-shm.c b/clients/presentation-shm.c
index 120c40c..9083d8e 100644
--- a/clients/presentation-shm.c
+++ b/clients/presentation-shm.c
@@ -38,7 +38,7 @@
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
-#include "presentation_timing-client-protocol.h"
+#include "presentation-timing-unstable-v1-client-protocol.h"
enum run_mode {
RUN_MODE_FEEDBACK,
@@ -67,7 +67,7 @@ struct display {
struct wl_shm *shm;
uint32_t formats;
- struct presentation *presentation;
+ struct zwl_presentation1 *presentation;
Hi Jonas,

I see you added the prefix wl_ here. I think this is good, it is aiming
to be a standard, generic extension usable everywhere where Wayland is.

What I am not so sure about is whether keeping it unstable is still necessary.
https://phabricator.freedesktop.org/T43

Maybe we should just promote it stable while we are moving it, and
avoid one round of renames. I don't know of anything that would need
fixing or reconsidering in it, apart maybe from names (presentation?).

Hmm, maybe if someone makes the case that one really *really* does
not need 64 bits for seconds value, it could use a break. However,
64-bit nanoseconds value does not necessarily fit in a 32-bit seconds +
32-bit nsecs value when nsec is limited to [0, 999999999], so I think
it's good as is. (And the code is already written and been out there
for a long time.)

What if we skipped this one with the unstable move?


Thanks,
pq
Jonas Ådahl
2015-11-06 01:46:04 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:52 +0800
Post by Jonas Ådahl
---
Makefile.am | 21 ++-
clients/presentation-shm.c | 65 +++++-----
clients/weston-info.c | 19 +--
protocol/presentation_timing.xml | 274 ---------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 2 +-
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +++--
tests/presentation-test.c | 34 ++---
12 files changed, 101 insertions(+), 369 deletions(-)
delete mode 100644 protocol/presentation_timing.xml
diff --git a/clients/presentation-shm.c b/clients/presentation-shm.c
index 120c40c..9083d8e 100644
--- a/clients/presentation-shm.c
+++ b/clients/presentation-shm.c
@@ -38,7 +38,7 @@
#include <wayland-client.h>
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
-#include "presentation_timing-client-protocol.h"
+#include "presentation-timing-unstable-v1-client-protocol.h"
enum run_mode {
RUN_MODE_FEEDBACK,
@@ -67,7 +67,7 @@ struct display {
struct wl_shm *shm;
uint32_t formats;
- struct presentation *presentation;
+ struct zwl_presentation1 *presentation;
Hi Jonas,
I see you added the prefix wl_ here. I think this is good, it is aiming
to be a standard, generic extension usable everywhere where Wayland is.
What I am not so sure about is whether keeping it unstable is still necessary.
https://phabricator.freedesktop.org/T43
Maybe we should just promote it stable while we are moving it, and
avoid one round of renames. I don't know of anything that would need
fixing or reconsidering in it, apart maybe from names (presentation?).
Hmm, maybe if someone makes the case that one really *really* does
not need 64 bits for seconds value, it could use a break. However,
64-bit nanoseconds value does not necessarily fit in a 32-bit seconds +
32-bit nsecs value when nsec is limited to [0, 999999999], so I think
it's good as is. (And the code is already written and been out there
for a long time.)
What if we skipped this one with the unstable move?
If that what you think makes sense, and noone objects to it, I see no
reason not to. I haven't followed the details regarding the protocol
itself, so I have no opinion whether it is suitable or not.


Jonas
Post by Pekka Paalanen
Thanks,
pq
Hardening
2015-11-06 08:38:05 UTC
Permalink
Post by Jonas Ådahl
---
Makefile.am | 21 ++-
clients/presentation-shm.c | 65 +++++-----
clients/weston-info.c | 19 +--
protocol/presentation_timing.xml | 274 ---------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 2 +-
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +++--
tests/presentation-test.c | 34 ++---
12 files changed, 101 insertions(+), 369 deletions(-)
delete mode 100644 protocol/presentation_timing.xml
The RDP compositor is not treated by this patch.
--
David FORT
website: http://www.hardening-consulting.com/
Hardening
2015-11-06 09:16:21 UTC
Permalink
Post by Jonas Ådahl
---
Makefile.am | 21 ++-
clients/presentation-shm.c | 65 +++++-----
clients/weston-info.c | 19 +--
protocol/presentation_timing.xml | 274 ---------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 2 +-
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +++--
tests/presentation-test.c | 34 ++---
12 files changed, 101 insertions(+), 369 deletions(-)
delete mode 100644 protocol/presentation_timing.xml
As stated on IRC, in fact no changes are needed for the RDP compositor.
Sorry for the noise.
--
David FORT
website: http://www.hardening-consulting.com/
Jonas Ådahl
2015-11-04 08:49:53 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 21 ++-
clients/editor.c | 119 +++++++++--------
clients/keyboard.c | 12 +-
protocol/text.xml | 374 -----------------------------------------------------
src/text-backend.c | 56 ++++----
tests/text-test.c | 52 ++++----
6 files changed, 133 insertions(+), 501 deletions(-)
delete mode 100644 protocol/text.xml

diff --git a/Makefile.am b/Makefile.am
index 175e924..e14878e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,8 +117,8 @@ nodist_weston_SOURCES = \
protocol/screenshooter-server-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-cursor-position-server-protocol.h \
- protocol/text-protocol.c \
- protocol/text-server-protocol.h \
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-server-protocol.h \
protocol/input-method-protocol.c \
protocol/input-method-server-protocol.h \
protocol/workspaces-protocol.c \
@@ -686,8 +686,8 @@ weston_editor_SOURCES = \
clients/editor.c \
shared/helpers.h
nodist_weston_editor_SOURCES = \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h
weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS)
weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS)
endif
@@ -753,8 +753,8 @@ BUILT_SOURCES += \
protocol/screenshooter-client-protocol.h \
protocol/text-cursor-position-client-protocol.h \
protocol/text-cursor-position-protocol.c \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h \
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h \
protocol/input-method-protocol.c \
protocol/input-method-client-protocol.h \
protocol/desktop-shell-client-protocol.h \
@@ -1212,8 +1212,8 @@ devices_weston_LDADD = libtest-client.la

text_weston_SOURCES = tests/text-test.c
nodist_text_weston_SOURCES = \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h
text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
text_weston_LDADD = libtest-client.la

@@ -1336,13 +1336,12 @@ BUILT_SOURCES += \
protocol/weston-test-protocol.c \
protocol/weston-test-server-protocol.h \
protocol/weston-test-client-protocol.h \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h

EXTRA_DIST += \
protocol/desktop-shell.xml \
protocol/screenshooter.xml \
- protocol/text.xml \
protocol/input-method.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
diff --git a/clients/editor.c b/clients/editor.c
index 7d388a4..c3ac217 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -38,7 +38,7 @@

#include "shared/helpers.h"
#include "window.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"

struct text_entry {
struct widget *widget;
@@ -64,7 +64,7 @@ struct text_entry {
uint32_t delete_length;
bool invalid_delete;
} pending_commit;
- struct wl_text_input *text_input;
+ struct zwl_text_input1 *text_input;
PangoLayout *layout;
struct {
xkb_mod_mask_t shift_mask;
@@ -78,7 +78,7 @@ struct text_entry {
};

struct editor {
- struct wl_text_input_manager *text_input_manager;
+ struct zwl_text_input_manager1 *text_input_manager;
struct wl_data_source *selection;
char *selected_text;
struct display *display;
@@ -182,7 +182,7 @@ static void text_entry_update(struct text_entry *entry);

static void
text_input_commit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text)
{
@@ -234,7 +234,7 @@ clear_pending_preedit(struct text_entry *entry)

static void
text_input_preedit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text,
const char *commit)
@@ -275,7 +275,7 @@ text_input_preedit_string(void *data,

static void
text_input_delete_surrounding_text(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
uint32_t length)
{
@@ -300,7 +300,7 @@ text_input_delete_surrounding_text(void *data,

static void
text_input_cursor_position(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
int32_t anchor)
{
@@ -312,7 +312,7 @@ text_input_cursor_position(void *data,

static void
text_input_preedit_styling(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t index,
uint32_t length,
uint32_t style)
@@ -325,24 +325,24 @@ text_input_preedit_styling(void *data,
entry->preedit_info.attr_list = pango_attr_list_new();

switch (style) {
- case WL_TEXT_INPUT_PREEDIT_STYLE_DEFAULT:
- case WL_TEXT_INPUT_PREEDIT_STYLE_UNDERLINE:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_DEFAULT:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_UNDERLINE:
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
break;
- case WL_TEXT_INPUT_PREEDIT_STYLE_INCORRECT:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_INCORRECT:
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_ERROR);
attr2 = pango_attr_underline_color_new(65535, 0, 0);
break;
- case WL_TEXT_INPUT_PREEDIT_STYLE_SELECTION:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_SELECTION:
attr1 = pango_attr_background_new(0.3 * 65535, 0.3 * 65535, 65535);
attr2 = pango_attr_foreground_new(65535, 65535, 65535);
break;
- case WL_TEXT_INPUT_PREEDIT_STYLE_HIGHLIGHT:
- case WL_TEXT_INPUT_PREEDIT_STYLE_ACTIVE:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_HIGHLIGHT:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_ACTIVE:
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
attr2 = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
break;
- case WL_TEXT_INPUT_PREEDIT_STYLE_INACTIVE:
+ case ZWL_TEXT_INPUT1_PREEDIT_STYLE_INACTIVE:
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
attr2 = pango_attr_foreground_new(0.3 * 65535, 0.3 * 65535, 0.3 * 65535);
break;
@@ -363,7 +363,7 @@ text_input_preedit_styling(void *data,

static void
text_input_preedit_cursor(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index)
{
struct text_entry *entry = data;
@@ -373,7 +373,7 @@ text_input_preedit_cursor(void *data,

static void
text_input_modifiers_map(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_array *map)
{
struct text_entry *entry = data;
@@ -383,7 +383,7 @@ text_input_modifiers_map(void *data,

static void
text_input_keysym(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t time,
uint32_t key,
@@ -470,7 +470,7 @@ text_input_keysym(void *data,

static void
text_input_enter(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_surface *surface)
{
struct text_entry *entry = data;
@@ -488,7 +488,7 @@ text_input_enter(void *data,

static void
text_input_leave(void *data,
- struct wl_text_input *text_input)
+ struct zwl_text_input1 *text_input)
{
struct text_entry *entry = data;

@@ -496,21 +496,21 @@ text_input_leave(void *data,
entry->active--;

if (!entry->active)
- wl_text_input_hide_input_panel(text_input);
+ zwl_text_input1_hide_input_panel(text_input);

widget_schedule_redraw(entry->widget);
}

static void
text_input_input_panel_state(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t state)
{
}

static void
text_input_language(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *language)
{
@@ -519,7 +519,7 @@ text_input_language(void *data,

static void
text_input_text_direction(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t direction)
{
@@ -529,13 +529,13 @@ text_input_text_direction(void *data,


switch (direction) {
- case WL_TEXT_INPUT_TEXT_DIRECTION_LTR:
+ case ZWL_TEXT_INPUT1_TEXT_DIRECTION_LTR:
pango_direction = PANGO_DIRECTION_LTR;
break;
- case WL_TEXT_INPUT_TEXT_DIRECTION_RTL:
+ case ZWL_TEXT_INPUT1_TEXT_DIRECTION_RTL:
pango_direction = PANGO_DIRECTION_RTL;
break;
- case WL_TEXT_INPUT_TEXT_DIRECTION_AUTO:
+ case ZWL_TEXT_INPUT1_TEXT_DIRECTION_AUTO:
default:
pango_direction = PANGO_DIRECTION_NEUTRAL;
}
@@ -543,7 +543,7 @@ text_input_text_direction(void *data,
pango_context_set_base_dir(context, pango_direction);
}

-static const struct wl_text_input_listener text_input_listener = {
+static const struct zwl_text_input1_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_modifiers_map,
@@ -695,8 +695,10 @@ text_entry_create(struct editor *editor, const char *text)
entry->active = 0;
entry->cursor = strlen(text);
entry->anchor = entry->cursor;
- entry->text_input = wl_text_input_manager_create_text_input(editor->text_input_manager);
- wl_text_input_add_listener(entry->text_input, &text_input_listener, entry);
+ entry->text_input =
+ zwl_text_input_manager1_create_text_input(editor->text_input_manager);
+ zwl_text_input1_add_listener(entry->text_input,
+ &text_input_listener, entry);

widget_set_redraw_handler(entry->widget, text_entry_redraw_handler);
widget_set_button_handler(entry->widget, text_entry_button_handler);
@@ -710,7 +712,7 @@ static void
text_entry_destroy(struct text_entry *entry)
{
widget_destroy(entry->widget);
- wl_text_input_destroy(entry->text_input);
+ zwl_text_input1_destroy(entry->text_input);
g_clear_object(&entry->layout);
free(entry->text);
free(entry);
@@ -778,25 +780,25 @@ text_entry_activate(struct text_entry *entry,
struct wl_surface *surface = window_get_wl_surface(entry->window);

if (entry->click_to_show && entry->active) {
- wl_text_input_show_input_panel(entry->text_input);
+ zwl_text_input1_show_input_panel(entry->text_input);

return;
}

if (!entry->click_to_show)
- wl_text_input_show_input_panel(entry->text_input);
+ zwl_text_input1_show_input_panel(entry->text_input);

- wl_text_input_activate(entry->text_input,
- seat,
- surface);
+ zwl_text_input1_activate(entry->text_input,
+ seat,
+ surface);
}

static void
text_entry_deactivate(struct text_entry *entry,
struct wl_seat *seat)
{
- wl_text_input_deactivate(entry->text_input,
- seat);
+ zwl_text_input1_deactivate(entry->text_input,
+ seat);
}

static void
@@ -867,24 +869,27 @@ text_entry_update(struct text_entry *entry)
{
struct rectangle cursor_rectangle;

- wl_text_input_set_content_type(entry->text_input,
- WL_TEXT_INPUT_CONTENT_HINT_NONE,
- entry->content_purpose);
+ zwl_text_input1_set_content_type(entry->text_input,
+ ZWL_TEXT_INPUT1_CONTENT_HINT_NONE,
+ entry->content_purpose);

- wl_text_input_set_surrounding_text(entry->text_input,
- entry->text,
- entry->cursor,
- entry->anchor);
+ zwl_text_input1_set_surrounding_text(entry->text_input,
+ entry->text,
+ entry->cursor,
+ entry->anchor);

if (entry->preferred_language)
- wl_text_input_set_preferred_language(entry->text_input,
- entry->preferred_language);
+ zwl_text_input1_set_preferred_language(entry->text_input,
+ entry->preferred_language);

text_entry_get_cursor_rectangle(entry, &cursor_rectangle);
- wl_text_input_set_cursor_rectangle(entry->text_input, cursor_rectangle.x, cursor_rectangle.y,
- cursor_rectangle.width, cursor_rectangle.height);
+ zwl_text_input1_set_cursor_rectangle(entry->text_input,
+ cursor_rectangle.x,
+ cursor_rectangle.y,
+ cursor_rectangle.width,
+ cursor_rectangle.height);

- wl_text_input_commit_state(entry->text_input, ++entry->serial);
+ zwl_text_input1_commit_state(entry->text_input, ++entry->serial);
}

static void
@@ -946,7 +951,7 @@ text_entry_commit_and_reset(struct text_entry *entry)
free(commit);
}

- wl_text_input_reset(entry->text_input);
+ zwl_text_input1_reset(entry->text_input);
text_entry_update(entry);
entry->reset_serial = entry->serial;
}
@@ -995,9 +1000,9 @@ text_entry_try_invoke_preedit_action(struct text_entry *entry,
}

if (state == WL_POINTER_BUTTON_STATE_RELEASED)
- wl_text_input_invoke_action(entry->text_input,
- button,
- cursor - entry->cursor);
+ zwl_text_input1_invoke_action(entry->text_input,
+ button,
+ cursor - entry->cursor);

return 1;
}
@@ -1472,10 +1477,10 @@ global_handler(struct display *display, uint32_t name,
{
struct editor *editor = data;

- if (!strcmp(interface, "wl_text_input_manager")) {
+ if (!strcmp(interface, "zwl_text_input_manager1")) {
editor->text_input_manager =
display_bind(display, name,
- &wl_text_input_manager_interface, 1);
+ &zwl_text_input_manager1_interface, 1);
}
}

@@ -1531,7 +1536,7 @@ main(int argc, char *argv[])
if (preferred_language)
editor.entry->preferred_language = strdup(preferred_language);
editor.editor = text_entry_create(&editor, "Numeric");
- editor.editor->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
+ editor.editor->content_purpose = ZWL_TEXT_INPUT1_CONTENT_PURPOSE_NUMBER;
editor.editor->click_to_show = click_to_show;
editor.selection = NULL;
editor.selected_text = NULL;
diff --git a/clients/keyboard.c b/clients/keyboard.c
index f5ffe30..61cfda5 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -33,7 +33,7 @@

#include "window.h"
#include "input-method-client-protocol.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"

struct keyboard;

@@ -216,7 +216,7 @@ static const struct layout normal_layout = {
12,
4,
"en",
- WL_TEXT_INPUT_TEXT_DIRECTION_LTR
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_LTR
};

static const struct layout numeric_layout = {
@@ -225,7 +225,7 @@ static const struct layout numeric_layout = {
12,
2,
"en",
- WL_TEXT_INPUT_TEXT_DIRECTION_LTR
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_LTR
};

static const struct layout arabic_layout = {
@@ -234,7 +234,7 @@ static const struct layout arabic_layout = {
13,
4,
"ar",
- WL_TEXT_INPUT_TEXT_DIRECTION_RTL
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_RTL
};

static const char *style_labels[] = {
@@ -339,8 +339,8 @@ static const struct layout *
get_current_layout(struct virtual_keyboard *keyboard)
{
switch (keyboard->content_purpose) {
- case WL_TEXT_INPUT_CONTENT_PURPOSE_DIGITS:
- case WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER:
+ case ZWL_TEXT_INPUT1_CONTENT_PURPOSE_DIGITS:
+ case ZWL_TEXT_INPUT1_CONTENT_PURPOSE_NUMBER:
return &numeric_layout;
default:
if (keyboard->preferred_language &&
diff --git a/protocol/text.xml b/protocol/text.xml
deleted file mode 100644
index 0f824ea..0000000
--- a/protocol/text.xml
+++ /dev/null
@@ -1,374 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="text">
-
- <copyright>
- Copyright © 2012, 2013 Intel Corporation
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="wl_text_input" version="1">
- <description summary="text input">
- An object used for text input. Adds support for text input and input
- methods to applications. A text-input object is created from a
- wl_text_input_manager and corresponds typically to a text entry in an
- application.
- Requests are used to activate/deactivate the text-input object and set
- state information like surrounding and selected text or the content type.
- The information about entered text is sent to the text-input object via
- the pre-edit and commit events. Using this interface removes the need
- for applications to directly process hardware key events and compose text
- out of them.
-
- Text is generally UTF-8 encoded, indices and lengths are in bytes.
-
- Serials are used to synchronize the state between the text input and
- an input method. New serials are sent by the text input in the
- commit_state request and are used by the input method to indicate
- the known text input state in events like preedit_string, commit_string,
- and keysym. The text input can then ignore events from the input method
- which are based on an outdated state (for example after a reset).
- </description>
-
- <request name="activate">
- <description summary="request activation">
- Requests the text-input object to be activated (typically when the
- text entry gets focus).
- The seat argument is a wl_seat which maintains the focus for this
- activation. The surface argument is a wl_surface assigned to the
- text-input object and tracked for focus lost. The enter event
- is emitted on successful activation.
- </description>
- <arg name="seat" type="object" interface="wl_seat"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="deactivate">
- <description summary="request deactivation">
- Requests the text-input object to be deactivated (typically when the
- text entry lost focus). The seat argument is a wl_seat which was used
- for activation.
- </description>
- <arg name="seat" type="object" interface="wl_seat"/>
- </request>
-
- <request name="show_input_panel">
- <description summary="show input panels">
- Requests input panels (virtual keyboard) to show.
- </description>
- </request>
-
- <request name="hide_input_panel">
- <description summary="hide input panels">
- Requests input panels (virtual keyboard) to hide.
- </description>
- </request>
-
- <request name="reset">
- <description summary="reset">
- Should be called by an editor widget when the input state should be
- reset, for example after the text was changed outside of the normal
- input method flow.
- </description>
- </request>
-
- <request name="set_surrounding_text">
- <description summary="sets the surrounding text">
- Sets the plain surrounding text around the input position. Text is
- UTF-8 encoded. Cursor is the byte offset within the
- surrounding text. Anchor is the byte offset of the
- selection anchor within the surrounding text. If there is no selected
- text anchor is the same as cursor.
- </description>
- <arg name="text" type="string"/>
- <arg name="cursor" type="uint"/>
- <arg name="anchor" type="uint"/>
- </request>
-
- <enum name="content_hint">
- <description summary="content hint">
- Content hint is a bitmask to allow to modify the behavior of the text
- input.
- </description>
- <entry name="none" value="0x0" summary="no special behaviour"/>
- <entry name="default" value="0x7" summary="auto completion, correction and capitalization"/>
- <entry name="password" value="0xc0" summary="hidden and sensitive text"/>
- <entry name="auto_completion" value="0x1" summary="suggest word completions"/>
- <entry name="auto_correction" value="0x2" summary="suggest word corrections"/>
- <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
- <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
- <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
- <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
- <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
- <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
- <entry name="latin" value="0x100" summary="just latin characters should be entered"/>
- <entry name="multiline" value="0x200" summary="the text input is multiline"/>
- </enum>
-
- <enum name="content_purpose">
- <description summary="content purpose">
- The content purpose allows to specify the primary purpose of a text
- input.
-
- This allows an input method to show special purpose input panels with
- extra characters or to disallow some characters.
- </description>
- <entry name="normal" value="0" summary="default input, allowing all characters"/>
- <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
- <entry name="digits" value="2" summary="allow only digits"/>
- <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
- <entry name="phone" value="4" summary="input a phone number"/>
- <entry name="url" value="5" summary="input an URL"/>
- <entry name="email" value="6" summary="input an email address"/>
- <entry name="name" value="7" summary="input a name of a person"/>
- <entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/>
- <entry name="date" value="9" summary="input a date"/>
- <entry name="time" value="10" summary="input a time"/>
- <entry name="datetime" value="11" summary="input a date and time"/>
- <entry name="terminal" value="12" summary="input for a terminal"/>
- </enum>
-
- <request name="set_content_type">
- <description summary="set content purpose and hint">
- Sets the content purpose and content hint. While the purpose is the
- basic purpose of an input field, the hint flags allow to modify some
- of the behavior.
-
- When no content type is explicitly set, a normal content purpose with
- default hints (auto completion, auto correction, auto capitalization)
- should be assumed.
- </description>
- <arg name="hint" type="uint"/>
- <arg name="purpose" type="uint"/>
- </request>
-
- <request name="set_cursor_rectangle">
- <arg name="x" type="int"/>
- <arg name="y" type="int"/>
- <arg name="width" type="int"/>
- <arg name="height" type="int"/>
- </request>
-
- <request name="set_preferred_language">
- <description summary="sets preferred language">
- Sets a specific language. This allows for example a virtual keyboard to
- show a language specific layout. The "language" argument is a RFC-3066
- format language tag.
-
- It could be used for example in a word processor to indicate language of
- currently edited document or in an instant message application which tracks
- languages of contacts.
- </description>
- <arg name="language" type="string"/>
- </request>
-
- <request name="commit_state">
- <arg name="serial" type="uint" summary="used to identify the known state"/>
- </request>
-
- <request name="invoke_action">
- <arg name="button" type="uint"/>
- <arg name="index" type="uint"/>
- </request>
-
- <event name="enter">
- <description summary="enter event">
- Notify the text-input object when it received focus. Typically in
- response to an activate request.
- </description>
- <arg name="surface" type="object" interface="wl_surface"/>
- </event>
-
- <event name="leave">
- <description summary="leave event">
- Notify the text-input object when it lost focus. Either in response
- to a deactivate request or when the assigned surface lost focus or was
- destroyed.
- </description>
- </event>
-
- <event name="modifiers_map">
- <description summary="modifiers map">
- Transfer an array of 0-terminated modifiers names. The position in
- the array is the index of the modifier as used in the modifiers
- bitmask in the keysym event.
- </description>
- <arg name="map" type="array"/>
- </event>
-
- <event name="input_panel_state">
- <description summary="state of the input panel">
- Notify when the visibility state of the input panel changed.
- </description>
- <arg name="state" type="uint"/>
- </event>
-
- <event name="preedit_string">
- <description summary="pre-edit">
- Notify when a new composing text (pre-edit) should be set around the
- current cursor position. Any previously set composing text should
- be removed.
-
- The commit text can be used to replace the preedit text on reset
- (for example on unfocus).
-
- The text input should also handle all preedit_style and preedit_cursor
- events occurring directly before preedit_string.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- <arg name="commit" type="string"/>
- </event>
-
- <enum name="preedit_style">
- <entry name="default" value="0" summary="default style for composing text"/>
- <entry name="none" value="1" summary="style should be the same as in non-composing text"/>
- <entry name="active" value="2"/>
- <entry name="inactive" value="3"/>
- <entry name="highlight" value="4"/>
- <entry name="underline" value="5"/>
- <entry name="selection" value="6"/>
- <entry name="incorrect" value="7"/>
- </enum>
-
- <event name="preedit_styling">
- <description summary="pre-edit styling">
- Sets styling information on composing text. The style is applied for
- length bytes from index relative to the beginning of the composing
- text (as byte offset). Multiple styles can
- be applied to a composing text by sending multiple preedit_styling
- events.
-
- This event is handled as part of a following preedit_string event.
- </description>
- <arg name="index" type="uint"/>
- <arg name="length" type="uint"/>
- <arg name="style" type="uint"/>
- </event>
-
- <event name="preedit_cursor">
- <description summary="pre-edit cursor">
- Sets the cursor position inside the composing text (as byte
- offset) relative to the start of the composing text. When index is a
- negative number no cursor is shown.
-
- This event is handled as part of a following preedit_string event.
- </description>
- <arg name="index" type="int"/>
- </event>
-
- <event name="commit_string">
- <description summary="commit">
- Notify when text should be inserted into the editor widget. The text to
- commit could be either just a single character after a key press or the
- result of some composing (pre-edit). It could be also an empty text
- when some text should be removed (see delete_surrounding_text) or when
- the input cursor should be moved (see cursor_position).
-
- Any previously set composing text should be removed.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- </event>
-
- <event name="cursor_position">
- <description summary="set cursor to new position">
- Notify when the cursor or anchor position should be modified.
-
- This event should be handled as part of a following commit_string
- event.
- </description>
- <arg name="index" type="int"/>
- <arg name="anchor" type="int"/>
- </event>
-
- <event name="delete_surrounding_text">
- <description summary="delete surrounding text">
- Notify when the text around the current cursor position should be
- deleted.
-
- Index is relative to the current cursor (in bytes).
- Length is the length of deleted text (in bytes).
-
- This event should be handled as part of a following commit_string
- event.
- </description>
- <arg name="index" type="int"/>
- <arg name="length" type="uint"/>
- </event>
-
- <event name="keysym">
- <description summary="keysym">
- Notify when a key event was sent. Key events should not be used
- for normal text input operations, which should be done with
- commit_string, delete_surrounding_text, etc. The key event follows
- the wl_keyboard key event convention. Sym is a XKB keysym, state a
- wl_keyboard key_state. Modifiers are a mask for effective modifiers
- (where the modifier indices are set by the modifiers_map event)
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="time" type="uint"/>
- <arg name="sym" type="uint"/>
- <arg name="state" type="uint"/>
- <arg name="modifiers" type="uint"/>
- </event>
-
- <event name="language">
- <description summary="language">
- Sets the language of the input text. The "language" argument is a RFC-3066
- format language tag.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="language" type="string"/>
- </event>
-
- <enum name="text_direction">
- <entry name="auto" value="0" summary="automatic text direction based on text and language"/>
- <entry name="ltr" value="1" summary="left-to-right"/>
- <entry name="rtl" value="2" summary="right-to-left"/>
- </enum>
-
- <event name="text_direction">
- <description summary="text direction">
- Sets the text direction of input text.
-
- It is mainly needed for showing input cursor on correct side of the
- editor when there is no input yet done and making sure neutral
- direction text is laid out properly.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="direction" type="uint"/>
- </event>
- </interface>
-
- <interface name="wl_text_input_manager" version="1">
- <description summary="text input manager">
- A factory for text-input objects. This object is a global singleton.
- </description>
-
- <request name="create_text_input">
- <description summary="create text input">
- Creates a new text-input object.
- </description>
- <arg name="id" type="new_id" interface="wl_text_input"/>
- </request>
- </interface>
-
-</protocol>
diff --git a/src/text-backend.c b/src/text-backend.c
index 8c9e30d..5227b97 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -33,7 +33,7 @@
#include <time.h>

#include "compositor.h"
-#include "text-server-protocol.h"
+#include "text-input-unstable-v1-server-protocol.h"
#include "input-method-server-protocol.h"
#include "shared/helpers.h"

@@ -142,7 +142,7 @@ deactivate_input_method(struct input_method *input_method)
text_input->input_panel_visible = false;
text_input->manager->current_panel = NULL;
}
- wl_text_input_send_leave(text_input->resource);
+ zwl_text_input1_send_leave(text_input->resource);
}

static void
@@ -219,8 +219,8 @@ text_input_activate(struct wl_client *client,
text_input->manager->current_panel = text_input;
}

- wl_text_input_send_enter(text_input->resource,
- text_input->surface->resource);
+ zwl_text_input1_send_enter(text_input->resource,
+ text_input->surface->resource);
}

static void
@@ -373,7 +373,7 @@ text_input_set_preferred_language(struct wl_client *client,
}
}

-static const struct wl_text_input_interface text_input_implementation = {
+static const struct zwl_text_input1_interface text_input_implementation = {
text_input_activate,
text_input_deactivate,
text_input_show_input_panel,
@@ -400,7 +400,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
return;

text_input->resource =
- wl_resource_create(client, &wl_text_input_interface, 1, id);
+ wl_resource_create(client, &zwl_text_input1_interface, 1, id);
wl_resource_set_implementation(text_input->resource,
&text_input_implementation,
text_input, destroy_text_input);
@@ -411,7 +411,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
wl_list_init(&text_input->input_methods);
};

-static const struct wl_text_input_manager_interface manager_implementation = {
+static const struct zwl_text_input_manager1_interface manager_implementation = {
text_input_manager_create_text_input
};

@@ -427,7 +427,7 @@ bind_text_input_manager(struct wl_client *client,
/* No checking for duplicate binding necessary. */
resource =
wl_resource_create(client,
- &wl_text_input_manager_interface, 1, id);
+ &zwl_text_input_manager1_interface, 1, id);
if (resource)
wl_resource_set_implementation(resource,
&manager_implementation,
@@ -460,7 +460,7 @@ text_input_manager_create(struct weston_compositor *ec)

text_input_manager->text_input_manager_global =
wl_global_create(ec->wl_display,
- &wl_text_input_manager_interface, 1,
+ &zwl_text_input_manager1_interface, 1,
text_input_manager, bind_text_input_manager);

text_input_manager->destroy_listener.notify =
@@ -486,8 +486,8 @@ input_method_context_commit_string(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_commit_string(context->input->resource,
- serial, text);
+ zwl_text_input1_send_commit_string(context->input->resource,
+ serial, text);
}

static void
@@ -501,8 +501,8 @@ input_method_context_preedit_string(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_preedit_string(context->input->resource,
- serial, text, commit);
+ zwl_text_input1_send_preedit_string(context->input->resource,
+ serial, text, commit);
}

static void
@@ -516,8 +516,8 @@ input_method_context_preedit_styling(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_preedit_styling(context->input->resource,
- index, length, style);
+ zwl_text_input1_send_preedit_styling(context->input->resource,
+ index, length, style);
}

static void
@@ -529,8 +529,8 @@ input_method_context_preedit_cursor(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_preedit_cursor(context->input->resource,
- cursor);
+ zwl_text_input1_send_preedit_cursor(context->input->resource,
+ cursor);
}

static void
@@ -543,7 +543,7 @@ input_method_context_delete_surrounding_text(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_delete_surrounding_text(
+ zwl_text_input1_send_delete_surrounding_text(
context->input->resource, index, length);
}

@@ -557,8 +557,8 @@ input_method_context_cursor_position(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_cursor_position(context->input->resource,
- index, anchor);
+ zwl_text_input1_send_cursor_position(context->input->resource,
+ index, anchor);
}

static void
@@ -570,7 +570,8 @@ input_method_context_modifiers_map(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_modifiers_map(context->input->resource, map);
+ zwl_text_input1_send_modifiers_map(context->input->resource,
+ map);
}

static void
@@ -586,8 +587,9 @@ input_method_context_keysym(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_keysym(context->input->resource,
- serial, time, sym, state, modifiers);
+ zwl_text_input1_send_keysym(context->input->resource,
+ serial, time,
+ sym, state, modifiers);
}

static void
@@ -724,8 +726,8 @@ input_method_context_language(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_language(context->input->resource,
- serial, language);
+ zwl_text_input1_send_language(context->input->resource,
+ serial, language);
}

static void
@@ -738,8 +740,8 @@ input_method_context_text_direction(struct wl_client *client,
wl_resource_get_user_data(resource);

if (context->input)
- wl_text_input_send_text_direction(context->input->resource,
- serial, direction);
+ zwl_text_input1_send_text_direction(context->input->resource,
+ serial, direction);
}


diff --git a/tests/text-test.c b/tests/text-test.c
index ce60c3d..1a1275d 100644
--- a/tests/text-test.c
+++ b/tests/text-test.c
@@ -29,7 +29,7 @@
#include <stdio.h>

#include "weston-test-client-helper.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"

struct text_input_state {
int activated;
@@ -38,7 +38,7 @@ struct text_input_state {

static void
text_input_commit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text)
{
@@ -46,7 +46,7 @@ text_input_commit_string(void *data,

static void
text_input_preedit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text,
const char *commit)
@@ -55,7 +55,7 @@ text_input_preedit_string(void *data,

static void
text_input_delete_surrounding_text(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
uint32_t length)
{
@@ -63,7 +63,7 @@ text_input_delete_surrounding_text(void *data,

static void
text_input_cursor_position(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
int32_t anchor)
{
@@ -71,7 +71,7 @@ text_input_cursor_position(void *data,

static void
text_input_preedit_styling(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t index,
uint32_t length,
uint32_t style)
@@ -80,21 +80,21 @@ text_input_preedit_styling(void *data,

static void
text_input_preedit_cursor(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index)
{
}

static void
text_input_modifiers_map(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_array *map)
{
}

static void
text_input_keysym(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t time,
uint32_t sym,
@@ -105,7 +105,7 @@ text_input_keysym(void *data,

static void
text_input_enter(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_surface *surface)

{
@@ -118,7 +118,7 @@ text_input_enter(void *data,

static void
text_input_leave(void *data,
- struct wl_text_input *text_input)
+ struct zwl_text_input1 *text_input)
{
struct text_input_state *state = data;

@@ -127,14 +127,14 @@ text_input_leave(void *data,

static void
text_input_input_panel_state(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t state)
{
}

static void
text_input_language(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *language)
{
@@ -142,13 +142,13 @@ text_input_language(void *data,

static void
text_input_text_direction(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t direction)
{
}

-static const struct wl_text_input_listener text_input_listener = {
+static const struct zwl_text_input1_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_modifiers_map,
@@ -168,8 +168,8 @@ TEST(text_test)
{
struct client *client;
struct global *global;
- struct wl_text_input_manager *factory;
- struct wl_text_input *text_input;
+ struct zwl_text_input_manager1 *factory;
+ struct zwl_text_input1 *text_input;
struct text_input_state state;

client = create_client_and_test_surface(100, 100, 100, 100);
@@ -177,17 +177,17 @@ TEST(text_test)

factory = NULL;
wl_list_for_each(global, &client->global_list, link) {
- if (strcmp(global->interface, "wl_text_input_manager") == 0)
+ if (strcmp(global->interface, "zwl_text_input_manager1") == 0)
factory = wl_registry_bind(client->wl_registry,
global->name,
- &wl_text_input_manager_interface, 1);
+ &zwl_text_input_manager1_interface, 1);
}

assert(factory);

memset(&state, 0, sizeof state);
- text_input = wl_text_input_manager_create_text_input(factory);
- wl_text_input_add_listener(text_input, &text_input_listener, &state);
+ text_input = zwl_text_input_manager1_create_text_input(factory);
+ zwl_text_input1_add_listener(text_input, &text_input_listener, &state);

/* Make sure our test surface has keyboard focus. */
weston_test_activate_surface(client->test->weston_test,
@@ -196,19 +196,19 @@ TEST(text_test)
assert(client->input->keyboard->focus == client->surface);

/* Activate test model and make sure we get enter event. */
- wl_text_input_activate(text_input, client->input->wl_seat,
- client->surface->wl_surface);
+ zwl_text_input1_activate(text_input, client->input->wl_seat,
+ client->surface->wl_surface);
client_roundtrip(client);
assert(state.activated == 1 && state.deactivated == 0);

/* Deactivate test model and make sure we get leave event. */
- wl_text_input_deactivate(text_input, client->input->wl_seat);
+ zwl_text_input1_deactivate(text_input, client->input->wl_seat);
client_roundtrip(client);
assert(state.activated == 1 && state.deactivated == 1);

/* Activate test model again. */
- wl_text_input_activate(text_input, client->input->wl_seat,
- client->surface->wl_surface);
+ zwl_text_input1_activate(text_input, client->input->wl_seat,
+ client->surface->wl_surface);
client_roundtrip(client);
assert(state.activated == 2 && state.deactivated == 1);
--
2.4.3
Jan Arne Petersen
2015-11-04 13:22:18 UTC
Permalink
Post by Jonas Ådahl
---
Makefile.am | 21 ++-
clients/editor.c | 119 +++++++++--------
clients/keyboard.c | 12 +-
protocol/text.xml | 374 -----------------------------------------------------
src/text-backend.c | 56 ++++----
tests/text-test.c | 52 ++++----
6 files changed, 133 insertions(+), 501 deletions(-)
delete mode 100644 protocol/text.xml
diff --git a/Makefile.am b/Makefile.am
index 175e924..e14878e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,8 +117,8 @@ nodist_weston_SOURCES = \
protocol/screenshooter-server-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-cursor-position-server-protocol.h \
- protocol/text-protocol.c \
- protocol/text-server-protocol.h \
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-server-protocol.h \
protocol/input-method-protocol.c \
protocol/input-method-server-protocol.h \
protocol/workspaces-protocol.c \
@@ -686,8 +686,8 @@ weston_editor_SOURCES = \
clients/editor.c \
shared/helpers.h
nodist_weston_editor_SOURCES = \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h
weston_editor_LDADD = libtoytoolkit.la $(PANGO_LIBS)
weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS)
endif
@@ -753,8 +753,8 @@ BUILT_SOURCES += \
protocol/screenshooter-client-protocol.h \
protocol/text-cursor-position-client-protocol.h \
protocol/text-cursor-position-protocol.c \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h \
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h \
protocol/input-method-protocol.c \
protocol/input-method-client-protocol.h \
protocol/desktop-shell-client-protocol.h \
@@ -1212,8 +1212,8 @@ devices_weston_LDADD = libtest-client.la
text_weston_SOURCES = tests/text-test.c
nodist_text_weston_SOURCES = \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h
text_weston_CFLAGS = $(AM_CFLAGS) $(TEST_CLIENT_CFLAGS)
text_weston_LDADD = libtest-client.la
@@ -1336,13 +1336,12 @@ BUILT_SOURCES += \
protocol/weston-test-protocol.c \
protocol/weston-test-server-protocol.h \
protocol/weston-test-client-protocol.h \
- protocol/text-protocol.c \
- protocol/text-client-protocol.h
+ protocol/text-input-unstable-v1-protocol.c \
+ protocol/text-input-unstable-v1-client-protocol.h
EXTRA_DIST += \
protocol/desktop-shell.xml \
protocol/screenshooter.xml \
- protocol/text.xml \
protocol/input-method.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
diff --git a/clients/editor.c b/clients/editor.c
index 7d388a4..c3ac217 100644
--- a/clients/editor.c
+++ b/clients/editor.c
@@ -38,7 +38,7 @@
#include "shared/helpers.h"
#include "window.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"
struct text_entry {
struct widget *widget;
@@ -64,7 +64,7 @@ struct text_entry {
uint32_t delete_length;
bool invalid_delete;
} pending_commit;
- struct wl_text_input *text_input;
+ struct zwl_text_input1 *text_input;
PangoLayout *layout;
struct {
xkb_mod_mask_t shift_mask;
@@ -78,7 +78,7 @@ struct text_entry {
};
struct editor {
- struct wl_text_input_manager *text_input_manager;
+ struct zwl_text_input_manager1 *text_input_manager;
struct wl_data_source *selection;
char *selected_text;
struct display *display;
@@ -182,7 +182,7 @@ static void text_entry_update(struct text_entry *entry);
static void
text_input_commit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text)
{
@@ -234,7 +234,7 @@ clear_pending_preedit(struct text_entry *entry)
static void
text_input_preedit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text,
const char *commit)
@@ -275,7 +275,7 @@ text_input_preedit_string(void *data,
static void
text_input_delete_surrounding_text(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
uint32_t length)
{
@@ -300,7 +300,7 @@ text_input_delete_surrounding_text(void *data,
static void
text_input_cursor_position(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
int32_t anchor)
{
@@ -312,7 +312,7 @@ text_input_cursor_position(void *data,
static void
text_input_preedit_styling(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t index,
uint32_t length,
uint32_t style)
@@ -325,24 +325,24 @@ text_input_preedit_styling(void *data,
entry->preedit_info.attr_list = pango_attr_list_new();
switch (style) {
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
break;
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_ERROR);
attr2 = pango_attr_underline_color_new(65535, 0, 0);
break;
attr1 = pango_attr_background_new(0.3 * 65535, 0.3 * 65535, 65535);
attr2 = pango_attr_foreground_new(65535, 65535, 65535);
break;
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
attr2 = pango_attr_weight_new(PANGO_WEIGHT_BOLD);
break;
attr1 = pango_attr_underline_new(PANGO_UNDERLINE_SINGLE);
attr2 = pango_attr_foreground_new(0.3 * 65535, 0.3 * 65535, 0.3 * 65535);
break;
@@ -363,7 +363,7 @@ text_input_preedit_styling(void *data,
static void
text_input_preedit_cursor(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index)
{
struct text_entry *entry = data;
@@ -373,7 +373,7 @@ text_input_preedit_cursor(void *data,
static void
text_input_modifiers_map(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_array *map)
{
struct text_entry *entry = data;
@@ -383,7 +383,7 @@ text_input_modifiers_map(void *data,
static void
text_input_keysym(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t time,
uint32_t key,
@@ -470,7 +470,7 @@ text_input_keysym(void *data,
static void
text_input_enter(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_surface *surface)
{
struct text_entry *entry = data;
@@ -488,7 +488,7 @@ text_input_enter(void *data,
static void
text_input_leave(void *data,
- struct wl_text_input *text_input)
+ struct zwl_text_input1 *text_input)
{
struct text_entry *entry = data;
@@ -496,21 +496,21 @@ text_input_leave(void *data,
entry->active--;
if (!entry->active)
- wl_text_input_hide_input_panel(text_input);
+ zwl_text_input1_hide_input_panel(text_input);
widget_schedule_redraw(entry->widget);
}
static void
text_input_input_panel_state(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t state)
{
}
static void
text_input_language(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *language)
{
@@ -519,7 +519,7 @@ text_input_language(void *data,
static void
text_input_text_direction(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t direction)
{
@@ -529,13 +529,13 @@ text_input_text_direction(void *data,
switch (direction) {
pango_direction = PANGO_DIRECTION_LTR;
break;
pango_direction = PANGO_DIRECTION_RTL;
break;
pango_direction = PANGO_DIRECTION_NEUTRAL;
}
@@ -543,7 +543,7 @@ text_input_text_direction(void *data,
pango_context_set_base_dir(context, pango_direction);
}
-static const struct wl_text_input_listener text_input_listener = {
+static const struct zwl_text_input1_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_modifiers_map,
@@ -695,8 +695,10 @@ text_entry_create(struct editor *editor, const char *text)
entry->active = 0;
entry->cursor = strlen(text);
entry->anchor = entry->cursor;
- entry->text_input = wl_text_input_manager_create_text_input(editor->text_input_manager);
- wl_text_input_add_listener(entry->text_input, &text_input_listener, entry);
+ entry->text_input =
+ zwl_text_input_manager1_create_text_input(editor->text_input_manager);
+ zwl_text_input1_add_listener(entry->text_input,
+ &text_input_listener, entry);
widget_set_redraw_handler(entry->widget, text_entry_redraw_handler);
widget_set_button_handler(entry->widget, text_entry_button_handler);
@@ -710,7 +712,7 @@ static void
text_entry_destroy(struct text_entry *entry)
{
widget_destroy(entry->widget);
- wl_text_input_destroy(entry->text_input);
+ zwl_text_input1_destroy(entry->text_input);
g_clear_object(&entry->layout);
free(entry->text);
free(entry);
@@ -778,25 +780,25 @@ text_entry_activate(struct text_entry *entry,
struct wl_surface *surface = window_get_wl_surface(entry->window);
if (entry->click_to_show && entry->active) {
- wl_text_input_show_input_panel(entry->text_input);
+ zwl_text_input1_show_input_panel(entry->text_input);
return;
}
if (!entry->click_to_show)
- wl_text_input_show_input_panel(entry->text_input);
+ zwl_text_input1_show_input_panel(entry->text_input);
- wl_text_input_activate(entry->text_input,
- seat,
- surface);
+ zwl_text_input1_activate(entry->text_input,
+ seat,
+ surface);
}
static void
text_entry_deactivate(struct text_entry *entry,
struct wl_seat *seat)
{
- wl_text_input_deactivate(entry->text_input,
- seat);
+ zwl_text_input1_deactivate(entry->text_input,
+ seat);
}
static void
@@ -867,24 +869,27 @@ text_entry_update(struct text_entry *entry)
{
struct rectangle cursor_rectangle;
- wl_text_input_set_content_type(entry->text_input,
- WL_TEXT_INPUT_CONTENT_HINT_NONE,
- entry->content_purpose);
+ zwl_text_input1_set_content_type(entry->text_input,
+ ZWL_TEXT_INPUT1_CONTENT_HINT_NONE,
+ entry->content_purpose);
- wl_text_input_set_surrounding_text(entry->text_input,
- entry->text,
- entry->cursor,
- entry->anchor);
+ zwl_text_input1_set_surrounding_text(entry->text_input,
+ entry->text,
+ entry->cursor,
+ entry->anchor);
if (entry->preferred_language)
- wl_text_input_set_preferred_language(entry->text_input,
- entry->preferred_language);
+ zwl_text_input1_set_preferred_language(entry->text_input,
+ entry->preferred_language);
text_entry_get_cursor_rectangle(entry, &cursor_rectangle);
- wl_text_input_set_cursor_rectangle(entry->text_input, cursor_rectangle.x, cursor_rectangle.y,
- cursor_rectangle.width, cursor_rectangle.height);
+ zwl_text_input1_set_cursor_rectangle(entry->text_input,
+ cursor_rectangle.x,
+ cursor_rectangle.y,
+ cursor_rectangle.width,
+ cursor_rectangle.height);
- wl_text_input_commit_state(entry->text_input, ++entry->serial);
+ zwl_text_input1_commit_state(entry->text_input, ++entry->serial);
}
static void
@@ -946,7 +951,7 @@ text_entry_commit_and_reset(struct text_entry *entry)
free(commit);
}
- wl_text_input_reset(entry->text_input);
+ zwl_text_input1_reset(entry->text_input);
text_entry_update(entry);
entry->reset_serial = entry->serial;
}
@@ -995,9 +1000,9 @@ text_entry_try_invoke_preedit_action(struct text_entry *entry,
}
if (state == WL_POINTER_BUTTON_STATE_RELEASED)
- wl_text_input_invoke_action(entry->text_input,
- button,
- cursor - entry->cursor);
+ zwl_text_input1_invoke_action(entry->text_input,
+ button,
+ cursor - entry->cursor);
return 1;
}
@@ -1472,10 +1477,10 @@ global_handler(struct display *display, uint32_t name,
{
struct editor *editor = data;
- if (!strcmp(interface, "wl_text_input_manager")) {
+ if (!strcmp(interface, "zwl_text_input_manager1")) {
editor->text_input_manager =
display_bind(display, name,
- &wl_text_input_manager_interface, 1);
+ &zwl_text_input_manager1_interface, 1);
}
}
@@ -1531,7 +1536,7 @@ main(int argc, char *argv[])
if (preferred_language)
editor.entry->preferred_language = strdup(preferred_language);
editor.editor = text_entry_create(&editor, "Numeric");
- editor.editor->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NUMBER;
+ editor.editor->content_purpose = ZWL_TEXT_INPUT1_CONTENT_PURPOSE_NUMBER;
editor.editor->click_to_show = click_to_show;
editor.selection = NULL;
editor.selected_text = NULL;
diff --git a/clients/keyboard.c b/clients/keyboard.c
index f5ffe30..61cfda5 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -33,7 +33,7 @@
#include "window.h"
#include "input-method-client-protocol.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"
struct keyboard;
@@ -216,7 +216,7 @@ static const struct layout normal_layout = {
12,
4,
"en",
- WL_TEXT_INPUT_TEXT_DIRECTION_LTR
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_LTR
};
static const struct layout numeric_layout = {
@@ -225,7 +225,7 @@ static const struct layout numeric_layout = {
12,
2,
"en",
- WL_TEXT_INPUT_TEXT_DIRECTION_LTR
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_LTR
};
static const struct layout arabic_layout = {
@@ -234,7 +234,7 @@ static const struct layout arabic_layout = {
13,
4,
"ar",
- WL_TEXT_INPUT_TEXT_DIRECTION_RTL
+ ZWL_TEXT_INPUT1_TEXT_DIRECTION_RTL
};
static const char *style_labels[] = {
@@ -339,8 +339,8 @@ static const struct layout *
get_current_layout(struct virtual_keyboard *keyboard)
{
switch (keyboard->content_purpose) {
return &numeric_layout;
if (keyboard->preferred_language &&
diff --git a/protocol/text.xml b/protocol/text.xml
deleted file mode 100644
index 0f824ea..0000000
--- a/protocol/text.xml
+++ /dev/null
@@ -1,374 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="text">
-
- <copyright>
- Copyright © 2012, 2013 Intel Corporation
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="wl_text_input" version="1">
- <description summary="text input">
- An object used for text input. Adds support for text input and input
- methods to applications. A text-input object is created from a
- wl_text_input_manager and corresponds typically to a text entry in an
- application.
- Requests are used to activate/deactivate the text-input object and set
- state information like surrounding and selected text or the content type.
- The information about entered text is sent to the text-input object via
- the pre-edit and commit events. Using this interface removes the need
- for applications to directly process hardware key events and compose text
- out of them.
-
- Text is generally UTF-8 encoded, indices and lengths are in bytes.
-
- Serials are used to synchronize the state between the text input and
- an input method. New serials are sent by the text input in the
- commit_state request and are used by the input method to indicate
- the known text input state in events like preedit_string, commit_string,
- and keysym. The text input can then ignore events from the input method
- which are based on an outdated state (for example after a reset).
- </description>
-
- <request name="activate">
- <description summary="request activation">
- Requests the text-input object to be activated (typically when the
- text entry gets focus).
- The seat argument is a wl_seat which maintains the focus for this
- activation. The surface argument is a wl_surface assigned to the
- text-input object and tracked for focus lost. The enter event
- is emitted on successful activation.
- </description>
- <arg name="seat" type="object" interface="wl_seat"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="deactivate">
- <description summary="request deactivation">
- Requests the text-input object to be deactivated (typically when the
- text entry lost focus). The seat argument is a wl_seat which was used
- for activation.
- </description>
- <arg name="seat" type="object" interface="wl_seat"/>
- </request>
-
- <request name="show_input_panel">
- <description summary="show input panels">
- Requests input panels (virtual keyboard) to show.
- </description>
- </request>
-
- <request name="hide_input_panel">
- <description summary="hide input panels">
- Requests input panels (virtual keyboard) to hide.
- </description>
- </request>
-
- <request name="reset">
- <description summary="reset">
- Should be called by an editor widget when the input state should be
- reset, for example after the text was changed outside of the normal
- input method flow.
- </description>
- </request>
-
- <request name="set_surrounding_text">
- <description summary="sets the surrounding text">
- Sets the plain surrounding text around the input position. Text is
- UTF-8 encoded. Cursor is the byte offset within the
- surrounding text. Anchor is the byte offset of the
- selection anchor within the surrounding text. If there is no selected
- text anchor is the same as cursor.
- </description>
- <arg name="text" type="string"/>
- <arg name="cursor" type="uint"/>
- <arg name="anchor" type="uint"/>
- </request>
-
- <enum name="content_hint">
- <description summary="content hint">
- Content hint is a bitmask to allow to modify the behavior of the text
- input.
- </description>
- <entry name="none" value="0x0" summary="no special behaviour"/>
- <entry name="default" value="0x7" summary="auto completion, correction and capitalization"/>
- <entry name="password" value="0xc0" summary="hidden and sensitive text"/>
- <entry name="auto_completion" value="0x1" summary="suggest word completions"/>
- <entry name="auto_correction" value="0x2" summary="suggest word corrections"/>
- <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
- <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
- <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
- <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
- <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
- <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
- <entry name="latin" value="0x100" summary="just latin characters should be entered"/>
- <entry name="multiline" value="0x200" summary="the text input is multiline"/>
- </enum>
-
- <enum name="content_purpose">
- <description summary="content purpose">
- The content purpose allows to specify the primary purpose of a text
- input.
-
- This allows an input method to show special purpose input panels with
- extra characters or to disallow some characters.
- </description>
- <entry name="normal" value="0" summary="default input, allowing all characters"/>
- <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
- <entry name="digits" value="2" summary="allow only digits"/>
- <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
- <entry name="phone" value="4" summary="input a phone number"/>
- <entry name="url" value="5" summary="input an URL"/>
- <entry name="email" value="6" summary="input an email address"/>
- <entry name="name" value="7" summary="input a name of a person"/>
- <entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/>
- <entry name="date" value="9" summary="input a date"/>
- <entry name="time" value="10" summary="input a time"/>
- <entry name="datetime" value="11" summary="input a date and time"/>
- <entry name="terminal" value="12" summary="input for a terminal"/>
- </enum>
-
- <request name="set_content_type">
- <description summary="set content purpose and hint">
- Sets the content purpose and content hint. While the purpose is the
- basic purpose of an input field, the hint flags allow to modify some
- of the behavior.
-
- When no content type is explicitly set, a normal content purpose with
- default hints (auto completion, auto correction, auto capitalization)
- should be assumed.
- </description>
- <arg name="hint" type="uint"/>
- <arg name="purpose" type="uint"/>
- </request>
-
- <request name="set_cursor_rectangle">
- <arg name="x" type="int"/>
- <arg name="y" type="int"/>
- <arg name="width" type="int"/>
- <arg name="height" type="int"/>
- </request>
-
- <request name="set_preferred_language">
- <description summary="sets preferred language">
- Sets a specific language. This allows for example a virtual keyboard to
- show a language specific layout. The "language" argument is a RFC-3066
- format language tag.
-
- It could be used for example in a word processor to indicate language of
- currently edited document or in an instant message application which tracks
- languages of contacts.
- </description>
- <arg name="language" type="string"/>
- </request>
-
- <request name="commit_state">
- <arg name="serial" type="uint" summary="used to identify the known state"/>
- </request>
-
- <request name="invoke_action">
- <arg name="button" type="uint"/>
- <arg name="index" type="uint"/>
- </request>
-
- <event name="enter">
- <description summary="enter event">
- Notify the text-input object when it received focus. Typically in
- response to an activate request.
- </description>
- <arg name="surface" type="object" interface="wl_surface"/>
- </event>
-
- <event name="leave">
- <description summary="leave event">
- Notify the text-input object when it lost focus. Either in response
- to a deactivate request or when the assigned surface lost focus or was
- destroyed.
- </description>
- </event>
-
- <event name="modifiers_map">
- <description summary="modifiers map">
- Transfer an array of 0-terminated modifiers names. The position in
- the array is the index of the modifier as used in the modifiers
- bitmask in the keysym event.
- </description>
- <arg name="map" type="array"/>
- </event>
-
- <event name="input_panel_state">
- <description summary="state of the input panel">
- Notify when the visibility state of the input panel changed.
- </description>
- <arg name="state" type="uint"/>
- </event>
-
- <event name="preedit_string">
- <description summary="pre-edit">
- Notify when a new composing text (pre-edit) should be set around the
- current cursor position. Any previously set composing text should
- be removed.
-
- The commit text can be used to replace the preedit text on reset
- (for example on unfocus).
-
- The text input should also handle all preedit_style and preedit_cursor
- events occurring directly before preedit_string.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- <arg name="commit" type="string"/>
- </event>
-
- <enum name="preedit_style">
- <entry name="default" value="0" summary="default style for composing text"/>
- <entry name="none" value="1" summary="style should be the same as in non-composing text"/>
- <entry name="active" value="2"/>
- <entry name="inactive" value="3"/>
- <entry name="highlight" value="4"/>
- <entry name="underline" value="5"/>
- <entry name="selection" value="6"/>
- <entry name="incorrect" value="7"/>
- </enum>
-
- <event name="preedit_styling">
- <description summary="pre-edit styling">
- Sets styling information on composing text. The style is applied for
- length bytes from index relative to the beginning of the composing
- text (as byte offset). Multiple styles can
- be applied to a composing text by sending multiple preedit_styling
- events.
-
- This event is handled as part of a following preedit_string event.
- </description>
- <arg name="index" type="uint"/>
- <arg name="length" type="uint"/>
- <arg name="style" type="uint"/>
- </event>
-
- <event name="preedit_cursor">
- <description summary="pre-edit cursor">
- Sets the cursor position inside the composing text (as byte
- offset) relative to the start of the composing text. When index is a
- negative number no cursor is shown.
-
- This event is handled as part of a following preedit_string event.
- </description>
- <arg name="index" type="int"/>
- </event>
-
- <event name="commit_string">
- <description summary="commit">
- Notify when text should be inserted into the editor widget. The text to
- commit could be either just a single character after a key press or the
- result of some composing (pre-edit). It could be also an empty text
- when some text should be removed (see delete_surrounding_text) or when
- the input cursor should be moved (see cursor_position).
-
- Any previously set composing text should be removed.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- </event>
-
- <event name="cursor_position">
- <description summary="set cursor to new position">
- Notify when the cursor or anchor position should be modified.
-
- This event should be handled as part of a following commit_string
- event.
- </description>
- <arg name="index" type="int"/>
- <arg name="anchor" type="int"/>
- </event>
-
- <event name="delete_surrounding_text">
- <description summary="delete surrounding text">
- Notify when the text around the current cursor position should be
- deleted.
-
- Index is relative to the current cursor (in bytes).
- Length is the length of deleted text (in bytes).
-
- This event should be handled as part of a following commit_string
- event.
- </description>
- <arg name="index" type="int"/>
- <arg name="length" type="uint"/>
- </event>
-
- <event name="keysym">
- <description summary="keysym">
- Notify when a key event was sent. Key events should not be used
- for normal text input operations, which should be done with
- commit_string, delete_surrounding_text, etc. The key event follows
- the wl_keyboard key event convention. Sym is a XKB keysym, state a
- wl_keyboard key_state. Modifiers are a mask for effective modifiers
- (where the modifier indices are set by the modifiers_map event)
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="time" type="uint"/>
- <arg name="sym" type="uint"/>
- <arg name="state" type="uint"/>
- <arg name="modifiers" type="uint"/>
- </event>
-
- <event name="language">
- <description summary="language">
- Sets the language of the input text. The "language" argument is a RFC-3066
- format language tag.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="language" type="string"/>
- </event>
-
- <enum name="text_direction">
- <entry name="auto" value="0" summary="automatic text direction based on text and language"/>
- <entry name="ltr" value="1" summary="left-to-right"/>
- <entry name="rtl" value="2" summary="right-to-left"/>
- </enum>
-
- <event name="text_direction">
- <description summary="text direction">
- Sets the text direction of input text.
-
- It is mainly needed for showing input cursor on correct side of the
- editor when there is no input yet done and making sure neutral
- direction text is laid out properly.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="direction" type="uint"/>
- </event>
- </interface>
-
- <interface name="wl_text_input_manager" version="1">
- <description summary="text input manager">
- A factory for text-input objects. This object is a global singleton.
- </description>
-
- <request name="create_text_input">
- <description summary="create text input">
- Creates a new text-input object.
- </description>
- <arg name="id" type="new_id" interface="wl_text_input"/>
- </request>
- </interface>
-
-</protocol>
diff --git a/src/text-backend.c b/src/text-backend.c
index 8c9e30d..5227b97 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -33,7 +33,7 @@
#include <time.h>
#include "compositor.h"
-#include "text-server-protocol.h"
+#include "text-input-unstable-v1-server-protocol.h"
#include "input-method-server-protocol.h"
#include "shared/helpers.h"
@@ -142,7 +142,7 @@ deactivate_input_method(struct input_method *input_method)
text_input->input_panel_visible = false;
text_input->manager->current_panel = NULL;
}
- wl_text_input_send_leave(text_input->resource);
+ zwl_text_input1_send_leave(text_input->resource);
}
static void
@@ -219,8 +219,8 @@ text_input_activate(struct wl_client *client,
text_input->manager->current_panel = text_input;
}
- wl_text_input_send_enter(text_input->resource,
- text_input->surface->resource);
+ zwl_text_input1_send_enter(text_input->resource,
+ text_input->surface->resource);
}
static void
@@ -373,7 +373,7 @@ text_input_set_preferred_language(struct wl_client *client,
}
}
-static const struct wl_text_input_interface text_input_implementation = {
+static const struct zwl_text_input1_interface text_input_implementation = {
text_input_activate,
text_input_deactivate,
text_input_show_input_panel,
@@ -400,7 +400,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
return;
text_input->resource =
- wl_resource_create(client, &wl_text_input_interface, 1, id);
+ wl_resource_create(client, &zwl_text_input1_interface, 1, id);
wl_resource_set_implementation(text_input->resource,
&text_input_implementation,
text_input, destroy_text_input);
@@ -411,7 +411,7 @@ static void text_input_manager_create_text_input(struct wl_client *client,
wl_list_init(&text_input->input_methods);
};
-static const struct wl_text_input_manager_interface manager_implementation = {
+static const struct zwl_text_input_manager1_interface manager_implementation = {
text_input_manager_create_text_input
};
@@ -427,7 +427,7 @@ bind_text_input_manager(struct wl_client *client,
/* No checking for duplicate binding necessary. */
resource =
wl_resource_create(client,
- &wl_text_input_manager_interface, 1, id);
+ &zwl_text_input_manager1_interface, 1, id);
if (resource)
wl_resource_set_implementation(resource,
&manager_implementation,
@@ -460,7 +460,7 @@ text_input_manager_create(struct weston_compositor *ec)
text_input_manager->text_input_manager_global =
wl_global_create(ec->wl_display,
- &wl_text_input_manager_interface, 1,
+ &zwl_text_input_manager1_interface, 1,
text_input_manager, bind_text_input_manager);
text_input_manager->destroy_listener.notify =
@@ -486,8 +486,8 @@ input_method_context_commit_string(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_commit_string(context->input->resource,
- serial, text);
+ zwl_text_input1_send_commit_string(context->input->resource,
+ serial, text);
}
static void
@@ -501,8 +501,8 @@ input_method_context_preedit_string(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_preedit_string(context->input->resource,
- serial, text, commit);
+ zwl_text_input1_send_preedit_string(context->input->resource,
+ serial, text, commit);
}
static void
@@ -516,8 +516,8 @@ input_method_context_preedit_styling(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_preedit_styling(context->input->resource,
- index, length, style);
+ zwl_text_input1_send_preedit_styling(context->input->resource,
+ index, length, style);
}
static void
@@ -529,8 +529,8 @@ input_method_context_preedit_cursor(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_preedit_cursor(context->input->resource,
- cursor);
+ zwl_text_input1_send_preedit_cursor(context->input->resource,
+ cursor);
}
static void
@@ -543,7 +543,7 @@ input_method_context_delete_surrounding_text(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_delete_surrounding_text(
+ zwl_text_input1_send_delete_surrounding_text(
context->input->resource, index, length);
}
@@ -557,8 +557,8 @@ input_method_context_cursor_position(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_cursor_position(context->input->resource,
- index, anchor);
+ zwl_text_input1_send_cursor_position(context->input->resource,
+ index, anchor);
}
static void
@@ -570,7 +570,8 @@ input_method_context_modifiers_map(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_modifiers_map(context->input->resource, map);
+ zwl_text_input1_send_modifiers_map(context->input->resource,
+ map);
}
static void
@@ -586,8 +587,9 @@ input_method_context_keysym(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_keysym(context->input->resource,
- serial, time, sym, state, modifiers);
+ zwl_text_input1_send_keysym(context->input->resource,
+ serial, time,
+ sym, state, modifiers);
}
static void
@@ -724,8 +726,8 @@ input_method_context_language(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_language(context->input->resource,
- serial, language);
+ zwl_text_input1_send_language(context->input->resource,
+ serial, language);
}
static void
@@ -738,8 +740,8 @@ input_method_context_text_direction(struct wl_client *client,
wl_resource_get_user_data(resource);
if (context->input)
- wl_text_input_send_text_direction(context->input->resource,
- serial, direction);
+ zwl_text_input1_send_text_direction(context->input->resource,
+ serial, direction);
}
diff --git a/tests/text-test.c b/tests/text-test.c
index ce60c3d..1a1275d 100644
--- a/tests/text-test.c
+++ b/tests/text-test.c
@@ -29,7 +29,7 @@
#include <stdio.h>
#include "weston-test-client-helper.h"
-#include "text-client-protocol.h"
+#include "text-input-unstable-v1-client-protocol.h"
struct text_input_state {
int activated;
@@ -38,7 +38,7 @@ struct text_input_state {
static void
text_input_commit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text)
{
@@ -46,7 +46,7 @@ text_input_commit_string(void *data,
static void
text_input_preedit_string(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *text,
const char *commit)
@@ -55,7 +55,7 @@ text_input_preedit_string(void *data,
static void
text_input_delete_surrounding_text(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
uint32_t length)
{
@@ -63,7 +63,7 @@ text_input_delete_surrounding_text(void *data,
static void
text_input_cursor_position(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index,
int32_t anchor)
{
@@ -71,7 +71,7 @@ text_input_cursor_position(void *data,
static void
text_input_preedit_styling(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t index,
uint32_t length,
uint32_t style)
@@ -80,21 +80,21 @@ text_input_preedit_styling(void *data,
static void
text_input_preedit_cursor(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
int32_t index)
{
}
static void
text_input_modifiers_map(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_array *map)
{
}
static void
text_input_keysym(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t time,
uint32_t sym,
@@ -105,7 +105,7 @@ text_input_keysym(void *data,
static void
text_input_enter(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
struct wl_surface *surface)
{
@@ -118,7 +118,7 @@ text_input_enter(void *data,
static void
text_input_leave(void *data,
- struct wl_text_input *text_input)
+ struct zwl_text_input1 *text_input)
{
struct text_input_state *state = data;
@@ -127,14 +127,14 @@ text_input_leave(void *data,
static void
text_input_input_panel_state(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t state)
{
}
static void
text_input_language(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
const char *language)
{
@@ -142,13 +142,13 @@ text_input_language(void *data,
static void
text_input_text_direction(void *data,
- struct wl_text_input *text_input,
+ struct zwl_text_input1 *text_input,
uint32_t serial,
uint32_t direction)
{
}
-static const struct wl_text_input_listener text_input_listener = {
+static const struct zwl_text_input1_listener text_input_listener = {
text_input_enter,
text_input_leave,
text_input_modifiers_map,
@@ -168,8 +168,8 @@ TEST(text_test)
{
struct client *client;
struct global *global;
- struct wl_text_input_manager *factory;
- struct wl_text_input *text_input;
+ struct zwl_text_input_manager1 *factory;
+ struct zwl_text_input1 *text_input;
struct text_input_state state;
client = create_client_and_test_surface(100, 100, 100, 100);
@@ -177,17 +177,17 @@ TEST(text_test)
factory = NULL;
wl_list_for_each(global, &client->global_list, link) {
- if (strcmp(global->interface, "wl_text_input_manager") == 0)
+ if (strcmp(global->interface, "zwl_text_input_manager1") == 0)
factory = wl_registry_bind(client->wl_registry,
global->name,
- &wl_text_input_manager_interface, 1);
+ &zwl_text_input_manager1_interface, 1);
}
assert(factory);
memset(&state, 0, sizeof state);
- text_input = wl_text_input_manager_create_text_input(factory);
- wl_text_input_add_listener(text_input, &text_input_listener, &state);
+ text_input = zwl_text_input_manager1_create_text_input(factory);
+ zwl_text_input1_add_listener(text_input, &text_input_listener, &state);
/* Make sure our test surface has keyboard focus. */
weston_test_activate_surface(client->test->weston_test,
@@ -196,19 +196,19 @@ TEST(text_test)
assert(client->input->keyboard->focus == client->surface);
/* Activate test model and make sure we get enter event. */
- wl_text_input_activate(text_input, client->input->wl_seat,
- client->surface->wl_surface);
+ zwl_text_input1_activate(text_input, client->input->wl_seat,
+ client->surface->wl_surface);
client_roundtrip(client);
assert(state.activated == 1 && state.deactivated == 0);
/* Deactivate test model and make sure we get leave event. */
- wl_text_input_deactivate(text_input, client->input->wl_seat);
+ zwl_text_input1_deactivate(text_input, client->input->wl_seat);
client_roundtrip(client);
assert(state.activated == 1 && state.deactivated == 1);
/* Activate test model again. */
- wl_text_input_activate(text_input, client->input->wl_seat,
- client->surface->wl_surface);
+ zwl_text_input1_activate(text_input, client->input->wl_seat,
+ client->surface->wl_surface);
client_roundtrip(client);
assert(state.activated == 2 && state.deactivated == 1);
--
Jan Arne Petersen | ***@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
Jonas Ådahl
2015-11-04 08:49:54 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 17 ++-
clients/keyboard.c | 174 +++++++++++++-------------
clients/weston-simple-im.c | 122 +++++++++----------
desktop-shell/input-panel.c | 12 +-
ivi-shell/input-panel-ivi.c | 12 +-
protocol/input-method.xml | 291 --------------------------------------------
src/text-backend.c | 26 ++--
7 files changed, 186 insertions(+), 468 deletions(-)
delete mode 100644 protocol/input-method.xml

diff --git a/Makefile.am b/Makefile.am
index e14878e..6b2b3da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -119,8 +119,8 @@ nodist_weston_SOURCES = \
protocol/text-cursor-position-server-protocol.h \
protocol/text-input-unstable-v1-protocol.c \
protocol/text-input-unstable-v1-server-protocol.h \
- protocol/input-method-protocol.c \
- protocol/input-method-server-protocol.h \
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-server-protocol.h \
protocol/workspaces-protocol.c \
protocol/workspaces-server-protocol.h \
protocol/presentation-timing-unstable-v1-protocol.c \
@@ -696,15 +696,15 @@ weston_keyboard_SOURCES = clients/keyboard.c
nodist_weston_keyboard_SOURCES = \
protocol/desktop-shell-client-protocol.h \
protocol/desktop-shell-protocol.c \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h
weston_keyboard_LDADD = libtoytoolkit.la
weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

weston_simple_im_SOURCES = clients/weston-simple-im.c
nodist_weston_simple_im_SOURCES = \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h
weston_simple_im_LDADD = $(CLIENT_LIBS)
weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

@@ -755,8 +755,8 @@ BUILT_SOURCES += \
protocol/text-cursor-position-protocol.c \
protocol/text-input-unstable-v1-protocol.c \
protocol/text-input-unstable-v1-client-protocol.h \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h \
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h \
protocol/desktop-shell-client-protocol.h \
protocol/desktop-shell-protocol.c \
protocol/scaler-client-protocol.h \
@@ -1342,7 +1342,6 @@ BUILT_SOURCES += \
EXTRA_DIST += \
protocol/desktop-shell.xml \
protocol/screenshooter.xml \
- protocol/input-method.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
diff --git a/clients/keyboard.c b/clients/keyboard.c
index 61cfda5..b524423 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -32,15 +32,15 @@
#include <cairo.h>

#include "window.h"
-#include "input-method-client-protocol.h"
+#include "input-method-unstable-v1-client-protocol.h"
#include "text-input-unstable-v1-client-protocol.h"

struct keyboard;

struct virtual_keyboard {
- struct wl_input_panel *input_panel;
- struct wl_input_method *input_method;
- struct wl_input_method_context *context;
+ struct zwl_input_panel1 *input_panel;
+ struct zwl_input_method1 *input_method;
+ struct zwl_input_method_context1 *context;
struct display *display;
struct output *output;
char *preedit_string;
@@ -427,11 +427,11 @@ virtual_keyboard_commit_preedit(struct virtual_keyboard *keyboard)
strlen(keyboard->preedit_string) == 0)
return;

- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- keyboard->preedit_string);
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ keyboard->preedit_string);

if (keyboard->surrounding_text) {
surrounding_text = insert_text(keyboard->surrounding_text,
@@ -456,18 +456,18 @@ virtual_keyboard_send_preedit(struct virtual_keyboard *keyboard,
uint32_t index = strlen(keyboard->preedit_string);

if (keyboard->preedit_style)
- wl_input_method_context_preedit_styling(keyboard->context,
- 0,
- strlen(keyboard->preedit_string),
- keyboard->preedit_style);
+ zwl_input_method_context1_preedit_styling(keyboard->context,
+ 0,
+ strlen(keyboard->preedit_string),
+ keyboard->preedit_style);
if (cursor > 0)
index = cursor;
- wl_input_method_context_preedit_cursor(keyboard->context,
- index);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- keyboard->preedit_string,
- keyboard->preedit_string);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ index);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ keyboard->preedit_string,
+ keyboard->preedit_string);
}

static const char *
@@ -499,12 +499,12 @@ delete_before_cursor(struct virtual_keyboard *keyboard)

end = keyboard->surrounding_text + keyboard->surrounding_cursor;

- wl_input_method_context_delete_surrounding_text(keyboard->context,
- (start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
- end - start);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- "");
+ zwl_input_method_context1_delete_surrounding_text(keyboard->context,
+ (start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
+ end - start);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ "");

/* Update surrounding text */
keyboard->surrounding_cursor = start - keyboard->surrounding_text;
@@ -571,10 +571,10 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
break;
case keytype_enter:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Return, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Return, key_state, mod_mask);
break;
case keytype_space:
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
@@ -615,38 +615,38 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
break;
case keytype_tab:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Tab, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Tab, key_state, mod_mask);
break;
case keytype_arrow_up:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Up, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Up, key_state, mod_mask);
break;
case keytype_arrow_left:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Left, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Left, key_state, mod_mask);
break;
case keytype_arrow_right:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Right, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Right, key_state, mod_mask);
break;
case keytype_arrow_down:
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Down, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Down, key_state, mod_mask);
break;
case keytype_style:
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
@@ -750,7 +750,7 @@ touch_up_handler(struct widget *widget, struct input *input,

static void
handle_surrounding_text(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *text,
uint32_t cursor,
uint32_t anchor)
@@ -765,7 +765,7 @@ handle_surrounding_text(void *data,

static void
handle_reset(void *data,
- struct wl_input_method_context *context)
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;

@@ -779,7 +779,7 @@ handle_reset(void *data,

static void
handle_content_type(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t hint,
uint32_t purpose)
{
@@ -791,7 +791,7 @@ handle_content_type(void *data,

static void
handle_invoke_action(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t button,
uint32_t index)
{
@@ -805,7 +805,7 @@ handle_invoke_action(void *data,

static void
handle_commit_state(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t serial)
{
struct virtual_keyboard *keyboard = data;
@@ -822,15 +822,19 @@ handle_commit_state(void *data,
layout->columns * key_width,
layout->rows * key_height);

- wl_input_method_context_language(context, keyboard->serial, layout->language);
- wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
+ zwl_input_method_context1_language(context,
+ keyboard->serial,
+ layout->language);
+ zwl_input_method_context1_text_direction(context,
+ keyboard->serial,
+ layout->text_direction);

widget_schedule_redraw(keyboard->keyboard->widget);
}

static void
handle_preferred_language(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *language)
{
struct virtual_keyboard *keyboard = data;
@@ -844,7 +848,7 @@ handle_preferred_language(void *data,
keyboard->preferred_language = strdup(language);
}

-static const struct wl_input_method_context_listener input_method_context_listener = {
+static const struct zwl_input_method_context1_listener input_method_context_listener = {
handle_surrounding_text,
handle_reset,
handle_content_type,
@@ -855,8 +859,8 @@ static const struct wl_input_method_context_listener input_method_context_listen

static void
input_method_activate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;
struct wl_array modifiers_map;
@@ -865,7 +869,7 @@ input_method_activate(void *data,
keyboard->keyboard->state = KEYBOARD_STATE_DEFAULT;

if (keyboard->context)
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);

if (keyboard->preedit_string)
free(keyboard->preedit_string);
@@ -881,15 +885,15 @@ input_method_activate(void *data,
keyboard->serial = 0;

keyboard->context = context;
- wl_input_method_context_add_listener(context,
- &input_method_context_listener,
- keyboard);
+ zwl_input_method_context1_add_listener(context,
+ &input_method_context_listener,
+ keyboard);

wl_array_init(&modifiers_map);
keysym_modifiers_add(&modifiers_map, "Shift");
keysym_modifiers_add(&modifiers_map, "Control");
keysym_modifiers_add(&modifiers_map, "Mod1");
- wl_input_method_context_modifiers_map(context, &modifiers_map);
+ zwl_input_method_context1_modifiers_map(context, &modifiers_map);
keyboard->keysym.shift_mask = keysym_modifiers_get_mask(&modifiers_map, "Shift");
wl_array_release(&modifiers_map);

@@ -899,27 +903,31 @@ input_method_activate(void *data,
layout->columns * key_width,
layout->rows * key_height);

- wl_input_method_context_language(context, keyboard->serial, layout->language);
- wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
+ zwl_input_method_context1_language(context,
+ keyboard->serial,
+ layout->language);
+ zwl_input_method_context1_text_direction(context,
+ keyboard->serial,
+ layout->text_direction);

widget_schedule_redraw(keyboard->keyboard->widget);
}

static void
input_method_deactivate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;

if (!keyboard->context)
return;

- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
keyboard->context = NULL;
}

-static const struct wl_input_method_listener input_method_listener = {
+static const struct zwl_input_method1_listener input_method_listener = {
input_method_activate,
input_method_deactivate
};
@@ -930,14 +938,16 @@ global_handler(struct display *display, uint32_t name,
{
struct virtual_keyboard *keyboard = data;

- if (!strcmp(interface, "wl_input_panel")) {
+ if (!strcmp(interface, "zwl_input_panel1")) {
keyboard->input_panel =
- display_bind(display, name, &wl_input_panel_interface, 1);
- } else if (!strcmp(interface, "wl_input_method")) {
+ display_bind(display, name, &zwl_input_panel1_interface, 1);
+ } else if (!strcmp(interface, "zwl_input_method1")) {
keyboard->input_method =
display_bind(display, name,
- &wl_input_method_interface, 1);
- wl_input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard);
+ &zwl_input_method1_interface, 1);
+ zwl_input_method1_add_listener(keyboard->input_method,
+ &input_method_listener,
+ keyboard);
}
}

@@ -946,7 +956,7 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
{
struct keyboard *keyboard;
const struct layout *layout;
- struct wl_input_panel_surface *ips;
+ struct zwl_input_panel_surface1 *ips;

layout = get_current_layout(virtual_keyboard);

@@ -971,12 +981,12 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
layout->rows * key_height);


- ips = wl_input_panel_get_input_panel_surface(virtual_keyboard->input_panel,
- window_get_wl_surface(keyboard->window));
+ ips = zwl_input_panel1_get_input_panel_surface(virtual_keyboard->input_panel,
+ window_get_wl_surface(keyboard->window));

- wl_input_panel_surface_set_toplevel(ips,
- output_get_wl_output(output),
- WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+ zwl_input_panel_surface1_set_toplevel(ips,
+ output_get_wl_output(output),
+ ZWL_INPUT_PANEL_SURFACE1_POSITION_CENTER_BOTTOM);
}

int
diff --git a/clients/weston-simple-im.c b/clients/weston-simple-im.c
index 0e68d48..304ba6e 100644
--- a/clients/weston-simple-im.c
+++ b/clients/weston-simple-im.c
@@ -33,7 +33,7 @@
#include <linux/input.h>

#include "window.h"
-#include "input-method-client-protocol.h"
+#include "input-method-unstable-v1-client-protocol.h"

enum compose_state {
state_normal,
@@ -54,8 +54,8 @@ typedef void (*keyboard_input_key_handler_t)(struct simple_im *keyboard,
enum wl_keyboard_key_state state);

struct simple_im {
- struct wl_input_method *input_method;
- struct wl_input_method_context *context;
+ struct zwl_input_method1 *input_method;
+ struct zwl_input_method_context1 *context;
struct wl_display *display;
struct wl_registry *registry;
struct wl_keyboard *keyboard;
@@ -105,7 +105,7 @@ static const uint32_t ignore_keys_on_compose[] = {

static void
handle_surrounding_text(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *text,
uint32_t cursor,
uint32_t anchor)
@@ -115,7 +115,7 @@ handle_surrounding_text(void *data,

static void
handle_reset(void *data,
- struct wl_input_method_context *context)
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;

@@ -126,7 +126,7 @@ handle_reset(void *data,

static void
handle_content_type(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t hint,
uint32_t purpose)
{
@@ -134,7 +134,7 @@ handle_content_type(void *data,

static void
handle_invoke_action(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t button,
uint32_t index)
{
@@ -142,7 +142,7 @@ handle_invoke_action(void *data,

static void
handle_commit_state(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t serial)
{
struct simple_im *keyboard = data;
@@ -152,12 +152,12 @@ handle_commit_state(void *data,

static void
handle_preferred_language(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *language)
{
}

-static const struct wl_input_method_context_listener input_method_context_listener = {
+static const struct zwl_input_method_context1_listener input_method_context_listener = {
handle_surrounding_text,
handle_reset,
handle_content_type,
@@ -256,7 +256,7 @@ input_method_keyboard_modifiers(void *data,
uint32_t group)
{
struct simple_im *keyboard = data;
- struct wl_input_method_context *context = keyboard->context;
+ struct zwl_input_method_context1 *context = keyboard->context;
xkb_mod_mask_t mask;

xkb_state_update_mask(keyboard->state, mods_depressed,
@@ -273,9 +273,9 @@ input_method_keyboard_modifiers(void *data,
if (mask & keyboard->shift_mask)
keyboard->modifiers |= MOD_SHIFT_MASK;

- wl_input_method_context_modifiers(context, serial,
- mods_depressed, mods_depressed,
- mods_latched, group);
+ zwl_input_method_context1_modifiers(context, serial,
+ mods_depressed, mods_depressed,
+ mods_latched, group);
}

static const struct wl_keyboard_listener input_method_keyboard_listener = {
@@ -288,23 +288,23 @@ static const struct wl_keyboard_listener input_method_keyboard_listener = {

static void
input_method_activate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;

if (keyboard->context)
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);

keyboard->compose_state = state_normal;

keyboard->serial = 0;

keyboard->context = context;
- wl_input_method_context_add_listener(context,
+ zwl_input_method_context1_add_listener(context,
&input_method_context_listener,
keyboard);
- keyboard->keyboard = wl_input_method_context_grab_keyboard(context);
+ keyboard->keyboard = zwl_input_method_context1_grab_keyboard(context);
wl_keyboard_add_listener(keyboard->keyboard,
&input_method_keyboard_listener,
keyboard);
@@ -312,19 +312,19 @@ input_method_activate(void *data,

static void
input_method_deactivate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;

if (!keyboard->context)
return;

- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
keyboard->context = NULL;
}

-static const struct wl_input_method_listener input_method_listener = {
+static const struct zwl_input_method1_listener input_method_listener = {
input_method_activate,
input_method_deactivate
};
@@ -335,12 +335,12 @@ registry_handle_global(void *data, struct wl_registry *registry,
{
struct simple_im *keyboard = data;

- if (!strcmp(interface, "wl_input_method")) {
+ if (!strcmp(interface, "zwl_input_method1")) {
keyboard->input_method =
wl_registry_bind(registry, name,
- &wl_input_method_interface, 1);
- wl_input_method_add_listener(keyboard->input_method,
- &input_method_listener, keyboard);
+ &zwl_input_method1_interface, 1);
+ zwl_input_method1_add_listener(keyboard->input_method,
+ &input_method_listener, keyboard);
}
}

@@ -379,7 +379,7 @@ simple_im_key_handler(struct simple_im *keyboard,
uint32_t serial, uint32_t time, uint32_t key, uint32_t sym,
enum wl_keyboard_key_state state)
{
- struct wl_input_method_context *context = keyboard->context;
+ struct zwl_input_method_context1 *context = keyboard->context;
char text[64];

if (sym == XKB_KEY_Multi_key &&
@@ -399,7 +399,7 @@ simple_im_key_handler(struct simple_im *keyboard,

for (i = 0; i < sizeof(ignore_keys_on_compose) / sizeof(ignore_keys_on_compose[0]); i++) {
if (sym == ignore_keys_on_compose[i]) {
- wl_input_method_context_key(context, keyboard->serial, time, key, state);
+ zwl_input_method_context1_key(context, keyboard->serial, time, key, state);
return;
}
}
@@ -414,16 +414,16 @@ simple_im_key_handler(struct simple_im *keyboard,

if (cs) {
if (cs->keys[i + 1] == 0) {
- wl_input_method_context_preedit_cursor(keyboard->context,
- 0);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- "", "");
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- cs->text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ 0);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ "", "");
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ cs->text);
keyboard->compose_state = state_normal;
} else {
uint32_t j = 0, idx = 0;
@@ -432,12 +432,12 @@ simple_im_key_handler(struct simple_im *keyboard,
idx += xkb_keysym_to_utf8(cs->keys[j], text + idx, sizeof(text) - idx);
}

- wl_input_method_context_preedit_cursor(keyboard->context,
- strlen(text));
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- text,
- text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ strlen(text));
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ text,
+ text);
}
} else {
uint32_t j = 0, idx = 0;
@@ -445,34 +445,34 @@ simple_im_key_handler(struct simple_im *keyboard,
for (; j <= i; j++) {
idx += xkb_keysym_to_utf8(keyboard->compose_seq.keys[j], text + idx, sizeof(text) - idx);
}
- wl_input_method_context_preedit_cursor(keyboard->context,
- 0);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- "", "");
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ 0);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ "", "");
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ text);
keyboard->compose_state = state_normal;
}
return;
}

if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) {
- wl_input_method_context_key(context, serial, time, key, state);
+ zwl_input_method_context1_key(context, serial, time, key, state);
return;
}

if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
return;

- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- text);
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ text);
}

int
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
index 95d6287..f5342aa 100644
--- a/desktop-shell/input-panel.c
+++ b/desktop-shell/input-panel.c
@@ -31,7 +31,7 @@

#include "shell.h"
#include "desktop-shell-server-protocol.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"

struct input_panel_surface {
@@ -290,7 +290,7 @@ input_panel_surface_set_overlay_panel(struct wl_client *client,
input_panel_surface->panel = 1;
}

-static const struct wl_input_panel_surface_interface input_panel_surface_implementation = {
+static const struct zwl_input_panel_surface1_interface input_panel_surface_implementation = {
input_panel_surface_set_toplevel,
input_panel_surface_set_overlay_panel
};
@@ -332,14 +332,14 @@ input_panel_get_input_panel_surface(struct wl_client *client,

ipsurf->resource =
wl_resource_create(client,
- &wl_input_panel_surface_interface, 1, id);
+ &zwl_input_panel_surface1_interface, 1, id);
wl_resource_set_implementation(ipsurf->resource,
&input_panel_surface_implementation,
ipsurf,
destroy_input_panel_surface_resource);
}

-static const struct wl_input_panel_interface input_panel_implementation = {
+static const struct zwl_input_panel1_interface input_panel_implementation = {
input_panel_get_input_panel_surface
};

@@ -359,7 +359,7 @@ bind_input_panel(struct wl_client *client,
struct wl_resource *resource;

resource = wl_resource_create(client,
- &wl_input_panel_interface, 1, id);
+ &zwl_input_panel1_interface, 1, id);

if (shell->input_panel.binding == NULL) {
wl_resource_set_implementation(resource,
@@ -398,7 +398,7 @@ input_panel_setup(struct desktop_shell *shell)
wl_list_init(&shell->input_panel.surfaces);

if (wl_global_create(shell->compositor->wl_display,
- &wl_input_panel_interface, 1,
+ &zwl_input_panel1_interface, 1,
shell, bind_input_panel) == NULL)
return -1;

diff --git a/ivi-shell/input-panel-ivi.c b/ivi-shell/input-panel-ivi.c
index ecd497e..359bd7f 100644
--- a/ivi-shell/input-panel-ivi.c
+++ b/ivi-shell/input-panel-ivi.c
@@ -32,7 +32,7 @@
#include <string.h>

#include "ivi-shell.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "ivi-layout-private.h"
#include "shared/helpers.h"

@@ -282,7 +282,7 @@ input_panel_surface_set_overlay_panel(struct wl_client *client,
input_panel_surface->panel = 1;
}

-static const struct wl_input_panel_surface_interface input_panel_surface_implementation = {
+static const struct zwl_input_panel_surface1_interface input_panel_surface_implementation = {
input_panel_surface_set_toplevel,
input_panel_surface_set_overlay_panel
};
@@ -324,14 +324,14 @@ input_panel_get_input_panel_surface(struct wl_client *client,

ipsurf->resource =
wl_resource_create(client,
- &wl_input_panel_surface_interface, 1, id);
+ &zwl_input_panel_surface1_interface, 1, id);
wl_resource_set_implementation(ipsurf->resource,
&input_panel_surface_implementation,
ipsurf,
destroy_input_panel_surface_resource);
}

-static const struct wl_input_panel_interface input_panel_implementation = {
+static const struct zwl_input_panel1_interface input_panel_implementation = {
input_panel_get_input_panel_surface
};

@@ -351,7 +351,7 @@ bind_input_panel(struct wl_client *client,
struct wl_resource *resource;

resource = wl_resource_create(client,
- &wl_input_panel_interface, 1, id);
+ &zwl_input_panel1_interface, 1, id);

if (shell->input_panel.binding == NULL) {
wl_resource_set_implementation(resource,
@@ -390,7 +390,7 @@ input_panel_setup(struct ivi_shell *shell)
wl_list_init(&shell->input_panel.surfaces);

if (wl_global_create(shell->compositor->wl_display,
- &wl_input_panel_interface, 1,
+ &zwl_input_panel1_interface, 1,
shell, bind_input_panel) == NULL)
return -1;

diff --git a/protocol/input-method.xml b/protocol/input-method.xml
deleted file mode 100644
index 657230c..0000000
--- a/protocol/input-method.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="input_method">
-
- <copyright>
- Copyright © 2012, 2013 Intel Corporation
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="wl_input_method_context" version="1">
- <description summary="input method context">
- Corresponds to a text input on input method side. An input method context
- is created on text input activation on the input method side. It allows to
- receive information about the text input from the application via events.
- Input method contexts do not keep state after deactivation and should be
- destroyed after deactivation is handled.
-
- Text is generally UTF-8 encoded, indices and lengths are in bytes.
-
- Serials are used to synchronize the state between the text input and
- an input method. New serials are sent by the text input in the
- commit_state request and are used by the input method to indicate
- the known text input state in events like preedit_string, commit_string,
- and keysym. The text input can then ignore events from the input method
- which are based on an outdated state (for example after a reset).
- </description>
-
- <request name="destroy" type="destructor"/>
-
- <request name="commit_string">
- <description summary="commit string">
- Send the commit string text for insertion to the application.
-
- The text to commit could be either just a single character after a key
- press or the result of some composing (pre-edit). It could be also an
- empty text when some text should be removed (see
- delete_surrounding_text) or when the input cursor should be moved (see
- cursor_position).
-
- Any previously set composing text will be removed.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- </request>
-
- <request name="preedit_string">
- <description summary="pre-edit string">
- Send the pre-edit string text to the application text input.
-
- The commit text can be used to replace the preedit text on reset (for
- example on unfocus).
-
- Also previously sent preedit_style and preedit_cursor requests are
- processed bt the text_input also.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- <arg name="commit" type="string"/>
- </request>
-
- <request name="preedit_styling">
- <description summary="pre-edit styling">
- Sets styling information on composing text. The style is applied for
- length in bytes from index relative to the beginning of
- the composing text (as byte offset). Multiple styles can
- be applied to a composing text.
-
- This request should be sent before sending preedit_string request.
- </description>
- <arg name="index" type="uint"/>
- <arg name="length" type="uint"/>
- <arg name="style" type="uint"/>
- </request>
-
- <request name="preedit_cursor">
- <description summary="pre-edit cursor">
- Sets the cursor position inside the composing text (as byte offset)
- relative to the start of the composing text.
-
- When index is negative no cursor should be displayed.
-
- This request should be sent before sending preedit_string request.
- </description>
- <arg name="index" type="int"/>
- </request>
-
- <request name="delete_surrounding_text">
- <description summary="delete text">
- This request will be handled on text_input side as part of a directly
- following commit_string request.
- </description>
- <arg name="index" type="int"/>
- <arg name="length" type="uint"/>
- </request>
-
- <request name="cursor_position">
- <description summary="set cursor to a new position">
- Sets the cursor and anchor to a new position. Index is the new cursor
- position in bytes (when >= 0 relative to the end of inserted text
- else relative to beginning of inserted text). Anchor is the new anchor
- position in bytes (when >= 0 relative to the end of inserted text, else
- relative to beginning of inserted text). When there should be no
- selected text anchor should be the same as index.
-
- This request will be handled on text_input side as part of a directly
- following commit_string request.
- </description>
- <arg name="index" type="int"/>
- <arg name="anchor" type="int"/>
- </request>
-
- <request name="modifiers_map">
- <arg name="map" type="array"/>
- </request>
-
- <request name="keysym">
- <description summary="keysym">
- Notify when a key event was sent. Key events should not be used for
- normal text input operations, which should be done with commit_string,
- delete_surrounfing_text, etc. The key event follows the wl_keyboard key
- event convention. Sym is a XKB keysym, state a wl_keyboard key_state.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="time" type="uint"/>
- <arg name="sym" type="uint"/>
- <arg name="state" type="uint"/>
- <arg name="modifiers" type="uint"/>
- </request>
-
- <request name="grab_keyboard">
- <description summary="grab hardware keyboard">
- Allows an input method to receive hardware keyboard input and process
- key events to generate text events (with pre-edit) over the wire. This
- allows input methods which compose multiple key events for inputting
- text like it is done for CJK languages.
- </description>
- <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
- </request>
-
- <request name="key">
- <description summary="forward key event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::key event is not processed by the input
- method itself and should be sent to the client instead, forward it
- with this request. The arguments should be the ones from the
- wl_keyboard::key event.
-
- For generating custom key events use the keysym request instead.
- </description>
- <arg name="serial" type="uint" summary="serial from wl_keyboard::key"/>
- <arg name="time" type="uint" summary="time from wl_keyboard::key"/>
- <arg name="key" type="uint" summary="key from wl_keyboard::key"/>
- <arg name="state" type="uint" summary="state from wl_keyboard::key"/>
- </request>
-
- <request name="modifiers">
- <description summary="forward modifiers event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::modifiers event should be also send to the
- client, forward it with this request. The arguments should be the ones
- from the wl_keyboard::modifiers event.
- </description>
- <arg name="serial" type="uint" summary="serial from wl_keyboard::modifiers"/>
- <arg name="mods_depressed" type="uint" summary="mods_depressed from wl_keyboard::modifiers"/>
- <arg name="mods_latched" type="uint" summary="mods_latched from wl_keyboard::modifiers"/>
- <arg name="mods_locked" type="uint" summary="mods_locked from wl_keyboard::modifiers"/>
- <arg name="group" type="uint" summary="group from wl_keyboard::modifiers"/>
- </request>
-
- <request name="language">
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="language" type="string"/>
- </request>
- <request name="text_direction">
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="direction" type="uint"/>
- </request>
-
- <event name="surrounding_text">
- <description summary="surrounding text event">
- The plain surrounding text around the input position. Cursor is the
- position in bytes within the surrounding text relative to the beginning
- of the text. Anchor is the position in bytes of the selection anchor
- within the surrounding text relative to the beginning of the text. If
- there is no selected text anchor is the same as cursor.
- </description>
- <arg name="text" type="string"/>
- <arg name="cursor" type="uint"/>
- <arg name="anchor" type="uint"/>
- </event>
-
- <event name="reset">
- </event>
-
- <event name="content_type">
- <arg name="hint" type="uint"/>
- <arg name="purpose" type="uint"/>
- </event>
-
- <event name="invoke_action">
- <arg name="button" type="uint"/>
- <arg name="index" type="uint"/>
- </event>
-
- <event name="commit_state">
- <arg name="serial" type="uint" summary="serial of text input state"/>
- </event>
-
- <event name="preferred_language">
- <arg name="language" type="string"/>
- </event>
- </interface>
-
- <interface name="wl_input_method" version="1">
- <description summary="input method">
- An input method object is responsible to compose text in response to
- input from hardware or virtual keyboards. There is one input method
- object per seat. On activate there is a new input method context object
- created which allows the input method to communicate with the text input.
- </description>
-
- <event name="activate">
- <description summary="activate event">
- A text input was activated. Creates an input method context object
- which allows communication with the text input.
- </description>
- <arg name="id" type="new_id" interface="wl_input_method_context"/>
- </event>
-
- <event name="deactivate">
- <description summary="deactivate event">
- The text input corresponding to the context argument was deactivated.
- The input method context should be destroyed after deactivation is
- handled.
- </description>
- <arg name="context" type="object" interface="wl_input_method_context"/>
- </event>
- </interface>
-
- <interface name="wl_input_panel" version="1">
- <description summary="interface for implementing keyboards">
- Only one client can bind this interface at a time.
- </description>
-
- <request name="get_input_panel_surface">
- <arg name="id" type="new_id" interface="wl_input_panel_surface"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
- </interface>
-
- <interface name="wl_input_panel_surface" version="1">
- <enum name="position">
- <entry name="center_bottom" value="0"/>
- </enum>
-
- <request name="set_toplevel">
- <description summary="set the surface type as a keyboard">
- A keyboard surface is only shown when a text input is active.
- </description>
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="position" type="uint"/>
- </request>
-
- <request name="set_overlay_panel">
- <description summary="set the surface type as an overlay panel">
- An overlay panel is shown near the input cursor above the application
- window when a text input is active.
- </description>
- </request>
- </interface>
-
-</protocol>
diff --git a/src/text-backend.c b/src/text-backend.c
index 5227b97..9fb5bef 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -34,7 +34,7 @@

#include "compositor.h"
#include "text-input-unstable-v1-server-protocol.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"

struct text_input_manager;
@@ -127,7 +127,7 @@ deactivate_input_method(struct input_method *input_method)

if (input_method->context && input_method->input_method_binding) {
input_method_context_end_keyboard_grab(input_method->context);
- wl_input_method_send_deactivate(
+ zwl_input_method1_send_deactivate(
input_method->input_method_binding,
input_method->context->resource);
}
@@ -172,7 +172,7 @@ text_input_set_surrounding_text(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_surrounding_text(
+ zwl_input_method_context1_send_surrounding_text(
input_method->context->resource, text, cursor, anchor);
}
}
@@ -245,7 +245,7 @@ text_input_reset(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_reset(
+ zwl_input_method_context1_send_reset(
input_method->context->resource);
}
}
@@ -283,7 +283,7 @@ text_input_set_content_type(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_content_type(
+ zwl_input_method_context1_send_content_type(
input_method->context->resource, hint, purpose);
}
}
@@ -301,7 +301,7 @@ text_input_invoke_action(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_invoke_action(
+ zwl_input_method_context1_send_invoke_action(
input_method->context->resource, button, index);
}
}
@@ -318,7 +318,7 @@ text_input_commit_state(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_commit_state(
+ zwl_input_method_context1_send_commit_state(
input_method->context->resource, serial);
}
}
@@ -368,7 +368,7 @@ text_input_set_preferred_language(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_preferred_language(
+ zwl_input_method_context1_send_preferred_language(
input_method->context->resource, language);
}
}
@@ -745,7 +745,7 @@ input_method_context_text_direction(struct wl_client *client,
}


-static const struct wl_input_method_context_interface context_implementation = {
+static const struct zwl_input_method_context1_interface context_implementation = {
input_method_context_destroy,
input_method_context_commit_string,
input_method_context_preedit_string,
@@ -794,7 +794,7 @@ input_method_context_create(struct text_input *input,
binding = input_method->input_method_binding;
context->resource =
wl_resource_create(wl_resource_get_client(binding),
- &wl_input_method_context_interface, 1, 0);
+ &zwl_input_method_context1_interface, 1, 0);
wl_resource_set_implementation(context->resource,
&context_implementation,
context, destroy_input_method_context);
@@ -804,7 +804,7 @@ input_method_context_create(struct text_input *input,
input_method->context = context;


- wl_input_method_send_activate(binding, context->resource);
+ zwl_input_method1_send_activate(binding, context->resource);
}

static void
@@ -848,7 +848,7 @@ bind_input_method(struct wl_client *client,
struct wl_resource *resource;

resource =
- wl_resource_create(client, &wl_input_method_interface, 1, id);
+ wl_resource_create(client, &zwl_input_method1_interface, 1, id);

if (input_method->input_method_binding != NULL) {
wl_resource_post_error(resource,
@@ -999,7 +999,7 @@ text_backend_seat_created(struct text_backend *text_backend,
input_method->text_backend = text_backend;

input_method->input_method_global =
- wl_global_create(ec->wl_display, &wl_input_method_interface, 1,
+ wl_global_create(ec->wl_display, &zwl_input_method1_interface, 1,
input_method, bind_input_method);

input_method->destroy_listener.notify = input_method_notifier_destroy;
--
2.4.3
Jan Arne Petersen
2015-11-04 13:22:52 UTC
Permalink
Post by Jonas Ådahl
---
Makefile.am | 17 ++-
clients/keyboard.c | 174 +++++++++++++-------------
clients/weston-simple-im.c | 122 +++++++++----------
desktop-shell/input-panel.c | 12 +-
ivi-shell/input-panel-ivi.c | 12 +-
protocol/input-method.xml | 291 --------------------------------------------
src/text-backend.c | 26 ++--
7 files changed, 186 insertions(+), 468 deletions(-)
delete mode 100644 protocol/input-method.xml
diff --git a/Makefile.am b/Makefile.am
index e14878e..6b2b3da 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -119,8 +119,8 @@ nodist_weston_SOURCES = \
protocol/text-cursor-position-server-protocol.h \
protocol/text-input-unstable-v1-protocol.c \
protocol/text-input-unstable-v1-server-protocol.h \
- protocol/input-method-protocol.c \
- protocol/input-method-server-protocol.h \
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-server-protocol.h \
protocol/workspaces-protocol.c \
protocol/workspaces-server-protocol.h \
protocol/presentation-timing-unstable-v1-protocol.c \
@@ -696,15 +696,15 @@ weston_keyboard_SOURCES = clients/keyboard.c
nodist_weston_keyboard_SOURCES = \
protocol/desktop-shell-client-protocol.h \
protocol/desktop-shell-protocol.c \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h
weston_keyboard_LDADD = libtoytoolkit.la
weston_keyboard_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_simple_im_SOURCES = clients/weston-simple-im.c
nodist_weston_simple_im_SOURCES = \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h
weston_simple_im_LDADD = $(CLIENT_LIBS)
weston_simple_im_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
@@ -755,8 +755,8 @@ BUILT_SOURCES += \
protocol/text-cursor-position-protocol.c \
protocol/text-input-unstable-v1-protocol.c \
protocol/text-input-unstable-v1-client-protocol.h \
- protocol/input-method-protocol.c \
- protocol/input-method-client-protocol.h \
+ protocol/input-method-unstable-v1-protocol.c \
+ protocol/input-method-unstable-v1-client-protocol.h \
protocol/desktop-shell-client-protocol.h \
protocol/desktop-shell-protocol.c \
protocol/scaler-client-protocol.h \
@@ -1342,7 +1342,6 @@ BUILT_SOURCES += \
EXTRA_DIST += \
protocol/desktop-shell.xml \
protocol/screenshooter.xml \
- protocol/input-method.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
diff --git a/clients/keyboard.c b/clients/keyboard.c
index 61cfda5..b524423 100644
--- a/clients/keyboard.c
+++ b/clients/keyboard.c
@@ -32,15 +32,15 @@
#include <cairo.h>
#include "window.h"
-#include "input-method-client-protocol.h"
+#include "input-method-unstable-v1-client-protocol.h"
#include "text-input-unstable-v1-client-protocol.h"
struct keyboard;
struct virtual_keyboard {
- struct wl_input_panel *input_panel;
- struct wl_input_method *input_method;
- struct wl_input_method_context *context;
+ struct zwl_input_panel1 *input_panel;
+ struct zwl_input_method1 *input_method;
+ struct zwl_input_method_context1 *context;
struct display *display;
struct output *output;
char *preedit_string;
@@ -427,11 +427,11 @@ virtual_keyboard_commit_preedit(struct virtual_keyboard *keyboard)
strlen(keyboard->preedit_string) == 0)
return;
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- keyboard->preedit_string);
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ keyboard->preedit_string);
if (keyboard->surrounding_text) {
surrounding_text = insert_text(keyboard->surrounding_text,
@@ -456,18 +456,18 @@ virtual_keyboard_send_preedit(struct virtual_keyboard *keyboard,
uint32_t index = strlen(keyboard->preedit_string);
if (keyboard->preedit_style)
- wl_input_method_context_preedit_styling(keyboard->context,
- 0,
- strlen(keyboard->preedit_string),
- keyboard->preedit_style);
+ zwl_input_method_context1_preedit_styling(keyboard->context,
+ 0,
+ strlen(keyboard->preedit_string),
+ keyboard->preedit_style);
if (cursor > 0)
index = cursor;
- wl_input_method_context_preedit_cursor(keyboard->context,
- index);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- keyboard->preedit_string,
- keyboard->preedit_string);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ index);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ keyboard->preedit_string,
+ keyboard->preedit_string);
}
static const char *
@@ -499,12 +499,12 @@ delete_before_cursor(struct virtual_keyboard *keyboard)
end = keyboard->surrounding_text + keyboard->surrounding_cursor;
- wl_input_method_context_delete_surrounding_text(keyboard->context,
- (start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
- end - start);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- "");
+ zwl_input_method_context1_delete_surrounding_text(keyboard->context,
+ (start - keyboard->surrounding_text) - keyboard->surrounding_cursor,
+ end - start);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ "");
/* Update surrounding text */
keyboard->surrounding_cursor = start - keyboard->surrounding_text;
@@ -571,10 +571,10 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Return, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Return, key_state, mod_mask);
break;
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
@@ -615,38 +615,38 @@ keyboard_handle_key(struct keyboard *keyboard, uint32_t time, const struct key *
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Tab, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Tab, key_state, mod_mask);
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Up, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Up, key_state, mod_mask);
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Left, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Left, key_state, mod_mask);
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Right, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Right, key_state, mod_mask);
break;
virtual_keyboard_commit_preedit(keyboard->keyboard);
- wl_input_method_context_keysym(keyboard->keyboard->context,
- display_get_serial(keyboard->keyboard->display),
- time,
- XKB_KEY_Down, key_state, mod_mask);
+ zwl_input_method_context1_keysym(keyboard->keyboard->context,
+ display_get_serial(keyboard->keyboard->display),
+ time,
+ XKB_KEY_Down, key_state, mod_mask);
break;
if (state != WL_POINTER_BUTTON_STATE_PRESSED)
@@ -750,7 +750,7 @@ touch_up_handler(struct widget *widget, struct input *input,
static void
handle_surrounding_text(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *text,
uint32_t cursor,
uint32_t anchor)
@@ -765,7 +765,7 @@ handle_surrounding_text(void *data,
static void
handle_reset(void *data,
- struct wl_input_method_context *context)
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;
@@ -779,7 +779,7 @@ handle_reset(void *data,
static void
handle_content_type(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t hint,
uint32_t purpose)
{
@@ -791,7 +791,7 @@ handle_content_type(void *data,
static void
handle_invoke_action(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t button,
uint32_t index)
{
@@ -805,7 +805,7 @@ handle_invoke_action(void *data,
static void
handle_commit_state(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t serial)
{
struct virtual_keyboard *keyboard = data;
@@ -822,15 +822,19 @@ handle_commit_state(void *data,
layout->columns * key_width,
layout->rows * key_height);
- wl_input_method_context_language(context, keyboard->serial, layout->language);
- wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
+ zwl_input_method_context1_language(context,
+ keyboard->serial,
+ layout->language);
+ zwl_input_method_context1_text_direction(context,
+ keyboard->serial,
+ layout->text_direction);
widget_schedule_redraw(keyboard->keyboard->widget);
}
static void
handle_preferred_language(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *language)
{
struct virtual_keyboard *keyboard = data;
@@ -844,7 +848,7 @@ handle_preferred_language(void *data,
keyboard->preferred_language = strdup(language);
}
-static const struct wl_input_method_context_listener input_method_context_listener = {
+static const struct zwl_input_method_context1_listener input_method_context_listener = {
handle_surrounding_text,
handle_reset,
handle_content_type,
@@ -855,8 +859,8 @@ static const struct wl_input_method_context_listener input_method_context_listen
static void
input_method_activate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;
struct wl_array modifiers_map;
@@ -865,7 +869,7 @@ input_method_activate(void *data,
keyboard->keyboard->state = KEYBOARD_STATE_DEFAULT;
if (keyboard->context)
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
if (keyboard->preedit_string)
free(keyboard->preedit_string);
@@ -881,15 +885,15 @@ input_method_activate(void *data,
keyboard->serial = 0;
keyboard->context = context;
- wl_input_method_context_add_listener(context,
- &input_method_context_listener,
- keyboard);
+ zwl_input_method_context1_add_listener(context,
+ &input_method_context_listener,
+ keyboard);
wl_array_init(&modifiers_map);
keysym_modifiers_add(&modifiers_map, "Shift");
keysym_modifiers_add(&modifiers_map, "Control");
keysym_modifiers_add(&modifiers_map, "Mod1");
- wl_input_method_context_modifiers_map(context, &modifiers_map);
+ zwl_input_method_context1_modifiers_map(context, &modifiers_map);
keyboard->keysym.shift_mask = keysym_modifiers_get_mask(&modifiers_map, "Shift");
wl_array_release(&modifiers_map);
@@ -899,27 +903,31 @@ input_method_activate(void *data,
layout->columns * key_width,
layout->rows * key_height);
- wl_input_method_context_language(context, keyboard->serial, layout->language);
- wl_input_method_context_text_direction(context, keyboard->serial, layout->text_direction);
+ zwl_input_method_context1_language(context,
+ keyboard->serial,
+ layout->language);
+ zwl_input_method_context1_text_direction(context,
+ keyboard->serial,
+ layout->text_direction);
widget_schedule_redraw(keyboard->keyboard->widget);
}
static void
input_method_deactivate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct virtual_keyboard *keyboard = data;
if (!keyboard->context)
return;
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
keyboard->context = NULL;
}
-static const struct wl_input_method_listener input_method_listener = {
+static const struct zwl_input_method1_listener input_method_listener = {
input_method_activate,
input_method_deactivate
};
@@ -930,14 +938,16 @@ global_handler(struct display *display, uint32_t name,
{
struct virtual_keyboard *keyboard = data;
- if (!strcmp(interface, "wl_input_panel")) {
+ if (!strcmp(interface, "zwl_input_panel1")) {
keyboard->input_panel =
- display_bind(display, name, &wl_input_panel_interface, 1);
- } else if (!strcmp(interface, "wl_input_method")) {
+ display_bind(display, name, &zwl_input_panel1_interface, 1);
+ } else if (!strcmp(interface, "zwl_input_method1")) {
keyboard->input_method =
display_bind(display, name,
- &wl_input_method_interface, 1);
- wl_input_method_add_listener(keyboard->input_method, &input_method_listener, keyboard);
+ &zwl_input_method1_interface, 1);
+ zwl_input_method1_add_listener(keyboard->input_method,
+ &input_method_listener,
+ keyboard);
}
}
@@ -946,7 +956,7 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
{
struct keyboard *keyboard;
const struct layout *layout;
- struct wl_input_panel_surface *ips;
+ struct zwl_input_panel_surface1 *ips;
layout = get_current_layout(virtual_keyboard);
@@ -971,12 +981,12 @@ keyboard_create(struct output *output, struct virtual_keyboard *virtual_keyboard
layout->rows * key_height);
- ips = wl_input_panel_get_input_panel_surface(virtual_keyboard->input_panel,
- window_get_wl_surface(keyboard->window));
+ ips = zwl_input_panel1_get_input_panel_surface(virtual_keyboard->input_panel,
+ window_get_wl_surface(keyboard->window));
- wl_input_panel_surface_set_toplevel(ips,
- output_get_wl_output(output),
- WL_INPUT_PANEL_SURFACE_POSITION_CENTER_BOTTOM);
+ zwl_input_panel_surface1_set_toplevel(ips,
+ output_get_wl_output(output),
+ ZWL_INPUT_PANEL_SURFACE1_POSITION_CENTER_BOTTOM);
}
int
diff --git a/clients/weston-simple-im.c b/clients/weston-simple-im.c
index 0e68d48..304ba6e 100644
--- a/clients/weston-simple-im.c
+++ b/clients/weston-simple-im.c
@@ -33,7 +33,7 @@
#include <linux/input.h>
#include "window.h"
-#include "input-method-client-protocol.h"
+#include "input-method-unstable-v1-client-protocol.h"
enum compose_state {
state_normal,
@@ -54,8 +54,8 @@ typedef void (*keyboard_input_key_handler_t)(struct simple_im *keyboard,
enum wl_keyboard_key_state state);
struct simple_im {
- struct wl_input_method *input_method;
- struct wl_input_method_context *context;
+ struct zwl_input_method1 *input_method;
+ struct zwl_input_method_context1 *context;
struct wl_display *display;
struct wl_registry *registry;
struct wl_keyboard *keyboard;
@@ -105,7 +105,7 @@ static const uint32_t ignore_keys_on_compose[] = {
static void
handle_surrounding_text(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *text,
uint32_t cursor,
uint32_t anchor)
@@ -115,7 +115,7 @@ handle_surrounding_text(void *data,
static void
handle_reset(void *data,
- struct wl_input_method_context *context)
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;
@@ -126,7 +126,7 @@ handle_reset(void *data,
static void
handle_content_type(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t hint,
uint32_t purpose)
{
@@ -134,7 +134,7 @@ handle_content_type(void *data,
static void
handle_invoke_action(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t button,
uint32_t index)
{
@@ -142,7 +142,7 @@ handle_invoke_action(void *data,
static void
handle_commit_state(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
uint32_t serial)
{
struct simple_im *keyboard = data;
@@ -152,12 +152,12 @@ handle_commit_state(void *data,
static void
handle_preferred_language(void *data,
- struct wl_input_method_context *context,
+ struct zwl_input_method_context1 *context,
const char *language)
{
}
-static const struct wl_input_method_context_listener input_method_context_listener = {
+static const struct zwl_input_method_context1_listener input_method_context_listener = {
handle_surrounding_text,
handle_reset,
handle_content_type,
@@ -256,7 +256,7 @@ input_method_keyboard_modifiers(void *data,
uint32_t group)
{
struct simple_im *keyboard = data;
- struct wl_input_method_context *context = keyboard->context;
+ struct zwl_input_method_context1 *context = keyboard->context;
xkb_mod_mask_t mask;
xkb_state_update_mask(keyboard->state, mods_depressed,
@@ -273,9 +273,9 @@ input_method_keyboard_modifiers(void *data,
if (mask & keyboard->shift_mask)
keyboard->modifiers |= MOD_SHIFT_MASK;
- wl_input_method_context_modifiers(context, serial,
- mods_depressed, mods_depressed,
- mods_latched, group);
+ zwl_input_method_context1_modifiers(context, serial,
+ mods_depressed, mods_depressed,
+ mods_latched, group);
}
static const struct wl_keyboard_listener input_method_keyboard_listener = {
@@ -288,23 +288,23 @@ static const struct wl_keyboard_listener input_method_keyboard_listener = {
static void
input_method_activate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;
if (keyboard->context)
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
keyboard->compose_state = state_normal;
keyboard->serial = 0;
keyboard->context = context;
- wl_input_method_context_add_listener(context,
+ zwl_input_method_context1_add_listener(context,
&input_method_context_listener,
keyboard);
- keyboard->keyboard = wl_input_method_context_grab_keyboard(context);
+ keyboard->keyboard = zwl_input_method_context1_grab_keyboard(context);
wl_keyboard_add_listener(keyboard->keyboard,
&input_method_keyboard_listener,
keyboard);
@@ -312,19 +312,19 @@ input_method_activate(void *data,
static void
input_method_deactivate(void *data,
- struct wl_input_method *input_method,
- struct wl_input_method_context *context)
+ struct zwl_input_method1 *input_method,
+ struct zwl_input_method_context1 *context)
{
struct simple_im *keyboard = data;
if (!keyboard->context)
return;
- wl_input_method_context_destroy(keyboard->context);
+ zwl_input_method_context1_destroy(keyboard->context);
keyboard->context = NULL;
}
-static const struct wl_input_method_listener input_method_listener = {
+static const struct zwl_input_method1_listener input_method_listener = {
input_method_activate,
input_method_deactivate
};
@@ -335,12 +335,12 @@ registry_handle_global(void *data, struct wl_registry *registry,
{
struct simple_im *keyboard = data;
- if (!strcmp(interface, "wl_input_method")) {
+ if (!strcmp(interface, "zwl_input_method1")) {
keyboard->input_method =
wl_registry_bind(registry, name,
- &wl_input_method_interface, 1);
- wl_input_method_add_listener(keyboard->input_method,
- &input_method_listener, keyboard);
+ &zwl_input_method1_interface, 1);
+ zwl_input_method1_add_listener(keyboard->input_method,
+ &input_method_listener, keyboard);
}
}
@@ -379,7 +379,7 @@ simple_im_key_handler(struct simple_im *keyboard,
uint32_t serial, uint32_t time, uint32_t key, uint32_t sym,
enum wl_keyboard_key_state state)
{
- struct wl_input_method_context *context = keyboard->context;
+ struct zwl_input_method_context1 *context = keyboard->context;
char text[64];
if (sym == XKB_KEY_Multi_key &&
@@ -399,7 +399,7 @@ simple_im_key_handler(struct simple_im *keyboard,
for (i = 0; i < sizeof(ignore_keys_on_compose) / sizeof(ignore_keys_on_compose[0]); i++) {
if (sym == ignore_keys_on_compose[i]) {
- wl_input_method_context_key(context, keyboard->serial, time, key, state);
+ zwl_input_method_context1_key(context, keyboard->serial, time, key, state);
return;
}
}
@@ -414,16 +414,16 @@ simple_im_key_handler(struct simple_im *keyboard,
if (cs) {
if (cs->keys[i + 1] == 0) {
- wl_input_method_context_preedit_cursor(keyboard->context,
- 0);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- "", "");
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- cs->text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ 0);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ "", "");
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ cs->text);
keyboard->compose_state = state_normal;
} else {
uint32_t j = 0, idx = 0;
@@ -432,12 +432,12 @@ simple_im_key_handler(struct simple_im *keyboard,
idx += xkb_keysym_to_utf8(cs->keys[j], text + idx, sizeof(text) - idx);
}
- wl_input_method_context_preedit_cursor(keyboard->context,
- strlen(text));
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- text,
- text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ strlen(text));
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ text,
+ text);
}
} else {
uint32_t j = 0, idx = 0;
@@ -445,34 +445,34 @@ simple_im_key_handler(struct simple_im *keyboard,
for (; j <= i; j++) {
idx += xkb_keysym_to_utf8(keyboard->compose_seq.keys[j], text + idx, sizeof(text) - idx);
}
- wl_input_method_context_preedit_cursor(keyboard->context,
- 0);
- wl_input_method_context_preedit_string(keyboard->context,
- keyboard->serial,
- "", "");
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- text);
+ zwl_input_method_context1_preedit_cursor(keyboard->context,
+ 0);
+ zwl_input_method_context1_preedit_string(keyboard->context,
+ keyboard->serial,
+ "", "");
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ text);
keyboard->compose_state = state_normal;
}
return;
}
if (xkb_keysym_to_utf8(sym, text, sizeof(text)) <= 0) {
- wl_input_method_context_key(context, serial, time, key, state);
+ zwl_input_method_context1_key(context, serial, time, key, state);
return;
}
if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
return;
- wl_input_method_context_cursor_position(keyboard->context,
- 0, 0);
- wl_input_method_context_commit_string(keyboard->context,
- keyboard->serial,
- text);
+ zwl_input_method_context1_cursor_position(keyboard->context,
+ 0, 0);
+ zwl_input_method_context1_commit_string(keyboard->context,
+ keyboard->serial,
+ text);
}
int
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
index 95d6287..f5342aa 100644
--- a/desktop-shell/input-panel.c
+++ b/desktop-shell/input-panel.c
@@ -31,7 +31,7 @@
#include "shell.h"
#include "desktop-shell-server-protocol.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
struct input_panel_surface {
@@ -290,7 +290,7 @@ input_panel_surface_set_overlay_panel(struct wl_client *client,
input_panel_surface->panel = 1;
}
-static const struct wl_input_panel_surface_interface input_panel_surface_implementation = {
+static const struct zwl_input_panel_surface1_interface input_panel_surface_implementation = {
input_panel_surface_set_toplevel,
input_panel_surface_set_overlay_panel
};
@@ -332,14 +332,14 @@ input_panel_get_input_panel_surface(struct wl_client *client,
ipsurf->resource =
wl_resource_create(client,
- &wl_input_panel_surface_interface, 1, id);
+ &zwl_input_panel_surface1_interface, 1, id);
wl_resource_set_implementation(ipsurf->resource,
&input_panel_surface_implementation,
ipsurf,
destroy_input_panel_surface_resource);
}
-static const struct wl_input_panel_interface input_panel_implementation = {
+static const struct zwl_input_panel1_interface input_panel_implementation = {
input_panel_get_input_panel_surface
};
@@ -359,7 +359,7 @@ bind_input_panel(struct wl_client *client,
struct wl_resource *resource;
resource = wl_resource_create(client,
- &wl_input_panel_interface, 1, id);
+ &zwl_input_panel1_interface, 1, id);
if (shell->input_panel.binding == NULL) {
wl_resource_set_implementation(resource,
@@ -398,7 +398,7 @@ input_panel_setup(struct desktop_shell *shell)
wl_list_init(&shell->input_panel.surfaces);
if (wl_global_create(shell->compositor->wl_display,
- &wl_input_panel_interface, 1,
+ &zwl_input_panel1_interface, 1,
shell, bind_input_panel) == NULL)
return -1;
diff --git a/ivi-shell/input-panel-ivi.c b/ivi-shell/input-panel-ivi.c
index ecd497e..359bd7f 100644
--- a/ivi-shell/input-panel-ivi.c
+++ b/ivi-shell/input-panel-ivi.c
@@ -32,7 +32,7 @@
#include <string.h>
#include "ivi-shell.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "ivi-layout-private.h"
#include "shared/helpers.h"
@@ -282,7 +282,7 @@ input_panel_surface_set_overlay_panel(struct wl_client *client,
input_panel_surface->panel = 1;
}
-static const struct wl_input_panel_surface_interface input_panel_surface_implementation = {
+static const struct zwl_input_panel_surface1_interface input_panel_surface_implementation = {
input_panel_surface_set_toplevel,
input_panel_surface_set_overlay_panel
};
@@ -324,14 +324,14 @@ input_panel_get_input_panel_surface(struct wl_client *client,
ipsurf->resource =
wl_resource_create(client,
- &wl_input_panel_surface_interface, 1, id);
+ &zwl_input_panel_surface1_interface, 1, id);
wl_resource_set_implementation(ipsurf->resource,
&input_panel_surface_implementation,
ipsurf,
destroy_input_panel_surface_resource);
}
-static const struct wl_input_panel_interface input_panel_implementation = {
+static const struct zwl_input_panel1_interface input_panel_implementation = {
input_panel_get_input_panel_surface
};
@@ -351,7 +351,7 @@ bind_input_panel(struct wl_client *client,
struct wl_resource *resource;
resource = wl_resource_create(client,
- &wl_input_panel_interface, 1, id);
+ &zwl_input_panel1_interface, 1, id);
if (shell->input_panel.binding == NULL) {
wl_resource_set_implementation(resource,
@@ -390,7 +390,7 @@ input_panel_setup(struct ivi_shell *shell)
wl_list_init(&shell->input_panel.surfaces);
if (wl_global_create(shell->compositor->wl_display,
- &wl_input_panel_interface, 1,
+ &zwl_input_panel1_interface, 1,
shell, bind_input_panel) == NULL)
return -1;
diff --git a/protocol/input-method.xml b/protocol/input-method.xml
deleted file mode 100644
index 657230c..0000000
--- a/protocol/input-method.xml
+++ /dev/null
@@ -1,291 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="input_method">
-
- <copyright>
- Copyright © 2012, 2013 Intel Corporation
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="wl_input_method_context" version="1">
- <description summary="input method context">
- Corresponds to a text input on input method side. An input method context
- is created on text input activation on the input method side. It allows to
- receive information about the text input from the application via events.
- Input method contexts do not keep state after deactivation and should be
- destroyed after deactivation is handled.
-
- Text is generally UTF-8 encoded, indices and lengths are in bytes.
-
- Serials are used to synchronize the state between the text input and
- an input method. New serials are sent by the text input in the
- commit_state request and are used by the input method to indicate
- the known text input state in events like preedit_string, commit_string,
- and keysym. The text input can then ignore events from the input method
- which are based on an outdated state (for example after a reset).
- </description>
-
- <request name="destroy" type="destructor"/>
-
- <request name="commit_string">
- <description summary="commit string">
- Send the commit string text for insertion to the application.
-
- The text to commit could be either just a single character after a key
- press or the result of some composing (pre-edit). It could be also an
- empty text when some text should be removed (see
- delete_surrounding_text) or when the input cursor should be moved (see
- cursor_position).
-
- Any previously set composing text will be removed.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- </request>
-
- <request name="preedit_string">
- <description summary="pre-edit string">
- Send the pre-edit string text to the application text input.
-
- The commit text can be used to replace the preedit text on reset (for
- example on unfocus).
-
- Also previously sent preedit_style and preedit_cursor requests are
- processed bt the text_input also.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="text" type="string"/>
- <arg name="commit" type="string"/>
- </request>
-
- <request name="preedit_styling">
- <description summary="pre-edit styling">
- Sets styling information on composing text. The style is applied for
- length in bytes from index relative to the beginning of
- the composing text (as byte offset). Multiple styles can
- be applied to a composing text.
-
- This request should be sent before sending preedit_string request.
- </description>
- <arg name="index" type="uint"/>
- <arg name="length" type="uint"/>
- <arg name="style" type="uint"/>
- </request>
-
- <request name="preedit_cursor">
- <description summary="pre-edit cursor">
- Sets the cursor position inside the composing text (as byte offset)
- relative to the start of the composing text.
-
- When index is negative no cursor should be displayed.
-
- This request should be sent before sending preedit_string request.
- </description>
- <arg name="index" type="int"/>
- </request>
-
- <request name="delete_surrounding_text">
- <description summary="delete text">
- This request will be handled on text_input side as part of a directly
- following commit_string request.
- </description>
- <arg name="index" type="int"/>
- <arg name="length" type="uint"/>
- </request>
-
- <request name="cursor_position">
- <description summary="set cursor to a new position">
- Sets the cursor and anchor to a new position. Index is the new cursor
- position in bytes (when >= 0 relative to the end of inserted text
- else relative to beginning of inserted text). Anchor is the new anchor
- position in bytes (when >= 0 relative to the end of inserted text, else
- relative to beginning of inserted text). When there should be no
- selected text anchor should be the same as index.
-
- This request will be handled on text_input side as part of a directly
- following commit_string request.
- </description>
- <arg name="index" type="int"/>
- <arg name="anchor" type="int"/>
- </request>
-
- <request name="modifiers_map">
- <arg name="map" type="array"/>
- </request>
-
- <request name="keysym">
- <description summary="keysym">
- Notify when a key event was sent. Key events should not be used for
- normal text input operations, which should be done with commit_string,
- delete_surrounfing_text, etc. The key event follows the wl_keyboard key
- event convention. Sym is a XKB keysym, state a wl_keyboard key_state.
- </description>
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="time" type="uint"/>
- <arg name="sym" type="uint"/>
- <arg name="state" type="uint"/>
- <arg name="modifiers" type="uint"/>
- </request>
-
- <request name="grab_keyboard">
- <description summary="grab hardware keyboard">
- Allows an input method to receive hardware keyboard input and process
- key events to generate text events (with pre-edit) over the wire. This
- allows input methods which compose multiple key events for inputting
- text like it is done for CJK languages.
- </description>
- <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
- </request>
-
- <request name="key">
- <description summary="forward key event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::key event is not processed by the input
- method itself and should be sent to the client instead, forward it
- with this request. The arguments should be the ones from the
- wl_keyboard::key event.
-
- For generating custom key events use the keysym request instead.
- </description>
- <arg name="serial" type="uint" summary="serial from wl_keyboard::key"/>
- <arg name="time" type="uint" summary="time from wl_keyboard::key"/>
- <arg name="key" type="uint" summary="key from wl_keyboard::key"/>
- <arg name="state" type="uint" summary="state from wl_keyboard::key"/>
- </request>
-
- <request name="modifiers">
- <description summary="forward modifiers event">
- Should be used when filtering key events with grab_keyboard.
-
- When the wl_keyboard::modifiers event should be also send to the
- client, forward it with this request. The arguments should be the ones
- from the wl_keyboard::modifiers event.
- </description>
- <arg name="serial" type="uint" summary="serial from wl_keyboard::modifiers"/>
- <arg name="mods_depressed" type="uint" summary="mods_depressed from wl_keyboard::modifiers"/>
- <arg name="mods_latched" type="uint" summary="mods_latched from wl_keyboard::modifiers"/>
- <arg name="mods_locked" type="uint" summary="mods_locked from wl_keyboard::modifiers"/>
- <arg name="group" type="uint" summary="group from wl_keyboard::modifiers"/>
- </request>
-
- <request name="language">
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="language" type="string"/>
- </request>
- <request name="text_direction">
- <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
- <arg name="direction" type="uint"/>
- </request>
-
- <event name="surrounding_text">
- <description summary="surrounding text event">
- The plain surrounding text around the input position. Cursor is the
- position in bytes within the surrounding text relative to the beginning
- of the text. Anchor is the position in bytes of the selection anchor
- within the surrounding text relative to the beginning of the text. If
- there is no selected text anchor is the same as cursor.
- </description>
- <arg name="text" type="string"/>
- <arg name="cursor" type="uint"/>
- <arg name="anchor" type="uint"/>
- </event>
-
- <event name="reset">
- </event>
-
- <event name="content_type">
- <arg name="hint" type="uint"/>
- <arg name="purpose" type="uint"/>
- </event>
-
- <event name="invoke_action">
- <arg name="button" type="uint"/>
- <arg name="index" type="uint"/>
- </event>
-
- <event name="commit_state">
- <arg name="serial" type="uint" summary="serial of text input state"/>
- </event>
-
- <event name="preferred_language">
- <arg name="language" type="string"/>
- </event>
- </interface>
-
- <interface name="wl_input_method" version="1">
- <description summary="input method">
- An input method object is responsible to compose text in response to
- input from hardware or virtual keyboards. There is one input method
- object per seat. On activate there is a new input method context object
- created which allows the input method to communicate with the text input.
- </description>
-
- <event name="activate">
- <description summary="activate event">
- A text input was activated. Creates an input method context object
- which allows communication with the text input.
- </description>
- <arg name="id" type="new_id" interface="wl_input_method_context"/>
- </event>
-
- <event name="deactivate">
- <description summary="deactivate event">
- The text input corresponding to the context argument was deactivated.
- The input method context should be destroyed after deactivation is
- handled.
- </description>
- <arg name="context" type="object" interface="wl_input_method_context"/>
- </event>
- </interface>
-
- <interface name="wl_input_panel" version="1">
- <description summary="interface for implementing keyboards">
- Only one client can bind this interface at a time.
- </description>
-
- <request name="get_input_panel_surface">
- <arg name="id" type="new_id" interface="wl_input_panel_surface"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
- </interface>
-
- <interface name="wl_input_panel_surface" version="1">
- <enum name="position">
- <entry name="center_bottom" value="0"/>
- </enum>
-
- <request name="set_toplevel">
- <description summary="set the surface type as a keyboard">
- A keyboard surface is only shown when a text input is active.
- </description>
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="position" type="uint"/>
- </request>
-
- <request name="set_overlay_panel">
- <description summary="set the surface type as an overlay panel">
- An overlay panel is shown near the input cursor above the application
- window when a text input is active.
- </description>
- </request>
- </interface>
-
-</protocol>
diff --git a/src/text-backend.c b/src/text-backend.c
index 5227b97..9fb5bef 100644
--- a/src/text-backend.c
+++ b/src/text-backend.c
@@ -34,7 +34,7 @@
#include "compositor.h"
#include "text-input-unstable-v1-server-protocol.h"
-#include "input-method-server-protocol.h"
+#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
struct text_input_manager;
@@ -127,7 +127,7 @@ deactivate_input_method(struct input_method *input_method)
if (input_method->context && input_method->input_method_binding) {
input_method_context_end_keyboard_grab(input_method->context);
- wl_input_method_send_deactivate(
+ zwl_input_method1_send_deactivate(
input_method->input_method_binding,
input_method->context->resource);
}
@@ -172,7 +172,7 @@ text_input_set_surrounding_text(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_surrounding_text(
+ zwl_input_method_context1_send_surrounding_text(
input_method->context->resource, text, cursor, anchor);
}
}
@@ -245,7 +245,7 @@ text_input_reset(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_reset(
+ zwl_input_method_context1_send_reset(
input_method->context->resource);
}
}
@@ -283,7 +283,7 @@ text_input_set_content_type(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_content_type(
+ zwl_input_method_context1_send_content_type(
input_method->context->resource, hint, purpose);
}
}
@@ -301,7 +301,7 @@ text_input_invoke_action(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_invoke_action(
+ zwl_input_method_context1_send_invoke_action(
input_method->context->resource, button, index);
}
}
@@ -318,7 +318,7 @@ text_input_commit_state(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_commit_state(
+ zwl_input_method_context1_send_commit_state(
input_method->context->resource, serial);
}
}
@@ -368,7 +368,7 @@ text_input_set_preferred_language(struct wl_client *client,
&text_input->input_methods, link) {
if (!input_method->context)
continue;
- wl_input_method_context_send_preferred_language(
+ zwl_input_method_context1_send_preferred_language(
input_method->context->resource, language);
}
}
@@ -745,7 +745,7 @@ input_method_context_text_direction(struct wl_client *client,
}
-static const struct wl_input_method_context_interface context_implementation = {
+static const struct zwl_input_method_context1_interface context_implementation = {
input_method_context_destroy,
input_method_context_commit_string,
input_method_context_preedit_string,
@@ -794,7 +794,7 @@ input_method_context_create(struct text_input *input,
binding = input_method->input_method_binding;
context->resource =
wl_resource_create(wl_resource_get_client(binding),
- &wl_input_method_context_interface, 1, 0);
+ &zwl_input_method_context1_interface, 1, 0);
wl_resource_set_implementation(context->resource,
&context_implementation,
context, destroy_input_method_context);
@@ -804,7 +804,7 @@ input_method_context_create(struct text_input *input,
input_method->context = context;
- wl_input_method_send_activate(binding, context->resource);
+ zwl_input_method1_send_activate(binding, context->resource);
}
static void
@@ -848,7 +848,7 @@ bind_input_method(struct wl_client *client,
struct wl_resource *resource;
resource =
- wl_resource_create(client, &wl_input_method_interface, 1, id);
+ wl_resource_create(client, &zwl_input_method1_interface, 1, id);
if (input_method->input_method_binding != NULL) {
wl_resource_post_error(resource,
@@ -999,7 +999,7 @@ text_backend_seat_created(struct text_backend *text_backend,
input_method->text_backend = text_backend;
input_method->input_method_global =
- wl_global_create(ec->wl_display, &wl_input_method_interface, 1,
+ wl_global_create(ec->wl_display, &zwl_input_method1_interface, 1,
input_method, bind_input_method);
input_method->destroy_listener.notify = input_method_notifier_destroy;
--
Jan Arne Petersen | ***@kdab.com | Senior Software Engineer
KDAB (Deutschland) GmbH&Co KG, a KDAB Group company
Tel: +49-30-521325470
KDAB - The Qt Experts
Jonas Ådahl
2015-11-04 08:49:55 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 6b2b3da..66d133d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1414,13 +1414,21 @@ doc: $(DOXYGEN_INDICES)

.SECONDEXPANSION:

-protocol/%-unstable-v1-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+define protostability
+$(shell echo $1 | sed 's/.*\(\<unstable\>\|\<stable\>\).*/\1/')
+endef
+
+define protoname
+$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
+endef
+
+protocol/%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) code < $< > $@

-protocol/%-unstable-v1-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+protocol/%-server-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) server-header < $< > $@

-protocol/%-unstable-v1-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/unstable/$$*/$$*-unstable-v1.xml
+protocol/%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(wayland_scanner) client-header < $< > $@

protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
--
2.4.3
Jonas Ådahl
2015-11-04 08:49:56 UTC
Permalink
Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 29 ++-
protocol/xdg-shell.xml | 616 -------------------------------------------------
2 files changed, 14 insertions(+), 631 deletions(-)
delete mode 100644 protocol/xdg-shell.xml

diff --git a/Makefile.am b/Makefile.am
index 66d133d..46732e2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -473,8 +473,8 @@ demo_clients += \

weston_simple_shm_SOURCES = clients/simple-shm.c
nodist_weston_simple_shm_SOURCES = \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/ivi-application-protocol.c \
@@ -486,8 +486,8 @@ weston_simple_damage_SOURCES = clients/simple-damage.c
nodist_weston_simple_damage_SOURCES = \
protocol/scaler-protocol.c \
protocol/scaler-client-protocol.h \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h
weston_simple_damage_CFLAGS = $(AM_CFLAGS) $(SIMPLE_CLIENT_CFLAGS)
@@ -517,8 +517,8 @@ if BUILD_SIMPLE_EGL_CLIENTS
demo_clients += weston-simple-egl
weston_simple_egl_SOURCES = clients/simple-egl.c
nodist_weston_simple_egl_SOURCES = \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h
weston_simple_egl_CFLAGS = $(AM_CFLAGS) $(SIMPLE_EGL_CLIENT_CFLAGS)
@@ -529,8 +529,8 @@ if BUILD_SIMPLE_INTEL_DMABUF_CLIENT
demo_clients += weston-simple-dmabuf
weston_simple_dmabuf_SOURCES = clients/simple-dmabuf.c
nodist_weston_simple_dmabuf_SOURCES = \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/linux-dmabuf-unstable-v1-protocol.c \
@@ -556,8 +556,8 @@ nodist_libtoytoolkit_la_SOURCES = \
protocol/workspaces-client-protocol.h \
protocol/presentation-timing-unstable-v1-protocol.c \
protocol/presentation-timing-unstable-v1-client-protocol.h \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/ivi-application-protocol.c \
protocol/ivi-application-client-protocol.h

@@ -765,8 +765,8 @@ BUILT_SOURCES += \
protocol/workspaces-protocol.c \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
- protocol/xdg-shell-protocol.c \
- protocol/xdg-shell-client-protocol.h \
+ protocol/xdg-shell-unstable-v5-protocol.c \
+ protocol/xdg-shell-unstable-v5-client-protocol.h \
protocol/ivi-hmi-controller-protocol.c \
protocol/ivi-hmi-controller-client-protocol.h \
protocol/ivi-application-protocol.c \
@@ -841,8 +841,8 @@ desktop_shell_la_SOURCES = \
nodist_desktop_shell_la_SOURCES = \
protocol/desktop-shell-protocol.c \
protocol/desktop-shell-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

BUILT_SOURCES += $(nodist_desktop_shell_la_SOURCES)
endif
@@ -1345,7 +1345,6 @@ EXTRA_DIST += \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
- protocol/xdg-shell.xml \
protocol/scaler.xml \
protocol/ivi-application.xml \
protocol/ivi-hmi-controller.xml
diff --git a/protocol/xdg-shell.xml b/protocol/xdg-shell.xml
deleted file mode 100644
index 1d37e36..0000000
--- a/protocol/xdg-shell.xml
+++ /dev/null
@@ -1,616 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="xdg_shell">
-
- <copyright>
- Copyright © 2008-2013 Kristian Høgsberg
- Copyright © 2013 Rafael Antognolli
- Copyright © 2013 Jasper St. Pierre
- Copyright © 2010-2013 Intel Corporation
-
- Permission is hereby granted, free of charge, to any person obtaining a
- copy of this software and associated documentation files (the "Software"),
- to deal in the Software without restriction, including without limitation
- the rights to use, copy, modify, merge, publish, distribute, sublicense,
- and/or sell copies of the Software, and to permit persons to whom the
- Software is furnished to do so, subject to the following conditions:
-
- The above copyright notice and this permission notice (including the next
- paragraph) shall be included in all copies or substantial portions of the
- Software.
-
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- DEALINGS IN THE SOFTWARE.
- </copyright>
-
- <interface name="xdg_shell" version="1">
- <description summary="create desktop-style surfaces">
- xdg_shell allows clients to turn a wl_surface into a "real window"
- which can be dragged, resized, stacked, and moved around by the
- user. Everything about this interface is suited towards traditional
- desktop environments.
- </description>
-
- <enum name="version">
- <description summary="latest protocol version">
- The 'current' member of this enum gives the version of the
- protocol. Implementations can compare this to the version
- they implement using static_assert to ensure the protocol and
- implementation versions match.
- </description>
- <entry name="current" value="5" summary="Always the latest version"/>
- </enum>
-
- <enum name="error">
- <entry name="role" value="0" summary="given wl_surface has another role"/>
- <entry name="defunct_surfaces" value="1" summary="xdg_shell was destroyed before children"/>
- <entry name="not_the_topmost_popup" value="2" summary="the client tried to map or destroy a non-topmost popup"/>
- <entry name="invalid_popup_parent" value="3" summary="the client specified an invalid popup parent surface"/>
- </enum>
-
- <request name="destroy" type="destructor">
- <description summary="destroy xdg_shell">
- Destroy this xdg_shell object.
-
- Destroying a bound xdg_shell object while there are surfaces
- still alive created by this xdg_shell object instance is illegal
- and will result in a protocol error.
- </description>
- </request>
-
- <request name="use_unstable_version">
- <description summary="enable use of this unstable version">
- Negotiate the unstable version of the interface. This
- mechanism is in place to ensure client and server agree on the
- unstable versions of the protocol that they speak or exit
- cleanly if they don't agree. This request will go away once
- the xdg-shell protocol is stable.
- </description>
- <arg name="version" type="int"/>
- </request>
-
- <request name="get_xdg_surface">
- <description summary="create a shell surface from a surface">
- This creates an xdg_surface for the given surface and gives it the
- xdg_surface role. A wl_surface can only be given an xdg_surface role
- once. If get_xdg_surface is called with a wl_surface that already has
- an active xdg_surface associated with it, or if it had any other role,
- an error is raised.
-
- See the documentation of xdg_surface for more details about what an
- xdg_surface is and how it is used.
- </description>
- <arg name="id" type="new_id" interface="xdg_surface"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="get_xdg_popup">
- <description summary="create a popup for a surface">
- This creates an xdg_popup for the given surface and gives it the
- xdg_popup role. A wl_surface can only be given an xdg_popup role
- once. If get_xdg_popup is called with a wl_surface that already has
- an active xdg_popup associated with it, or if it had any other role,
- an error is raised.
-
- This request must be used in response to some sort of user action
- like a button press, key press, or touch down event.
-
- See the documentation of xdg_popup for more details about what an
- xdg_popup is and how it is used.
- </description>
- <arg name="id" type="new_id" interface="xdg_popup"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="parent" type="object" interface="wl_surface"/>
- <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
- <arg name="serial" type="uint" summary="the serial of the user event"/>
- <arg name="x" type="int"/>
- <arg name="y" type="int"/>
- </request>
-
- <event name="ping">
- <description summary="check if the client is alive">
- The ping event asks the client if it's still alive. Pass the
- serial specified in the event back to the compositor by sending
- a "pong" request back with the specified serial.
-
- Compositors can use this to determine if the client is still
- alive. It's unspecified what will happen if the client doesn't
- respond to the ping request, or in what timeframe. Clients should
- try to respond in a reasonable amount of time.
-
- A compositor is free to ping in any way it wants, but a client must
- always respond to any xdg_shell object it created.
- </description>
- <arg name="serial" type="uint" summary="pass this to the pong request"/>
- </event>
-
- <request name="pong">
- <description summary="respond to a ping event">
- A client must respond to a ping event with a pong request or
- the client may be deemed unresponsive.
- </description>
- <arg name="serial" type="uint" summary="serial of the ping event"/>
- </request>
- </interface>
-
- <interface name="xdg_surface" version="1">
- <description summary="A desktop window">
- An interface that may be implemented by a wl_surface, for
- implementations that provide a desktop-style user interface.
-
- It provides requests to treat surfaces like windows, allowing to set
- properties like maximized, fullscreen, minimized, and to move and resize
- them, and associate metadata like title and app id.
-
- The client must call wl_surface.commit on the corresponding wl_surface
- for the xdg_surface state to take effect. Prior to committing the new
- state, it can set up initial configuration, such as maximizing or setting
- a window geometry.
-
- Even without attaching a buffer the compositor must respond to initial
- committed configuration, for instance sending a configure event with
- expected window geometry if the client maximized its surface during
- initialization.
-
- For a surface to be mapped by the compositor the client must have
- committed both an xdg_surface state and a buffer.
- </description>
-
- <request name="destroy" type="destructor">
- <description summary="Destroy the xdg_surface">
- Unmap and destroy the window. The window will be effectively
- hidden from the user's point of view, and all state like
- maximization, fullscreen, and so on, will be lost.
- </description>
- </request>
-
- <request name="set_parent">
- <description summary="set the parent of this surface">
- Set the "parent" of this surface. This window should be stacked
- above a parent. The parent surface must be mapped as long as this
- surface is mapped.
-
- Parent windows should be set on dialogs, toolboxes, or other
- "auxiliary" surfaces, so that the parent is raised when the dialog
- is raised.
- </description>
- <arg name="parent" type="object" interface="xdg_surface" allow-null="true"/>
- </request>
-
- <request name="set_title">
- <description summary="set surface title">
- Set a short title for the surface.
-
- This string may be used to identify the surface in a task bar,
- window list, or other user interface elements provided by the
- compositor.
-
- The string must be encoded in UTF-8.
- </description>
- <arg name="title" type="string"/>
- </request>
-
- <request name="set_app_id">
- <description summary="set application ID">
- Set an application identifier for the surface.
-
- The app ID identifies the general class of applications to which
- the surface belongs. The compositor can use this to group multiple
- surfaces together, or to determine how to launch a new application.
-
- For D-Bus activatable applications, the app ID is used as the D-Bus
- service name.
-
- The compositor shell will try to group application surfaces together
- by their app ID. As a best practice, it is suggested to select app
- ID's that match the basename of the application's .desktop file.
- For example, "org.freedesktop.FooViewer" where the .desktop file is
- "org.freedesktop.FooViewer.desktop".
-
- See the desktop-entry specification [0] for more details on
- application identifiers and how they relate to well-known D-Bus
- names and .desktop files.
-
- [0] http://standards.freedesktop.org/desktop-entry-spec/
- </description>
- <arg name="app_id" type="string"/>
- </request>
-
- <request name="show_window_menu">
- <description summary="show the window menu">
- Clients implementing client-side decorations might want to show
- a context menu when right-clicking on the decorations, giving the
- user a menu that they can use to maximize or minimize the window.
-
- This request asks the compositor to pop up such a window menu at
- the given position, relative to the local surface coordinates of
- the parent surface. There are no guarantees as to what menu items
- the window menu contains.
-
- This request must be used in response to some sort of user action
- like a button press, key press, or touch down event.
- </description>
-
- <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
- <arg name="serial" type="uint" summary="the serial of the user event"/>
- <arg name="x" type="int" summary="the x position to pop up the window menu at"/>
- <arg name="y" type="int" summary="the y position to pop up the window menu at"/>
- </request>
-
- <request name="move">
- <description summary="start an interactive move">
- Start an interactive, user-driven move of the surface.
-
- This request must be used in response to some sort of user action
- like a button press, key press, or touch down event. The passed
- serial is used to determine the type of interactive move (touch,
- pointer, etc).
-
- The server may ignore move requests depending on the state of
- the surface (e.g. fullscreen or maximized), or if the passed serial
- is no longer valid.
-
- If triggered, the surface will lose the focus of the device
- (wl_pointer, wl_touch, etc) used for the move. It is up to the
- compositor to visually indicate that the move is taking place, such as
- updating a pointer cursor, during the move. There is no guarantee
- that the device focus will return when the move is completed.
- </description>
- <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
- <arg name="serial" type="uint" summary="the serial of the user event"/>
- </request>
-
- <enum name="resize_edge">
- <description summary="edge values for resizing">
- These values are used to indicate which edge of a surface
- is being dragged in a resize operation.
- </description>
- <entry name="none" value="0"/>
- <entry name="top" value="1"/>
- <entry name="bottom" value="2"/>
- <entry name="left" value="4"/>
- <entry name="top_left" value="5"/>
- <entry name="bottom_left" value="6"/>
- <entry name="right" value="8"/>
- <entry name="top_right" value="9"/>
- <entry name="bottom_right" value="10"/>
- </enum>
-
- <request name="resize">
- <description summary="start an interactive resize">
- Start a user-driven, interactive resize of the surface.
-
- This request must be used in response to some sort of user action
- like a button press, key press, or touch down event. The passed
- serial is used to determine the type of interactive resize (touch,
- pointer, etc).
-
- The server may ignore resize requests depending on the state of
- the surface (e.g. fullscreen or maximized).
-
- If triggered, the client will receive configure events with the
- "resize" state enum value and the expected sizes. See the "resize"
- enum value for more details about what is required. The client
- must also acknowledge configure events using "ack_configure". After
- the resize is completed, the client will receive another "configure"
- event without the resize state.
-
- If triggered, the surface also will lose the focus of the device
- (wl_pointer, wl_touch, etc) used for the resize. It is up to the
- compositor to visually indicate that the resize is taking place,
- such as updating a pointer cursor, during the resize. There is no
- guarantee that the device focus will return when the resize is
- completed.
-
- The edges parameter specifies how the surface should be resized,
- and is one of the values of the resize_edge enum. The compositor
- may use this information to update the surface position for
- example when dragging the top left corner. The compositor may also
- use this information to adapt its behavior, e.g. choose an
- appropriate cursor image.
- </description>
- <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
- <arg name="serial" type="uint" summary="the serial of the user event"/>
- <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
- </request>
-
- <enum name="state">
- <description summary="types of state on the surface">
- The different state values used on the surface. This is designed for
- state values like maximized, fullscreen. It is paired with the
- configure event to ensure that both the client and the compositor
- setting the state can be synchronized.
-
- States set in this way are double-buffered. They will get applied on
- the next commit.
-
- Desktop environments may extend this enum by taking up a range of
- values and documenting the range they chose in this description.
- They are not required to document the values for the range that they
- chose. Ideally, any good extensions from a desktop environment should
- make its way into standardization into this enum.
-
- The current reserved ranges are:
-
- 0x0000 - 0x0FFF: xdg-shell core values, documented below.
- 0x1000 - 0x1FFF: GNOME
- </description>
- <entry name="maximized" value="1" summary="the surface is maximized">
- The surface is maximized. The window geometry specified in the configure
- event must be obeyed by the client.
- </entry>
- <entry name="fullscreen" value="2" summary="the surface is fullscreen">
- The surface is fullscreen. The window geometry specified in the configure
- event must be obeyed by the client.
- </entry>
- <entry name="resizing" value="3">
- The surface is being resized. The window geometry specified in the
- configure event is a maximum; the client cannot resize beyond it.
- Clients that have aspect ratio or cell sizing configuration can use
- a smaller size, however.
- </entry>
- <entry name="activated" value="4">
- Client window decorations should be painted as if the window is
- active. Do not assume this means that the window actually has
- keyboard or pointer focus.
- </entry>
- </enum>
-
- <event name="configure">
- <description summary="suggest a surface change">
- The configure event asks the client to resize its surface or to
- change its state.
-
- The width and height arguments specify a hint to the window
- about how its surface should be resized in window geometry
- coordinates. See set_window_geometry.
-
- If the width or height arguments are zero, it means the client
- should decide its own window dimension. This may happen when the
- compositor need to configure the state of the surface but doesn't
- have any information about any previous or expected dimension.
-
- The states listed in the event specify how the width/height
- arguments should be interpreted, and possibly how it should be
- drawn.
-
- Clients should arrange their surface for the new size and
- states, and then send a ack_configure request with the serial
- sent in this configure event at some point before committing
- the new surface.
-
- If the client receives multiple configure events before it
- can respond to one, it is free to discard all but the last
- event it received.
- </description>
-
- <arg name="width" type="int"/>
- <arg name="height" type="int"/>
- <arg name="states" type="array"/>
- <arg name="serial" type="uint"/>
- </event>
-
- <request name="ack_configure">
- <description summary="ack a configure event">
- When a configure event is received, if a client commits the
- surface in response to the configure event, then the client
- must make an ack_configure request sometime before the commit
- request, passing along the serial of the configure event.
-
- For instance, the compositor might use this information to move
- a surface to the top left only when the client has drawn itself
- for the maximized or fullscreen state.
-
- If the client receives multiple configure events before it
- can respond to one, it only has to ack the last configure event.
-
- A client is not required to commit immediately after sending
- an ack_configure request - it may even ack_configure several times
- before its next surface commit.
-
- The compositor expects that the most recently received
- ack_configure request at the time of a commit indicates which
- configure event the client is responding to.
- </description>
- <arg name="serial" type="uint" summary="the serial from the configure event"/>
- </request>
-
- <request name="set_window_geometry">
- <description summary="set the new window geometry">
- The window geometry of a window is its "visible bounds" from the
- user's perspective. Client-side decorations often have invisible
- portions like drop-shadows which should be ignored for the
- purposes of aligning, placing and constraining windows.
-
- The window geometry is double buffered, and will be applied at the
- time wl_surface.commit of the corresponding wl_surface is called.
-
- Once the window geometry of the surface is set once, it is not
- possible to unset it, and it will remain the same until
- set_window_geometry is called again, even if a new subsurface or
- buffer is attached.
-
- If never set, the value is the full bounds of the surface,
- including any subsurfaces. This updates dynamically on every
- commit. This unset mode is meant for extremely simple clients.
-
- If responding to a configure event, the window geometry in here
- must respect the sizing negotiations specified by the states in
- the configure event.
-
- The arguments are given in the surface local coordinate space of
- the wl_surface associated with this xdg_surface.
-
- The width and height must be greater than zero.
- </description>
- <arg name="x" type="int"/>
- <arg name="y" type="int"/>
- <arg name="width" type="int"/>
- <arg name="height" type="int"/>
- </request>
-
- <request name="set_maximized">
- <description summary="maximize the window">
- Maximize the surface.
-
- After requesting that the surface should be maximized, the compositor
- will respond by emitting a configure event with the "maximized" state
- and the required window geometry. The client should then update its
- content, drawing it in a maximized state, i.e. without shadow or other
- decoration outside of the window geometry. The client must also
- acknowledge the configure when committing the new content (see
- ack_configure).
-
- It is up to the compositor to decide how and where to maximize the
- surface, for example which output and what region of the screen should
- be used.
-
- If the surface was already maximized, the compositor will still emit
- a configure event with the "maximized" state.
- </description>
- </request>
-
- <request name="unset_maximized">
- <description summary="unmaximize the window">
- Unmaximize the surface.
-
- After requesting that the surface should be unmaximized, the compositor
- will respond by emitting a configure event without the "maximized"
- state. If available, the compositor will include the window geometry
- dimensions the window had prior to being maximized in the configure
- request. The client must then update its content, drawing it in a
- regular state, i.e. potentially with shadow, etc. The client must also
- acknowledge the configure when committing the new content (see
- ack_configure).
-
- It is up to the compositor to position the surface after it was
- unmaximized; usually the position the surface had before maximizing, if
- applicable.
-
- If the surface was already not maximized, the compositor will still
- emit a configure event without the "maximized" state.
- </description>
- </request>
-
- <request name="set_fullscreen">
- <description summary="set the window as fullscreen on a monitor">
- Make the surface fullscreen.
-
- You can specify an output that you would prefer to be fullscreen.
- If this value is NULL, it's up to the compositor to choose which
- display will be used to map this surface.
-
- If the surface doesn't cover the whole output, the compositor will
- position the surface in the center of the output and compensate with
- black borders filling the rest of the output.
- </description>
- <arg name="output" type="object" interface="wl_output" allow-null="true"/>
- </request>
- <request name="unset_fullscreen" />
-
- <request name="set_minimized">
- <description summary="set the window as minimized">
- Request that the compositor minimize your surface. There is no
- way to know if the surface is currently minimized, nor is there
- any way to unset minimization on this surface.
-
- If you are looking to throttle redrawing when minimized, please
- instead use the wl_surface.frame event for this, as this will
- also work with live previews on windows in Alt-Tab, Expose or
- similar compositor features.
- </description>
- </request>
-
- <event name="close">
- <description summary="surface wants to be closed">
- The close event is sent by the compositor when the user
- wants the surface to be closed. This should be equivalent to
- the user clicking the close button in client-side decorations,
- if your application has any...
-
- This is only a request that the user intends to close your
- window. The client may choose to ignore this request, or show
- a dialog to ask the user to save their data...
- </description>
- </event>
- </interface>
-
- <interface name="xdg_popup" version="1">
- <description summary="short-lived, popup surfaces for menus">
- A popup surface is a short-lived, temporary surface that can be
- used to implement menus. It takes an explicit grab on the surface
- that will be dismissed when the user dismisses the popup. This can
- be done by the user clicking outside the surface, using the keyboard,
- or even locking the screen through closing the lid or a timeout.
-
- When the popup is dismissed, a popup_done event will be sent out,
- and at the same time the surface will be unmapped. The xdg_popup
- object is now inert and cannot be reactivated, so clients should
- destroy it. Explicitly destroying the xdg_popup object will also
- dismiss the popup and unmap the surface.
-
- Clients will receive events for all their surfaces during this
- grab (which is an "owner-events" grab in X11 parlance). This is
- done so that users can navigate through submenus and other
- "nested" popup windows without having to dismiss the topmost
- popup.
-
- Clients that want to dismiss the popup when another surface of
- their own is clicked should dismiss the popup using the destroy
- request.
-
- The parent surface must have either an xdg_surface or xdg_popup
- role.
-
- Specifying an xdg_popup for the parent means that the popups are
- nested, with this popup now being the topmost popup. Nested
- popups must be destroyed in the reverse order they were created
- in, e.g. the only popup you are allowed to destroy at all times
- is the topmost one.
-
- If there is an existing popup when creating a new popup, the
- parent must be the current topmost popup.
-
- A parent surface must be mapped before the new popup is mapped.
-
- When compositors choose to dismiss a popup, they will likely
- dismiss every nested popup as well. When a compositor dismisses
- popups, it will follow the same dismissing order as required
- from the client.
-
- The x and y arguments passed when creating the popup object specify
- where the top left of the popup should be placed, relative to the
- local surface coordinates of the parent surface. See
- xdg_shell.get_xdg_popup.
-
- The client must call wl_surface.commit on the corresponding wl_surface
- for the xdg_popup state to take effect.
-
- For a surface to be mapped by the compositor the client must have
- committed both the xdg_popup state and a buffer.
- </description>
-
- <request name="destroy" type="destructor">
- <description summary="remove xdg_popup interface">
- This destroys the popup. Explicitly destroying the xdg_popup
- object will also dismiss the popup, and unmap the surface.
-
- If this xdg_popup is not the "topmost" popup, a protocol error
- will be sent.
- </description>
- </request>
-
- <event name="popup_done">
- <description summary="popup interaction is done">
- The popup_done event is sent out when a popup is dismissed by the
- compositor. The client should destroy the xdg_popup object at this
- point.
- </description>
- </event>
-
- </interface>
-</protocol>
--
2.4.3
Pekka Paalanen
2015-11-05 14:06:28 UTC
Permalink
On Wed, 4 Nov 2015 16:49:56 +0800
Post by Jonas Ådahl
---
Makefile.am | 29 ++-
protocol/xdg-shell.xml | 616 -------------------------------------------------
2 files changed, 14 insertions(+), 631 deletions(-)
delete mode 100644 protocol/xdg-shell.xml
Acked-by: Pekka Paalanen <***@collabora.co.uk>

The xdg-shell version in wayland-protocols has no interface renamed,
like Daniel S. suggested. We talked about renaming this in irc, and that
will probably wait until there is something to actually break in the
protocol.


Thanks,
pq
Jonas Ådahl
2015-11-04 08:49:58 UTC
Permalink
Due to the effort of moving a way from non-prefixed protocols, rename
the weston specific screenshooter protocol to weston_screenshooter.

Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 14 +++++++-------
clients/screenshot.c | 21 +++++++++++++--------
protocol/screenshooter.xml | 12 ------------
protocol/weston-screenshooter.xml | 12 ++++++++++++
src/screenshooter.c | 12 ++++++------
5 files changed, 38 insertions(+), 33 deletions(-)
delete mode 100644 protocol/screenshooter.xml
create mode 100644 protocol/weston-screenshooter.xml

diff --git a/Makefile.am b/Makefile.am
index c2e7fcf..580f282 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -113,8 +113,8 @@ systemd_notify_la_SOURCES = \
endif

nodist_weston_SOURCES = \
- protocol/screenshooter-protocol.c \
- protocol/screenshooter-server-protocol.h \
+ protocol/weston-screenshooter-protocol.c \
+ protocol/weston-screenshooter-server-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-cursor-position-server-protocol.h \
protocol/text-input-unstable-v1-protocol.c \
@@ -577,8 +577,8 @@ weston_flower_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)
weston_screenshooter_SOURCES = \
clients/screenshot.c
nodist_weston_screenshooter_SOURCES = \
- protocol/screenshooter-protocol.c \
- protocol/screenshooter-client-protocol.h
+ protocol/weston-screenshooter-protocol.c \
+ protocol/weston-screenshooter-client-protocol.h
weston_screenshooter_LDADD = $(CLIENT_LIBS) libshared.la
weston_screenshooter_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

@@ -749,8 +749,8 @@ endif
endif

BUILT_SOURCES += \
- protocol/screenshooter-protocol.c \
- protocol/screenshooter-client-protocol.h \
+ protocol/weston-screenshooter-protocol.c \
+ protocol/weston-screenshooter-client-protocol.h \
protocol/text-cursor-position-client-protocol.h \
protocol/text-cursor-position-protocol.c \
protocol/text-input-unstable-v1-protocol.c \
@@ -1341,7 +1341,7 @@ BUILT_SOURCES += \

EXTRA_DIST += \
protocol/weston-desktop-shell.xml \
- protocol/screenshooter.xml \
+ protocol/weston-screenshooter.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
diff --git a/clients/screenshot.c b/clients/screenshot.c
index f11e3ba..18b5f88 100644
--- a/clients/screenshot.c
+++ b/clients/screenshot.c
@@ -36,7 +36,7 @@
#include <cairo.h>

#include <wayland-client.h>
-#include "screenshooter-client-protocol.h"
+#include "weston-screenshooter-client-protocol.h"
#include "shared/os-compatibility.h"

/* The screenshooter is a good example of a custom object exposed by
@@ -44,7 +44,7 @@
* side marshalling outside libwayland.so */

static struct wl_shm *shm;
-static struct screenshooter *screenshooter;
+static struct weston_screenshooter *screenshooter;
static struct wl_list output_list;
int min_x, min_y, max_x, max_y;
int buffer_copy_done;
@@ -118,12 +118,12 @@ static const struct wl_output_listener output_listener = {
};

static void
-screenshot_done(void *data, struct screenshooter *screenshooter)
+screenshot_done(void *data, struct weston_screenshooter *screenshooter)
{
buffer_copy_done = 1;
}

-static const struct screenshooter_listener screenshooter_listener = {
+static const struct weston_screenshooter_listener screenshooter_listener = {
screenshot_done
};

@@ -141,9 +141,10 @@ handle_global(void *data, struct wl_registry *registry,
wl_output_add_listener(output->output, &output_listener, output);
} else if (strcmp(interface, "wl_shm") == 0) {
shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
- } else if (strcmp(interface, "screenshooter") == 0) {
+ } else if (strcmp(interface, "weston_screenshooter") == 0) {
screenshooter = wl_registry_bind(registry, name,
- &screenshooter_interface, 1);
+ &weston_screenshooter_interface,
+ 1);
}
}

@@ -290,7 +291,9 @@ int main(int argc, char *argv[])
return -1;
}

- screenshooter_add_listener(screenshooter, &screenshooter_listener, screenshooter);
+ weston_screenshooter_add_listener(screenshooter,
+ &screenshooter_listener,
+ screenshooter);

if (set_buffer_size(&width, &height))
return -1;
@@ -298,7 +301,9 @@ int main(int argc, char *argv[])

wl_list_for_each(output, &output_list, link) {
output->buffer = create_shm_buffer(output->width, output->height, &output->data);
- screenshooter_shoot(screenshooter, output->output, output->buffer);
+ weston_screenshooter_shoot(screenshooter,
+ output->output,
+ output->buffer);
buffer_copy_done = 0;
while (!buffer_copy_done)
wl_display_roundtrip(display);
diff --git a/protocol/screenshooter.xml b/protocol/screenshooter.xml
deleted file mode 100644
index 76e3c85..0000000
--- a/protocol/screenshooter.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<protocol name="screenshooter">
-
- <interface name="screenshooter" version="1">
- <request name="shoot">
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="buffer" type="object" interface="wl_buffer"/>
- </request>
- <event name="done">
- </event>
- </interface>
-
-</protocol>
diff --git a/protocol/weston-screenshooter.xml b/protocol/weston-screenshooter.xml
new file mode 100644
index 0000000..8c4486c
--- /dev/null
+++ b/protocol/weston-screenshooter.xml
@@ -0,0 +1,12 @@
+<protocol name="weston_screenshooter">
+
+ <interface name="weston_screenshooter" version="1">
+ <request name="shoot">
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="buffer" type="object" interface="wl_buffer"/>
+ </request>
+ <event name="done">
+ </event>
+ </interface>
+
+</protocol>
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 6e1af65..d0ec00e 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -34,7 +34,7 @@
#include <sys/uio.h>

#include "compositor.h"
-#include "screenshooter-server-protocol.h"
+#include "weston-screenshooter-server-protocol.h"
#include "shared/helpers.h"

#include "wcap/wcap-decode.h"
@@ -223,7 +223,7 @@ screenshooter_done(void *data, enum weston_screenshooter_outcome outcome)

switch (outcome) {
case WESTON_SCREENSHOOTER_SUCCESS:
- screenshooter_send_done(resource);
+ weston_screenshooter_send_done(resource);
break;
case WESTON_SCREENSHOOTER_NO_MEMORY:
wl_resource_post_no_memory(resource);
@@ -252,7 +252,7 @@ screenshooter_shoot(struct wl_client *client,
weston_screenshooter_shoot(output, buffer, screenshooter_done, resource);
}

-struct screenshooter_interface screenshooter_implementation = {
+struct weston_screenshooter_interface screenshooter_implementation = {
screenshooter_shoot
};

@@ -264,7 +264,7 @@ bind_shooter(struct wl_client *client,
struct wl_resource *resource;

resource = wl_resource_create(client,
- &screenshooter_interface, 1, id);
+ &weston_screenshooter_interface, 1, id);

if (client != shooter->client) {
wl_resource_post_error(resource, WL_DISPLAY_ERROR_INVALID_OBJECT,
@@ -622,9 +622,9 @@ screenshooter_create(struct weston_compositor *ec)
shooter->client = NULL;

shooter->global = wl_global_create(ec->wl_display,
- &screenshooter_interface, 1,
+ &weston_screenshooter_interface, 1,
shooter, bind_shooter);
- weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER,
+ weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_CTRL,
screenshooter_binding, shooter);
weston_compositor_add_key_binding(ec, KEY_R, MODIFIER_SUPER,
recorder_binding, shooter);
--
2.4.3
Pekka Paalanen
2015-11-05 14:35:15 UTC
Permalink
On Wed, 4 Nov 2015 16:49:58 +0800
Post by Jonas Ådahl
Due to the effort of moving a way from non-prefixed protocols, rename
the weston specific screenshooter protocol to weston_screenshooter.
---
Makefile.am | 14 +++++++-------
clients/screenshot.c | 21 +++++++++++++--------
protocol/screenshooter.xml | 12 ------------
protocol/weston-screenshooter.xml | 12 ++++++++++++
src/screenshooter.c | 12 ++++++------
5 files changed, 38 insertions(+), 33 deletions(-)
delete mode 100644 protocol/screenshooter.xml
create mode 100644 protocol/weston-screenshooter.xml
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 6e1af65..d0ec00e 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -622,9 +622,9 @@ screenshooter_create(struct weston_compositor *ec)
shooter->client = NULL;
shooter->global = wl_global_create(ec->wl_display,
- &screenshooter_interface, 1,
+ &weston_screenshooter_interface, 1,
shooter, bind_shooter);
- weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER,
+ weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_CTRL,
Oops? :-)

Otherwise
Acked-by: Pekka Paalanen <***@collabora.co.uk>


Thanks,
pq
Jonas Ådahl
2015-11-06 02:54:38 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:58 +0800
Post by Jonas Ådahl
Due to the effort of moving a way from non-prefixed protocols, rename
the weston specific screenshooter protocol to weston_screenshooter.
---
Makefile.am | 14 +++++++-------
clients/screenshot.c | 21 +++++++++++++--------
protocol/screenshooter.xml | 12 ------------
protocol/weston-screenshooter.xml | 12 ++++++++++++
src/screenshooter.c | 12 ++++++------
5 files changed, 38 insertions(+), 33 deletions(-)
delete mode 100644 protocol/screenshooter.xml
create mode 100644 protocol/weston-screenshooter.xml
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 6e1af65..d0ec00e 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -622,9 +622,9 @@ screenshooter_create(struct weston_compositor *ec)
shooter->client = NULL;
shooter->global = wl_global_create(ec->wl_display,
- &screenshooter_interface, 1,
+ &weston_screenshooter_interface, 1,
shooter, bind_shooter);
- weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_SUPER,
+ weston_compositor_add_key_binding(ec, KEY_S, MODIFIER_CTRL,
Oops? :-)
Oops indeed (MODIFIER_SUPER tends to never work on a nested weston in
gnome shell). Sorry about that.


Jonas
Post by Pekka Paalanen
Otherwise
Thanks,
pq
Jonas Ådahl
2015-11-04 08:49:57 UTC
Permalink
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.

This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.

Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 20 +++---
clients/desktop-shell.c | 79 +++++++++++-----------
desktop-shell/input-panel.c | 2 +-
desktop-shell/shell.c | 70 ++++++++++---------
desktop-shell/shell.h | 4 +-
protocol/desktop-shell.xml | 138 --------------------------------------
protocol/weston-desktop-shell.xml | 134 ++++++++++++++++++++++++++++++++++++
7 files changed, 224 insertions(+), 223 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
create mode 100644 protocol/weston-desktop-shell.xml

diff --git a/Makefile.am b/Makefile.am
index 46732e2..c2e7fcf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -693,9 +693,9 @@ weston_editor_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS) $(PANGO_CFLAGS)
endif

weston_keyboard_SOURCES = clients/keyboard.c
-nodist_weston_keyboard_SOURCES = \
- protocol/desktop-shell-client-protocol.h \
- protocol/desktop-shell-protocol.c \
+nodist_weston_keyboard_SOURCES = \
+ protocol/weston-desktop-shell-client-protocol.h \
+ protocol/weston-desktop-shell-protocol.c \
protocol/input-method-unstable-v1-protocol.c \
protocol/input-method-unstable-v1-client-protocol.h
weston_keyboard_LDADD = libtoytoolkit.la
@@ -721,8 +721,8 @@ weston_desktop_shell_SOURCES = \
clients/desktop-shell.c \
shared/helpers.h
nodist_weston_desktop_shell_SOURCES = \
- protocol/desktop-shell-client-protocol.h \
- protocol/desktop-shell-protocol.c
+ protocol/weston-desktop-shell-client-protocol.h \
+ protocol/weston-desktop-shell-protocol.c
weston_desktop_shell_LDADD = libtoytoolkit.la
weston_desktop_shell_CFLAGS = $(AM_CFLAGS) $(CLIENT_CFLAGS)

@@ -757,8 +757,8 @@ BUILT_SOURCES += \
protocol/text-input-unstable-v1-client-protocol.h \
protocol/input-method-unstable-v1-protocol.c \
protocol/input-method-unstable-v1-client-protocol.h \
- protocol/desktop-shell-client-protocol.h \
- protocol/desktop-shell-protocol.c \
+ protocol/weston-desktop-shell-client-protocol.h \
+ protocol/weston-desktop-shell-protocol.c \
protocol/scaler-client-protocol.h \
protocol/scaler-protocol.c \
protocol/workspaces-client-protocol.h \
@@ -839,8 +839,8 @@ desktop_shell_la_SOURCES = \
desktop-shell/input-panel.c \
shared/helpers.h
nodist_desktop_shell_la_SOURCES = \
- protocol/desktop-shell-protocol.c \
- protocol/desktop-shell-server-protocol.h \
+ protocol/weston-desktop-shell-protocol.c \
+ protocol/weston-desktop-shell-server-protocol.h \
protocol/xdg-shell-unstable-v5-protocol.c \
protocol/xdg-shell-unstable-v5-server-protocol.h

@@ -1340,7 +1340,7 @@ BUILT_SOURCES += \
protocol/text-input-unstable-v1-client-protocol.h

EXTRA_DIST += \
- protocol/desktop-shell.xml \
+ protocol/weston-desktop-shell.xml \
protocol/screenshooter.xml \
protocol/workspaces.xml \
protocol/text-cursor-position.xml \
diff --git a/clients/desktop-shell.c b/clients/desktop-shell.c
index 9cf3d68..6ab76dc 100644
--- a/clients/desktop-shell.c
+++ b/clients/desktop-shell.c
@@ -47,14 +47,13 @@
#include "shared/config-parser.h"
#include "shared/helpers.h"

-#include "desktop-shell-client-protocol.h"
+#include "weston-desktop-shell-client-protocol.h"

extern char **environ; /* defined by libc */

struct desktop {
struct display *display;
- struct desktop_shell *shell;
- uint32_t interface_version;
+ struct weston_desktop_shell *shell;
struct unlock_dialog *unlock_dialog;
struct task unlock_task;
struct wl_list outputs;
@@ -72,7 +71,7 @@ struct desktop {

struct surface {
void (*configure)(void *data,
- struct desktop_shell *desktop_shell,
+ struct weston_desktop_shell *desktop_shell,
uint32_t edges, struct window *window,
int32_t width, int32_t height);
};
@@ -174,8 +173,7 @@ check_desktop_ready(struct window *window)
if (!desktop->painted && is_desktop_painted(desktop)) {
desktop->painted = 1;

- if (desktop->interface_version >= 2)
- desktop_shell_desktop_ready(desktop->shell);
+ weston_desktop_shell_desktop_ready(desktop->shell);
}
}

@@ -462,7 +460,7 @@ panel_resize_handler(struct widget *widget,

static void
panel_configure(void *data,
- struct desktop_shell *desktop_shell,
+ struct weston_desktop_shell *desktop_shell,
uint32_t edges, struct window *window,
int32_t width, int32_t height)
{
@@ -725,7 +723,7 @@ background_draw(struct widget *widget, void *data)

static void
background_configure(void *data,
- struct desktop_shell *desktop_shell,
+ struct weston_desktop_shell *desktop_shell,
uint32_t edges, struct window *window,
int32_t width, int32_t height)
{
@@ -860,6 +858,7 @@ unlock_dialog_create(struct desktop *desktop)
{
struct display *display = desktop->display;
struct unlock_dialog *dialog;
+ struct wl_surface *surface;

dialog = xzalloc(sizeof *dialog);

@@ -884,8 +883,8 @@ unlock_dialog_create(struct desktop *desktop)
widget_set_touch_up_handler(dialog->button,
unlock_dialog_touch_up_handler);

- desktop_shell_set_lock_surface(desktop->shell,
- window_get_wl_surface(dialog->window));
+ surface = window_get_wl_surface(dialog->window);
+ weston_desktop_shell_set_lock_surface(desktop->shell, surface);

window_schedule_resize(dialog->window, 260, 230);

@@ -905,14 +904,14 @@ unlock_dialog_finish(struct task *task, uint32_t events)
struct desktop *desktop =
container_of(task, struct desktop, unlock_task);

- desktop_shell_unlock(desktop->shell);
+ weston_desktop_shell_unlock(desktop->shell);
unlock_dialog_destroy(desktop->unlock_dialog);
desktop->unlock_dialog = NULL;
}

static void
desktop_shell_configure(void *data,
- struct desktop_shell *desktop_shell,
+ struct weston_desktop_shell *desktop_shell,
uint32_t edges,
struct wl_surface *surface,
int32_t width, int32_t height)
@@ -925,12 +924,12 @@ desktop_shell_configure(void *data,

static void
desktop_shell_prepare_lock_surface(void *data,
- struct desktop_shell *desktop_shell)
+ struct weston_desktop_shell *desktop_shell)
{
struct desktop *desktop = data;

if (!desktop->locking) {
- desktop_shell_unlock(desktop->shell);
+ weston_desktop_shell_unlock(desktop->shell);
return;
}

@@ -942,52 +941,52 @@ desktop_shell_prepare_lock_surface(void *data,

static void
desktop_shell_grab_cursor(void *data,
- struct desktop_shell *desktop_shell,
+ struct weston_desktop_shell *desktop_shell,
uint32_t cursor)
{
struct desktop *desktop = data;

switch (cursor) {
- case DESKTOP_SHELL_CURSOR_NONE:
+ case WESTON_DESKTOP_SHELL_CURSOR_NONE:
desktop->grab_cursor = CURSOR_BLANK;
break;
- case DESKTOP_SHELL_CURSOR_BUSY:
+ case WESTON_DESKTOP_SHELL_CURSOR_BUSY:
desktop->grab_cursor = CURSOR_WATCH;
break;
- case DESKTOP_SHELL_CURSOR_MOVE:
+ case WESTON_DESKTOP_SHELL_CURSOR_MOVE:
desktop->grab_cursor = CURSOR_DRAGGING;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_TOP:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_TOP:
desktop->grab_cursor = CURSOR_TOP;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM:
desktop->grab_cursor = CURSOR_BOTTOM;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_LEFT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_LEFT:
desktop->grab_cursor = CURSOR_LEFT;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_RIGHT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_RIGHT:
desktop->grab_cursor = CURSOR_RIGHT;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_TOP_LEFT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_TOP_LEFT:
desktop->grab_cursor = CURSOR_TOP_LEFT;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_TOP_RIGHT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_TOP_RIGHT:
desktop->grab_cursor = CURSOR_TOP_RIGHT;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_LEFT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_LEFT:
desktop->grab_cursor = CURSOR_BOTTOM_LEFT;
break;
- case DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_RIGHT:
+ case WESTON_DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_RIGHT:
desktop->grab_cursor = CURSOR_BOTTOM_RIGHT;
break;
- case DESKTOP_SHELL_CURSOR_ARROW:
+ case WESTON_DESKTOP_SHELL_CURSOR_ARROW:
default:
desktop->grab_cursor = CURSOR_LEFT_PTR;
}
}

-static const struct desktop_shell_listener listener = {
+static const struct weston_desktop_shell_listener listener = {
desktop_shell_configure,
desktop_shell_prepare_lock_surface,
desktop_shell_grab_cursor
@@ -1075,7 +1074,7 @@ grab_surface_create(struct desktop *desktop)
window_set_user_data(desktop->grab_window, desktop);

s = window_get_wl_surface(desktop->grab_window);
- desktop_shell_set_grab_surface(desktop->shell, s);
+ weston_desktop_shell_set_grab_surface(desktop->shell, s);

desktop->grab_widget =
window_add_widget(desktop->grab_window, desktop);
@@ -1189,14 +1188,14 @@ output_init(struct output *output, struct desktop *desktop)
if (want_panel(desktop)) {
output->panel = panel_create(desktop);
surface = window_get_wl_surface(output->panel->window);
- desktop_shell_set_panel(desktop->shell,
- output->output, surface);
+ weston_desktop_shell_set_panel(desktop->shell,
+ output->output, surface);
}

output->background = background_create(desktop);
surface = window_get_wl_surface(output->background->window);
- desktop_shell_set_background(desktop->shell,
- output->output, surface);
+ weston_desktop_shell_set_background(desktop->shell,
+ output->output, surface);
}

static void
@@ -1228,12 +1227,14 @@ global_handler(struct display *display, uint32_t id,
{
struct desktop *desktop = data;

- if (!strcmp(interface, "desktop_shell")) {
- desktop->interface_version = (version < 2) ? version : 2;
+ if (!strcmp(interface, "weston_desktop_shell")) {
desktop->shell = display_bind(desktop->display,
- id, &desktop_shell_interface,
- desktop->interface_version);
- desktop_shell_add_listener(desktop->shell, &listener, desktop);
+ id,
+ &weston_desktop_shell_interface,
+ 1);
+ weston_desktop_shell_add_listener(desktop->shell,
+ &listener,
+ desktop);
} else if (!strcmp(interface, "wl_output")) {
create_output(desktop, id);
}
@@ -1334,7 +1335,7 @@ int main(int argc, char *argv[])
desktop_destroy_outputs(&desktop);
if (desktop.unlock_dialog)
unlock_dialog_destroy(desktop.unlock_dialog);
- desktop_shell_destroy(desktop.shell);
+ weston_desktop_shell_destroy(desktop.shell);
display_destroy(desktop.display);

return 0;
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
index f5342aa..6619e4c 100644
--- a/desktop-shell/input-panel.c
+++ b/desktop-shell/input-panel.c
@@ -30,7 +30,7 @@
#include <string.h>

#include "shell.h"
-#include "desktop-shell-server-protocol.h"
+#include "weston-desktop-shell-server-protocol.h"
#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index 52d1195..bbb1537 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -36,7 +36,7 @@
#include <sys/types.h>

#include "shell.h"
-#include "desktop-shell-server-protocol.h"
+#include "weston-desktop-shell-server-protocol.h"
#include "workspaces-server-protocol.h"
#include "shared/config-parser.h"
#include "shared/helpers.h"
@@ -375,7 +375,7 @@ shell_grab_start(struct shell_grab *grab,
const struct weston_pointer_grab_interface *interface,
struct shell_surface *shsurf,
struct weston_pointer *pointer,
- enum desktop_shell_cursor cursor)
+ enum weston_desktop_shell_cursor cursor)
{
struct desktop_shell *shell = shsurf->shell;
struct weston_touch *touch = weston_seat_get_touch(pointer->seat);
@@ -393,7 +393,7 @@ shell_grab_start(struct shell_grab *grab,
shsurf->grabbed = 1;
weston_pointer_start_grab(pointer, &grab->grab);
if (shell->child.desktop_shell) {
- desktop_shell_send_grab_cursor(shell->child.desktop_shell,
+ weston_desktop_shell_send_grab_cursor(shell->child.desktop_shell,
cursor);
weston_pointer_set_focus(pointer,
get_default_view(shell->grab_surface),
@@ -423,8 +423,8 @@ get_output_panel_size(struct desktop_shell *shell,
continue;

switch (shell->panel_position) {
- case DESKTOP_SHELL_PANEL_POSITION_TOP:
- case DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
weston_view_to_global_float(view,
view->surface->width, 0,
&x, &y);
@@ -433,8 +433,8 @@ get_output_panel_size(struct desktop_shell *shell,
*height = view->surface->height + (int) y - output->y;
return;

- case DESKTOP_SHELL_PANEL_POSITION_LEFT:
- case DESKTOP_SHELL_PANEL_POSITION_RIGHT:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_RIGHT:
weston_view_to_global_float(view,
0, view->surface->height,
&x, &y);
@@ -465,16 +465,16 @@ get_output_work_area(struct desktop_shell *shell,

get_output_panel_size(shell, output, &panel_width, &panel_height);
switch (shell->panel_position) {
- case DESKTOP_SHELL_PANEL_POSITION_TOP:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP:
default:
area->y += panel_height;
- case DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_BOTTOM:
area->width = output->width;
area->height = output->height - panel_height;
break;
- case DESKTOP_SHELL_PANEL_POSITION_LEFT:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT:
area->x += panel_width;
- case DESKTOP_SHELL_PANEL_POSITION_RIGHT:
+ case WESTON_DESKTOP_SHELL_PANEL_POSITION_RIGHT:
area->width = output->width - panel_width;
area->height = output->height;
break;
@@ -1718,7 +1718,8 @@ constrain_position(struct weston_move_grab *move, int *cx, int *cy)
x = wl_fixed_to_int(pointer->x + move->dx);
y = wl_fixed_to_int(pointer->y + move->dy);

- if (shsurf->shell->panel_position == DESKTOP_SHELL_PANEL_POSITION_TOP) {
+ if (shsurf->shell->panel_position ==
+ WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP) {
get_output_work_area(shsurf->shell,
shsurf->surface->output,
&area);
@@ -1818,7 +1819,7 @@ surface_move(struct shell_surface *shsurf, struct weston_pointer *pointer,
move->client_initiated = client_initiated;

shell_grab_start(&move->base, &move_grab_interface, shsurf,
- pointer, DESKTOP_SHELL_CURSOR_MOVE);
+ pointer, WESTON_DESKTOP_SHELL_CURSOR_MOVE);

return 0;
}
@@ -2134,7 +2135,7 @@ set_busy_cursor(struct shell_surface *shsurf, struct weston_pointer *pointer)
return;

shell_grab_start(grab, &busy_cursor_grab_interface, shsurf, pointer,
- DESKTOP_SHELL_CURSOR_BUSY);
+ WESTON_DESKTOP_SHELL_CURSOR_BUSY);
/* Mark the shsurf as ungrabbed so that button binding is able
* to move it. */
shsurf->grabbed = 0;
@@ -4459,10 +4460,10 @@ desktop_shell_set_background(struct wl_client *client,
weston_surface_set_label_func(surface, background_get_label);
surface->output = wl_resource_get_user_data(output_resource);
view->output = surface->output;
- desktop_shell_send_configure(resource, 0,
- surface_resource,
- surface->output->width,
- surface->output->height);
+ weston_desktop_shell_send_configure(resource, 0,
+ surface_resource,
+ surface->output->width,
+ surface->output->height);
}

static int
@@ -4510,10 +4511,10 @@ desktop_shell_set_panel(struct wl_client *client,
weston_surface_set_label_func(surface, panel_get_label);
surface->output = wl_resource_get_user_data(output_resource);
view->output = surface->output;
- desktop_shell_send_configure(resource, 0,
- surface_resource,
- surface->output->width,
- surface->output->height);
+ weston_desktop_shell_send_configure(resource, 0,
+ surface_resource,
+ surface->output->width,
+ surface->output->height);
}

static int
@@ -4645,12 +4646,12 @@ desktop_shell_set_panel_position(struct wl_client *client,
{
struct desktop_shell *shell = wl_resource_get_user_data(resource);

- if (position != DESKTOP_SHELL_PANEL_POSITION_TOP &&
- position != DESKTOP_SHELL_PANEL_POSITION_BOTTOM &&
- position != DESKTOP_SHELL_PANEL_POSITION_LEFT &&
- position != DESKTOP_SHELL_PANEL_POSITION_RIGHT) {
+ if (position != WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP &&
+ position != WESTON_DESKTOP_SHELL_PANEL_POSITION_BOTTOM &&
+ position != WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT &&
+ position != WESTON_DESKTOP_SHELL_PANEL_POSITION_RIGHT) {
wl_resource_post_error(resource,
- DESKTOP_SHELL_ERROR_INVALID_ARGUMENT,
+ WESTON_DESKTOP_SHELL_ERROR_INVALID_ARGUMENT,
"bad position argument");
return;
}
@@ -4658,7 +4659,7 @@ desktop_shell_set_panel_position(struct wl_client *client,
shell->panel_position = position;
}

-static const struct desktop_shell_interface desktop_shell_implementation = {
+static const struct weston_desktop_shell_interface desktop_shell_implementation = {
desktop_shell_set_background,
desktop_shell_set_panel,
desktop_shell_set_lock_surface,
@@ -5063,7 +5064,7 @@ surface_rotate(struct shell_surface *surface, struct weston_pointer *pointer)
}

shell_grab_start(&rotate->base, &rotate_grab_interface, surface,
- pointer, DESKTOP_SHELL_CURSOR_ARROW);
+ pointer, WESTON_DESKTOP_SHELL_CURSOR_ARROW);
}

static void
@@ -5301,6 +5302,8 @@ lock(struct desktop_shell *shell)
static void
unlock(struct desktop_shell *shell)
{
+ struct wl_resource *shell_resource;
+
if (!shell->locked || shell->lock_surface) {
shell_fade(shell, FADE_IN);
return;
@@ -5315,7 +5318,8 @@ unlock(struct desktop_shell *shell)
if (shell->prepare_event_sent)
return;

- desktop_shell_send_prepare_lock_surface(shell->child.desktop_shell);
+ shell_resource = shell->child.desktop_shell;
+ weston_desktop_shell_send_prepare_lock_surface(shell_resource);
shell->prepare_event_sent = true;
}

@@ -5969,7 +5973,7 @@ bind_desktop_shell(struct wl_client *client,
struct desktop_shell *shell = data;
struct wl_resource *resource;

- resource = wl_resource_create(client, &desktop_shell_interface,
+ resource = wl_resource_create(client, &weston_desktop_shell_interface,
MIN(version, 3), id);

if (client == shell->child.client) {
@@ -6689,7 +6693,7 @@ module_init(struct weston_compositor *ec,
return -1;

if (wl_global_create(ec->wl_display,
- &desktop_shell_interface, 3,
+ &weston_desktop_shell_interface, 1,
shell, bind_desktop_shell) == NULL)
return -1;

@@ -6699,7 +6703,7 @@ module_init(struct weston_compositor *ec,

shell->child.deathstamp = weston_compositor_get_time();

- shell->panel_position = DESKTOP_SHELL_PANEL_POSITION_TOP;
+ shell->panel_position = WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP;

setup_output_destroy_handler(ec, shell);

diff --git a/desktop-shell/shell.h b/desktop-shell/shell.h
index 041ecd8..2ef23f4 100644
--- a/desktop-shell/shell.h
+++ b/desktop-shell/shell.h
@@ -28,7 +28,7 @@

#include "compositor.h"

-#include "desktop-shell-server-protocol.h"
+#include "weston-desktop-shell-server-protocol.h"

enum animation_type {
ANIMATION_NONE,
@@ -202,7 +202,7 @@ struct desktop_shell {
struct wl_listener output_move_listener;
struct wl_list output_list;

- enum desktop_shell_panel_position panel_position;
+ enum weston_desktop_shell_panel_position panel_position;

char *client;

diff --git a/protocol/desktop-shell.xml b/protocol/desktop-shell.xml
deleted file mode 100644
index dd81574..0000000
--- a/protocol/desktop-shell.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<protocol name="desktop">
-
- <interface name="desktop_shell" version="3">
- <description summary="create desktop widgets and helpers">
- Traditional user interfaces can rely on this interface to define the
- foundations of typical desktops. Currently it's possible to set up
- background, panels and locking surfaces.
- </description>
-
- <request name="set_background">
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="set_panel">
- <arg name="output" type="object" interface="wl_output"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="set_lock_surface">
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <request name="unlock"/>
-
- <request name="set_grab_surface">
- <description summary="set grab surface">
- The surface set by this request will receive a fake
- pointer.enter event during grabs at position 0, 0 and is
- expected to set an appropriate cursor image as described by
- the grab_cursor event sent just before the enter event.
- </description>
- <arg name="surface" type="object" interface="wl_surface"/>
- </request>
-
- <!-- We'll fold most of wl_shell into this interface and then
- they'll share the configure event. -->
- <event name="configure">
- <arg name="edges" type="uint"/>
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="width" type="int"/>
- <arg name="height" type="int"/>
- </event>
-
- <event name="prepare_lock_surface">
- <description summary="tell the client to create, set the lock surface">
- Tell the client we want it to create and set the lock surface, which is
- a GUI asking the user to unlock the screen. The lock surface is
- announced with 'set_lock_surface'. Whether or not the client actually
- implements locking, it MUST send 'unlock' request to let the normal
- desktop resume.
- </description>
- </event>
-
- <event name="grab_cursor">
- <description summary="tell client what cursor to show during a grab">
- This event will be sent immediately before a fake enter event on the
- grab surface.
- </description>
- <arg name="cursor" type="uint"/>
- </event>
-
- <enum name="cursor">
- <entry name="none" value="0"/>
-
- <entry name="resize_top" value="1"/>
- <entry name="resize_bottom" value="2"/>
-
- <entry name="arrow" value="3"/>
-
- <entry name="resize_left" value="4"/>
- <entry name="resize_top_left" value="5"/>
- <entry name="resize_bottom_left" value="6"/>
-
- <entry name="move" value="7"/>
-
- <entry name="resize_right" value="8"/>
- <entry name="resize_top_right" value="9"/>
- <entry name="resize_bottom_right" value="10"/>
-
- <entry name="busy" value="11"/>
- </enum>
-
- <!-- Version 2 additions -->
-
- <request name="desktop_ready" since="2">
- <description summary="desktop is ready to be shown">
- Tell the server, that enough desktop elements have been drawn
- to make the desktop look ready for use. During start-up, the
- server can wait for this request with a black screen before
- starting to fade in the desktop, for instance. If the client
- parts of a desktop take a long time to initialize, we avoid
- showing temporary garbage.
- </description>
- </request>
-
- <!-- Version 3 additions -->
-
- <enum name="panel_position">
- <entry name="top" value="0"/>
- <entry name="bottom" value="1"/>
- <entry name="left" value="2"/>
- <entry name="right" value="3"/>
- </enum>
-
- <enum name="error">
- <entry name="invalid_argument" value="0"
- summary="an invalid argument was provided in a request"/>
- </enum>
-
- <request name="set_panel_position" since="3">
- <arg name="position" type="uint"/>
- <description summary="set panel position">
- Tell the shell which side of the screen the panel is
- located. This is so that new windows do not overlap the panel
- and maximized windows maximize properly.
- </description>
- </request>
-
- </interface>
-
- <interface name="screensaver" version="1">
- <description summary="interface for implementing screensavers">
- Only one client can bind this interface at a time.
- </description>
-
- <request name="set_surface">
- <description summary="set the surface type as a screensaver">
- A screensaver surface is normally hidden, and only visible after an
- idle timeout.
- </description>
-
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="output" type="object" interface="wl_output"/>
- </request>
-
- </interface>
-</protocol>
diff --git a/protocol/weston-desktop-shell.xml b/protocol/weston-desktop-shell.xml
new file mode 100644
index 0000000..a21047f
--- /dev/null
+++ b/protocol/weston-desktop-shell.xml
@@ -0,0 +1,134 @@
+<protocol name="weston_desktop">
+
+ <interface name="weston_desktop_shell" version="1">
+ <description summary="create desktop widgets and helpers">
+ Traditional user interfaces can rely on this interface to define the
+ foundations of typical desktops. Currently it's possible to set up
+ background, panels and locking surfaces.
+ </description>
+
+ <request name="set_background">
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="set_panel">
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="set_lock_surface">
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="unlock"/>
+
+ <request name="set_grab_surface">
+ <description summary="set grab surface">
+ The surface set by this request will receive a fake
+ pointer.enter event during grabs at position 0, 0 and is
+ expected to set an appropriate cursor image as described by
+ the grab_cursor event sent just before the enter event.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <!-- We'll fold most of wl_shell into this interface and then
+ they'll share the configure event. -->
+ <event name="configure">
+ <arg name="edges" type="uint"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </event>
+
+ <event name="prepare_lock_surface">
+ <description summary="tell the client to create, set the lock surface">
+ Tell the client we want it to create and set the lock surface, which is
+ a GUI asking the user to unlock the screen. The lock surface is
+ announced with 'set_lock_surface'. Whether or not the client actually
+ implements locking, it MUST send 'unlock' request to let the normal
+ desktop resume.
+ </description>
+ </event>
+
+ <event name="grab_cursor">
+ <description summary="tell client what cursor to show during a grab">
+ This event will be sent immediately before a fake enter event on the
+ grab surface.
+ </description>
+ <arg name="cursor" type="uint"/>
+ </event>
+
+ <enum name="cursor">
+ <entry name="none" value="0"/>
+
+ <entry name="resize_top" value="1"/>
+ <entry name="resize_bottom" value="2"/>
+
+ <entry name="arrow" value="3"/>
+
+ <entry name="resize_left" value="4"/>
+ <entry name="resize_top_left" value="5"/>
+ <entry name="resize_bottom_left" value="6"/>
+
+ <entry name="move" value="7"/>
+
+ <entry name="resize_right" value="8"/>
+ <entry name="resize_top_right" value="9"/>
+ <entry name="resize_bottom_right" value="10"/>
+
+ <entry name="busy" value="11"/>
+ </enum>
+
+ <request name="desktop_ready">
+ <description summary="desktop is ready to be shown">
+ Tell the server, that enough desktop elements have been drawn
+ to make the desktop look ready for use. During start-up, the
+ server can wait for this request with a black screen before
+ starting to fade in the desktop, for instance. If the client
+ parts of a desktop take a long time to initialize, we avoid
+ showing temporary garbage.
+ </description>
+ </request>
+
+ <enum name="panel_position">
+ <entry name="top" value="0"/>
+ <entry name="bottom" value="1"/>
+ <entry name="left" value="2"/>
+ <entry name="right" value="3"/>
+ </enum>
+
+ <enum name="error">
+ <entry name="invalid_argument" value="0"
+ summary="an invalid argument was provided in a request"/>
+ </enum>
+
+ <request name="set_panel_position">
+ <arg name="position" type="uint"/>
+ <description summary="set panel position">
+ Tell the shell which side of the screen the panel is
+ located. This is so that new windows do not overlap the panel
+ and maximized windows maximize properly.
+ </description>
+ </request>
+
+ </interface>
+
+ <interface name="weston_screensaver" version="1">
+ <description summary="interface for implementing screensavers">
+ Only one client can bind this interface at a time.
+ </description>
+
+ <request name="set_surface">
+ <description summary="set the surface type as a screensaver">
+ A screensaver surface is normally hidden, and only visible after an
+ idle timeout.
+ </description>
+
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="output" type="object" interface="wl_output"/>
+ </request>
+
+ </interface>
+</protocol>
--
2.4.3
Pekka Paalanen
2015-11-05 14:31:37 UTC
Permalink
On Wed, 4 Nov 2015 16:49:57 +0800
Post by Jonas Ådahl
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.
This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.
---
Makefile.am | 20 +++---
clients/desktop-shell.c | 79 +++++++++++-----------
desktop-shell/input-panel.c | 2 +-
desktop-shell/shell.c | 70 ++++++++++---------
desktop-shell/shell.h | 4 +-
protocol/desktop-shell.xml | 138 --------------------------------------
protocol/weston-desktop-shell.xml | 134 ++++++++++++++++++++++++++++++++++++
7 files changed, 224 insertions(+), 223 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
create mode 100644 protocol/weston-desktop-shell.xml
This renaming will break Maynard:
https://github.com/raspberrypi/maynard.git

This is not a blocker for this patch, just something we should be aware
of. The fix should be pretty easy if anyone cares.
Post by Jonas Ådahl
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
index f5342aa..6619e4c 100644
--- a/desktop-shell/input-panel.c
+++ b/desktop-shell/input-panel.c
@@ -30,7 +30,7 @@
#include <string.h>
#include "shell.h"
-#include "desktop-shell-server-protocol.h"
+#include "weston-desktop-shell-server-protocol.h"
#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
And no other changes in this file, that's odd. Maybe the header is not
needed at all?

Acked-by: Pekka Paalanen <***@collabora.co.uk>


Thanks,
pq
Jonas Ådahl
2015-11-06 02:53:36 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:57 +0800
Post by Jonas Ådahl
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.
This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.
---
Makefile.am | 20 +++---
clients/desktop-shell.c | 79 +++++++++++-----------
desktop-shell/input-panel.c | 2 +-
desktop-shell/shell.c | 70 ++++++++++---------
desktop-shell/shell.h | 4 +-
protocol/desktop-shell.xml | 138 --------------------------------------
protocol/weston-desktop-shell.xml | 134 ++++++++++++++++++++++++++++++++++++
7 files changed, 224 insertions(+), 223 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
create mode 100644 protocol/weston-desktop-shell.xml
https://github.com/raspberrypi/maynard.git
This is not a blocker for this patch, just something we should be aware
of. The fix should be pretty easy if anyone cares.
Yea, and practically it is not an important name change. I do however
think weston should 'set an example' and do the right thing here though.
Post by Pekka Paalanen
Post by Jonas Ådahl
diff --git a/desktop-shell/input-panel.c b/desktop-shell/input-panel.c
index f5342aa..6619e4c 100644
--- a/desktop-shell/input-panel.c
+++ b/desktop-shell/input-panel.c
@@ -30,7 +30,7 @@
#include <string.h>
#include "shell.h"
-#include "desktop-shell-server-protocol.h"
+#include "weston-desktop-shell-server-protocol.h"
#include "input-method-unstable-v1-server-protocol.h"
#include "shared/helpers.h"
And no other changes in this file, that's odd. Maybe the header is not
needed at all?
Indeed. It could be removed.


Jonas
Post by Pekka Paalanen
Thanks,
pq
Pekka Paalanen
2015-11-06 08:29:28 UTC
Permalink
On Fri, 6 Nov 2015 10:53:36 +0800
Post by Jonas Ådahl
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:57 +0800
Post by Jonas Ådahl
In the effort of going away from generic names of protocols only
relevant for weston, rename the weston desktop shell
weston_desktop_shell.
This also resets the version to 1, as there will be no prior versions
to weston_desktop_shell.
---
Makefile.am | 20 +++---
clients/desktop-shell.c | 79 +++++++++++-----------
desktop-shell/input-panel.c | 2 +-
desktop-shell/shell.c | 70 ++++++++++---------
desktop-shell/shell.h | 4 +-
protocol/desktop-shell.xml | 138 --------------------------------------
protocol/weston-desktop-shell.xml | 134 ++++++++++++++++++++++++++++++++++++
7 files changed, 224 insertions(+), 223 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
create mode 100644 protocol/weston-desktop-shell.xml
https://github.com/raspberrypi/maynard.git
This is not a blocker for this patch, just something we should be aware
of. The fix should be pretty easy if anyone cares.
Yea, and practically it is not an important name change. I do however
think weston should 'set an example' and do the right thing here though.
Yes definely, let's do this. Just wanted to make a reminder in case
someone comes complaining Maynard broke. :-)


Thanks,
pq
Jonas Ådahl
2015-11-04 08:49:59 UTC
Permalink
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.

Signed-off-by: Jonas Ådahl <***@gmail.com>
---
Makefile.am | 7 ---
clients/window.c | 57 +-----------------------
desktop-shell/shell.c | 113 ------------------------------------------------
protocol/workspaces.xml | 27 ------------
4 files changed, 1 insertion(+), 203 deletions(-)
delete mode 100644 protocol/workspaces.xml

diff --git a/Makefile.am b/Makefile.am
index 580f282..e7feebd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -121,8 +121,6 @@ nodist_weston_SOURCES = \
protocol/text-input-unstable-v1-server-protocol.h \
protocol/input-method-unstable-v1-protocol.c \
protocol/input-method-unstable-v1-server-protocol.h \
- protocol/workspaces-protocol.c \
- protocol/workspaces-server-protocol.h \
protocol/presentation-timing-unstable-v1-protocol.c \
protocol/presentation-timing-unstable-v1-server-protocol.h \
protocol/scaler-protocol.c \
@@ -552,8 +550,6 @@ nodist_libtoytoolkit_la_SOURCES = \
protocol/text-cursor-position-client-protocol.h \
protocol/scaler-protocol.c \
protocol/scaler-client-protocol.h \
- protocol/workspaces-protocol.c \
- protocol/workspaces-client-protocol.h \
protocol/presentation-timing-unstable-v1-protocol.c \
protocol/presentation-timing-unstable-v1-client-protocol.h \
protocol/xdg-shell-unstable-v5-protocol.c \
@@ -761,8 +757,6 @@ BUILT_SOURCES += \
protocol/weston-desktop-shell-protocol.c \
protocol/scaler-client-protocol.h \
protocol/scaler-protocol.c \
- protocol/workspaces-client-protocol.h \
- protocol/workspaces-protocol.c \
protocol/fullscreen-shell-unstable-v1-protocol.c \
protocol/fullscreen-shell-unstable-v1-client-protocol.h \
protocol/xdg-shell-unstable-v5-protocol.c \
@@ -1342,7 +1336,6 @@ BUILT_SOURCES += \
EXTRA_DIST += \
protocol/weston-desktop-shell.xml \
protocol/weston-screenshooter.xml \
- protocol/workspaces.xml \
protocol/text-cursor-position.xml \
protocol/weston-test.xml \
protocol/scaler.xml \
diff --git a/clients/window.c b/clients/window.c
index 47628de..bb62617 100644
--- a/clients/window.c
+++ b/clients/window.c
@@ -96,7 +96,6 @@ struct display {
struct wl_shm *shm;
struct wl_data_device_manager *data_device_manager;
struct text_cursor_position *text_cursor_position;
- struct workspace_manager *workspace_manager;
struct xdg_shell *xdg_shell;
struct ivi_application *ivi_application; /* ivi style shell */
EGLDisplay dpy;
@@ -132,9 +131,6 @@ struct display {

struct xkb_context *xkb_context;

- uint32_t workspace;
- uint32_t workspace_count;
-
/* A hack to get text extents for tooltips */
cairo_surface_t *dummy_surface;
void *dummy_surface_data;
@@ -2130,22 +2126,6 @@ widget_set_tooltip(struct widget *parent, char *entry, float x, float y)
}

static void
-workspace_manager_state(void *data,
- struct workspace_manager *workspace_manager,
- uint32_t current,
- uint32_t count)
-{
- struct display *display = data;
-
- display->workspace = current;
- display->workspace_count = count;
-}
-
-static const struct workspace_manager_listener workspace_manager_listener = {
- workspace_manager_state
-};
-
-static void
frame_resize_handler(struct widget *widget,
int32_t width, int32_t height, void *data)
{
@@ -2272,29 +2252,12 @@ static void
frame_menu_func(void *data, struct input *input, int index)
{
struct window *window = data;
- struct display *display;

switch (index) {
case 0: /* close */
window_close(window);
break;
- case 1: /* move to workspace above */
- display = window->display;
- if (display->workspace > 0)
- workspace_manager_move_surface(
- display->workspace_manager,
- window->main_surface->surface,
- display->workspace - 1);
- break;
- case 2: /* move to workspace below */
- display = window->display;
- if (display->workspace < display->workspace_count - 1)
- workspace_manager_move_surface(
- display->workspace_manager,
- window->main_surface->surface,
- display->workspace + 1);
- break;
- case 3: /* fullscreen */
+ case 1: /* fullscreen */
/* we don't have a way to get out of fullscreen for now */
if (window->fullscreen_handler)
window->fullscreen_handler(window, window->user_data);
@@ -2311,7 +2274,6 @@ window_show_frame_menu(struct window *window,

static const char *entries[] = {
"Close",
- "Move to workspace above", "Move to workspace below",
"Fullscreen"
};

@@ -5312,18 +5274,6 @@ input_destroy(struct input *input)
}

static void
-init_workspace_manager(struct display *d, uint32_t id)
-{
- d->workspace_manager =
- wl_registry_bind(d->registry, id,
- &workspace_manager_interface, 1);
- if (d->workspace_manager != NULL)
- workspace_manager_add_listener(d->workspace_manager,
- &workspace_manager_listener,
- d);
-}
-
-static void
shm_format(void *data, struct wl_shm *wl_shm, uint32_t format)
{
struct display *d = data;
@@ -5390,8 +5340,6 @@ registry_handle_global(void *data, struct wl_registry *registry, uint32_t id,
d->text_cursor_position =
wl_registry_bind(registry, id,
&text_cursor_position_interface, 1);
- } else if (strcmp(interface, "workspace_manager") == 0) {
- init_workspace_manager(d, id);
} else if (strcmp(interface, "wl_subcompositor") == 0) {
d->subcompositor =
wl_registry_bind(registry, id,
@@ -5623,9 +5571,6 @@ display_create(int *argc, char *argv[])
wl_list_init(&d->output_list);
wl_list_init(&d->global_list);

- d->workspace = 0;
- d->workspace_count = 1;
-
d->registry = wl_display_get_registry(d->display);
wl_registry_add_listener(d->registry, &registry_listener, d);

diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index bbb1537..749c9a5 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -37,7 +37,6 @@

#include "shell.h"
#include "weston-desktop-shell-server-protocol.h"
-#include "workspaces-server-protocol.h"
#include "shared/config-parser.h"
#include "shared/helpers.h"
#include "xdg-shell-server-protocol.h"
@@ -1184,17 +1183,6 @@ workspace_translate_in(struct workspace *ws, double fraction)
}

static void
-broadcast_current_workspace_state(struct desktop_shell *shell)
-{
- struct wl_resource *resource;
-
- wl_resource_for_each(resource, &shell->workspaces.client_list)
- workspace_manager_send_state(resource,
- shell->workspaces.current,
- shell->workspaces.num);
-}
-
-static void
reverse_workspace_change_animation(struct desktop_shell *shell,
unsigned int index,
struct workspace *from,
@@ -1375,7 +1363,6 @@ change_workspace(struct desktop_shell *shell, unsigned int index)
shell->workspaces.anim_to == from) {
restore_focus_state(shell, to);
reverse_workspace_change_animation(shell, index, from, to);
- broadcast_current_workspace_state(shell);
return;
}

@@ -1402,8 +1389,6 @@ change_workspace(struct desktop_shell *shell, unsigned int index)
update_workspace(shell, index, from, to);
else
animate_workspace_change(shell, index, from, to);
-
- broadcast_current_workspace_state(shell);
}

static bool
@@ -1444,41 +1429,6 @@ surface_keyboard_focus_lost(struct weston_surface *surface)
}

static void
-move_surface_to_workspace(struct desktop_shell *shell,
- struct shell_surface *shsurf,
- uint32_t workspace)
-{
- struct workspace *from;
- struct workspace *to;
- struct weston_view *view;
-
- if (workspace == shell->workspaces.current)
- return;
-
- view = get_default_view(shsurf->surface);
- if (!view)
- return;
-
- assert(weston_surface_get_main_surface(view->surface) == view->surface);
-
- if (workspace >= shell->workspaces.num)
- workspace = shell->workspaces.num - 1;
-
- from = get_current_workspace(shell);
- to = get_workspace(shell, workspace);
-
- weston_layer_entry_remove(&view->layer_link);
- weston_layer_entry_insert(&to->layer.view_list, &view->layer_link);
-
- shell_surface_update_child_surface_layers(shsurf);
-
- drop_focus_state(shell, from, view->surface);
- surface_keyboard_focus_lost(view->surface);
-
- weston_view_damage_below(view);
-}
-
-static void
take_surface_to_workspace_by_seat(struct desktop_shell *shell,
struct weston_seat *seat,
unsigned int index)
@@ -1517,7 +1467,6 @@ take_surface_to_workspace_by_seat(struct desktop_shell *shell,
wl_list_insert(from->layer.link.prev, &to->layer.link);

reverse_workspace_change_animation(shell, index, from, to);
- broadcast_current_workspace_state(shell);

return;
}
@@ -1539,70 +1488,12 @@ take_surface_to_workspace_by_seat(struct desktop_shell *shell,
animate_workspace_change(shell, index, from, to);
}

- broadcast_current_workspace_state(shell);
-
state = ensure_focus_state(shell, seat);
if (state != NULL)
focus_state_set_focus(state, surface);
}

static void
-workspace_manager_move_surface(struct wl_client *client,
- struct wl_resource *resource,
- struct wl_resource *surface_resource,
- uint32_t workspace)
-{
- struct desktop_shell *shell = wl_resource_get_user_data(resource);
- struct weston_surface *surface =
- wl_resource_get_user_data(surface_resource);
- struct weston_surface *main_surface;
- struct shell_surface *shell_surface;
-
- main_surface = weston_surface_get_main_surface(surface);
- shell_surface = get_shell_surface(main_surface);
- if (shell_surface == NULL)
- return;
-
- move_surface_to_workspace(shell, shell_surface, workspace);
-}
-
-static const struct workspace_manager_interface workspace_manager_implementation = {
- workspace_manager_move_surface,
-};
-
-static void
-unbind_resource(struct wl_resource *resource)
-{
- wl_list_remove(wl_resource_get_link(resource));
-}
-
-static void
-bind_workspace_manager(struct wl_client *client,
- void *data, uint32_t version, uint32_t id)
-{
- struct desktop_shell *shell = data;
- struct wl_resource *resource;
-
- resource = wl_resource_create(client,
- &workspace_manager_interface, 1, id);
-
- if (resource == NULL) {
- weston_log("couldn't add workspace manager object");
- return;
- }
-
- wl_resource_set_implementation(resource,
- &workspace_manager_implementation,
- shell, unbind_resource);
- wl_list_insert(&shell->workspaces.client_list,
- wl_resource_get_link(resource));
-
- workspace_manager_send_state(resource,
- shell->workspaces.current,
- shell->workspaces.num);
-}
-
-static void
touch_move_grab_down(struct weston_touch_grab *grab, uint32_t time,
int touch_id, wl_fixed_t x, wl_fixed_t y)
{
@@ -6697,10 +6588,6 @@ module_init(struct weston_compositor *ec,
shell, bind_desktop_shell) == NULL)
return -1;

- if (wl_global_create(ec->wl_display, &workspace_manager_interface, 1,
- shell, bind_workspace_manager) == NULL)
- return -1;
-
shell->child.deathstamp = weston_compositor_get_time();

shell->panel_position = WESTON_DESKTOP_SHELL_PANEL_POSITION_TOP;
diff --git a/protocol/workspaces.xml b/protocol/workspaces.xml
deleted file mode 100644
index 22f4802..0000000
--- a/protocol/workspaces.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<protocol name="workspaces">
-
- <interface name="workspace_manager" version="1">
- <description summary="workspaces manager">
- An interface for managing surfaces in workspaces.
- </description>
-
- <request name="move_surface">
- <description summary="move surface to workspace">
- Move the given surface to the specified workspace.
- </description>
- <arg name="surface" type="object" interface="wl_surface"/>
- <arg name="workspace" type="uint"/>
- </request>
-
- <event name="state">
- <description summary="workspace state">
- The current workspace state, such as current workspace and workspace
- count, has changed.
- </description>
- <arg name="current" type="uint"/>
- <arg name="count" type="uint"/>
- </event>
-
- </interface>
-
-</protocol>
--
2.4.3
Pekka Paalanen
2015-11-05 08:28:53 UTC
Permalink
On Wed, 4 Nov 2015 16:49:59 +0800
Post by Jonas Ådahl
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.
---
Makefile.am | 7 ---
clients/window.c | 57 +-----------------------
desktop-shell/shell.c | 113 ------------------------------------------------
protocol/workspaces.xml | 27 ------------
4 files changed, 1 insertion(+), 203 deletions(-)
delete mode 100644 protocol/workspaces.xml
Acked-by: Pekka Paalanen <***@collabora.co.uk>

Are we left with any way to move a window from a workspace to another?

Should we have multiple workspaces in vanilla Weston/desktop at all?

Do we have any Weston core features that would be left unused in
vanilla Weston with this patch or with the removal of workspaces?

This is mostly food for thought for potentially simplifying desktop
shell in future.


Thanks,
pq
Jonas Ådahl
2015-11-05 08:40:44 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:59 +0800
Post by Jonas Ådahl
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.
---
Makefile.am | 7 ---
clients/window.c | 57 +-----------------------
desktop-shell/shell.c | 113 ------------------------------------------------
protocol/workspaces.xml | 27 ------------
4 files changed, 1 insertion(+), 203 deletions(-)
delete mode 100644 protocol/workspaces.xml
Are we left with any way to move a window from a workspace to another?
Yes, there are keybindings for that still left.
Post by Pekka Paalanen
Should we have multiple workspaces in vanilla Weston/desktop at all?
Do we have any Weston core features that would be left unused in
vanilla Weston with this patch or with the removal of workspaces?
This is mostly food for thought for potentially simplifying desktop
shell in future.
I have no objections to someone removing it.


Jonas
Post by Pekka Paalanen
Thanks,
pq
Bryce Harrington
2015-11-05 20:25:53 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:59 +0800
Post by Jonas Ådahl
It doesn't fill a useful function and is not intended to be continued.
If there is need for workspace manipulation from clients a protocol
based on those future needs need to be properly designed.
workspaces.xml is probably not very relevant since it did the bare
minimum.
---
Makefile.am | 7 ---
clients/window.c | 57 +-----------------------
desktop-shell/shell.c | 113 ------------------------------------------------
protocol/workspaces.xml | 27 ------------
4 files changed, 1 insertion(+), 203 deletions(-)
delete mode 100644 protocol/workspaces.xml
Are we left with any way to move a window from a workspace to another?
Should we have multiple workspaces in vanilla Weston/desktop at all?
I don't think we should shut the door to having multiple workspaces (or
other analogous concepts) in the future, but am ok dropping this
particular attempt.

Bryce
Mariusz Ceier
2015-11-04 16:50:00 UTC
Permalink
Hi,
Weston doesn't compile with this patchset - some source files in clients
directory still use old or removed headers.
I had to replace xdg-shell-server-protocol.h in desktop-shell/shell.c
with xdg-shell-unstable-v5-server-protocol.h and disable clients
compilation in order to be able to compile weston.
If that's not an issue:

Reviewed-by: Mariusz Ceier <mceier+***@gmail.com>

Mariusz Ceier
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Another protocol left to migrate is scalar.xml. I didn't do this yet
because Pekka had plans on renaming it, and I'll simply wait until he
has a name for it before migrating anything.
Other than that, the wayland-protocols have shaped up some, with the
pointer gestures protocol as well as the protocols of this series
migrated there. I wouldn't mind if people went and had a look to see if
there are any opinions of how things should work before we make an
initial release. The procedures and some details are explained in the
README file in the toplevel directory.
One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?
Jonas
Use fullscreen-shell.xml from wayland-protocols
Use linux-dmabuf protocol from wayland-protocols
Use presentation timing protocol from wayland-protocols
Use text input protocol from wayland-protocols
Use input method protocol from wayland-protocols
Makefile.am: Make the external xml scanning rule version generic
Use xdg_shell protocol from wayland-protocols
desktop-shell: Rename protocol weston_desktop_shell
Rename screenshooter protocol to weston_screenshooter
Remove workspaces protocol
Makefile.am | 194 ++++++------
clients/desktop-shell.c | 79 ++---
clients/editor.c | 119 +++----
clients/fullscreen.c | 60 ++--
clients/keyboard.c | 186 +++++------
clients/presentation-shm.c | 65 ++--
clients/screenshot.c | 21 +-
clients/simple-damage.c | 18 +-
clients/simple-dmabuf.c | 74 ++---
clients/simple-shm.c | 18 +-
clients/weston-info.c | 19 +-
clients/weston-simple-im.c | 122 +++----
clients/window.c | 57 +---
configure.ac | 7 +
desktop-shell/input-panel.c | 14 +-
desktop-shell/shell.c | 183 +++--------
desktop-shell/shell.h | 4 +-
fullscreen-shell/fullscreen-shell.c | 54 ++--
ivi-shell/input-panel-ivi.c | 12 +-
protocol/desktop-shell.xml | 138 --------
protocol/fullscreen-shell.xml | 206 ------------
protocol/input-method.xml | 291 -----------------
protocol/linux-dmabuf.xml | 274 ----------------
protocol/presentation_timing.xml | 274 ----------------
protocol/screenshooter.xml | 12 -
protocol/text.xml | 374 ----------------------
protocol/weston-desktop-shell.xml | 134 ++++++++
protocol/weston-screenshooter.xml | 12 +
protocol/workspaces.xml | 27 --
protocol/xdg-shell.xml | 616
------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 50 +--
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +-
src/gl-renderer.c | 6 +-
src/linux-dmabuf.c | 40 +--
src/screen-share.c | 34 +-
src/screenshooter.c | 12 +-
src/text-backend.c | 82 ++---
tests/presentation-test.c | 34 +-
tests/text-test.c | 52 +--
44 files changed, 921 insertions(+), 3108 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
delete mode 100644 protocol/fullscreen-shell.xml
delete mode 100644 protocol/input-method.xml
delete mode 100644 protocol/linux-dmabuf.xml
delete mode 100644 protocol/presentation_timing.xml
delete mode 100644 protocol/screenshooter.xml
delete mode 100644 protocol/text.xml
create mode 100644 protocol/weston-desktop-shell.xml
create mode 100644 protocol/weston-screenshooter.xml
delete mode 100644 protocol/workspaces.xml
delete mode 100644 protocol/xdg-shell.xml
--
2.4.3
_______________________________________________
wayland-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Jonas Ådahl
2015-11-05 01:40:38 UTC
Permalink
Post by Mariusz Ceier
Hi,
Weston doesn't compile with this patchset - some source files in clients
directory still use old or removed headers.
I had to replace xdg-shell-server-protocol.h in desktop-shell/shell.c
with xdg-shell-unstable-v5-server-protocol.h and disable clients
compilation in order to be able to compile weston.
It is. I had forgotten to remove the old generated files from
xdg-shell.xml, but that is now taken care of locally. Thanks for
testing and reviewing.


Jonas
Post by Mariusz Ceier
Mariusz Ceier
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Another protocol left to migrate is scalar.xml. I didn't do this yet
because Pekka had plans on renaming it, and I'll simply wait until he
has a name for it before migrating anything.
Other than that, the wayland-protocols have shaped up some, with the
pointer gestures protocol as well as the protocols of this series
migrated there. I wouldn't mind if people went and had a look to see if
there are any opinions of how things should work before we make an
initial release. The procedures and some details are explained in the
README file in the toplevel directory.
One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?
Jonas
Use fullscreen-shell.xml from wayland-protocols
Use linux-dmabuf protocol from wayland-protocols
Use presentation timing protocol from wayland-protocols
Use text input protocol from wayland-protocols
Use input method protocol from wayland-protocols
Makefile.am: Make the external xml scanning rule version generic
Use xdg_shell protocol from wayland-protocols
desktop-shell: Rename protocol weston_desktop_shell
Rename screenshooter protocol to weston_screenshooter
Remove workspaces protocol
Makefile.am | 194 ++++++------
clients/desktop-shell.c | 79 ++---
clients/editor.c | 119 +++----
clients/fullscreen.c | 60 ++--
clients/keyboard.c | 186 +++++------
clients/presentation-shm.c | 65 ++--
clients/screenshot.c | 21 +-
clients/simple-damage.c | 18 +-
clients/simple-dmabuf.c | 74 ++---
clients/simple-shm.c | 18 +-
clients/weston-info.c | 19 +-
clients/weston-simple-im.c | 122 +++----
clients/window.c | 57 +---
configure.ac | 7 +
desktop-shell/input-panel.c | 14 +-
desktop-shell/shell.c | 183 +++--------
desktop-shell/shell.h | 4 +-
fullscreen-shell/fullscreen-shell.c | 54 ++--
ivi-shell/input-panel-ivi.c | 12 +-
protocol/desktop-shell.xml | 138 --------
protocol/fullscreen-shell.xml | 206 ------------
protocol/input-method.xml | 291 -----------------
protocol/linux-dmabuf.xml | 274 ----------------
protocol/presentation_timing.xml | 274 ----------------
protocol/screenshooter.xml | 12 -
protocol/text.xml | 374 ----------------------
protocol/weston-desktop-shell.xml | 134 ++++++++
protocol/weston-screenshooter.xml | 12 +
protocol/workspaces.xml | 27 --
protocol/xdg-shell.xml | 616
------------------------------------
src/compositor-drm.c | 14 +-
src/compositor-fbdev.c | 2 +-
src/compositor-headless.c | 2 +-
src/compositor-rpi.c | 6 +-
src/compositor-wayland.c | 50 +--
src/compositor-x11.c | 2 +-
src/compositor.c | 29 +-
src/gl-renderer.c | 6 +-
src/linux-dmabuf.c | 40 +--
src/screen-share.c | 34 +-
src/screenshooter.c | 12 +-
src/text-backend.c | 82 ++---
tests/presentation-test.c | 34 +-
tests/text-test.c | 52 +--
44 files changed, 921 insertions(+), 3108 deletions(-)
delete mode 100644 protocol/desktop-shell.xml
delete mode 100644 protocol/fullscreen-shell.xml
delete mode 100644 protocol/input-method.xml
delete mode 100644 protocol/linux-dmabuf.xml
delete mode 100644 protocol/presentation_timing.xml
delete mode 100644 protocol/screenshooter.xml
delete mode 100644 protocol/text.xml
create mode 100644 protocol/weston-desktop-shell.xml
create mode 100644 protocol/weston-screenshooter.xml
delete mode 100644 protocol/workspaces.xml
delete mode 100644 protocol/xdg-shell.xml
--
2.4.3
_______________________________________________
wayland-devel mailing list
http://lists.freedesktop.org/mailman/listinfo/wayland-devel
Pekka Paalanen
2015-11-05 10:21:21 UTC
Permalink
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Hi Jonas,

I'll give any detailed feedback as replies to the patches, here are some
overall comments.
Post by Jonas Ådahl
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?

I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.

Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.

Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.

xdg_shell is setting a precedent for using xdg_ prefix for all
desktoppy but still DE-agnostic extensions, and I think that is fine.
Post by Jonas Ådahl
Another protocol left to migrate is scalar.xml. I didn't do this yet
because Pekka had plans on renaming it, and I'll simply wait until he
has a name for it before migrating anything.
Yeah, inventing a new name for it is hard, but I'll try to come up with
something. Something that implies both scaling and clipping...
something used to create viewport objects...
Post by Jonas Ådahl
Other than that, the wayland-protocols have shaped up some, with the
pointer gestures protocol as well as the protocols of this series
migrated there. I wouldn't mind if people went and had a look to see if
there are any opinions of how things should work before we make an
initial release. The procedures and some details are explained in the
README file in the toplevel directory.
The README looks fine to me on the whole, I sent you some trivial typo
fixes for your consideration.

This puzzles me a bit:

"Each release of wayland-protocols finalizes the version of the
protocols to their state they had at that time. Between each
release, backward incompatible changes can be made to both
stable and major unstable protocol versions as long as the
requirements are held upon release."

It says backward-incompatible changes could be made to also stable
protocols as long as stability is maintained from release to release.
Essentially it means that such changes have to be reverted before the
next release. Is that just to account for accidents?

If wayland-protocols is intended to be released often and as-needed, we
should make sure we don't need such reverts to begin with. Otherwise
the release engineer will have a big review burden. IOW, we should keep
the repo in an always releasable state.

In short, I wouldn't mention the stable protocols in this paragraph.


I looked at the Presentation (feedback) extension in wayland-protocols,
and I saw that you renamed both global and non-global interfaces.

Do we need to rename also non-global interfaces according to the
unstable naming convention?

I assumed renaming the globals would be enough, because it is enough to
bring the runtime discoverability. Renaming also non-global interfaces
seems needless churn on one hand, but it does make it painfully clear
to a developer upgrading to a new major version which places he needs
to review in the code for changes.
Post by Jonas Ådahl
One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?
Do all your ideas still have the same organization when installed as
currently produced from wayland-protocols?

My first thought would be that repository file tree matching the
installed file tree would be nice and obvious.

This is how I would imagine the installed tree worked:

- When an unstable extension gets the major version bumped, we get a
new xml file and none will be removed.

- When an unstable extension gets stabilized, a new xml file for the
stable version is added. The unstable versions are still kept around
for some time before removed, so that projects have time to migrate.

- When a stable or unstable extension gets obsoleted, all its xml files
get moved into the obsolete/ directory at once. (The README in
wayland-protocols talks about "obsolete", not "deprecated", btw.)
This is a clear signal that an extension is going away by breaking
builds, but with a simple fix-up if a project is not willing to drop
it right away.

Have I understood that right?

Now the question is, how to map that to the repository directory
structure? The current way seems fine to me. Why does it seem backwards
to you?

I see that having a sub-directory per extension in stable/ is
superfluous, as there will be just one xml file per extension. The
readmes could be just named by the extension, collected into a single
README, or even just appended into the xml files themselves. The
unstable/ directory obviously needs sub-directories, and obsolete/
probably too.


Thanks,
pq
Bryce Harrington
2015-11-05 19:25:27 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Hi Jonas,
I'll give any detailed feedback as replies to the patches, here are some
overall comments.
Post by Jonas Ådahl
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?
I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.
Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.
Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.
That sounds like a good rule of thumb. I should think it further should
be limited to stuff that we (the Wayland project) intend to provide
stability guarantees for and to maintain as an official interface for
the project.
Post by Pekka Paalanen
"Each release of wayland-protocols finalizes the version of the
protocols to their state they had at that time. Between each
release, backward incompatible changes can be made to both
stable and major unstable protocol versions as long as the
requirements are held upon release."
It says backward-incompatible changes could be made to also stable
protocols as long as stability is maintained from release to release.
Essentially it means that such changes have to be reverted before the
next release. Is that just to account for accidents?
If wayland-protocols is intended to be released often and as-needed, we
should make sure we don't need such reverts to begin with. Otherwise
the release engineer will have a big review burden. IOW, we should keep
the repo in an always releasable state.
In short, I wouldn't mention the stable protocols in this paragraph.
Agreed. It's also not unlikely people will be using snapshots of the
git tree from between releases.

Bryce
Jonas Ådahl
2015-11-06 02:39:12 UTC
Permalink
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Hi Jonas,
I'll give any detailed feedback as replies to the patches, here are some
overall comments.
Post by Jonas Ådahl
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?
I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.
Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.
Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.
xdg_shell is setting a precedent for using xdg_ prefix for all
desktoppy but still DE-agnostic extensions, and I think that is fine.
We discussed this last night on IRC and you expressed that you thought
that the wl_ prefix should be limited to only libwayland-client and
libwayland-server and nothing else.

The resulting idea after that discussion was to use the wp_ prefix
instead of wl_ prefix for future protocols with the exception of the
rare cases where new interfaces actually have to be added to
wayland.xml. I don't know of any examples or plans where this is needed
yet.

This means wl_scaler would become wp_scaler, wl_fullscreen would become
wp_fullscreen, wl_presentation wp_presentation, etc.

We also somewhat concluded that generic sounding name (linux_) should
also be prefixed, meaning linux_dmabuf will become wp_linux_dmabuf, but
maybe we should really use some other prefix for non-generic protocols?
I'm not sure.

Regarding the xdg_ prefix, nothing in particular was concluded. I'm not
sure wp_xdg_ is desirable, but maybe its not that bad. We'll have to
bite this bullet the next time xdg_shell changes, or if some other
protocol depending on xdg_shell is introduced. Opinions? Stay with xdg_?
wp_xdg_? wpxdg? wxdg? wp_desktop_shell? Something else?

Anyhow, I will add the concluded parts to the README.
Post by Pekka Paalanen
Post by Jonas Ådahl
Another protocol left to migrate is scalar.xml. I didn't do this yet
because Pekka had plans on renaming it, and I'll simply wait until he
has a name for it before migrating anything.
Yeah, inventing a new name for it is hard, but I'll try to come up with
something. Something that implies both scaling and clipping...
something used to create viewport objects...
Post by Jonas Ådahl
Other than that, the wayland-protocols have shaped up some, with the
pointer gestures protocol as well as the protocols of this series
migrated there. I wouldn't mind if people went and had a look to see if
there are any opinions of how things should work before we make an
initial release. The procedures and some details are explained in the
README file in the toplevel directory.
The README looks fine to me on the whole, I sent you some trivial typo
fixes for your consideration.
"Each release of wayland-protocols finalizes the version of the
protocols to their state they had at that time. Between each
release, backward incompatible changes can be made to both
stable and major unstable protocol versions as long as the
requirements are held upon release."
It says backward-incompatible changes could be made to also stable
protocols as long as stability is maintained from release to release.
Essentially it means that such changes have to be reverted before the
next release. Is that just to account for accidents?
If wayland-protocols is intended to be released often and as-needed, we
should make sure we don't need such reverts to begin with. Otherwise
the release engineer will have a big review burden. IOW, we should keep
the repo in an always releasable state.
In short, I wouldn't mention the stable protocols in this paragraph.
Yea, not happy with that paragraph. Actually I think the first sentance
is enough, i.e. we can drop evereything after "... had at that time. The
intended purpose was to make it clear that it's allowed to do 'oops,
thats not what i meant' fixups, but that should be clear already I
suppose.
Post by Pekka Paalanen
I looked at the Presentation (feedback) extension in wayland-protocols,
and I saw that you renamed both global and non-global interfaces.
Do we need to rename also non-global interfaces according to the
unstable naming convention?
I assumed renaming the globals would be enough, because it is enough to
bring the runtime discoverability. Renaming also non-global interfaces
seems needless churn on one hand, but it does make it painfully clear
to a developer upgrading to a new major version which places he needs
to review in the code for changes.
The reason is to make it at least possible to implement two versions of
the same unstable protocol in one file. If we'd include
"foo-unstable-v2-server-protocol.h" and
"foo-unstable-v3-server-protocol.h" the non-global interfaces would
collide.
Post by Pekka Paalanen
Post by Jonas Ådahl
One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?
Do all your ideas still have the same organization when installed as
currently produced from wayland-protocols?
No. The one with all protocols in the toplevel/ would be installed as
such. I.e. foo/unstable/foo-unstable-v2.xml and foo/stable/foo.xml. But
this approach is probably my least favorite.
Post by Pekka Paalanen
My first thought would be that repository file tree matching the
installed file tree would be nice and obvious.
- When an unstable extension gets the major version bumped, we get a
new xml file and none will be removed.
- When an unstable extension gets stabilized, a new xml file for the
stable version is added. The unstable versions are still kept around
for some time before removed, so that projects have time to migrate.
This is the problem. How long is that? We might end up with a stable
protocol in the unstable/ directory for a long time.

One of the ideas was to move the -unstable-vN- XML files to an unstable/
or legacy/unstable/ directory in the new directory and add Makefile
magic to install it in the right place.
Post by Pekka Paalanen
- When a stable or unstable extension gets obsoleted, all its xml files
get moved into the obsolete/ directory at once. (The README in
wayland-protocols talks about "obsolete", not "deprecated", btw.)
This is a clear signal that an extension is going away by breaking
builds, but with a simple fix-up if a project is not willing to drop
it right away.
Deprecated is probably a better name than obsolete. Though, I think here
we should be even more careful regarding breaking builds. We should
probably, at least by default, install deprecated protocols in the same
way as before, for some time.
Post by Pekka Paalanen
Have I understood that right?
More or less. The question is whether it would be Ok to break builds,
and if so how "soon"?
Post by Pekka Paalanen
Now the question is, how to map that to the repository directory
structure? The current way seems fine to me. Why does it seem backwards
to you?
Mostly because we'd have the same protocols looking like it's in up to
three concurrent states at the same time. This could be fixed by when
declaring stable / deprecating actually moving all the files while
adding Makefile code to make the installed files structure unchanged.
Post by Pekka Paalanen
I see that having a sub-directory per extension in stable/ is
superfluous, as there will be just one xml file per extension. The
readmes could be just named by the extension, collected into a single
README, or even just appended into the xml files themselves. The
unstable/ directory obviously needs sub-directories, and obsolete/
probably too.
I think having protocols as directories in stable/ even when they are
stable is still preferable. Maybe there will be related data, such as
SVG diagrams and other things, and that would be impossible/inconvenient
if everything is thrown in the same directory.

Personally I'm leaning towards declaring stable means moving the XML
files into a subdirectory in the new protocol directory under the
stable/ toplevel directory, and having the Makefile install the files in
the same way as before. Deprecating would work the same. But if there
are objections to doing things like that I suppose having copies in the
different stability states are fine.


Jonas
Post by Pekka Paalanen
Thanks,
pq
Bryce Harrington
2015-11-06 05:36:18 UTC
Permalink
Post by Jonas Ådahl
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?
I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.
Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.
Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.
xdg_shell is setting a precedent for using xdg_ prefix for all
desktoppy but still DE-agnostic extensions, and I think that is fine.
We discussed this last night on IRC and you expressed that you thought
that the wl_ prefix should be limited to only libwayland-client and
libwayland-server and nothing else.
The resulting idea after that discussion was to use the wp_ prefix
instead of wl_ prefix for future protocols with the exception of the
rare cases where new interfaces actually have to be added to
wayland.xml. I don't know of any examples or plans where this is needed
yet.
This means wl_scaler would become wp_scaler, wl_fullscreen would become
wp_fullscreen, wl_presentation wp_presentation, etc.
I can live with that, although I suspect I'll always read it as Word
Perfect rather than Wayland Protocol...
Post by Jonas Ådahl
We also somewhat concluded that generic sounding name (linux_) should
also be prefixed, meaning linux_dmabuf will become wp_linux_dmabuf, but
maybe we should really use some other prefix for non-generic protocols?
I'm not sure.
Agreed on prefixing these.
Post by Jonas Ådahl
Regarding the xdg_ prefix, nothing in particular was concluded. I'm not
sure wp_xdg_ is desirable, but maybe its not that bad. We'll have to
bite this bullet the next time xdg_shell changes, or if some other
protocol depending on xdg_shell is introduced. Opinions? Stay with xdg_?
wp_xdg_? wpxdg? wxdg? wp_desktop_shell? Something else?
This is probably going to require some debate... which is why I
suggested leaving it as a special case so as not to derail the rest of
the effort. But, I do think it too should be renamed, and I feel fairly
strongly that in doing so we should just discard "xdg" from the name.
Here's my thinking:

1. "xdg" is a prefix used by an actual real open source project which
isn't us. We're not using it inappropriately or anything, but still.
We wouldn't name a protocol kde_foo_thingee to make it more acceptable
to kde folks.

2. As a corollary to #1, using it might suggest the protocol is
something *external* to wayland and not sanctioned by us. Just as if we
prefixed it kde_ people would reasonably assume it was a KDE thing, not
wayland.

3. While there is I guess you could say "marketing" value in including
"XDG" in the name as a way to promote cross-desktop adoption, if it did
have any such value in the past, we're beyond that point now.

4. Many people probably won't know what "XDG" stands for anyway. We
would do as well to just call it wp_common_desktop_shell and it'd be
more comprehensible to the average person and no less cross-desktoppy.

5. I don't think it's really that important that we especially label a
protocol as cross-desktop. After all, the implication is that all
Wayland protocols are intended to be widely usable. I don't think we'd
push a protocol that is usable by only one desktop environment, so in
that sense xdg_ is kind of redundant with wl_ (or wp_).

6. As this is a protocol we want to be standardized, that we want to
actively maintain, and that we want used broadly by Wayland-based
projects, it seems right to give it a simple, prominent name like
wp_desktop_shell.

Anyway, that's my long-winded +1 vote for renaming xdg-shell to
wp_desktop_shell.

Bryce
Jonas Ådahl
2015-11-06 06:22:10 UTC
Permalink
Post by Bryce Harrington
Post by Jonas Ådahl
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?
I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.
Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.
Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.
xdg_shell is setting a precedent for using xdg_ prefix for all
desktoppy but still DE-agnostic extensions, and I think that is fine.
We discussed this last night on IRC and you expressed that you thought
that the wl_ prefix should be limited to only libwayland-client and
libwayland-server and nothing else.
The resulting idea after that discussion was to use the wp_ prefix
instead of wl_ prefix for future protocols with the exception of the
rare cases where new interfaces actually have to be added to
wayland.xml. I don't know of any examples or plans where this is needed
yet.
This means wl_scaler would become wp_scaler, wl_fullscreen would become
wp_fullscreen, wl_presentation wp_presentation, etc.
I can live with that, although I suspect I'll always read it as Word
Perfect rather than Wayland Protocol...
Or WordPress...
Post by Bryce Harrington
Post by Jonas Ådahl
We also somewhat concluded that generic sounding name (linux_) should
also be prefixed, meaning linux_dmabuf will become wp_linux_dmabuf, but
maybe we should really use some other prefix for non-generic protocols?
I'm not sure.
Agreed on prefixing these.
Post by Jonas Ådahl
Regarding the xdg_ prefix, nothing in particular was concluded. I'm not
sure wp_xdg_ is desirable, but maybe its not that bad. We'll have to
bite this bullet the next time xdg_shell changes, or if some other
protocol depending on xdg_shell is introduced. Opinions? Stay with xdg_?
wp_xdg_? wpxdg? wxdg? wp_desktop_shell? Something else?
This is probably going to require some debate... which is why I
suggested leaving it as a special case so as not to derail the rest of
the effort. But, I do think it too should be renamed, and I feel fairly
strongly that in doing so we should just discard "xdg" from the name.
Yea, lets leave any decision to when we need to make it, which is not
before the first release of wayland-protocols.
Post by Bryce Harrington
1. "xdg" is a prefix used by an actual real open source project which
isn't us. We're not using it inappropriately or anything, but still.
We wouldn't name a protocol kde_foo_thingee to make it more acceptable
to kde folks.
I *think* one of the reasons why the prefix is xdg_ was that it was
intended to be developed and maintained as part of the xdg project, and
in that case it makes sense to use that prefix. However, that is not
really how it has worked so far, nor how I assume it will work in the
future, making the prefix a bit unfortunate.
Post by Bryce Harrington
2. As a corollary to #1, using it might suggest the protocol is
something *external* to wayland and not sanctioned by us. Just as if we
prefixed it kde_ people would reasonably assume it was a KDE thing, not
wayland.
3. While there is I guess you could say "marketing" value in including
"XDG" in the name as a way to promote cross-desktop adoption, if it did
have any such value in the past, we're beyond that point now.
4. Many people probably won't know what "XDG" stands for anyway. We
would do as well to just call it wp_common_desktop_shell and it'd be
more comprehensible to the average person and no less cross-desktoppy.
5. I don't think it's really that important that we especially label a
protocol as cross-desktop. After all, the implication is that all
Wayland protocols are intended to be widely usable. I don't think we'd
push a protocol that is usable by only one desktop environment, so in
that sense xdg_ is kind of redundant with wl_ (or wp_).
6. As this is a protocol we want to be standardized, that we want to
actively maintain, and that we want used broadly by Wayland-based
projects, it seems right to give it a simple, prominent name like
wp_desktop_shell.
Anyway, that's my long-winded +1 vote for renaming xdg-shell to
wp_desktop_shell.
I tend to agree with this. It also makes it easier to introduce a
"smartphone" shell or something like that without making it look like
too much like an after thought. One concern I have is that might be
adding sub objects like popup, tooltip, toplevel, will result in long
annoying names. The xdg_ prefix made this quite easy and
distinguishable.


Jonas
Post by Bryce Harrington
Bryce
Pekka Paalanen
2015-11-06 10:48:40 UTC
Permalink
On Fri, 6 Nov 2015 10:39:12 +0800
Post by Jonas Ådahl
Post by Pekka Paalanen
On Wed, 4 Nov 2015 16:49:49 +0800
Post by Jonas Ådahl
Hi,
This series changes weston to depend on wayland-protocols for the
majority of the protocols previously in the protocols/ directory. The
protocols moved are also renamed to comply with the unstable naming
conventions of wayland-protocols, with the exception of xdg_shell which
will use the current name until the next version.
I'd appreciate if maintainers of given protocols could at least Ack the
patch changing their protocol implementation, as a semi formal stamp of
approval of the name change.
Hi Jonas,
I'll give any detailed feedback as replies to the patches, here are some
overall comments.
Post by Jonas Ådahl
Other than that, the workspaces protocol is removed, mostly because it
wasn't a significant enough proof of concept needed for any particular
feature. text-cursor-position.xml however I have left intact, because
without it the zoom accessibility feature proof of concept becomes
a bit too useless. I'd prefer to prefix it with something like toy_ or
weston_, but would like to hear input on this one. Given that it is
completely undocumented it is quite far from a real attempt, but it
seems like something that will be needed sooner or later for
accessibility reasons, so not sure what to do with it right now.
Things that seemed more weston specific was weston_ prefixed. The
screenshooter protocol and the desktop shell protocol fell into this
category.
Speaking of prefixes, do we have an idea what protocols should use the
wl_ prefix and what shouldn't?
I have had the feeling that wl_ is only Wayland core. But what does
Wayland core mean? And wl_shell is an exception already.
Should we restrict wl_ to only for things in wayland.xml? Probably not,
as I think wl_ in e.g. wl_scaler is justified since it's a "low-level"
generic feature, and yet wl_scaler will not be added into wayland.xml.
Perhaps wl_ prefix should be reserved for extensions that are usable
regardless of a shell or environment. I'm not sure if the input method
extensions would be eligible for wl_ or not, or what to do with
fullscreen shell.
xdg_shell is setting a precedent for using xdg_ prefix for all
desktoppy but still DE-agnostic extensions, and I think that is fine.
We discussed this last night on IRC and you expressed that you thought
that the wl_ prefix should be limited to only libwayland-client and
libwayland-server and nothing else.
Indeed.

The rationale I gave in IRC is that if we look at how the wl_ prefix is
currently used, unstable protocols notwithstanding, we have it for
normal libwayland functions and protocol interfaces in wayland.xml. The
common factor here is that they all are in libwayland (which even
installs generated C bindings for wayland.xml), so it would be logical
to have wl_ mean "Wayland library".

The earlier interpretation of wl_ meaning "Wayland core protocol" was
encumbered by libwayland having non-protocol functions and types with
that prefix and wayland.xml containing wl_shell. We don't really think
wl_shell as Wayland core because it is specific to desktops, I think.
Post by Jonas Ådahl
The resulting idea after that discussion was to use the wp_ prefix
instead of wl_ prefix for future protocols with the exception of the
rare cases where new interfaces actually have to be added to
wayland.xml. I don't know of any examples or plans where this is needed
yet.
This means wl_scaler would become wp_scaler, wl_fullscreen would become
wp_fullscreen, wl_presentation wp_presentation, etc.
wp_ is just whatever came first to my mind, from "Wayland protocol".

I'd like to say "better suggestions welcome", but I don't want to delay
this work on bikeshedding on it, so I'll just say: "if there is a good
reason to not use wp_, tell us now!"
Post by Jonas Ådahl
We also somewhat concluded that generic sounding name (linux_) should
also be prefixed, meaning linux_dmabuf will become wp_linux_dmabuf, but
maybe we should really use some other prefix for non-generic protocols?
I'm not sure.
wp_linux_dmabuf works for me, and should address the concerns Daniel
Stone had about namespace clashes. I think wp_linux_ is appropriate: it
is generic in the sense that it does not have any ties to shells, DEs or
other non-generic extensions, and it is specific to linux (until other
OSs implement dmabuf support).

Whether non-generic extensions use prefix foo_ or wp_foo_, I don't
really care per se. If foo_ alone is distinguishing enough, I'm ok
either way. However, using wp_ prefix for a non-generic extension
without any other prefix is something I'd like to avoid. IOW, I would
not like e.g. wp_popup, because popups are inherently a shell concept
and therefore need scoping to the shell protocol.
Post by Jonas Ådahl
Regarding the xdg_ prefix, nothing in particular was concluded. I'm not
sure wp_xdg_ is desirable, but maybe its not that bad. We'll have to
bite this bullet the next time xdg_shell changes, or if some other
protocol depending on xdg_shell is introduced. Opinions? Stay with xdg_?
wp_xdg_? wpxdg? wxdg? wp_desktop_shell? Something else?
If those are awkward, how about de_?
Post by Jonas Ådahl
Anyhow, I will add the concluded parts to the README.
Post by Pekka Paalanen
I looked at the Presentation (feedback) extension in wayland-protocols,
and I saw that you renamed both global and non-global interfaces.
Do we need to rename also non-global interfaces according to the
unstable naming convention?
I assumed renaming the globals would be enough, because it is enough to
bring the runtime discoverability. Renaming also non-global interfaces
seems needless churn on one hand, but it does make it painfully clear
to a developer upgrading to a new major version which places he needs
to review in the code for changes.
The reason is to make it at least possible to implement two versions of
the same unstable protocol in one file. If we'd include
"foo-unstable-v2-server-protocol.h" and
"foo-unstable-v3-server-protocol.h" the non-global interfaces would
collide.
That is a good practical justification. Ok!
Post by Jonas Ådahl
Post by Pekka Paalanen
Post by Jonas Ådahl
One current inconvenience that would be nice with some opinions is what
to do with unstable protocol files after a protocol has been declared
stable. Currently specified to work by having one directory containing
the stable XML file together with a README in the stable/ toplevel
directory, and yet another directory containing the unstable protocol
files together with a README in the unstable/ directory. This seems a bit
backward to me. Deprecating a protocol by moving it into deprecated/
would still require us to have the protocol in the stable/ and probably
even in the unstable/ directory. This all is a bit awkward to me. One
idea is restructure the tree a bit and put protocols in the directory of
the current state (stable/unstable/obsolete) and then keep the old XML
files in subdirectories in there, having the Makefile deal with
installing XML files appropriately in the corresponding
stable/unstable/obsolete directories. Or we could have all protocols in
the toplevel directory and always have the corresponding XML files in
stable/unstable/obsolete subdirectories and just installing that. Any
opinions about this?
Do all your ideas still have the same organization when installed as
currently produced from wayland-protocols?
No. The one with all protocols in the toplevel/ would be installed as
such. I.e. foo/unstable/foo-unstable-v2.xml and foo/stable/foo.xml. But
this approach is probably my least favorite.
Post by Pekka Paalanen
My first thought would be that repository file tree matching the
installed file tree would be nice and obvious.
- When an unstable extension gets the major version bumped, we get a
new xml file and none will be removed.
- When an unstable extension gets stabilized, a new xml file for the
stable version is added. The unstable versions are still kept around
for some time before removed, so that projects have time to migrate.
This is the problem. How long is that? We might end up with a stable
protocol in the unstable/ directory for a long time.
N releases? N months? Does it matter too much? But see below.
Post by Jonas Ådahl
One of the ideas was to move the -unstable-vN- XML files to an unstable/
or legacy/unstable/ directory in the new directory and add Makefile
magic to install it in the right place.
But if the installed tree will remain the same, what good does
rearranging the git repository layout do?
Post by Jonas Ådahl
Post by Pekka Paalanen
- When a stable or unstable extension gets obsoleted, all its xml files
get moved into the obsolete/ directory at once. (The README in
wayland-protocols talks about "obsolete", not "deprecated", btw.)
This is a clear signal that an extension is going away by breaking
builds, but with a simple fix-up if a project is not willing to drop
it right away.
Deprecated is probably a better name than obsolete. Though, I think here
we should be even more careful regarding breaking builds. We should
probably, at least by default, install deprecated protocols in the same
way as before, for some time.
Post by Pekka Paalanen
Have I understood that right?
More or less. The question is whether it would be Ok to break builds,
and if so how "soon"?
Post by Pekka Paalanen
Now the question is, how to map that to the repository directory
structure? The current way seems fine to me. Why does it seem backwards
to you?
Mostly because we'd have the same protocols looking like it's in up to
three concurrent states at the same time. This could be fixed by when
declaring stable / deprecating actually moving all the files while
adding Makefile code to make the installed files structure unchanged.
The same question: if installed tree remains the same, what's the
benefit?

Ok, it seems like we need two levels of communication here:
1. announcement that a protocol is stabilized or deprecated
2. breaking everyone's build who uses outdated versions.

Step 1 is usually communicated on a mailing list, but if we need a
clear note in the git repository, and adding a sentence in README is
not visible enough, then, say, let's add a file STABILIZED or DEPRECATED
in the protocol's directory. I think that would have practically the
same effect as moving files around in the git repo and still installing
the same file tree layout, but without the hassle to adjust Makefiles
and checking things actually get installed the right way.

Step 2 is where we change where xml files get installed, which will
break builds that try to use outdated files. This is the forced wake-up
call for all projects, but still not a big deal, because the projects
can just check against the wayland-protocols version on which directory
to find the old files. If they choose to keep on using the old files,
at least they do it knowingly.

I suppose when a protocol is stabilized, then in step 2 we would move
the unstable versions into the deprecated directory rather than remove
them.

Cleaning up, that is, really removing protocols that are not supposed
to be used anymore, can be done after years then.

Would this be satisfactory?
Post by Jonas Ådahl
Post by Pekka Paalanen
I see that having a sub-directory per extension in stable/ is
superfluous, as there will be just one xml file per extension. The
readmes could be just named by the extension, collected into a single
README, or even just appended into the xml files themselves. The
unstable/ directory obviously needs sub-directories, and obsolete/
probably too.
I think having protocols as directories in stable/ even when they are
stable is still preferable. Maybe there will be related data, such as
SVG diagrams and other things, and that would be impossible/inconvenient
if everything is thrown in the same directory.
A good point.
Post by Jonas Ådahl
Personally I'm leaning towards declaring stable means moving the XML
files into a subdirectory in the new protocol directory under the
stable/ toplevel directory, and having the Makefile install the files in
the same way as before. Deprecating would work the same. But if there
are objections to doing things like that I suppose having copies in the
different stability states are fine.
I'm losing track of all these directories. :-)

I'd suggest the only time we can have a functionally identical copy of
a protocol in more than one place is when the last unstable version is
copied to stable, before the unstable versions get moved to deprecated.

So, what I have in mind in summary:

- unstable protocols we have already figured out
- stabilizing a protocol involves copying it from unstable to stable
directory, and marking the unstable as deprecated (step 1)
- deprecating a stable or unstable protocol starts with step 1
- when we want to do the wake-up call on a deprecated protocol,
do step 2
- final removal of deprecated files after step 2 can be done years after

How's that?

I am assuming that the directory structure in the git repository will
match the directory structure of the installed files. I think this
would be more clear than the Makefile installing some with matching
structure and some not. This would also allow using wayland-protocols
without installing it.


Thanks,
pq
ahmet acar
2015-11-06 15:05:57 UTC
Permalink
Post by Jonas Ådahl
More or less. The question is whether it would be Ok to break builds,
and if so how "soon"?
are builds have to breaks?

If build systems smarts enought(no needs for so complicated)

and its behaivour known clearly both by you upstream devs and downstream clients

then it able to handle all cases?

A pseudocode instance:

if(exists("protocol_foo_v1.xml"))
{
do_stuff

}

else if(exists("deprecated/protocol_foo_v1.xml"))
{
do_stuff

}

else
{
do_stuff

}

or something similar. regards.
Loading...