Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
RsvgLength
values are used in handleGetIntrinsicDimensions
, for
example, to return the CSS length values of the width
and
height
attributes of an <svg>
element.
This is equivalent to CSS lengths.
It is up to the calling application to convert lengths in non-pixel units
(i.e. those where the unit
field is not RSVG_UNIT_PX
) into something
meaningful to the application. For example, if your application knows the
dots-per-inch (DPI) it is using, it can convert lengths with unit
in
RSVG_UNIT_IN
or other physical units.
Synopsis
- newtype Length = Length (ManagedPtr Length)
- newZeroLength :: MonadIO m => m Length
- getLengthLength :: MonadIO m => Length -> m Double
- setLengthLength :: MonadIO m => Length -> Double -> m ()
- getLengthUnit :: MonadIO m => Length -> m Unit
- setLengthUnit :: MonadIO m => Length -> Unit -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Length Source # | |
BoxedPtr Length Source # | |
Defined in GI.Rsvg.Structs.Length boxedPtrCopy :: Length -> IO Length boxedPtrFree :: Length -> IO () | |
CallocPtr Length Source # | |
Defined in GI.Rsvg.Structs.Length boxedPtrCalloc :: IO (Ptr Length) | |
ManagedPtrNewtype Length Source # | |
Defined in GI.Rsvg.Structs.Length toManagedPtr :: Length -> ManagedPtr Length | |
tag ~ 'AttrSet => Constructible Length tag Source # | |
Methods
Properties
length
numeric part of the length
getLengthLength :: MonadIO m => Length -> m Double Source #
Get the value of the “length
” field.
When overloading is enabled, this is equivalent to
get
length #length
setLengthLength :: MonadIO m => Length -> Double -> m () Source #
Set the value of the “length
” field.
When overloading is enabled, this is equivalent to
set
length [ #length:=
value ]
unit
unit part of the length
getLengthUnit :: MonadIO m => Length -> m Unit Source #
Get the value of the “unit
” field.
When overloading is enabled, this is equivalent to
get
length #unit
setLengthUnit :: MonadIO m => Length -> Unit -> m () Source #
Set the value of the “unit
” field.
When overloading is enabled, this is equivalent to
set
length [ #unit:=
value ]