*micro = WESTON_VERSION_MICRO;
}
+static const struct {
+ uint32_t bit;
+ const char *desc;
+} capability_strings[] = {
+ { WESTON_CAP_ROTATION_ANY, "arbitrary surface rotation:" },
+};
+
+static void
+weston_compositor_log_capabilities(struct weston_compositor *compositor)
+{
+ unsigned i;
+ int yes;
+
+ weston_log("Compositor capabilities:\n");
+ for (i = 0; i < ARRAY_LENGTH(capability_strings); i++) {
+ yes = compositor->capabilities & capability_strings[i].bit;
+ weston_log_continue(STAMP_SPACE "%s %s\n",
+ capability_strings[i].desc,
+ yes ? "yes" : "no");
+ }
+}
+
static int on_term_signal(int signal_number, void *data)
{
struct wl_display *display = data;
goto out;
}
+ weston_compositor_log_capabilities(ec);
+
if (wl_display_add_socket(display, socket_name)) {
weston_log("fatal: failed to add socket: %m\n");
ret = EXIT_FAILURE;
void (*destroy)(struct weston_compositor *ec);
};
+enum weston_capability {
+ /* backend/renderer supports arbitrary rotation */
+ WESTON_CAP_ROTATION_ANY = 0x0001,
+};
+
struct weston_compositor {
struct wl_signal destroy_signal;
/* Repaint state. */
struct weston_plane primary_plane;
+ uint32_t capabilities; /* combination of enum weston_capability */
uint32_t focus;
}
ec->renderer = &gr->base;
+ ec->capabilities |= WESTON_CAP_ROTATION_ANY;
return 0;
renderer->base.destroy_surface = pixman_renderer_destroy_surface;
renderer->base.destroy = pixman_renderer_destroy;
ec->renderer = &renderer->base;
+ ec->capabilities |= WESTON_CAP_ROTATION_ANY;
weston_compositor_add_debug_binding(ec, KEY_R,
debug_binding, ec);
shell);
weston_compositor_add_button_binding(ec, BTN_MIDDLE, mod,
resize_binding, shell);
- weston_compositor_add_button_binding(ec, BTN_RIGHT, mod,
- rotate_binding, NULL);
+
+ if (ec->capabilities & WESTON_CAP_ROTATION_ANY)
+ weston_compositor_add_button_binding(ec, BTN_RIGHT, mod,
+ rotate_binding, NULL);
+
weston_compositor_add_key_binding(ec, KEY_TAB, mod, switcher_binding,
shell);
weston_compositor_add_key_binding(ec, KEY_F9, mod, backlight_binding,