devilhorns pushed a commit to branch devs/devilhorns/wayland.

commit dcd3c1de1bbf3ea90662b21a4963869bc076d1e0
Author: Chris Michael <[email protected]>
Date:   Thu Mar 7 08:49:11 2013 +0000

    Update desktop_shell protocol code & header.
    
    Signed-off-by: Chris Michael <[email protected]>
---
 src/modules/wl_shell/e_desktop_shell_protocol.c | 42 ++++++++++++++-----------
 src/modules/wl_shell/e_desktop_shell_protocol.h | 36 +++++++++++++++++++--
 2 files changed, 57 insertions(+), 21 deletions(-)

diff --git a/src/modules/wl_shell/e_desktop_shell_protocol.c 
b/src/modules/wl_shell/e_desktop_shell_protocol.c
index 3ad8687..ae531cf 100644
--- a/src/modules/wl_shell/e_desktop_shell_protocol.c
+++ b/src/modules/wl_shell/e_desktop_shell_protocol.c
@@ -3,54 +3,58 @@
 #include "wayland-util.h"
 
 extern const struct wl_interface wl_output_interface;
-extern const struct wl_interface wl_shell_surface_interface;
+extern const struct wl_interface wl_surface_interface;
 extern const struct wl_interface wl_output_interface;
-extern const struct wl_interface wl_shell_surface_interface;
-extern const struct wl_interface wl_shell_surface_interface;
-extern const struct wl_interface wl_shell_surface_interface;
-extern const struct wl_interface wl_shell_surface_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_surface_interface;
 extern const struct wl_interface wl_output_interface;
 
 static const struct wl_interface *types[] = {
+       NULL,
        &wl_output_interface,
-       &wl_shell_surface_interface,
+       &wl_surface_interface,
        &wl_output_interface,
-       &wl_shell_surface_interface,
-       &wl_shell_surface_interface,
-       NULL,
+       &wl_surface_interface,
+       &wl_surface_interface,
+       &wl_surface_interface,
        NULL,
-       &wl_shell_surface_interface,
+       &wl_surface_interface,
        NULL,
        NULL,
-       &wl_shell_surface_interface,
+       &wl_surface_interface,
        &wl_output_interface,
 };
 
 static const struct wl_message desktop_shell_requests[] = {
-       { "set_background", "oo", types + 0 },
-       { "set_panel", "oo", types + 2 },
-       { "set_lock_surface", "o", types + 4 },
+       { "set_background", "oo", types + 1 },
+       { "set_panel", "oo", types + 3 },
+       { "set_lock_surface", "o", types + 5 },
        { "unlock", "", types + 0 },
+       { "set_grab_surface", "o", types + 6 },
 };
 
 static const struct wl_message desktop_shell_events[] = {
-       { "configure", "uuoii", types + 5 },
+       { "configure", "uoii", types + 7 },
        { "prepare_lock_surface", "", types + 0 },
+       { "grab_cursor", "u", types + 0 },
 };
 
 WL_EXPORT const struct wl_interface desktop_shell_interface = {
        "desktop_shell", 1,
-       ARRAY_LENGTH(desktop_shell_requests), desktop_shell_requests,
-       ARRAY_LENGTH(desktop_shell_events), desktop_shell_events,
+       5, desktop_shell_requests,
+       3, desktop_shell_events,
 };
 
 static const struct wl_message screensaver_requests[] = {
-       { "set_surface", "oo", types + 10 },
+       { "set_surface", "oo", types + 11 },
 };
 
 WL_EXPORT const struct wl_interface screensaver_interface = {
        "screensaver", 1,
-       ARRAY_LENGTH(screensaver_requests), screensaver_requests,
+       1, screensaver_requests,
        0, NULL,
 };
 
diff --git a/src/modules/wl_shell/e_desktop_shell_protocol.h 
b/src/modules/wl_shell/e_desktop_shell_protocol.h
index fcb310a..e42f75d 100644
--- a/src/modules/wl_shell/e_desktop_shell_protocol.h
+++ b/src/modules/wl_shell/e_desktop_shell_protocol.h
@@ -18,6 +18,24 @@ struct screensaver;
 extern const struct wl_interface desktop_shell_interface;
 extern const struct wl_interface screensaver_interface;
 
+#ifndef DESKTOP_SHELL_CURSOR_ENUM
+#define DESKTOP_SHELL_CURSOR_ENUM
+enum desktop_shell_cursor {
+       DESKTOP_SHELL_CURSOR_NONE = 0,
+       DESKTOP_SHELL_CURSOR_RESIZE_TOP = 1,
+       DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM = 2,
+       DESKTOP_SHELL_CURSOR_ARROW = 3,
+       DESKTOP_SHELL_CURSOR_RESIZE_LEFT = 4,
+       DESKTOP_SHELL_CURSOR_RESIZE_TOP_LEFT = 5,
+       DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_LEFT = 6,
+       DESKTOP_SHELL_CURSOR_MOVE = 7,
+       DESKTOP_SHELL_CURSOR_RESIZE_RIGHT = 8,
+       DESKTOP_SHELL_CURSOR_RESIZE_TOP_RIGHT = 9,
+       DESKTOP_SHELL_CURSOR_RESIZE_BOTTOM_RIGHT = 10,
+       DESKTOP_SHELL_CURSOR_BUSY = 11,
+};
+#endif /* DESKTOP_SHELL_CURSOR_ENUM */
+
 struct desktop_shell_interface {
        /**
         * set_background - (none)
@@ -49,15 +67,23 @@ struct desktop_shell_interface {
         */
        void (*unlock)(struct wl_client *client,
                       struct wl_resource *resource);
+       /**
+        * set_grab_surface - (none)
+        * @surface: (none)
+        */
+       void (*set_grab_surface)(struct wl_client *client,
+                                struct wl_resource *resource,
+                                struct wl_resource *surface);
 };
 
 #define DESKTOP_SHELL_CONFIGURE        0
 #define DESKTOP_SHELL_PREPARE_LOCK_SURFACE     1
+#define DESKTOP_SHELL_GRAB_CURSOR      2
 
 static inline void
-desktop_shell_send_configure(struct wl_resource *resource_, uint32_t time, 
uint32_t edges, struct wl_resource *surface, int32_t width, int32_t height)
+desktop_shell_send_configure(struct wl_resource *resource_, uint32_t edges, 
struct wl_resource *surface, int32_t width, int32_t height)
 {
-       wl_resource_post_event(resource_, DESKTOP_SHELL_CONFIGURE, time, edges, 
surface, width, height);
+       wl_resource_post_event(resource_, DESKTOP_SHELL_CONFIGURE, edges, 
surface, width, height);
 }
 
 static inline void
@@ -66,6 +92,12 @@ desktop_shell_send_prepare_lock_surface(struct wl_resource 
*resource_)
        wl_resource_post_event(resource_, DESKTOP_SHELL_PREPARE_LOCK_SURFACE);
 }
 
+static inline void
+desktop_shell_send_grab_cursor(struct wl_resource *resource_, uint32_t cursor)
+{
+       wl_resource_post_event(resource_, DESKTOP_SHELL_GRAB_CURSOR, cursor);
+}
+
 struct screensaver_interface {
        /**
         * set_surface - (none)

-- 

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to 
tackle endpoint security challenges, access the full report. 
http://p.sf.net/sfu/symantec-dev2dev

Reply via email to