| 1 | // Hand-edited to resolve conflicts with xdg-shell stable | 
| 2 | /* | 
| 3 |  * Copyright © 2008-2013 Kristian Høgsberg | 
| 4 |  * Copyright © 2013      Rafael Antognolli | 
| 5 |  * Copyright © 2013      Jasper St. Pierre | 
| 6 |  * Copyright © 2010-2013 Intel Corporation | 
| 7 |  * | 
| 8 |  * Permission is hereby granted, free of charge, to any person obtaining a | 
| 9 |  * copy of this software and associated documentation files (the "Software"), | 
| 10 |  * to deal in the Software without restriction, including without limitation | 
| 11 |  * the rights to use, copy, modify, merge, publish, distribute, sublicense, | 
| 12 |  * and/or sell copies of the Software, and to permit persons to whom the | 
| 13 |  * Software is furnished to do so, subject to the following conditions: | 
| 14 |  * | 
| 15 |  * The above copyright notice and this permission notice (including the next | 
| 16 |  * paragraph) shall be included in all copies or substantial portions of the | 
| 17 |  * Software. | 
| 18 |  * | 
| 19 |  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | 
| 20 |  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | 
| 21 |  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL | 
| 22 |  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | 
| 23 |  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | 
| 24 |  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 
| 25 |  * DEALINGS IN THE SOFTWARE. | 
| 26 |  */ | 
| 27 | #ifndef QT_WAYLAND_XDG_SHELL_UNSTABLE_V5 | 
| 28 | #define QT_WAYLAND_XDG_SHELL_UNSTABLE_V5 | 
| 29 |  | 
| 30 | #include "wayland-xdg-shell-unstable-v5-client-protocol_p.h" | 
| 31 | #include <QByteArray> | 
| 32 | #include <QString> | 
| 33 |  | 
| 34 | struct wl_registry; | 
| 35 |  | 
| 36 | QT_BEGIN_NAMESPACE | 
| 37 | QT_WARNING_PUSH | 
| 38 | QT_WARNING_DISABLE_GCC("-Wmissing-field-initializers" ) | 
| 39 |  | 
| 40 | namespace QtWayland { | 
| 41 |     class  xdg_shell_v5 | 
| 42 |     { | 
| 43 |     public: | 
| 44 |         xdg_shell_v5(struct ::wl_registry *registry, int id, int version); | 
| 45 |         xdg_shell_v5(struct ::xdg_shell_v5 *object); | 
| 46 |         xdg_shell_v5(); | 
| 47 |  | 
| 48 |         virtual ~xdg_shell_v5(); | 
| 49 |  | 
| 50 |         void init(struct ::wl_registry *registry, int id, int version); | 
| 51 |         void init(struct ::xdg_shell_v5 *object); | 
| 52 |  | 
| 53 |         struct ::xdg_shell_v5 *object() { return m_xdg_shell; } | 
| 54 |         const struct ::xdg_shell_v5 *object() const { return m_xdg_shell; } | 
| 55 |  | 
| 56 |         bool isInitialized() const; | 
| 57 |  | 
| 58 |         static const struct ::wl_interface *interface(); | 
| 59 |  | 
| 60 |         enum version { | 
| 61 |             version_current = 5 // Always the latest version | 
| 62 |         }; | 
| 63 |  | 
| 64 |         enum error { | 
| 65 |             error_role = 0, // given wl_surface has another role | 
| 66 |             error_defunct_surfaces = 1, // xdg_shell was destroyed before children | 
| 67 |             error_not_the_topmost_popup = 2, // the client tried to map or destroy a non-topmost popup | 
| 68 |             error_invalid_popup_parent = 3 // the client specified an invalid popup parent surface | 
| 69 |         }; | 
| 70 |  | 
| 71 |         void destroy(); | 
| 72 |         void use_unstable_version(int32_t version); | 
| 73 |         struct ::xdg_surface_v5 *get_xdg_surface(struct ::wl_surface *surface); | 
| 74 |         struct ::xdg_popup_v5 *get_xdg_popup(struct ::wl_surface *surface, struct ::wl_surface *parent, struct ::wl_seat *seat, uint32_t serial, int32_t x, int32_t y); | 
| 75 |         void pong(uint32_t serial); | 
| 76 |  | 
| 77 |     protected: | 
| 78 |         virtual void xdg_shell_ping(uint32_t serial); | 
| 79 |  | 
| 80 |     private: | 
| 81 |         void init_listener(); | 
| 82 |         static const struct xdg_shell_listener m_xdg_shell_listener; | 
| 83 |         static void handle_ping( | 
| 84 |             void *data, | 
| 85 |             struct ::xdg_shell_v5 *object, | 
| 86 |             uint32_t serial); | 
| 87 |         struct ::xdg_shell_v5 *m_xdg_shell; | 
| 88 |     }; | 
| 89 |  | 
| 90 |     class  xdg_surface_v5 | 
| 91 |     { | 
| 92 |     public: | 
| 93 |         xdg_surface_v5(struct ::wl_registry *registry, int id, int version); | 
| 94 |         xdg_surface_v5(struct ::xdg_surface_v5 *object); | 
| 95 |         xdg_surface_v5(); | 
| 96 |  | 
| 97 |         virtual ~xdg_surface_v5(); | 
| 98 |  | 
| 99 |         void init(struct ::wl_registry *registry, int id, int version); | 
| 100 |         void init(struct ::xdg_surface_v5 *object); | 
| 101 |  | 
| 102 |         struct ::xdg_surface_v5 *object() { return m_xdg_surface; } | 
| 103 |         const struct ::xdg_surface_v5 *object() const { return m_xdg_surface; } | 
| 104 |  | 
| 105 |         bool isInitialized() const; | 
| 106 |  | 
| 107 |         static const struct ::wl_interface *interface(); | 
| 108 |  | 
| 109 |         enum resize_edge { | 
| 110 |             resize_edge_none = 0, | 
| 111 |             resize_edge_top = 1, | 
| 112 |             resize_edge_bottom = 2, | 
| 113 |             resize_edge_left = 4, | 
| 114 |             resize_edge_top_left = 5, | 
| 115 |             resize_edge_bottom_left = 6, | 
| 116 |             resize_edge_right = 8, | 
| 117 |             resize_edge_top_right = 9, | 
| 118 |             resize_edge_bottom_right = 10 | 
| 119 |         }; | 
| 120 |  | 
| 121 |         enum state { | 
| 122 |             state_maximized = 1, // the surface is maximized | 
| 123 |             state_fullscreen = 2, // the surface is fullscreen | 
| 124 |             state_resizing = 3, | 
| 125 |             state_activated = 4 | 
| 126 |         }; | 
| 127 |  | 
| 128 |         void destroy(); | 
| 129 |         void set_parent(struct ::xdg_surface_v5 *parent); | 
| 130 |         void set_title(const QString &title); | 
| 131 |         void set_app_id(const QString &app_id); | 
| 132 |         void show_window_menu(struct ::wl_seat *seat, uint32_t serial, int32_t x, int32_t y); | 
| 133 |         void move(struct ::wl_seat *seat, uint32_t serial); | 
| 134 |         void resize(struct ::wl_seat *seat, uint32_t serial, uint32_t edges); | 
| 135 |         void ack_configure(uint32_t serial); | 
| 136 |         void set_window_geometry(int32_t x, int32_t y, int32_t width, int32_t height); | 
| 137 |         void set_maximized(); | 
| 138 |         void unset_maximized(); | 
| 139 |         void set_fullscreen(struct ::wl_output *output); | 
| 140 |         void unset_fullscreen(); | 
| 141 |         void set_minimized(); | 
| 142 |  | 
| 143 |     protected: | 
| 144 |         virtual void xdg_surface_configure(int32_t width, int32_t height, wl_array *states, uint32_t serial); | 
| 145 |         virtual void xdg_surface_close(); | 
| 146 |  | 
| 147 |     private: | 
| 148 |         void init_listener(); | 
| 149 |         static const struct xdg_surface_listener m_xdg_surface_listener; | 
| 150 |         static void handle_configure( | 
| 151 |             void *data, | 
| 152 |             struct ::xdg_surface_v5 *object, | 
| 153 |             int32_t width, | 
| 154 |             int32_t height, | 
| 155 |             wl_array *states, | 
| 156 |             uint32_t serial); | 
| 157 |         static void handle_close( | 
| 158 |             void *data, | 
| 159 |             struct ::xdg_surface_v5 *object); | 
| 160 |         struct ::xdg_surface_v5 *m_xdg_surface; | 
| 161 |     }; | 
| 162 |  | 
| 163 |     class  xdg_popup_v5 | 
| 164 |     { | 
| 165 |     public: | 
| 166 |         xdg_popup_v5(struct ::wl_registry *registry, int id, int version); | 
| 167 |         xdg_popup_v5(struct ::xdg_popup_v5 *object); | 
| 168 |         xdg_popup_v5(); | 
| 169 |  | 
| 170 |         virtual ~xdg_popup_v5(); | 
| 171 |  | 
| 172 |         void init(struct ::wl_registry *registry, int id, int version); | 
| 173 |         void init(struct ::xdg_popup_v5 *object); | 
| 174 |  | 
| 175 |         struct ::xdg_popup_v5 *object() { return m_xdg_popup; } | 
| 176 |         const struct ::xdg_popup_v5 *object() const { return m_xdg_popup; } | 
| 177 |  | 
| 178 |         bool isInitialized() const; | 
| 179 |  | 
| 180 |         static const struct ::wl_interface *interface(); | 
| 181 |  | 
| 182 |         void destroy(); | 
| 183 |  | 
| 184 |     protected: | 
| 185 |         virtual void xdg_popup_popup_done(); | 
| 186 |  | 
| 187 |     private: | 
| 188 |         void init_listener(); | 
| 189 |         static const struct xdg_popup_listener m_xdg_popup_listener; | 
| 190 |         static void handle_popup_done( | 
| 191 |             void *data, | 
| 192 |             struct ::xdg_popup_v5 *object); | 
| 193 |         struct ::xdg_popup_v5 *m_xdg_popup; | 
| 194 |     }; | 
| 195 | } | 
| 196 |  | 
| 197 | QT_WARNING_POP | 
| 198 | QT_END_NAMESPACE | 
| 199 |  | 
| 200 | #endif | 
| 201 |  |