[gtk+] Drop the screen resolution api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Drop the screen resolution api
- Date: Tue, 31 Oct 2017 23:17:28 +0000 (UTC)
commit 01dfb49bbea85ff3c42190ff1aac318d82e7fff4
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Oct 31 19:12:05 2017 -0400
Drop the screen resolution api
GTK+ now uses the gtk-xft-dpi setting directly.
Note: this commit only fixes the backends that
currently provide this setting. The win32 and
Quartz backends still need to be fixed.
gdk/gdkscreen.c | 143 ---------------------------------------
gdk/gdkscreen.h | 6 --
gdk/gdkscreenprivate.h | 2 -
gdk/wayland/gdkscreen-wayland.c | 5 --
gdk/x11/xsettings-client.c | 1 -
5 files changed, 0 insertions(+), 157 deletions(-)
---
diff --git a/gdk/gdkscreen.c b/gdk/gdkscreen.c
index dae1c92..5a04bb7 100644
--- a/gdk/gdkscreen.c
+++ b/gdk/gdkscreen.c
@@ -44,21 +44,6 @@
*/
-static void gdk_screen_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec);
-static void gdk_screen_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec);
-
-enum
-{
- PROP_0,
- PROP_RESOLUTION
-};
-
enum
{
SIZE_CHANGED,
@@ -75,20 +60,6 @@ gdk_screen_class_init (GdkScreenClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
- object_class->set_property = gdk_screen_set_property;
- object_class->get_property = gdk_screen_get_property;
-
- g_object_class_install_property (object_class,
- PROP_RESOLUTION,
- g_param_spec_double ("resolution",
- P_("Font resolution"),
- P_("The resolution for fonts on the screen"),
- -1.0,
- 10000.0,
- -1.0,
- G_PARAM_READWRITE|G_PARAM_STATIC_NAME|
- G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB));
-
/**
* GdkScreen::monitors-changed:
* @screen: the object on which the signal is emitted
@@ -115,7 +86,6 @@ gdk_screen_class_init (GdkScreenClass *klass)
static void
gdk_screen_init (GdkScreen *screen)
{
- screen->resolution = -1.;
}
void
@@ -131,119 +101,6 @@ _gdk_screen_close (GdkScreen *screen)
}
/**
- * gdk_screen_set_resolution:
- * @screen: a #GdkScreen
- * @dpi: the resolution in “dots per inch”. (Physical inches aren’t actually
- * involved; the terminology is conventional.)
-
- * Sets the resolution for font handling on the screen. This is a
- * scale factor between points specified in a #PangoFontDescription
- * and cairo units. The default value is 96, meaning that a 10 point
- * font will be 13 units high. (10 * 96. / 72. = 13.3).
- *
- * Since: 2.10
- **/
-void
-gdk_screen_set_resolution (GdkScreen *screen,
- gdouble dpi)
-{
- g_return_if_fail (GDK_IS_SCREEN (screen));
-
- if (dpi < 0)
- dpi = -1.0;
-
- screen->resolution_set = TRUE;
-
- if (screen->resolution != dpi)
- {
- screen->resolution = dpi;
-
- g_object_notify (G_OBJECT (screen), "resolution");
- }
-}
-
-/* Just like gdk_screen_set_resolution(), but doesn't change
- * screen->resolution. This is us to allow us to distinguish
- * resolution changes that the backend picks up from resolution
- * changes made through the public API - perhaps using
- * g_object_set(<GtkSetting>, "gtk-xft-dpi", ...);
- */
-void
-_gdk_screen_set_resolution (GdkScreen *screen,
- gdouble dpi)
-{
- g_return_if_fail (GDK_IS_SCREEN (screen));
-
- if (dpi < 0)
- dpi = -1.0;
-
- if (screen->resolution != dpi)
- {
- screen->resolution = dpi;
-
- g_object_notify (G_OBJECT (screen), "resolution");
- }
-}
-
-/**
- * gdk_screen_get_resolution:
- * @screen: a #GdkScreen
- *
- * Gets the resolution for font handling on the screen; see
- * gdk_screen_set_resolution() for full details.
- *
- * Returns: the current resolution, or -1 if no resolution
- * has been set.
- *
- * Since: 2.10
- **/
-gdouble
-gdk_screen_get_resolution (GdkScreen *screen)
-{
- g_return_val_if_fail (GDK_IS_SCREEN (screen), -1.0);
-
- return screen->resolution;
-}
-
-static void
-gdk_screen_get_property (GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- GdkScreen *screen = GDK_SCREEN (object);
-
- switch (prop_id)
- {
- case PROP_RESOLUTION:
- g_value_set_double (value, gdk_screen_get_resolution (screen));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-static void
-gdk_screen_set_property (GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GdkScreen *screen = GDK_SCREEN (object);
-
- switch (prop_id)
- {
- case PROP_RESOLUTION:
- gdk_screen_set_resolution (screen, g_value_get_double (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
-}
-
-/**
* gdk_screen_get_display:
* @screen: a #GdkScreen
*
diff --git a/gdk/gdkscreen.h b/gdk/gdkscreen.h
index e4592ea..6c77d48 100644
--- a/gdk/gdkscreen.h
+++ b/gdk/gdkscreen.h
@@ -50,12 +50,6 @@ GList * gdk_screen_get_toplevel_windows (GdkScreen *screen);
GDK_AVAILABLE_IN_ALL
GdkScreen *gdk_screen_get_default (void);
-GDK_AVAILABLE_IN_ALL
-void gdk_screen_set_resolution (GdkScreen *screen,
- gdouble dpi);
-GDK_AVAILABLE_IN_ALL
-gdouble gdk_screen_get_resolution (GdkScreen *screen);
-
G_END_DECLS
#endif /* __GDK_SCREEN_H__ */
diff --git a/gdk/gdkscreenprivate.h b/gdk/gdkscreenprivate.h
index 9f63c41..04b7a3e 100644
--- a/gdk/gdkscreenprivate.h
+++ b/gdk/gdkscreenprivate.h
@@ -33,8 +33,6 @@ struct _GdkScreen
{
GObject parent_instance;
- gdouble resolution; /* pixels/points scale factor for fonts */
- guint resolution_set : 1; /* resolution set through public API */
guint closed : 1;
};
diff --git a/gdk/wayland/gdkscreen-wayland.c b/gdk/wayland/gdkscreen-wayland.c
index 4666c6f..3c46852 100644
--- a/gdk/wayland/gdkscreen-wayland.c
+++ b/gdk/wayland/gdkscreen-wayland.c
@@ -267,12 +267,7 @@ update_xft_settings (GdkScreen *screen)
if (screen_wayland->xft_settings.dpi != xft_settings.dpi)
{
- double dpi = xft_settings.dpi / 1024.;
-
screen_wayland->xft_settings.dpi = xft_settings.dpi;
-
- _gdk_screen_set_resolution (screen, dpi);
-
notify_setting (screen, "gtk-xft-dpi");
}
}
diff --git a/gdk/x11/xsettings-client.c b/gdk/x11/xsettings-client.c
index f73e7e4..8bb67b5 100644
--- a/gdk/x11/xsettings-client.c
+++ b/gdk/x11/xsettings-client.c
@@ -398,7 +398,6 @@ static void
read_settings (GdkX11Screen *x11_screen,
gboolean do_notify)
{
- GdkScreen *screen = GDK_SCREEN (x11_screen);
GdkDisplay *display = x11_screen->display;
Atom type;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]