diff --git a/include/libweston/libweston.h b/include/libweston/libweston.h index d4d95b5c..748386d4 100644 --- a/include/libweston/libweston.h +++ b/include/libweston/libweston.h @@ -2039,18 +2039,6 @@ weston_surface_copy_content(struct weston_surface *surface, struct weston_buffer * weston_buffer_from_resource(struct wl_resource *resource); -void -weston_buffer_reference(struct weston_buffer_reference *ref, - struct weston_buffer *buffer); - -void -weston_buffer_release_reference(struct weston_buffer_release_reference *ref, - struct weston_buffer_release *buf_release); - -void -weston_buffer_release_move(struct weston_buffer_release_reference *dest, - struct weston_buffer_release_reference *src); - void weston_compositor_get_time(struct timespec *time); @@ -2456,10 +2444,6 @@ weston_log_ctx_compositor_setup(struct weston_compositor *compositor, void weston_log_ctx_compositor_destroy(struct weston_compositor *compositor); -void -weston_buffer_send_server_error(struct weston_buffer *buffer, - const char *msg); - int weston_compositor_enable_content_protection(struct weston_compositor *compositor); diff --git a/libweston/backend-drm/drm-internal.h b/libweston/backend-drm/drm-internal.h index 29b3a91a..403ae2d2 100644 --- a/libweston/backend-drm/drm-internal.h +++ b/libweston/backend-drm/drm-internal.h @@ -55,6 +55,7 @@ #include #include "shared/helpers.h" #include "libinput-seat.h" +#include "libweston-internal.h" #ifndef DRM_CLIENT_CAP_ASPECT_RATIO #define DRM_CLIENT_CAP_ASPECT_RATIO 4 diff --git a/libweston/compositor.c b/libweston/compositor.c index 848ae4e6..444b4064 100644 --- a/libweston/compositor.c +++ b/libweston/compositor.c @@ -72,6 +72,7 @@ #include #include #include "pixel-formats.h" +#include "libweston-internal.h" /** * \defgroup head Head diff --git a/libweston/libweston-internal.h b/libweston/libweston-internal.h new file mode 100644 index 00000000..b4a9737b --- /dev/null +++ b/libweston/libweston-internal.h @@ -0,0 +1,61 @@ +/* + * Copyright © 2008-2011 Kristian Høgsberg + * Copyright © 2017, 2018 General Electric Company + * Copyright © 2012, 2017-2019 Collabora, Ltd. + * + * 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 (including the + * next paragraph) 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 LIBWESTON_INTERNAL_H +#define LIBWESTON_INTERNAL_H + +/* + * This is the internal (private) part of libweston. All symbols found here + * are, and should be only (with a few exceptions) used within the internal + * parts of libweston. Notable exception(s) include a few files in tests/ that + * need access to these functions, screen-share file from compositor/ and those + * remoting/. Those will require some further fixing as to avoid including this + * private header. + * + * Eventually, these symbols should reside naturally into their own scope. New + * features should either provide their own (internal) header or use this one. + */ + + +/* weston_buffer */ + +void +weston_buffer_send_server_error(struct weston_buffer *buffer, + const char *msg); +void +weston_buffer_reference(struct weston_buffer_reference *ref, + struct weston_buffer *buffer); + +void +weston_buffer_release_move(struct weston_buffer_release_reference *dest, + struct weston_buffer_release_reference *src); + +void +weston_buffer_release_reference(struct weston_buffer_release_reference *ref, + struct weston_buffer_release *buf_release); + +#endif diff --git a/libweston/linux-explicit-synchronization.c b/libweston/linux-explicit-synchronization.c index 220cdde5..f93a5d60 100644 --- a/libweston/linux-explicit-synchronization.c +++ b/libweston/linux-explicit-synchronization.c @@ -33,6 +33,7 @@ #include "linux-explicit-synchronization-unstable-v1-server-protocol.h" #include "linux-sync-file.h" #include "shared/fd-util.h" +#include "libweston-internal.h" static void destroy_linux_buffer_release(struct wl_resource *resource) diff --git a/libweston/pixman-renderer.h b/libweston/pixman-renderer.h index 83a43010..07571a1d 100644 --- a/libweston/pixman-renderer.h +++ b/libweston/pixman-renderer.h @@ -26,6 +26,7 @@ #include "config.h" #include +#include "libweston-internal.h" int pixman_renderer_init(struct weston_compositor *ec); diff --git a/libweston/renderer-gl/gl-renderer.h b/libweston/renderer-gl/gl-renderer.h index 24af9256..7067c8f5 100644 --- a/libweston/renderer-gl/gl-renderer.h +++ b/libweston/renderer-gl/gl-renderer.h @@ -28,6 +28,7 @@ #include #include +#include "libweston-internal.h" #ifdef ENABLE_EGL