Class Attribute
- All Implemented Interfaces:
Proxy
PangoAttribute structure represents the common portions of all
attributes.
Particular types of attributes include this structure as their initial
portion. The common portion of the attribute holds the range to which
the value in the type-specific part of the attribute applies and should
be initialized using init(org.gnome.pango.AttrClass). By default, an attribute
will have an all-inclusive range of [0,G_MAXUINT].
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new Attribute.Allocate a new Attribute.Attribute(MemorySegment address) Create a Attribute proxy instance for the provided memory address.Allocate a new Attribute with the fields set to the provided values.Allocate a new Attribute with the fields set to the provided values. -
Method Summary
Modifier and TypeMethodDescription@Nullable AttrColorasColor()Returns the attribute cast toPangoAttrColor.@Nullable AttrFloatasFloat()Returns the attribute cast toPangoAttrFloat.@Nullable AttrFontDescReturns the attribute cast toPangoAttrFontDesc.@Nullable AttrFontFeaturesReturns the attribute cast toPangoAttrFontFeatures.@Nullable AttrIntasInt()Returns the attribute cast toPangoAttrInt.@Nullable AttrLanguageReturns the attribute cast toPangoAttrLanguage.@Nullable AttrShapeasShape()Returns the attribute cast toPangoAttrShape.@Nullable AttrSizeasSize()Returns the attribute cast toPangoAttrSize.@Nullable AttrStringasString()Returns the attribute cast toPangoAttrString.copy()Make a copy of an attribute.voiddestroy()Destroy aPangoAttributeand free all associated memory.booleanCompare two attributes for equality.static MemoryLayoutThe memory layout of the native struct.static @Nullable TypegetType()Get the GType of the Attribute classvoidInitializesattr'sklass toklass,it's start_index toPANGO_ATTR_INDEX_FROM_TEXT_BEGINNINGand end_index toPANGO_ATTR_INDEX_TO_TEXT_ENDsuch that the attribute applies to the entire text by default.intRead the value of the fieldend_index.Read the value of the fieldklass.intRead the value of the fieldstart_index.voidwriteEndIndex(int endIndex) Write a value in the fieldend_index.voidwriteKlass(AttrClass klass) Write a value in the fieldklass.voidwriteStartIndex(int startIndex) Write a value in the fieldstart_index.Methods inherited from class org.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
Attribute
Create a Attribute proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
Attribute
Allocate a new Attribute.- Parameters:
arena- to control the memory allocation scope
-
Attribute
public Attribute()Allocate a new Attribute. The memory is allocated withArena.ofAuto(). -
Attribute
Allocate a new Attribute with the fields set to the provided values.- Parameters:
klass- value for the fieldklassstartIndex- value for the fieldstartIndexendIndex- value for the fieldendIndexarena- to control the memory allocation scope
-
Attribute
Allocate a new Attribute with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
klass- value for the fieldklassstartIndex- value for the fieldstartIndexendIndex- value for the fieldendIndex
-
-
Method Details
-
getType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readKlass
Read the value of the fieldklass.- Returns:
- The value of the field
klass
-
writeKlass
Write a value in the fieldklass.- Parameters:
klass- The new value for the fieldklass
-
readStartIndex
public int readStartIndex()Read the value of the fieldstart_index.- Returns:
- The value of the field
start_index
-
writeStartIndex
public void writeStartIndex(int startIndex) Write a value in the fieldstart_index.- Parameters:
startIndex- The new value for the fieldstart_index
-
readEndIndex
public int readEndIndex()Read the value of the fieldend_index.- Returns:
- The value of the field
end_index
-
writeEndIndex
public void writeEndIndex(int endIndex) Write a value in the fieldend_index.- Parameters:
endIndex- The new value for the fieldend_index
-
asColor
Returns the attribute cast toPangoAttrColor.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrColor, ornullif it's not a color attribute - Since:
- 1.50
-
asFloat
Returns the attribute cast toPangoAttrFloat.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrFloat, ornullif it's not a floating point attribute - Since:
- 1.50
-
asFontDesc
Returns the attribute cast toPangoAttrFontDesc.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrFontDesc, ornullif it's not a font description attribute - Since:
- 1.50
-
asFontFeatures
Returns the attribute cast toPangoAttrFontFeatures.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrFontFeatures, ornullif it's not a font features attribute - Since:
- 1.50
-
asInt
Returns the attribute cast toPangoAttrInt.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrInt, ornullif it's not an integer attribute - Since:
- 1.50
-
asLanguage
Returns the attribute cast toPangoAttrLanguage.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrLanguage, ornullif it's not a language attribute - Since:
- 1.50
-
asShape
Returns the attribute cast toPangoAttrShape.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrShape, ornullif it's not a shape attribute - Since:
- 1.50
-
asSize
Returns the attribute cast toPangoAttrSize.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrSize, or NULL if it's not a size attribute - Since:
- 1.50
-
asString
Returns the attribute cast toPangoAttrString.This is mainly useful for language bindings.
- Returns:
- The attribute as
PangoAttrString, ornullif it's not a string attribute - Since:
- 1.50
-
copy
-
destroy
public void destroy()Destroy aPangoAttributeand free all associated memory. -
equal
Compare two attributes for equality.This compares only the actual value of the two attributes and not the ranges that the attributes apply to.
- Parameters:
attr2- anotherPangoAttribute- Returns:
trueif the two attributes have the same value
-
init
Initializesattr'sklass toklass,it's start_index toPANGO_ATTR_INDEX_FROM_TEXT_BEGINNINGand end_index toPANGO_ATTR_INDEX_TO_TEXT_ENDsuch that the attribute applies to the entire text by default.- Parameters:
klass- aPangoAttrClass- Since:
- 1.20
-