|  | Source code | Contents | Index

Graphics.UI.ObjectIO.StdIOCommon |

Portability | portable
Stability | provisional
Maintainer | ka2_mail@yahoo.com

Description
StdIOCommon defines common types and access functions for the I/O library.
Synopsis

data SelectState

= Able
| Unable

data MarkState

= Mark
| NoMark

enabled :: SelectState -> Bool
marked :: MarkState -> Bool

data KeyboardState

= CharKey Char KeyState
| SpecialKey SpecialKey KeyState Modifiers
| KeyLost

data KeyState

= KeyDown IsRepeatKey
| KeyUp

type IsRepeatKey = Bool

data Key

= IsCharKey Char
| IsSpecialKey SpecialKey

type KeyboardStateFilter = KeyboardState -> Bool
getKeyboardStateKeyState :: KeyboardState -> KeyState
getKeyboardStateKey :: KeyboardState -> Maybe Key

data MouseState

= MouseMove Point2 Modifiers
| MouseDown Point2 Modifiers Int
| MouseDrag Point2 Modifiers
| MouseUp Point2 Modifiers
| MouseLost

data ButtonState

= ButtonStillUp
| ButtonDown
| ButtonDoubleDown
| ButtonTripleDown
| ButtonStillDown
| ButtonUp

type MouseStateFilter = MouseState -> Bool
getMouseStatePos :: MouseState -> Point2
getMouseStateModifiers :: MouseState -> Modifiers
getMouseStateButtonState :: MouseState -> ButtonState
data SliderState = SliderState {

sliderMin :: !Int
sliderMax :: !Int
sliderThumb :: !Int

}
data UpdateState = UpdateState {

oldFrame :: !ViewFrame
newFrame :: !ViewFrame
updArea :: !UpdateArea

}
type ViewDomain = Rectangle
type ViewFrame = Rectangle
type UpdateArea = [ViewFrame]
rectangleToUpdateState :: Rectangle -> UpdateState
viewDomainRange :: ViewDomain
viewFrameRange :: ViewFrame
data Modifiers = Modifiers {

shiftDown :: !Bool
optionDown :: !Bool
commandDown :: !Bool
controlDown :: !Bool
altDown :: !Bool

}
type ItemPos = (ItemLoc, ItemOffset)

data ItemLoc

= Fix
| LeftTop
| RightTop
| LeftBottom
| RightBottom
| Left
| Center
| Right
| LeftOf Id
| RightTo Id
| Above Id
| Below Id
| LeftOfPrev
| RightToPrev
| AbovePrev
| BelowPrev

type ItemOffset = Vector2

data Direction

= Horizontal
| Vertical

data CursorShape

= StandardCursor
| BusyCursor
| IBeamCursor
| CrossCursor
| FatCrossCursor
| ArrowCursor
| HiddenCursor

data DocumentInterface

= NDI
| SDI
| MDI

data SliderMove

= SliderIncSmall
| SliderDecSmall
| SliderIncLarge
| SliderDecLarge
| SliderThumb Int

data ErrorReport

= ErrorViolateDI
| ErrorIdsInUse
| ErrorUnknownObject
| ErrorNotifierOpen
| ErrorUnableReceiver
| OtherError !String

handleErrorReport :: Monad m => ErrorReport -> m a
module Graphics.UI.ObjectIO.StdIOBasic
module Graphics.UI.ObjectIO.StdKey
module Data.Maybe
type Id = Unique
data R2Id mess resp
data RId mess
rIdtoId :: RId mess -> Id
r2IdtoId :: R2Id mess resp -> Id

Documentation
data SelectState

`SelectState` is similar to Bool but it shows whether an object is enabled or disabled.
Constructors

Able |
Unable |

Instances

Eq SelectState
Show SelectState
Toggle SelectState

data MarkState

`MarkState` is similar to Bool but it shows whether the CheckControl is marked.
Constructors

Mark |
NoMark |

Instances

Eq MarkState
Show MarkState
Toggle MarkState

enabled :: SelectState -> Bool
marked :: MarkState -> Bool
data KeyboardState

`KeyboardState` is passed to keyboard handler for every keyboard event.
Constructors

CharKey Char KeyState | ASCII character input
SpecialKey SpecialKey KeyState Modifiers | Special key input
KeyLost | Key input lost while key was down

Instances

Eq KeyboardState
Show KeyboardState

data KeyState

The KeyState type
Constructors

KeyDown IsRepeatKey | Key is down
KeyUp | Key goes up

Instances

Eq KeyState
Show KeyState

type IsRepeatKey = Bool
Flag on key down (True iff key is repeating)
data Key

Constructors

IsCharKey Char |
IsSpecialKey SpecialKey |

