gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Gdk.Gdk

Description

Gdk general functions.

Synopsis

- flush :: IO ()
- screenWidth :: IO Int
- screenHeight :: IO Int
- screenWidthMM :: IO Int
- screenHeightMM :: IO Int
- data GrabStatus
  - = GrabSuccess
  - | GrabAlreadyGrabbed
  - | GrabInvalidTime
  - | GrabNotViewable
  - | GrabFrozen
  - | GrabFailed
- pointerGrab :: (DrawWindowClass window, DrawWindowClass confine_to) => window -> Bool -> [EventMask] -> Maybe confine_to -> Maybe Cursor -> TimeStamp -> IO GrabStatus
- pointerUngrab :: TimeStamp -> IO ()
- pointerIsGrabbed :: IO Bool
- keyboardGrab :: DrawWindowClass window => window -> Bool -> TimeStamp -> IO GrabStatus
- keyboardUngrab :: TimeStamp -> IO ()
- beep :: IO ()
- data RGBA = RGBA Double Double Double Double

# Documentation

flush :: IO () Source #

Flushes the X output buffer and waits until all requests have been processed by the server. This is rarely needed by applications.

screenWidth :: IO Int Source #

Returns the width of the default screen in pixels.

screenHeight :: IO Int Source #

Returns the height of the default screen in pixels.

screenWidthMM :: IO Int Source #

Returns the width of the default screen in millimeters. Note that on many X servers this value will not be correct.

screenHeightMM :: IO Int Source #

Returns the height of the default screen in millimeters. Note that on many X servers this value will not be correct.

data GrabStatus Source #

Constructors

GrabSuccess |
GrabAlreadyGrabbed |
GrabInvalidTime |
GrabNotViewable |
GrabFrozen |
GrabFailed |

#### Instances

Instances details

Enum GrabStatus Source #

Specifies why a selection ownership was changed.

`OwnerChangeNewOwner`
  some other application claimed the ownership
`OwnerChangeDestroy`
  the window was destroyed
`OwnerChangeClose`
  the client was closed

Instance details

Defined in Graphics.UI.Gtk.Gdk.Enums

Methods

succ :: GrabStatus -> GrabStatus Source #

pred :: GrabStatus -> GrabStatus Source #

toEnum :: Int -> GrabStatus Source #

fromEnum :: GrabStatus -> Int Source #

enumFrom :: GrabStatus -> [GrabStatus] Source #

enumFromThen :: GrabStatus -> GrabStatus -> [GrabStatus] Source #

enumFromTo :: GrabStatus -> GrabStatus -> [GrabStatus] Source #

enumFromThenTo :: GrabStatus -> GrabStatus -> GrabStatus -> [GrabStatus] Source #

Show GrabStatus Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods showsPrec :: Int -> GrabStatus -> ShowS Source # show :: GrabStatus -> String Source # showList :: [GrabStatus] -> ShowS Source #
Eq GrabStatus Source # |
Instance details Defined in Graphics.UI.Gtk.Gdk.Enums Methods (==) :: GrabStatus -> GrabStatus -> Bool Source # (/=) :: GrabStatus -> GrabStatus -> Bool Source #

pointerGrab Source #

Arguments

:: (DrawWindowClass window, DrawWindowClass confine_to) |
=> window | `window` - the `DrawWindow` which will own the grab (the grab window).
-> Bool | `owner_events` - if `False` then all pointer events are reported with respect to `window` and are only reported if selected by `event_mask`. If `True` then pointer events for this application are reported as normal, but pointer events outside this application are reported with respect to `window` and only if selected by `event_mask`. In either mode, unreported events are discarded.
-> [EventMask] | `event_mask` - specifies the event mask, which is used in accordance with `owner_events`. Note that only pointer events (i.e. button and motion events) may be selected.
-> Maybe confine_to | `confine_to` If supplied, the pointer will be confined to this window during the grab. If the pointer is outside `confine_to`, it will automatically be moved to the closest edge of `confine_to` and enter and leave events will be generated as necessary.
-> Maybe Cursor | `cursor` - the cursor to display while the grab is active. If this is `Nothing` then the normal cursors are used for `window` and its descendants, and the cursor for `window` is used for all other windows.
-> TimeStamp | `time` - the timestamp of the event which led to this pointer grab. This usually comes from an `Event`, though `currentTime` can be used if the time isn't known.
-> IO GrabStatus | `Returns` - `GrabSuccess` if the grab was successful.

Grabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with `pointerUngrab`, or the grab window becomes unviewable. This overrides any previous pointer grab by this client.

Pointer grabs are used for operations which need complete control over mouse events, even if the mouse leaves the application. For example in GTK+ it is used for Drag and Drop, for dragging the handle in the GtkHPaned and GtkVPaned widgets, and for resizing columns in GtkCList widgets.

Note that if the event mask of an X window has selected both button press and button release events, then a button press event will cause an automatic pointer grab until the button is released. X does this automatically since most applications expect to receive button press and release events in pairs. It is equivalent to a pointer grab on the window with `owner_events` set to `True`.

If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the GdkEventGrabBroken events that are emitted when the grab ends unvoluntarily.

pointerUngrab Source #

Arguments

:: TimeStamp | `time` - a timestamp from an `Event`, or `currentTime` if no timestamp is available.
-> IO () |

Ungrabs the pointer on the default display, if it is grabbed by this application.

pointerIsGrabbed :: IO Bool Source #

Returns `True` if the pointer on the default display is currently grabbed by this application.

Note that this does not take the inmplicit pointer grab on button presses into account.

keyboardGrab Source #

Arguments

:: DrawWindowClass window |
=> window | `window` - the `DrawWindow` which will own the grab (the grab window).
-> Bool | `owner_events` - if `False` then all keyboard events are reported with respect to `window`. If `True` then keyboard events for this application are reported as normal, but keyboard events outside this application are reported with respect to `window`. Both key press and key release events are always reported, independent of the event mask set by the application.
-> TimeStamp | `time` - a timestamp from an `Event`, or `currentTime` if no timestamp is available.
-> IO GrabStatus | `Returns` - `GrabSuccess` if the grab was successful.

Grabs the keyboard so that all events are passed to this application until the keyboard is ungrabbed with `keyboardUngrab`. This overrides any previous keyboard grab by this client.

If you set up anything at the time you take the grab that needs to be cleaned up when the grab ends, you should handle the GdkEventGrabBroken events that are emitted when the grab ends unvoluntarily.

keyboardUngrab Source #

Arguments

:: TimeStamp | `time` - a timestamp from an `Event`, or `currentTime` if no timestamp is available.
-> IO () |

Ungrabs the keyboard on the default display, if it is grabbed by this application.

beep :: IO () Source #

Emits a short beep.

data RGBA Source #

Constructors

RGBA Double Double Double Double |

#### Instances

Instances details

Storable RGBA Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Structs

Methods

sizeOf :: RGBA -> Int Source #

alignment :: RGBA -> Int Source #

peekElemOff :: Ptr RGBA -> Int -> IO RGBA Source #

pokeElemOff :: Ptr RGBA -> Int -> RGBA -> IO () Source #

peekByteOff :: Ptr b -> Int -> IO RGBA Source #

pokeByteOff :: Ptr b -> Int -> RGBA -> IO () Source #

peek :: Ptr RGBA -> IO RGBA Source #

poke :: Ptr RGBA -> RGBA -> IO () Source #