Commit 35cc1780 authored by Enrico Lumetti's avatar Enrico Lumetti

Show how many paths are used per annotation in the properties view

parent 25e79aec
......@@ -533,6 +533,14 @@ pgd_annot_view_set_annot_text_markup (GtkWidget *table,
g_free (text);
}
static void
pgd_annot_view_set_annot_ink (GtkWidget *table, PopplerAnnotInk *annot, gint *row)
{
gchar* text = g_strdup_printf("%d", poppler_annot_ink_get_ink_list_size(annot));
pgd_table_add_property (GTK_GRID (table), "<b>InkList size:</b>", text, row);
g_free(text);
}
static void
pgd_annot_view_set_annot_free_text (GtkWidget *table,
......@@ -725,18 +733,21 @@ pgd_annot_view_set_annot (PgdAnnotsDemo *demo,
case POPPLER_ANNOT_STRIKE_OUT:
pgd_annot_view_set_annot_text_markup (table, POPPLER_ANNOT_TEXT_MARKUP (annot), &row);
break;
case POPPLER_ANNOT_INK:
pgd_annot_view_set_annot_ink (table, POPPLER_ANNOT_INK (annot), &row);
break;
case POPPLER_ANNOT_FREE_TEXT:
pgd_annot_view_set_annot_free_text (table, POPPLER_ANNOT_FREE_TEXT (annot), &row);
break;
case POPPLER_ANNOT_FILE_ATTACHMENT:
pgd_annot_view_set_annot_file_attachment (table, POPPLER_ANNOT_FILE_ATTACHMENT (annot), &row);
break;
pgd_annot_view_set_annot_file_attachment (table, POPPLER_ANNOT_FILE_ATTACHMENT (annot), &row);
break;
case POPPLER_ANNOT_MOVIE:
pgd_annot_view_set_annot_movie (table, POPPLER_ANNOT_MOVIE (annot), &row);
break;
pgd_annot_view_set_annot_movie (table, POPPLER_ANNOT_MOVIE (annot), &row);
break;
case POPPLER_ANNOT_SCREEN:
pgd_annot_view_set_annot_screen (table, POPPLER_ANNOT_SCREEN (annot), &row);
break;
pgd_annot_view_set_annot_screen (table, POPPLER_ANNOT_SCREEN (annot), &row);
break;
default:
break;
}
......
......@@ -174,7 +174,7 @@ G_DEFINE_TYPE (PopplerAnnotScreen, poppler_annot_screen, POPPLER_TYPE_ANNOT)
G_DEFINE_TYPE (PopplerAnnotLine, poppler_annot_line, POPPLER_TYPE_ANNOT_MARKUP)
G_DEFINE_TYPE (PopplerAnnotCircle, poppler_annot_circle, POPPLER_TYPE_ANNOT_MARKUP)
G_DEFINE_TYPE (PopplerAnnotSquare, poppler_annot_square, POPPLER_TYPE_ANNOT_MARKUP)
G_DEFINE_TYPE (PopplerAnnotInk, poppler_annot_ink, POPPLER_TYPE_ANNOT_INK)
G_DEFINE_TYPE (PopplerAnnotInk, poppler_annot_ink, POPPLER_TYPE_ANNOT_MARKUP)
static PopplerAnnot *
_poppler_create_annot (GType annot_type, Annot *annot)
......
......@@ -73,7 +73,7 @@ G_BEGIN_DECLS
#define POPPLER_ANNOT_SQUARE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_SQUARE, PopplerAnnotSquare))
#define POPPLER_IS_ANNOT_SQUARE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_SQUARE))
#define POPPLER_TYPE_ANNOT_INK (poppler_annot_square_get_type ())
#define POPPLER_TYPE_ANNOT_INK (poppler_annot_ink_get_type ())
#define POPPLER_ANNOT_INK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_ANNOT_INK, PopplerAnnotInk))
#define POPPLER_IS_ANNOT_INK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_ANNOT_INK))
......@@ -368,13 +368,13 @@ PopplerColor *poppler_annot_square_get_interior_color (
/* PopplerAnnotInk */
POPPLER_PUBLIC
GType poppler_annot_ink_get_type (void) G_GNUC_CONST;
POPPLER_PUBLIC
PopplerAnnot *poppler_annot_ink_new (PopplerDocument *doc,
PopplerRectangle *rect);
POPPLER_PUBLIC
void poppler_annot_ink_set_ink_list (PopplerAnnotInk *poppler_annot,
const GPtrArray *poppler_paths);
POPPLER_PUBLIC
gint poppler_annot_ink_get_ink_list_size (PopplerAnnotInk *poppler_annot) G_GNUC_CONST;
......
......@@ -1433,6 +1433,9 @@ poppler_page_get_annot_mapping (PopplerPage *page)
break;
case Annot::typeSquare:
mapping->annot = _poppler_annot_square_new (annot);
break;
case Annot::typeInk:
mapping->annot = _poppler_annot_ink_new (annot);
break;
case Annot::typeCircle:
mapping->annot = _poppler_annot_circle_new (annot);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment