gi-gdk-3.0.23: 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

Description

DrawingContext is an object that represents the current drawing state of a Window.

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

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

DrawingContext is available since GDK 3.22

Synopsis

Exported types

newtype DrawingContext Source #

Memory-managed wrapper type.

Constructors

DrawingContext (ManagedPtr DrawingContext) 

Instances

Instances details
Eq DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

GObject DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

ManagedPtrNewtype DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

TypedObject DrawingContext Source # 
Instance details

Defined in GI.Gdk.Objects.DrawingContext

Methods

glibType :: 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]

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

Instances details
(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.

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 Window. The context is owned by the DrawingContext and should not be destroyed

Retrieves a Cairo context to be used to draw on the Window that created the DrawingContext.

The returned context is guaranteed to be valid as long as the DrawingContext 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 DrawingContext

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

-> m Window

Returns: a Window

Retrieves the window that created the drawing context.

Since: 3.22

isValid

drawingContextIsValid Source #

Arguments

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

context: a DrawingContext

-> m Bool

Returns: True if the context is valid

Checks whether the given DrawingContext is valid.

Since: 3.22

Properties

clip

The clip region applied to the drawing context.

Since: 3.22

constructDrawingContextClip :: (IsDrawingContext o, MonadIO m) => Region -> m (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 Window that created the drawing context.

Since: 3.22

constructDrawingContextWindow :: (IsDrawingContext o, MonadIO m, IsWindow a) => a -> m (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