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 
39 G_BEGIN_DECLS
40 
41 typedef 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 
51 GDK_AVAILABLE_IN_ALL
52 GType         gdk_surface_get_type              (void) G_GNUC_CONST;
53 GDK_AVAILABLE_IN_ALL
54 GdkSurface *   gdk_surface_new_toplevel         (GdkDisplay    *display);
55 GDK_AVAILABLE_IN_ALL
56 GdkSurface *   gdk_surface_new_popup            (GdkSurface    *parent,
57                                                  gboolean       autohide);
58 
59 GDK_AVAILABLE_IN_ALL
60 void          gdk_surface_destroy               (GdkSurface     *surface);
61 GDK_AVAILABLE_IN_ALL
62 gboolean      gdk_surface_is_destroyed          (GdkSurface     *surface);
63 
64 GDK_AVAILABLE_IN_ALL
65 GdkDisplay *  gdk_surface_get_display           (GdkSurface     *surface);
66 GDK_AVAILABLE_IN_ALL
67 void          gdk_surface_hide                  (GdkSurface     *surface);
68 
69 GDK_AVAILABLE_IN_ALL
70 void          gdk_surface_set_input_region      (GdkSurface     *surface,
71                                                  cairo_region_t *region);
72 
73 GDK_AVAILABLE_IN_ALL
74 gboolean      gdk_surface_get_mapped   (GdkSurface *surface);
75 
76 GDK_AVAILABLE_IN_ALL
77 void          gdk_surface_set_cursor     (GdkSurface      *surface,
78                                           GdkCursor       *cursor);
79 GDK_AVAILABLE_IN_ALL
80 GdkCursor    *gdk_surface_get_cursor      (GdkSurface       *surface);
81 GDK_AVAILABLE_IN_ALL
82 void          gdk_surface_set_device_cursor (GdkSurface   *surface,
83                                              GdkDevice     *device,
84                                              GdkCursor     *cursor);
85 GDK_AVAILABLE_IN_ALL
86 GdkCursor    *gdk_surface_get_device_cursor (GdkSurface     *surface,
87                                              GdkDevice     *device);
88 GDK_AVAILABLE_IN_ALL
89 int           gdk_surface_get_width       (GdkSurface       *surface);
90 GDK_AVAILABLE_IN_ALL
91 int           gdk_surface_get_height      (GdkSurface       *surface);
92 GDK_AVAILABLE_IN_ALL
93 gboolean gdk_surface_translate_coordinates (GdkSurface *from,
94                                             GdkSurface *to,
95                                             double     *x,
96                                             double     *y);
97 
98 GDK_AVAILABLE_IN_ALL
99 int           gdk_surface_get_scale_factor  (GdkSurface     *surface);
100 
101 GDK_AVAILABLE_IN_ALL
102 gboolean      gdk_surface_get_device_position (GdkSurface      *surface,
103                                                GdkDevice       *device,
104                                                double          *x,
105                                                double          *y,
106                                                GdkModifierType *mask);
107 
108 GDK_AVAILABLE_IN_ALL
109 cairo_surface_t *
110               gdk_surface_create_similar_surface (GdkSurface *surface,
111                                                   cairo_content_t  content,
112                                                   int              width,
113                                                   int              height);
114 
115 GDK_AVAILABLE_IN_ALL
116 void          gdk_surface_beep            (GdkSurface       *surface);
117 
118 GDK_AVAILABLE_IN_ALL
119 void       gdk_surface_queue_render       (GdkSurface       *surface);
120 
121 GDK_AVAILABLE_IN_ALL
122 void       gdk_surface_request_layout     (GdkSurface       *surface);
123 
124 GDK_AVAILABLE_IN_ALL
125 GdkFrameClock* gdk_surface_get_frame_clock      (GdkSurface     *surface);
126 
127 GDK_AVAILABLE_IN_ALL
128 void       gdk_surface_set_opaque_region        (GdkSurface      *surface,
129                                                  cairo_region_t *region);
130 
131 GDK_AVAILABLE_IN_ALL
132 GdkCairoContext *gdk_surface_create_cairo_context(GdkSurface    *surface);
133 GDK_AVAILABLE_IN_ALL
134 GdkGLContext * gdk_surface_create_gl_context    (GdkSurface     *surface,
135                                                  GError        **error);
136 GDK_AVAILABLE_IN_ALL
137 GdkVulkanContext *
138                gdk_surface_create_vulkan_context(GdkSurface     *surface,
139                                                  GError        **error);
140 
141 G_DEFINE_AUTOPTR_CLEANUP_FUNC (GdkSurface, g_object_unref)
142 
143 G_END_DECLS
144 
145 #endif /* __GDK_SURFACE_H__ */
146