GtkSource.AnnotationProvider

g GObject.Object GObject.Object GtkSource.AnnotationProvider GtkSource.AnnotationProvider GObject.Object->GtkSource.AnnotationProvider

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add_annotation (annotation)

populate_hover_async (annotation, display, cancellable, callback, *user_data)

populate_hover_finish (result)

remove_all ()

remove_annotation (annotation)

Virtual Methods

Inherited:

GObject.Object (7)

do_populate_hover_async (annotation, display, cancellable, callback, *user_data)

do_populate_hover_finish (result)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

changed

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class GtkSource.AnnotationProvider(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GtkSource.AnnotationProviderClass

It is used to provide annotations and display them on [class`View`] and also populate [class`HoverDisplay`] when the user hovers over an annotation.

You can subclass this object and implement [method`AnnotationProvider`.populate_hover_async] and [method`AnnotationProvider`.populate_hover_finish] or connect to [signal`AnnotationProvider`:py:func:::populate<GtkSource.AnnotationProvider.signals.populate>] and call [method`AnnotationProvider`.populate] or do it asynchronously.

New in version 5.18.

classmethod new()
Returns:

a new GtkSource.AnnotationProvider

Return type:

GtkSource.AnnotationProvider

Used to create a new annotation provider.

New in version 5.18.

add_annotation(annotation)
Parameters:

annotation (GtkSource.Annotation) –

Add an annotation to the provider.

New in version 5.18.

populate_hover_async(annotation, display, cancellable, callback, *user_data)
Parameters:

Used to populate the [class`HoverDisplay`] asynchronously, use [method`AnnotationProvider`.populate_hover] to do it synchronously.

New in version 5.18.

populate_hover_finish(result)
Parameters:

result (Gio.AsyncResult) –

Raises:

GLib.Error

Returns:

True if successful; otherwise False and error is set.

Return type:

bool

Finishes populating the [class`HoverDisplay`] asynchronously.

New in version 5.18.

remove_all()

Removes all annotations from the provider.

New in version 5.18.

remove_annotation(annotation)
Parameters:

annotation (GtkSource.Annotation) –

Returns:

True if the annotation was found and removed

Return type:

bool

Remove an annotation from the provider.

New in version 5.18.

do_populate_hover_async(annotation, display, cancellable, callback, *user_data) virtual
Parameters:

Used to populate the [class`HoverDisplay`] asynchronously, use [method`AnnotationProvider`.populate_hover] to do it synchronously.

New in version 5.18.

do_populate_hover_finish(result) virtual
Parameters:

result (Gio.AsyncResult) –

Returns:

True if successful; otherwise False and error is set.

Return type:

bool

Finishes populating the [class`HoverDisplay`] asynchronously.

New in version 5.18.

Signal Details

GtkSource.AnnotationProvider.signals.changed(annotation_provider)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

annotation_provider (GtkSource.AnnotationProvider) – The object which received the signal

New in version 5.18.