summaryrefslogtreecommitdiff
path: root/src/wayland/meta-wayland-surface.h
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2015-12-15 12:51:24 +0800
committerJonas Ådahl <jadahl@gmail.com>2016-05-01 21:11:27 +0800
commit7fd585fe98b92fd7219f87b11f14bce0aaed04c0 (patch)
treed9391a1949519199ec8a08b7024686ee7664ed09 /src/wayland/meta-wayland-surface.h
parent6957b5f9766f071ff76bfe02c9d7f09d6bdeec5c (diff)
downloadmutter-7fd585fe98b92fd7219f87b11f14bce0aaed04c0.tar.gz
wayland: Split out shell surface code from meta-wayland-surface.c
Move xdg_shell related functionality to a new meta-wayland-xdg-shell.c and wl_shell related functionality to a new meta-wayland-wl-shell.c, and adapt role object tree. Common functionality related to the surface being drawn as a MetaSurfaceActor was moved to a MetaWaylandSurfaceRoleActorSurface role. The subsurface role GObject is made to inherit the actor surface GObject. Shell surface hooks (configure, ping, close, popup done) were added to a MetaWaylandSurfaceRoleShellSurface GObject which inherits the surface actor role GObject. The shell surface roles (xdg_surface, xdg_popup, wl_shell_surface) are made to inherit the shell surface GObject and implement the relevant API. https://bugzilla.gnome.org/show_bug.cgi?id=757623 https://bugzilla.gnome.org/show_bug.cgi?id=763431
Diffstat (limited to 'src/wayland/meta-wayland-surface.h')
-rw-r--r--src/wayland/meta-wayland-surface.h61
1 files changed, 42 insertions, 19 deletions
diff --git a/src/wayland/meta-wayland-surface.h b/src/wayland/meta-wayland-surface.h
index c817ed715..cf6b79b35 100644
--- a/src/wayland/meta-wayland-surface.h
+++ b/src/wayland/meta-wayland-surface.h
@@ -69,29 +69,42 @@ struct _MetaWaylandSerial {
uint32_t value;
};
+#define META_TYPE_WAYLAND_SURFACE_ROLE_ACTOR_SURFACE (meta_wayland_surface_role_actor_surface_get_type ())
+G_DECLARE_DERIVABLE_TYPE (MetaWaylandSurfaceRoleActorSurface,
+ meta_wayland_surface_role_actor_surface,
+ META, WAYLAND_SURFACE_ROLE_ACTOR_SURFACE,
+ MetaWaylandSurfaceRole);
+
+struct _MetaWaylandSurfaceRoleActorSurfaceClass
+{
+ MetaWaylandSurfaceRoleClass parent_class;
+};
+
+#define META_TYPE_WAYLAND_SURFACE_ROLE_SHELL_SURFACE (meta_wayland_surface_role_shell_surface_get_type ())
+G_DECLARE_DERIVABLE_TYPE (MetaWaylandSurfaceRoleShellSurface,
+ meta_wayland_surface_role_shell_surface,
+ META, WAYLAND_SURFACE_ROLE_SHELL_SURFACE,
+ MetaWaylandSurfaceRoleActorSurface);
+
+struct _MetaWaylandSurfaceRoleShellSurfaceClass
+{
+ MetaWaylandSurfaceRoleActorSurfaceClass parent_class;
+
+ void (*configure) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
+ int new_width,
+ int new_height,
+ MetaWaylandSerial *sent_serial);
+ void (*ping) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role,
+ uint32_t serial);
+ void (*close) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
+ void (*popup_done) (MetaWaylandSurfaceRoleShellSurface *shell_surface_role);
+};
+
#define META_TYPE_WAYLAND_SURFACE_ROLE_SUBSURFACE (meta_wayland_surface_role_subsurface_get_type ())
G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleSubsurface,
meta_wayland_surface_role_subsurface,
META, WAYLAND_SURFACE_ROLE_SUBSURFACE,
- MetaWaylandSurfaceRole);
-
-#define META_TYPE_WAYLAND_SURFACE_ROLE_XDG_SURFACE (meta_wayland_surface_role_xdg_surface_get_type ())
-G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleXdgSurface,
- meta_wayland_surface_role_xdg_surface,
- META, WAYLAND_SURFACE_ROLE_XDG_SURFACE,
- MetaWaylandSurfaceRole);
-
-#define META_TYPE_WAYLAND_SURFACE_ROLE_XDG_POPUP (meta_wayland_surface_role_xdg_popup_get_type ())
-G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleXdgPopup,
- meta_wayland_surface_role_xdg_popup,
- META, WAYLAND_SURFACE_ROLE_XDG_POPUP,
- MetaWaylandSurfaceRole);
-
-#define META_TYPE_WAYLAND_SURFACE_ROLE_WL_SHELL_SURFACE (meta_wayland_surface_role_wl_shell_surface_get_type ())
-G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleWlShellSurface,
- meta_wayland_surface_role_wl_shell_surface,
- META, WAYLAND_SURFACE_ROLE_WL_SHELL_SURFACE,
- MetaWaylandSurfaceRole);
+ MetaWaylandSurfaceRoleActorSurface);
#define META_TYPE_WAYLAND_SURFACE_ROLE_DND (meta_wayland_surface_role_dnd_get_type ())
G_DECLARE_FINAL_TYPE (MetaWaylandSurfaceRoleDND,
@@ -298,4 +311,14 @@ MetaWaylandSurface * meta_wayland_surface_role_get_surface (MetaWaylandSurfaceRo
cairo_region_t * meta_wayland_surface_calculate_input_region (MetaWaylandSurface *surface);
+void meta_wayland_surface_apply_window_state (MetaWaylandSurface *surface,
+ MetaWaylandPendingState *pending);
+
+void meta_wayland_surface_destroy_window (MetaWaylandSurface *surface);
+
+gboolean meta_wayland_surface_begin_grab_op (MetaWaylandSurface *surface,
+ MetaWaylandSeat *seat,
+ MetaGrabOp grab_op,
+ gfloat x,
+ gfloat y);
#endif