Drop gdk_pango_context_get_for_display
authorMatthias Clasen <mclasen@redhat.com>
Tue, 31 Oct 2017 22:15:50 +0000 (18:15 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Tue, 31 Oct 2017 22:15:50 +0000 (18:15 -0400)
This api does not offer much over the pango api, and
the use of the resolution here is causing layering
problems.

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

index a0e544189a033a7bd8b8fe0d69bfc933abac7196..1d82d1770eb80ddabfd9395386bec7b4240c66f6 100644 (file)
@@ -497,7 +497,6 @@ GDK_TYPE_PROP_MODE
 <FILE>pango_interaction</FILE>
 gdk_pango_layout_get_clip_region
 gdk_pango_layout_line_get_clip_region
-gdk_pango_context_get_for_display
 </SECTION>
 
 <SECTION>
index 13b20d2dbbd917aa34e584195f97bb65db97cac2..1ab905d5bd1e16112d464f9d54ec8f830cce09f8 100644 (file)
@@ -39,9 +39,8 @@
  * Creating a #PangoLayout object is the first step in rendering text,
  * 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_display(). Once you have a #PangoLayout, you
- * can set the text and attributes of it with Pango functions like
+ * gtk_widget_create_pango_layout(). 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
  * between Pango units and pixels using [PANGO_SCALE][PANGO-SCALE-CAPS]
@@ -297,43 +296,3 @@ gdk_pango_layout_get_clip_region (PangoLayout *layout,
 
   return clip_region;
 }
-
-/**
- * gdk_pango_context_get_for_display:
- * @display: the #GdkDisplay for which the context is to be created
- *
- * Creates a #PangoContext for @display.
- *
- * 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 display; 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 font rendering settings.
- *
- * Returns: (transfer full): a new #PangoContext for @display
- *
- * Since: 3.22
- */
-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);
-
-  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 99be71bf4c35e800b63d9f1f1996c0920f2b905b..2f2d0d2a2e71e26275d87964f305471fc1bdb0cd 100644 (file)
@@ -27,9 +27,6 @@
 
 G_BEGIN_DECLS
 
-GDK_AVAILABLE_IN_3_22
-PangoContext *gdk_pango_context_get_for_display (GdkDisplay *display);
-
 /* Get a clip region to draw only part of a layout or
  * line. index_ranges contains alternating range starts/stops. The
  * region is the region which contains the given ranges, i.e. if you