gi-gdk-4.0.1: Gdk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.Surface

Description

A Surface is a (usually) rectangular region on the screen. It’s a low-level object, used to implement high-level objects such as GtkWidget and GtkWindow on the GTK level. A GtkWindow is a toplevel surface, the thing a user might think of as a “window” with a titlebar and so on; a GtkWindow may contain many sub-GdkSurfaces.

Synopsis

Exported types

newtype Surface Source #

Memory-managed wrapper type.

Constructors

Surface (ManagedPtr Surface) 

Instances

Instances details
Eq Surface Source # 
Instance details

Defined in GI.Gdk.Objects.Surface

Methods

(==) :: Surface -> Surface -> Bool #

(/=) :: Surface -> Surface -> Bool #

GObject Surface Source # 
Instance details

Defined in GI.Gdk.Objects.Surface

Methods

gobjectType :: IO GType #

IsGValue Surface Source #

Convert Surface to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.Surface

HasParentTypes Surface Source # 
Instance details

Defined in GI.Gdk.Objects.Surface

type ParentTypes Surface Source # 
Instance details

Defined in GI.Gdk.Objects.Surface

class (GObject o, IsDescendantOf Surface o) => IsSurface o Source #

Type class for types which can be safely cast to Surface, for instance with toSurface.

Instances

Instances details
(GObject o, IsDescendantOf Surface o) => IsSurface o Source # 
Instance details

Defined in GI.Gdk.Objects.Surface

toSurface :: (MonadIO m, IsSurface o) => o -> m Surface Source #

Cast to Surface, for types for which this is known to be safe. For general casts, use castTo.

noSurface :: Maybe Surface Source #

A convenience alias for Nothing :: Maybe Surface.

Methods

Overloaded methods

beep

surfaceBeep Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Emits a short beep associated to surface in the appropriate display, if supported. Otherwise, emits a short beep on the display just as displayBeep.

beginMoveDrag

surfaceBeginMoveDrag Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Int32

button: the button being used to drag, or 0 for a keyboard-initiated drag

-> Int32

x: surface X coordinate of mouse click that began the drag

-> Int32

y: surface Y coordinate of mouse click that began the drag

-> Word32

timestamp: timestamp of mouse click that began the drag

-> m () 

Begins a surface move operation (for a toplevel surface).

This function assumes that the drag is controlled by the client pointer device, use surfaceBeginMoveDragForDevice to begin a drag with a different device.

beginMoveDragForDevice

surfaceBeginMoveDragForDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) 
=> a

surface: a toplevel Surface

-> b

device: the device used for the operation

-> Int32

button: the button being used to drag, or 0 for a keyboard-initiated drag

-> Int32

x: surface X coordinate of mouse click that began the drag

-> Int32

y: surface Y coordinate of mouse click that began the drag

-> Word32

timestamp: timestamp of mouse click that began the drag

-> m () 

Begins a surface move operation (for a toplevel surface).

beginResizeDrag

surfaceBeginResizeDrag Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> SurfaceEdge

edge: the edge or corner from which the drag is started

-> Int32

button: the button being used to drag, or 0 for a keyboard-initiated drag

-> Int32

x: surface X coordinate of mouse click that began the drag

-> Int32

y: surface Y coordinate of mouse click that began the drag

-> Word32

timestamp: timestamp of mouse click that began the drag (use eventGetTime)

-> m () 

Begins a surface resize operation (for a toplevel surface).

This function assumes that the drag is controlled by the client pointer device, use surfaceBeginResizeDragForDevice to begin a drag with a different device.

beginResizeDragForDevice

surfaceBeginResizeDragForDevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) 
=> a

surface: a toplevel Surface

-> SurfaceEdge

edge: the edge or corner from which the drag is started

-> b

device: the device used for the operation

-> Int32

button: the button being used to drag, or 0 for a keyboard-initiated drag

-> Int32

x: surface X coordinate of mouse click that began the drag

-> Int32

y: surface Y coordinate of mouse click that began the drag

-> Word32

timestamp: timestamp of mouse click that began the drag (use eventGetTime)

-> m () 

Begins a surface resize operation (for a toplevel surface). You might use this function to implement a “window resize grip,”

constrainSize

surfaceConstrainSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Geometry

geometry: a Geometry structure

-> [SurfaceHints]

flags: a mask indicating what portions of geometry are set

-> Int32

width: desired width of surface

-> Int32

height: desired height of the surface

-> m (Int32, Int32) 

Constrains a desired width and height according to a set of geometry hints (such as minimum and maximum size).

coordsFromParent

surfaceCoordsFromParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a child surface

-> Double

parentX: X coordinate in parent’s coordinate system

-> Double

parentY: Y coordinate in parent’s coordinate system

-> m (Double, Double) 

Transforms surface coordinates from a parent surface to a child surface.

Calling this function is equivalent to subtracting the return values of surfaceGetPosition from the parent coordinates.

See also: surfaceCoordsToParent

coordsToParent

surfaceCoordsToParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a child surface

-> Double

x: X coordinate in child’s coordinate system

-> Double

y: Y coordinate in child’s coordinate system

-> m (Double, Double) 

Transforms surface coordinates from a child surface to its parent surface. Calling this function is equivalent to adding the return values of surfaceGetPosition to the child coordinates.

