module Graphics.UI.Gtk.General.Enums (
AccelFlags(..),
ArrowType(..),
AttachOptions(..),
MouseButton(..),
ButtonBoxStyle(..),
CalendarDisplayOptions(..),
Click(..),
CornerType(..),
DeleteType(..),
DestDefaults(..),
DragResult(..),
DirectionType(..),
Justification(..),
MatchType(..),
MenuDirectionType(..),
MetricType(..),
MovementStep(..),
Orientation(..),
Packing(..), toPacking, fromPacking,
PackType(..),
PathPriorityType(..),
PathType(..),
PolicyType(..),
PositionType(..),
ProgressBarOrientation(..),
ReliefStyle(..),
ResizeMode(..),
ScrollType(..),
ScrollStep (..),
SelectionMode(..),
ShadowType(..),
SortType(..),
StateType(..),
SubmenuDirection(..),
SubmenuPlacement(..),
SpinButtonUpdatePolicy(..),
SpinType(..),
TargetFlags(..),
TextDirection(..),
TextSearchFlags(..),
TextWindowType(..),
ToolbarStyle(..),
TreeViewColumnSizing(..),
--TroughType(..),
UpdateType(..),
Visibility(..),
WindowPosition(..),
WindowType(..),
WrapMode(..),
EntryIconPosition(..),
AnchorType (..),
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 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 = ButtonboxDefaultStyle
| ButtonboxSpread
| ButtonboxEdge
| ButtonboxStart
| ButtonboxEnd
| ButtonboxCenter
deriving (Enum,Eq,Show)
data CalendarDisplayOptions = CalendarShowHeading
| CalendarShowDayNames
| CalendarNoMonthChange
| CalendarShowWeekNumbers
| CalendarWeekStartMonday
| CalendarShowDetails
deriving (Bounded,Eq,Show)
instance Enum CalendarDisplayOptions where
fromEnum CalendarShowHeading = 1
fromEnum CalendarShowDayNames = 2
fromEnum CalendarNoMonthChange = 4
fromEnum CalendarShowWeekNumbers = 8
fromEnum CalendarWeekStartMonday = 16
fromEnum CalendarShowDetails = 32
toEnum 1 = CalendarShowHeading
toEnum 2 = CalendarShowDayNames
toEnum 4 = CalendarNoMonthChange
toEnum 8 = CalendarShowWeekNumbers
toEnum 16 = CalendarWeekStartMonday
toEnum 32 = CalendarShowDetails
toEnum unmatched = error ("CalendarDisplayOptions.toEnum: Cannot match " ++ show unmatched)
succ CalendarShowHeading = CalendarShowDayNames
succ CalendarShowDayNames = CalendarNoMonthChange
succ CalendarNoMonthChange = CalendarShowWeekNumbers
succ CalendarShowWeekNumbers = CalendarWeekStartMonday
succ CalendarWeekStartMonday = CalendarShowDetails
succ _ = undefined
pred CalendarShowDayNames = CalendarShowHeading
pred CalendarNoMonthChange = CalendarShowDayNames
pred CalendarShowWeekNumbers = CalendarNoMonthChange
pred CalendarWeekStartMonday = CalendarShowWeekNumbers
pred CalendarShowDetails = CalendarWeekStartMonday
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 MatchType = MatchAll
| MatchAllTail
| MatchHead
| MatchTail
| MatchExact
| MatchLast
deriving (Enum,Eq,Show)
data MenuDirectionType = MenuDirParent
| MenuDirChild
| MenuDirNext
| MenuDirPrev
deriving (Enum,Eq,Show)
data MetricType = Pixels
| Inches
| Centimeters
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 ProgressBarOrientation = ProgressLeftToRight
| ProgressRightToLeft
| ProgressBottomToTop
| ProgressTopToBottom
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 SortType = SortAscending
| SortDescending
deriving (Enum,Eq,Show)
data StateType = StateNormal
| StateActive
| StatePrelight
| StateSelected
| StateInsensitive
deriving (Enum,Eq,Show)
data SubmenuDirection = DirectionLeft
| DirectionRight
deriving (Enum,Eq,Show)
data SubmenuPlacement = TopBottom
| LeftRight
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
deriving (Bounded,Eq,Show)
instance Enum TextSearchFlags where
fromEnum TextSearchVisibleOnly = 1
fromEnum TextSearchTextOnly = 2
toEnum 1 = TextSearchVisibleOnly
toEnum 2 = TextSearchTextOnly
toEnum unmatched = error ("TextSearchFlags.toEnum: Cannot match " ++ show unmatched)
succ TextSearchVisibleOnly = TextSearchTextOnly
succ _ = undefined
pred TextSearchTextOnly = TextSearchVisibleOnly
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x TextSearchTextOnly
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 UpdateType = UpdateContinuous
| UpdateDiscontinuous
| UpdateDelayed
deriving (Enum,Eq,Show)
data Visibility = VisibilityNone
| VisibilityPartial
| VisibilityFull
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)
data AnchorType = AnchorCenter
| AnchorNorth
| AnchorNorthWest
| AnchorNorthEast
| AnchorSouth
| AnchorSouthWest
| AnchorSouthEast
| AnchorWest
| AnchorEast
| AnchorN
| AnchorNw
| AnchorNe
| AnchorS
| AnchorSw
| AnchorSe
| AnchorW
| AnchorE
deriving (Eq,Show)
instance Enum AnchorType where
fromEnum AnchorCenter = 0
fromEnum AnchorNorth = 1
fromEnum AnchorNorthWest = 2
fromEnum AnchorNorthEast = 3
fromEnum AnchorSouth = 4
fromEnum AnchorSouthWest = 5
fromEnum AnchorSouthEast = 6
fromEnum AnchorWest = 7
fromEnum AnchorEast = 8
fromEnum AnchorN = 1
fromEnum AnchorNw = 2
fromEnum AnchorNe = 3
fromEnum AnchorS = 4
fromEnum AnchorSw = 5
fromEnum AnchorSe = 6
fromEnum AnchorW = 7
fromEnum AnchorE = 8
toEnum 0 = AnchorCenter
toEnum 1 = AnchorNorth
toEnum 2 = AnchorNorthWest
toEnum 3 = AnchorNorthEast
toEnum 4 = AnchorSouth
toEnum 5 = AnchorSouthWest
toEnum 6 = AnchorSouthEast
toEnum 7 = AnchorWest
toEnum 8 = AnchorEast
toEnum unmatched = error ("AnchorType.toEnum: Cannot match " ++ show unmatched)
succ AnchorCenter = AnchorNorth
succ AnchorNorth = AnchorNorthWest
succ AnchorNorthWest = AnchorNorthEast
succ AnchorNorthEast = AnchorSouth
succ AnchorSouth = AnchorSouthWest
succ AnchorSouthWest = AnchorSouthEast
succ AnchorSouthEast = AnchorWest
succ AnchorWest = AnchorEast
succ AnchorEast = AnchorN
succ AnchorN = AnchorNw
succ AnchorNw = AnchorNe
succ AnchorNe = AnchorS
succ AnchorS = AnchorSw
succ AnchorSw = AnchorSe
succ AnchorSe = AnchorW
succ AnchorW = AnchorE
succ _ = undefined
pred AnchorNorth = AnchorCenter
pred AnchorNorthWest = AnchorNorth
pred AnchorNorthEast = AnchorNorthWest
pred AnchorSouth = AnchorNorthEast
pred AnchorSouthWest = AnchorSouth
pred AnchorSouthEast = AnchorSouthWest
pred AnchorWest = AnchorSouthEast
pred AnchorEast = AnchorWest
pred AnchorN = AnchorEast
pred AnchorNw = AnchorN
pred AnchorNe = AnchorNw
pred AnchorS = AnchorNe
pred AnchorSw = AnchorS
pred AnchorSe = AnchorSw
pred AnchorW = AnchorSe
pred AnchorE = AnchorW
pred _ = undefined
enumFromTo x y | fromEnum x == fromEnum y = [ y ]
| otherwise = x : enumFromTo (succ x) y
enumFrom x = enumFromTo x AnchorE
enumFromThen _ _ = error "Enum AnchorType: enumFromThen not implemented"
enumFromThenTo _ _ _ = error "Enum AnchorType: enumFromThenTo not implemented"