Package org.gnome.rsvg
Class Length
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.rsvg.Length
- All Implemented Interfaces:
Proxy
RsvgLength values are used in Handle.getIntrinsicDimensions(org.javagi.base.Out<java.lang.Boolean>, org.gnome.rsvg.Length, org.javagi.base.Out<java.lang.Boolean>, org.gnome.rsvg.Length, org.javagi.base.Out<java.lang.Boolean>, org.gnome.rsvg.Rectangle), 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.
-
Constructor Summary
ConstructorsConstructorDescriptionLength()Allocate a new Length.Allocate a new Length with the fields set to the provided values.Allocate a new Length with the fields set to the provided values.Allocate a new Length.Length(MemorySegment address) Create a Length proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.doubleRead the value of the fieldlength.readUnit()Read the value of the fieldunit.voidwriteLength(double length) Write a value in the fieldlength.voidWrite a value in the fieldunit.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Length
Create a Length proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Length
Allocate a new Length.- Parameters:
arena- to control the memory allocation scope
-
Length
public Length()Allocate a new Length. The memory is allocated withArena.ofAuto(). -
Length
-
Length
Allocate a new Length with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
length- value for the fieldlengthunit- value for the fieldunit
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readLength
public double readLength()Read the value of the fieldlength.- Returns:
- The value of the field
length
-
writeLength
public void writeLength(double length) Write a value in the fieldlength.- Parameters:
length- The new value for the fieldlength
-
readUnit
-
writeUnit
Write a value in the fieldunit.- Parameters:
unit- The new value for the fieldunit
-