From f3adc600fc7f11338b5e213b5ad049ca069531e4 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Mon, 21 Jun 2010 18:01:57 +0100 Subject: [PATCH] backend: Undeprecated clutter_backend_get_resolution() Since the Settings:font-dpi property is exposed as 1024 * real_dpi in order to make the setting as neutral as possible (and allow XSETTINGS to use it natively) we need a simple API returning the DPI using a floating point value. --- clutter/clutter-backend.c | 14 +++++++++++--- clutter/clutter-backend.h | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 5e5208c..db92e5d 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -662,9 +662,17 @@ clutter_backend_set_resolution (ClutterBackend *backend, * clutter_backend_get_resolution: * @backend: a #ClutterBackend * - * Gets the resolution for font handling on the screen; see - * clutter_backend_set_resolution() for full details. - * + * Gets the resolution for font handling on the screen. + * + * The resolution is a scale factor between points specified in a + * #PangoFontDescription and cairo units. The default value is 96.0, + * meaning that a 10 point font will be 13 units + * high (10 * 96. / 72. = 13.3). + * + * Clutter will set the resolution using the current backend when + * initializing; the resolution is also stored in the + * #ClutterSettings:font-dpi property. + * * Return value: the current resolution, or -1 if no resolution * has been set. * diff --git a/clutter/clutter-backend.h b/clutter/clutter-backend.h index cae86c1..1012664 100644 --- a/clutter/clutter-backend.h +++ b/clutter/clutter-backend.h @@ -98,7 +98,6 @@ ClutterBackend *clutter_get_default_backend (void); #ifndef CLUTTER_DISABLE_DEPRECATED void clutter_backend_set_resolution (ClutterBackend *backend, gdouble dpi); -gdouble clutter_backend_get_resolution (ClutterBackend *backend); void clutter_backend_set_double_click_time (ClutterBackend *backend, guint msec); guint clutter_backend_get_double_click_time (ClutterBackend *backend); @@ -110,6 +109,8 @@ void clutter_backend_set_font_name (ClutterBa G_CONST_RETURN gchar * clutter_backend_get_font_name (ClutterBackend *backend); #endif /* CLUTTER_DISABLE_DEPRECATED */ +gdouble clutter_backend_get_resolution (ClutterBackend *backend); + void clutter_backend_set_font_options (ClutterBackend *backend, const cairo_font_options_t *options); const cairo_font_options_t *clutter_backend_get_font_options (ClutterBackend *backend); -- 2.7.4