File: Enums.chs

package info (click to toggle)
haskell-gtk 0.11.0-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 2,920 kB
  • ctags: 82
  • sloc: haskell: 1,929; ansic: 714; sh: 5; makefile: 3
file content (281 lines) | stat: -rw-r--r-- 9,583 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
{-# LANGUAGE CPP #-}
-- -*-haskell-*-
--  GIMP Toolkit (GTK) Enumerations
--
--  Author : Manuel M. T. Chakravarty, Axel Simon
--
--  Created: 13 Januar 1999
--
--  Copyright (C) 1999-2005 Manuel M. T. Chakravarty, Axel Simon
--
--  This library is free software; you can redistribute it and/or
--  modify it under the terms of the GNU Lesser General Public
--  License as published by the Free Software Foundation; either
--  version 2.1 of the License, or (at your option) any later version.
--
--  This library is distributed in the hope that it will be useful,
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
--  Lesser General Public License for more details.
--
-- |
-- Maintainer  : gtk2hs-users@lists.sourceforge.net
-- Stability   : provisional
-- Portability : portable (depends on GHC)
--
-- General enumeration types.
--
module Graphics.UI.Gtk.Gdk.Enums (
  CapStyle(..),
  CrossingMode(..),
  Dither(..),
  DragProtocol(..),
  DragAction(..),
  EventMask(..),
  Modifier(..),
  ExtensionMode(..),
  Fill(..),
  Function(..),
  InputCondition(..),
  JoinStyle(..),
  LineStyle(..),
  NotifyType(..),
  ScrollDirection(..),
  SubwindowMode(..),
  VisibilityState(..),
  WindowState(..),
  WindowEdge(..),
  WindowTypeHint(..),
  Gravity(..),
  GrabStatus(..),
#if GTK_CHECK_VERSION(2,6,0)
  OwnerChange(..),
#endif
  ) where

import System.Glib.Flags	(Flags)

{#context lib="gdk" prefix ="gdk"#}

-- | Specify the how the ends of a line is drawn.
--
{#enum CapStyle {underscoreToCase} deriving(Eq,Show)#}

-- | How focus is crossing the widget.
--
{#enum CrossingMode {underscoreToCase} deriving(Eq,Show) #}

-- | Used in 'Graphics.UI.Gtk.Gdk.Drag.DragContext' to indicate the protocol according to which DND is done.
--
{#enum DragProtocol {underscoreToCase} deriving(Eq,Bounded,Show)#}


-- | Used in 'Graphics.UI.Gtk.Genearl.Drag.DragContext' to indicate what the
-- destination should do with the dropped data.
--
--   * 'ActionDefault': Initialisation value, should not be used.
--
--   * 'ActionCopy': Copy the data.
--
--   * 'ActionMove': Move the data, i.e. first copy it, then delete it from the source.
--
--   * 'ActionLink':  Add a link to the data. Note that this is only useful if source and
--     destination agree on what it means.
--
--   * 'ActionPrivate': Special action which tells the source that the destination will do
--     something that the source doesn't understand.
--
--   * 'ActionAsk': Ask the user what to do with the data.
--
{#enum DragAction {underscoreToCase} deriving(Eq,Bounded,Show)#}

instance Flags DragAction

-- | Specify how to dither colors onto the screen.
--
{#enum RgbDither as Dither {underscoreToCase} deriving(Eq,Show) #}

-- | Specify which events a widget will emit signals on.
--
{#enum EventMask {underscoreToCase} deriving(Eq,Bounded,Show)#}

instance Flags EventMask

-- | Keyboard modifiers that are depressed when the user presses
--   a key or a mouse button.
--
-- * This data type is used to build lists of modifers that were active
--   during an event.
--
-- * The "Apple" key on Macintoshs is mapped to 'Alt2' and the 'Meta'
--   key (if available).
--
-- * Since Gtk 2.10, there are also 'Super', 'Hyper' and 'Meta' modifiers
--   which are simply generated from 'Alt' .. 'Compose' modifier keys,
--   depending on the mapping used by the windowing system. Due to one
--   key being mapped to e.g. 'Alt2' and 'Meta', you shouldn't pattern
--   match directly against a certain key but check whether a key is
--   in the list using the 'elem' function, say.
--
#if GTK_CHECK_VERSION(2,10,0)
{#enum ModifierType as Modifier {SHIFT_MASK as Shift,
                                 LOCK_MASK as Lock,
                                 CONTROL_MASK as Control,
                                 MOD1_MASK as Alt,
                                 MOD2_MASK as Alt2,
                                 MOD3_MASK as Alt3,
                                 MOD4_MASK as Alt4,
                                 MOD5_MASK as Alt5,
                                 BUTTON1_MASK as Button1,
                                 BUTTON2_MASK as Button2,
                                 BUTTON3_MASK as Button3,
                                 BUTTON4_MASK as Button4,
                                 BUTTON5_MASK as Button5,
                                 SUPER_MASK as Super,
                                 HYPER_MASK as Hyper,
                                 META_MASK as Meta,
                                 RELEASE_MASK as Release,
                                 MODIFIER_MASK as ModifierMask
                                 } deriving(Bounded,Show,Eq) #}
#else
{#enum ModifierType as Modifier {SHIFT_MASK as Shift,
                                 LOCK_MASK as Lock,
                                 CONTROL_MASK as Control,
                                 MOD1_MASK as Alt,
                                 MOD2_MASK as Alt2,
                                 MOD3_MASK as Alt3,
                                 MOD4_MASK as Alt4,
                                 MOD5_MASK as Alt5,
                                 BUTTON1_MASK as Button1,
                                 BUTTON2_MASK as Button2,
                                 BUTTON3_MASK as Button3,
                                 BUTTON4_MASK as Button4,
                                 BUTTON5_MASK as Button5,
                                 RELEASE_MASK as Release,
                                 MODIFIER_MASK as ModifierMask
                                 } deriving(Bounded,Show,Eq) #}
#endif

instance Flags Modifier

-- | specify which input extension a widget desires
--
{#enum ExtensionMode {underscoreToCase} deriving(Eq,Bounded,Show)#}

instance Flags ExtensionMode

-- | How objects are filled.
--
{#enum Fill {underscoreToCase} deriving(Eq,Show) #}

-- | Determine how bitmap operations are carried out.
--
{#enum Function {underscoreToCase} deriving(Eq,Show) #}

-- | Specify on what file condition a callback should be
-- done.
--
{#enum InputCondition {underscoreToCase} deriving(Eq,Bounded) #}

instance Flags InputCondition

-- | Determines how adjacent line ends are drawn.
--
{#enum JoinStyle {underscoreToCase} deriving(Eq,Show)#}

-- | Determines if a line is solid or dashed.
--
{#enum LineStyle {underscoreToCase} deriving(Eq,Show)#}

-- | Information on from what level of the widget hierarchy the mouse
--   cursor came.
--
-- ['NotifyAncestor'] The window is entered from an ancestor or left towards
-- an ancestor.
--
-- ['NotifyVirtual'] The pointer moves between an ancestor and an inferior
-- of the window.
--
-- ['NotifyInferior'] The window is entered from an inferior or left
-- towards an inferior.
--
-- ['NotifyNonlinear'] The window is entered from or left towards a
-- window which is neither an ancestor nor an inferior.
--
-- ['NotifyNonlinearVirtual'] The pointer moves between two windows which
-- are not ancestors of each other and the window is part of the ancestor
-- chain between one of these windows and their least common ancestor.
--
-- ['NotifyUnknown'] The level change does not fit into any of the other
-- categories or could not be determined.
--
{#enum NotifyType {underscoreToCase} deriving(Eq,Show) #}

-- | in which direction was scrolled?
--
{#enum ScrollDirection {underscoreToCase} deriving(Eq,Show) #}

-- | Determine if child widget may be overdrawn.
--
{#enum SubwindowMode {underscoreToCase} deriving(Eq,Show) #}

-- | visibility of a window
--
{#enum VisibilityState {underscoreToCase,
			VISIBILITY_PARTIAL as VisibilityPartialObscured}
			 deriving(Eq,Show) #}

-- | The state a @DrawWindow@ is in.
--
{#enum WindowState {underscoreToCase} deriving(Eq,Bounded,Show)#}

instance Flags WindowState

-- | Determines a window edge or corner.
--
{#enum WindowEdge {underscoreToCase} deriving(Eq,Show) #}

-- | These are hints for the window manager that indicate what type of function
-- the window has. The window manager can use this when determining decoration
-- and behaviour of the window. The hint must be set before mapping the window.
--
-- See the extended window manager hints specification for more details about
-- window types.
--
{#enum WindowTypeHint {underscoreToCase} deriving(Eq,Show)#}

-- | Defines the reference point of a window and the meaning of coordinates
-- passed to 'Graphics.UI.Gtk.Windows.Window.windowMove'. See
-- 'Graphics.UI.Gtk.Windows.Window.windowMove' and the "implementation notes"
-- section of the extended window manager hints specification for more details.
--
{#enum Gravity {underscoreToCase} deriving(Eq,Show) #}

-- | Returned by 'pointerGrab' and 'keyboardGrab' to indicate success or the
-- reason for the failure of the grab attempt.
--
-- [@GrabSuccess@] the resource was successfully grabbed.
--
-- [@GrabAlreadyGrabbed@] the resource is actively grabbed by another client.
--
-- [@GrabInvalidTime@] the resource was grabbed more recently than the
--   specified time.
--
-- [@GrabNotViewable@] the grab window or the confine_to window are not
--   viewable.
--
-- [@GrabFrozen@] the resource is frozen by an active grab of another client.
--
{#enum GrabStatus {underscoreToCase} deriving(Eq,Show) #}

#if GTK_CHECK_VERSION(2,6,0)
-- | Specifies why a selection ownership was changed.
--
-- [@OwnerChangeNewOwner@] some other application claimed the ownership
--
-- [@OwnerChangeDestroy@] the window was destroyed
--
-- [@OwnerChangeClose@] the client was closed
--
{#enum OwnerChange {underscoreToCase} deriving(Eq,Show) #}
#endif