From b01d42926624d9a9d3bb1d053fc395fdb4a66aa4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 24 Jan 2025 00:03:54 +0100 Subject: [PATCH] st/theme-context: Make property setter public There's no good reason to only expose the getter of a READWRITE property. Part-of: --- src/st/st-theme-context.c | 33 +++++++++++++++++++++------------ src/st/st-theme-context.h | 2 ++ 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/src/st/st-theme-context.c b/src/st/st-theme-context.c index cf6893492..eb24212e1 100644 --- a/src/st/st-theme-context.c +++ b/src/st/st-theme-context.c @@ -99,18 +99,6 @@ static void st_theme_context_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void -st_theme_context_set_scale_factor (StThemeContext *context, - int scale_factor) -{ - if (scale_factor == context->scale_factor) - return; - - context->scale_factor = scale_factor; - g_object_notify_by_pspec (G_OBJECT (context), props[PROP_SCALE_FACTOR]); - st_theme_context_changed (context); -} - static void st_theme_context_finalize (GObject *object) @@ -578,6 +566,27 @@ st_theme_context_get_scale_factor (StThemeContext *context) return context->scale_factor; } +/** + * st_theme_context_set_scale_factor: + * @context: a #StThemeContext + * @factor: the new factor + * + * Set the new scale factor of @context. + */ +void +st_theme_context_set_scale_factor (StThemeContext *context, + int scale_factor) +{ + g_return_if_fail (ST_IS_THEME_CONTEXT (context)); + + if (scale_factor == context->scale_factor) + return; + + context->scale_factor = scale_factor; + g_object_notify_by_pspec (G_OBJECT (context), props[PROP_SCALE_FACTOR]); + st_theme_context_changed (context); +} + /** * st_theme_context_get_resolution: * @context: a #StThemeContext diff --git a/src/st/st-theme-context.h b/src/st/st-theme-context.h index d7ccdff01..69245c0c3 100644 --- a/src/st/st-theme-context.h +++ b/src/st/st-theme-context.h @@ -62,6 +62,8 @@ StThemeNode * st_theme_context_intern_node (StThemeContext StThemeNode *node); int st_theme_context_get_scale_factor (StThemeContext *context); +void st_theme_context_set_scale_factor (StThemeContext *context, + int factor); double st_theme_context_get_resolution (StThemeContext *context);