1 | /* GDK - The GIMP Drawing Kit |
2 | * Copyright (C) 2020 Red Hat |
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 | #ifndef __GDK_POPUP_LAYOUT_H__ |
20 | #define |
21 | |
22 | #if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION) |
23 | #error "Only <gdk/gdk.h> can be included directly." |
24 | #endif |
25 | |
26 | #include <gdk/gdkenums.h> |
27 | #include <gdk/gdktypes.h> |
28 | #include <gdk/gdkversionmacros.h> |
29 | |
30 | G_BEGIN_DECLS |
31 | |
32 | /** |
33 | * GdkAnchorHints: |
34 | * @GDK_ANCHOR_FLIP_X: allow flipping anchors horizontally |
35 | * @GDK_ANCHOR_FLIP_Y: allow flipping anchors vertically |
36 | * @GDK_ANCHOR_SLIDE_X: allow sliding surface horizontally |
37 | * @GDK_ANCHOR_SLIDE_Y: allow sliding surface vertically |
38 | * @GDK_ANCHOR_RESIZE_X: allow resizing surface horizontally |
39 | * @GDK_ANCHOR_RESIZE_Y: allow resizing surface vertically |
40 | * @GDK_ANCHOR_FLIP: allow flipping anchors on both axes |
41 | * @GDK_ANCHOR_SLIDE: allow sliding surface on both axes |
42 | * @GDK_ANCHOR_RESIZE: allow resizing surface on both axes |
43 | * |
44 | * Positioning hints for aligning a surface relative to a rectangle. |
45 | * |
46 | * These hints determine how the surface should be positioned in the case that |
47 | * the surface would fall off-screen if placed in its ideal position. |
48 | * |
49 | * For example, %GDK_ANCHOR_FLIP_X will replace %GDK_GRAVITY_NORTH_WEST with |
50 | * %GDK_GRAVITY_NORTH_EAST and vice versa if the surface extends beyond the left |
51 | * or right edges of the monitor. |
52 | * |
53 | * If %GDK_ANCHOR_SLIDE_X is set, the surface can be shifted horizontally to fit |
54 | * on-screen. If %GDK_ANCHOR_RESIZE_X is set, the surface can be shrunken |
55 | * horizontally to fit. |
56 | * |
57 | * In general, when multiple flags are set, flipping should take precedence over |
58 | * sliding, which should take precedence over resizing. |
59 | */ |
60 | typedef enum |
61 | { |
62 | GDK_ANCHOR_FLIP_X = 1 << 0, |
63 | GDK_ANCHOR_FLIP_Y = 1 << 1, |
64 | GDK_ANCHOR_SLIDE_X = 1 << 2, |
65 | GDK_ANCHOR_SLIDE_Y = 1 << 3, |
66 | GDK_ANCHOR_RESIZE_X = 1 << 4, |
67 | GDK_ANCHOR_RESIZE_Y = 1 << 5, |
68 | GDK_ANCHOR_FLIP = GDK_ANCHOR_FLIP_X | GDK_ANCHOR_FLIP_Y, |
69 | GDK_ANCHOR_SLIDE = GDK_ANCHOR_SLIDE_X | GDK_ANCHOR_SLIDE_Y, |
70 | GDK_ANCHOR_RESIZE = GDK_ANCHOR_RESIZE_X | GDK_ANCHOR_RESIZE_Y, |
71 | } GdkAnchorHints; |
72 | |
73 | typedef struct ; |
74 | |
75 | #define (gdk_popup_layout_get_type ()) |
76 | |
77 | GDK_AVAILABLE_IN_ALL |
78 | GType (void); |
79 | |
80 | GDK_AVAILABLE_IN_ALL |
81 | GdkPopupLayout * (const GdkRectangle *anchor_rect, |
82 | GdkGravity rect_anchor, |
83 | GdkGravity surface_anchor); |
84 | |
85 | GDK_AVAILABLE_IN_ALL |
86 | GdkPopupLayout * (GdkPopupLayout *layout); |
87 | |
88 | GDK_AVAILABLE_IN_ALL |
89 | void (GdkPopupLayout *layout); |
90 | |
91 | GDK_AVAILABLE_IN_ALL |
92 | GdkPopupLayout * (GdkPopupLayout *layout); |
93 | |
94 | GDK_AVAILABLE_IN_ALL |
95 | gboolean (GdkPopupLayout *layout, |
96 | GdkPopupLayout *other); |
97 | |
98 | GDK_AVAILABLE_IN_ALL |
99 | void (GdkPopupLayout *layout, |
100 | const GdkRectangle *anchor_rect); |
101 | |
102 | GDK_AVAILABLE_IN_ALL |
103 | const GdkRectangle * (GdkPopupLayout *layout); |
104 | |
105 | GDK_AVAILABLE_IN_ALL |
106 | void (GdkPopupLayout *layout, |
107 | GdkGravity anchor); |
108 | |
109 | GDK_AVAILABLE_IN_ALL |
110 | GdkGravity (GdkPopupLayout *layout); |
111 | |
112 | GDK_AVAILABLE_IN_ALL |
113 | void (GdkPopupLayout *layout, |
114 | GdkGravity anchor); |
115 | |
116 | GDK_AVAILABLE_IN_ALL |
117 | GdkGravity (GdkPopupLayout *layout); |
118 | |
119 | GDK_AVAILABLE_IN_ALL |
120 | void (GdkPopupLayout *layout, |
121 | GdkAnchorHints anchor_hints); |
122 | |
123 | GDK_AVAILABLE_IN_ALL |
124 | GdkAnchorHints (GdkPopupLayout *layout); |
125 | |
126 | GDK_AVAILABLE_IN_ALL |
127 | void (GdkPopupLayout *layout, |
128 | int dx, |
129 | int dy); |
130 | |
131 | GDK_AVAILABLE_IN_ALL |
132 | void (GdkPopupLayout *layout, |
133 | int *dx, |
134 | int *dy); |
135 | |
136 | GDK_AVAILABLE_IN_4_2 |
137 | void gdk_popup_layout_set_shadow_width (GdkPopupLayout *layout, |
138 | int left, |
139 | int right, |
140 | int top, |
141 | int bottom); |
142 | GDK_AVAILABLE_IN_4_2 |
143 | void gdk_popup_layout_get_shadow_width (GdkPopupLayout *layout, |
144 | int *left, |
145 | int *right, |
146 | int *top, |
147 | int *bottom); |
148 | |
149 | |
150 | G_END_DECLS |
151 | |
152 | #endif /* __GDK_POPUP_LAYOUT_H__ */ |
153 | |