### Class

# GtkSource AnnotationProvider

since: 5.18

#### Description [src]

    class GtkSource.AnnotationProvider : GObject.Object
    {
      /* No available fields */
    }

It is used to provide annotations and display them on `GtkSourceView` and also populate `GtkSourceHoverDisplay` when the user hovers over an annotation.

You can subclass this object and implement `gtk_source_annotation_provider_populate_hover_async()` and `gtk_source_annotation_provider_populate_hover_finish()` or connect to AnnotationProvider::populate and call AnnotationProvider.populate or do it asynchronously.

Available since: 5.18

#### Ancestors

- GObject

#### Constructors

###### gtk_source_annotation_provider_new

Used to create a new annotation provider.

since: 5.18

#### Instance methods

###### gtk_source_annotation_provider_add_annotation

Add an annotation to the provider.

since: 5.18

###### gtk_source_annotation_provider_populate_hover_async

Used to populate the `GtkSourceHoverDisplay` asynchronously, use AnnotationProvider.populate_hover to do it synchronously.

since: 5.18

###### gtk_source_annotation_provider_populate_hover_finish

Finishes populating the `GtkSourceHoverDisplay` asynchronously.

since: 5.18

###### gtk_source_annotation_provider_remove_all

Removes all annotations from the provider.

since: 5.18

###### gtk_source_annotation_provider_remove_annotation

Remove an annotation from the provider.

since: 5.18

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Signals

###### GtkSource.AnnotationProvider::changed

No description available.

since: 5.18

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct GtkSourceAnnotationProviderClass {
      GObjectClass parent_class;
      void (* populate_hover_async) (
        GtkSourceAnnotationProvider* self,
        GtkSourceAnnotation* annotation,
        GtkSourceHoverDisplay* display,
        GCancellable* cancellable,
        GAsyncReadyCallback callback,
        gpointer user_data
      );
      gboolean (* populate_hover_finish) (
        GtkSourceAnnotationProvider* self,
        GAsyncResult* result,
        GError** error
      );

    }

No description available.

###### Class members

`parent_class: GObjectClass`

  No description available.

`populate_hover_async: void (* populate_hover_async) ( GtkSourceAnnotationProvider* self, GtkSourceAnnotation* annotation, GtkSourceHoverDisplay* display, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data )`

  No description available.

`populate_hover_finish: gboolean (* populate_hover_finish) ( GtkSourceAnnotationProvider* self, GAsyncResult* result, GError** error )`

  No description available.

#### Virtual methods

###### GtkSource.AnnotationProviderClass.populate_hover_async

Used to populate the `GtkSourceHoverDisplay` asynchronously, use AnnotationProvider.populate_hover to do it synchronously.

since: 5.18

###### GtkSource.AnnotationProviderClass.populate_hover_finish

Finishes populating the `GtkSourceHoverDisplay` asynchronously.

since: 5.18