See also: surfaceCoordsFromParent

createCairoContext

surfaceCreateCairoContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m CairoContext

Returns: the newly created CairoContext

Creates a new CairoContext for rendering on surface.

createGlContext

surfaceCreateGlContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m GLContext

Returns: the newly created GLContext, or Nothing on error (Can throw GError)

Creates a new GLContext matching the framebuffer format to the visual of the Surface. The context is disconnected from any particular surface or surface.

If the creation of the GLContext failed, error will be set.

Before using the returned GLContext, you will need to call gLContextMakeCurrent or gLContextRealize.

createSimilarSurface

surfaceCreateSimilarSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: surface to make new surface similar to

-> Content

content: the content for the new surface

-> Int32

width: width of the new surface

-> Int32

height: height of the new surface

-> m Surface

Returns: a pointer to the newly allocated surface. The caller owns the surface and should call cairo_surface_destroy() when done with it.

This function always returns a valid pointer, but it will return a pointer to a “nil” surface if other is already in an error state or any other error occurs.

Create a new surface that is as compatible as possible with the given surface. For example the new surface will have the same fallback resolution and font options as surface. Generally, the new surface will also use the same backend as surface, unless that is not possible for some reason. The type of the returned surface may be examined with cairo_surface_get_type().

Initially the surface contents are all 0 (transparent if contents have transparency, black otherwise.)

createVulkanContext

surfaceCreateVulkanContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m VulkanContext

Returns: the newly created VulkanContext, or Nothing on error (Can throw GError)

Creates a new VulkanContext for rendering on surface.

If the creation of the VulkanContext failed, error will be set.

deiconify

surfaceDeiconify Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Attempt to deiconify (unminimize) surface. On X11 the window manager may choose to ignore the request to deiconify. When using GTK, use gtk_window_deiconify() instead of the Surface variant. Or better yet, you probably want to use gtk_window_present_with_time(), which raises the surface, focuses it, unminimizes it, and puts it on the current desktop.

destroy

surfaceDestroy Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Destroys the window system resources associated with surface and decrements surface's reference count. The window system resources for all children of surface are also destroyed, but the children’s reference counts are not decremented.

Note that a surface will not be destroyed automatically when its reference count reaches zero. You must call this function yourself before that happens.

focus

surfaceFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Word32

timestamp: timestamp of the event triggering the surface focus

-> m () 

Sets keyboard focus to surface. In most cases, gtk_window_present_with_time() should be used on a GtkWindow, rather than calling this function.

freezeUpdates

surfaceFreezeUpdates Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Temporarily freezes a surface such that it won’t receive expose events. The surface will begin receiving expose events again when surfaceThawUpdates is called. If surfaceFreezeUpdates has been called more than once, surfaceThawUpdates must be called an equal number of times to begin processing exposes.

fullscreen

surfaceFullscreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Moves the surface into fullscreen mode. This means the surface covers the entire screen and is above any panels or task bars.

If the surface was already fullscreen, then this function does nothing.

On X11, asks the window manager to put surface in a fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the fullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

fullscreenOnMonitor

surfaceFullscreenOnMonitor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsMonitor b) 
=> a

surface: a toplevel Surface

-> b

monitor: Which monitor to display fullscreen on.

-> m () 

Moves the surface into fullscreen mode on the given monitor. This means the surface covers the entire screen and is above any panels or task bars.

If the surface was already fullscreen, then this function does nothing.

getAcceptFocus

surfaceGetAcceptFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface.

-> m Bool

Returns: whether or not the surface should receive input focus.

Determines whether or not the desktop environment shuld be hinted that the surface does not want to receive input focus.

getChildren

surfaceGetChildren Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m [Surface]

Returns: list of child surfaces inside surface

Gets the list of children of surface known to GDK. This function only returns children created via GDK, so for example it’s useless when used with the root window; it only returns surfaces an application created itself.

The returned list must be freed, but the elements in the list need not be.

getCursor

surfaceGetCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m (Maybe Cursor)

Returns: a Cursor, or Nothing. The returned object is owned by the Surface and should not be unreferenced directly. Use surfaceSetCursor to unset the cursor of the surface

Retrieves a Cursor pointer for the cursor currently set on the specified Surface, or Nothing. If the return value is Nothing then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.

getDecorations

surfaceGetDecorations Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: The toplevel Surface to get the decorations from

-> m (Bool, [WMDecoration])

Returns: True if the surface has decorations set, False otherwise.

Returns the decorations set on the GdkSurface with surfaceSetDecorations.

getDeviceCursor

surfaceGetDeviceCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) 
=> a

surface: a Surface.

-> b

device: a master, pointer Device.

-> m (Maybe Cursor)

Returns: a Cursor, or Nothing. The returned object is owned by the Surface and should not be unreferenced directly. Use surfaceSetCursor to unset the cursor of the surface

Retrieves a Cursor pointer for the device currently set on the specified Surface, or Nothing. If the return value is Nothing then there is no custom cursor set on the specified surface, and it is using the cursor for its parent surface.

getDevicePosition

surfaceGetDevicePosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) 
=> a

surface: a Surface.

-> b

device: pointer Device to query to.

-> m (Maybe Surface, Double, Double, [ModifierType])

Returns: The surface underneath device (as with deviceGetSurfaceAtPosition), or Nothing if the surface is not known to GDK.

