[evince/617-get-dpi-from-gdk-monitor] libdocument: deprecate ev_document_misc_get_screen_dpi()



commit 3c184e4a9ccdbfabc38d007306a8b317b020d904
Author: Jason Crain <jason inspiresomeone us>
Date:   Tue Nov 5 12:06:14 2019 -0700

    libdocument: deprecate ev_document_misc_get_screen_dpi()
    
    The GDK screen size functions, such as gdk_screen_get_width(), are
    deprecated since GDK version 3.22 in favor of the per-monitor
    information provided through GdkMonitor. In turn, deprecate evince's
    ev_document_misc_get_screen_dpi() function in favor of
    ev_document_misc_get_widget_dpi(), which uses the GdkMonitor API.

 libdocument/ev-document-misc.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)
---
diff --git a/libdocument/ev-document-misc.c b/libdocument/ev-document-misc.c
index fb6de3ec..d0954871 100644
--- a/libdocument/ev-document-misc.c
+++ b/libdocument/ev-document-misc.c
@@ -506,9 +506,20 @@ ev_document_misc_invert_pixbuf (GdkPixbuf *pixbuf)
        }
 }
 
+/**
+ * ev_document_misc_get_screen_dpi:
+ * @screen: a #GtkScreen
+ *
+ * Returns: The DPI of @screen, or 96 if the DPI is not available
+ *
+ * Deprecated: 3.36: This uses a deprecated GDK API. Use
+ * ev_document_misc_get_widget_dpi() instead, which uses GDK's per-monitor
+ * information.
+ */
 gdouble
 ev_document_misc_get_screen_dpi (GdkScreen *screen)
 {
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
        gdouble dp, di;
 
        /*diagonal in pixels*/
@@ -522,6 +533,7 @@ ev_document_misc_get_screen_dpi (GdkScreen *screen)
                return 96;
 
        return (dp / di);
+G_GNUC_END_IGNORE_DEPRECATIONS
 }
 
 /**


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]