Graphics.UI.Gtk.Gdk.Screen

gtk3-0.14.5: 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.Screen

Contents

- Detail
- Class Hierarchy
- Types
- Methods
- Attributes
- Signals

Description

Object representing a physical screen

- Module available since Gdk version 2.2

Synopsis

- data Screen
- class GObjectClass o => ScreenClass o
- castToScreen :: GObjectClass obj => obj -> Screen
- gTypeScreen :: GType
- toScreen :: ScreenClass o => o -> Screen
- screenGetDefault :: IO (Maybe Screen)
- screenGetSystemVisual :: Screen -> IO Visual
- screenIsComposited :: Screen -> IO Bool
- screenGetRootWindow :: Screen -> IO DrawWindow
- screenGetDisplay :: Screen -> IO Display
- screenGetNumber :: Screen -> IO Int
- screenGetWidth :: Screen -> IO Int
- screenGetHeight :: Screen -> IO Int
- screenGetWidthMm :: Screen -> IO Int
- screenGetHeightMm :: Screen -> IO Int
- screenGetWidthMM :: Screen -> IO Int
- screenGetHeightMM :: Screen -> IO Int
- screenListVisuals :: Screen -> IO [Visual]
- screenGetToplevelWindows :: Screen -> IO [DrawWindow]
- screenMakeDisplayName :: GlibString string => Screen -> IO string
- screenGetNMonitors :: Screen -> IO Int
- screenGetMonitorGeometry :: Screen -> Int -> IO Rectangle
- screenGetMonitorAtPoint :: Screen -> Int -> Int -> IO Int
- screenGetMonitorAtWindow :: Screen -> DrawWindow -> IO Int
- screenGetMonitorHeightMm :: Screen -> Int -> IO Int
- screenGetMonitorWidthMm :: Screen -> Int -> IO Int
- screenGetMonitorPlugName :: GlibString string => Screen -> Int -> IO (Maybe string)
- screenGetActiveWindow :: Screen -> IO (Maybe DrawWindow)
- screenGetWindowStack :: Screen -> IO (Maybe [DrawWindow])
- screenFontOptions :: Attr Screen (Maybe FontOptions)
- screenResolution :: Attr Screen Double
- screenSizeChanged :: ScreenClass self => Signal self (IO ())
- screenCompositedChanged :: ScreenClass self => Signal self (IO ())
- screenMonitorsChanged :: ScreenClass self => Signal self (IO ())

# Detail

`Screen` objects are the GDK representation of a physical screen. It is used throughout GDK and Gtk+ to specify which screen the top level windows are to be displayed on. It is also used to query the screen specification and default settings such as the default colormap (`screenGetDefaultColormap`), the screen width (`screenGetWidth`), etc.

Note that a screen may consist of multiple monitors which are merged to form a large screen area.

# Class Hierarchy

    | GObject
    | +----Screen

# Types

data Screen #

Instances

Eq Screen # |
Methods (==) :: Screen -> Screen -> Bool # (/=) :: Screen -> Screen -> Bool #
Ord Screen # |
Methods compare :: Screen -> Screen -> Ordering # (<) :: Screen -> Screen -> Bool # (<=) :: Screen -> Screen -> Bool # (>) :: Screen -> Screen -> Bool # (>=) :: Screen -> Screen -> Bool # max :: Screen -> Screen -> Screen # min :: Screen -> Screen -> Screen #
GObjectClass Screen # |
Methods toGObject :: Screen -> GObject # unsafeCastGObject :: GObject -> Screen #
ScreenClass Screen # |

class GObjectClass o => ScreenClass o #

Instances

ScreenClass Screen # |

castToScreen :: GObjectClass obj => obj -> Screen #

gTypeScreen :: GType #

toScreen :: ScreenClass o => o -> Screen #

# Methods

screenGetDefault #

Arguments

:: IO (Maybe Screen) | returns a `Screen`, or `Nothing` if there is no default display.

Gets the default screen for the default display. (See `displayGetDefault`).

screenGetSystemVisual #

Arguments

:: Screen |
-> IO Visual | returns the system visual

Get the system's default visual for `screen`. This is the visual for the root window of the display.

screenIsComposited #

Arguments

:: Screen |
-> IO Bool | returns Whether windows with RGBA visuals can reasonably be expected to have their alpha channels drawn correctly on the screen.

Returns whether windows with an RGBA visual can reasonably be expected to have their alpha channel drawn correctly on the screen.

On X11 this function returns whether a compositing manager is compositing `screen`.

- Available since Gdk version 2.10

screenGetRootWindow #

Arguments

:: Screen |
-> IO DrawWindow | returns the root window

Gets the root window of `screen`.

screenGetDisplay #

Arguments

:: Screen |
-> IO Display | returns the display to which `screen` belongs

Gets the display to which the `screen` belongs.

screenGetNumber #

Arguments

:: Screen |
-> IO Int | returns the index

Gets the index of `screen` among the screens in the display to which it belongs. (See `screenGetDisplay`)

screenGetWidth #

Arguments

:: Screen |
-> IO Int | returns the width of `screen` in pixels.

Gets the width of `screen` in pixels

screenGetHeight #

Arguments

:: Screen |
-> IO Int | returns the height of `screen` in pixels.

Gets the height of `screen` in pixels