Obtains the current device position in doubles and modifier state. The position is given in coordinates relative to the upper left corner of surface.

getDisplay

surfaceGetDisplay Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Display

Returns: the Display associated with surface

Gets the Display associated with a Surface.

getFocusOnMap

surfaceGetFocusOnMap Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface.

-> m Bool

Returns: whether or not the surface wants to receive input focus when it is mapped.

Determines whether or not the desktop environment should be hinted that the surface does not want to receive input focus when it is mapped.

getFrameClock

surfaceGetFrameClock Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: surface to get frame clock for

-> m FrameClock

Returns: the frame clock

Gets the frame clock for the surface. The frame clock for a surface never changes unless the surface is reparented to a new toplevel surface.

getFrameExtents

surfaceGetFrameExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m Rectangle 

Obtains the bounding box of the surface, including window manager titlebar/borders if any. The frame position is given in root window coordinates. To get the position of the surface itself (rather than the frame) in root window coordinates, use surfaceGetOrigin.

getFullscreenMode

surfaceGetFullscreenMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m FullscreenMode

Returns: The FullscreenMode applied to the surface when fullscreen.

Obtains the FullscreenMode of the surface.

getGeometry

surfaceGetGeometry Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m (Int32, Int32, Int32, Int32) 

Any of the return location arguments to this function may be Nothing, if you aren’t interested in getting the value of that field.

The X and Y coordinates returned are relative to the parent surface of surface, which for toplevels usually means relative to the surface decorations (titlebar, etc.) rather than relative to the root window (screen-size background window).

On the X11 platform, the geometry is obtained from the X server, so reflects the latest position of surface; this may be out-of-sync with the position of surface delivered in the most-recently-processed EventConfigure. surfaceGetPosition in contrast gets the position from the most recent configure event.

Note: If surface is not a toplevel, it is much better to call surfaceGetPosition, surfaceGetWidth and surfaceGetHeight instead, because it avoids the roundtrip to the X server and because these functions support the full 32-bit coordinate space, whereas surfaceGetGeometry is restricted to the 16-bit coordinates of X11.

getHeight

surfaceGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Int32

Returns: The height of surface

Returns the height of the given surface.

On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

getModalHint

surfaceGetModalHint Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: A toplevel Surface.

-> m Bool

Returns: whether or not the surface has the modal hint set.

Determines whether or not the window manager is hinted that surface has modal behaviour.

getOrigin

surfaceGetOrigin Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m (Int32, Int32, Int32)

Returns: not meaningful, ignore

Obtains the position of a surface in root window coordinates. (Compare with surfaceGetPosition and surfaceGetGeometry which return the position of a surface relative to its parent surface.)

getParent

surfaceGetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Surface

Returns: parent of surface

Obtains the parent of surface, as known to GDK. Does not query the X server; thus this returns the parent as passed to gdk_surface_new(), not the actual parent. This should never matter unless you’re using Xlib calls mixed with GDK calls on the X11 platform. It may also matter for toplevel windows, because the window manager may choose to reparent them.

getPassThrough

surfaceGetPassThrough Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Bool 

Returns whether input to the surface is passed through to the surface below.

See surfaceSetPassThrough for details

getPosition

surfaceGetPosition Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m (Int32, Int32) 

Obtains the position of the surface as reported in the most-recently-processed EventConfigure. Contrast with surfaceGetGeometry which queries the X server for the current surface position, regardless of which events have been received or processed.

The position coordinates are relative to the surface’s parent surface.

getRootCoords

surfaceGetRootCoords Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Int32

x: X coordinate in surface

-> Int32

y: Y coordinate in surface

-> m (Int32, Int32) 

Obtains the position of a surface position in root window coordinates. This is similar to surfaceGetOrigin but allows you to pass in any position in the surface, not just the origin.

getRootOrigin

surfaceGetRootOrigin Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m (Int32, Int32) 

Obtains the top-left corner of the window manager frame in root surface coordinates.

getScaleFactor

surfaceGetScaleFactor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: surface to get scale factor for

-> m Int32

Returns: the scale factor

Returns the internal scale factor that maps from surface coordiantes to the actual device pixels. On traditional systems this is 1, but on very high density outputs this can be a higher value (often 2).

A higher value means that drawing is automatically scaled up to a higher resolution, so any code doing drawing will automatically look nicer. However, if you are supplying pixel-based data the scale value can be used to determine whether to use a pixel resource with higher resolution data.

The scale of a surface may change during runtime, if this happens a configure event will be sent to the toplevel surface.

getState

surfaceGetState Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m [SurfaceState]

Returns: surface state bitfield

Gets the bitwise OR of the currently active surface state flags, from the SurfaceState enumeration.

getSupportMultidevice

surfaceGetSupportMultidevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface.

-> m Bool

Returns: True if the surface handles multidevice features.

Returns True if the surface is aware of the existence of multiple devices.

getSurfaceType

surfaceGetSurfaceType Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m SurfaceType

Returns: type of surface

Gets the type of the surface. See SurfaceType.

getToplevel

surfaceGetToplevel Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Surface

Returns: the toplevel surface containing surface

Gets the toplevel surface that’s an ancestor of surface.

Any surface type but SurfaceTypeChild is considered a toplevel surface, as is a SurfaceTypeChild surface that has a root surface as parent.

