From 30488432ad1b721cadfe51249dba26faa89998ed Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Thu, 2 Feb 2012 15:01:01 +0100 Subject: [PATCH 8/8] glib: Add POPPLER_DISABLE_DEPRECATED guards around deprecated functions If you want to make sure that your program doesn't use any deprecated functions, you can define the preprocessor symbol POPPLER_DISABLE_DEPRECATED by using the command line option -DPOPPLER_DISABLE_DEPRECATED=1. COMMENTS FOR THE REVIEWER (please remove these when committing): The real reason for doing this is to make gtk-doc not complain about deprecated functions. I am not sure we should realy add this. It seems glib/gtk is moving away from using G_DISABLE_DEPRECATED guards, in favour of defining attributes with a new macro G_DEPRECATED. See http://git.gnome.org/browse/glib/commit/?id=03766a1a38407fbbbf8c30874e6f8d46e2b0da43 The advantage of that approach is it does not break the build when you use deprecated functions, but instead gives warnings. However, I actually like having the functionality of being able to force a build to break when using deprecated functions. And also, gtk-doc does not handle G_DEPRECATED (yet). Futhermore, the new G_DEPRECATED based functionality can co-exist with these guards, thus if we want that we can always add a G_DEPRECATED based appoach later. Conclusion: I think it is worthwile to add these guards now. --- glib/poppler-page.h | 2 ++ glib/reference/Makefile.am | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/glib/poppler-page.h b/glib/poppler-page.h index 7b36843..ead0b14 100644 --- a/glib/poppler-page.h +++ b/glib/poppler-page.h @@ -72,11 +72,13 @@ cairo_region_t *poppler_page_get_selected_region (PopplerPage *pa gdouble scale, PopplerSelectionStyle style, PopplerRectangle *selection); +#ifndef POPPLER_DISABLE_DEPRECATED GList *poppler_page_get_selection_region (PopplerPage *page, gdouble scale, PopplerSelectionStyle style, PopplerRectangle *selection); void poppler_page_selection_region_free(GList *region); +#endif /* !POPPLER_DISABLE_DEPRECATED */ GList *poppler_page_get_link_mapping (PopplerPage *page); void poppler_page_free_link_mapping (GList *list); GList *poppler_page_get_image_mapping (PopplerPage *page); diff --git a/glib/reference/Makefile.am b/glib/reference/Makefile.am index b01192d..e0c93fb 100644 --- a/glib/reference/Makefile.am +++ b/glib/reference/Makefile.am @@ -25,7 +25,7 @@ SCANGOBJ_OPTIONS= # Extra options to supply to gtkdoc-scan. # e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED" -SCAN_OPTIONS= +SCAN_OPTIONS=--deprecated-guards="POPPLER_DISABLE_DEPRECATED" # Extra options to supply to gtkdoc-mkdb. # e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml -- 1.7.7