module Graphics.UI.Gtk.Gdk.Enums (
CrossingMode(..),
DragProtocol(..),
DragAction(..),
EventMask(..),
Modifier(..),
NotifyType(..),
ScrollDirection(..),
VisibilityState(..),
WindowState(..),
WindowEdge(..),
WindowTypeHint(..),
Gravity(..),
GrabStatus(..),
OwnerChange(..),
ExtensionMode(..),
CapStyle(..),
Dither(..),
Fill(..),
Function(..),
InputCondition(..),
JoinStyle(..),
LineStyle(..),
SubwindowMode(..),
) where
import System.Glib.Flags (Flags)
data CapStyle = CapNotLast
| CapButt
| CapRound
| CapProjecting
deriving (Enum,Eq,Show)
data CrossingMode = CrossingNormal
| CrossingGrab
| CrossingUngrab
| CrossingGtkGrab
| CrossingGtkUngrab
| CrossingStateChanged
deriving (Enum,Eq,Show)
data DragProtocol = DragProtoMotif
| DragProtoXdnd
| DragProtoRootwin
| DragProtoNone
| DragProtoWin32Dropfiles
| DragProtoOle2
| DragProtoLocal
deriving (Enum,Eq,Bounded,Show)
data DragAction = ActionDefault
| ActionCopy
| ActionMove
| ActionLink
| ActionPrivate
| ActionAsk
deriving (Eq,Bounded,Show)
instance Enum DragAction where
fromEnum ActionDefault = 1
fromEnum ActionCopy = 2
fromEnum ActionMove = 4
fromEnum ActionLink = 8
fromEnum ActionPrivate = 16
fromEnum ActionAsk = 32
toEnum 1 = ActionDefault
toEnum 2 = ActionCopy
toEnum 4 = ActionMove
toEnum 8 = ActionLink
toEnum 16 = ActionPrivate
toEnum 32 = ActionAsk
toEnum unmatched = error ("DragAction.toEnum: Cannot match " ++ show unmatched)
succ ActionDefault = ActionCopy
succ ActionCopy = ActionMove
succ ActionMove = ActionLink
succ ActionLink = ActionPrivate
succ ActionPrivate = ActionAsk
succ _ = undefined
pred ActionCopy = ActionDefault
pred ActionMove = ActionCopy
pred ActionLink = ActionMove
pred ActionPrivate = ActionLink
pred ActionAsk = ActionPrivate
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x ActionAsk
enumFromThen _ _ = error "Enum DragAction: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum DragAction: enumFromThenTo not implemented"
instance Flags DragAction
data Dither = RgbDitherNone
| RgbDitherNormal
| RgbDitherMax
deriving (Enum,Eq,Show)
data EventMask = ExposureMask
| PointerMotionMask
| PointerMotionHintMask
| ButtonMotionMask
| Button1MotionMask
| Button2MotionMask
| Button3MotionMask
| ButtonPressMask
| ButtonReleaseMask
| KeyPressMask
| KeyReleaseMask
| EnterNotifyMask
| LeaveNotifyMask
| FocusChangeMask
| StructureMask
| PropertyChangeMask
| VisibilityNotifyMask
| ProximityInMask
| ProximityOutMask
| SubstructureMask
| ScrollMask
| AllEventsMask
deriving (Eq,Bounded,Show)
instance Enum EventMask where
fromEnum ExposureMask = 2
fromEnum PointerMotionMask = 4
fromEnum PointerMotionHintMask = 8
fromEnum ButtonMotionMask = 16
fromEnum Button1MotionMask = 32
fromEnum Button2MotionMask = 64
fromEnum Button3MotionMask = 128
fromEnum ButtonPressMask = 256
fromEnum ButtonReleaseMask = 512
fromEnum KeyPressMask = 1024
fromEnum KeyReleaseMask = 2048
fromEnum EnterNotifyMask = 4096
fromEnum LeaveNotifyMask = 8192
fromEnum FocusChangeMask = 16384
fromEnum StructureMask = 32768
fromEnum PropertyChangeMask = 65536
fromEnum VisibilityNotifyMask = 131072
fromEnum ProximityInMask = 262144
fromEnum ProximityOutMask = 524288
fromEnum SubstructureMask = 1048576
fromEnum ScrollMask = 2097152
fromEnum AllEventsMask = 4194302
toEnum 2 = ExposureMask
toEnum 4 = PointerMotionMask
toEnum 8 = PointerMotionHintMask
toEnum 16 = ButtonMotionMask
toEnum 32 = Button1MotionMask
toEnum 64 = Button2MotionMask
toEnum 128 = Button3MotionMask
toEnum 256 = ButtonPressMask
toEnum 512 = ButtonReleaseMask
toEnum 1024 = KeyPressMask
toEnum 2048 = KeyReleaseMask
toEnum 4096 = EnterNotifyMask
toEnum 8192 = LeaveNotifyMask
toEnum 16384 = FocusChangeMask
toEnum 32768 = StructureMask
toEnum 65536 = PropertyChangeMask
toEnum 131072 = VisibilityNotifyMask
toEnum 262144 = ProximityInMask
toEnum 524288 = ProximityOutMask
toEnum 1048576 = SubstructureMask
toEnum 2097152 = ScrollMask
toEnum 4194302 = AllEventsMask
toEnum unmatched = error ("EventMask.toEnum: Cannot match " ++ show unmatched)
succ ExposureMask = PointerMotionMask
succ PointerMotionMask = PointerMotionHintMask
succ PointerMotionHintMask = ButtonMotionMask
succ ButtonMotionMask = Button1MotionMask
succ Button1MotionMask = Button2MotionMask
succ Button2MotionMask = Button3MotionMask
succ Button3MotionMask = ButtonPressMask
succ ButtonPressMask = ButtonReleaseMask
succ ButtonReleaseMask = KeyPressMask
succ KeyPressMask = KeyReleaseMask
succ KeyReleaseMask = EnterNotifyMask
succ EnterNotifyMask = LeaveNotifyMask
succ LeaveNotifyMask = FocusChangeMask
succ FocusChangeMask = StructureMask
succ StructureMask = PropertyChangeMask
succ PropertyChangeMask = VisibilityNotifyMask
succ VisibilityNotifyMask = ProximityInMask
succ ProximityInMask = ProximityOutMask
succ ProximityOutMask = SubstructureMask
succ SubstructureMask = ScrollMask
succ ScrollMask = AllEventsMask
succ _ = undefined
pred PointerMotionMask = ExposureMask
pred PointerMotionHintMask = PointerMotionMask
pred ButtonMotionMask = PointerMotionHintMask
pred Button1MotionMask = ButtonMotionMask
pred Button2MotionMask = Button1MotionMask
pred Button3MotionMask = Button2MotionMask
pred ButtonPressMask = Button3MotionMask
pred ButtonReleaseMask = ButtonPressMask
pred KeyPressMask = ButtonReleaseMask
pred KeyReleaseMask = KeyPressMask
pred EnterNotifyMask = KeyReleaseMask
pred LeaveNotifyMask = EnterNotifyMask
pred FocusChangeMask = LeaveNotifyMask
pred StructureMask = FocusChangeMask
pred PropertyChangeMask = StructureMask
pred VisibilityNotifyMask = PropertyChangeMask
pred ProximityInMask = VisibilityNotifyMask
pred ProximityOutMask = ProximityInMask
pred SubstructureMask = ProximityOutMask
pred ScrollMask = SubstructureMask
pred AllEventsMask = ScrollMask
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x AllEventsMask
enumFromThen _ _ = error "Enum EventMask: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum EventMask: enumFromThenTo not implemented"
instance Flags EventMask
data Modifier = Shift
| Lock
| Control
| Alt
| Alt2
| Alt3
| Alt4
| Alt5
| Button1
| Button2
| Button3
| Button4
| Button5
| Super
| Hyper
| Meta
| Release
| ModifierMask
deriving (Bounded,Show,Eq)
instance Enum Modifier where
fromEnum Shift = 1
fromEnum Lock = 2
fromEnum Control = 4
fromEnum Alt = 8
fromEnum Alt2 = 16
fromEnum Alt3 = 32
fromEnum Alt4 = 64
fromEnum Alt5 = 128
fromEnum Button1 = 256
fromEnum Button2 = 512
fromEnum Button3 = 1024
fromEnum Button4 = 2048
fromEnum Button5 = 4096
fromEnum Super = 67108864
fromEnum Hyper = 134217728
fromEnum Meta = 268435456
fromEnum Release = 1073741824
fromEnum ModifierMask = 1543512063
toEnum 1 = Shift
toEnum 2 = Lock
toEnum 4 = Control
toEnum 8 = Alt
toEnum 16 = Alt2
toEnum 32 = Alt3
toEnum 64 = Alt4
toEnum 128 = Alt5
toEnum 256 = Button1
toEnum 512 = Button2
toEnum 1024 = Button3
toEnum 2048 = Button4
toEnum 4096 = Button5
toEnum 67108864 = Super
toEnum 134217728 = Hyper
toEnum 268435456 = Meta
toEnum 1073741824 = Release
toEnum 1543512063 = ModifierMask
toEnum unmatched = error ("Modifier.toEnum: Cannot match " ++ show unmatched)
succ Shift = Lock
succ Lock = Control
succ Control = Alt
succ Alt = Alt2
succ Alt2 = Alt3
succ Alt3 = Alt4
succ Alt4 = Alt5
succ Alt5 = Button1
succ Button1 = Button2
succ Button2 = Button3
succ Button3 = Button4
succ Button4 = Button5
succ Button5 = Super
succ Super = Hyper
succ Hyper = Meta
succ Meta = Release
succ Release = ModifierMask
succ _ = undefined
pred Lock = Shift
pred Control = Lock
pred Alt = Control
pred Alt2 = Alt
pred Alt3 = Alt2
pred Alt4 = Alt3
pred Alt5 = Alt4
pred Button1 = Alt5
pred Button2 = Button1
pred Button3 = Button2
pred Button4 = Button3
pred Button5 = Button4
pred Super = Button5
pred Hyper = Super
pred Meta = Hyper
pred Release = Meta
pred ModifierMask = Release
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x ModifierMask
enumFromThen _ _ = error "Enum Modifier: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum Modifier: enumFromThenTo not implemented"
instance Flags Modifier
data ExtensionMode = ExtensionEventsNone
| ExtensionEventsAll
| ExtensionEventsCursor
deriving (Enum,Eq,Bounded,Show)
instance Flags ExtensionMode
data Fill = Solid
| Tiled
| Stippled
| OpaqueStippled
deriving (Enum,Eq,Show)
data Function = Copy
| Invert
| Xor
| Clear
| And
| AndReverse
| AndInvert
| Noop
| Or
| Equiv
| OrReverse
| CopyInvert
| OrInvert
| Nand
| Nor
| Set
deriving (Enum,Eq,Show)
data InputCondition = InputRead
| InputWrite
| InputException
deriving (Eq,Bounded)
instance Enum InputCondition where
fromEnum InputRead = 1
fromEnum InputWrite = 2
fromEnum InputException = 4
toEnum 1 = InputRead
toEnum 2 = InputWrite
toEnum 4 = InputException
toEnum unmatched = error ("InputCondition.toEnum: Cannot match " ++ show unmatched)
succ InputRead = InputWrite
succ InputWrite = InputException
succ _ = undefined
pred InputWrite = InputRead
pred InputException = InputWrite
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x InputException
enumFromThen _ _ = error "Enum InputCondition: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum InputCondition: enumFromThenTo not implemented"
instance Flags InputCondition
data JoinStyle = JoinMiter
| JoinRound
| JoinBevel
deriving (Enum,Eq,Show)
data LineStyle = LineSolid
| LineOnOffDash
| LineDoubleDash
deriving (Enum,Eq,Show)
data NotifyType = NotifyAncestor
| NotifyVirtual
| NotifyInferior
| NotifyNonlinear
| NotifyNonlinearVirtual
| NotifyUnknown
deriving (Eq,Show)
instance Enum NotifyType where
fromEnum NotifyAncestor = 0
fromEnum NotifyVirtual = 1
fromEnum NotifyInferior = 2
fromEnum NotifyNonlinear = 3
fromEnum NotifyNonlinearVirtual = 4
fromEnum NotifyUnknown = 5
toEnum 0 = NotifyAncestor
toEnum 1 = NotifyVirtual
toEnum 2 = NotifyInferior
toEnum 3 = NotifyNonlinear
toEnum 4 = NotifyNonlinearVirtual
toEnum 5 = NotifyUnknown
toEnum unmatched = error ("NotifyType.toEnum: Cannot match " ++ show unmatched)
succ NotifyAncestor = NotifyVirtual
succ NotifyVirtual = NotifyInferior
succ NotifyInferior = NotifyNonlinear
succ NotifyNonlinear = NotifyNonlinearVirtual
succ NotifyNonlinearVirtual = NotifyUnknown
succ _ = undefined
pred NotifyVirtual = NotifyAncestor
pred NotifyInferior = NotifyVirtual
pred NotifyNonlinear = NotifyInferior
pred NotifyNonlinearVirtual = NotifyNonlinear
pred NotifyUnknown = NotifyNonlinearVirtual
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x NotifyUnknown
enumFromThen _ _ = error "Enum NotifyType: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum NotifyType: enumFromThenTo not implemented"
data ScrollDirection = ScrollUp
| ScrollDown
| ScrollLeft
| ScrollRight
deriving (Enum,Eq,Show)
data SubwindowMode = ClipByChildren
| IncludeInferiors
deriving (Eq,Show)
instance Enum SubwindowMode where
fromEnum ClipByChildren = 0
fromEnum IncludeInferiors = 1
toEnum 0 = ClipByChildren
toEnum 1 = IncludeInferiors
toEnum unmatched = error ("SubwindowMode.toEnum: Cannot match " ++ show unmatched)
succ ClipByChildren = IncludeInferiors
succ _ = undefined
pred IncludeInferiors = ClipByChildren
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x IncludeInferiors
enumFromThen _ _ = error "Enum SubwindowMode: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum SubwindowMode: enumFromThenTo not implemented"
data VisibilityState = VisibilityUnobscured
| VisibilityPartialObscured
| VisibilityFullyObscured
deriving (Enum,Eq,Show)
data WindowState = WindowStateWithdrawn
| WindowStateIconified
| WindowStateMaximized
| WindowStateSticky
| WindowStateFullscreen
| WindowStateAbove
| WindowStateBelow
deriving (Eq,Bounded,Show)
instance Enum WindowState where
fromEnum WindowStateWithdrawn = 1
fromEnum WindowStateIconified = 2
fromEnum WindowStateMaximized = 4
fromEnum WindowStateSticky = 8
fromEnum WindowStateFullscreen = 16
fromEnum WindowStateAbove = 32
fromEnum WindowStateBelow = 64
toEnum 1 = WindowStateWithdrawn
toEnum 2 = WindowStateIconified
toEnum 4 = WindowStateMaximized
toEnum 8 = WindowStateSticky
toEnum 16 = WindowStateFullscreen
toEnum 32 = WindowStateAbove
toEnum 64 = WindowStateBelow
toEnum unmatched = error ("WindowState.toEnum: Cannot match " ++ show unmatched)
succ WindowStateWithdrawn = WindowStateIconified
succ WindowStateIconified = WindowStateMaximized
succ WindowStateMaximized = WindowStateSticky
succ WindowStateSticky = WindowStateFullscreen
succ WindowStateFullscreen = WindowStateAbove
succ WindowStateAbove = WindowStateBelow
succ _ = undefined
pred WindowStateIconified = WindowStateWithdrawn
pred WindowStateMaximized = WindowStateIconified
pred WindowStateSticky = WindowStateMaximized
pred WindowStateFullscreen = WindowStateSticky
pred WindowStateAbove = WindowStateFullscreen
pred WindowStateBelow = WindowStateAbove
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x WindowStateBelow
enumFromThen _ _ = error "Enum WindowState: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum WindowState: enumFromThenTo not implemented"
instance Flags WindowState
data WindowEdge = WindowEdgeNorthWest
| WindowEdgeNorth
| WindowEdgeNorthEast
| WindowEdgeWest
| WindowEdgeEast
| WindowEdgeSouthWest
| WindowEdgeSouth
| WindowEdgeSouthEast
deriving (Enum,Eq,Show)
data WindowTypeHint = WindowTypeHintNormal
| WindowTypeHintDialog
| WindowTypeHintMenu
| WindowTypeHintToolbar
| WindowTypeHintSplashscreen
| WindowTypeHintUtility
| WindowTypeHintDock
| WindowTypeHintDesktop
| WindowTypeHintDropdownMenu
| WindowTypeHintPopupMenu
| WindowTypeHintTooltip
| WindowTypeHintNotification
| WindowTypeHintCombo
| WindowTypeHintDnd
deriving (Enum,Eq,Show)
data Gravity = GravityNorthWest
| GravityNorth
| GravityNorthEast
| GravityWest
| GravityCenter
| GravityEast
| GravitySouthWest
| GravitySouth
| GravitySouthEast
| GravityStatic
deriving (Eq,Show)
instance Enum Gravity where
fromEnum GravityNorthWest = 1
fromEnum GravityNorth = 2
fromEnum GravityNorthEast = 3
fromEnum GravityWest = 4
fromEnum GravityCenter = 5
fromEnum GravityEast = 6
fromEnum GravitySouthWest = 7
fromEnum GravitySouth = 8
fromEnum GravitySouthEast = 9
fromEnum GravityStatic = 10
toEnum 1 = GravityNorthWest
toEnum 2 = GravityNorth
toEnum 3 = GravityNorthEast
toEnum 4 = GravityWest
toEnum 5 = GravityCenter
toEnum 6 = GravityEast
toEnum 7 = GravitySouthWest
toEnum 8 = GravitySouth
toEnum 9 = GravitySouthEast
toEnum 10 = GravityStatic
toEnum unmatched = error ("Gravity.toEnum: Cannot match " ++ show unmatched)
succ GravityNorthWest = GravityNorth
succ GravityNorth = GravityNorthEast
succ GravityNorthEast = GravityWest
succ GravityWest = GravityCenter
succ GravityCenter = GravityEast
succ GravityEast = GravitySouthWest
succ GravitySouthWest = GravitySouth
succ GravitySouth = GravitySouthEast
succ GravitySouthEast = GravityStatic
succ _ = undefined
pred GravityNorth = GravityNorthWest
pred GravityNorthEast = GravityNorth
pred GravityWest = GravityNorthEast
pred GravityCenter = GravityWest
pred GravityEast = GravityCenter
pred GravitySouthWest = GravityEast
pred GravitySouth = GravitySouthWest
pred GravitySouthEast = GravitySouth
pred GravityStatic = GravitySouthEast
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x GravityStatic
enumFromThen _ _ = error "Enum Gravity: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum Gravity: enumFromThenTo not implemented"
data GrabStatus = GrabSuccess
| GrabAlreadyGrabbed
| GrabInvalidTime
| GrabNotViewable
| GrabFrozen
deriving (Eq,Show)
instance Enum GrabStatus where
fromEnum GrabSuccess = 0
fromEnum GrabAlreadyGrabbed = 1
fromEnum GrabInvalidTime = 2
fromEnum GrabNotViewable = 3
fromEnum GrabFrozen = 4
toEnum 0 = GrabSuccess
toEnum 1 = GrabAlreadyGrabbed
toEnum 2 = GrabInvalidTime
toEnum 3 = GrabNotViewable
toEnum 4 = GrabFrozen
toEnum unmatched = error ("GrabStatus.toEnum: Cannot match " ++ show unmatched)
succ GrabSuccess = GrabAlreadyGrabbed
succ GrabAlreadyGrabbed = GrabInvalidTime
succ GrabInvalidTime = GrabNotViewable
succ GrabNotViewable = GrabFrozen
succ _ = undefined
pred GrabAlreadyGrabbed = GrabSuccess
pred GrabInvalidTime = GrabAlreadyGrabbed
pred GrabNotViewable = GrabInvalidTime
pred GrabFrozen = GrabNotViewable
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x GrabFrozen
enumFromThen _ _ = error "Enum GrabStatus: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum GrabStatus: enumFromThenTo not implemented"
data OwnerChange = OwnerChangeNewOwner
| OwnerChangeDestroy
| OwnerChangeClose
deriving (Enum,Eq,Show)