gi-gtk-3.0.36: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Structs.Gradient

Description

GtkGradient is a boxed type that represents a gradient. It is the result of parsing a [gradient expression][gtkcssprovider-gradients]. To obtain the gradient represented by a GtkGradient, it has to be resolved with gradientResolve, which replaces all symbolic color references by the colors they refer to (in a given context) and constructs a Pattern value.

It is not normally necessary to deal directly with GtkGradients, since they are mostly used behind the scenes by StyleContext and CssProvider.

Gradient is deprecated. It was used internally by GTK’s CSS engine to represent gradients. As its handling is not conforming to modern web standards, it is not used anymore. If you want to use gradients in your own code, please use Cairo directly.

Synopsis

Exported types

newtype Gradient Source #

Memory-managed wrapper type.

Constructors

Gradient (ManagedPtr Gradient) 

Instances

Instances details
Eq Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

IsGValue Gradient Source #

Convert Gradient to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Structs.Gradient

ManagedPtrNewtype Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

TypedObject Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

Methods

glibType :: IO GType #

GBoxed Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

HasParentTypes Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

type ParentTypes Gradient Source # 
Instance details

Defined in GI.Gtk.Structs.Gradient

type ParentTypes Gradient = '[] :: [Type]

Methods

Overloaded methods

addColorStop

gradientAddColorStop Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Gradient

gradient: a Gradient

-> Double

offset: offset for the color stop

-> SymbolicColor

color: color to use

-> m () 

Deprecated: (Since version 3.8)tGradient is deprecated.

Adds a stop color to gradient.

Since: 3.0

newLinear

gradientNewLinear Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Double

x0: X coordinate of the starting point

-> Double

y0: Y coordinate of the starting point

-> Double

x1: X coordinate of the end point

-> Double

y1: Y coordinate of the end point

-> m Gradient

Returns: A newly created Gradient

Deprecated: (Since version 3.8)tGradient is deprecated.

Creates a new linear gradient along the line defined by (x0, y0) and (x1, y1). Before using the gradient a number of stop colors must be added through gradientAddColorStop.

Since: 3.0

newRadial

gradientNewRadial Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Double

x0: X coordinate of the start circle

-> Double

y0: Y coordinate of the start circle

-> Double

radius0: radius of the start circle

-> Double

x1: X coordinate of the end circle

-> Double

y1: Y coordinate of the end circle

-> Double

radius1: radius of the end circle

-> m Gradient

Returns: A newly created Gradient

Deprecated: (Since version 3.8)tGradient is deprecated.

Creates a new radial gradient along the two circles defined by (x0, y0, radius0) and (x1, y1, radius1). Before using the gradient a number of stop colors must be added through gradientAddColorStop.

Since: 3.0

ref

gradientRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Gradient

gradient: a Gradient

-> m Gradient

Returns: The same gradient

Deprecated: (Since version 3.8)tGradient is deprecated.

Increases the reference count of gradient.

Since: 3.0

resolve

gradientResolve Source #

Arguments

:: (HasCallStack, MonadIO m, IsStyleProperties a) 
=> Gradient

gradient: a Gradient

-> a

props: StyleProperties to use when resolving named colors

-> m (Bool, Pattern)

Returns: True if the gradient has been resolved

Deprecated: (Since version 3.8)tGradient is deprecated.

If gradient is resolvable, resolvedGradient will be filled in with the resolved gradient as a cairo_pattern_t, and True will be returned. Generally, if gradient can’t be resolved, it is due to it being defined on top of a named color that doesn't exist in props.

Since: 3.0

resolveForContext

gradientResolveForContext :: (HasCallStack, MonadIO m, IsStyleContext a) => Gradient -> a -> m Pattern Source #

No description available in the introspection data.

toString

gradientToString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Gradient

gradient: the gradient to print

-> m Text

Returns: A string representation for gradient

Deprecated: (Since version 3.8)tGradient is deprecated.

Creates a string representation for gradient that is suitable for using in GTK CSS files.

unref

gradientUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Gradient

gradient: a Gradient

-> m () 

Deprecated: (Since version 3.8)tGradient is deprecated.

Decreases the reference count of gradient, freeing its memory if the reference count reaches 0.

Since: 3.0