diff --git a/include/display.h b/include/display.h index 41d7c25e..bf4117b1 100644 --- a/include/display.h +++ b/include/display.h @@ -106,16 +106,4 @@ void display_dump_monitor_layout ( void ); */ void display_startup_notification ( RofiHelperExecuteContext *context, GSpawnChildSetupFunc *child_setup, gpointer *user_data ); - -// ! -typedef struct _display_buffer_pool display_buffer_pool; -display_buffer_pool *display_buffer_pool_new(gint width, gint height); -void display_buffer_pool_free(display_buffer_pool *pool); - -cairo_surface_t *display_buffer_pool_get_next_buffer(display_buffer_pool *pool); -void display_surface_commit(cairo_surface_t *surface); - -gboolean display_get_surface_dimensions ( int *width, int *height ); -void display_set_surface_dimensions ( int width, int height, int loc ); - #endif diff --git a/include/view-internal.h b/include/view-internal.h index 6a40af29..6d36ef74 100644 --- a/include/view-internal.h +++ b/include/view-internal.h @@ -37,6 +37,10 @@ #include "xcb.h" #include "theme.h" +#ifdef ENABLE_WAYLAND +#include "wayland.h" +#endif + /** * @ingroup ViewHandle * @@ -125,8 +129,11 @@ struct RofiViewState /** Y position of the view */ int y; +#ifdef ENABLE_WAYLAND + /** wayland */ display_buffer_pool *pool; gboolean frame_callback; +#endif /** Position and target of the mouse. */ struct diff --git a/include/wayland-internal.h b/include/wayland-internal.h index 7913f4af..eb43827e 100644 --- a/include/wayland-internal.h +++ b/include/wayland-internal.h @@ -9,6 +9,8 @@ #include #include +#include "wayland.h" + typedef enum { WAYLAND_GLOBAL_COMPOSITOR, WAYLAND_GLOBAL_SHM, diff --git a/include/wayland.h b/include/wayland.h new file mode 100644 index 00000000..803872ea --- /dev/null +++ b/include/wayland.h @@ -0,0 +1,45 @@ +/* + * rofi + * + * MIT/X11 License + * Copyright © 2013-2020 Qball Cow + * + * 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 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. + * + */ + +#ifndef ROFI_WAYLAND_H +#define ROFI_WAYLAND_H + +#include +#include + +typedef struct _display_buffer_pool display_buffer_pool; +display_buffer_pool *display_buffer_pool_new(gint width, gint height); +void display_buffer_pool_free(display_buffer_pool *pool); + +cairo_surface_t *display_buffer_pool_get_next_buffer(display_buffer_pool *pool); +void display_surface_commit(cairo_surface_t *surface); + +gboolean display_get_surface_dimensions ( int *width, int *height ); +void display_set_surface_dimensions ( int width, int height, int loc ); + + +#endif