From 9a31150187cc227e96456efa95fc074f391334bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Germ=C3=A1n=20Poo-Caama=C3=B1o?= Date: Mon, 28 Oct 2013 22:52:22 -0700 Subject: [PATCH] glib-demo: Add Square and Circle annotations demo https://bugs.freedesktop.org/show_bug.cgi?id=70983 --- glib/demo/annots.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/glib/demo/annots.c b/glib/demo/annots.c index dfd2dda..e808fc8 100644 --- a/glib/demo/annots.c +++ b/glib/demo/annots.c @@ -847,6 +847,14 @@ pgd_annots_add_annot (PgdAnnotsDemo *demo) poppler_annot_line_set_vertices (POPPLER_ANNOT_LINE (annot), &start, &end); break; + case POPPLER_ANNOT_SQUARE: + annot = poppler_annot_square_new (demo->doc, &rect); + poppler_annot_set_border_width (annot, 1.5); + break; + case POPPLER_ANNOT_CIRCLE: + annot = poppler_annot_circle_new (demo->doc, &rect); + poppler_annot_set_border_width (annot, 1.5); + break; default: g_assert_not_reached (); } @@ -1119,6 +1127,19 @@ pgd_annots_create_widget (PopplerDocument *document) SELECTED_TYPE_COLUMN, POPPLER_ANNOT_LINE, SELECTED_LABEL_COLUMN, "Line", -1); + + gtk_list_store_append (model, &iter); + gtk_list_store_set (model, &iter, + SELECTED_TYPE_COLUMN, POPPLER_ANNOT_SQUARE, + SELECTED_LABEL_COLUMN, "Square", + -1); + + gtk_list_store_append (model, &iter); + gtk_list_store_set (model, &iter, + SELECTED_TYPE_COLUMN, POPPLER_ANNOT_CIRCLE, + SELECTED_LABEL_COLUMN, "Circle", + -1); + demo->type_selector = gtk_combo_box_new_with_model (GTK_TREE_MODEL (model)); g_object_unref (model); -- 1.7.9.5