Expose ds_surface as ABI 94/294094/1
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 22 Feb 2023 05:10:00 +0000 (14:10 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 13 Jun 2023 05:01:21 +0000 (14:01 +0900)
Change-Id: I43ee7c7423915ead7ac0b0f924436e9e84ac9c48

include/libds/types/ds_surface.h [new file with mode: 0644]
include/libds/util/addon.h [moved from src/addon.h with 92% similarity]
src/addon.c
src/compositor/compositor_private.h

diff --git a/include/libds/types/ds_surface.h b/include/libds/types/ds_surface.h
new file mode 100644 (file)
index 0000000..1447a2e
--- /dev/null
@@ -0,0 +1,91 @@
+#ifndef LIBDS_TYPES_DS_SURFACE_H
+#define LIBDS_TYPES_DS_SURFACE_H
+
+#include <pixman.h>
+#include <wayland-server.h>
+
+#include <libds/util/box.h>
+#include <libds/util/addon.h>
+#include <libds/buffer.h>
+#include <libds/surface.h>
+
+enum ds_surface_state_field
+{
+    DS_SURFACE_STATE_BUFFER = 1 << 0,
+    DS_SURFACE_STATE_SURFACE_DAMAGE = 1 << 1,
+    DS_SURFACE_STATE_BUFFER_DAMAGE = 1 << 2,
+    DS_SURFACE_STATE_OPAQUE_REGION = 1 << 3,
+    DS_SURFACE_STATE_INPUT_REGION = 1 << 4,
+    DS_SURFACE_STATE_TRANSFORM = 1 << 5,
+    DS_SURFACE_STATE_SCALE = 1 << 6,
+    DS_SURFACE_STATE_FRAME_CALLBACK_LIST = 1 << 7,
+    DS_SURFACE_STATE_VIEWPORT = 1 << 8,
+};
+
+struct ds_surface_state
+{
+    enum ds_surface_state_field committed;
+
+    struct ds_buffer *buffer;
+    int32_t dx, dy;
+    pixman_region32_t surface_damage, buffer_damage;
+    pixman_region32_t opaque, input;
+    enum wl_output_transform transform;
+    int32_t scale;
+    struct wl_list frame_callback_list;
+
+    int width, height;
+    int buffer_width, buffer_height;
+
+    struct wl_list subsurfaces_below;
+    struct wl_list subsurfaces_above;
+
+    /**
+     * The viewport is applied after the surface transform and scale.
+     *
+     * If has_src is true, the surface content is cropped to the provided
+     * rectangle. If has_dst is true, the surface content is scaled to the
+     * provided rectangle.
+     */
+    struct {
+        bool has_src, has_dst;
+        // In coordinates alter scale/transform are applied, but before the
+        // destination rectangle is applied
+        struct ds_fbox src;
+        int dst_width, dst_height;
+    } viewport;
+};
+
+struct ds_surface_viewport
+{
+    bool taken;
+};
+
+struct ds_surface
+{
+    struct wl_resource *resource;
+
+    struct ds_buffer *buffer;
+
+    pixman_region32_t buffer_damage;
+    pixman_region32_t opaque_region;
+    pixman_region32_t input_region;
+
+    struct ds_surface_state current, pending;
+    struct ds_surface_viewport viewport_handle;
+
+    const struct ds_surface_role *role;
+    void *role_data;
+
+    int sx, sy;
+
+    struct {
+        struct wl_signal commit;
+        struct wl_signal new_subsurface;
+        struct wl_signal destroy;
+    } events;
+
+    struct ds_addon_set addons;
+};
+
+#endif
similarity index 92%
rename from src/addon.h
rename to include/libds/util/addon.h
index 2e7b0e1..7a5c798 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DS_ADDON_H
-#define DS_ADDON_H
+#ifndef LIBDS_UTIL_ADDON_H
+#define LIBDS_UTIL_ADDON_H
 
 #include <wayland-util.h>
 
index 0deac7a..0d23a24 100644 (file)
@@ -1,7 +1,7 @@
 #include <assert.h>
 
+#include "libds/util/addon.h"
 #include "util.h"
-#include "addon.h"
 
 void
 ds_addon_set_init(struct ds_addon_set *set)
index 3020939..1860be3 100644 (file)
 #include <stdint.h>
 #include <stdlib.h>
 
-#include <pixman.h>
 #include <wayland-server.h>
 
 #include "libds/log.h"
 #include "libds/util/defs.h"
 #include "libds/util/box.h"
-#include "addon.h"
-#include "buffer.h"
+#include "libds/util/addon.h"
+#include "libds/types/ds_surface.h"
 #include "surface.h"
 #include "util.h"
 
-enum ds_surface_state_field
-{
-    DS_SURFACE_STATE_BUFFER = 1 << 0,
-    DS_SURFACE_STATE_SURFACE_DAMAGE = 1 << 1,
-    DS_SURFACE_STATE_BUFFER_DAMAGE = 1 << 2,
-    DS_SURFACE_STATE_OPAQUE_REGION = 1 << 3,
-    DS_SURFACE_STATE_INPUT_REGION = 1 << 4,
-    DS_SURFACE_STATE_TRANSFORM = 1 << 5,
-    DS_SURFACE_STATE_SCALE = 1 << 6,
-    DS_SURFACE_STATE_FRAME_CALLBACK_LIST = 1 << 7,
-    DS_SURFACE_STATE_VIEWPORT = 1 << 8,
-};
-
 struct ds_subcompositor
 {
     struct wl_global *global;
 };
 
-struct ds_surface_state
-{
-    enum ds_surface_state_field committed;
-
-    struct ds_buffer *buffer;
-    int32_t dx, dy;
-    pixman_region32_t surface_damage, buffer_damage;
-    pixman_region32_t opaque, input;
-    enum wl_output_transform transform;
-    int32_t scale;
-    struct wl_list frame_callback_list;
-
-    int width, height;
-    int buffer_width, buffer_height;
-
-    struct wl_list subsurfaces_below;
-    struct wl_list subsurfaces_above;
-
-    /**
-     * The viewport is applied after the surface transform and scale.
-     *
-     * If has_src is true, the surface content is cropped to the provided
-     * rectangle. If has_dst is true, the surface content is scaled to the
-     * provided rectangle.
-     */
-    struct {
-        bool has_src, has_dst;
-        // In coordinates alter scale/transform are applied, but before the
-        // destination rectangle is applied
-        struct ds_fbox src;
-        int dst_width, dst_height;
-    } viewport;
-};
-
-struct ds_surface_viewport
-{
-    bool taken;
-};
-
-struct ds_surface
-{
-    struct wl_resource *resource;
-
-    struct ds_buffer *buffer;
-
-    pixman_region32_t buffer_damage;
-    pixman_region32_t opaque_region;
-    pixman_region32_t input_region;
-
-    struct ds_surface_state current, pending;
-    struct ds_surface_viewport viewport_handle;
-
-    const struct ds_surface_role *role;
-    void *role_data;
-
-    int sx, sy;
-
-    struct {
-        struct wl_signal commit;
-        struct wl_signal new_subsurface;
-        struct wl_signal destroy;
-    } events;
-
-    struct ds_addon_set addons;
-};
-
 struct ds_subsurface_parent_state
 {
     int32_t x, y;