getTypeHint

surfaceGetTypeHint Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: A toplevel Surface

-> m SurfaceTypeHint

Returns: The type hint set for surface

This function returns the type hint set for a surface.

getWidth

surfaceGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Int32

Returns: The width of surface

Returns the width of the given surface.

On the X11 platform the returned size is the size reported in the most-recently-processed configure event, rather than the current size on the X server.

hasNative

surfaceHasNative Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Bool

Returns: True if the surface has a native surface, False otherwise.

Checks whether the surface has a native surface or not.

hide

surfaceHide Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

For toplevel surfaces, withdraws them, so they will no longer be known to the window manager; for all surfaces, unmaps them, so they won’t be displayed. Normally done automatically as part of gtk_widget_hide().

iconify

surfaceIconify Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Asks to iconify (minimize) surface. The window manager may choose to ignore the request, but normally will honor it. Using gtk_window_iconify() is preferred, if you have a GtkWindow widget.

This function only makes sense when surface is a toplevel surface.

inputShapeCombineRegion

surfaceInputShapeCombineRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Region

shapeRegion: region of surface to be non-transparent

-> Int32

offsetX: X position of shapeRegion in surface coordinates

-> Int32

offsetY: Y position of shapeRegion in surface coordinates

-> m () 

Like gdk_surface_shape_combine_region(), but the shape applies only to event handling. Mouse events which happen while the pointer position corresponds to an unset bit in the mask will be passed on the surface below surface.

An input shape is typically used with RGBA surfaces. The alpha channel of the surface defines which pixels are invisible and allows for nicely antialiased borders, and the input shape controls where the surface is “clickable”.

On the X11 platform, this requires version 1.1 of the shape extension.

On the Win32 platform, this functionality is not present and the function does nothing.

isDestroyed

surfaceIsDestroyed Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Bool

Returns: True if the surface is destroyed

Check to see if a surface is destroyed..

isInputOnly

surfaceIsInputOnly Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m Bool

Returns: True if surface is input only

Determines whether or not the surface is an input only surface.

isViewable

surfaceIsViewable Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Bool

Returns: True if the surface is viewable

Check if the surface and all ancestors of the surface are mapped. (This is not necessarily "viewable" in the X sense, since we only check as far as we have GDK surface parents, not to the root surface.)

isVisible

surfaceIsVisible Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m Bool

Returns: True if the surface is mapped

Checks whether the surface has been mapped (with surfaceShow or surfaceShowUnraised).

lower

surfaceLower Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Lowers surface to the bottom of the Z-order (stacking order), so that other surfaces with the same parent surface appear above surface. This is true whether or not the other surfaces are visible.

If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, surfaceLower only requests the restack, does not guarantee it.

Note that surfaceShow raises the surface again, so don’t call this function before surfaceShow. (Try surfaceShowUnraised.)

maximize

surfaceMaximize Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Maximizes the surface. If the surface was already maximized, then this function does nothing.

On X11, asks the window manager to maximize surface, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the maximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

On Windows, reliably maximizes the surface.

mergeChildInputShapes

surfaceMergeChildInputShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Merges the input shape masks for any child surfaces into the input shape mask for surface. i.e. the union of all input masks for surface and its children will become the new input mask for surface. See surfaceInputShapeCombineRegion.

This function is distinct from surfaceSetChildInputShapes because it includes surface’s input shape mask in the set of shapes to be merged.

move

surfaceMove Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Int32

x: X coordinate relative to surface’s parent

-> Int32

y: Y coordinate relative to surface’s parent

-> m () 

Repositions a surface relative to its parent surface. For toplevel surfaces, window managers may ignore or modify the move; you should probably use gtk_window_move() on a GtkWindow widget anyway, instead of using GDK functions. For child surfaces, the move will reliably succeed.

If you’re also planning to resize the surface, use surfaceMoveResize to both move and resize simultaneously, for a nicer visual effect.

moveResize

surfaceMoveResize Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Int32

x: new X position relative to surface’s parent

-> Int32

y: new Y position relative to surface’s parent

-> Int32

width: new width

-> Int32

height: new height

-> m () 

Equivalent to calling surfaceMove and surfaceResize, except that both operations are performed at once, avoiding strange visual effects. (i.e. the user may be able to see the surface first move, then resize, if you don’t use surfaceMoveResize.)

moveToRect

surfaceMoveToRect Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: the Surface to move

-> Rectangle

rect: the destination Rectangle to align surface with

-> Gravity

rectAnchor: the point on rect to align with surface's anchor point

-> Gravity

surfaceAnchor: the point on surface to align with rect's anchor point

-> [AnchorHints]

anchorHints: positioning hints to use when limited on space

-> Int32

rectAnchorDx: horizontal offset to shift surface, i.e. rect's anchor point

-> Int32

rectAnchorDy: vertical offset to shift surface, i.e. rect's anchor point

-> m () 

Moves surface to rect, aligning their anchor points.

rect is relative to the top-left corner of the surface that surface is transient for. rectAnchor and surfaceAnchor determine anchor points on rect and surface to pin together. rect's anchor point can optionally be offset by rectAnchorDx and rectAnchorDy, which is equivalent to offsetting the position of surface.

