gi-gdk-3.0.22: Gdk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gdk.Objects.DrawingContext

Contents

Description

tDrawingContext is an object that represents the current drawing state of a tWindow.

It's possible to use a tDrawingContext to draw on a tWindow via rendering API like Cairo or OpenGL.

A tDrawingContext can only be created by calling windowBeginDrawFrame and will be valid until a call to windowEndDrawFrame.

tDrawingContext is available since GDK 3.22

Synopsis

Exported types

newtype DrawingContext Source #

Memory-managed wrapper type.

Constructors

DrawingContext (ManagedPtr DrawingContext) 
Instances
Eq DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

GObject DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

Methods

gobjectType :: IO GType

IsGValue DrawingContext Source #

Convert DrawingContext to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gdk.Objects.DrawingContext

Methods

toGValue :: DrawingContext -> IO GValue

fromGValue :: GValue -> IO DrawingContext

HasParentTypes DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

type ParentTypes DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

type ParentTypes DrawingContext = Object ': ([] :: [Type])

class (GObject o, IsDescendantOf DrawingContext o) => IsDrawingContext o Source #

Type class for types which can be safely cast to DrawingContext, for instance with toDrawingContext.

Instances
(GObject o, IsDescendantOf DrawingContext o) => IsDrawingContext o Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

toDrawingContext :: (MonadIO m, IsDrawingContext o) => o -> m DrawingContext Source #

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

noDrawingContext :: Maybe DrawingContext Source #

A convenience alias for Nothing :: Maybe DrawingContext.

Methods

Overloaded methods

getCairoContext

drawingContextGetCairoContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsDrawingContext a) 
=> a 
-> m Context

Returns: a Cairo context to be used to draw the contents of the tWindow. The context is owned by the tDrawingContext and should not be destroyed

Retrieves a Cairo context to be used to draw on the tWindow that created the tDrawingContext.

The returned context is guaranteed to be valid as long as the tDrawingContext is valid, that is between a call to windowBeginDrawFrame and windowEndDrawFrame.

Since: 3.22

getClip

drawingContextGetClip Source #

Arguments

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

context: a tDrawingContext

-> m (Maybe Region)

Returns: a Cairo region

Retrieves a copy of the clip region used when creating the context.

Since: 3.22

getWindow

drawingContextGetWindow Source #

Arguments

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

context: a tDrawingContext

-> m Window

Returns: a tWindow

Retrieves the window that created the drawing context.

Since: 3.22

isValid

drawingContextIsValid Source #

Arguments

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

context: a tDrawingContext

-> m Bool

Returns: True if the context is valid

Checks whether the given tDrawingContext is valid.

Since: 3.22

Properties

clip

The clip region applied to the drawing context.

Since: 3.22

constructDrawingContextClip :: IsDrawingContext o => Region -> IO (GValueConstruct o) Source #

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

getDrawingContextClip :: (MonadIO m, IsDrawingContext o) => o -> m (Maybe Region) Source #

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

get drawingContext #clip

window

The tWindow that created the drawing context.

Since: 3.22

constructDrawingContextWindow :: (IsDrawingContext o, IsWindow a) => a -> IO (GValueConstruct o) Source #

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

getDrawingContextWindow :: (MonadIO m, IsDrawingContext o) => o -> m Window Source #

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

get drawingContext #window