module Graphics.UI.Gtk.General.Enums (
AccelFlags(..),
Align(..),
ArrowType(..),
AttachOptions(..),
MouseButton(..),
ButtonBoxStyle(..),
CalendarDisplayOptions(..),
Click(..),
CornerType(..),
DeleteType(..),
DestDefaults(..),
DragResult(..),
DirectionType(..),
Justification(..),
LevelBarMode(..),
MenuDirectionType(..),
MovementStep(..),
Orientation(..),
Packing(..), toPacking, fromPacking,
PackType(..),
PathPriorityType(..),
PathType(..),
PolicyType(..),
PositionType(..),
ReliefStyle(..),
ResizeMode(..),
ScrollType(..),
ScrollStep (..),
SelectionMode(..),
ShadowType(..),
StateFlags(..),
SortType(..),
StateType(..),
SpinButtonUpdatePolicy(..),
SpinType(..),
TargetFlags(..),
TextDirection(..),
TextSearchFlags(..),
TextWindowType(..),
ToolbarStyle(..),
TreeViewColumnSizing(..),
--TroughType(..),
WindowPosition(..),
WindowType(..),
WrapMode(..),
EntryIconPosition(..),
module Graphics.UI.Gtk.Gdk.Enums
) where
import System.Glib.Flags (Flags)
import Graphics.UI.Gtk.Gdk.Enums
data AccelFlags = AccelVisible
| AccelLocked
| AccelMask
deriving (Bounded,Eq,Show)
instance Enum AccelFlags where
fromEnum AccelVisible = 1
fromEnum AccelLocked = 2
fromEnum AccelMask = 7
toEnum 1 = AccelVisible
toEnum 2 = AccelLocked
toEnum 7 = AccelMask
toEnum unmatched = error ("AccelFlags.toEnum: Cannot match " ++ show unmatched)
succ AccelVisible = AccelLocked
succ AccelLocked = AccelMask
succ _ = undefined
pred AccelLocked = AccelVisible
pred AccelMask = AccelLocked
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x AccelMask
enumFromThen _ _ = error "Enum AccelFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum AccelFlags: enumFromThenTo not implemented"
instance Flags AccelFlags
data Align = AlignFill
| AlignStart
| AlignEnd
| AlignCenter
| AlignBaseline
deriving (Enum,Bounded,Eq,Show)
data ArrowType = ArrowUp
| ArrowDown
| ArrowLeft
| ArrowRight
| ArrowNone
deriving (Enum,Eq,Show)
data AttachOptions = Expand
| Shrink
| Fill
deriving (Bounded,Eq,Show)
instance Enum AttachOptions where
fromEnum Expand = 1
fromEnum Shrink = 2
fromEnum Fill = 4
toEnum 1 = Expand
toEnum 2 = Shrink
toEnum 4 = Fill
toEnum unmatched = error ("AttachOptions.toEnum: Cannot match " ++ show unmatched)
succ Expand = Shrink
succ Shrink = Fill
succ _ = undefined
pred Shrink = Expand
pred Fill = Shrink
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x Fill
enumFromThen _ _ = error "Enum AttachOptions: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum AttachOptions: enumFromThenTo not implemented"
instance Flags AttachOptions
data MouseButton = LeftButton
| MiddleButton
| RightButton
| OtherButton Int
deriving (Eq,Show)
instance Enum MouseButton where
toEnum 1 = LeftButton
toEnum 2 = MiddleButton
toEnum 3 = RightButton
toEnum n = OtherButton (fromIntegral n)
fromEnum LeftButton = 1
fromEnum MiddleButton = 2
fromEnum RightButton = 3
fromEnum (OtherButton n) = fromIntegral n
data ButtonBoxStyle = ButtonboxSpread
| ButtonboxEdge
| ButtonboxStart
| ButtonboxEnd
| ButtonboxCenter
deriving (Eq,Show)
instance Enum ButtonBoxStyle where
fromEnum ButtonboxSpread = 1
fromEnum ButtonboxEdge = 2
fromEnum ButtonboxStart = 3
fromEnum ButtonboxEnd = 4
fromEnum ButtonboxCenter = 5
toEnum 1 = ButtonboxSpread
toEnum 2 = ButtonboxEdge
toEnum 3 = ButtonboxStart
toEnum 4 = ButtonboxEnd
toEnum 5 = ButtonboxCenter
toEnum unmatched = error ("ButtonBoxStyle.toEnum: Cannot match " ++ show unmatched)
succ ButtonboxSpread = ButtonboxEdge
succ ButtonboxEdge = ButtonboxStart
succ ButtonboxStart = ButtonboxEnd
succ ButtonboxEnd = ButtonboxCenter
succ _ = undefined
pred ButtonboxEdge = ButtonboxSpread
pred ButtonboxStart = ButtonboxEdge
pred ButtonboxEnd = ButtonboxStart
pred ButtonboxCenter = ButtonboxEnd
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x ButtonboxCenter
enumFromThen _ _ = error "Enum ButtonBoxStyle: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum ButtonBoxStyle: enumFromThenTo not implemented"
data CalendarDisplayOptions = CalendarShowHeading
| CalendarShowDayNames
| CalendarNoMonthChange
| CalendarShowWeekNumbers
| CalendarShowDetails
deriving (Bounded,Eq,Show)
instance Enum CalendarDisplayOptions where
fromEnum CalendarShowHeading = 1
fromEnum CalendarShowDayNames = 2
fromEnum CalendarNoMonthChange = 4
fromEnum CalendarShowWeekNumbers = 8
fromEnum CalendarShowDetails = 32
toEnum 1 = CalendarShowHeading
toEnum 2 = CalendarShowDayNames
toEnum 4 = CalendarNoMonthChange
toEnum 8 = CalendarShowWeekNumbers
toEnum 32 = CalendarShowDetails
toEnum unmatched = error ("CalendarDisplayOptions.toEnum: Cannot match " ++ show unmatched)
succ CalendarShowHeading = CalendarShowDayNames
succ CalendarShowDayNames = CalendarNoMonthChange
succ CalendarNoMonthChange = CalendarShowWeekNumbers
succ CalendarShowWeekNumbers = CalendarShowDetails
succ _ = undefined
pred CalendarShowDayNames = CalendarShowHeading
pred CalendarNoMonthChange = CalendarShowDayNames
pred CalendarShowWeekNumbers = CalendarNoMonthChange
pred CalendarShowDetails = CalendarShowWeekNumbers
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x CalendarShowDetails
enumFromThen _ _ = error "Enum CalendarDisplayOptions: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum CalendarDisplayOptions: enumFromThenTo not implemented"
instance Flags CalendarDisplayOptions
data Click = SingleClick
| DoubleClick
| TripleClick
| ReleaseClick
deriving (Eq,Show,Enum)
data CornerType = CornerTopLeft
| CornerBottomLeft
| CornerTopRight
| CornerBottomRight
deriving (Enum,Eq,Show)
data DeleteType = DeleteChars
| DeleteWordEnds
| DeleteWords
| DeleteDisplayLines
| DeleteDisplayLineEnds
| DeleteParagraphEnds
| DeleteParagraphs
| DeleteWhitespace
deriving (Enum,Eq,Show)
data DestDefaults = DestDefaultMotion
| DestDefaultHighlight
| DestDefaultDrop
| DestDefaultAll
deriving (Bounded,Eq,Show)
instance Enum DestDefaults where
fromEnum DestDefaultMotion = 1
fromEnum DestDefaultHighlight = 2
fromEnum DestDefaultDrop = 4
fromEnum DestDefaultAll = 7
toEnum 1 = DestDefaultMotion
toEnum 2 = DestDefaultHighlight
toEnum 4 = DestDefaultDrop
toEnum 7 = DestDefaultAll
toEnum unmatched = error ("DestDefaults.toEnum: Cannot match " ++ show unmatched)
succ DestDefaultMotion = DestDefaultHighlight
succ DestDefaultHighlight = DestDefaultDrop
succ DestDefaultDrop = DestDefaultAll
succ _ = undefined
pred DestDefaultHighlight = DestDefaultMotion
pred DestDefaultDrop = DestDefaultHighlight
pred DestDefaultAll = DestDefaultDrop
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x DestDefaultAll
enumFromThen _ _ = error "Enum DestDefaults: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum DestDefaults: enumFromThenTo not implemented"
instance Flags DestDefaults
data DragResult = DragResultSuccess
| DragResultNoTarget
| DragResultUserCancelled
| DragResultTimeoutExpired
| DragResultGrabBroken
| DragResultError
deriving (Enum,Bounded,Eq,Show)
data DirectionType = DirTabForward
| DirTabBackward
| DirUp
| DirDown
| DirLeft
| DirRight
deriving (Enum,Eq,Show)
data Justification = JustifyLeft
| JustifyRight
| JustifyCenter
| JustifyFill
deriving (Enum,Eq,Show)
data LevelBarMode = LevelBarModeContinuous
| LevelBarModeDiscrete
deriving (Enum,Eq,Show)
data MenuDirectionType = MenuDirParent
| MenuDirChild
| MenuDirNext
| MenuDirPrev
deriving (Enum,Eq,Show)
data MovementStep = MovementLogicalPositions
| MovementVisualPositions
| MovementWords
| MovementDisplayLines
| MovementDisplayLineEnds
| MovementParagraphs
| MovementParagraphEnds
| MovementPages
| MovementBufferEnds
| MovementHorizontalPages
deriving (Enum,Eq,Show)
data Orientation = OrientationHorizontal
| OrientationVertical
deriving (Enum,Eq,Show)
data Packing = PackRepel
| PackGrow
| PackNatural
deriving (Enum,Eq,Show)
toPacking :: Bool -> Bool -> Packing
toPacking expand True = PackGrow
toPacking True fill = PackRepel
toPacking False fill = PackNatural
fromPacking :: Packing -> (Bool, Bool)
fromPacking PackGrow = (True,True)
fromPacking PackRepel = (True,False)
fromPacking PackNatural = (False,False)
data PackType = PackStart
| PackEnd
deriving (Enum,Eq,Show)
data PathPriorityType = PathPrioLowest
| PathPrioGtk
| PathPrioApplication
| PathPrioTheme
| PathPrioRc
| PathPrioHighest
deriving (Eq,Show)
instance Enum PathPriorityType where
fromEnum PathPrioLowest = 0
fromEnum PathPrioGtk = 4
fromEnum PathPrioApplication = 8
fromEnum PathPrioTheme = 10
fromEnum PathPrioRc = 12
fromEnum PathPrioHighest = 15
toEnum 0 = PathPrioLowest
toEnum 4 = PathPrioGtk
toEnum 8 = PathPrioApplication
toEnum 10 = PathPrioTheme
toEnum 12 = PathPrioRc
toEnum 15 = PathPrioHighest
toEnum unmatched = error ("PathPriorityType.toEnum: Cannot match " ++ show unmatched)
succ PathPrioLowest = PathPrioGtk
succ PathPrioGtk = PathPrioApplication
succ PathPrioApplication = PathPrioTheme
succ PathPrioTheme = PathPrioRc
succ PathPrioRc = PathPrioHighest
succ _ = undefined
pred PathPrioGtk = PathPrioLowest
pred PathPrioApplication = PathPrioGtk
pred PathPrioTheme = PathPrioApplication
pred PathPrioRc = PathPrioTheme
pred PathPrioHighest = PathPrioRc
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x PathPrioHighest
enumFromThen _ _ = error "Enum PathPriorityType: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum PathPriorityType: enumFromThenTo not implemented"
data PathType = PathWidget
| PathWidgetClass
| PathClass
deriving (Enum,Eq,Show)
data PolicyType = PolicyAlways
| PolicyAutomatic
| PolicyNever
deriving (Enum,Eq,Show)
data PositionType = PosLeft
| PosRight
| PosTop
| PosBottom
deriving (Enum,Eq,Show)
data ReliefStyle = ReliefNormal
| ReliefHalf
| ReliefNone
deriving (Enum,Eq,Show)
data ResizeMode = ResizeParent
| ResizeQueue
| ResizeImmediate
deriving (Enum,Eq,Show)
data ScrollType = ScrollNone
| ScrollJump
| ScrollStepBackward
| ScrollStepForward
| ScrollPageBackward
| ScrollPageForward
| ScrollStepUp
| ScrollStepDown
| ScrollPageUp
| ScrollPageDown
| ScrollStepLeft
| ScrollStepRight
| ScrollPageLeft
| ScrollPageRight
| ScrollStart
| ScrollEnd
deriving (Enum,Eq,Show)
data ScrollStep = ScrollSteps
| ScrollPages
| ScrollEnds
| ScrollHorizontalSteps
| ScrollHorizontalPages
| ScrollHorizontalEnds
deriving (Enum,Eq,Show)
data SelectionMode = SelectionNone
| SelectionSingle
| SelectionBrowse
| SelectionMultiple
deriving (Enum,Eq,Show)
data ShadowType = ShadowNone
| ShadowIn
| ShadowOut
| ShadowEtchedIn
| ShadowEtchedOut
deriving (Enum,Eq,Show)
data StateFlags = StateFlagNormal
| StateFlagActive
| StateFlagPrelight
| StateFlagSelected
| StateFlagInsensitive
| StateFlagInconsistent
| StateFlagFocused
| StateFlagBackdrop
| StateFlagDirLtr
| StateFlagDirRtl
deriving (Bounded,Eq,Show)
instance Enum StateFlags where
fromEnum StateFlagNormal = 0
fromEnum StateFlagActive = 1
fromEnum StateFlagPrelight = 2
fromEnum StateFlagSelected = 4
fromEnum StateFlagInsensitive = 8
fromEnum StateFlagInconsistent = 16
fromEnum StateFlagFocused = 32
fromEnum StateFlagBackdrop = 64
fromEnum StateFlagDirLtr = 128
fromEnum StateFlagDirRtl = 256
toEnum 0 = StateFlagNormal
toEnum 1 = StateFlagActive
toEnum 2 = StateFlagPrelight
toEnum 4 = StateFlagSelected
toEnum 8 = StateFlagInsensitive
toEnum 16 = StateFlagInconsistent
toEnum 32 = StateFlagFocused
toEnum 64 = StateFlagBackdrop
toEnum 128 = StateFlagDirLtr
toEnum 256 = StateFlagDirRtl
toEnum unmatched = error ("StateFlags.toEnum: Cannot match " ++ show unmatched)
succ StateFlagNormal = StateFlagActive
succ StateFlagActive = StateFlagPrelight
succ StateFlagPrelight = StateFlagSelected
succ StateFlagSelected = StateFlagInsensitive
succ StateFlagInsensitive = StateFlagInconsistent
succ StateFlagInconsistent = StateFlagFocused
succ StateFlagFocused = StateFlagBackdrop
succ StateFlagBackdrop = StateFlagDirLtr
succ StateFlagDirLtr = StateFlagDirRtl
succ _ = undefined
pred StateFlagActive = StateFlagNormal
pred StateFlagPrelight = StateFlagActive
pred StateFlagSelected = StateFlagPrelight
pred StateFlagInsensitive = StateFlagSelected
pred StateFlagInconsistent = StateFlagInsensitive
pred StateFlagFocused = StateFlagInconsistent
pred StateFlagBackdrop = StateFlagFocused
pred StateFlagDirLtr = StateFlagBackdrop
pred StateFlagDirRtl = StateFlagDirLtr
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x StateFlagDirRtl
enumFromThen _ _ = error "Enum StateFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum StateFlags: enumFromThenTo not implemented"
instance Flags StateFlags
data SortType = SortAscending
| SortDescending
deriving (Enum,Eq,Show)
data StateType = StateNormal
| StateActive
| StatePrelight
| StateSelected
| StateInsensitive
| StateInconsistent
| StateFocused
deriving (Enum,Eq,Show)
data SpinButtonUpdatePolicy = UpdateAlways
| UpdateIfValid
deriving (Enum,Eq,Show)
data SpinType = SpinStepForward
| SpinStepBackward
| SpinPageForward
| SpinPageBackward
| SpinHome
| SpinEnd
| SpinUserDefined
deriving (Enum,Eq,Show)
data TargetFlags = TargetSameApp
| TargetSameWidget
| TargetOtherApp
| TargetOtherWidget
deriving (Bounded,Eq,Show)
instance Enum TargetFlags where
fromEnum TargetSameApp = 1
fromEnum TargetSameWidget = 2
fromEnum TargetOtherApp = 4
fromEnum TargetOtherWidget = 8
toEnum 1 = TargetSameApp
toEnum 2 = TargetSameWidget
toEnum 4 = TargetOtherApp
toEnum 8 = TargetOtherWidget
toEnum unmatched = error ("TargetFlags.toEnum: Cannot match " ++ show unmatched)
succ TargetSameApp = TargetSameWidget
succ TargetSameWidget = TargetOtherApp
succ TargetOtherApp = TargetOtherWidget
succ _ = undefined
pred TargetSameWidget = TargetSameApp
pred TargetOtherApp = TargetSameWidget
pred TargetOtherWidget = TargetOtherApp
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x TargetOtherWidget
enumFromThen _ _ = error "Enum TargetFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum TargetFlags: enumFromThenTo not implemented"
instance Flags TargetFlags
data TextDirection = TextDirNone
| TextDirLtr
| TextDirRtl
deriving (Enum,Eq,Show)
data TextSearchFlags = TextSearchVisibleOnly
| TextSearchTextOnly
| TextSearchCaseInsensitive
deriving (Bounded,Eq,Show)
instance Enum TextSearchFlags where
fromEnum TextSearchVisibleOnly = 1
fromEnum TextSearchTextOnly = 2
fromEnum TextSearchCaseInsensitive = 4
toEnum 1 = TextSearchVisibleOnly
toEnum 2 = TextSearchTextOnly
toEnum 4 = TextSearchCaseInsensitive
toEnum unmatched = error ("TextSearchFlags.toEnum: Cannot match " ++ show unmatched)
succ TextSearchVisibleOnly = TextSearchTextOnly
succ TextSearchTextOnly = TextSearchCaseInsensitive
succ _ = undefined
pred TextSearchTextOnly = TextSearchVisibleOnly
pred TextSearchCaseInsensitive = TextSearchTextOnly
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x TextSearchCaseInsensitive
enumFromThen _ _ = error "Enum TextSearchFlags: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum TextSearchFlags: enumFromThenTo not implemented"
instance Flags TextSearchFlags
data TextWindowType = TextWindowPrivate
| TextWindowWidget
| TextWindowText
| TextWindowLeft
| TextWindowRight
| TextWindowTop
| TextWindowBottom
deriving (Enum,Eq,Show)
data ToolbarStyle = ToolbarIcons
| ToolbarText
| ToolbarBoth
| ToolbarBothHoriz
deriving (Enum,Eq,Show)
data TreeViewColumnSizing = TreeViewColumnGrowOnly
| TreeViewColumnAutosize
| TreeViewColumnFixed
deriving (Enum,Eq,Show)
data WindowPosition = WinPosNone
| WinPosCenter
| WinPosMouse
| WinPosCenterAlways
| WinPosCenterOnParent
deriving (Enum,Eq,Show)
data WindowType = WindowToplevel
| WindowPopup
deriving (Enum,Eq,Show)
data WrapMode = WrapNone
| WrapChar
| WrapWord
| WrapWordChar
deriving (Enum,Eq,Show)
data EntryIconPosition = EntryIconPrimary
| EntryIconSecondary
deriving (Enum,Eq,Show)