anchorHints determines how surface will be moved if the anchor points cause it to move off-screen. For example, AnchorHintsFlipX will replace GravityNorthWest with GravityNorthEast and vice versa if surface extends beyond the left or right edges of the monitor.

Connect to the movedToRect signal to find out how it was actually positioned.

newChild

surfaceNewChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

parent: the parent surface

-> Rectangle

position: placement of the surface inside parent

-> m Surface

Returns: the new Surface

Creates a new client-side child surface.

newPopup

surfaceNewPopup Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the display to create the surface on

-> Rectangle

position: position of the surface on screen

-> m Surface

Returns: the new Surface

Creates a new toplevel popup surface. The surface will bypass surface management.

newTemp

surfaceNewTemp Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the display to create the surface on

-> m Surface

Returns: the new Surface

Creates a new toplevel temporary surface. The surface will be situated off-screen and not handle output.

You most likely do not want to use this function.

newToplevel

surfaceNewToplevel Source #

Arguments

:: (HasCallStack, MonadIO m, IsDisplay a) 
=> a

display: the display to create the surface on

-> Int32

width: width of new surface

-> Int32

height: height of new surface

-> m Surface

Returns: the new Surface

Creates a new toplevel surface. The surface will be managed by the surface manager.

peekChildren

surfacePeekChildren Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m [Surface]

Returns: a reference to the list of child surfaces in surface

Like surfaceGetChildren, but does not copy the list of children, so the list does not need to be freed.

queueExpose

surfaceQueueExpose Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Forces an expose event for surface to be scheduled.

If the invalid area of surface is empty, an expose event will still be emitted. Its invalid region will be empty.

This function is useful for implementations that track invalid regions on their own.

raise

surfaceRaise Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Raises surface to the top of the Z-order (stacking order), so that other surfaces with the same parent surface appear below surface. This is true whether or not the surfaces are visible.

If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, surfaceRaise only requests the restack, does not guarantee it.

registerDnd

surfaceRegisterDnd Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface.

-> m () 

Registers a surface as a potential drop destination.

resize

surfaceResize Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Int32

width: new width of the surface

-> Int32

height: new height of the surface

-> m () 

Resizes surface; for toplevel surfaces, asks the window manager to resize the surface. The window manager may not allow the resize. When using GTK, use gtk_window_resize() instead of this low-level GDK function.

Surfaces may not be resized below 1x1.

If you’re also planning to move the surface, use surfaceMoveResize to both move and resize simultaneously, for a nicer visual effect.

restack

surfaceRestack Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) 
=> a

surface: a Surface

-> Maybe b

sibling: a Surface that is a sibling of surface, or Nothing

-> Bool

above: a boolean

-> m () 

Changes the position of surface in the Z-order (stacking order), so that it is above sibling (if above is True) or below sibling (if above is False).

If sibling is Nothing, then this either raises (if above is True) or lowers the surface.

If surface is a toplevel, the window manager may choose to deny the request to move the surface in the Z-order, surfaceRestack only requests the restack, does not guarantee it.

setAcceptFocus

surfaceSetAcceptFocus Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Bool

acceptFocus: True if the surface should receive input focus

-> m () 

Setting acceptFocus to False hints the desktop environment that the surface doesn’t want to receive input focus.

On X, it is the responsibility of the window manager to interpret this hint. ICCCM-compliant window manager usually respect it.

setChildInputShapes

surfaceSetChildInputShapes Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Sets the input shape mask of surface to the union of input shape masks for all children of surface, ignoring the input shape mask of surface itself. Contrast with surfaceMergeChildInputShapes which includes the input shape mask of surface in the masks to be merged.

setCursor

surfaceSetCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsCursor b) 
=> a

surface: a Surface

-> Maybe b

cursor: a cursor

-> m () 

Sets the default mouse pointer for a Surface.

Note that cursor must be for the same display as surface.

Use cursorNewFromName or cursorNewFromTexture to create the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR. Passing Nothing for the cursor argument to surfaceSetCursor means that surface will use the cursor of its parent surface. Most surfaces should use this default.

setDecorations

surfaceSetDecorations Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> [WMDecoration]

decorations: decoration hint mask

-> m () 

“Decorations” are the features the window manager adds to a toplevel Surface. This function sets the traditional Motif window manager hints that tell the window manager which decorations you would like your surface to have. Usually you should use gtk_window_set_decorated() on a GtkWindow instead of using the GDK function directly.

The decorations argument is the logical OR of the fields in the WMDecoration enumeration. If GDK_DECOR_ALL is included in the mask, the other bits indicate which decorations should be turned off. If GDK_DECOR_ALL is not included, then the other bits indicate which decorations should be turned on.

Most window managers honor a decorations hint of 0 to disable all decorations, but very few honor all possible combinations of bits.

setDeviceCursor

surfaceSetDeviceCursor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b, IsCursor c) 
=> a

surface: a Surface

-> b

device: a master, pointer Device

-> c

cursor: a Cursor

-> m () 

Sets a specific Cursor for a given device when it gets inside surface. Use gdk_cursor_new_fromm_name() or cursorNewFromTexture to create the cursor. To make the cursor invisible, use GDK_BLANK_CURSOR. Passing Nothing for the cursor argument to surfaceSetCursor means that surface will use the cursor of its parent surface. Most surfaces should use this default.

setFocusOnMap

surfaceSetFocusOnMap Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Bool

