gi-gdk-4.0.8: Gdk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gdk.Interfaces.Toplevel

Description

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

Exported types

newtype Toplevel Source #

Memory-managed wrapper type.

Constructors

Toplevel (ManagedPtr Toplevel) 

Instances

Instances details
Eq Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

GObject Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

ManagedPtrNewtype Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

Methods

toManagedPtr :: Toplevel -> ManagedPtr Toplevel

TypedObject Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

Methods

glibType :: IO GType

HasParentTypes Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

IsGValue (Maybe Toplevel) Source #

Convert Toplevel to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Interfaces.Toplevel

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe Toplevel -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Toplevel)

type ParentTypes Toplevel Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

type ParentTypes Toplevel = '[Object, Surface]

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

Instances details
(GObject o, IsDescendantOf Toplevel o) => IsToplevel o Source # 
Instance details

Defined in GI.Gdk.Interfaces.Toplevel

toToplevel :: (MonadIO m, IsToplevel o) => o -> m Toplevel Source #

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

Methods

beginMove

toplevelBeginMove Source #

Arguments

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

toplevel: a GdkToplevel

-> b

device: the device used for the operation

-> Int32

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

-> Double

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

-> Double

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 an interactive move operation.

You might use this function to implement draggable titlebars.

beginResize

toplevelBeginResize Source #

Arguments

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

toplevel: a GdkToplevel

-> SurfaceEdge

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

-> Maybe b

device: the device used for the operation

-> Int32

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

-> Double

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

-> Double

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 an interactive resize operation.

You might use this function to implement a “window resize grip.”

focus

toplevelFocus Source #

Arguments

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

toplevel: a GdkToplevel

-> 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.

getState

toplevelGetState Source #

Arguments

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

toplevel: a GdkToplevel

-> m [ToplevelState]

Returns: surface state bitfield

Gets the bitwise or of the currently active surface state flags, from the GdkToplevelState enumeration.

inhibitSystemShortcuts

toplevelInhibitSystemShortcuts Source #

Arguments

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

toplevel: a GdkToplevel

-> Maybe b

event: the GdkEvent that is triggering the inhibit request, or Nothing if none is available

-> 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

toplevelLower Source #

Arguments

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

toplevel: a GdkToplevel

-> m Bool

Returns: True if the surface was lowered

Asks to lower the toplevel below other windows.

The windowing system may choose to ignore the request.

minimize

toplevelMinimize Source #

Arguments

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

toplevel: a GdkToplevel

-> m Bool

Returns: True if the surface was minimized

Asks to minimize the toplevel.

The windowing system may choose to ignore the request.

present

toplevelPresent Source #

Arguments

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

toplevel: the GdkToplevel to show

-> ToplevelLayout

layout: the GdkToplevelLayout object used to layout

-> 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 #

Arguments

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

toplevel: a GdkToplevel

-> m () 

Restore default system keyboard shortcuts which were previously inhibited.

This undoes the effect of toplevelInhibitSystemShortcuts.

setDecorated

toplevelSetDecorated Source #

Arguments

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

toplevel: a GdkToplevel

-> Bool

decorated: True to request decorations

-> 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

toplevelSetDeletable Source #

Arguments

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

toplevel: a GdkToplevel

-> Bool

deletable: True to request a delete button

-> 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

toplevelSetIconList Source #

Arguments

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

toplevel: a GdkToplevel

-> [b]

surfaces: A list of textures to use as icon, of different sizes

-> 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

toplevelSetModal Source #

Arguments

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

toplevel: a GdkToplevel

-> Bool

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

-> 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

toplevelSetStartupId Source #

Arguments

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

toplevel: a GdkToplevel

-> Text

startupId: a string with startup-notification identifier

-> 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

toplevelSetTitle Source #

Arguments

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

toplevel: a GdkToplevel

-> Text

title: title of surface

-> m () 

Sets the title of a toplevel surface.

The title maybe be displayed in the titlebar, in lists of windows, etc.

setTransientFor

toplevelSetTransientFor Source #

Arguments

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

toplevel: a GdkToplevel

-> b

parent: another toplevel GdkSurface

-> 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 #

Arguments

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

toplevel: a GdkToplevel

-> 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.

supportsEdgeConstraints

toplevelSupportsEdgeConstraints Source #

Arguments

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

toplevel: a GdkToplevel

-> m Bool

Returns: True if the desktop environment supports tiled window states

Returns whether the desktop environment supports tiled window states.

titlebarGesture

toplevelTitlebarGesture Source #

Arguments

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

toplevel: a GdkToplevel

-> TitlebarGesture

gesture: a GdkTitlebarGesture

-> 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 #

Arguments

 = ToplevelSize

size: a GdkToplevelSize

-> 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