gtk: add enumeration modules and new widgets
[nit.git] / lib / gtk / gtk_enums.nit
1 module gtk_enums
2
3 in "C Header" `{
4 #include <gtk/gtk.h>
5
6 `}
7
8 #enum GtkArrowPlacement
9 #Used to specify the placement of scroll arrows in scrolling menus.
10 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkArrowPlacement
11 extern GtkArrowPlacement `{GtkArrowPlacement`}
12 #Place one arrow on each end of the menu.
13 new both `{ return GTK_ARROWS_BOTH; `}
14
15 #Place both arrows at the top of the menu.
16 new top `{ return GTK_ARROWS_START; `}
17
18 #Place both arrows at the bottom of the menu.
19 new bottom `{ return GTK_ARROWS_END; `}
20 end
21
22 #enum GtkArrowType
23 #Used to indicate the direction in which a GtkArrow should point.
24 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkArrowType
25 extern GtkArrowType `{GtkArrowType`}
26 #Represents an upward pointing arrow.
27 new up `{ return GTK_ARROW_UP; `}
28
29 #Represents an downward pointing arrow.
30 new down `{ return GTK_ARROW_DOWN; `}
31
32 #Represents a left pointing arrow.
33 new left `{ return GTK_ARROW_LEFT; `}
34
35 #Represents a right pointing arrow.
36 new right `{ return GTK_ARROW_RIGHT; `}
37
38 #No arrow
39 new none `{ return GTK_ARROW_NONE; `}
40 end
41
42 #enum GtkAttachOptions
43 #Denotes the expansion properties that a widget will have when it (or its parent) is resized.
44 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkAttachOptions
45 extern GtkAttachOptions `{GtkAttachOptions`}
46 #The widget should expand to take up any extra space in its container that has been allocated.
47 new expan `{ return GTK_EXPAND; `}
48
49 #The widget should shrink as and when possible.
50 new shrink `{ return GTK_SHRINK; `}
51
52 #The widget should fill the space allocated to it.
53 new fill `{ return GTK_FILL; `}
54 end
55
56 #enum GtkButtonBoxStyle
57 #Used to dictate the style that a GtkButtonBox uses to layout the buttons it contains.
58 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkButtonBoxStyle
59 extern GtkButtonBoxStyle `{GtkButtonBoxStyle`}
60 #Buttons are evenly spread across the box.
61 new spread `{ return GTK_BUTTONBOX_SPREAD; `}
62
63 #Buttons are placed at the edges of the box.
64 new edge `{ return GTK_BUTTONBOX_EDGE; `}
65
66 #Buttons are grouped towards the start of the box.
67 new start `{ return GTK_BUTTONBOX_START; `}
68
69 #Buttons are grouped towards the end of the box.
70 new end_of_box `{ return GTK_BUTTONBOX_END; `}
71
72 #Buttons are centered in the box
73 new center `{ return GTK_BUTTONBOX_CENTER; `}
74 end
75
76 #enum GtkCornerType
77 #Specifies which corner a child widget should be placed in when packed into a GtkScrolledWindow. This is effectively the opposite of where the scroll bars are placed.
78 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkCornerType
79 extern GtkCornerType `{GtkCornerType`}
80 #Place the scrollbars on the right and bottom of the widget (default behaviour).
81 new top_left `{ return GTK_CORNER_TOP_LEFT; `}
82
83 #Place the scrollbars on the right and bottom of the widget (default behaviour).
84 new bottom_left `{ return GTK_CORNER_BOTTOM_LEFT; `}
85
86 #Place the scrollbars on the left and bottom of the widget.
87 new top_right `{ return GTK_CORNER_TOP_RIGHT; `}
88
89 #Place the scrollbars on the top and left of the widget.
90 new bottom_right `{ return GTK_CORNER_BOTTOM_RIGHT; `}
91 end
92
93 #enum GtkExpanderStyle
94 #Used to specify the style of the expanders drawn by a GtkTreeView.
95 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkExpanderStyle
96 extern GtkExpanderStyle `{GtkExpanderStyle`}
97 #The style used for a collapsed subtree.
98 new collapsed `{ return GTK_EXPANDER_COLLAPSED; `}
99
100 #Intermediate style used during animation.
101 new semi_collapsed `{ return GTK_EXPANDER_SEMI_COLLAPSED; `}
102
103 #Intermediate style used during animation.
104 new semi_expanded `{ return GTK_EXPANDER_SEMI_EXPANDED; `}
105
106 #The style used for an expanded subtree.
107 new expanded `{ return GTK_EXPANDER_EXPANDED; `}
108 end
109
110 #enum GtkJustification
111 #Used for justifying the text inside a GtkLabel widget.
112 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkJustification
113 extern GtkJustification `{GtkJustification`}
114 #The text is placed at the left edge of the label.
115 new left `{ return GTK_JUSTIFY_LEFT; `}
116
117 #The text is placed at the right edge of the label.
118 new right `{ return GTK_JUSTIFY_RIGHT; `}
119
120 #The text is placed in the center of the label.
121 new center `{ return GTK_JUSTIFY_CENTER; `}
122
123 #The text is placed is distributed across the label.
124 new fill `{ return GTK_JUSTIFY_FILL; `}
125 end
126
127 #enum GtkOrientation
128 #Represents the orientation of widgets.
129 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkOrientation
130 extern GtkOrientation `{GtkOrientation`}
131 #The widget is in horizontal orientation.
132 new horizontal `{ return GTK_ORIENTATION_HORIZONTAL; `}
133
134 #The widget is in vertical orientation.
135 new vertical `{ return GTK_ORIENTATION_VERTICAL; `}
136 end
137
138 #enum GtkPackType
139 #Represents the packing location GtkBox children.
140 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPackType
141 extern GtkPackType `{GtkPackType`}
142 #The child is packed into the start of the box.
143 new start `{ return GTK_PACK_START; `}
144
145 #The child is packed into the end of the box.
146 new end_of_box `{ return GTK_PACK_END; `}
147 end
148
149 #enum GtkPolicyType
150 #Determines when a scroll bar will be visible.
151 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPolicyType
152 extern GtkPolicyType `{GtkPolicyType`}
153 #The scrollbar is always visible.
154 new always `{ return GTK_POLICY_ALWAYS; `}
155
156 #The scrollbar will appear and disappear as necessary.
157 new automatic `{ return GTK_POLICY_AUTOMATIC; `}
158
159 #The scrollbar will never appear.
160 new never `{ return GTK_POLICY_NEVER; `}
161 end
162
163 #enum GtkPositionType
164 #Describes which edge of a widget a certain feature is positioned.
165 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkPositionType
166 extern GtkPositionType `{GtkPositionType`}
167 #The feature is at the left edge.
168 new left `{ return GTK_POS_LEFT; `}
169
170 #The feature is at the right edge.
171 new right `{ return GTK_POS_RIGHT; `}
172
173 #The feature is at the top edge.
174 new top `{ return GTK_POS_TOP; `}
175
176 #The feature is at the bottom edge.
177 new bottom `{ return GTK_POS_BOTTOM; `}
178 end
179
180 #enum GtkReliefStyle
181 #Indicates the relief to be drawn around a GtkButton.
182 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkReliefStyle
183 extern GtkReliefStyle `{GtkReliefStyle`}
184 #Draw a normal relief.
185 new normal `{ return GTK_RELIEF_NORMAL; `}
186
187 #A half relief.
188 new half `{ return GTK_RELIEF_HALF; `}
189
190 #No relief.
191 new none `{ return GTK_RELIEF_NONE; `}
192 end
193
194 #enum GtkResizeMode
195 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkResizeMode
196 extern GtkResizeMode `{GtkResizeMode`}
197 #Pass resize request to the parent.
198 new parent `{ return GTK_RESIZE_PARENT; `}
199
200 #Queue resizes on this widget.
201 new queue `{ return GTK_RESIZE_QUEUE; `}
202 end
203
204 #enum GtkSelectionMode
205 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkSelectionMode
206 extern GtkSelectionMode `{GtkResizeMode`}
207 #No selection is possible.
208 new none `{ return GTK_SELECTION_NONE; `}
209
210 #Zero or one element may be selected.
211 new single `{ return GTK_SELECTION_SINGLE; `}
212
213 #Exactly one element is selected.
214 new browse `{ return GTK_SELECTION_BROWSE; `}
215
216 #Any number of elements may be selected.
217 new multiple `{ return GTK_SELECTION_MULTIPLE; `}
218 end
219
220 #enum GtkShadowType
221 #Used to change the appearance of an outline typically provided by a GtkFrame.
222 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkShadowType
223 extern GtkShadowType `{GtkShadowType`}
224 #No outline.
225 new none `{ return GTK_SHADOW_NONE; `}
226
227 #The outline is bevelled inwards.
228 new shadow_in `{ return GTK_SHADOW_IN; `}
229
230 #The outline is bevelled outwards like a button.
231 new shadow_out `{ return GTK_SHADOW_OUT; `}
232
233 #The outline has a sunken 3d appearance.
234 new etched_id `{ return GTK_SHADOW_ETCHED_IN; `}
235
236 #The outline has a raised 3d appearance.
237 new etched_out `{ return GTK_SHADOW_ETCHED_OUT; `}
238 end
239
240 #enum GtkStateType
241 #Indicates the current state of a widget; the state determines how the widget is drawn.
242 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkStateType
243 extern GtkStateType `{GtkStateType`}
244 #State during normal operation.
245 new normal `{ return GTK_STATE_NORMAL; `}
246
247 #State of a currently active widget, such as a depressed button.
248 new active `{ return GTK_STATE_ACTIVE; `}
249
250 #State indicating that the mouse pointer is over the widget and the widget will respond to mouse clicks.
251 new prelight `{ return GTK_STATE_PRELIGHT; `}
252
253 #State of a selected item, such the selected row in a list.
254 new selected `{ return GTK_STATE_SELECTED; `}
255
256 #State indicating that the widget is unresponsive to user actions.
257 new insensitive `{ return GTK_STATE_INSENSITIVE; `}
258
259 #The widget is inconsistent, such as checkbuttons or radiobuttons that aren't either set to TRUE nor FALSE, or buttons requiring the user attention.
260 new inconsistent `{ return GTK_STATE_INCONSISTENT; `}
261
262 #The widget has the keyboard focus.
263 new focused `{ return GTK_STATE_FOCUSED; `}
264 end
265
266 #enum GtkStateFlags
267 #Describes a widget state.
268 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkStateFlags
269 extern GtkStateFlags `{GtkStateFlags`}
270 #State during normal operation.
271 new normal `{ return GTK_STATE_FLAG_NORMAL; `}
272
273 #Widget is active.
274 new active `{ return GTK_STATE_FLAG_ACTIVE; `}
275
276 #Widget has a mouse pointer over it.
277 new prelight `{ return GTK_STATE_FLAG_PRELIGHT; `}
278
279 #Widget is selected.
280 new selected `{ return GTK_STATE_FLAG_SELECTED; `}
281
282 #Widget is insensitive.
283 new insensitive `{ return GTK_STATE_INSENSITIVE; `}
284
285 #Widget is inconsistent.
286 new inconsistent `{ return GTK_STATE_FLAG_INCONSISTENT; `}
287
288 #Widget has the keyboard focus.
289 new focused `{ return GTK_STATE_FLAG_FOCUSED; `}
290 end
291
292 #enum GtkToolbarStyle
293 #Used to customize the appearance of a GtkToolbar.
294 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkToolbarStyle
295 extern GtkToolbarStyle `{GtkToolbarStyle`}
296 #Buttons display only icons in the toolbar.
297 new icons `{ return GTK_TOOLBAR_ICONS; `}
298
299 #Buttons display only text labels in the toolbar.
300 new text `{ return GTK_TOOLBAR_TEXT; `}
301
302 #Buttons display text and icons in the toolbar.
303 new both `{ return GTK_TOOLBAR_BOTH; `}
304
305 #Buttons display icons and text alongside each other, rather than vertically stacked
306 new both_horiz `{ return GTK_TOOLBAR_BOTH_HORIZ; `}
307 end
308
309 #enum GtkWindowPosition
310 #Window placement can be influenced using this enumeration.
311 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkWindowPosition
312 extern GtkWindowPosition `{GtkWindowPosition`}
313 #No influence is made on placement.
314 new none `{ return GTK_WIN_POS_NONE; `}
315
316 #Windows should be placed in the center of the screen.
317 new center `{ return GTK_WIN_POS_CENTER; `}
318
319 #Windows should be placed at the current mouse position.
320 new mouse `{ return GTK_WIN_POS_MOUSE; `}
321
322 #Keep window centered as it changes size, etc.
323 new center_always `{ return GTK_WIN_POS_CENTER_ALWAYS; `}
324
325 #Center the window on its transient parent.
326 new center_on_parent `{ return GTK_WIN_POS_CENTER_ON_PARENT; `}
327 end
328
329 #enum GtkWindowType
330 #A GtkWindow can be one of these types.
331 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkWindowType
332 extern GtkWindowType `{GtkWindowType`}
333 #A regular window, such as a dialog
334 new toplevel `{ return GTK_WINDOW_TOPLEVEL; `}
335
336 #A special window such as a tooltip.
337 new popup `{ return GTK_WINDOW_POPUP; `}
338 end
339
340 #enum GtkSortType
341 #Determines the direction of a sort.
342 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkSortType
343 extern GtkSortType `{GtkSortType`}
344 #Sorting is in ascending order.
345 new asc `{ return GTK_SORT_ASCENDING; `}
346
347 #Sorting is in descending order.
348 new desc `{ return GTK_SORT_DESCENDING; `}
349 end
350
351 #enum GtkBorderStyle
352 #Describes how the border of a UI element should be rendered.
353 #@https://developer.gnome.org/gtk3/3.2/gtk3-Standard-Enumerations.html#GtkBorderStyle
354 extern GtkBorderStyle `{GtkBorderStyle`}
355 #No visible border.
356 new none `{ return GTK_BORDER_STYLE_NONE; `}
357
358 #An solid border.
359 new solid `{ return GTK_BORDER_STYLE_SOLID; `}
360
361 #An intset border.
362 new inset `{ return GTK_BORDER_STYLE_INSET; `}
363
364 #An outset border.
365 new outset `{ return GTK_BORDER_STYLE_OUTSET; `}
366 end
367
368 # Icon size enum
369 extern GtkIconSize `{GtkIconSize`}
370 new invalid `{ return GTK_ICON_SIZE_INVALID; `}
371 new menu `{ return GTK_ICON_SIZE_MENU; `}
372 new small_toolbar `{ return GTK_ICON_SIZE_SMALL_TOOLBAR; `}
373 new large_toolbar `{ return GTK_ICON_SIZE_LARGE_TOOLBAR; `}
374 new button `{ return GTK_ICON_SIZE_BUTTON; `}
375 new dnd `{ return GTK_ICON_SIZE_DND; `}
376 new dialog `{ return GTK_ICON_SIZE_DIALOG;`}
377 end