Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype Gradient = Gradient (ManagedPtr Gradient)
- gradientAddColorStop :: (HasCallStack, MonadIO m) => Gradient -> Double -> SymbolicColor -> m ()
- gradientNewLinear :: (HasCallStack, MonadIO m) => Double -> Double -> Double -> Double -> m Gradient
- gradientNewRadial :: (HasCallStack, MonadIO m) => Double -> Double -> Double -> Double -> Double -> Double -> m Gradient
- gradientRef :: (HasCallStack, MonadIO m) => Gradient -> m Gradient
- gradientResolve :: (HasCallStack, MonadIO m, IsStyleProperties a) => Gradient -> a -> m (Bool, Pattern)
- gradientResolveForContext :: (HasCallStack, MonadIO m, IsStyleContext a) => Gradient -> a -> m Pattern
- gradientToString :: (HasCallStack, MonadIO m) => Gradient -> m Text
- gradientUnref :: (HasCallStack, MonadIO m) => Gradient -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Gradient Source # | |
IsGValue Gradient Source # | Convert |
ManagedPtrNewtype Gradient Source # | |
Defined in GI.Gtk.Structs.Gradient toManagedPtr :: Gradient -> ManagedPtr Gradient # | |
TypedObject Gradient Source # | |
Defined in GI.Gtk.Structs.Gradient | |
GBoxed Gradient Source # | |
Defined in GI.Gtk.Structs.Gradient | |
HasParentTypes Gradient Source # | |
Defined in GI.Gtk.Structs.Gradient | |
type ParentTypes Gradient Source # | |
Defined in GI.Gtk.Structs.Gradient |
Methods
Overloaded methods
addColorStop
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> Double |
|
-> SymbolicColor |
|
-> m () |
newLinear
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> m Gradient | Returns: A newly created |
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
:: (HasCallStack, MonadIO m) | |
=> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> Double |
|
-> m Gradient | Returns: A newly created |
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
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> m Gradient | Returns: The same |
Deprecated: (Since version 3.8)tGradient
is deprecated.
Increases the reference count of gradient
.
Since: 3.0
resolve
:: (HasCallStack, MonadIO m, IsStyleProperties a) | |
=> Gradient |
|
-> a |
|
-> m (Bool, Pattern) | Returns: |
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
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> m Text | Returns: A string representation for |
Deprecated: (Since version 3.8)tGradient
is deprecated.
Creates a string representation for gradient
that is suitable
for using in GTK CSS files.
unref
:: (HasCallStack, MonadIO m) | |
=> 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