Class MarkAttributes
- All Implemented Interfaces:
Proxy
The source mark attributes object.
GtkSourceMarkAttributes is an object specifying attributes used by
a View to visually show lines marked with Marks
of a specific category. It allows you to define a background color of a line,
an icon shown in gutter and tooltips.
The background color is used as a background of a line where a mark is placed
and it can be set with setBackground(RGBA). To check
if any custom background color was defined and what color it is, use
getBackground(RGBA).
An icon is a graphic element which is shown in the gutter of a view. An
example use is showing a red filled circle in a debugger to show that a
breakpoint was set in certain line. To get an icon that will be placed in
a gutter, first a base for it must be specified and then
renderIcon(Widget, int) must be called.
There are several ways to specify a base for an icon:
Using any of the above functions overrides the one used earlier. But note that a getter counterpart of earlier used function can still return some value, but it is just not used when rendering the proper icon.
To provide meaningful tooltips for a given mark of a category, you should
connect to MarkAttributes::query-tooltip-text or
MarkAttributes::query-tooltip-markup where the latter
takes precedence.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classMarkAttributes.Builder<B extends MarkAttributes.Builder<B>>Inner class implementing a builder pattern to construct a GObject with properties.static classstatic interfaceFunctional interface declaration of theQueryTooltipMarkupCallbackcallback.static interfaceFunctional interface declaration of theQueryTooltipTextCallbackcallback.Nested classes/interfaces inherited from class GObject
GObject.NotifyCallback, GObject.ObjectClass -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new MarkAttributes.MarkAttributes(MemorySegment address) Create a MarkAttributes instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionprotected MarkAttributesasParent()Return this instance as if it were its parent type.static MarkAttributes.Builder<? extends MarkAttributes.Builder> builder()AMarkAttributes.Builderobject constructs aMarkAttributeswith the specified properties.emitQueryTooltipMarkup(@Nullable Mark mark) Emits the "query-tooltip-markup" signal.emitQueryTooltipText(@Nullable Mark mark) Emits the "query-tooltip-text" signal.booleangetBackground(RGBA background) Stores background color inbackground.getGicon()Gets aIconto be used as a base for rendered icon.Gets a name of an icon to be used as a base for rendered icon.static MemoryLayoutThe memory layout of the native struct.Gets aPixbufto be used as a base for rendered icon.getTooltipMarkup(Mark mark) Queries for a tooltip by emitting aMarkAttributes::query-tooltip-markupsignal.getTooltipText(Mark mark) Queries for a tooltip by emitting aMarkAttributes::query-tooltip-textsignal.static @Nullable TypegetType()Get the GType of the MarkAttributes class.The code should connect to this signal to provide a tooltip for givenmark.The tooltip can contain a markup.The code should connect to this signal to provide a tooltip for givenmark.The tooltip should be just a plain text.renderIcon(Widget widget, int size) Renders an icon of given size.voidsetBackground(RGBA background) Sets background color to the one given inbackground.voidSets an icon to be used as a base for rendered icon.voidsetIconName(String iconName) Sets a name of an icon to be used as a base for rendered icon.voidSets a pixbuf to be used as a base for rendered icon.Methods inherited from class GObject
addToggleRef, addWeakPointer, bindProperty, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, connect, constructed, disconnect, dispatchPropertiesChanged, dispose, dupData, dupQdata, emit, emitNotify, finalize_, forceFloating, freezeNotify, get, getData, getProperty, getProperty, getProperty, getQdata, getv, interfaceFindProperty, interfaceInstallProperty, interfaceListProperties, isFloating, newInstance, newInstance, newv, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, removeWeakPointer, replaceData, replaceQdata, runDispose, set, setData, setDataFull, setProperty, setProperty, setProperty, setQdata, setQdataFull, setv, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref, withPropertiesMethods inherited from class TypeInstance
callParent, callParent, cast, getPrivate, readGClass, writeGClassMethods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
MarkAttributes
Create a MarkAttributes instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
MarkAttributes
public MarkAttributes()Create a new MarkAttributes.
-
-
Method Details
-
getType
Get the GType of the MarkAttributes class.- Returns:
- the GType
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
asParent
Return this instance as if it were its parent type. Comparable to the Javasuperkeyword, but ensures the parent typeclass is also used in native code. -
getBackground
Stores background color inbackground.- Parameters:
background- aGdkRGBA.- Returns:
- whether background color for this MarkAttributes was set.
-
getGicon
-
getIconName
Gets a name of an icon to be used as a base for rendered icon.
Note that the icon name can be
nullif it wasn't set earlier.- Returns:
- An icon name. The string belongs to this MarkAttributes and should not be freed.
-
getPixbuf
-
getTooltipMarkup
-
getTooltipText
-
renderIcon
Renders an icon of given size.
The base of the icon is set by the last call to one of:
sizecannot be lower than 1.- Parameters:
widget- widget of which style settings may be used.size- size of the rendered icon.- Returns:
- A
GdkPaintable. The paintable belongs to this MarkAttributes and should not be unreffed.
-
setBackground
Sets background color to the one given inbackground.- Parameters:
background- aGdkRGBA.
-
setGicon
Sets an icon to be used as a base for rendered icon.- Parameters:
gicon- aGIconto be used.
-
setIconName
Sets a name of an icon to be used as a base for rendered icon.- Parameters:
iconName- name of an icon to be used.
-
setPixbuf
Sets a pixbuf to be used as a base for rendered icon.- Parameters:
pixbuf- aGdkPixbufto be used.
-
onQueryTooltipMarkup
public SignalConnection<MarkAttributes.QueryTooltipMarkupCallback> onQueryTooltipMarkup(MarkAttributes.QueryTooltipMarkupCallback handler) The code should connect to this signal to provide a tooltip for givenmark.The tooltip can contain a markup.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitQueryTooltipMarkup
Emits the "query-tooltip-markup" signal. SeeonQueryTooltipMarkup(MarkAttributes.QueryTooltipMarkupCallback). -
onQueryTooltipText
public SignalConnection<MarkAttributes.QueryTooltipTextCallback> onQueryTooltipText(MarkAttributes.QueryTooltipTextCallback handler) The code should connect to this signal to provide a tooltip for givenmark.The tooltip should be just a plain text.- Parameters:
handler- the signal handler- Returns:
- a signal handler ID to keep track of the signal connection
- See Also:
-
emitQueryTooltipText
Emits the "query-tooltip-text" signal. SeeonQueryTooltipText(MarkAttributes.QueryTooltipTextCallback). -
builder
AMarkAttributes.Builderobject constructs aMarkAttributeswith the specified properties. Use the variousset...()methods to set properties, and finish construction withMarkAttributes.Builder.build().- Returns:
- the builder object
-