]> Pileus Git - ~andy/gtk/blob - gtk/gtkenums.h
Added initial revision of GtkWrapBox container widget and test case.
[~andy/gtk] / gtk / gtkenums.h
1 /* GTK - The GIMP Toolkit
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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 /*
21  * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
22  * file for a list of people on the GTK+ Team.  See the ChangeLog
23  * files for a list of changes.  These files are distributed with
24  * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
25  */
26
27 #if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
28 #error "Only <gtk/gtk.h> can be included directly."
29 #endif
30
31 #ifndef __GTK_ENUMS_H__
32 #define __GTK_ENUMS_H__
33
34 #include <glib-object.h>
35
36 G_BEGIN_DECLS
37
38 /* Anchor types */
39 typedef enum
40 {
41   GTK_ANCHOR_CENTER,
42   GTK_ANCHOR_NORTH,
43   GTK_ANCHOR_NORTH_WEST,
44   GTK_ANCHOR_NORTH_EAST,
45   GTK_ANCHOR_SOUTH,
46   GTK_ANCHOR_SOUTH_WEST,
47   GTK_ANCHOR_SOUTH_EAST,
48   GTK_ANCHOR_WEST,
49   GTK_ANCHOR_EAST,
50   GTK_ANCHOR_N          = GTK_ANCHOR_NORTH,
51   GTK_ANCHOR_NW         = GTK_ANCHOR_NORTH_WEST,
52   GTK_ANCHOR_NE         = GTK_ANCHOR_NORTH_EAST,
53   GTK_ANCHOR_S          = GTK_ANCHOR_SOUTH,
54   GTK_ANCHOR_SW         = GTK_ANCHOR_SOUTH_WEST,
55   GTK_ANCHOR_SE         = GTK_ANCHOR_SOUTH_EAST,
56   GTK_ANCHOR_W          = GTK_ANCHOR_WEST,
57   GTK_ANCHOR_E          = GTK_ANCHOR_EAST
58 } GtkAnchorType;
59
60 /* Arrow placement */
61 typedef enum
62 {
63   GTK_ARROWS_BOTH,
64   GTK_ARROWS_START,
65   GTK_ARROWS_END
66 } GtkArrowPlacement;
67
68 /* Arrow types */
69 typedef enum
70 {
71   GTK_ARROW_UP,
72   GTK_ARROW_DOWN,
73   GTK_ARROW_LEFT,
74   GTK_ARROW_RIGHT,
75   GTK_ARROW_NONE
76 } GtkArrowType;
77
78 /* Attach options (for tables) */
79 typedef enum
80 {
81   GTK_EXPAND = 1 << 0,
82   GTK_SHRINK = 1 << 1,
83   GTK_FILL   = 1 << 2
84 } GtkAttachOptions;
85
86 /* Button box styles */
87 typedef enum
88 {
89   GTK_BUTTONBOX_SPREAD = 1,
90   GTK_BUTTONBOX_EDGE,
91   GTK_BUTTONBOX_START,
92   GTK_BUTTONBOX_END,
93   GTK_BUTTONBOX_CENTER
94 } GtkButtonBoxStyle;
95
96 typedef enum
97 {
98   GTK_DELETE_CHARS,
99   GTK_DELETE_WORD_ENDS,           /* delete only the portion of the word to the
100                                    * left/right of cursor if we're in the middle
101                                    * of a word */
102   GTK_DELETE_WORDS,
103   GTK_DELETE_DISPLAY_LINES,
104   GTK_DELETE_DISPLAY_LINE_ENDS,
105   GTK_DELETE_PARAGRAPH_ENDS,      /* like C-k in Emacs (or its reverse) */
106   GTK_DELETE_PARAGRAPHS,          /* C-k in pico, kill whole line */
107   GTK_DELETE_WHITESPACE           /* M-\ in Emacs */
108 } GtkDeleteType;
109
110 /* Focus movement types */
111 typedef enum
112 {
113   GTK_DIR_TAB_FORWARD,
114   GTK_DIR_TAB_BACKWARD,
115   GTK_DIR_UP,
116   GTK_DIR_DOWN,
117   GTK_DIR_LEFT,
118   GTK_DIR_RIGHT
119 } GtkDirectionType;
120
121 /* Expander styles */
122 typedef enum
123 {
124   GTK_EXPANDER_COLLAPSED,
125   GTK_EXPANDER_SEMI_COLLAPSED,
126   GTK_EXPANDER_SEMI_EXPANDED,
127   GTK_EXPANDER_EXPANDED
128 } GtkExpanderStyle;
129
130 /* Built-in stock icon sizes */
131 typedef enum
132 {
133   GTK_ICON_SIZE_INVALID,
134   GTK_ICON_SIZE_MENU,
135   GTK_ICON_SIZE_SMALL_TOOLBAR,
136   GTK_ICON_SIZE_LARGE_TOOLBAR,
137   GTK_ICON_SIZE_BUTTON,
138   GTK_ICON_SIZE_DND,
139   GTK_ICON_SIZE_DIALOG
140 } GtkIconSize;
141
142 /**
143  * GtkSensitivityType:
144  * @GTK_SENSITIVITY_AUTO: The arrow is made insensitive if the
145  *   thumb is at the end
146  * @GTK_SENSITIVITY_ON: The arrow is always sensitive
147  * @GTK_SENSITIVITY_OFF: The arrow is always insensitive
148  *
149  * Determines how GTK+ handles the sensitivity of stepper arrows
150  * at the end of range widgets.
151  */
152 typedef enum
153 {
154   GTK_SENSITIVITY_AUTO,
155   GTK_SENSITIVITY_ON,
156   GTK_SENSITIVITY_OFF
157 } GtkSensitivityType;
158
159 /* Reading directions for text */
160 typedef enum
161 {
162   GTK_TEXT_DIR_NONE,
163   GTK_TEXT_DIR_LTR,
164   GTK_TEXT_DIR_RTL
165 } GtkTextDirection;
166
167 /* justification for label and maybe other widgets (text?) */
168 typedef enum
169 {
170   GTK_JUSTIFY_LEFT,
171   GTK_JUSTIFY_RIGHT,
172   GTK_JUSTIFY_CENTER,
173   GTK_JUSTIFY_FILL
174 } GtkJustification;
175
176 /* Menu keyboard movement types */
177 typedef enum
178 {
179   GTK_MENU_DIR_PARENT,
180   GTK_MENU_DIR_CHILD,
181   GTK_MENU_DIR_NEXT,
182   GTK_MENU_DIR_PREV
183 } GtkMenuDirectionType;
184
185 /**
186  * GtkMessageType:
187  * @GTK_MESSAGE_INFO: Informational message
188  * @GTK_MESSAGE_WARNING: Nonfatal warning message
189  * @GTK_MESSAGE_QUESTION: Question requiring a choice
190  * @GTK_MESSAGE_ERROR: Fatal error message
191  * @GTK_MESSAGE_OTHER: None of the above, doesn't get an icon
192  *
193  * The type of message being displayed in the dialog.
194  */
195 typedef enum
196 {
197   GTK_MESSAGE_INFO,
198   GTK_MESSAGE_WARNING,
199   GTK_MESSAGE_QUESTION,
200   GTK_MESSAGE_ERROR,
201   GTK_MESSAGE_OTHER
202 } GtkMessageType;
203
204 typedef enum
205 {
206   GTK_PIXELS,
207   GTK_INCHES,
208   GTK_CENTIMETERS
209 } GtkMetricType;
210
211 /**
212  * GtkMovementStep:
213  * @GTK_MOVEMENT_LOGICAL_POSITIONS: Move forward or back by graphemes
214  * @GTK_MOVEMENT_VISUAL_POSITIONS:  Move left or right by graphemes
215  * @GTK_MOVEMENT_WORDS:             Move forward or back by words
216  * @GTK_MOVEMENT_DISPLAY_LINES:     Move up or down lines (wrapped lines)
217  * @GTK_MOVEMENT_DISPLAY_LINE_ENDS: Move to either end of a line
218  * @GTK_MOVEMENT_PARAGRAPHS:        Move up or down paragraphs (newline-ended lines)
219  * @GTK_MOVEMENT_PARAGRAPH_ENDS:    Move to either end of a paragraph
220  * @GTK_MOVEMENT_PAGES:             Move by pages
221  * @GTK_MOVEMENT_BUFFER_ENDS:       Move to ends of the buffer
222  * @GTK_MOVEMENT_HORIZONTAL_PAGES:  Move horizontally by pages
223  */
224 typedef enum
225 {
226   GTK_MOVEMENT_LOGICAL_POSITIONS,
227   GTK_MOVEMENT_VISUAL_POSITIONS,
228   GTK_MOVEMENT_WORDS,
229   GTK_MOVEMENT_DISPLAY_LINES,
230   GTK_MOVEMENT_DISPLAY_LINE_ENDS,
231   GTK_MOVEMENT_PARAGRAPHS,
232   GTK_MOVEMENT_PARAGRAPH_ENDS,
233   GTK_MOVEMENT_PAGES,
234   GTK_MOVEMENT_BUFFER_ENDS,
235   GTK_MOVEMENT_HORIZONTAL_PAGES
236 } GtkMovementStep;
237
238 typedef enum
239 {
240   GTK_SCROLL_STEPS,
241   GTK_SCROLL_PAGES,
242   GTK_SCROLL_ENDS,
243   GTK_SCROLL_HORIZONTAL_STEPS,
244   GTK_SCROLL_HORIZONTAL_PAGES,
245   GTK_SCROLL_HORIZONTAL_ENDS
246 } GtkScrollStep;
247
248 /* Orientation for toolbars, etc. */
249 typedef enum
250 {
251   GTK_ORIENTATION_HORIZONTAL,
252   GTK_ORIENTATION_VERTICAL
253 } GtkOrientation;
254
255 /* Placement type for scrolled window */
256 typedef enum
257 {
258   GTK_CORNER_TOP_LEFT,
259   GTK_CORNER_BOTTOM_LEFT,
260   GTK_CORNER_TOP_RIGHT,
261   GTK_CORNER_BOTTOM_RIGHT
262 } GtkCornerType;
263
264 /* Packing types (for boxes) */
265 typedef enum
266 {
267   GTK_PACK_START,
268   GTK_PACK_END
269 } GtkPackType;
270
271 /* priorities for path lookups */
272 typedef enum
273 {
274   GTK_PATH_PRIO_LOWEST      = 0,
275   GTK_PATH_PRIO_GTK         = 4,
276   GTK_PATH_PRIO_APPLICATION = 8,
277   GTK_PATH_PRIO_THEME       = 10,
278   GTK_PATH_PRIO_RC          = 12,
279   GTK_PATH_PRIO_HIGHEST     = 15
280 } GtkPathPriorityType;
281 #define GTK_PATH_PRIO_MASK 0x0f
282
283 /* widget path types */
284 typedef enum
285 {
286   GTK_PATH_WIDGET,
287   GTK_PATH_WIDGET_CLASS,
288   GTK_PATH_CLASS
289 } GtkPathType;
290
291 /* Scrollbar policy types (for scrolled windows) */
292 typedef enum
293 {
294   GTK_POLICY_ALWAYS,
295   GTK_POLICY_AUTOMATIC,
296   GTK_POLICY_NEVER
297 } GtkPolicyType;
298
299 typedef enum
300 {
301   GTK_POS_LEFT,
302   GTK_POS_RIGHT,
303   GTK_POS_TOP,
304   GTK_POS_BOTTOM
305 } GtkPositionType;
306
307 /* Style for buttons */
308 typedef enum
309 {
310   GTK_RELIEF_NORMAL,
311   GTK_RELIEF_HALF,
312   GTK_RELIEF_NONE
313 } GtkReliefStyle;
314
315 /* Resize type */
316 typedef enum
317 {
318   GTK_RESIZE_PARENT,            /* Pass resize request to the parent */
319   GTK_RESIZE_QUEUE,             /* Queue resizes on this widget */
320   GTK_RESIZE_IMMEDIATE          /* Perform the resizes now */
321 } GtkResizeMode;
322
323 /* scrolling types */
324 typedef enum
325 {
326   GTK_SCROLL_NONE,
327   GTK_SCROLL_JUMP,
328   GTK_SCROLL_STEP_BACKWARD,
329   GTK_SCROLL_STEP_FORWARD,
330   GTK_SCROLL_PAGE_BACKWARD,
331   GTK_SCROLL_PAGE_FORWARD,
332   GTK_SCROLL_STEP_UP,
333   GTK_SCROLL_STEP_DOWN,
334   GTK_SCROLL_PAGE_UP,
335   GTK_SCROLL_PAGE_DOWN,
336   GTK_SCROLL_STEP_LEFT,
337   GTK_SCROLL_STEP_RIGHT,
338   GTK_SCROLL_PAGE_LEFT,
339   GTK_SCROLL_PAGE_RIGHT,
340   GTK_SCROLL_START,
341   GTK_SCROLL_END
342 } GtkScrollType;
343
344 /* list selection modes */
345 typedef enum
346 {
347   GTK_SELECTION_NONE,                             /* Nothing can be selected */
348   GTK_SELECTION_SINGLE,
349   GTK_SELECTION_BROWSE,
350   GTK_SELECTION_MULTIPLE,
351   GTK_SELECTION_EXTENDED = GTK_SELECTION_MULTIPLE /* Deprecated */
352 } GtkSelectionMode;
353
354 /* Shadow types */
355 typedef enum
356 {
357   GTK_SHADOW_NONE,
358   GTK_SHADOW_IN,
359   GTK_SHADOW_OUT,
360   GTK_SHADOW_ETCHED_IN,
361   GTK_SHADOW_ETCHED_OUT
362 } GtkShadowType;
363
364 /* Widget states */
365 typedef enum
366 {
367   GTK_STATE_NORMAL,
368   GTK_STATE_ACTIVE,
369   GTK_STATE_PRELIGHT,
370   GTK_STATE_SELECTED,
371   GTK_STATE_INSENSITIVE
372 } GtkStateType;
373
374 #if !defined(GTK_DISABLE_DEPRECATED) || defined (GTK_MENU_INTERNALS)
375 /* Directions for submenus */
376 typedef enum
377 {
378   GTK_DIRECTION_LEFT,
379   GTK_DIRECTION_RIGHT
380 } GtkSubmenuDirection;
381
382 /* Placement of submenus */
383 typedef enum
384 {
385   GTK_TOP_BOTTOM,
386   GTK_LEFT_RIGHT
387 } GtkSubmenuPlacement;
388 #endif /* GTK_DISABLE_DEPRECATED */
389
390 /* Style for toolbars */
391 typedef enum
392 {
393   GTK_TOOLBAR_ICONS,
394   GTK_TOOLBAR_TEXT,
395   GTK_TOOLBAR_BOTH,
396   GTK_TOOLBAR_BOTH_HORIZ
397 } GtkToolbarStyle;
398
399 /* Data update types (for ranges) */
400 typedef enum
401 {
402   GTK_UPDATE_CONTINUOUS,
403   GTK_UPDATE_DISCONTINUOUS,
404   GTK_UPDATE_DELAYED
405 } GtkUpdateType;
406
407 /* Generic visibility flags */
408 typedef enum
409 {
410   GTK_VISIBILITY_NONE,
411   GTK_VISIBILITY_PARTIAL,
412   GTK_VISIBILITY_FULL
413 } GtkVisibility;
414
415 /* Window position types */
416 typedef enum
417 {
418   GTK_WIN_POS_NONE,
419   GTK_WIN_POS_CENTER,
420   GTK_WIN_POS_MOUSE,
421   GTK_WIN_POS_CENTER_ALWAYS,
422   GTK_WIN_POS_CENTER_ON_PARENT
423 } GtkWindowPosition;
424
425 /* Window types */
426 typedef enum
427 {
428   GTK_WINDOW_TOPLEVEL,
429   GTK_WINDOW_POPUP
430 } GtkWindowType;
431
432 /* Text wrap */
433 typedef enum
434 {
435   GTK_WRAP_NONE,
436   GTK_WRAP_CHAR,
437   GTK_WRAP_WORD,
438   GTK_WRAP_WORD_CHAR
439 } GtkWrapMode;
440
441 /* How to sort */
442 typedef enum
443 {
444   GTK_SORT_ASCENDING,
445   GTK_SORT_DESCENDING
446 } GtkSortType;
447
448 /* Style for gtk input method preedit/status */
449 typedef enum
450 {
451   GTK_IM_PREEDIT_NOTHING,
452   GTK_IM_PREEDIT_CALLBACK,
453   GTK_IM_PREEDIT_NONE
454 } GtkIMPreeditStyle;
455
456 typedef enum
457 {
458   GTK_IM_STATUS_NOTHING,
459   GTK_IM_STATUS_CALLBACK,
460   GTK_IM_STATUS_NONE
461 } GtkIMStatusStyle;
462
463 typedef enum
464 {
465   GTK_PACK_DIRECTION_LTR,
466   GTK_PACK_DIRECTION_RTL,
467   GTK_PACK_DIRECTION_TTB,
468   GTK_PACK_DIRECTION_BTT
469 } GtkPackDirection;
470
471 typedef enum
472 {
473   GTK_PRINT_PAGES_ALL,
474   GTK_PRINT_PAGES_CURRENT,
475   GTK_PRINT_PAGES_RANGES,
476   GTK_PRINT_PAGES_SELECTION
477 } GtkPrintPages;
478
479 typedef enum
480 {
481   GTK_PAGE_SET_ALL,
482   GTK_PAGE_SET_EVEN,
483   GTK_PAGE_SET_ODD
484 } GtkPageSet;
485
486 typedef enum
487 {
488   GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_TOP_TO_BOTTOM, /*< nick=lrtb >*/
489   GTK_NUMBER_UP_LAYOUT_LEFT_TO_RIGHT_BOTTOM_TO_TOP, /*< nick=lrbt >*/
490   GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_TOP_TO_BOTTOM, /*< nick=rltb >*/
491   GTK_NUMBER_UP_LAYOUT_RIGHT_TO_LEFT_BOTTOM_TO_TOP, /*< nick=rlbt >*/
492   GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_LEFT_TO_RIGHT, /*< nick=tblr >*/
493   GTK_NUMBER_UP_LAYOUT_TOP_TO_BOTTOM_RIGHT_TO_LEFT, /*< nick=tbrl >*/
494   GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_LEFT_TO_RIGHT, /*< nick=btlr >*/
495   GTK_NUMBER_UP_LAYOUT_BOTTOM_TO_TOP_RIGHT_TO_LEFT  /*< nick=btrl >*/
496 } GtkNumberUpLayout;
497
498 typedef enum
499 {
500   GTK_PAGE_ORIENTATION_PORTRAIT,
501   GTK_PAGE_ORIENTATION_LANDSCAPE,
502   GTK_PAGE_ORIENTATION_REVERSE_PORTRAIT,
503   GTK_PAGE_ORIENTATION_REVERSE_LANDSCAPE
504 } GtkPageOrientation;
505
506 typedef enum
507 {
508   GTK_PRINT_QUALITY_LOW,
509   GTK_PRINT_QUALITY_NORMAL,
510   GTK_PRINT_QUALITY_HIGH,
511   GTK_PRINT_QUALITY_DRAFT
512 } GtkPrintQuality;
513
514 typedef enum
515 {
516   GTK_PRINT_DUPLEX_SIMPLEX,
517   GTK_PRINT_DUPLEX_HORIZONTAL,
518   GTK_PRINT_DUPLEX_VERTICAL
519 } GtkPrintDuplex;
520
521
522 typedef enum
523 {
524   GTK_UNIT_PIXEL,
525   GTK_UNIT_POINTS,
526   GTK_UNIT_INCH,
527   GTK_UNIT_MM
528 } GtkUnit;
529
530 typedef enum
531 {
532   GTK_TREE_VIEW_GRID_LINES_NONE,
533   GTK_TREE_VIEW_GRID_LINES_HORIZONTAL,
534   GTK_TREE_VIEW_GRID_LINES_VERTICAL,
535   GTK_TREE_VIEW_GRID_LINES_BOTH
536 } GtkTreeViewGridLines;
537
538 typedef enum
539 {
540   GTK_DRAG_RESULT_SUCCESS,
541   GTK_DRAG_RESULT_NO_TARGET,
542   GTK_DRAG_RESULT_USER_CANCELLED,
543   GTK_DRAG_RESULT_TIMEOUT_EXPIRED,
544   GTK_DRAG_RESULT_GRAB_BROKEN,
545   GTK_DRAG_RESULT_ERROR
546 } GtkDragResult;
547
548 /**
549  * GtkSizeRequestMode:
550  * @GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: Prefer height-for-width geometry management
551  * @GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT: Prefer width-for-height geometry management
552  * 
553  * Specifies a preference for height-for-width or
554  * width-for-height geometry management.
555  */
556 typedef enum
557 {
558   GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH = 0,
559   GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT
560 } GtkSizeRequestMode;
561
562
563 /**
564  * GtkWrapAllocationMode:
565  * @GTK_WRAP_ALLOCATE_FREE:        Items wrap freely in the box's orientation
566  * @GTK_WRAP_ALLOCATE_ALIGNED:     Items are aligned into rows and columns
567  * @GTK_WRAP_ALLOCATE_HOMOGENEOUS: Items are all allocated the same size
568  *
569  * Describes how an #GtkWrapBox positions its children.
570  */
571 typedef enum {
572   GTK_WRAP_ALLOCATE_FREE = 0,
573   GTK_WRAP_ALLOCATE_ALIGNED,
574   GTK_WRAP_ALLOCATE_HOMOGENEOUS
575 } GtkWrapAllocationMode;
576
577 /**
578  * GtkWrapBoxSpreading:
579  * @GTK_WRAP_BOX_SPREAD_BEGIN:  Items are allocated no more than their natural size
580  *                              in the layout's orientation and any extra space is left trailing at 
581  *                              the end of each line.
582  * @GTK_WRAP_BOX_SPREAD_END:    Items are allocated no more than their natural size
583  *                              in the layout's orientation and any extra space skipped at the beginning
584  *                              of each line.
585  * @GTK_WRAP_BOX_SPREAD_EVEN:   Items are allocated no more than their natural size
586  *                              in the layout's orientation and any extra space is evenly distributed
587  *                              between children.
588  * @GTK_WRAP_BOX_SPREAD_EXPAND: Items share the extra space evenly (or among children that 'expand' when
589  *                              in %GTK_WRAP_ALLOCATE_FREE mode.
590  *
591  * Describes how an #GtkWrapBox deals with extra space when allocating children.
592  *
593  * The box always tries to fit as many children at their natural size 
594  * in the given orentation as possible with the exception of fitting "minimum-line-children"
595  * items into the available size. When the available size is larger than
596  * the size needed to fit a given number of children at their natural size
597  * then extra space is available to distribute among children. The
598  * #GtkWrapBoxSpreading option describes what to do with this space.
599  *
600  */
601 typedef enum {
602   GTK_WRAP_BOX_SPREAD_BEGIN = 0,
603   GTK_WRAP_BOX_SPREAD_END,
604   GTK_WRAP_BOX_SPREAD_EVEN,
605   GTK_WRAP_BOX_SPREAD_EXPAND
606 } GtkWrapBoxSpreading;
607
608
609 G_END_DECLS
610
611 #endif /* __GTK_ENUMS_H__ */