2013-08-30 12:03:30 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2013 Red Hat, Inc.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of the
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
* 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef META_WAYLAND_SURFACE_H
|
|
|
|
#define META_WAYLAND_SURFACE_H
|
|
|
|
|
|
|
|
#include <wayland-server.h>
|
|
|
|
#include <xkbcommon/xkbcommon.h>
|
|
|
|
#include <clutter/clutter.h>
|
|
|
|
|
|
|
|
#include <glib.h>
|
|
|
|
#include <cairo.h>
|
|
|
|
|
|
|
|
#include <meta/meta-cursor-tracker.h>
|
|
|
|
#include "meta-wayland-types.h"
|
2013-11-22 15:24:06 -05:00
|
|
|
#include "meta-surface-actor.h"
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
struct _MetaWaylandBuffer
|
|
|
|
{
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wl_signal destroy_signal;
|
|
|
|
struct wl_listener destroy_listener;
|
|
|
|
|
2013-09-16 07:42:59 -04:00
|
|
|
CoglTexture *texture;
|
2013-08-30 12:03:30 -04:00
|
|
|
int32_t width, height;
|
|
|
|
uint32_t busy_count;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _MetaWaylandBufferReference
|
|
|
|
{
|
|
|
|
MetaWaylandBuffer *buffer;
|
|
|
|
struct wl_listener destroy_listener;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
/* wl_surface.attach */
|
|
|
|
gboolean newly_attached;
|
|
|
|
MetaWaylandBuffer *buffer;
|
|
|
|
struct wl_listener buffer_destroy_listener;
|
2013-09-03 06:00:29 -04:00
|
|
|
int32_t dx;
|
|
|
|
int32_t dy;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
/* wl_surface.damage */
|
|
|
|
cairo_region_t *damage;
|
|
|
|
|
|
|
|
cairo_region_t *input_region;
|
|
|
|
cairo_region_t *opaque_region;
|
|
|
|
|
|
|
|
/* wl_surface.frame */
|
|
|
|
struct wl_list frame_callback_list;
|
2013-11-11 17:35:56 -05:00
|
|
|
} MetaWaylandDoubleBufferedState;
|
2013-08-30 03:40:36 -04:00
|
|
|
|
2013-09-16 07:42:59 -04:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
struct wl_resource *resource;
|
|
|
|
struct wl_listener surface_destroy_listener;
|
|
|
|
} MetaWaylandSurfaceExtension;
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
struct _MetaWaylandSurface
|
|
|
|
{
|
|
|
|
struct wl_resource *resource;
|
|
|
|
MetaWaylandCompositor *compositor;
|
|
|
|
MetaWaylandBufferReference buffer_ref;
|
2013-11-22 15:24:06 -05:00
|
|
|
MetaSurfaceActor *surface_actor;
|
2013-08-30 12:03:30 -04:00
|
|
|
MetaWindow *window;
|
2013-11-19 17:32:59 -05:00
|
|
|
MetaWaylandSurfaceExtension xdg_surface;
|
2013-11-14 21:55:37 -05:00
|
|
|
MetaWaylandSurfaceExtension xdg_popup;
|
2013-11-19 17:32:59 -05:00
|
|
|
MetaWaylandSurfaceExtension gtk_surface;
|
2013-11-25 16:26:02 -05:00
|
|
|
MetaWaylandSurfaceExtension subsurface;
|
2013-08-30 12:03:30 -04:00
|
|
|
|
|
|
|
/* All the pending state, that wl_surface.commit will apply. */
|
|
|
|
MetaWaylandDoubleBufferedState pending;
|
|
|
|
};
|
|
|
|
|
2013-08-30 12:26:18 -04:00
|
|
|
void meta_wayland_init_shell (MetaWaylandCompositor *compositor);
|
|
|
|
|
|
|
|
MetaWaylandSurface *meta_wayland_surface_create (MetaWaylandCompositor *compositor,
|
|
|
|
struct wl_client *client,
|
|
|
|
guint32 id,
|
|
|
|
guint32 version);
|
2013-09-03 06:00:29 -04:00
|
|
|
void meta_wayland_surface_configure_notify (MetaWaylandSurface *surface,
|
|
|
|
int width,
|
|
|
|
int height,
|
|
|
|
int edges);
|
|
|
|
|
2013-11-12 15:52:03 -05:00
|
|
|
void meta_wayland_surface_focused_set (MetaWaylandSurface *surface);
|
|
|
|
void meta_wayland_surface_focused_unset (MetaWaylandSurface *surface);
|
|
|
|
|
2013-11-21 14:20:52 -05:00
|
|
|
void meta_wayland_surface_ping (MetaWaylandSurface *surface,
|
|
|
|
guint32 serial);
|
|
|
|
|
2013-08-30 12:03:30 -04:00
|
|
|
#endif
|