focusOnMap: True if the surface should receive input focus when mapped

-> m () 

Setting focusOnMap to False hints the desktop environment that the surface doesn’t want to receive input focus when it is mapped. focus_on_map should be turned off for surfaces that aren’t triggered interactively (such as popups from network activity).

On X, it is the responsibility of the window manager to interpret this hint. Window managers following the freedesktop.org window manager extension specification should respect it.

setFullscreenMode

surfaceSetFullscreenMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> FullscreenMode

mode: fullscreen mode

-> m () 

Specifies whether the surface should span over all monitors (in a multi-head setup) or only the current monitor when in fullscreen mode.

The mode argument is from the FullscreenMode enumeration. If GDK_FULLSCREEN_ON_ALL_MONITORS is specified, the fullscreen surface will span over all monitors of the display.

On X11, searches through the list of monitors display the ones which delimit the 4 edges of the entire display and will ask the window manager to span the surface over these monitors.

If the XINERAMA extension is not available or not usable, this function has no effect.

Not all window managers support this, so you can’t rely on the fullscreen surface to span over the multiple monitors when GDK_FULLSCREEN_ON_ALL_MONITORS is specified.

setFunctions

surfaceSetFunctions Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> [WMFunction]

functions: bitmask of operations to allow on surface

-> m () 

Sets hints about the window management functions to make available via buttons on the window frame.

On the X backend, this function sets the traditional Motif window manager hint for this purpose. However, few window managers do anything reliable or interesting with this hint. Many ignore it entirely.

The functions argument is the logical OR of values from the WMFunction enumeration. If the bitmask includes GDK_FUNC_ALL, then the other bits indicate which functions to disable; if it doesn’t include GDK_FUNC_ALL, it indicates which functions to enable.

setGeometryHints

surfaceSetGeometryHints Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Geometry

geometry: geometry hints

-> [SurfaceHints]

geomMask: bitmask indicating fields of geometry to pay attention to

-> m () 

Sets the geometry hints for surface. Hints flagged in geomMask are set, hints not flagged in geomMask are unset. To unset all hints, use a geomMask of 0 and a geometry of Nothing.

This function provides hints to the surfaceing system about acceptable sizes for a toplevel surface. The purpose of this is to constrain user resizing, but the windowing system will typically (but is not required to) also constrain the current size of the surface to the provided values and constrain programatic resizing via surfaceResize or surfaceMoveResize.

Note that on X11, this effect has no effect on surfaces of type SurfaceTypeTemp since these surfaces are not resizable by the user.

Since you can’t count on the windowing system doing the constraints for programmatic resizes, you should generally call surfaceConstrainSize yourself to determine appropriate sizes.

setIconList

surfaceSetIconList Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsTexture b) 
=> a

surface: The Surface toplevel surface to set the icon of.

-> [b]

surfaces: A list of image surfaces, of different sizes.

-> m () 

Sets a list of icons for the surface. One of these will be used to represent the surface when it has been iconified. The icon is usually shown in an icon box or some sort of task bar. Which icon size is shown depends on the window manager. The window manager can scale the icon but setting several size icons can give better image quality since the window manager may only need to scale the icon by a small amount or not at all.

Note that some platforms don't support surface icons.

setIconName

surfaceSetIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Maybe Text

name: name of surface while iconified (minimized)

-> m () 

Surfaces may have a name used while minimized, distinct from the name they display in their titlebar. Most of the time this is a bad idea from a user interface standpoint. But you can set such a name with this function, if you like.

After calling this with a non-Nothing name, calls to surfaceSetTitle will not update the icon title.

Using Nothing for name unsets the icon title; further calls to surfaceSetTitle will again update the icon title as well.

Note that some platforms don't support surface icons.

setKeepAbove

surfaceSetKeepAbove Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Bool

setting: whether to keep surface above other surfaces

-> m () 

Set if surface must be kept above other surfaces. If the surface was already above, then this function does nothing.

On X11, asks the window manager to keep surface above, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep above”; so you can’t rely on the surface being kept above. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

setKeepBelow

surfaceSetKeepBelow Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Bool

setting: whether to keep surface below other surfaces

-> m () 

Set if surface must be kept below other surfaces. If the surface was already below, then this function does nothing.

On X11, asks the window manager to keep surface below, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “keep below”; so you can’t rely on the surface being kept below. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

setModalHint

surfaceSetModalHint Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: A toplevel Surface

-> Bool

modal: True if the surface is modal, False otherwise.

-> m () 

The application can use this hint to tell the window manager that a certain surface has modal behaviour. The window manager can use this information to handle modal surfaces in a special way.

You should only use this on surfaces for which you have previously called surfaceSetTransientFor

setOpacity

surfaceSetOpacity Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a top-level or non-native Surface

-> Double

opacity: opacity

-> m () 

Set surface to render as partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.)

For toplevel surfaces this depends on support from the windowing system that may not always be there. For instance, On X11, this works only on X screens with a compositing manager running. On Wayland, there is no per-surface opacity value that the compositor would apply. Instead, use gdk_surface_set_opaque_region (surface, NULL) to tell the compositor that the entire surface is (potentially) non-opaque, and draw your content with alpha, or use gtk_widget_set_opacity() to set an overall opacity for your widgets.

Support for non-toplevel surfaces was added in 3.8.

setOpaqueRegion