type KeyboardStateFilter = KeyboardState -> Bool
Predicate on KeyboardState
getKeyboardStateKeyState :: KeyboardState -> KeyState
getKeyboardStateKeyState gets KeyState from KeyboardState (KeyUp if KeyboardState is KeyLost)
getKeyboardStateKey :: KeyboardState -> Maybe Key
getKeyboardStateKey gets Key value from KeyboardState (Nothing if KeyboardState is KeyLost)
data MouseState

The MouseState type.
Constructors

MouseMove Point2 Modifiers | Mouse is up (position,modifiers)
MouseDown Point2 Modifiers Int | Mouse goes down (and nr down)
MouseDrag Point2 Modifiers | Mouse is down (position,modifiers)
MouseUp Point2 Modifiers | Mouse goes up (position,modifiers)
MouseLost | Mouse input lost while mouse was down

Instances

Eq MouseState
Show MouseState

data ButtonState

The ButtonState type.
Constructors

ButtonStillUp | MouseMove
ButtonDown | MouseDown _ _ 1
ButtonDoubleDown | _ _ 2
ButtonTripleDown | _ _ >2
ButtonStillDown | MouseDrag
ButtonUp | MouseUp/MouseLost

Instances

Eq ButtonState
Show ButtonState

type MouseStateFilter = MouseState -> Bool
Predicate on MouseState
getMouseStatePos :: MouseState -> Point2
getMouseStateModifiers :: MouseState -> Modifiers
getMouseStateButtonState :: MouseState -> ButtonState
data SliderState

Constructors

SliderState |

sliderMin :: !Int |
sliderMax :: !Int |
sliderThumb :: !Int |

Instances

Eq SliderState
Show SliderState

data UpdateState

Constructors

UpdateState |

oldFrame :: !ViewFrame |
newFrame :: !ViewFrame |
updArea :: !UpdateArea |

Instances

Show UpdateState

type ViewDomain = Rectangle
ViewDomain is the `Rectangle`, which specifies the logical drawing area of the CompoundControl or Window.
type ViewFrame = Rectangle
ViewFrame is the current visible `Rectangle` of CompoundControl or Window. When there are horizontal and vertical scroll bars then the changing of the scroller thumb will change the `ViewFrame`.
type UpdateArea = [ViewFrame]
rectangleToUpdateState :: Rectangle -> UpdateState
viewDomainRange :: ViewDomain
viewDomainRange defines the minimum and maximum values for ViewDomains
viewFrameRange :: ViewFrame
viewFrameRange defines the minimum and maximum values for ViewFrames.
data Modifiers

Modifiers indicates the meta keys that have been pressed (True) or not (False).
Constructors

Modifiers |

shiftDown :: !Bool | True iff shift down
optionDown :: !Bool | True iff option down
commandDown :: !Bool | True iff command down
controlDown :: !Bool | True iff control down
altDown :: !Bool | True iff alt down

Instances

Eq Modifiers
Show Modifiers

type ItemPos = (ItemLoc, ItemOffset)
The layout language used for windows and controls. -}
data ItemLoc

Constructors

Fix |
LeftTop |
RightTop |
LeftBottom |
RightBottom |
Left |
Center |
Right |
LeftOf Id |
RightTo Id |
Above Id |
Below Id |
LeftOfPrev |
RightToPrev |
AbovePrev |
BelowPrev |

Instances

Eq ItemLoc
Show ItemLoc

type ItemOffset = Vector2
data Direction

Constructors

Horizontal |
Vertical |

Instances

Eq Direction

data CursorShape

Constructors

StandardCursor |
BusyCursor |
IBeamCursor |
CrossCursor |
FatCrossCursor |
ArrowCursor |
HiddenCursor |

Instances

Eq CursorShape

data DocumentInterface

The document interface type of interactive processes.
Constructors

NDI | No document interface
SDI | Single document interface
MDI | Multiple document interface

Instances

Eq DocumentInterface
Show DocumentInterface

data SliderMove

Constructors

SliderIncSmall |
SliderDecSmall |
SliderIncLarge |
SliderDecLarge |
SliderThumb Int |

Instances

Show SliderMove

data ErrorReport

Common error report type.
Constructors

ErrorViolateDI | Violation against DocumentInterface
ErrorIdsInUse | Object contains Ids that are bound
ErrorUnknownObject | Object can not be found
ErrorNotifierOpen | It was tried to open a second send notifier
ErrorUnableReceiver | Sending to receiver that exists, but its ReceiverSelectState is Unable.
OtherError !String | Some other kind of error

Instances

Eq ErrorReport
Show ErrorReport
Typeable ErrorReport

handleErrorReport :: Monad m => ErrorReport -> m a
module Graphics.UI.ObjectIO.StdIOBasic
module Graphics.UI.ObjectIO.StdKey
module Data.Maybe
type Id = Unique
data R2Id mess resp

Instances

Eq (R2Id mess resp)

data RId mess

Instances

Eq (RId mess)

rIdtoId :: RId mess -> Id
r2IdtoId :: R2Id mess resp -> Id
Produced by Haddock version 0.8