PapersView.AnnotationsContext

g GObject.GInterface GObject.GInterface PapersView.UndoHandler PapersView.UndoHandler GObject.GInterface->PapersView.UndoHandler GObject.Object GObject.Object PapersView.AnnotationsContext PapersView.AnnotationsContext GObject.Object->PapersView.AnnotationsContext PapersView.UndoHandler->PapersView.AnnotationsContext

Subclasses:

None

Methods

Inherited:

GObject.Object (37), PapersView.UndoHandler (2)

Structs:

GObject.ObjectClass (5)

class

new (model, undo_context)

add_annotation_sync (page_index, type, start, end, color, user_data)

get_annot_at_doc_point (doc_point)

get_annots_model ()

remove_annotation (annot)

set_color (color)

Virtual Methods

Inherited:

GObject.Object (7), PapersView.UndoHandler (1)

Properties

Name

Type

Flags

Short Description

document-model

PapersView.DocumentModel

w/co

The document model

undo-context

PapersView.UndoContext

w/co

The undo context

Signals

Inherited:

GObject.Object (1)

Name

Short Description

annot-added

annot-removed

annots-loaded

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class PapersView.AnnotationsContext(**kwargs)
Bases:

GObject.Object, PapersView.UndoHandler

Abstract:

No

Structure:

PapersView.AnnotationsContextClass

classmethod new(model, undo_context)
Parameters:
Return type:

PapersView.AnnotationsContext

add_annotation_sync(page_index, type, start, end, color, user_data)
Parameters:
  • page_index (int) – the index of the page where the annotation will be added

  • type (PapersDocument.AnnotationType) – the type of annotation to add

  • start (PapersDocument.Point) – point where to start creating an annotation

  • end (PapersDocument.Point) – point where to end creating the annotation. It is ignored for TEXT annotations

  • color (Gdk.RGBA) – the color to give to the annotation

  • user_data (object or None) – a pointer with auxiliary data that is annotation-dependent

Returns:

the newly created annotation

Return type:

PapersDocument.Annotation

Add an annotation based on the provided information.

New in version 48.0.

get_annot_at_doc_point(doc_point)
Parameters:

doc_point (PapersDocument.DocumentPoint) – the document point where to search for annotations

Returns:

the PapersDocument.Annotation, if to be found

Return type:

PapersDocument.Annotation or None

New in version 49.0.

get_annots_model()
Returns:

the returned Gio.ListModel. The model is owned but the PpsAnnotationsContext and shall not be modified outside of it.

Return type:

Gio.ListModel

remove_annotation(annot)
Parameters:

annot (PapersDocument.Annotation) –

set_color(color)
Parameters:

color (Gdk.RGBA) –

Signal Details

PapersView.AnnotationsContext.signals.annot_added(annotations_context, object)
Signal Name:

annot-added

Flags:

RUN_LAST

Parameters:
PapersView.AnnotationsContext.signals.annot_removed(annotations_context, object)
Signal Name:

annot-removed

Flags:

RUN_LAST

Parameters:
PapersView.AnnotationsContext.signals.annots_loaded(annotations_context)
Signal Name:

annots-loaded

Flags:

RUN_LAST

Parameters:

annotations_context (PapersView.AnnotationsContext) – The object which received the signal

Property Details

PapersView.AnnotationsContext.props.document_model
Name:

document-model

Type:

PapersView.DocumentModel

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The document model

PapersView.AnnotationsContext.props.undo_context
Name:

undo-context

Type:

PapersView.UndoContext

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The undo context