surfaceSetOpaqueRegion Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a top-level or non-native Surface

-> Maybe Region

region: a region, or Nothing

-> m () 

For optimisation purposes, compositing window managers may like to not draw obscured regions of surfaces, or turn off blending during for these regions. With RGB windows with no transparency, this is just the shape of the window, but with ARGB32 windows, the compositor does not know what regions of the window are transparent or not.

This function only works for toplevel surfaces.

GTK will update this property automatically if the surface background is opaque, as we know where the opaque regions are. If your surface background is not opaque, please update this property in your GtkWidget::style-updated handler.

setPassThrough

surfaceSetPassThrough Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Bool

passThrough: a boolean

-> m () 

Sets whether input to the surface is passed through to the surface below.

The default value of this is False, which means that pointer events that happen inside the surface are send first to the surface, but if the event is not selected by the event mask then the event is sent to the parent surface, and so on up the hierarchy.

If passThrough is True then such pointer events happen as if the surface wasn't there at all, and thus will be sent first to any surfaces below surface. This is useful if the surface is used in a transparent fashion. In the terminology of the web this would be called "pointer-events: none".

Note that a surface with passThrough True can still have a subsurface without pass through, so you can get events on a subset of a surface. And in that cases you would get the in-between related events such as the pointer enter/leave events on its way to the destination surface.

setShadowWidth

surfaceSetShadowWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> Int32

left: The left extent

-> Int32

right: The right extent

-> Int32

top: The top extent

-> Int32

bottom: The bottom extent

-> m () 

Newer GTK windows using client-side decorations use extra geometry around their frames for effects like shadows and invisible borders. Window managers that want to maximize windows or snap to edges need to know where the extents of the actual frame lie, so that users don’t feel like windows are snapping against random invisible edges.

Note that this property is automatically updated by GTK, so this function should only be used by applications which do not use GTK to create toplevel surfaces.

setStartupId

surfaceSetStartupId Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Text

startupId: a string with startup-notification identifier

-> m () 

When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.

setSupportMultidevice

surfaceSetSupportMultidevice Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface.

-> Bool

supportMultidevice: True to enable multidevice support in surface.

-> m () 

This function will enable multidevice features in surface.

Multidevice aware surfaces will need to handle properly multiple, per device enter/leave events, device grabs and grab ownerships.

setTitle

surfaceSetTitle Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> Text

title: title of surface

-> m () 

Sets the title of a toplevel surface, to be displayed in the titlebar. If you haven’t explicitly set the icon name for the surface (using surfaceSetIconName), the icon name will be set to title as well. title must be in UTF-8 encoding (as with all user-readable strings in GDK and GTK). title may not be Nothing.

setTransientFor

surfaceSetTransientFor Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) 
=> a

surface: a toplevel Surface

-> b

parent: another toplevel Surface

-> m () 

Indicates to the window manager that surface is a transient dialog associated with the application surface parent. This allows the window manager to do things like center surface on parent and keep surface above parent.

See gtk_window_set_transient_for() if you’re using GtkWindow or GtkDialog.

setTypeHint

surfaceSetTypeHint Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: A toplevel Surface

-> SurfaceTypeHint

hint: A hint of the function this surface will have

-> m () 

The application can use this call to provide a hint to the surface manager about the functionality of a surface. The window manager can use this information when determining the decoration and behaviour of the surface.

The hint must be set before the surface is mapped.

show

surfaceShow Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Like surfaceShowUnraised, but also raises the surface to the top of the surface stack (moves the surface to the front of the Z-order).

This function maps a surface so it’s visible onscreen. Its opposite is surfaceHide.

When implementing a GtkWidget, you should call this function on the widget's Surface as part of the “map” method.

showUnraised

surfaceShowUnraised Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Shows a Surface onscreen, but does not modify its stacking order. In contrast, surfaceShow will raise the surface to the top of the surface stack.

On the X11 platform, in Xlib terms, this function calls XMapWindow() (it also updates some internal GDK state, which means that you can’t really use XMapWindow() directly on a GDK surface).

showWindowMenu

surfaceShowWindowMenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a, IsEvent b) 
=> a

surface: a Surface

-> b

event: a GdkEvent to show the menu for

-> m Bool

Returns: True if the window menu was shown and False otherwise.

Asks the windowing system to show the window menu. The window menu is the menu shown when right-clicking the titlebar on traditional windows managed by the window manager. This is useful for windows using client-side decorations, activating it with a right-click on the window decorations.

stick

surfaceStick Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

“Pins” a surface such that it’s on all workspaces and does not scroll with viewports, for window managers that have scrollable viewports. (When using GtkWindow, gtk_window_stick() may be more useful.)

On the X11 platform, this function depends on window manager support, so may have no effect with many window managers. However, GDK will do the best it can to convince the window manager to stick the surface. For window managers that don’t support this operation, there’s nothing you can do to force it to happen.

thawUpdates

surfaceThawUpdates Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a Surface

-> m () 

Thaws a surface frozen with surfaceFreezeUpdates.

unfullscreen

surfaceUnfullscreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Moves the surface out of fullscreen mode. If the surface was not fullscreen, does nothing.

On X11, asks the window manager to move surface out of the fullscreen state, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “fullscreen”; so you can’t rely on the unfullscreenification actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

unmaximize

