Drop gdk_pango_context_get_for_screen
authorMatthias Clasen <mclasen@redhat.com>
Tue, 31 Oct 2017 01:29:48 +0000 (21:29 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 31 Oct 2017 01:29:48 +0000 (21:29 -0400)
GdkScreen is going away, and this api is unused in gtk.

docs/reference/gdk/gdk4-sections.txt
gdk/gdkpango.c
gdk/gdkpango.h

index 1e06d87ba9a22428acc16705507c3ad28dada676..089fe3162e4e9144f71d375bb24bb0373e9520bc 100644 (file)
@@ -498,7 +498,6 @@ GDK_TYPE_PROP_MODE
 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>
 
index 9c431c66923be8543839e037c19b4ac9bb55d568..83d107244336650debe7985e67f29e3b97b85c5a 100644 (file)
@@ -40,7 +40,7 @@
  * and requires getting a handle to a #PangoContext. For GTK+ programs,
  * you’ll usually want to use gtk_widget_get_pango_context(), or
  * gtk_widget_create_pango_layout(), rather than using the lowlevel
- * gdk_pango_context_get_for_screen(). Once you have a #PangoLayout, you
+ * gdk_pango_context_get_for_display(). Once you have a #PangoLayout, you
  * can set the text and attributes of it with Pango functions like
  * pango_layout_set_text() and get its size with pango_layout_get_size().
  * (Note that Pango uses a fixed point system internally, so converting
@@ -79,7 +79,7 @@
  *                  cairo_scale (cr, radius / RADIUS, radius / RADIUS);
  *
  * // Create a PangoLayout, set the font and text
- * context = gdk_pango_context_get_for_screen (screen);
+ * context = gdk_pango_context_get_for_display (display);
  * layout = pango_layout_new (context);
  * pango_layout_set_text (layout, "Text", -1);
  * desc = pango_font_description_from_string (FONT);
@@ -323,46 +323,6 @@ gdk_pango_context_get (void)
   return gdk_pango_context_get_for_display (gdk_display_get_default ());
 }
 
-/**
- * gdk_pango_context_get_for_screen:
- * @screen: the #GdkScreen for which the context is to be created.
- * 
- * Creates a #PangoContext for @screen.
- *
- * The context must be freed when you’re finished with it.
- * 
- * When using GTK+, normally you should use gtk_widget_get_pango_context()
- * instead of this function, to get the appropriate context for
- * the widget you intend to render text onto.
- * 
- * The newly created context will have the default font options
- * (see #cairo_font_options_t) for the screen; if these options
- * change it will not be updated. Using gtk_widget_get_pango_context()
- * is more convenient if you want to keep a context around and track
- * changes to the screen’s font rendering settings.
- * 
- * Returns: (transfer full): a new #PangoContext for @screen
- *
- * Since: 2.2
- **/
-PangoContext *
-gdk_pango_context_get_for_screen (GdkScreen *screen)
-{
-  PangoFontMap *fontmap;
-  PangoContext *context;
-  double dpi;
-
-  g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
-
-  fontmap = pango_cairo_font_map_get_default ();
-  context = pango_font_map_create_context (fontmap);
-
-  dpi = gdk_screen_get_resolution (screen);
-  pango_cairo_context_set_resolution (context, dpi);
-
-  return context;
-}
-
 /**
  * gdk_pango_context_get_for_display:
  * @display: the #GdkDisplay for which the context is to be created
@@ -388,7 +348,17 @@ gdk_pango_context_get_for_screen (GdkScreen *screen)
 PangoContext *
 gdk_pango_context_get_for_display (GdkDisplay *display)
 {
+  PangoFontMap *fontmap;
+  PangoContext *context;
+  double dpi;
+
   g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
 
-  return gdk_pango_context_get_for_screen (gdk_display_get_default_screen (display));
+  fontmap = pango_cairo_font_map_get_default ();
+  context = pango_font_map_create_context (fontmap);
+
+  dpi = gdk_screen_get_resolution (gdk_display_get_default_screen (display));
+  pango_cairo_context_set_resolution (context, dpi);
+
+  return context;
 }
index 01bdc687cb4918d8d929732c1b836b466d371867..899cd4d59e1215876858f538ece1c010818da774 100644 (file)
 
 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