[gtk+] Add gdk_pango_context_get_for_display



commit 117c0c0aea19b97aa93e8774fd72072fe8888343
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Mar 31 21:33:03 2016 -0400

    Add gdk_pango_context_get_for_display
    
    This is the obvious 1 line equivalent of the for_screen function.

 docs/reference/gdk/gdk3-sections.txt |    1 +
 gdk/gdkpango.c                       |   10 +++++++++-
 gdk/gdkpango.h                       |    2 ++
 3 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 786a5ad..64c61b3 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -607,6 +607,7 @@ gdk_pango_layout_get_clip_region
 gdk_pango_layout_line_get_clip_region
 gdk_pango_context_get
 gdk_pango_context_get_for_screen
+gdk_pango_context_get_for_display
 </SECTION>
 
 <SECTION>
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index 66615e8..63e33c7 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -320,7 +320,7 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
 PangoContext *
 gdk_pango_context_get (void)
 {
-  return gdk_pango_context_get_for_screen (gdk_screen_get_default ());
+  return gdk_pango_context_get_for_display (gdk_display_get_default ());
 }
 
 /**
@@ -366,3 +366,11 @@ gdk_pango_context_get_for_screen (GdkScreen *screen)
 
   return context;
 }
+
+PangoContext *
+gdk_pango_context_get_for_display (GdkDisplay *display)
+{
+  g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
+
+  return gdk_pango_context_get_for_screen (gdk_display_get_default_screen (display));
+}
diff --git a/gdk/gdkpango.h b/gdk/gdkpango.h
index af2abf4..01bdc68 100644
--- a/gdk/gdkpango.h
+++ b/gdk/gdkpango.h
@@ -31,6 +31,8 @@ G_BEGIN_DECLS
 
 GDK_AVAILABLE_IN_ALL
 PangoContext *gdk_pango_context_get_for_screen (GdkScreen    *screen);
+GDK_AVAILABLE_IN_3_22
+PangoContext *gdk_pango_context_get_for_display (GdkDisplay *display);
 GDK_AVAILABLE_IN_ALL
 PangoContext *gdk_pango_context_get            (void);
 


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