[poppler] 2 commits - glib/demo

Carlos Garcia Campos carlosgc at kemper.freedesktop.org
Sat Feb 4 02:17:09 PST 2012


 glib/demo/annots.c     |    6 ++++++
 glib/demo/main.c       |    2 ++
 glib/demo/print.c      |    9 ++++++++-
 glib/demo/render.c     |   16 ++++++++++++++++
 glib/demo/selections.c |    8 ++++++++
 5 files changed, 40 insertions(+), 1 deletion(-)

New commits:
commit bc389cff91c350d7da186d4cf707c389c77bbc29
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Jan 31 14:03:08 2012 +0100

    glib-demo: Do not use deprecated gtk_dialog_set_has_separator()
    
    Bug #45439

diff --git a/glib/demo/main.c b/glib/demo/main.c
index b531bad..9e11577 100644
--- a/glib/demo/main.c
+++ b/glib/demo/main.c
@@ -180,7 +180,9 @@ pgd_demo_get_auth_dialog (GFile *uri_file)
 	action_area = gtk_dialog_get_action_area (dialog);
 
 	/* Set the dialog up with HIG properties */
+#if !GTK_CHECK_VERSION (2, 22, 0)
 	gtk_dialog_set_has_separator (dialog, FALSE);
+#endif
 	gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
 	gtk_box_set_spacing (GTK_BOX (content_area), 2); /* 2 * 5 + 2 = 12 */
 	gtk_container_set_border_width (GTK_CONTAINER (action_area), 5);
commit e52e3c24663edaa630d9187e832223b474b74089
Author: Hib Eris <hib at hiberis.nl>
Date:   Tue Jan 31 13:39:05 2012 +0100

    glib-demo: Do not use deprecated GtkComboBox API
    
    Bug #45439.

diff --git a/glib/demo/annots.c b/glib/demo/annots.c
index 9d99c34..7075028 100644
--- a/glib/demo/annots.c
+++ b/glib/demo/annots.c
@@ -666,9 +666,15 @@ pgd_annots_add_annot (GtkWidget     *button,
 
     vbox = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+    type_selector = gtk_combo_box_text_new ();
+    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (type_selector), "POPPLER_ANNOT_UNKNOWN");
+    gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (type_selector), "POPPLER_ANNOT_TEXT");
+#else
     type_selector = gtk_combo_box_new_text ();
     gtk_combo_box_append_text (GTK_COMBO_BOX (type_selector), "POPPLER_ANNOT_UNKNOWN");
     gtk_combo_box_append_text (GTK_COMBO_BOX (type_selector), "POPPLER_ANNOT_TEXT");
+#endif
     gtk_combo_box_set_active (GTK_COMBO_BOX (type_selector), 1);
     gtk_box_pack_start (GTK_BOX (vbox), type_selector, TRUE, TRUE, 0);
     gtk_widget_show (type_selector);
diff --git a/glib/demo/print.c b/glib/demo/print.c
index d1c89a9..17bbe0e 100644
--- a/glib/demo/print.c
+++ b/glib/demo/print.c
@@ -121,11 +121,18 @@ pgd_print_create_custom_widget (GtkPrintOperation *op,
         gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
         gtk_widget_show (label);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+        combo = gtk_combo_box_text_new ();
+        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document");
+        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document and markup");
+        gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "Document and stamps");
+#else
         combo = gtk_combo_box_new_text ();
-        demo->options_combo = combo;
         gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document");
         gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document and markup");
         gtk_combo_box_append_text (GTK_COMBO_BOX (combo), "Document and stamps");
+#endif
+        demo->options_combo = combo;
         gtk_combo_box_set_active (GTK_COMBO_BOX (combo), options);
         gtk_box_pack_start (GTK_BOX (hbox), combo, FALSE, FALSE, 0);
         gtk_widget_show (combo);
diff --git a/glib/demo/render.c b/glib/demo/render.c
index 1fa4761..bb7afbd 100644
--- a/glib/demo/render.c
+++ b/glib/demo/render.c
@@ -372,11 +372,19 @@ pgd_render_properties_selector_create (PgdRenderDemo *demo)
 	gtk_box_pack_start (GTK_BOX (rotate_hbox), label, TRUE, TRUE, 0);
 	gtk_widget_show (label);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+	rotate_selector = gtk_combo_box_text_new ();
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "0");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "90");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "180");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "270");
+#else
 	rotate_selector = gtk_combo_box_new_text ();
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "0");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "90");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "180");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "270");
+#endif
 	gtk_combo_box_set_active (GTK_COMBO_BOX (rotate_selector), 0);
 	g_signal_connect (G_OBJECT (rotate_selector), "changed",
 			  G_CALLBACK (pgd_render_rotate_selector_changed),
@@ -393,11 +401,19 @@ pgd_render_properties_selector_create (PgdRenderDemo *demo)
 	gtk_box_pack_start (GTK_BOX (mode_hbox), label, TRUE, TRUE, 0);
 	gtk_widget_show (label);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+	mode_selector = gtk_combo_box_text_new ();
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (mode_selector), "cairo");
+#ifdef POPPLER_WITH_GDK
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (mode_selector), "pixbuf");
+#endif
+#else // ! GTK_CHECK_VERSION (2, 24, 0)
 	mode_selector = gtk_combo_box_new_text ();
 	gtk_combo_box_append_text (GTK_COMBO_BOX (mode_selector), "cairo");
 #ifdef POPPLER_WITH_GDK
 	gtk_combo_box_append_text (GTK_COMBO_BOX (mode_selector), "pixbuf");
 #endif
+#endif // GTK_CHECK_VERSION (2, 24, 0)
 	gtk_combo_box_set_active (GTK_COMBO_BOX (mode_selector), 0);
 	g_signal_connect (G_OBJECT (mode_selector), "changed",
 			  G_CALLBACK (pgd_render_mode_selector_changed),
diff --git a/glib/demo/selections.c b/glib/demo/selections.c
index 27c053b..881733e 100644
--- a/glib/demo/selections.c
+++ b/glib/demo/selections.c
@@ -538,11 +538,19 @@ pgd_selections_properties_selector_create (PgdSelectionsDemo *demo)
 	gtk_box_pack_start (GTK_BOX (rotate_hbox), label, TRUE, TRUE, 0);
 	gtk_widget_show (label);
 
+#if GTK_CHECK_VERSION (2, 24, 0)
+	rotate_selector = gtk_combo_box_text_new ();
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "0");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "90");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "180");
+	gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (rotate_selector), "270");
+#else
 	rotate_selector = gtk_combo_box_new_text ();
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "0");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "90");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "180");
 	gtk_combo_box_append_text (GTK_COMBO_BOX (rotate_selector), "270");
+#endif
 	gtk_combo_box_set_active (GTK_COMBO_BOX (rotate_selector), 0);
 #if 0
 	g_signal_connect (G_OBJECT (rotate_selector), "changed",


More information about the poppler mailing list