Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
A GdkToplevel
is a freestanding toplevel surface.
The GdkToplevel
interface provides useful APIs for interacting with
the windowing system, such as controlling maximization and size of the
surface, setting icons and transient parents for dialogs.
Synopsis
- newtype Toplevel = Toplevel (ManagedPtr Toplevel)
- class (GObject o, IsDescendantOf Toplevel o) => IsToplevel o
- toToplevel :: (MonadIO m, IsToplevel o) => o -> m Toplevel
- toplevelBeginMove :: (HasCallStack, MonadIO m, IsToplevel a, IsDevice b) => a -> b -> Int32 -> Double -> Double -> Word32 -> m ()
- toplevelBeginResize :: (HasCallStack, MonadIO m, IsToplevel a, IsDevice b) => a -> SurfaceEdge -> Maybe b -> Int32 -> Double -> Double -> Word32 -> m ()
- toplevelFocus :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Word32 -> m ()
- toplevelGetState :: (HasCallStack, MonadIO m, IsToplevel a) => a -> m [ToplevelState]
- toplevelInhibitSystemShortcuts :: (HasCallStack, MonadIO m, IsToplevel a, IsEvent b) => a -> Maybe b -> m ()
- toplevelLower :: (HasCallStack, MonadIO m, IsToplevel a) => a -> m Bool
- toplevelMinimize :: (HasCallStack, MonadIO m, IsToplevel a) => a -> m Bool
- toplevelPresent :: (HasCallStack, MonadIO m, IsToplevel a) => a -> ToplevelLayout -> m ()
- toplevelRestoreSystemShortcuts :: (HasCallStack, MonadIO m, IsToplevel a) => a -> m ()
- toplevelSetDecorated :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Bool -> m ()
- toplevelSetDeletable :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Bool -> m ()
- toplevelSetIconList :: (HasCallStack, MonadIO m, IsToplevel a, IsTexture b) => a -> [b] -> m ()
- toplevelSetModal :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Bool -> m ()
- toplevelSetStartupId :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Text -> m ()
- toplevelSetTitle :: (HasCallStack, MonadIO m, IsToplevel a) => a -> Text -> m ()
- toplevelSetTransientFor :: (HasCallStack, MonadIO m, IsToplevel a, IsSurface b) => a -> b -> m ()
- toplevelShowWindowMenu :: (HasCallStack, MonadIO m, IsToplevel a, IsEvent b) => a -> b -> m Bool
- toplevelSupportsEdgeConstraints :: (HasCallStack, MonadIO m, IsToplevel a) => a -> m Bool
- toplevelTitlebarGesture :: (HasCallStack, MonadIO m, IsToplevel a) => a -> TitlebarGesture -> m Bool
- constructToplevelDecorated :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o)
- getToplevelDecorated :: (MonadIO m, IsToplevel o) => o -> m Bool
- setToplevelDecorated :: (MonadIO m, IsToplevel o) => o -> Bool -> m ()
- constructToplevelDeletable :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o)
- getToplevelDeletable :: (MonadIO m, IsToplevel o) => o -> m Bool
- setToplevelDeletable :: (MonadIO m, IsToplevel o) => o -> Bool -> m ()
- constructToplevelFullscreenMode :: (IsToplevel o, MonadIO m) => FullscreenMode -> m (GValueConstruct o)
- getToplevelFullscreenMode :: (MonadIO m, IsToplevel o) => o -> m FullscreenMode
- setToplevelFullscreenMode :: (MonadIO m, IsToplevel o) => o -> FullscreenMode -> m ()
- constructToplevelIconList :: (IsToplevel o, MonadIO m) => Ptr () -> m (GValueConstruct o)
- getToplevelIconList :: (MonadIO m, IsToplevel o) => o -> m (Ptr ())
- setToplevelIconList :: (MonadIO m, IsToplevel o) => o -> Ptr () -> m ()
- constructToplevelModal :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o)
- getToplevelModal :: (MonadIO m, IsToplevel o) => o -> m Bool
- setToplevelModal :: (MonadIO m, IsToplevel o) => o -> Bool -> m ()
- getToplevelShortcutsInhibited :: (MonadIO m, IsToplevel o) => o -> m Bool
- constructToplevelStartupId :: (IsToplevel o, MonadIO m) => Text -> m (GValueConstruct o)
- getToplevelStartupId :: (MonadIO m, IsToplevel o) => o -> m (Maybe Text)
- setToplevelStartupId :: (MonadIO m, IsToplevel o) => o -> Text -> m ()
- getToplevelState :: (MonadIO m, IsToplevel o) => o -> m [ToplevelState]
- constructToplevelTitle :: (IsToplevel o, MonadIO m) => Text -> m (GValueConstruct o)
- getToplevelTitle :: (MonadIO m, IsToplevel o) => o -> m (Maybe Text)
- setToplevelTitle :: (MonadIO m, IsToplevel o) => o -> Text -> m ()
- constructToplevelTransientFor :: (IsToplevel o, MonadIO m, IsSurface a) => a -> m (GValueConstruct o)
- getToplevelTransientFor :: (MonadIO m, IsToplevel o) => o -> m (Maybe Surface)
- setToplevelTransientFor :: (MonadIO m, IsToplevel o, IsSurface a) => o -> a -> m ()
- type ToplevelComputeSizeCallback = ToplevelSize -> IO ()
- afterToplevelComputeSize :: (IsToplevel a, MonadIO m) => a -> ((?self :: a) => ToplevelComputeSizeCallback) -> m SignalHandlerId
- onToplevelComputeSize :: (IsToplevel a, MonadIO m) => a -> ((?self :: a) => ToplevelComputeSizeCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Toplevel Source # | |
GObject Toplevel Source # | |
Defined in GI.Gdk.Interfaces.Toplevel | |
ManagedPtrNewtype Toplevel Source # | |
Defined in GI.Gdk.Interfaces.Toplevel toManagedPtr :: Toplevel -> ManagedPtr Toplevel | |
TypedObject Toplevel Source # | |
Defined in GI.Gdk.Interfaces.Toplevel | |
HasParentTypes Toplevel Source # | |
Defined in GI.Gdk.Interfaces.Toplevel | |
IsGValue (Maybe Toplevel) Source # | Convert |
Defined in GI.Gdk.Interfaces.Toplevel gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Toplevel -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Toplevel) | |
type ParentTypes Toplevel Source # | |
Defined in GI.Gdk.Interfaces.Toplevel |
class (GObject o, IsDescendantOf Toplevel o) => IsToplevel o Source #
Type class for types which can be safely cast to Toplevel
, for instance with toToplevel
.
Instances
(GObject o, IsDescendantOf Toplevel o) => IsToplevel o Source # | |
Defined in GI.Gdk.Interfaces.Toplevel |
toToplevel :: (MonadIO m, IsToplevel o) => o -> m Toplevel Source #
Methods
Click to display all available methods, including inherited ones
Methods
beep, beginMove, beginResize, bindProperty, bindPropertyFull, createCairoContext, createGlContext, createSimilarSurface, createVulkanContext, destroy, focus, forceFloating, freezeNotify, getv, hide, inhibitSystemShortcuts, isDestroyed, isFloating, lower, minimize, notify, notifyByPspec, present, queueRender, ref, refSink, requestLayout, restoreSystemShortcuts, runDispose, showWindowMenu, stealData, stealQdata, supportsEdgeConstraints, thawNotify, titlebarGesture, translateCoordinates, unref, watchClosure.
Getters
getCursor, getData, getDeviceCursor, getDevicePosition, getDisplay, getFrameClock, getHeight, getMapped, getProperty, getQdata, getScale, getScaleFactor, getState, getWidth.
Setters
setCursor, setData, setDataFull, setDecorated, setDeletable, setDeviceCursor, setIconList, setInputRegion, setModal, setOpaqueRegion, setProperty, setStartupId, setTitle, setTransientFor.
beginMove
:: (HasCallStack, MonadIO m, IsToplevel a, IsDevice b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Double |
|
-> Double |
|
-> Word32 |
|
-> m () |
Begins an interactive move operation.
You might use this function to implement draggable titlebars.
beginResize
:: (HasCallStack, MonadIO m, IsToplevel a, IsDevice b) | |
=> a |
|
-> SurfaceEdge |
|
-> Maybe b |
|
-> Int32 |
|
-> Double |
|
-> Double |
|
-> Word32 |
|
-> m () |
Begins an interactive resize operation.
You might use this function to implement a “window resize grip.”
focus
:: (HasCallStack, MonadIO m, IsToplevel 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.
getState
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> m [ToplevelState] | Returns: surface state bitfield |
Gets the bitwise or of the currently active surface state flags,
from the GdkToplevelState
enumeration.
inhibitSystemShortcuts
toplevelInhibitSystemShortcuts Source #
:: (HasCallStack, MonadIO m, IsToplevel a, IsEvent b) | |
=> a |
|
-> Maybe b |
|
-> m () |
Requests that the toplevel
inhibit the system shortcuts.
This is asking the desktop environment/windowing system to let all keyboard events reach the surface, as long as it is focused, instead of triggering system actions.
If granted, the rerouting remains active until the default shortcuts
processing is restored with toplevelRestoreSystemShortcuts
,
or the request is revoked by the desktop environment, windowing system
or the user.
A typical use case for this API is remote desktop or virtual machine viewers which need to inhibit the default system keyboard shortcuts so that the remote session or virtual host gets those instead of the local environment.
The windowing system or desktop environment may ask the user to grant or deny the request or even choose to ignore the request entirely.
The caller can be notified whenever the request is granted or revoked
by listening to the Toplevel
:shortcuts-inhibited
property.
lower
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> m Bool | Returns: |
Asks to lower the toplevel
below other windows.
The windowing system may choose to ignore the request.
minimize
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> m Bool | Returns: |
Asks to minimize the toplevel
.
The windowing system may choose to ignore the request.
present
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> ToplevelLayout |
|
-> m () |
Present toplevel
after having processed the GdkToplevelLayout
rules.
If the toplevel was previously not showing, it will be showed,
otherwise it will change layout according to layout
.
GDK may emit the Toplevel::computeSize signal to let the user of this toplevel compute the preferred size of the toplevel surface.
Presenting is asynchronous and the specified layout parameters are not guaranteed to be respected.
restoreSystemShortcuts
toplevelRestoreSystemShortcuts Source #
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> m () |
Restore default system keyboard shortcuts which were previously inhibited.
This undoes the effect of toplevelInhibitSystemShortcuts
.
setDecorated
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the toplevel to be decorated.
Setting decorated
to False
hints the desktop environment
that the surface has its own, client-side decorations and
does not need to have window decorations added.
setDeletable
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets the toplevel to be deletable.
Setting deletable
to True
hints the desktop environment
that it should offer the user a way to close the surface.
setIconList
:: (HasCallStack, MonadIO m, IsToplevel a, IsTexture b) | |
=> a |
|
-> [b] |
|
-> m () |
Sets a list of icons for the surface.
One of these will be used to represent the surface in iconic form. The icon may be shown in window lists or task bars. 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.
Note that some platforms don't support surface icons.
setModal
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> Bool | |
-> m () |
Sets the toplevel to be modal.
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 toplevelSetTransientFor
.
setStartupId
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the startup notification ID.
When using GTK, typically you should use gtk_window_set_startup_id() instead of this low-level function.
setTitle
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> Text |
|
-> m () |
Sets the title of a toplevel surface.
The title maybe be displayed in the titlebar, in lists of windows, etc.
setTransientFor
toplevelSetTransientFor Source #
:: (HasCallStack, MonadIO m, IsToplevel a, IsSurface b) | |
=> a |
|
-> b |
|
-> m () |
Sets a transient-for parent.
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.
showWindowMenu
toplevelShowWindowMenu Source #
:: (HasCallStack, MonadIO m, IsToplevel 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.
supportsEdgeConstraints
toplevelSupportsEdgeConstraints Source #
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> m Bool | Returns: |
Returns whether the desktop environment supports tiled window states.
titlebarGesture
toplevelTitlebarGesture Source #
:: (HasCallStack, MonadIO m, IsToplevel a) | |
=> a |
|
-> TitlebarGesture |
|
-> m Bool |
No description available in the introspection data.
Since: 4.4
Properties
decorated
Whether the window manager should add decorations.
constructToplevelDecorated :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “decorated
” property. This is rarely needed directly, but it is used by new
.
getToplevelDecorated :: (MonadIO m, IsToplevel o) => o -> m Bool Source #
Get the value of the “decorated
” property.
When overloading is enabled, this is equivalent to
get
toplevel #decorated
setToplevelDecorated :: (MonadIO m, IsToplevel o) => o -> Bool -> m () Source #
Set the value of the “decorated
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #decorated:=
value ]
deletable
Whether the window manager should allow to close the surface.
constructToplevelDeletable :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “deletable
” property. This is rarely needed directly, but it is used by new
.
getToplevelDeletable :: (MonadIO m, IsToplevel o) => o -> m Bool Source #
Get the value of the “deletable
” property.
When overloading is enabled, this is equivalent to
get
toplevel #deletable
setToplevelDeletable :: (MonadIO m, IsToplevel o) => o -> Bool -> m () Source #
Set the value of the “deletable
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #deletable:=
value ]
fullscreenMode
The fullscreen mode of the surface.
constructToplevelFullscreenMode :: (IsToplevel o, MonadIO m) => FullscreenMode -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “fullscreen-mode
” property. This is rarely needed directly, but it is used by new
.
getToplevelFullscreenMode :: (MonadIO m, IsToplevel o) => o -> m FullscreenMode Source #
Get the value of the “fullscreen-mode
” property.
When overloading is enabled, this is equivalent to
get
toplevel #fullscreenMode
setToplevelFullscreenMode :: (MonadIO m, IsToplevel o) => o -> FullscreenMode -> m () Source #
Set the value of the “fullscreen-mode
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #fullscreenMode:=
value ]
iconList
A list of textures to use as icon.
constructToplevelIconList :: (IsToplevel o, MonadIO m) => Ptr () -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “icon-list
” property. This is rarely needed directly, but it is used by new
.
getToplevelIconList :: (MonadIO m, IsToplevel o) => o -> m (Ptr ()) Source #
Get the value of the “icon-list
” property.
When overloading is enabled, this is equivalent to
get
toplevel #iconList
setToplevelIconList :: (MonadIO m, IsToplevel o) => o -> Ptr () -> m () Source #
Set the value of the “icon-list
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #iconList:=
value ]
modal
Whether the surface is modal.
constructToplevelModal :: (IsToplevel o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “modal
” property. This is rarely needed directly, but it is used by new
.
getToplevelModal :: (MonadIO m, IsToplevel o) => o -> m Bool Source #
Get the value of the “modal
” property.
When overloading is enabled, this is equivalent to
get
toplevel #modal
setToplevelModal :: (MonadIO m, IsToplevel o) => o -> Bool -> m () Source #
Set the value of the “modal
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #modal:=
value ]
shortcutsInhibited
Whether the surface should inhibit keyboard shortcuts.
getToplevelShortcutsInhibited :: (MonadIO m, IsToplevel o) => o -> m Bool Source #
Get the value of the “shortcuts-inhibited
” property.
When overloading is enabled, this is equivalent to
get
toplevel #shortcutsInhibited
startupId
The startup ID of the surface.
See AppLaunchContext
for more information about
startup feedback.
constructToplevelStartupId :: (IsToplevel o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “startup-id
” property. This is rarely needed directly, but it is used by new
.
getToplevelStartupId :: (MonadIO m, IsToplevel o) => o -> m (Maybe Text) Source #
Get the value of the “startup-id
” property.
When overloading is enabled, this is equivalent to
get
toplevel #startupId
setToplevelStartupId :: (MonadIO m, IsToplevel o) => o -> Text -> m () Source #
Set the value of the “startup-id
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #startupId:=
value ]
state
The state of the toplevel.
getToplevelState :: (MonadIO m, IsToplevel o) => o -> m [ToplevelState] Source #
Get the value of the “state
” property.
When overloading is enabled, this is equivalent to
get
toplevel #state
title
The title of the surface.
constructToplevelTitle :: (IsToplevel o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “title
” property. This is rarely needed directly, but it is used by new
.
getToplevelTitle :: (MonadIO m, IsToplevel o) => o -> m (Maybe Text) Source #
Get the value of the “title
” property.
When overloading is enabled, this is equivalent to
get
toplevel #title
setToplevelTitle :: (MonadIO m, IsToplevel o) => o -> Text -> m () Source #
Set the value of the “title
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #title:=
value ]
transientFor
The transient parent of the surface.
constructToplevelTransientFor :: (IsToplevel o, MonadIO m, IsSurface a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “transient-for
” property. This is rarely needed directly, but it is used by new
.
getToplevelTransientFor :: (MonadIO m, IsToplevel o) => o -> m (Maybe Surface) Source #
Get the value of the “transient-for
” property.
When overloading is enabled, this is equivalent to
get
toplevel #transientFor
setToplevelTransientFor :: (MonadIO m, IsToplevel o, IsSurface a) => o -> a -> m () Source #
Set the value of the “transient-for
” property.
When overloading is enabled, this is equivalent to
set
toplevel [ #transientFor:=
value ]
Signals
computeSize
type ToplevelComputeSizeCallback Source #
= ToplevelSize |
|
-> IO () |
Emitted when the size for the surface needs to be computed, when it is present.
This signal will normally be emitted during or after a call to
toplevelPresent
, depending on the configuration
received by the windowing system. It may also be emitted at any
other point in time, in response to the windowing system
spontaneously changing the configuration of the toplevel surface.
It is the responsibility of the toplevel user to handle this signal
and compute the desired size of the toplevel, given the information
passed via the [structgdk
.ToplevelSize] object. Failing to do so
will result in an arbitrary size being used as a result.
afterToplevelComputeSize :: (IsToplevel a, MonadIO m) => a -> ((?self :: a) => ToplevelComputeSizeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the computeSize signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
toplevel #computeSize callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onToplevelComputeSize :: (IsToplevel a, MonadIO m) => a -> ((?self :: a) => ToplevelComputeSizeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the computeSize signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
toplevel #computeSize callback