screenGetWidthMm :: Screen -> IO Int #

screenGetHeightMm :: Screen -> IO Int #

screenGetWidthMM #

Arguments

:: Screen |
-> IO Int | returns the width of `screen` in millimeters.

Gets the width of `screen` in millimeters. Note that on some X servers this value will not be correct.

screenGetHeightMM #

Arguments

:: Screen |
-> IO Int | returns the heigth of `screen` in millimeters.

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

screenListVisuals #

Arguments

:: Screen |
-> IO [Visual] | returns a list of visuals

Lists the available visuals for the specified `screen`. A visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit color, and might expect pixels to be in a certain format.

screenGetToplevelWindows #

Arguments

:: Screen |
-> IO [DrawWindow] | returns list of toplevel windows

Obtains a list of all toplevel windows known to GDK on the screen `screen`. A toplevel window is a child of the root window (see `getDefaultRootWindow`).

screenMakeDisplayName #

Arguments

:: GlibString string |
=> Screen |
-> IO string | returns a newly allocated string

Determines the name to pass to `displayOpen` to get a `Display` with this screen as the default screen.

screenGetNMonitors #

Arguments

:: Screen |
-> IO Int | returns number of monitors which `screen` consists of.

Returns the number of monitors which `screen` consists of.

screenGetMonitorGeometry #

Arguments

:: Screen |
-> Int | `monitorNum` - the monitor number.
-> IO Rectangle |

Retrieves the `Rectangle` representing the size and position of the individual monitor within the entire screen area.

Note that the size of the entire screen area can be retrieved via `screenGetWidth` and `screenGetHeight`.

screenGetMonitorAtPoint #

Arguments

:: Screen |
-> Int | `x` - the x coordinate in the virtual screen.
-> Int | `y` - the y coordinate in the virtual screen.
-> IO Int | returns the monitor number in which the point (`x`,`y`) lies, or a monitor close to (`x`,`y`) if the point is not in any monitor.

Returns the monitor number in which the point (`x`,`y`) is located.

screenGetMonitorAtWindow #

Arguments

:: Screen |
-> DrawWindow | `window` - a `DrawWindow`
-> IO Int | returns the monitor number in which most of `window` is located, or if `window` does not intersect any monitors, a monitor, close to `window`.

Returns the number of the monitor in which the largest area of the bounding rectangle of `window` resides.

screenGetMonitorHeightMm #

Arguments

:: Screen |
-> Int | `monitorNum` - number of the monitor
-> IO Int | returns the height of the monitor, or -1 if not available

Gets the height in millimeters of the specified monitor.

- Available since Gdk version 2.14

screenGetMonitorWidthMm #

Arguments

:: Screen |
-> Int | `monitorNum` - number of the monitor
-> IO Int | returns the width of the monitor, or -1 if not available

Gets the width in millimeters of the specified monitor, if available.

- Available since Gdk version 2.14

screenGetMonitorPlugName #

Arguments

:: GlibString string |
=> Screen |
-> Int | `monitorNum` - number of the monitor
-> IO (Maybe string) | returns a newly-allocated string containing the name of the monitor, or `Nothing` if the name cannot be determined

Returns the output name of the specified monitor. Usually something like VGA, DVI, or TV, not the actual product name of the display device.

- Available since Gdk version 2.14

screenGetActiveWindow #

Arguments

:: Screen |
-> IO (Maybe DrawWindow) | returns the currently active window, or `Nothing`.

Returns the currently active window of this screen.

On X11, this is done by inspecting the _NET_ACTIVE_WINDOW property on the root window, as described in the Extended Window Manager Hints. If there is no currently currently active window, or the window manager does not support the _NET_ACTIVE_WINDOW hint, this function returns `Nothing`.

On other platforms, this function may return `Nothing`, depending on whether it is implementable on that platform.

- Available since Gdk version 2.10

screenGetWindowStack #

Arguments

:: Screen |
-> IO (Maybe [DrawWindow]) | returns a list of `DrawWindow`s for the current window stack, or `Nothing`.

Returns a list of `DrawWindow`s representing the current window stack.

On X11, this is done by inspecting the _NET_CLIENT_LIST_STACKING property on the root window, as described in the Extended Window Manager Hints. If the window manager does not support the _NET_CLIENT_LIST_STACKING hint, this function returns `Nothing`.

On other platforms, this function may return `Nothing`, depending on whether it is implementable on that platform.

- Available since Gdk version 2.10

# Attributes

screenFontOptions :: Attr Screen (Maybe FontOptions) #

The default font options for the screen.

screenResolution :: Attr Screen Double #

The resolution for fonts on the screen.

Default value: -1

# Signals

screenSizeChanged :: ScreenClass self => Signal self (IO ()) #

The ::size_changed signal is emitted when the pixel width or height of a screen changes.

screenCompositedChanged :: ScreenClass self => Signal self (IO ()) #

The `screenCompositedChanged` signal is emitted when the composited status of the screen changes

- Available since Gdk version 2.10

screenMonitorsChanged :: ScreenClass self => Signal self (IO ()) #

The `screenMonitorsChanged` signal is emitted when the number, size or position of the monitors attached to the screen change.

Only for X for now. Future implementations for Win32 and OS X may be a possibility.

- Available since Gdk version 2.14