Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
- Exported types
- Methods
- Overloaded methods
- beep
- beginMoveDrag
- beginMoveDragForDevice
- beginResizeDrag
- beginResizeDragForDevice
- constrainSize
- coordsFromParent
- coordsToParent
- createCairoContext
- createGlContext
- createSimilarSurface
- createVulkanContext
- deiconify
- destroy
- focus
- freezeUpdates
- fullscreen
- fullscreenOnMonitor
- getAcceptFocus
- getChildren
- getCursor
- getDecorations
- getDeviceCursor
- getDevicePosition
- getDisplay
- getFocusOnMap
- getFrameClock
- getFrameExtents
- getFullscreenMode
- getGeometry
- getHeight
- getModalHint
- getOrigin
- getParent
- getPassThrough
- getPosition
- getRootCoords
- getRootOrigin
- getScaleFactor
- getState
- getSupportMultidevice
- getSurfaceType
- getToplevel
- getTypeHint
- getWidth
- hasNative
- hide
- iconify
- inputShapeCombineRegion
- isDestroyed
- isInputOnly
- isViewable
- isVisible
- lower
- maximize
- mergeChildInputShapes
- move
- moveResize
- moveToRect
- newChild
- newPopup
- newTemp
- newToplevel
- peekChildren
- queueExpose
- raise
- registerDnd
- resize
- restack
- setAcceptFocus
- setChildInputShapes
- setCursor
- setDecorations
- setDeviceCursor
- setFocusOnMap
- setFullscreenMode
- setFunctions
- setGeometryHints
- setIconList
- setIconName
- setKeepAbove
- setKeepBelow
- setModalHint
- setOpacity
- setOpaqueRegion
- setPassThrough
- setShadowWidth
- setStartupId
- setSupportMultidevice
- setTitle
- setTransientFor
- setTypeHint
- show
- showUnraised
- showWindowMenu
- stick
- thawUpdates
- unfullscreen
- unmaximize
- unstick
- Properties
- Signals
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
- newtype Surface = Surface (ManagedPtr Surface)
- class (GObject o, IsDescendantOf Surface o) => IsSurface o
- toSurface :: (MonadIO m, IsSurface o) => o -> m Surface
- noSurface :: Maybe Surface
- surfaceBeep :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceBeginMoveDrag :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
- surfaceBeginMoveDragForDevice :: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) => a -> b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
- surfaceBeginResizeDrag :: (HasCallStack, MonadIO m, IsSurface a) => a -> SurfaceEdge -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
- surfaceBeginResizeDragForDevice :: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) => a -> SurfaceEdge -> b -> Int32 -> Int32 -> Int32 -> Word32 -> m ()
- surfaceConstrainSize :: (HasCallStack, MonadIO m) => Geometry -> [SurfaceHints] -> Int32 -> Int32 -> m (Int32, Int32)
- surfaceCoordsFromParent :: (HasCallStack, MonadIO m, IsSurface a) => a -> Double -> Double -> m (Double, Double)
- surfaceCoordsToParent :: (HasCallStack, MonadIO m, IsSurface a) => a -> Double -> Double -> m (Double, Double)
- surfaceCreateCairoContext :: (HasCallStack, MonadIO m, IsSurface a) => a -> m CairoContext
- surfaceCreateGlContext :: (HasCallStack, MonadIO m, IsSurface a) => a -> m GLContext
- surfaceCreateSimilarSurface :: (HasCallStack, MonadIO m, IsSurface a) => a -> Content -> Int32 -> Int32 -> m Surface
- surfaceCreateVulkanContext :: (HasCallStack, MonadIO m, IsSurface a) => a -> m VulkanContext
- surfaceDeiconify :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceDestroy :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceFocus :: (HasCallStack, MonadIO m, IsSurface a) => a -> Word32 -> m ()
- surfaceFreezeUpdates :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceFullscreen :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceFullscreenOnMonitor :: (HasCallStack, MonadIO m, IsSurface a, IsMonitor b) => a -> b -> m ()
- surfaceGetAcceptFocus :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceGetChildren :: (HasCallStack, MonadIO m, IsSurface a) => a -> m [Surface]
- surfaceGetCursor :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Maybe Cursor)
- surfaceGetDecorations :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Bool, [WMDecoration])
- surfaceGetDeviceCursor :: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) => a -> b -> m (Maybe Cursor)
- surfaceGetDevicePosition :: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) => a -> b -> m (Maybe Surface, Double, Double, [ModifierType])
- surfaceGetDisplay :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Display
- surfaceGetFocusOnMap :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceGetFrameClock :: (HasCallStack, MonadIO m, IsSurface a) => a -> m FrameClock
- surfaceGetFrameExtents :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Rectangle
- surfaceGetFullscreenMode :: (HasCallStack, MonadIO m, IsSurface a) => a -> m FullscreenMode
- surfaceGetGeometry :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Int32, Int32, Int32, Int32)
- surfaceGetHeight :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Int32
- surfaceGetModalHint :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceGetOrigin :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Int32, Int32, Int32)
- surfaceGetParent :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Surface
- surfaceGetPassThrough :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceGetPosition :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Int32, Int32)
- surfaceGetRootCoords :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> m (Int32, Int32)
- surfaceGetRootOrigin :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Int32, Int32)
- surfaceGetScaleFactor :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Int32
- surfaceGetState :: (HasCallStack, MonadIO m, IsSurface a) => a -> m [SurfaceState]
- surfaceGetSupportMultidevice :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceGetSurfaceType :: (HasCallStack, MonadIO m, IsSurface a) => a -> m SurfaceType
- surfaceGetToplevel :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Surface
- surfaceGetTypeHint :: (HasCallStack, MonadIO m, IsSurface a) => a -> m SurfaceTypeHint
- surfaceGetWidth :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Int32
- surfaceHasNative :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceHide :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceIconify :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceInputShapeCombineRegion :: (HasCallStack, MonadIO m, IsSurface a) => a -> Region -> Int32 -> Int32 -> m ()
- surfaceIsDestroyed :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceIsInputOnly :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceIsViewable :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceIsVisible :: (HasCallStack, MonadIO m, IsSurface a) => a -> m Bool
- surfaceLower :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceMaximize :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceMergeChildInputShapes :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceMove :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> m ()
- surfaceMoveResize :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- surfaceMoveToRect :: (HasCallStack, MonadIO m, IsSurface a) => a -> Rectangle -> Gravity -> Gravity -> [AnchorHints] -> Int32 -> Int32 -> m ()
- surfaceNewChild :: (HasCallStack, MonadIO m, IsSurface a) => a -> Rectangle -> m Surface
- surfaceNewPopup :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Rectangle -> m Surface
- surfaceNewTemp :: (HasCallStack, MonadIO m, IsDisplay a) => a -> m Surface
- surfaceNewToplevel :: (HasCallStack, MonadIO m, IsDisplay a) => a -> Int32 -> Int32 -> m Surface
- surfacePeekChildren :: (HasCallStack, MonadIO m, IsSurface a) => a -> m [Surface]
- surfaceQueueExpose :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceRaise :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceRegisterDnd :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceResize :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> m ()
- surfaceRestack :: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) => a -> Maybe b -> Bool -> m ()
- surfaceSetAcceptFocus :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetChildInputShapes :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceSetCursor :: (HasCallStack, MonadIO m, IsSurface a, IsCursor b) => a -> Maybe b -> m ()
- surfaceSetDecorations :: (HasCallStack, MonadIO m, IsSurface a) => a -> [WMDecoration] -> m ()
- surfaceSetDeviceCursor :: (HasCallStack, MonadIO m, IsSurface a, IsDevice b, IsCursor c) => a -> b -> c -> m ()
- surfaceSetFocusOnMap :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetFullscreenMode :: (HasCallStack, MonadIO m, IsSurface a) => a -> FullscreenMode -> m ()
- surfaceSetFunctions :: (HasCallStack, MonadIO m, IsSurface a) => a -> [WMFunction] -> m ()
- surfaceSetGeometryHints :: (HasCallStack, MonadIO m, IsSurface a) => a -> Geometry -> [SurfaceHints] -> m ()
- surfaceSetIconList :: (HasCallStack, MonadIO m, IsSurface a, IsTexture b) => a -> [b] -> m ()
- surfaceSetIconName :: (HasCallStack, MonadIO m, IsSurface a) => a -> Maybe Text -> m ()
- surfaceSetKeepAbove :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetKeepBelow :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetModalHint :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetOpacity :: (HasCallStack, MonadIO m, IsSurface a) => a -> Double -> m ()
- surfaceSetOpaqueRegion :: (HasCallStack, MonadIO m, IsSurface a) => a -> Maybe Region -> m ()
- surfaceSetPassThrough :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetShadowWidth :: (HasCallStack, MonadIO m, IsSurface a) => a -> Int32 -> Int32 -> Int32 -> Int32 -> m ()
- surfaceSetStartupId :: (HasCallStack, MonadIO m, IsSurface a) => a -> Text -> m ()
- surfaceSetSupportMultidevice :: (HasCallStack, MonadIO m, IsSurface a) => a -> Bool -> m ()
- surfaceSetTitle :: (HasCallStack, MonadIO m, IsSurface a) => a -> Text -> m ()
- surfaceSetTransientFor :: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) => a -> b -> m ()
- surfaceSetTypeHint :: (HasCallStack, MonadIO m, IsSurface a) => a -> SurfaceTypeHint -> m ()
- surfaceShow :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceShowUnraised :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceShowWindowMenu :: (HasCallStack, MonadIO m, IsSurface a, IsEvent b) => a -> b -> m Bool
- surfaceStick :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceThawUpdates :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceUnfullscreen :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceUnmaximize :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- surfaceUnstick :: (HasCallStack, MonadIO m, IsSurface a) => a -> m ()
- clearSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m ()
- constructSurfaceCursor :: (IsSurface o, IsCursor a) => a -> IO (GValueConstruct o)
- getSurfaceCursor :: (MonadIO m, IsSurface o) => o -> m (Maybe Cursor)
- setSurfaceCursor :: (MonadIO m, IsSurface o, IsCursor a) => o -> a -> m ()
- constructSurfaceDisplay :: (IsSurface o, IsDisplay a) => a -> IO (GValueConstruct o)
- getSurfaceDisplay :: (MonadIO m, IsSurface o) => o -> m Display
- constructSurfaceFrameClock :: (IsSurface o, IsFrameClock a) => a -> IO (GValueConstruct o)
- getSurfaceFrameClock :: (MonadIO m, IsSurface o) => o -> m FrameClock
- getSurfaceMapped :: (MonadIO m, IsSurface o) => o -> m Bool
- getSurfaceState :: (MonadIO m, IsSurface o) => o -> m [SurfaceState]
- type C_SurfaceEventCallback = Ptr () -> Ptr Event -> Ptr () -> IO CInt
- type SurfaceEventCallback = Event -> IO Bool
- afterSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
- genClosure_SurfaceEvent :: MonadIO m => SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback)
- mk_SurfaceEventCallback :: C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback)
- noSurfaceEventCallback :: Maybe SurfaceEventCallback
- onSurfaceEvent :: (IsSurface a, MonadIO m) => a -> SurfaceEventCallback -> m SignalHandlerId
- wrap_SurfaceEventCallback :: SurfaceEventCallback -> C_SurfaceEventCallback
- type C_SurfaceMovedToRectCallback = Ptr () -> Ptr () -> Ptr () -> CInt -> CInt -> Ptr () -> IO ()
- type SurfaceMovedToRectCallback = Ptr () -> Ptr () -> Bool -> Bool -> IO ()
- afterSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId
- genClosure_SurfaceMovedToRect :: MonadIO m => SurfaceMovedToRectCallback -> m (GClosure C_SurfaceMovedToRectCallback)
- mk_SurfaceMovedToRectCallback :: C_SurfaceMovedToRectCallback -> IO (FunPtr C_SurfaceMovedToRectCallback)
- noSurfaceMovedToRectCallback :: Maybe SurfaceMovedToRectCallback
- onSurfaceMovedToRect :: (IsSurface a, MonadIO m) => a -> SurfaceMovedToRectCallback -> m SignalHandlerId
- wrap_SurfaceMovedToRectCallback :: SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback
- type C_SurfaceRenderCallback = Ptr () -> Ptr Region -> Ptr () -> IO CInt
- type SurfaceRenderCallback = Region -> IO Bool
- afterSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
- genClosure_SurfaceRender :: MonadIO m => SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback)
- mk_SurfaceRenderCallback :: C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback)
- noSurfaceRenderCallback :: Maybe SurfaceRenderCallback
- onSurfaceRender :: (IsSurface a, MonadIO m) => a -> SurfaceRenderCallback -> m SignalHandlerId
- wrap_SurfaceRenderCallback :: SurfaceRenderCallback -> C_SurfaceRenderCallback
- type C_SurfaceSizeChangedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO ()
- type SurfaceSizeChangedCallback = Int32 -> Int32 -> IO ()
- afterSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
- genClosure_SurfaceSizeChanged :: MonadIO m => SurfaceSizeChangedCallback -> m (GClosure C_SurfaceSizeChangedCallback)
- mk_SurfaceSizeChangedCallback :: C_SurfaceSizeChangedCallback -> IO (FunPtr C_SurfaceSizeChangedCallback)
- noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback
- onSurfaceSizeChanged :: (IsSurface a, MonadIO m) => a -> SurfaceSizeChangedCallback -> m SignalHandlerId
- wrap_SurfaceSizeChangedCallback :: SurfaceSizeChangedCallback -> C_SurfaceSizeChangedCallback
Exported types
Memory-managed wrapper type.
Instances
Eq Surface Source # | |
GObject Surface Source # | |
Defined in GI.Gdk.Objects.Surface gobjectType :: IO GType # | |
IsGValue Surface Source # | Convert |
HasParentTypes Surface Source # | |
Defined in GI.Gdk.Objects.Surface | |
type ParentTypes Surface Source # | |
Defined in GI.Gdk.Objects.Surface |
class (GObject o, IsDescendantOf Surface o) => IsSurface o Source #
Instances
(GObject o, IsDescendantOf Surface o) => IsSurface o Source # | |
Defined in GI.Gdk.Objects.Surface |
Methods
Overloaded methods
beep
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> m () |
Begins a surface move operation (for a toplevel surface).
beginResizeDrag
surfaceBeginResizeDrag Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> SurfaceEdge |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) | |
=> a |
|
-> SurfaceEdge |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Word32 |
|
-> m () |
Begins a surface resize operation (for a toplevel surface). You might use this function to implement a “window resize grip,”
constrainSize
:: (HasCallStack, MonadIO m) | |
=> Geometry |
|
-> [SurfaceHints] |
|
-> Int32 |
|
-> Int32 |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Double |
|
-> Double |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m CairoContext | Returns: the newly created |
Creates a new CairoContext
for rendering on surface
.
createGlContext
surfaceCreateGlContext Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m GLContext | Returns: the newly created |
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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Content |
|
-> Int32 |
|
-> Int32 |
|
-> m Surface | Returns: a pointer to the newly allocated surface. The caller
owns the surface and should call This function always returns a valid pointer, but it will return a
pointer to a “nil” surface if |
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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m VulkanContext | Returns: the newly created |
Creates a new VulkanContext
for rendering on surface
.
If the creation of the VulkanContext
failed, error
will be set.
deiconify
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Word32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsMonitor b) | |
=> a |
|
-> b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m [Surface] | Returns:
list of child surfaces inside |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m (Maybe Cursor) | Returns: a |
getDecorations
surfaceGetDecorations Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m (Bool, [WMDecoration]) | Returns: |
Returns the decorations set on the GdkSurface with
surfaceSetDecorations
.
getDeviceCursor
surfaceGetDeviceCursor Source #
:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) | |
=> a |
|
-> b |
|
-> m (Maybe Cursor) | Returns: a |
getDevicePosition
surfaceGetDevicePosition Source #
:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b) | |
=> a |
|
-> b |
|
-> m (Maybe Surface, Double, Double, [ModifierType]) | Returns: The surface underneath |
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
getFocusOnMap
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m FullscreenMode | Returns: The |
Obtains the FullscreenMode
of the surface
.
getGeometry
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Int32 | Returns: The height of |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Surface | Returns: parent of |
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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool |
Returns whether input to the surface is passed through to the surface below.
See surfaceSetPassThrough
for details
getPosition
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> 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
Obtains the top-left corner of the window manager frame in root surface coordinates.
getScaleFactor
surfaceGetScaleFactor Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m [SurfaceState] | Returns: surface state bitfield |
Gets the bitwise OR of the currently active surface state flags,
from the SurfaceState
enumeration.
getSupportMultidevice
surfaceGetSupportMultidevice Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
Returns True
if the surface is aware of the existence of multiple
devices.
getSurfaceType
surfaceGetSurfaceType Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m SurfaceType | Returns: type of surface |
Gets the type of the surface. See SurfaceType
.
getToplevel
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Surface | Returns: the toplevel surface containing |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m SurfaceTypeHint | Returns: The type hint set for |
This function returns the type hint set for a surface.
getWidth
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Int32 | Returns: The width of |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
Checks whether the surface has a native surface or not.
hide
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Region |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
Check to see if a surface is destroyed..
isInputOnly
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
Determines whether or not the surface is an input only surface.
isViewable
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m Bool | Returns: |
Checks whether the surface has been mapped (with surfaceShow
or
surfaceShowUnraised
).
lower
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Rectangle |
|
-> Gravity |
|
-> Gravity |
|
-> [AnchorHints] |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Rectangle |
|
-> m Surface | Returns: the new |
Creates a new client-side child surface.
newPopup
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> Rectangle |
|
-> m Surface | Returns: the new |
Creates a new toplevel popup surface. The surface will bypass surface management.
newTemp
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> m Surface | Returns: the new |
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
:: (HasCallStack, MonadIO m, IsDisplay a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> m Surface | Returns: the new |
Creates a new toplevel surface. The surface will be managed by the surface manager.
peekChildren
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m [Surface] | Returns:
a reference to the list of child surfaces in |
Like surfaceGetChildren
, but does not copy the list of
children, so the list does not need to be freed.
queueExpose
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m () |
Registers a surface as a potential drop destination.
resize
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) | |
=> a |
|
-> Maybe b | |
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a, IsCursor b) | |
=> a |
|
-> Maybe b |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> [WMDecoration] |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsDevice b, IsCursor c) | |
=> a |
|
-> b |
|
-> c |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> FullscreenMode |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> [WMFunction] |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Geometry |
|
-> [SurfaceHints] |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a, IsTexture b) | |
=> a |
|
-> [b] |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Maybe Text |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool | |
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Double |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Maybe Region |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Text |
|
-> m () |
When using GTK, typically you should use gtk_window_set_startup_id()
instead of this low-level function.
setSupportMultidevice
surfaceSetSupportMultidevice Source #
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Bool |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> Text |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsSurface b) | |
=> a |
|
-> b |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> SurfaceTypeHint |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
:: (HasCallStack, MonadIO m, IsSurface a, IsEvent b) | |
=> a |
|
-> b |
|
-> m Bool | Returns: |
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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> m () |
Thaws a surface frozen with surfaceFreezeUpdates
.
unfullscreen
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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
:: (HasCallStack, MonadIO m, IsSurface a) | |
=> a |
|
-> 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 #
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
genClosure_SurfaceEvent :: MonadIO m => SurfaceEventCallback -> m (GClosure C_SurfaceEventCallback) Source #
Wrap the callback into a GClosure
.
mk_SurfaceEventCallback :: C_SurfaceEventCallback -> IO (FunPtr C_SurfaceEventCallback) Source #
Generate a function pointer callable from C code, from a C_SurfaceEventCallback
.
noSurfaceEventCallback :: Maybe SurfaceEventCallback Source #
A convenience synonym for
.Nothing
:: Maybe
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
wrap_SurfaceEventCallback :: SurfaceEventCallback -> C_SurfaceEventCallback Source #
Wrap a SurfaceEventCallback
into a C_SurfaceEventCallback
.
movedToRect
type C_SurfaceMovedToRectCallback = Ptr () -> Ptr () -> Ptr () -> CInt -> CInt -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type SurfaceMovedToRectCallback Source #
= Ptr () |
|
-> Ptr () |
|
-> Bool |
|
-> Bool |
|
-> 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
genClosure_SurfaceMovedToRect :: MonadIO m => SurfaceMovedToRectCallback -> m (GClosure C_SurfaceMovedToRectCallback) Source #
Wrap the callback into a GClosure
.
mk_SurfaceMovedToRectCallback :: C_SurfaceMovedToRectCallback -> IO (FunPtr C_SurfaceMovedToRectCallback) Source #
Generate a function pointer callable from C code, from a C_SurfaceMovedToRectCallback
.
noSurfaceMovedToRectCallback :: Maybe SurfaceMovedToRectCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SurfaceMovedToRectCallback
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
wrap_SurfaceMovedToRectCallback :: SurfaceMovedToRectCallback -> C_SurfaceMovedToRectCallback Source #
Wrap a SurfaceMovedToRectCallback
into a C_SurfaceMovedToRectCallback
.
render
type C_SurfaceRenderCallback = Ptr () -> Ptr Region -> Ptr () -> IO CInt Source #
Type for the callback on the (unwrapped) C side.
type SurfaceRenderCallback Source #
= Region |
|
-> IO Bool | Returns: |
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
genClosure_SurfaceRender :: MonadIO m => SurfaceRenderCallback -> m (GClosure C_SurfaceRenderCallback) Source #
Wrap the callback into a GClosure
.
mk_SurfaceRenderCallback :: C_SurfaceRenderCallback -> IO (FunPtr C_SurfaceRenderCallback) Source #
Generate a function pointer callable from C code, from a C_SurfaceRenderCallback
.
noSurfaceRenderCallback :: Maybe SurfaceRenderCallback Source #
A convenience synonym for
.Nothing
:: Maybe
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
wrap_SurfaceRenderCallback :: SurfaceRenderCallback -> C_SurfaceRenderCallback Source #
Wrap a SurfaceRenderCallback
into a C_SurfaceRenderCallback
.
sizeChanged
type C_SurfaceSizeChangedCallback = Ptr () -> Int32 -> Int32 -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type SurfaceSizeChangedCallback Source #
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
genClosure_SurfaceSizeChanged :: MonadIO m => SurfaceSizeChangedCallback -> m (GClosure C_SurfaceSizeChangedCallback) Source #
Wrap the callback into a GClosure
.
mk_SurfaceSizeChangedCallback :: C_SurfaceSizeChangedCallback -> IO (FunPtr C_SurfaceSizeChangedCallback) Source #
Generate a function pointer callable from C code, from a C_SurfaceSizeChangedCallback
.
noSurfaceSizeChangedCallback :: Maybe SurfaceSizeChangedCallback Source #
A convenience synonym for
.Nothing
:: Maybe
SurfaceSizeChangedCallback
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