gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Interfaces.Native

Contents

- Exported types
- Methods
  - getForSurface
  - getRenderer
  - getSurface
  - getSurfaceTransform
  - realize
  - unrealize

Description

An interface for widgets that have their own `Surface`.

The obvious example of a `GtkNative` is `GtkWindow`.

Every widget that is not itself a `GtkNative` is contained in one, and you can get it with `widgetGetNative`.

To get the surface of a `GtkNative`, use `nativeGetSurface`. It is also possible to find the `GtkNative` to which a surface belongs, with `nativeGetForSurface`.

In addition to a `Surface`, a `GtkNative` also provides a `Renderer` for rendering on that surface. To get the renderer, use `nativeGetRenderer`.

Synopsis

- newtype Native = Native (ManagedPtr Native)
- class (GObject o, IsDescendantOf Native o) => IsNative o
- toNative :: (MonadIO m, IsNative o) => o -> m Native
- nativeGetForSurface :: (HasCallStack, MonadIO m, IsSurface a) => a -> m (Maybe Native)
- nativeGetRenderer :: (HasCallStack, MonadIO m, IsNative a) => a -> m (Maybe Renderer)
- nativeGetSurface :: (HasCallStack, MonadIO m, IsNative a) => a -> m (Maybe Surface)
- nativeGetSurfaceTransform :: (HasCallStack, MonadIO m, IsNative a) => a -> m (Double, Double)
- nativeRealize :: (HasCallStack, MonadIO m, IsNative a) => a -> m ()
- nativeUnrealize :: (HasCallStack, MonadIO m, IsNative a) => a -> m ()

# Exported types

newtype Native Source #

Memory-managed wrapper type.

Constructors

Native (ManagedPtr Native) |

#### Instances

Instances details

Eq Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native Methods (==) :: Native -> Native -> Bool Source # (/=) :: Native -> Native -> Bool Source #
GObject Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native
ManagedPtrNewtype Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native Methods toManagedPtr :: Native -> ManagedPtr Native Source #
TypedObject Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native Methods glibType :: IO GType Source #
HasParentTypes Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native
IsGValue (Maybe Native) Source # | Convert `Native` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Interfaces.Native Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Native -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Native) Source #
type ParentTypes Native Source # |
Instance details Defined in GI.Gtk.Interfaces.Native type ParentTypes Native = '[Widget, Object]

class (GObject o, IsDescendantOf Native o) => IsNative o Source #

Type class for types which can be safely cast to `Native`, for instance with `toNative`.

#### Instances

Instances details

(GObject o, IsDescendantOf Native o) => IsNative o Source # |
Instance details Defined in GI.Gtk.Interfaces.Native

toNative :: (MonadIO m, IsNative o) => o -> m Native Source #

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

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## getForSurface

nativeGetForSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsSurface a) |
=> a | `surface`: a `GdkSurface`
-> m (Maybe Native) | Returns: the `GtkNative` that is associated with `surface`

Finds the `GtkNative` associated with the surface.

## getRenderer

nativeGetRenderer Source #

Arguments

:: (HasCallStack, MonadIO m, IsNative a) |
=> a | `self`: a `GtkNative`
-> m (Maybe Renderer) | Returns: the renderer for `self`

Returns the renderer that is used for this `GtkNative`.

## getSurface

nativeGetSurface Source #

Arguments

:: (HasCallStack, MonadIO m, IsNative a) |
=> a | `self`: a `GtkNative`
-> m (Maybe Surface) | Returns: the surface of `self`

Returns the surface of this `GtkNative`.

## getSurfaceTransform

nativeGetSurfaceTransform Source #

Arguments

:: (HasCallStack, MonadIO m, IsNative a) |
=> a | `self`: a `GtkNative`
-> m (Double, Double) |

Retrieves the surface transform of `self`.

This is the translation from `self`'s surface coordinates into `self`'s widget coordinates.

## realize

nativeRealize Source #

Arguments

:: (HasCallStack, MonadIO m, IsNative a) |
=> a | `self`: a `GtkNative`
-> m () |

Realizes a `GtkNative`.

This should only be used by subclasses.

## unrealize

nativeUnrealize Source #

Arguments

:: (HasCallStack, MonadIO m, IsNative a) |
=> a | `self`: a `GtkNative`
-> m () |

Unrealizes a `GtkNative`.

This should only be used by subclasses.