Copyright | Will Thompson, Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
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.
- newtype Gradient = Gradient (ManagedPtr Gradient)
- noGradient :: Maybe Gradient
- data GradientAddColorStopMethodInfo
- 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
- data GradientRefMethodInfo
- gradientRef :: (HasCallStack, MonadIO m) => Gradient -> m Gradient
- data GradientResolveMethodInfo
- gradientResolve :: (HasCallStack, MonadIO m, IsStyleProperties a) => Gradient -> a -> m (Bool, Pattern)
- data GradientResolveForContextMethodInfo
- gradientResolveForContext :: (HasCallStack, MonadIO m, IsStyleContext a) => Gradient -> a -> m Pattern
- data GradientToStringMethodInfo
- gradientToString :: (HasCallStack, MonadIO m) => Gradient -> m Text
- data GradientUnrefMethodInfo
- gradientUnref :: (HasCallStack, MonadIO m) => Gradient -> m ()
Exported types
Methods
addColorStop
data GradientAddColorStopMethodInfo Source #
((~) * signature (Double -> SymbolicColor -> m ()), MonadIO m) => MethodInfo * GradientAddColorStopMethodInfo Gradient signature Source # | |
:: (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)Gradient
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)Gradient
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
data GradientRefMethodInfo Source #
((~) * signature (m Gradient), MonadIO m) => MethodInfo * GradientRefMethodInfo Gradient signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> m Gradient | Returns: The same |
Deprecated: (Since version 3.8)Gradient
is deprecated.
Increases the reference count of gradient
.
Since: 3.0
resolve
data GradientResolveMethodInfo Source #
((~) * signature (a -> m (Bool, Pattern)), MonadIO m, IsStyleProperties a) => MethodInfo * GradientResolveMethodInfo Gradient signature Source # | |
:: (HasCallStack, MonadIO m, IsStyleProperties a) | |
=> Gradient |
|
-> a |
|
-> m (Bool, Pattern) | Returns: |
Deprecated: (Since version 3.8)Gradient
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
data GradientResolveForContextMethodInfo Source #
((~) * signature (a -> m Pattern), MonadIO m, IsStyleContext a) => MethodInfo * GradientResolveForContextMethodInfo Gradient signature Source # | |
gradientResolveForContext :: (HasCallStack, MonadIO m, IsStyleContext a) => Gradient -> a -> m Pattern Source #
No description available in the introspection data.
toString
data GradientToStringMethodInfo Source #
((~) * signature (m Text), MonadIO m) => MethodInfo * GradientToStringMethodInfo Gradient signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> m Text | Returns: A string representation for |
Deprecated: (Since version 3.8)Gradient
is deprecated.
Creates a string representation for gradient
that is suitable
for using in GTK CSS files.
unref
data GradientUnrefMethodInfo Source #
((~) * signature (m ()), MonadIO m) => MethodInfo * GradientUnrefMethodInfo Gradient signature Source # | |
:: (HasCallStack, MonadIO m) | |
=> Gradient |
|
-> m () |
Deprecated: (Since version 3.8)Gradient
is deprecated.
Decreases the reference count of gradient
, freeing its memory
if the reference count reaches 0.
Since: 3.0