1/*
2 * Copyright © 2020 Red Hat, Inc.
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.1 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 * Authors: Matthias Clasen <mclasen@redhat.com>
18 */
19
20#ifndef __GDK_TOPLEVEL_H__
21#define __GDK_TOPLEVEL_H__
22
23#if !defined(__GDK_H_INSIDE__) && !defined(GTK_COMPILATION)
24#error "Only <gdk/gdk.h> can be included directly."
25#endif
26
27#include <gdk/gdkseat.h>
28#include <gdk/gdksurface.h>
29#include <gdk/gdktoplevellayout.h>
30
31G_BEGIN_DECLS
32
33/**
34 * GdkSurfaceEdge:
35 * @GDK_SURFACE_EDGE_NORTH_WEST: the top left corner.
36 * @GDK_SURFACE_EDGE_NORTH: the top edge.
37 * @GDK_SURFACE_EDGE_NORTH_EAST: the top right corner.
38 * @GDK_SURFACE_EDGE_WEST: the left edge.
39 * @GDK_SURFACE_EDGE_EAST: the right edge.
40 * @GDK_SURFACE_EDGE_SOUTH_WEST: the lower left corner.
41 * @GDK_SURFACE_EDGE_SOUTH: the lower edge.
42 * @GDK_SURFACE_EDGE_SOUTH_EAST: the lower right corner.
43 *
44 * Determines a surface edge or corner.
45 */
46typedef enum
47{
48 GDK_SURFACE_EDGE_NORTH_WEST,
49 GDK_SURFACE_EDGE_NORTH,
50 GDK_SURFACE_EDGE_NORTH_EAST,
51 GDK_SURFACE_EDGE_WEST,
52 GDK_SURFACE_EDGE_EAST,
53 GDK_SURFACE_EDGE_SOUTH_WEST,
54 GDK_SURFACE_EDGE_SOUTH,
55 GDK_SURFACE_EDGE_SOUTH_EAST
56} GdkSurfaceEdge;
57
58/**
59 * GdkFullscreenMode:
60 * @GDK_FULLSCREEN_ON_CURRENT_MONITOR: Fullscreen on current monitor only.
61 * @GDK_FULLSCREEN_ON_ALL_MONITORS: Span across all monitors when fullscreen.
62 *
63 * Indicates which monitor a surface should span over when in fullscreen mode.
64 */
65typedef enum
66{
67 GDK_FULLSCREEN_ON_CURRENT_MONITOR,
68 GDK_FULLSCREEN_ON_ALL_MONITORS
69} GdkFullscreenMode;
70
71/**
72 * GdkToplevelState:
73 * @GDK_TOPLEVEL_STATE_MINIMIZED: the surface is minimized
74 * @GDK_TOPLEVEL_STATE_MAXIMIZED: the surface is maximized
75 * @GDK_TOPLEVEL_STATE_STICKY: the surface is sticky
76 * @GDK_TOPLEVEL_STATE_FULLSCREEN: the surface is maximized without decorations
77 * @GDK_TOPLEVEL_STATE_ABOVE: the surface is kept above other surfaces
78 * @GDK_TOPLEVEL_STATE_BELOW: the surface is kept below other surfaces
79 * @GDK_TOPLEVEL_STATE_FOCUSED: the surface is presented as focused (with active decorations)
80 * @GDK_TOPLEVEL_STATE_TILED: the surface is in a tiled state
81 * @GDK_TOPLEVEL_STATE_TOP_TILED: whether the top edge is tiled
82 * @GDK_TOPLEVEL_STATE_TOP_RESIZABLE: whether the top edge is resizable
83 * @GDK_TOPLEVEL_STATE_RIGHT_TILED: whether the right edge is tiled
84 * @GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE: whether the right edge is resizable
85 * @GDK_TOPLEVEL_STATE_BOTTOM_TILED: whether the bottom edge is tiled
86 * @GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE: whether the bottom edge is resizable
87 * @GDK_TOPLEVEL_STATE_LEFT_TILED: whether the left edge is tiled
88 * @GDK_TOPLEVEL_STATE_LEFT_RESIZABLE: whether the left edge is resizable
89 *
90 * Specifies the state of a toplevel surface.
91 *
92 * On platforms that support information about individual edges, the
93 * %GDK_TOPLEVEL_STATE_TILED state will be set whenever any of the individual
94 * tiled states is set. On platforms that lack that support, the tiled state
95 * will give an indication of tiledness without any of the per-edge states
96 * being set.
97 */
98typedef enum
99{
100 GDK_TOPLEVEL_STATE_MINIMIZED = 1 << 0,
101 GDK_TOPLEVEL_STATE_MAXIMIZED = 1 << 1,
102 GDK_TOPLEVEL_STATE_STICKY = 1 << 2,
103 GDK_TOPLEVEL_STATE_FULLSCREEN = 1 << 3,
104 GDK_TOPLEVEL_STATE_ABOVE = 1 << 4,
105 GDK_TOPLEVEL_STATE_BELOW = 1 << 5,
106 GDK_TOPLEVEL_STATE_FOCUSED = 1 << 6,
107 GDK_TOPLEVEL_STATE_TILED = 1 << 7,
108 GDK_TOPLEVEL_STATE_TOP_TILED = 1 << 8,
109 GDK_TOPLEVEL_STATE_TOP_RESIZABLE = 1 << 9,
110 GDK_TOPLEVEL_STATE_RIGHT_TILED = 1 << 10,
111 GDK_TOPLEVEL_STATE_RIGHT_RESIZABLE = 1 << 11,
112 GDK_TOPLEVEL_STATE_BOTTOM_TILED = 1 << 12,
113 GDK_TOPLEVEL_STATE_BOTTOM_RESIZABLE = 1 << 13,
114 GDK_TOPLEVEL_STATE_LEFT_TILED = 1 << 14,
115 GDK_TOPLEVEL_STATE_LEFT_RESIZABLE = 1 << 15
116} GdkToplevelState;
117
118/**
119 * GdkTitlebarGesture:
120 * @GDK_TITLEBAR_GESTURE_DOUBLE_CLICK:
121 * @GDK_TITLEBAR_GESTURE_RIGHT_CLICK:
122 * @GDK_TITLEBAR_GESTURE_MIDDLE_CLICK:
123 *
124 * Since: 4.4
125 */
126typedef enum
127{
128 GDK_TITLEBAR_GESTURE_DOUBLE_CLICK = 1,
129 GDK_TITLEBAR_GESTURE_RIGHT_CLICK = 2,
130 GDK_TITLEBAR_GESTURE_MIDDLE_CLICK = 3
131} GdkTitlebarGesture;
132
133
134#define GDK_TYPE_TOPLEVEL (gdk_toplevel_get_type ())
135
136GDK_AVAILABLE_IN_ALL
137G_DECLARE_INTERFACE (GdkToplevel, gdk_toplevel, GDK, TOPLEVEL, GObject)
138
139GDK_AVAILABLE_IN_ALL
140void gdk_toplevel_present (GdkToplevel *toplevel,
141 GdkToplevelLayout *layout);
142
143GDK_AVAILABLE_IN_ALL
144gboolean gdk_toplevel_minimize (GdkToplevel *toplevel);
145
146GDK_AVAILABLE_IN_ALL
147gboolean gdk_toplevel_lower (GdkToplevel *toplevel);
148
149GDK_AVAILABLE_IN_ALL
150void gdk_toplevel_focus (GdkToplevel *toplevel,
151 guint32 timestamp);
152
153GDK_AVAILABLE_IN_ALL
154GdkToplevelState gdk_toplevel_get_state (GdkToplevel *toplevel);
155
156GDK_AVAILABLE_IN_ALL
157void gdk_toplevel_set_title (GdkToplevel *toplevel,
158 const char *title);
159
160GDK_AVAILABLE_IN_ALL
161void gdk_toplevel_set_startup_id (GdkToplevel *toplevel,
162 const char *startup_id);
163
164GDK_AVAILABLE_IN_ALL
165void gdk_toplevel_set_transient_for (GdkToplevel *toplevel,
166 GdkSurface *parent);
167
168GDK_AVAILABLE_IN_ALL
169void gdk_toplevel_set_modal (GdkToplevel *toplevel,
170 gboolean modal);
171
172GDK_AVAILABLE_IN_ALL
173void gdk_toplevel_set_icon_list (GdkToplevel *toplevel,
174 GList *surfaces);
175
176GDK_AVAILABLE_IN_ALL
177gboolean gdk_toplevel_show_window_menu (GdkToplevel *toplevel,
178 GdkEvent *event);
179
180GDK_AVAILABLE_IN_ALL
181void gdk_toplevel_set_decorated (GdkToplevel *toplevel,
182 gboolean decorated);
183
184GDK_AVAILABLE_IN_ALL
185void gdk_toplevel_set_deletable (GdkToplevel *toplevel,
186 gboolean deletable);
187GDK_AVAILABLE_IN_ALL
188gboolean gdk_toplevel_supports_edge_constraints (GdkToplevel *toplevel);
189
190GDK_AVAILABLE_IN_ALL
191void gdk_toplevel_inhibit_system_shortcuts (GdkToplevel *toplevel,
192 GdkEvent *event);
193
194GDK_AVAILABLE_IN_ALL
195void gdk_toplevel_restore_system_shortcuts (GdkToplevel *toplevel);
196
197GDK_AVAILABLE_IN_ALL
198void gdk_toplevel_begin_resize (GdkToplevel *toplevel,
199 GdkSurfaceEdge edge,
200 GdkDevice *device,
201 int button,
202 double x,
203 double y,
204 guint32 timestamp);
205
206GDK_AVAILABLE_IN_ALL
207void gdk_toplevel_begin_move (GdkToplevel *toplevel,
208 GdkDevice *device,
209 int button,
210 double x,
211 double y,
212 guint32 timestamp);
213
214GDK_AVAILABLE_IN_4_4
215gboolean gdk_toplevel_titlebar_gesture (GdkToplevel *toplevel,
216 GdkTitlebarGesture gesture);
217
218G_END_DECLS
219
220#endif /* __GDK_TOPLEVEL_H__ */
221

source code of gtk/gdk/gdktoplevel.h