src/video/wayland/SDL_waylandtouch.h
changeset 8104 2e4f1bd21196
parent 8082 5b83ad3f01ac
child 8149 681eb46b8ac4
equal deleted inserted replaced
8103:d4a88c49247e 8104:2e4f1bd21196
    17   2. Altered source versions must be plainly marked as such, and must not be
    17   2. Altered source versions must be plainly marked as such, and must not be
    18      misrepresented as being the original software.
    18      misrepresented as being the original software.
    19   3. This notice may not be removed or altered from any source distribution.
    19   3. This notice may not be removed or altered from any source distribution.
    20 */
    20 */
    21 
    21 
    22 #include "SDL_config.h"
    22 #include "../../SDL_internal.h"
    23 
    23 
    24 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
    24 #ifdef SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH
    25 
    25 
    26 #ifndef _SDL_waylandtouch_h
    26 #ifndef _SDL_waylandtouch_h
    27 #define _SDL_waylandtouch_h
    27 #define _SDL_waylandtouch_h
    28 
    28 
    29 #include "SDL_waylandvideo.h"
    29 #include "SDL_waylandvideo.h"
    30 #include <stdint.h>
    30 #include <stdint.h>
    31 #include <stddef.h>
    31 #include <stddef.h>
    32 #include "wayland-client.h"
       
    33 #include "wayland-util.h"
    32 #include "wayland-util.h"
       
    33 #include "SDL_waylanddyn.h"
       
    34 
    34 
    35 
    35 void Wayland_touch_create(SDL_VideoData *data, uint32_t id);
    36 void Wayland_touch_create(SDL_VideoData *data, uint32_t id);
    36 void Wayland_touch_destroy(SDL_VideoData *data);
    37 void Wayland_touch_destroy(SDL_VideoData *data);
    37 
    38 
    38 struct qt_touch_extension;
    39 struct qt_touch_extension;
    87 }
    88 }
    88 
    89 
    89 static inline void
    90 static inline void
    90 qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension)
    91 qt_surface_extension_destroy(struct qt_surface_extension *qt_surface_extension)
    91 {
    92 {
    92     wl_proxy_destroy((struct wl_proxy *) qt_surface_extension);
    93     WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_surface_extension);
    93 }
    94 }
    94 
    95 
    95 static inline struct qt_extended_surface *
    96 static inline struct qt_extended_surface *
    96 qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface)
    97 qt_surface_extension_get_extended_surface(struct qt_surface_extension *qt_surface_extension, struct wl_surface *surface)
    97 {
    98 {
   100     id = wl_proxy_create((struct wl_proxy *) qt_surface_extension,
   101     id = wl_proxy_create((struct wl_proxy *) qt_surface_extension,
   101                  &qt_extended_surface_interface);
   102                  &qt_extended_surface_interface);
   102     if (!id)
   103     if (!id)
   103         return NULL;
   104         return NULL;
   104 
   105 
   105     wl_proxy_marshal((struct wl_proxy *) qt_surface_extension,
   106     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_surface_extension,
   106              QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, id, surface);
   107              QT_SURFACE_EXTENSION_GET_EXTENDED_SURFACE, id, surface);
   107 
   108 
   108     return (struct qt_extended_surface *) id;
   109     return (struct qt_extended_surface *) id;
   109 }
   110 }
   110 
   111 
   164 #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS    2
   165 #define QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS    2
   165 
   166 
   166 static inline void
   167 static inline void
   167 qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data)
   168 qt_extended_surface_set_user_data(struct qt_extended_surface *qt_extended_surface, void *user_data)
   168 {
   169 {
   169     wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data);
   170     WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_extended_surface, user_data);
   170 }
   171 }
   171 
   172 
   172 static inline void *
   173 static inline void *
   173 qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface)
   174 qt_extended_surface_get_user_data(struct qt_extended_surface *qt_extended_surface)
   174 {
   175 {
   175     return wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface);
   176     return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_extended_surface);
   176 }
   177 }
   177 
   178 
   178 static inline void
   179 static inline void
   179 qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface)
   180 qt_extended_surface_destroy(struct qt_extended_surface *qt_extended_surface)
   180 {
   181 {
   181     wl_proxy_destroy((struct wl_proxy *) qt_extended_surface);
   182     WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_extended_surface);
   182 }
   183 }
   183 
   184 
   184 static inline void
   185 static inline void
   185 qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value)
   186 qt_extended_surface_update_generic_property(struct qt_extended_surface *qt_extended_surface, const char *name, struct wl_array *value)
   186 {
   187 {
   187     wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   188     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   188              QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value);
   189              QT_EXTENDED_SURFACE_UPDATE_GENERIC_PROPERTY, name, value);
   189 }
   190 }
   190 
   191 
   191 static inline void
   192 static inline void
   192 qt_extended_surface_set_content_orientation(struct qt_extended_surface *qt_extended_surface, int32_t orientation)
   193 qt_extended_surface_set_content_orientation(struct qt_extended_surface *qt_extended_surface, int32_t orientation)
   193 {
   194 {
   194     wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   195     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   195              QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION, orientation);
   196              QT_EXTENDED_SURFACE_SET_CONTENT_ORIENTATION, orientation);
   196 }
   197 }
   197 
   198 
   198 static inline void
   199 static inline void
   199 qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags)
   200 qt_extended_surface_set_window_flags(struct qt_extended_surface *qt_extended_surface, int32_t flags)
   200 {
   201 {
   201     wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   202     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_extended_surface,
   202              QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags);
   203              QT_EXTENDED_SURFACE_SET_WINDOW_FLAGS, flags);
   203 }
   204 }
   204 
   205 
   205 /* wayland-qt-touch-extension.h */
   206 /* wayland-qt-touch-extension.h */
   206 
   207 
   267 #define QT_TOUCH_EXTENSION_DUMMY    0
   268 #define QT_TOUCH_EXTENSION_DUMMY    0
   268 
   269 
   269 static inline void
   270 static inline void
   270 qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data)
   271 qt_touch_extension_set_user_data(struct qt_touch_extension *qt_touch_extension, void *user_data)
   271 {
   272 {
   272     wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data);
   273     WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_touch_extension, user_data);
   273 }
   274 }
   274 
   275 
   275 static inline void *
   276 static inline void *
   276 qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension)
   277 qt_touch_extension_get_user_data(struct qt_touch_extension *qt_touch_extension)
   277 {
   278 {
   278     return wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension);
   279     return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_touch_extension);
   279 }
   280 }
   280 
   281 
   281 static inline void
   282 static inline void
   282 qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension)
   283 qt_touch_extension_destroy(struct qt_touch_extension *qt_touch_extension)
   283 {
   284 {
   284     wl_proxy_destroy((struct wl_proxy *) qt_touch_extension);
   285     WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_touch_extension);
   285 }
   286 }
   286 
   287 
   287 static inline void
   288 static inline void
   288 qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension)
   289 qt_touch_extension_dummy(struct qt_touch_extension *qt_touch_extension)
   289 {
   290 {
   290     wl_proxy_marshal((struct wl_proxy *) qt_touch_extension,
   291     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_touch_extension,
   291              QT_TOUCH_EXTENSION_DUMMY);
   292              QT_TOUCH_EXTENSION_DUMMY);
   292 }
   293 }
   293 
   294 
   294 
   295 
   295 /* wayland-qt-windowmanager.h */
   296 /* wayland-qt-windowmanager.h */
   322 #define QT_WINDOWMANAGER_OPEN_URL   0
   323 #define QT_WINDOWMANAGER_OPEN_URL   0
   323 
   324 
   324 static inline void
   325 static inline void
   325 qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data)
   326 qt_windowmanager_set_user_data(struct qt_windowmanager *qt_windowmanager, void *user_data)
   326 {
   327 {
   327     wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data);
   328     WAYLAND_wl_proxy_set_user_data((struct wl_proxy *) qt_windowmanager, user_data);
   328 }
   329 }
   329 
   330 
   330 static inline void *
   331 static inline void *
   331 qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager)
   332 qt_windowmanager_get_user_data(struct qt_windowmanager *qt_windowmanager)
   332 {
   333 {
   333     return wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager);
   334     return WAYLAND_wl_proxy_get_user_data((struct wl_proxy *) qt_windowmanager);
   334 }
   335 }
   335 
   336 
   336 static inline void
   337 static inline void
   337 qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager)
   338 qt_windowmanager_destroy(struct qt_windowmanager *qt_windowmanager)
   338 {
   339 {
   339     wl_proxy_destroy((struct wl_proxy *) qt_windowmanager);
   340     WAYLAND_wl_proxy_destroy((struct wl_proxy *) qt_windowmanager);
   340 }
   341 }
   341 
   342 
   342 static inline void
   343 static inline void
   343 qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url)
   344 qt_windowmanager_open_url(struct qt_windowmanager *qt_windowmanager, uint32_t remaining, const char *url)
   344 {
   345 {
   345     wl_proxy_marshal((struct wl_proxy *) qt_windowmanager,
   346     WAYLAND_wl_proxy_marshal((struct wl_proxy *) qt_windowmanager,
   346              QT_WINDOWMANAGER_OPEN_URL, remaining, url);
   347              QT_WINDOWMANAGER_OPEN_URL, remaining, url);
   347 }
   348 }
   348 
   349 
   349 #endif /* _SDL_waylandtouch_h */
   350 #endif /* _SDL_waylandtouch_h */
   350 
   351