1/* GDK - The GIMP Drawing Kit
2 * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18/*
19 * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
20 * file for a list of people on the GTK+ Team. See the ChangeLog
21 * files for a list of changes. These files are distributed with
22 * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
23 */
24
25#ifndef __GDK_SURFACE_H__
26#define __GDK_SURFACE_H__
27
28#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
29#error "Only <gdk/gdk.h> can be included directly."
30#endif
31
32#include <gdk/gdkversionmacros.h>
33#include <gdk/gdktypes.h>
34#include <gdk/gdkevents.h>
35#include <gdk/gdkframeclock.h>
36#include <gdk/gdkmonitor.h>
37#include <gdk/gdkpopuplayout.h>
38
39G_BEGIN_DECLS
40
41typedef struct _GdkSurfaceClass GdkSurfaceClass;
42
43#define GDK_TYPE_SURFACE (gdk_surface_get_type ())
44#define GDK_SURFACE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_SURFACE, GdkSurface))
45#define GDK_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GDK_TYPE_SURFACE, GdkSurfaceClass))
46#define GDK_IS_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_SURFACE))
47#define GDK_IS_SURFACE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GDK_TYPE_SURFACE))
48#define GDK_SURFACE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_SURFACE, GdkSurfaceClass))
49
50
51GDK_AVAILABLE_IN_ALL
52GType gdk_surface_get_type (void) G_GNUC_CONST;
53GDK_AVAILABLE_IN_ALL
54GdkSurface * gdk_surface_new_toplevel (GdkDisplay *display);
55GDK_AVAILABLE_IN_ALL
56GdkSurface * gdk_surface_new_popup (GdkSurface *parent,
57 gboolean autohide);
58
59GDK_AVAILABLE_IN_ALL
60void gdk_surface_destroy (GdkSurface *surface);
61GDK_AVAILABLE_IN_ALL
62gboolean gdk_surface_is_destroyed (GdkSurface *surface);
63
64GDK_AVAILABLE_IN_ALL
65GdkDisplay * gdk_surface_get_display (GdkSurface *surface);
66GDK_AVAILABLE_IN_ALL
67void gdk_surface_hide (GdkSurface *surface);
68
69GDK_AVAILABLE_IN_ALL
70void gdk_surface_set_input_region (GdkSurface *surface,
71 cairo_region_t *region);
72
73GDK_AVAILABLE_IN_ALL
74gboolean gdk_surface_get_mapped (GdkSurface *surface);
75
76GDK_AVAILABLE_IN_ALL
77void gdk_surface_set_cursor (GdkSurface *surface,
78 GdkCursor *cursor);
79GDK_AVAILABLE_IN_ALL
80GdkCursor *gdk_surface_get_cursor (GdkSurface *surface);
81GDK_AVAILABLE_IN_ALL
82void gdk_surface_set_device_cursor (GdkSurface *surface,
83 GdkDevice *device,
84 GdkCursor *cursor);
85GDK_AVAILABLE_IN_ALL
86GdkCursor *gdk_surface_get_device_cursor (GdkSurface *surface,
87 GdkDevice *device);
88GDK_AVAILABLE_IN_ALL
89int gdk_surface_get_width (GdkSurface *surface);
90GDK_AVAILABLE_IN_ALL
91int gdk_surface_get_height (GdkSurface *surface);
92GDK_AVAILABLE_IN_ALL
93gboolean gdk_surface_translate_coordinates (GdkSurface *from,
94 GdkSurface *to,
95 double *x,
96 double *y);
97
98GDK_AVAILABLE_IN_ALL
99int gdk_surface_get_scale_factor (GdkSurface *surface);
100
101GDK_AVAILABLE_IN_ALL
102gboolean gdk_surface_get_device_position (GdkSurface *surface,
103 GdkDevice *device,
104 double *x,
105 double *y,
106 GdkModifierType *mask);
107
108GDK_AVAILABLE_IN_ALL
109cairo_surface_t *
110 gdk_surface_create_similar_surface (GdkSurface *surface,
111 cairo_content_t content,
112 int width,
113 int height);
114
115GDK_AVAILABLE_IN_ALL
116void gdk_surface_beep (GdkSurface *surface);
117
118GDK_AVAILABLE_IN_ALL
119void gdk_surface_queue_render (GdkSurface *surface);
120
121GDK_AVAILABLE_IN_ALL
122void gdk_surface_request_layout (GdkSurface *surface);
123
124GDK_AVAILABLE_IN_ALL
125GdkFrameClock* gdk_surface_get_frame_clock (GdkSurface *surface);
126
127GDK_AVAILABLE_IN_ALL
128void gdk_surface_set_opaque_region (GdkSurface *surface,
129 cairo_region_t *region);
130
131GDK_AVAILABLE_IN_ALL
132GdkCairoContext *gdk_surface_create_cairo_context(GdkSurface *surface);
133GDK_AVAILABLE_IN_ALL
134GdkGLContext * gdk_surface_create_gl_context (GdkSurface *surface,
135 GError **error);
136GDK_AVAILABLE_IN_ALL
137GdkVulkanContext *
138 gdk_surface_create_vulkan_context(GdkSurface *surface,
139 GError **error);
140
141G_DEFINE_AUTOPTR_CLEANUP_FUNC (GdkSurface, g_object_unref)
142
143G_END_DECLS
144
145#endif /* __GDK_SURFACE_H__ */
146

source code of gtk/gdk/gdksurface.h