surfaceUnmaximize Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Unmaximizes the surface. If the surface wasn’t maximized, then this function does nothing.

On X11, asks the window manager to unmaximize surface, if the window manager supports this operation. Not all window managers support this, and some deliberately ignore it or don’t have a concept of “maximized”; so you can’t rely on the unmaximization actually happening. But it will happen with most standard window managers, and GDK makes a best effort to get it to happen.

On Windows, reliably unmaximizes the surface.

unstick

surfaceUnstick Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) 
=> a

surface: a toplevel Surface

-> m () 

Reverse operation for surfaceStick; see surfaceStick, and gtk_window_unstick().

Properties

cursor

The mouse pointer for a Surface. See surfaceSetCursor and surfaceGetCursor for details.

clearSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m () Source #

Set the value of the “cursor” property to Nothing. When overloading is enabled, this is equivalent to

clear #cursor

constructSurfaceCursor :: (IsSurface o, IsCursor a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “cursor” property. This is rarely needed directly, but it is used by new.

getSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m (Maybe Cursor) Source #

Get the value of the “cursor” property. When overloading is enabled, this is equivalent to

get surface #cursor

setSurfaceCursor :: (MonadIO m, IsSurface o, IsCursor a) => o -> a -> m () Source #

Set the value of the “cursor” property. When overloading is enabled, this is equivalent to

set surface [ #cursor := value ]

display

The Display connection of the surface. See surfaceGetDisplay for details.

constructSurfaceDisplay :: (IsSurface o, IsDisplay a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “display” property. This is rarely needed directly, but it is used by new.

getSurfaceDisplay :: (MonadIO m, IsSurface o) => o -> m Display Source #

Get the value of the “display” property. When overloading is enabled, this is equivalent to

get surface #display

frameClock

No description available in the introspection data.

constructSurfaceFrameClock :: (IsSurface o, IsFrameClock a) => a -> IO (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “frame-clock” property. This is rarely needed directly, but it is used by new.

getSurfaceFrameClock :: (MonadIO m, IsSurface o) => o -> m FrameClock Source #

Get the value of the “frame-clock” property. When overloading is enabled, this is equivalent to

get surface #frameClock

mapped

No description available in the introspection data.

getSurfaceMapped :: (MonadIO m, IsSurface o) => o -> m Bool Source #

Get the value of the “mapped” property. When overloading is enabled, this is equivalent to

get surface #mapped

state

No description available in the introspection data.

getSurfaceState :: (MonadIO m, IsSurface o) => o -> m [SurfaceState] Source #

Get the value of the “state” property. When overloading is enabled, this is equivalent to

get surface #state

Signals

event

type C_SurfaceEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SurfaceEventCallback Source #

Arguments

 = Event

event: an input event

-> IO Bool

Returns: True to indicate that the event has been handled

Emitted when GDK receives an input event for surface.

afterSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId Source #

Connect a signal handler for the event signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after surface #event callback

mk_SurfaceEventCallback :: C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback) Source #

Generate a function pointer callable from C code, from a C_SurfaceEventCallback.

onSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId Source #

Connect a signal handler for the event signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on surface #event callback

movedToRect

type C_SurfaceMovedToRectCallback = Ptr () -> Ptr () -> Ptr () -> CInt -> CInt -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SurfaceMovedToRectCallback Source #

Arguments

 = Ptr ()

flippedRect: the position of surface after any possible flipping or Nothing if the backend can't obtain it

-> Ptr ()

finalRect: the final position of surface or Nothing if the backend can't obtain it

-> Bool

flippedX: True if the anchors were flipped horizontally

-> Bool

flippedY: True if the anchors were flipped vertically

-> IO () 

Emitted when the position of surface is finalized after being moved to a destination rectangle.

surface might be flipped over the destination rectangle in order to keep it on-screen, in which case flippedX and flippedY will be set to True accordingly.

flippedRect is the ideal position of surface after any possible flipping, but before any possible sliding. finalRect is flippedRect, but possibly translated in the case that flipping is still ineffective in keeping surface on-screen.

afterSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId Source #

Connect a signal handler for the movedToRect signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after surface #movedToRect callback

onSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId Source #

Connect a signal handler for the movedToRect signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on surface #movedToRect callback

render

type C_SurfaceRenderCallback = Ptr () -> Ptr Region -> Ptr () -> IO CInt Source #

Type for the callback on the (unwrapped) C side.

type SurfaceRenderCallback Source #

Arguments

 = Region

region: the region that needs to be redrawn

-> IO Bool

Returns: True to indicate that the signal has been handled

Emitted when part of the surface needs to be redrawn.

afterSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId Source #

Connect a signal handler for the render signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after surface #render callback

mk_SurfaceRenderCallback :: C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback) Source #

Generate a function pointer callable from C code, from a C_SurfaceRenderCallback.

onSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId Source #

Connect a signal handler for the render signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on surface #render callback

sizeChanged

type C_SurfaceSizeChangedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type SurfaceSizeChangedCallback Source #

Arguments

 = Int32

width: the new width

-> Int32

height: the new height

-> IO () 

Emitted when the size of surface is changed.

afterSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the sizeChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after surface #sizeChanged callback

onSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId Source #

Connect a signal handler for the sizeChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on surface #sizeChanged callback