[gtk+] Add a few settings getters



commit 8e62cee0758348e0a69f99048c0c357921603268
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Apr 30 22:00:06 2016 -0400

    Add a few settings getters

 gtk/gtksettings.c        |   34 ++++++++++++++++++++++++++++++++++
 gtk/gtksettingsprivate.h |    3 +++
 2 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 6de36a8..12b76f4 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -3475,3 +3475,37 @@ gtk_settings_reset_property (GtkSettings *settings,
   priv->property_values[pspec->param_id - 1].source = GTK_SETTINGS_SOURCE_DEFAULT;
   g_object_notify_by_pspec (G_OBJECT (settings), pspec);
 }
+
+gboolean
+gtk_settings_get_enable_animations (GtkSettings *settings)
+{
+  GtkSettingsPrivate *priv = settings->priv;
+  GtkSettingsPropertyValue *svalue = &priv->property_values[PROP_ENABLE_ANIMATIONS - 1];
+
+  if (svalue->source < GTK_SETTINGS_SOURCE_XSETTING)
+    {
+      GParamSpec *pspec;
+
+      pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "gtk-enable-animations");
+      settings_update_xsetting (settings, pspec, FALSE);
+    }
+
+  return g_value_get_boolean (&svalue->value);
+}
+
+gint
+gtk_settings_get_dnd_drag_threshold (GtkSettings *settings)
+{
+  GtkSettingsPrivate *priv = settings->priv;
+  GtkSettingsPropertyValue *svalue = &priv->property_values[PROP_DND_DRAG_THRESHOLD - 1];
+
+  if (svalue->source < GTK_SETTINGS_SOURCE_XSETTING)
+    {
+      GParamSpec *pspec;
+
+      pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), "gtk-dnd-drag-threshold");
+      settings_update_xsetting (settings, pspec, FALSE);
+    }
+
+  return g_value_get_int (&svalue->value);
+}
diff --git a/gtk/gtksettingsprivate.h b/gtk/gtksettingsprivate.h
index e14ec5f..2b9e841 100644
--- a/gtk/gtksettingsprivate.h
+++ b/gtk/gtksettingsprivate.h
@@ -52,6 +52,9 @@ typedef enum
 GtkSettingsSource  _gtk_settings_get_setting_source (GtkSettings *settings,
                                                      const gchar *name);
 
+gboolean gtk_settings_get_enable_animations  (GtkSettings *settings);
+gint     gtk_settings_get_dnd_drag_threshold (GtkSettings *settings);
+
 G_END_DECLS
 
 #endif /* __GTK_SETTINGS_PRIVATE_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]