| File: | ctk/ctksettings.c |
| Warning: | line 2021, column 8 Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption |
Press '?' to see keyboard shortcuts
Keyboard shortcuts:
| 1 | /* CTK - The GIMP Toolkit |
| 2 | * Copyright (C) 2000 Red Hat, Inc. |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>.Free |
| 16 | */ |
| 17 | |
| 18 | |
| 19 | #include "config.h" |
| 20 | |
| 21 | #include <string.h> |
| 22 | |
| 23 | #include "ctksettings.h" |
| 24 | |
| 25 | #include "ctkmodules.h" |
| 26 | #include "ctkmodulesprivate.h" |
| 27 | #include "ctksettingsprivate.h" |
| 28 | #include "ctkintl.h" |
| 29 | #include "ctkwidget.h" |
| 30 | #include "ctkprivate.h" |
| 31 | #include "ctkcssproviderprivate.h" |
| 32 | #include "ctkstyleproviderprivate.h" |
| 33 | #include "ctktypebuiltins.h" |
| 34 | #include "ctkversion.h" |
| 35 | #include "ctkscrolledwindow.h" |
| 36 | |
| 37 | #ifdef CDK_WINDOWING_X11 |
| 38 | #include "x11/cdkx.h" |
| 39 | #include <pango/pangofc-fontmap.h> |
| 40 | #endif |
| 41 | |
| 42 | #ifdef CDK_WINDOWING_WAYLAND |
| 43 | #include "wayland/cdkwayland.h" |
| 44 | #include <pango/pangofc-fontmap.h> |
| 45 | #endif |
| 46 | |
| 47 | #ifdef CDK_WINDOWING_BROADWAY |
| 48 | #include "broadway/cdkbroadway.h" |
| 49 | #endif |
| 50 | |
| 51 | #ifdef CDK_WINDOWING_QUARTZ |
| 52 | #include "quartz/cdkquartz.h" |
| 53 | #endif |
| 54 | |
| 55 | #ifdef CDK_WINDOWING_WIN32 |
| 56 | #include "win32/cdkwin32.h" |
| 57 | #endif |
| 58 | |
| 59 | #include "ctkrc.h" |
| 60 | |
| 61 | #ifdef CDK_WINDOWING_QUARTZ |
| 62 | #define PRINT_PREVIEW_COMMAND"evince --unlink-tempfile --preview --print-settings %s %f" "open -b com.apple.Preview %f" |
| 63 | #else |
| 64 | #define PRINT_PREVIEW_COMMAND"evince --unlink-tempfile --preview --print-settings %s %f" "evince --unlink-tempfile --preview --print-settings %s %f" |
| 65 | #endif |
| 66 | |
| 67 | /** |
| 68 | * SECTION:ctksettings |
| 69 | * @Short_description: Sharing settings between applications |
| 70 | * @Title: Settings |
| 71 | * |
| 72 | * CtkSettings provide a mechanism to share global settings between |
| 73 | * applications. |
| 74 | * |
| 75 | * On the X window system, this sharing is realized by an |
| 76 | * [XSettings](http://www.freedesktop.org/wiki/Specifications/xsettings-spec) |
| 77 | * manager that is usually part of the desktop environment, along with |
| 78 | * utilities that let the user change these settings. In the absence of |
| 79 | * an Xsettings manager, CTK+ reads default values for settings from |
| 80 | * `settings.ini` files in |
| 81 | * `/etc/ctk-3.0`, `$XDG_CONFIG_DIRS/ctk-3.0` |
| 82 | * and `$XDG_CONFIG_HOME/ctk-3.0`. |
| 83 | * These files must be valid key files (see #GKeyFile), and have |
| 84 | * a section called Settings. Themes can also provide default values |
| 85 | * for settings by installing a `settings.ini` file |
| 86 | * next to their `ctk.css` file. |
| 87 | * |
| 88 | * Applications can override system-wide settings by setting the property |
| 89 | * of the CtkSettings object with g_object_set(). This should be restricted |
| 90 | * to special cases though; CtkSettings are not meant as an application |
| 91 | * configuration facility. When doing so, you need to be aware that settings |
| 92 | * that are specific to individual widgets may not be available before the |
| 93 | * widget type has been realized at least once. The following example |
| 94 | * demonstrates a way to do this: |
| 95 | * |[<!-- language="C" --> |
| 96 | * ctk_init (&argc, &argv); |
| 97 | * |
| 98 | * // make sure the type is realized |
| 99 | * g_type_class_unref (g_type_class_ref (CTK_TYPE_IMAGE_MENU_ITEM)); |
| 100 | * |
| 101 | * g_object_set (ctk_settings_get_default (), "ctk-enable-animations", FALSE, NULL); |
| 102 | * ]| |
| 103 | * |
| 104 | * There is one CtkSettings instance per screen. It can be obtained with |
| 105 | * ctk_settings_get_for_screen(), but in many cases, it is more convenient |
| 106 | * to use ctk_widget_get_settings(). ctk_settings_get_default() returns the |
| 107 | * CtkSettings instance for the default screen. |
| 108 | */ |
| 109 | |
| 110 | |
| 111 | #define DEFAULT_TIMEOUT_INITIAL500 500 |
| 112 | #define DEFAULT_TIMEOUT_REPEAT50 50 |
| 113 | #define DEFAULT_TIMEOUT_EXPAND500 500 |
| 114 | |
| 115 | typedef struct _CtkSettingsPropertyValue CtkSettingsPropertyValue; |
| 116 | typedef struct _CtkSettingsValuePrivate CtkSettingsValuePrivate; |
| 117 | |
| 118 | struct _CtkSettingsPrivate |
| 119 | { |
| 120 | GData *queued_settings; /* of type CtkSettingsValue* */ |
| 121 | CtkSettingsPropertyValue *property_values; |
| 122 | CdkScreen *screen; |
| 123 | GSList *style_cascades; |
| 124 | CtkCssProvider *theme_provider; |
| 125 | CtkCssProvider *key_theme_provider; |
| 126 | gint font_size; |
| 127 | gboolean font_size_absolute; |
| 128 | gchar *font_family; |
| 129 | }; |
| 130 | |
| 131 | struct _CtkSettingsValuePrivate |
| 132 | { |
| 133 | CtkSettingsValue public; |
| 134 | CtkSettingsSource source; |
| 135 | }; |
| 136 | |
| 137 | struct _CtkSettingsPropertyValue |
| 138 | { |
| 139 | GValue value; |
| 140 | CtkSettingsSource source; |
| 141 | }; |
| 142 | |
| 143 | enum { |
| 144 | PROP_0, |
| 145 | PROP_DOUBLE_CLICK_TIME, |
| 146 | PROP_DOUBLE_CLICK_DISTANCE, |
| 147 | PROP_CURSOR_BLINK, |
| 148 | PROP_CURSOR_BLINK_TIME, |
| 149 | PROP_CURSOR_BLINK_TIMEOUT, |
| 150 | PROP_SPLIT_CURSOR, |
| 151 | PROP_CURSOR_ASPECT_RATIO, |
| 152 | PROP_THEME_NAME, |
| 153 | PROP_ICON_THEME_NAME, |
| 154 | PROP_FALLBACK_ICON_THEME, |
| 155 | PROP_KEY_THEME_NAME, |
| 156 | PROP_MENU_BAR_ACCEL, |
| 157 | PROP_DND_DRAG_THRESHOLD, |
| 158 | PROP_FONT_NAME, |
| 159 | PROP_ICON_SIZES, |
| 160 | PROP_MODULES, |
| 161 | PROP_XFT_ANTIALIAS, |
| 162 | PROP_XFT_HINTING, |
| 163 | PROP_XFT_HINTSTYLE, |
| 164 | PROP_XFT_RGBA, |
| 165 | PROP_XFT_DPI, |
| 166 | PROP_CURSOR_THEME_NAME, |
| 167 | PROP_CURSOR_THEME_SIZE, |
| 168 | PROP_ALTERNATIVE_BUTTON_ORDER, |
| 169 | PROP_ALTERNATIVE_SORT_ARROWS, |
| 170 | PROP_SHOW_INPUT_METHOD_MENU, |
| 171 | PROP_SHOW_UNICODE_MENU, |
| 172 | PROP_TIMEOUT_INITIAL, |
| 173 | PROP_TIMEOUT_REPEAT, |
| 174 | PROP_TIMEOUT_EXPAND, |
| 175 | PROP_COLOR_SCHEME, |
| 176 | PROP_ENABLE_ANIMATIONS, |
| 177 | PROP_TOUCHSCREEN_MODE, |
| 178 | PROP_TOOLTIP_TIMEOUT, |
| 179 | PROP_TOOLTIP_BROWSE_TIMEOUT, |
| 180 | PROP_TOOLTIP_BROWSE_MODE_TIMEOUT, |
| 181 | PROP_KEYNAV_CURSOR_ONLY, |
| 182 | PROP_KEYNAV_WRAP_AROUND, |
| 183 | PROP_ERROR_BELL, |
| 184 | PROP_COLOR_HASH, |
| 185 | PROP_FILE_CHOOSER_BACKEND, |
| 186 | PROP_PRINT_BACKENDS, |
| 187 | PROP_PRINT_PREVIEW_COMMAND, |
| 188 | PROP_ENABLE_MNEMONICS, |
| 189 | PROP_ENABLE_ACCELS, |
| 190 | PROP_RECENT_FILES_LIMIT, |
| 191 | PROP_IM_MODULE, |
| 192 | PROP_RECENT_FILES_MAX_AGE, |
| 193 | PROP_FONTCONFIG_TIMESTAMP, |
| 194 | PROP_SOUND_THEME_NAME, |
| 195 | PROP_ENABLE_INPUT_FEEDBACK_SOUNDS, |
| 196 | PROP_ENABLE_EVENT_SOUNDS, |
| 197 | PROP_ENABLE_TOOLTIPS, |
| 198 | PROP_TOOLBAR_STYLE, |
| 199 | PROP_TOOLBAR_ICON_SIZE, |
| 200 | PROP_AUTO_MNEMONICS, |
| 201 | PROP_PRIMARY_BUTTON_WARPS_SLIDER, |
| 202 | PROP_VISIBLE_FOCUS, |
| 203 | PROP_APPLICATION_PREFER_DARK_THEME, |
| 204 | PROP_BUTTON_IMAGES, |
| 205 | PROP_ENTRY_SELECT_ON_FOCUS, |
| 206 | PROP_ENTRY_PASSWORD_HINT_TIMEOUT, |
| 207 | PROP_MENU_IMAGES, |
| 208 | PROP_MENU_BAR_POPUP_DELAY, |
| 209 | PROP_SCROLLED_WINDOW_PLACEMENT, |
| 210 | PROP_CAN_CHANGE_ACCELS, |
| 211 | PROP_MENU_POPUP_DELAY, |
| 212 | PROP_MENU_POPDOWN_DELAY, |
| 213 | PROP_LABEL_SELECT_ON_FOCUS, |
| 214 | PROP_COLOR_PALETTE, |
| 215 | PROP_IM_PREEDIT_STYLE, |
| 216 | PROP_IM_STATUS_STYLE, |
| 217 | PROP_SHELL_SHOWS_APP_MENU, |
| 218 | PROP_SHELL_SHOWS_MENUBAR, |
| 219 | PROP_SHELL_SHOWS_DESKTOP, |
| 220 | PROP_DECORATION_LAYOUT, |
| 221 | PROP_TITLEBAR_DOUBLE_CLICK, |
| 222 | PROP_TITLEBAR_MIDDLE_CLICK, |
| 223 | PROP_TITLEBAR_RIGHT_CLICK, |
| 224 | PROP_DIALOGS_USE_HEADER, |
| 225 | PROP_ENABLE_PRIMARY_PASTE, |
| 226 | PROP_RECENT_FILES_ENABLED, |
| 227 | PROP_LONG_PRESS_TIME, |
| 228 | PROP_KEYNAV_USE_CARET, |
| 229 | PROP_OVERLAY_SCROLLING |
| 230 | }; |
| 231 | |
| 232 | /* --- prototypes --- */ |
| 233 | static void ctk_settings_provider_iface_init (CtkStyleProviderIface *iface); |
| 234 | static void ctk_settings_provider_private_init (CtkStyleProviderPrivateInterface *iface); |
| 235 | |
| 236 | static void ctk_settings_finalize (GObject *object); |
| 237 | static void ctk_settings_get_property (GObject *object, |
| 238 | guint property_id, |
| 239 | GValue *value, |
| 240 | GParamSpec *pspec); |
| 241 | static void ctk_settings_set_property (GObject *object, |
| 242 | guint property_id, |
| 243 | const GValue *value, |
| 244 | GParamSpec *pspec); |
| 245 | static void ctk_settings_notify (GObject *object, |
| 246 | GParamSpec *pspec); |
| 247 | static guint settings_install_property_parser (CtkSettingsClass *class, |
| 248 | GParamSpec *pspec, |
| 249 | CtkRcPropertyParser parser); |
| 250 | static void settings_update_double_click (CtkSettings *settings); |
| 251 | static void settings_update_modules (CtkSettings *settings); |
| 252 | |
| 253 | static void settings_update_cursor_theme (CtkSettings *settings); |
| 254 | static void settings_update_resolution (CtkSettings *settings); |
| 255 | static void settings_update_font_options (CtkSettings *settings); |
| 256 | static void settings_update_font_values (CtkSettings *settings); |
| 257 | static gboolean settings_update_fontconfig (CtkSettings *settings); |
| 258 | static void settings_update_theme (CtkSettings *settings); |
| 259 | static void settings_update_key_theme (CtkSettings *settings); |
| 260 | static gboolean settings_update_xsetting (CtkSettings *settings, |
| 261 | GParamSpec *pspec, |
| 262 | gboolean force); |
| 263 | static void settings_update_xsettings (CtkSettings *settings); |
| 264 | |
| 265 | static void ctk_settings_load_from_key_file (CtkSettings *settings, |
| 266 | const gchar *path, |
| 267 | CtkSettingsSource source); |
| 268 | static void settings_update_provider (CdkScreen *screen, |
| 269 | CtkCssProvider **old, |
| 270 | CtkCssProvider *new); |
| 271 | |
| 272 | /* the default palette for CtkColorSelelection */ |
| 273 | static const gchar default_color_palette[] = |
| 274 | "black:white:gray50:red:purple:blue:light blue:green:yellow:orange:" |
| 275 | "lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90"; |
| 276 | |
| 277 | /* --- variables --- */ |
| 278 | static GQuark quark_property_parser = 0; |
| 279 | static GQuark quark_ctk_settings = 0; |
| 280 | static GSList *object_list = NULL((void*)0); |
| 281 | static guint class_n_properties = 0; |
| 282 | |
| 283 | typedef struct { |
| 284 | CdkDisplay *display; |
| 285 | CtkSettings *settings; |
| 286 | } DisplaySettings; |
| 287 | |
| 288 | static GArray *display_settings; |
| 289 | |
| 290 | |
| 291 | G_DEFINE_TYPE_EXTENDED (CtkSettings, ctk_settings, G_TYPE_OBJECT, 0,static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; } |
| 292 | G_ADD_PRIVATE (CtkSettings)static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; } |
| 293 | G_IMPLEMENT_INTERFACE (CTK_TYPE_STYLE_PROVIDER,static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; } |
| 294 | ctk_settings_provider_iface_init)static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; } |
| 295 | G_IMPLEMENT_INTERFACE (CTK_TYPE_STYLE_PROVIDER_PRIVATE,static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; } |
| 296 | ctk_settings_provider_private_init))static void ctk_settings_init (CtkSettings *self); static void ctk_settings_class_init (CtkSettingsClass *klass); static GType ctk_settings_get_type_once (void); static gpointer ctk_settings_parent_class = ((void*)0); static gint CtkSettings_private_offset; static void ctk_settings_class_intern_init (gpointer klass) { ctk_settings_parent_class = g_type_class_peek_parent (klass); if (CtkSettings_private_offset != 0) g_type_class_adjust_private_offset (klass, &CtkSettings_private_offset ); ctk_settings_class_init ((CtkSettingsClass*) klass); } __attribute__ ((__unused__)) static inline gpointer ctk_settings_get_instance_private (CtkSettings *self) { return (((gpointer) ((guint8*) (self) + (glong) (CtkSettings_private_offset)))); } GType ctk_settings_get_type (void) { static GType static_g_define_type_id = 0; if ((__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer), "Expression evaluates to false"); (void) ( 0 ? (gpointer) * (&static_g_define_type_id) : ((void*)0)) ; (!(__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id ) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ (*(&static_g_define_type_id)) gapg_temp_newval; __typeof__ ((&static_g_define_type_id)) gapg_temp_atomic = (&static_g_define_type_id ); __atomic_load (gapg_temp_atomic, &gapg_temp_newval, 5) ; gapg_temp_newval; })) && g_once_init_enter_pointer ( &static_g_define_type_id)); })) ) { GType g_define_type_id = ctk_settings_get_type_once (); (__extension__ ({ _Static_assert (sizeof *(&static_g_define_type_id) == sizeof (gpointer) , "Expression evaluates to false"); 0 ? (void) (*(&static_g_define_type_id ) = (g_define_type_id)) : (void) 0; g_once_init_leave_pointer ((&static_g_define_type_id), (gpointer) (guintptr) (g_define_type_id )); })) ; } return static_g_define_type_id; } __attribute__ ( (__noinline__)) static GType ctk_settings_get_type_once (void ) { GType g_define_type_id = g_type_register_static_simple (( (GType) ((20) << (2))), g_intern_static_string ("CtkSettings" ), sizeof (CtkSettingsClass), (GClassInitFunc)(void (*)(void) ) ctk_settings_class_intern_init, sizeof (CtkSettings), (GInstanceInitFunc )(void (*)(void)) ctk_settings_init, (GTypeFlags) 0); { {{ CtkSettings_private_offset = g_type_add_instance_private (g_define_type_id, sizeof (CtkSettingsPrivate )); } { const GInterfaceInfo g_implement_interface_info = { ( GInterfaceInitFunc)(void (*)(void)) ctk_settings_provider_iface_init , ((void*)0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (ctk_style_provider_get_type ()), &g_implement_interface_info ); } { const GInterfaceInfo g_implement_interface_info = { (GInterfaceInitFunc )(void (*)(void)) ctk_settings_provider_private_init, ((void* )0), ((void*)0) }; g_type_add_interface_static (g_define_type_id , (_ctk_style_provider_private_get_type ()), &g_implement_interface_info ); };} } return g_define_type_id; }; |
| 297 | |
| 298 | /* --- functions --- */ |
| 299 | static void |
| 300 | ctk_settings_init (CtkSettings *settings) |
| 301 | { |
| 302 | CtkSettingsPrivate *priv; |
| 303 | GParamSpec **pspecs, **p; |
| 304 | guint i = 0; |
| 305 | gchar *path; |
| 306 | const gchar * const *config_dirs; |
| 307 | |
| 308 | priv = ctk_settings_get_instance_private (settings); |
| 309 | settings->priv = priv; |
| 310 | |
| 311 | g_datalist_init (&priv->queued_settings); |
| 312 | object_list = g_slist_prepend (object_list, settings); |
| 313 | |
| 314 | priv->style_cascades = g_slist_prepend (NULL((void*)0), _ctk_style_cascade_new ()); |
| 315 | priv->theme_provider = ctk_css_provider_new (); |
| 316 | |
| 317 | /* build up property array for all yet existing properties and queue |
| 318 | * notification for them (at least notification for internal properties |
| 319 | * will instantly be caught) |
| 320 | */ |
| 321 | pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), NULL((void*)0)); |
| 322 | for (p = pspecs; *p; p++) |
| 323 | if ((*p)->owner_type == G_OBJECT_TYPE (settings)(((((GTypeClass*) (((GTypeInstance*) (settings))->g_class) )->g_type)))) |
| 324 | i++; |
| 325 | priv->property_values = g_new0 (CtkSettingsPropertyValue, i)((CtkSettingsPropertyValue *) g_malloc0_n ((i), sizeof (CtkSettingsPropertyValue ))); |
| 326 | i = 0; |
| 327 | g_object_freeze_notify (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2))))))))); |
| 328 | |
| 329 | for (p = pspecs; *p; p++) |
| 330 | { |
| 331 | GParamSpec *pspec = *p; |
| 332 | GType value_type = G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type ); |
| 333 | |
| 334 | if (pspec->owner_type != G_OBJECT_TYPE (settings)(((((GTypeClass*) (((GTypeInstance*) (settings))->g_class) )->g_type)))) |
| 335 | continue; |
| 336 | g_value_init (&priv->property_values[i].value, value_type); |
| 337 | g_param_value_set_default (pspec, &priv->property_values[i].value); |
| 338 | |
| 339 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 340 | priv->property_values[i].source = CTK_SETTINGS_SOURCE_DEFAULT; |
| 341 | i++; |
| 342 | } |
| 343 | g_free (pspecs); |
| 344 | |
| 345 | path = g_build_filename (_ctk_get_data_prefix (), "share", "ctk-3.0", "settings.ini", NULL((void*)0)); |
| 346 | if (g_file_test (path, G_FILE_TEST_EXISTS)) |
| 347 | ctk_settings_load_from_key_file (settings, path, CTK_SETTINGS_SOURCE_DEFAULT); |
| 348 | g_free (path); |
| 349 | |
| 350 | path = g_build_filename (_ctk_get_sysconfdir (), "ctk-3.0", "settings.ini", NULL((void*)0)); |
| 351 | if (g_file_test (path, G_FILE_TEST_EXISTS)) |
| 352 | ctk_settings_load_from_key_file (settings, path, CTK_SETTINGS_SOURCE_DEFAULT); |
| 353 | g_free (path); |
| 354 | |
| 355 | config_dirs = g_get_system_config_dirs (); |
| 356 | for (i = 0; config_dirs[i] != NULL((void*)0); i++) |
| 357 | { |
| 358 | path = g_build_filename (config_dirs[i], "ctk-3.0", "settings.ini", NULL((void*)0)); |
| 359 | if (g_file_test (path, G_FILE_TEST_EXISTS)) |
| 360 | ctk_settings_load_from_key_file (settings, path, CTK_SETTINGS_SOURCE_DEFAULT); |
| 361 | g_free (path); |
| 362 | } |
| 363 | |
| 364 | path = g_build_filename (g_get_user_config_dir (), "ctk-3.0", "settings.ini", NULL((void*)0)); |
| 365 | if (g_file_test (path, G_FILE_TEST_EXISTS)) |
| 366 | ctk_settings_load_from_key_file (settings, path, CTK_SETTINGS_SOURCE_DEFAULT); |
| 367 | g_free (path); |
| 368 | |
| 369 | g_object_thaw_notify (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2))))))))); |
| 370 | |
| 371 | /* ensure that derived fields are initialized */ |
| 372 | if (priv->font_size == 0) |
| 373 | settings_update_font_values (settings); |
| 374 | } |
| 375 | |
| 376 | static void |
| 377 | ctk_settings_class_init (CtkSettingsClass *class) |
| 378 | { |
| 379 | GObjectClass *gobject_class = G_OBJECT_CLASS (class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass *) ((class)), (((GType) ((20) << (2)))))))); |
| 380 | guint result; |
| 381 | |
| 382 | gobject_class->finalize = ctk_settings_finalize; |
| 383 | gobject_class->get_property = ctk_settings_get_property; |
| 384 | gobject_class->set_property = ctk_settings_set_property; |
| 385 | gobject_class->notify = ctk_settings_notify; |
| 386 | |
| 387 | quark_property_parser = g_quark_from_static_string ("ctk-rc-property-parser"); |
| 388 | quark_ctk_settings = g_quark_from_static_string ("ctk-settings"); |
| 389 | |
| 390 | result = settings_install_property_parser (class, |
| 391 | g_param_spec_int ("ctk-double-click-time", |
| 392 | P_("Double Click Time")g_dgettext("ctk30" "-properties","Double Click Time"), |
| 393 | P_("Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)")g_dgettext("ctk30" "-properties","Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)" ), |
| 394 | 0, G_MAXINT2147483647, 400, |
| 395 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 396 | NULL((void*)0)); |
| 397 | g_assert (result == PROP_DOUBLE_CLICK_TIME)do { if (result == PROP_DOUBLE_CLICK_TIME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 397, ((const char*) (__func__)), "result == PROP_DOUBLE_CLICK_TIME" ); } while (0); |
| 398 | result = settings_install_property_parser (class, |
| 399 | g_param_spec_int ("ctk-double-click-distance", |
| 400 | P_("Double Click Distance")g_dgettext("ctk30" "-properties","Double Click Distance"), |
| 401 | P_("Maximum distance allowed between two clicks for them to be considered a double click (in pixels)")g_dgettext("ctk30" "-properties","Maximum distance allowed between two clicks for them to be considered a double click (in pixels)" ), |
| 402 | 0, G_MAXINT2147483647, 5, |
| 403 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 404 | NULL((void*)0)); |
| 405 | g_assert (result == PROP_DOUBLE_CLICK_DISTANCE)do { if (result == PROP_DOUBLE_CLICK_DISTANCE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 405, ((const char*) (__func__)), "result == PROP_DOUBLE_CLICK_DISTANCE" ); } while (0); |
| 406 | |
| 407 | /** |
| 408 | * CtkSettings:ctk-cursor-blink: |
| 409 | * |
| 410 | * Whether the cursor should blink. |
| 411 | * |
| 412 | * Also see the #CtkSettings:ctk-cursor-blink-timeout setting, |
| 413 | * which allows more flexible control over cursor blinking. |
| 414 | */ |
| 415 | result = settings_install_property_parser (class, |
| 416 | g_param_spec_boolean ("ctk-cursor-blink", |
| 417 | P_("Cursor Blink")g_dgettext("ctk30" "-properties","Cursor Blink"), |
| 418 | P_("Whether the cursor should blink")g_dgettext("ctk30" "-properties","Whether the cursor should blink" ), |
| 419 | TRUE(!(0)), |
| 420 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB ), |
| 421 | NULL((void*)0)); |
| 422 | g_assert (result == PROP_CURSOR_BLINK)do { if (result == PROP_CURSOR_BLINK) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 422, ((const char*) (__func__)), "result == PROP_CURSOR_BLINK" ); } while (0); |
| 423 | result = settings_install_property_parser (class, |
| 424 | g_param_spec_int ("ctk-cursor-blink-time", |
| 425 | P_("Cursor Blink Time")g_dgettext("ctk30" "-properties","Cursor Blink Time"), |
| 426 | P_("Length of the cursor blink cycle, in milliseconds")g_dgettext("ctk30" "-properties","Length of the cursor blink cycle, in milliseconds" ), |
| 427 | 100, G_MAXINT2147483647, 1200, |
| 428 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 429 | NULL((void*)0)); |
| 430 | g_assert (result == PROP_CURSOR_BLINK_TIME)do { if (result == PROP_CURSOR_BLINK_TIME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 430, ((const char*) (__func__)), "result == PROP_CURSOR_BLINK_TIME" ); } while (0); |
| 431 | |
| 432 | /** |
| 433 | * CtkSettings:ctk-cursor-blink-timeout: |
| 434 | * |
| 435 | * Time after which the cursor stops blinking, in seconds. |
| 436 | * The timer is reset after each user interaction. |
| 437 | * |
| 438 | * Setting this to zero has the same effect as setting |
| 439 | * #CtkSettings:ctk-cursor-blink to %FALSE. |
| 440 | * |
| 441 | * Since: 2.12 |
| 442 | */ |
| 443 | result = settings_install_property_parser (class, |
| 444 | g_param_spec_int ("ctk-cursor-blink-timeout", |
| 445 | P_("Cursor Blink Timeout")g_dgettext("ctk30" "-properties","Cursor Blink Timeout"), |
| 446 | P_("Time after which the cursor stops blinking, in seconds")g_dgettext("ctk30" "-properties","Time after which the cursor stops blinking, in seconds" ), |
| 447 | 1, G_MAXINT2147483647, 10, |
| 448 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 449 | NULL((void*)0)); |
| 450 | g_assert (result == PROP_CURSOR_BLINK_TIMEOUT)do { if (result == PROP_CURSOR_BLINK_TIMEOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 450, ((const char*) (__func__)), "result == PROP_CURSOR_BLINK_TIMEOUT" ); } while (0); |
| 451 | result = settings_install_property_parser (class, |
| 452 | g_param_spec_boolean ("ctk-split-cursor", |
| 453 | P_("Split Cursor")g_dgettext("ctk30" "-properties","Split Cursor"), |
| 454 | P_("Whether two cursors should be displayed for mixed left-to-right and right-to-left text")g_dgettext("ctk30" "-properties","Whether two cursors should be displayed for mixed left-to-right and right-to-left text" ), |
| 455 | TRUE(!(0)), |
| 456 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 457 | NULL((void*)0)); |
| 458 | g_assert (result == PROP_SPLIT_CURSOR)do { if (result == PROP_SPLIT_CURSOR) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 458, ((const char*) (__func__)), "result == PROP_SPLIT_CURSOR" ); } while (0); |
| 459 | result = settings_install_property_parser (class, |
| 460 | g_param_spec_float ("ctk-cursor-aspect-ratio", |
| 461 | P_("Cursor Aspect Ratio")g_dgettext("ctk30" "-properties","Cursor Aspect Ratio"), |
| 462 | P_("The aspect ratio of the text caret")g_dgettext("ctk30" "-properties","The aspect ratio of the text caret" ), |
| 463 | 0.0, 1.0, 0.04, |
| 464 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 465 | NULL((void*)0)); |
| 466 | |
| 467 | g_assert (result == PROP_CURSOR_ASPECT_RATIO)do { if (result == PROP_CURSOR_ASPECT_RATIO) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 467, ((const char*) (__func__)), "result == PROP_CURSOR_ASPECT_RATIO" ); } while (0); |
| 468 | result = settings_install_property_parser (class, |
| 469 | g_param_spec_string ("ctk-theme-name", |
| 470 | P_("Theme Name")g_dgettext("ctk30" "-properties","Theme Name"), |
| 471 | P_("Name of theme to load")g_dgettext("ctk30" "-properties","Name of theme to load"), |
| 472 | DEFAULT_THEME_NAME"Advaita", |
| 473 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 474 | NULL((void*)0)); |
| 475 | g_assert (result == PROP_THEME_NAME)do { if (result == PROP_THEME_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 475, ((const char*) (__func__)), "result == PROP_THEME_NAME" ); } while (0); |
| 476 | |
| 477 | result = settings_install_property_parser (class, |
| 478 | g_param_spec_string ("ctk-icon-theme-name", |
| 479 | P_("Icon Theme Name")g_dgettext("ctk30" "-properties","Icon Theme Name"), |
| 480 | P_("Name of icon theme to use")g_dgettext("ctk30" "-properties","Name of icon theme to use"), |
| 481 | DEFAULT_ICON_THEME"Advaita", |
| 482 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 483 | NULL((void*)0)); |
| 484 | g_assert (result == PROP_ICON_THEME_NAME)do { if (result == PROP_ICON_THEME_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 484, ((const char*) (__func__)), "result == PROP_ICON_THEME_NAME" ); } while (0); |
| 485 | |
| 486 | /** |
| 487 | * CtkSettings:ctk-fallback-icon-theme: |
| 488 | * |
| 489 | * Name of a icon theme to fall back to. |
| 490 | * |
| 491 | * Deprecated: 3.10: This setting is ignored. |
| 492 | */ |
| 493 | result = settings_install_property_parser (class, |
| 494 | g_param_spec_string ("ctk-fallback-icon-theme", |
| 495 | P_("Fallback Icon Theme Name")g_dgettext("ctk30" "-properties","Fallback Icon Theme Name"), |
| 496 | P_("Name of a icon theme to fall back to")g_dgettext("ctk30" "-properties","Name of a icon theme to fall back to" ), |
| 497 | NULL((void*)0), |
| 498 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 499 | NULL((void*)0)); |
| 500 | g_assert (result == PROP_FALLBACK_ICON_THEME)do { if (result == PROP_FALLBACK_ICON_THEME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 500, ((const char*) (__func__)), "result == PROP_FALLBACK_ICON_THEME" ); } while (0); |
| 501 | |
| 502 | result = settings_install_property_parser (class, |
| 503 | g_param_spec_string ("ctk-key-theme-name", |
| 504 | P_("Key Theme Name")g_dgettext("ctk30" "-properties","Key Theme Name"), |
| 505 | P_("Name of key theme to load")g_dgettext("ctk30" "-properties","Name of key theme to load"), |
| 506 | NULL((void*)0), |
| 507 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 508 | NULL((void*)0)); |
| 509 | g_assert (result == PROP_KEY_THEME_NAME)do { if (result == PROP_KEY_THEME_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 509, ((const char*) (__func__)), "result == PROP_KEY_THEME_NAME" ); } while (0); |
| 510 | |
| 511 | /** |
| 512 | * CtkSettings:ctk-menu-bar-accel: |
| 513 | * |
| 514 | * Keybinding to activate the menu bar. |
| 515 | * |
| 516 | * Deprecated: 3.10: This setting can still be used for application |
| 517 | * overrides, but will be ignored in the future |
| 518 | */ |
| 519 | result = settings_install_property_parser (class, |
| 520 | g_param_spec_string ("ctk-menu-bar-accel", |
| 521 | P_("Menu bar accelerator")g_dgettext("ctk30" "-properties","Menu bar accelerator"), |
| 522 | P_("Keybinding to activate the menu bar")g_dgettext("ctk30" "-properties","Keybinding to activate the menu bar" ), |
| 523 | "F10", |
| 524 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 525 | NULL((void*)0)); |
| 526 | g_assert (result == PROP_MENU_BAR_ACCEL)do { if (result == PROP_MENU_BAR_ACCEL) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 526, ((const char*) (__func__)), "result == PROP_MENU_BAR_ACCEL" ); } while (0); |
| 527 | |
| 528 | result = settings_install_property_parser (class, |
| 529 | g_param_spec_int ("ctk-dnd-drag-threshold", |
| 530 | P_("Drag threshold")g_dgettext("ctk30" "-properties","Drag threshold"), |
| 531 | P_("Number of pixels the cursor can move before dragging")g_dgettext("ctk30" "-properties","Number of pixels the cursor can move before dragging" ), |
| 532 | 1, G_MAXINT2147483647, 8, |
| 533 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 534 | NULL((void*)0)); |
| 535 | g_assert (result == PROP_DND_DRAG_THRESHOLD)do { if (result == PROP_DND_DRAG_THRESHOLD) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 535, ((const char*) (__func__)), "result == PROP_DND_DRAG_THRESHOLD" ); } while (0); |
| 536 | |
| 537 | /** |
| 538 | * CtkSettings:ctk-font-name: |
| 539 | * |
| 540 | * The default font to use. CTK+ uses the family name and size from this string. |
| 541 | */ |
| 542 | result = settings_install_property_parser (class, |
| 543 | g_param_spec_string ("ctk-font-name", |
| 544 | P_("Font Name")g_dgettext("ctk30" "-properties","Font Name"), |
| 545 | P_("The default font family and size to use")g_dgettext("ctk30" "-properties","The default font family and size to use" ), |
| 546 | "Sans 10", |
| 547 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 548 | NULL((void*)0)); |
| 549 | g_assert (result == PROP_FONT_NAME)do { if (result == PROP_FONT_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 549, ((const char*) (__func__)), "result == PROP_FONT_NAME" ); } while (0); |
| 550 | |
| 551 | /** |
| 552 | * CtkSettings:ctk-icon-sizes: |
| 553 | * |
| 554 | * A list of icon sizes. The list is separated by colons, and |
| 555 | * item has the form: |
| 556 | * |
| 557 | * `size-name` = `width` , `height` |
| 558 | * |
| 559 | * E.g. "ctk-menu=16,16:ctk-button=20,20:ctk-dialog=48,48". |
| 560 | * CTK+ itself use the following named icon sizes: ctk-menu, |
| 561 | * ctk-button, ctk-small-toolbar, ctk-large-toolbar, ctk-dnd, |
| 562 | * ctk-dialog. Applications can register their own named icon |
| 563 | * sizes with ctk_icon_size_register(). |
| 564 | * |
| 565 | * Deprecated: 3.10: This setting is ignored. |
| 566 | */ |
| 567 | result = settings_install_property_parser (class, |
| 568 | g_param_spec_string ("ctk-icon-sizes", |
| 569 | P_("Icon Sizes")g_dgettext("ctk30" "-properties","Icon Sizes"), |
| 570 | P_("List of icon sizes (ctk-menu=16,16:ctk-button=20,20...")g_dgettext("ctk30" "-properties","List of icon sizes (ctk-menu=16,16:ctk-button=20,20..." ), |
| 571 | NULL((void*)0), |
| 572 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 573 | NULL((void*)0)); |
| 574 | g_assert (result == PROP_ICON_SIZES)do { if (result == PROP_ICON_SIZES) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 574, ((const char*) (__func__)), "result == PROP_ICON_SIZES" ); } while (0); |
| 575 | |
| 576 | result = settings_install_property_parser (class, |
| 577 | g_param_spec_string ("ctk-modules", |
| 578 | P_("CTK Modules")g_dgettext("ctk30" "-properties","CTK Modules"), |
| 579 | P_("List of currently active CTK modules")g_dgettext("ctk30" "-properties","List of currently active CTK modules" ), |
| 580 | NULL((void*)0), |
| 581 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 582 | NULL((void*)0)); |
| 583 | g_assert (result == PROP_MODULES)do { if (result == PROP_MODULES) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 583, ((const char*) (__func__)), "result == PROP_MODULES" ); } while (0); |
| 584 | |
| 585 | result = settings_install_property_parser (class, |
| 586 | g_param_spec_int ("ctk-xft-antialias", |
| 587 | P_("Xft Antialias")g_dgettext("ctk30" "-properties","Xft Antialias"), |
| 588 | P_("Whether to antialias Xft fonts; 0=no, 1=yes, -1=default")g_dgettext("ctk30" "-properties","Whether to antialias Xft fonts; 0=no, 1=yes, -1=default" ), |
| 589 | -1, 1, -1, |
| 590 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 591 | NULL((void*)0)); |
| 592 | |
| 593 | g_assert (result == PROP_XFT_ANTIALIAS)do { if (result == PROP_XFT_ANTIALIAS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 593, ((const char*) (__func__)), "result == PROP_XFT_ANTIALIAS" ); } while (0); |
| 594 | |
| 595 | result = settings_install_property_parser (class, |
| 596 | g_param_spec_int ("ctk-xft-hinting", |
| 597 | P_("Xft Hinting")g_dgettext("ctk30" "-properties","Xft Hinting"), |
| 598 | P_("Whether to hint Xft fonts; 0=no, 1=yes, -1=default")g_dgettext("ctk30" "-properties","Whether to hint Xft fonts; 0=no, 1=yes, -1=default" ), |
| 599 | -1, 1, -1, |
| 600 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 601 | NULL((void*)0)); |
| 602 | |
| 603 | g_assert (result == PROP_XFT_HINTING)do { if (result == PROP_XFT_HINTING) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 603, ((const char*) (__func__)), "result == PROP_XFT_HINTING" ); } while (0); |
| 604 | |
| 605 | result = settings_install_property_parser (class, |
| 606 | g_param_spec_string ("ctk-xft-hintstyle", |
| 607 | P_("Xft Hint Style")g_dgettext("ctk30" "-properties","Xft Hint Style"), |
| 608 | P_("What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull")g_dgettext("ctk30" "-properties","What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull" ), |
| 609 | NULL((void*)0), |
| 610 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 611 | NULL((void*)0)); |
| 612 | |
| 613 | g_assert (result == PROP_XFT_HINTSTYLE)do { if (result == PROP_XFT_HINTSTYLE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 613, ((const char*) (__func__)), "result == PROP_XFT_HINTSTYLE" ); } while (0); |
| 614 | |
| 615 | result = settings_install_property_parser (class, |
| 616 | g_param_spec_string ("ctk-xft-rgba", |
| 617 | P_("Xft RGBA")g_dgettext("ctk30" "-properties","Xft RGBA"), |
| 618 | P_("Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr")g_dgettext("ctk30" "-properties","Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr" ), |
| 619 | NULL((void*)0), |
| 620 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 621 | NULL((void*)0)); |
| 622 | |
| 623 | g_assert (result == PROP_XFT_RGBA)do { if (result == PROP_XFT_RGBA) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 623, ((const char*) (__func__)), "result == PROP_XFT_RGBA" ); } while (0); |
| 624 | |
| 625 | result = settings_install_property_parser (class, |
| 626 | g_param_spec_int ("ctk-xft-dpi", |
| 627 | P_("Xft DPI")g_dgettext("ctk30" "-properties","Xft DPI"), |
| 628 | P_("Resolution for Xft, in 1024 * dots/inch. -1 to use default value")g_dgettext("ctk30" "-properties","Resolution for Xft, in 1024 * dots/inch. -1 to use default value" ), |
| 629 | -1, 1024*1024, -1, |
| 630 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 631 | NULL((void*)0)); |
| 632 | |
| 633 | g_assert (result == PROP_XFT_DPI)do { if (result == PROP_XFT_DPI) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 633, ((const char*) (__func__)), "result == PROP_XFT_DPI" ); } while (0); |
| 634 | |
| 635 | result = settings_install_property_parser (class, |
| 636 | g_param_spec_string ("ctk-cursor-theme-name", |
| 637 | P_("Cursor theme name")g_dgettext("ctk30" "-properties","Cursor theme name"), |
| 638 | P_("Name of the cursor theme to use, or NULL to use the default theme")g_dgettext("ctk30" "-properties","Name of the cursor theme to use, or NULL to use the default theme" ), |
| 639 | NULL((void*)0), |
| 640 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 641 | NULL((void*)0)); |
| 642 | g_assert (result == PROP_CURSOR_THEME_NAME)do { if (result == PROP_CURSOR_THEME_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 642, ((const char*) (__func__)), "result == PROP_CURSOR_THEME_NAME" ); } while (0); |
| 643 | |
| 644 | result = settings_install_property_parser (class, |
| 645 | g_param_spec_int ("ctk-cursor-theme-size", |
| 646 | P_("Cursor theme size")g_dgettext("ctk30" "-properties","Cursor theme size"), |
| 647 | P_("Size to use for cursors, or 0 to use the default size")g_dgettext("ctk30" "-properties","Size to use for cursors, or 0 to use the default size" ), |
| 648 | 0, 128, 0, |
| 649 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 650 | NULL((void*)0)); |
| 651 | |
| 652 | g_assert (result == PROP_CURSOR_THEME_SIZE)do { if (result == PROP_CURSOR_THEME_SIZE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 652, ((const char*) (__func__)), "result == PROP_CURSOR_THEME_SIZE" ); } while (0); |
| 653 | |
| 654 | result = settings_install_property_parser (class, |
| 655 | g_param_spec_boolean ("ctk-alternative-button-order", |
| 656 | P_("Alternative button order")g_dgettext("ctk30" "-properties","Alternative button order"), |
| 657 | P_("Whether buttons in dialogs should use the alternative button order")g_dgettext("ctk30" "-properties","Whether buttons in dialogs should use the alternative button order" ), |
| 658 | FALSE(0), |
| 659 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 660 | NULL((void*)0)); |
| 661 | g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER)do { if (result == PROP_ALTERNATIVE_BUTTON_ORDER) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 661, ((const char*) (__func__)), "result == PROP_ALTERNATIVE_BUTTON_ORDER" ); } while (0); |
| 662 | |
| 663 | /** |
| 664 | * CtkSettings:ctk-alternative-sort-arrows: |
| 665 | * |
| 666 | * Controls the direction of the sort indicators in sorted list and tree |
| 667 | * views. By default an arrow pointing down means the column is sorted |
| 668 | * in ascending order. When set to %TRUE, this order will be inverted. |
| 669 | * |
| 670 | * Since: 2.12 |
| 671 | */ |
| 672 | result = settings_install_property_parser (class, |
| 673 | g_param_spec_boolean ("ctk-alternative-sort-arrows", |
| 674 | P_("Alternative sort indicator direction")g_dgettext("ctk30" "-properties","Alternative sort indicator direction" ), |
| 675 | P_("Whether the direction of the sort indicators in list and tree views is inverted compared to the default (where down means ascending)")g_dgettext("ctk30" "-properties","Whether the direction of the sort indicators in list and tree views is inverted compared to the default (where down means ascending)" ), |
| 676 | FALSE(0), |
| 677 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 678 | NULL((void*)0)); |
| 679 | g_assert (result == PROP_ALTERNATIVE_SORT_ARROWS)do { if (result == PROP_ALTERNATIVE_SORT_ARROWS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 679, ((const char*) (__func__)), "result == PROP_ALTERNATIVE_SORT_ARROWS" ); } while (0); |
| 680 | |
| 681 | /** |
| 682 | * CtkSettings:ctk-show-input-method-menu: |
| 683 | * |
| 684 | * Deprecated: 3.10: This setting is ignored. |
| 685 | */ |
| 686 | result = settings_install_property_parser (class, |
| 687 | g_param_spec_boolean ("ctk-show-input-method-menu", |
| 688 | P_("Show the 'Input Methods' menu")g_dgettext("ctk30" "-properties","Show the 'Input Methods' menu" ), |
| 689 | P_("Whether the context menus of entries and text views should offer to change the input method")g_dgettext("ctk30" "-properties","Whether the context menus of entries and text views should offer to change the input method" ), |
| 690 | FALSE(0), |
| 691 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 692 | NULL((void*)0)); |
| 693 | g_assert (result == PROP_SHOW_INPUT_METHOD_MENU)do { if (result == PROP_SHOW_INPUT_METHOD_MENU) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 693, ((const char*) (__func__)), "result == PROP_SHOW_INPUT_METHOD_MENU" ); } while (0); |
| 694 | |
| 695 | /** |
| 696 | * CtkSettings:ctk-show-unicode-menu: |
| 697 | * |
| 698 | * Deprecated: 3.10: This setting is ignored. |
| 699 | */ |
| 700 | result = settings_install_property_parser (class, |
| 701 | g_param_spec_boolean ("ctk-show-unicode-menu", |
| 702 | P_("Show the 'Insert Unicode Control Character' menu")g_dgettext("ctk30" "-properties","Show the 'Insert Unicode Control Character' menu" ), |
| 703 | P_("Whether the context menus of entries and text views should offer to insert control characters")g_dgettext("ctk30" "-properties","Whether the context menus of entries and text views should offer to insert control characters" ), |
| 704 | FALSE(0), |
| 705 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 706 | NULL((void*)0)); |
| 707 | g_assert (result == PROP_SHOW_UNICODE_MENU)do { if (result == PROP_SHOW_UNICODE_MENU) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 707, ((const char*) (__func__)), "result == PROP_SHOW_UNICODE_MENU" ); } while (0); |
| 708 | |
| 709 | /** |
| 710 | * CtkSettings:ctk-timeout-initial: |
| 711 | * |
| 712 | * Deprecated: 3.10: This setting is ignored. |
| 713 | */ |
| 714 | result = settings_install_property_parser (class, |
| 715 | g_param_spec_int ("ctk-timeout-initial", |
| 716 | P_("Start timeout")g_dgettext("ctk30" "-properties","Start timeout"), |
| 717 | P_("Starting value for timeouts, when button is pressed")g_dgettext("ctk30" "-properties","Starting value for timeouts, when button is pressed" ), |
| 718 | 0, G_MAXINT2147483647, DEFAULT_TIMEOUT_INITIAL500, |
| 719 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 720 | NULL((void*)0)); |
| 721 | |
| 722 | g_assert (result == PROP_TIMEOUT_INITIAL)do { if (result == PROP_TIMEOUT_INITIAL) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 722, ((const char*) (__func__)), "result == PROP_TIMEOUT_INITIAL" ); } while (0); |
| 723 | |
| 724 | /** |
| 725 | * CtkSettings:ctk-timeout-repeat: |
| 726 | * |
| 727 | * Deprecated: 3.10: This setting is ignored. |
| 728 | */ |
| 729 | result = settings_install_property_parser (class, |
| 730 | g_param_spec_int ("ctk-timeout-repeat", |
| 731 | P_("Repeat timeout")g_dgettext("ctk30" "-properties","Repeat timeout"), |
| 732 | P_("Repeat value for timeouts, when button is pressed")g_dgettext("ctk30" "-properties","Repeat value for timeouts, when button is pressed" ), |
| 733 | 0, G_MAXINT2147483647, DEFAULT_TIMEOUT_REPEAT50, |
| 734 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 735 | NULL((void*)0)); |
| 736 | |
| 737 | g_assert (result == PROP_TIMEOUT_REPEAT)do { if (result == PROP_TIMEOUT_REPEAT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 737, ((const char*) (__func__)), "result == PROP_TIMEOUT_REPEAT" ); } while (0); |
| 738 | |
| 739 | /** |
| 740 | * CtkSettings:ctk-timeout-expand: |
| 741 | * |
| 742 | * Deprecated: 3.10: This setting is ignored. |
| 743 | */ |
| 744 | result = settings_install_property_parser (class, |
| 745 | g_param_spec_int ("ctk-timeout-expand", |
| 746 | P_("Expand timeout")g_dgettext("ctk30" "-properties","Expand timeout"), |
| 747 | P_("Expand value for timeouts, when a widget is expanding a new region")g_dgettext("ctk30" "-properties","Expand value for timeouts, when a widget is expanding a new region" ), |
| 748 | 0, G_MAXINT2147483647, DEFAULT_TIMEOUT_EXPAND500, |
| 749 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 750 | NULL((void*)0)); |
| 751 | |
| 752 | g_assert (result == PROP_TIMEOUT_EXPAND)do { if (result == PROP_TIMEOUT_EXPAND) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 752, ((const char*) (__func__)), "result == PROP_TIMEOUT_EXPAND" ); } while (0); |
| 753 | |
| 754 | /** |
| 755 | * CtkSettings:ctk-color-scheme: |
| 756 | * |
| 757 | * A palette of named colors for use in themes. The format of the string is |
| 758 | * |[ |
| 759 | * name1: color1 |
| 760 | * name2: color2 |
| 761 | * ... |
| 762 | * ]| |
| 763 | * Color names must be acceptable as identifiers in the |
| 764 | * [ctkrc][ctk3-Resource-Files] syntax, and |
| 765 | * color specifications must be in the format accepted by |
| 766 | * cdk_color_parse(). |
| 767 | * |
| 768 | * Note that due to the way the color tables from different sources are |
| 769 | * merged, color specifications will be converted to hexadecimal form |
| 770 | * when getting this property. |
| 771 | * |
| 772 | * Starting with CTK+ 2.12, the entries can alternatively be separated |
| 773 | * by ';' instead of newlines: |
| 774 | * |[ |
| 775 | * name1: color1; name2: color2; ... |
| 776 | * ]| |
| 777 | * |
| 778 | * Since: 2.10 |
| 779 | * |
| 780 | * Deprecated: 3.8: Color scheme support was dropped and is no longer supported. |
| 781 | * You can still set this property, but it will be ignored. |
| 782 | */ |
| 783 | result = settings_install_property_parser (class, |
| 784 | g_param_spec_string ("ctk-color-scheme", |
| 785 | P_("Color scheme")g_dgettext("ctk30" "-properties","Color scheme"), |
| 786 | P_("A palette of named colors for use in themes")g_dgettext("ctk30" "-properties","A palette of named colors for use in themes" ), |
| 787 | "", |
| 788 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 789 | NULL((void*)0)); |
| 790 | |
| 791 | g_assert (result == PROP_COLOR_SCHEME)do { if (result == PROP_COLOR_SCHEME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 791, ((const char*) (__func__)), "result == PROP_COLOR_SCHEME" ); } while (0); |
| 792 | |
| 793 | result = settings_install_property_parser (class, |
| 794 | g_param_spec_boolean ("ctk-enable-animations", |
| 795 | P_("Enable Animations")g_dgettext("ctk30" "-properties","Enable Animations"), |
| 796 | P_("Whether to enable toolkit-wide animations.")g_dgettext("ctk30" "-properties","Whether to enable toolkit-wide animations." ), |
| 797 | TRUE(!(0)), |
| 798 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 799 | NULL((void*)0)); |
| 800 | |
| 801 | g_assert (result == PROP_ENABLE_ANIMATIONS)do { if (result == PROP_ENABLE_ANIMATIONS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 801, ((const char*) (__func__)), "result == PROP_ENABLE_ANIMATIONS" ); } while (0); |
| 802 | |
| 803 | /** |
| 804 | * CtkSettings:ctk-touchscreen-mode: |
| 805 | * |
| 806 | * When %TRUE, there are no motion notify events delivered on this screen, |
| 807 | * and widgets can't use the pointer hovering them for any essential |
| 808 | * functionality. |
| 809 | * |
| 810 | * Since: 2.10 |
| 811 | * |
| 812 | * Deprecated: 3.4. Generally, the behavior for touchscreen input should be |
| 813 | * performed dynamically based on cdk_event_get_source_device(). |
| 814 | */ |
| 815 | result = settings_install_property_parser (class, |
| 816 | g_param_spec_boolean ("ctk-touchscreen-mode", |
| 817 | P_("Enable Touchscreen Mode")g_dgettext("ctk30" "-properties","Enable Touchscreen Mode"), |
| 818 | P_("When TRUE, there are no motion notify events delivered on this screen")g_dgettext("ctk30" "-properties","When TRUE, there are no motion notify events delivered on this screen" ), |
| 819 | FALSE(0), |
| 820 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 821 | NULL((void*)0)); |
| 822 | |
| 823 | g_assert (result == PROP_TOUCHSCREEN_MODE)do { if (result == PROP_TOUCHSCREEN_MODE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 823, ((const char*) (__func__)), "result == PROP_TOUCHSCREEN_MODE" ); } while (0); |
| 824 | |
| 825 | /** |
| 826 | * CtkSettings:ctk-tooltip-timeout: |
| 827 | * |
| 828 | * Time, in milliseconds, after which a tooltip could appear if the |
| 829 | * cursor is hovering on top of a widget. |
| 830 | * |
| 831 | * Since: 2.12 |
| 832 | * |
| 833 | * Deprecated: 3.10: This setting is ignored. |
| 834 | */ |
| 835 | result = settings_install_property_parser (class, |
| 836 | g_param_spec_int ("ctk-tooltip-timeout", |
| 837 | P_("Tooltip timeout")g_dgettext("ctk30" "-properties","Tooltip timeout"), |
| 838 | P_("Timeout before tooltip is shown")g_dgettext("ctk30" "-properties","Timeout before tooltip is shown" ), |
| 839 | 0, G_MAXINT2147483647, |
| 840 | 500, |
| 841 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 842 | NULL((void*)0)); |
| 843 | |
| 844 | g_assert (result == PROP_TOOLTIP_TIMEOUT)do { if (result == PROP_TOOLTIP_TIMEOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 844, ((const char*) (__func__)), "result == PROP_TOOLTIP_TIMEOUT" ); } while (0); |
| 845 | |
| 846 | /** |
| 847 | * CtkSettings:ctk-tooltip-browse-timeout: |
| 848 | * |
| 849 | * Controls the time after which tooltips will appear when |
| 850 | * browse mode is enabled, in milliseconds. |
| 851 | * |
| 852 | * Browse mode is enabled when the mouse pointer moves off an object |
| 853 | * where a tooltip was currently being displayed. If the mouse pointer |
| 854 | * hits another object before the browse mode timeout expires (see |
| 855 | * #CtkSettings:ctk-tooltip-browse-mode-timeout), it will take the |
| 856 | * amount of milliseconds specified by this setting to popup the tooltip |
| 857 | * for the new object. |
| 858 | * |
| 859 | * Since: 2.12 |
| 860 | * |
| 861 | * Deprecated: 3.10: This setting is ignored. |
| 862 | */ |
| 863 | result = settings_install_property_parser (class, |
| 864 | g_param_spec_int ("ctk-tooltip-browse-timeout", |
| 865 | P_("Tooltip browse timeout")g_dgettext("ctk30" "-properties","Tooltip browse timeout"), |
| 866 | P_("Timeout before tooltip is shown when browse mode is enabled")g_dgettext("ctk30" "-properties","Timeout before tooltip is shown when browse mode is enabled" ), |
| 867 | 0, G_MAXINT2147483647, |
| 868 | 60, |
| 869 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 870 | NULL((void*)0)); |
| 871 | |
| 872 | g_assert (result == PROP_TOOLTIP_BROWSE_TIMEOUT)do { if (result == PROP_TOOLTIP_BROWSE_TIMEOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 872, ((const char*) (__func__)), "result == PROP_TOOLTIP_BROWSE_TIMEOUT" ); } while (0); |
| 873 | |
| 874 | /** |
| 875 | * CtkSettings:ctk-tooltip-browse-mode-timeout: |
| 876 | * |
| 877 | * Amount of time, in milliseconds, after which the browse mode |
| 878 | * will be disabled. |
| 879 | * |
| 880 | * See #CtkSettings:ctk-tooltip-browse-timeout for more information |
| 881 | * about browse mode. |
| 882 | * |
| 883 | * Since: 2.12 |
| 884 | * |
| 885 | * Deprecated: 3.10: This setting is ignored. |
| 886 | */ |
| 887 | result = settings_install_property_parser (class, |
| 888 | g_param_spec_int ("ctk-tooltip-browse-mode-timeout", |
| 889 | P_("Tooltip browse mode timeout")g_dgettext("ctk30" "-properties","Tooltip browse mode timeout" ), |
| 890 | P_("Timeout after which browse mode is disabled")g_dgettext("ctk30" "-properties","Timeout after which browse mode is disabled" ), |
| 891 | 0, G_MAXINT2147483647, |
| 892 | 500, |
| 893 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 894 | NULL((void*)0)); |
| 895 | |
| 896 | g_assert (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT)do { if (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 896, ((const char*) (__func__)), "result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT" ); } while (0); |
| 897 | |
| 898 | /** |
| 899 | * CtkSettings:ctk-keynav-cursor-only: |
| 900 | * |
| 901 | * When %TRUE, keyboard navigation should be able to reach all widgets |
| 902 | * by using the cursor keys only. Tab, Shift etc. keys can't be expected |
| 903 | * to be present on the used input device. |
| 904 | * |
| 905 | * Since: 2.12 |
| 906 | * |
| 907 | * Deprecated: 3.10: Generally, the behavior for touchscreen input should be |
| 908 | * performed dynamically based on cdk_event_get_source_device(). |
| 909 | */ |
| 910 | result = settings_install_property_parser (class, |
| 911 | g_param_spec_boolean ("ctk-keynav-cursor-only", |
| 912 | P_("Keynav Cursor Only")g_dgettext("ctk30" "-properties","Keynav Cursor Only"), |
| 913 | P_("When TRUE, there are only cursor keys available to navigate widgets")g_dgettext("ctk30" "-properties","When TRUE, there are only cursor keys available to navigate widgets" ), |
| 914 | FALSE(0), |
| 915 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 916 | NULL((void*)0)); |
| 917 | |
| 918 | g_assert (result == PROP_KEYNAV_CURSOR_ONLY)do { if (result == PROP_KEYNAV_CURSOR_ONLY) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 918, ((const char*) (__func__)), "result == PROP_KEYNAV_CURSOR_ONLY" ); } while (0); |
| 919 | |
| 920 | /** |
| 921 | * CtkSettings:ctk-keynav-wrap-around: |
| 922 | * |
| 923 | * When %TRUE, some widgets will wrap around when doing keyboard |
| 924 | * navigation, such as menus, menubars and notebooks. |
| 925 | * |
| 926 | * Since: 2.12 |
| 927 | * |
| 928 | * Deprecated: 3.10: This setting is ignored. |
| 929 | */ |
| 930 | result = settings_install_property_parser (class, |
| 931 | g_param_spec_boolean ("ctk-keynav-wrap-around", |
| 932 | P_("Keynav Wrap Around")g_dgettext("ctk30" "-properties","Keynav Wrap Around"), |
| 933 | P_("Whether to wrap around when keyboard-navigating widgets")g_dgettext("ctk30" "-properties","Whether to wrap around when keyboard-navigating widgets" ), |
| 934 | TRUE(!(0)), |
| 935 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 936 | NULL((void*)0)); |
| 937 | |
| 938 | g_assert (result == PROP_KEYNAV_WRAP_AROUND)do { if (result == PROP_KEYNAV_WRAP_AROUND) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 938, ((const char*) (__func__)), "result == PROP_KEYNAV_WRAP_AROUND" ); } while (0); |
| 939 | |
| 940 | /** |
| 941 | * CtkSettings:ctk-error-bell: |
| 942 | * |
| 943 | * When %TRUE, keyboard navigation and other input-related errors |
| 944 | * will cause a beep. Since the error bell is implemented using |
| 945 | * cdk_window_beep(), the windowing system may offer ways to |
| 946 | * configure the error bell in many ways, such as flashing the |
| 947 | * window or similar visual effects. |
| 948 | * |
| 949 | * Since: 2.12 |
| 950 | */ |
| 951 | result = settings_install_property_parser (class, |
| 952 | g_param_spec_boolean ("ctk-error-bell", |
| 953 | P_("Error Bell")g_dgettext("ctk30" "-properties","Error Bell"), |
| 954 | P_("When TRUE, keyboard navigation and other errors will cause a beep")g_dgettext("ctk30" "-properties","When TRUE, keyboard navigation and other errors will cause a beep" ), |
| 955 | TRUE(!(0)), |
| 956 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 957 | NULL((void*)0)); |
| 958 | |
| 959 | g_assert (result == PROP_ERROR_BELL)do { if (result == PROP_ERROR_BELL) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 959, ((const char*) (__func__)), "result == PROP_ERROR_BELL" ); } while (0); |
| 960 | |
| 961 | /** |
| 962 | * CtkSettings:color-hash: (type GLib.HashTable(utf8,Cdk.Color)) (transfer container) |
| 963 | * |
| 964 | * Holds a hash table representation of the #CtkSettings:ctk-color-scheme |
| 965 | * setting, mapping color names to #CdkColors. |
| 966 | * |
| 967 | * Since: 2.10 |
| 968 | * |
| 969 | * Deprecated: 3.8: Will always return an empty hash table. |
| 970 | */ |
| 971 | result = settings_install_property_parser (class, |
| 972 | g_param_spec_boxed ("color-hash", |
| 973 | P_("Color Hash")g_dgettext("ctk30" "-properties","Color Hash"), |
| 974 | P_("A hash table representation of the color scheme.")g_dgettext("ctk30" "-properties","A hash table representation of the color scheme." ), |
| 975 | G_TYPE_HASH_TABLE(g_hash_table_get_type ()), |
| 976 | CTK_PARAM_READABLEG_PARAM_READABLE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 977 | NULL((void*)0)); |
| 978 | g_assert (result == PROP_COLOR_HASH)do { if (result == PROP_COLOR_HASH) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 978, ((const char*) (__func__)), "result == PROP_COLOR_HASH" ); } while (0); |
| 979 | |
| 980 | /** |
| 981 | * CtkSettings:ctk-file-chooser-backend: |
| 982 | * |
| 983 | * Name of the CtkFileChooser backend to use by default. |
| 984 | * |
| 985 | * Deprecated: 3.10: This setting is ignored. #CtkFileChooser uses GIO by default. |
| 986 | */ |
| 987 | result = settings_install_property_parser (class, |
| 988 | g_param_spec_string ("ctk-file-chooser-backend", |
| 989 | P_("Default file chooser backend")g_dgettext("ctk30" "-properties","Default file chooser backend" ), |
| 990 | P_("Name of the CtkFileChooser backend to use by default")g_dgettext("ctk30" "-properties","Name of the CtkFileChooser backend to use by default" ), |
| 991 | NULL((void*)0), |
| 992 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 993 | NULL((void*)0)); |
| 994 | g_assert (result == PROP_FILE_CHOOSER_BACKEND)do { if (result == PROP_FILE_CHOOSER_BACKEND) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 994, ((const char*) (__func__)), "result == PROP_FILE_CHOOSER_BACKEND" ); } while (0); |
| 995 | |
| 996 | /** |
| 997 | * CtkSettings:ctk-print-backends: |
| 998 | * |
| 999 | * A comma-separated list of print backends to use in the print |
| 1000 | * dialog. Available print backends depend on the CTK+ installation, |
| 1001 | * and may include "file", "cups", "lpr" or "papi". |
| 1002 | * |
| 1003 | * Since: 2.10 |
| 1004 | */ |
| 1005 | result = settings_install_property_parser (class, |
| 1006 | g_param_spec_string ("ctk-print-backends", |
| 1007 | P_("Default print backend")g_dgettext("ctk30" "-properties","Default print backend"), |
| 1008 | P_("List of the CtkPrintBackend backends to use by default")g_dgettext("ctk30" "-properties","List of the CtkPrintBackend backends to use by default" ), |
| 1009 | CTK_PRINT_BACKENDS"file,cups", |
| 1010 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1011 | NULL((void*)0)); |
| 1012 | g_assert (result == PROP_PRINT_BACKENDS)do { if (result == PROP_PRINT_BACKENDS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1012, ((const char*) (__func__)), "result == PROP_PRINT_BACKENDS" ); } while (0); |
| 1013 | |
| 1014 | /** |
| 1015 | * CtkSettings:ctk-print-preview-command: |
| 1016 | * |
| 1017 | * A command to run for displaying the print preview. The command |
| 1018 | * should contain a `%f` placeholder, which will get replaced by |
| 1019 | * the path to the pdf file. The command may also contain a `%s` |
| 1020 | * placeholder, which will get replaced by the path to a file |
| 1021 | * containing the print settings in the format produced by |
| 1022 | * ctk_print_settings_to_file(). |
| 1023 | * |
| 1024 | * The preview application is responsible for removing the pdf file |
| 1025 | * and the print settings file when it is done. |
| 1026 | * |
| 1027 | * Since: 2.10 |
| 1028 | */ |
| 1029 | result = settings_install_property_parser (class, |
| 1030 | g_param_spec_string ("ctk-print-preview-command", |
| 1031 | P_("Default command to run when displaying a print preview")g_dgettext("ctk30" "-properties","Default command to run when displaying a print preview" ), |
| 1032 | P_("Command to run when displaying a print preview")g_dgettext("ctk30" "-properties","Command to run when displaying a print preview" ), |
| 1033 | PRINT_PREVIEW_COMMAND"evince --unlink-tempfile --preview --print-settings %s %f", |
| 1034 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1035 | NULL((void*)0)); |
| 1036 | g_assert (result == PROP_PRINT_PREVIEW_COMMAND)do { if (result == PROP_PRINT_PREVIEW_COMMAND) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1036, ((const char*) (__func__)), "result == PROP_PRINT_PREVIEW_COMMAND" ); } while (0); |
| 1037 | |
| 1038 | /** |
| 1039 | * CtkSettings:ctk-enable-mnemonics: |
| 1040 | * |
| 1041 | * Whether labels and menu items should have visible mnemonics which |
| 1042 | * can be activated. |
| 1043 | * |
| 1044 | * Since: 2.12 |
| 1045 | * |
| 1046 | * Deprecated: 3.10: This setting can still be used for application |
| 1047 | * overrides, but will be ignored in the future |
| 1048 | */ |
| 1049 | result = settings_install_property_parser (class, |
| 1050 | g_param_spec_boolean ("ctk-enable-mnemonics", |
| 1051 | P_("Enable Mnemonics")g_dgettext("ctk30" "-properties","Enable Mnemonics"), |
| 1052 | P_("Whether labels should have mnemonics")g_dgettext("ctk30" "-properties","Whether labels should have mnemonics" ), |
| 1053 | TRUE(!(0)), |
| 1054 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1055 | NULL((void*)0)); |
| 1056 | g_assert (result == PROP_ENABLE_MNEMONICS)do { if (result == PROP_ENABLE_MNEMONICS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1056, ((const char*) (__func__)), "result == PROP_ENABLE_MNEMONICS" ); } while (0); |
| 1057 | |
| 1058 | /** |
| 1059 | * CtkSettings:ctk-enable-accels: |
| 1060 | * |
| 1061 | * Whether menu items should have visible accelerators which can be |
| 1062 | * activated. |
| 1063 | * |
| 1064 | * Since: 2.12 |
| 1065 | */ |
| 1066 | result = settings_install_property_parser (class, |
| 1067 | g_param_spec_boolean ("ctk-enable-accels", |
| 1068 | P_("Enable Accelerators")g_dgettext("ctk30" "-properties","Enable Accelerators"), |
| 1069 | P_("Whether menu items should have accelerators")g_dgettext("ctk30" "-properties","Whether menu items should have accelerators" ), |
| 1070 | TRUE(!(0)), |
| 1071 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1072 | NULL((void*)0)); |
| 1073 | g_assert (result == PROP_ENABLE_ACCELS)do { if (result == PROP_ENABLE_ACCELS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1073, ((const char*) (__func__)), "result == PROP_ENABLE_ACCELS" ); } while (0); |
| 1074 | |
| 1075 | /** |
| 1076 | * CtkSettings:ctk-recent-files-limit: |
| 1077 | * |
| 1078 | * The number of recently used files that should be displayed by default by |
| 1079 | * #CtkRecentChooser implementations and by the #CtkFileChooser. A value of |
| 1080 | * -1 means every recently used file stored. |
| 1081 | * |
| 1082 | * Since: 2.12 |
| 1083 | * |
| 1084 | * Deprecated: 3.10: This setting is ignored |
| 1085 | */ |
| 1086 | result = settings_install_property_parser (class, |
| 1087 | g_param_spec_int ("ctk-recent-files-limit", |
| 1088 | P_("Recent Files Limit")g_dgettext("ctk30" "-properties","Recent Files Limit"), |
| 1089 | P_("Number of recently used files")g_dgettext("ctk30" "-properties","Number of recently used files" ), |
| 1090 | -1, G_MAXINT2147483647, |
| 1091 | 50, |
| 1092 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1093 | NULL((void*)0)); |
| 1094 | g_assert (result == PROP_RECENT_FILES_LIMIT)do { if (result == PROP_RECENT_FILES_LIMIT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1094, ((const char*) (__func__)), "result == PROP_RECENT_FILES_LIMIT" ); } while (0); |
| 1095 | |
| 1096 | /** |
| 1097 | * CtkSettings:ctk-im-module: |
| 1098 | * |
| 1099 | * Which IM (input method) module should be used by default. This is the |
| 1100 | * input method that will be used if the user has not explicitly chosen |
| 1101 | * another input method from the IM context menu. |
| 1102 | * This also can be a colon-separated list of input methods, which CTK+ |
| 1103 | * will try in turn until it finds one available on the system. |
| 1104 | * |
| 1105 | * See #CtkIMContext. |
| 1106 | */ |
| 1107 | result = settings_install_property_parser (class, |
| 1108 | g_param_spec_string ("ctk-im-module", |
| 1109 | P_("Default IM module")g_dgettext("ctk30" "-properties","Default IM module"), |
| 1110 | P_("Which IM module should be used by default")g_dgettext("ctk30" "-properties","Which IM module should be used by default" ), |
| 1111 | NULL((void*)0), |
| 1112 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1113 | NULL((void*)0)); |
| 1114 | g_assert (result == PROP_IM_MODULE)do { if (result == PROP_IM_MODULE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1114, ((const char*) (__func__)), "result == PROP_IM_MODULE" ); } while (0); |
| 1115 | |
| 1116 | /** |
| 1117 | * CtkSettings:ctk-recent-files-max-age: |
| 1118 | * |
| 1119 | * The maximum age, in days, of the items inside the recently used |
| 1120 | * resources list. Items older than this setting will be excised |
| 1121 | * from the list. If set to 0, the list will always be empty; if |
| 1122 | * set to -1, no item will be removed. |
| 1123 | * |
| 1124 | * Since: 2.14 |
| 1125 | */ |
| 1126 | result = settings_install_property_parser (class, |
| 1127 | g_param_spec_int ("ctk-recent-files-max-age", |
| 1128 | P_("Recent Files Max Age")g_dgettext("ctk30" "-properties","Recent Files Max Age"), |
| 1129 | P_("Maximum age of recently used files, in days")g_dgettext("ctk30" "-properties","Maximum age of recently used files, in days" ), |
| 1130 | -1, G_MAXINT2147483647, |
| 1131 | 30, |
| 1132 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1133 | NULL((void*)0)); |
| 1134 | g_assert (result == PROP_RECENT_FILES_MAX_AGE)do { if (result == PROP_RECENT_FILES_MAX_AGE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1134, ((const char*) (__func__)), "result == PROP_RECENT_FILES_MAX_AGE" ); } while (0); |
| 1135 | |
| 1136 | result = settings_install_property_parser (class, |
| 1137 | g_param_spec_uint ("ctk-fontconfig-timestamp", |
| 1138 | P_("Fontconfig configuration timestamp")g_dgettext("ctk30" "-properties","Fontconfig configuration timestamp" ), |
| 1139 | P_("Timestamp of current fontconfig configuration")g_dgettext("ctk30" "-properties","Timestamp of current fontconfig configuration" ), |
| 1140 | 0, G_MAXUINT(2147483647 *2U +1U), 0, |
| 1141 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1142 | NULL((void*)0)); |
| 1143 | |
| 1144 | g_assert (result == PROP_FONTCONFIG_TIMESTAMP)do { if (result == PROP_FONTCONFIG_TIMESTAMP) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1144, ((const char*) (__func__)), "result == PROP_FONTCONFIG_TIMESTAMP" ); } while (0); |
| 1145 | |
| 1146 | /** |
| 1147 | * CtkSettings:ctk-sound-theme-name: |
| 1148 | * |
| 1149 | * The XDG sound theme to use for event sounds. |
| 1150 | * |
| 1151 | * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec) |
| 1152 | * for more information on event sounds and sound themes. |
| 1153 | * |
| 1154 | * CTK+ itself does not support event sounds, you have to use a loadable |
| 1155 | * module like the one that comes with libcanberra. |
| 1156 | * |
| 1157 | * Since: 2.14 |
| 1158 | */ |
| 1159 | result = settings_install_property_parser (class, |
| 1160 | g_param_spec_string ("ctk-sound-theme-name", |
| 1161 | P_("Sound Theme Name")g_dgettext("ctk30" "-properties","Sound Theme Name"), |
| 1162 | P_("XDG sound theme name")g_dgettext("ctk30" "-properties","XDG sound theme name"), |
| 1163 | "freedesktop", |
| 1164 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1165 | NULL((void*)0)); |
| 1166 | g_assert (result == PROP_SOUND_THEME_NAME)do { if (result == PROP_SOUND_THEME_NAME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1166, ((const char*) (__func__)), "result == PROP_SOUND_THEME_NAME" ); } while (0); |
| 1167 | |
| 1168 | /** |
| 1169 | * CtkSettings:ctk-enable-input-feedback-sounds: |
| 1170 | * |
| 1171 | * Whether to play event sounds as feedback to user input. |
| 1172 | * |
| 1173 | * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec) |
| 1174 | * for more information on event sounds and sound themes. |
| 1175 | * |
| 1176 | * CTK+ itself does not support event sounds, you have to use a loadable |
| 1177 | * module like the one that comes with libcanberra. |
| 1178 | * |
| 1179 | * Since: 2.14 |
| 1180 | */ |
| 1181 | result = settings_install_property_parser (class, |
| 1182 | g_param_spec_boolean ("ctk-enable-input-feedback-sounds", |
| 1183 | /* Translators: this means sounds that are played as feedback to user input */ |
| 1184 | P_("Audible Input Feedback")g_dgettext("ctk30" "-properties","Audible Input Feedback"), |
| 1185 | P_("Whether to play event sounds as feedback to user input")g_dgettext("ctk30" "-properties","Whether to play event sounds as feedback to user input" ), |
| 1186 | TRUE(!(0)), |
| 1187 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1188 | NULL((void*)0)); |
| 1189 | g_assert (result == PROP_ENABLE_INPUT_FEEDBACK_SOUNDS)do { if (result == PROP_ENABLE_INPUT_FEEDBACK_SOUNDS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1189, ((const char*) (__func__)), "result == PROP_ENABLE_INPUT_FEEDBACK_SOUNDS" ); } while (0); |
| 1190 | |
| 1191 | /** |
| 1192 | * CtkSettings:ctk-enable-event-sounds: |
| 1193 | * |
| 1194 | * Whether to play any event sounds at all. |
| 1195 | * |
| 1196 | * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec) |
| 1197 | * for more information on event sounds and sound themes. |
| 1198 | * |
| 1199 | * CTK+ itself does not support event sounds, you have to use a loadable |
| 1200 | * module like the one that comes with libcanberra. |
| 1201 | * |
| 1202 | * Since: 2.14 |
| 1203 | */ |
| 1204 | result = settings_install_property_parser (class, |
| 1205 | g_param_spec_boolean ("ctk-enable-event-sounds", |
| 1206 | P_("Enable Event Sounds")g_dgettext("ctk30" "-properties","Enable Event Sounds"), |
| 1207 | P_("Whether to play any event sounds at all")g_dgettext("ctk30" "-properties","Whether to play any event sounds at all" ), |
| 1208 | TRUE(!(0)), |
| 1209 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1210 | NULL((void*)0)); |
| 1211 | g_assert (result == PROP_ENABLE_EVENT_SOUNDS)do { if (result == PROP_ENABLE_EVENT_SOUNDS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1211, ((const char*) (__func__)), "result == PROP_ENABLE_EVENT_SOUNDS" ); } while (0); |
| 1212 | |
| 1213 | /** |
| 1214 | * CtkSettings:ctk-enable-tooltips: |
| 1215 | * |
| 1216 | * Whether tooltips should be shown on widgets. |
| 1217 | * |
| 1218 | * Since: 2.14 |
| 1219 | * |
| 1220 | * Deprecated: 3.10: This setting is ignored. |
| 1221 | */ |
| 1222 | result = settings_install_property_parser (class, |
| 1223 | g_param_spec_boolean ("ctk-enable-tooltips", |
| 1224 | P_("Enable Tooltips")g_dgettext("ctk30" "-properties","Enable Tooltips"), |
| 1225 | P_("Whether tooltips should be shown on widgets")g_dgettext("ctk30" "-properties","Whether tooltips should be shown on widgets" ), |
| 1226 | TRUE(!(0)), |
| 1227 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1228 | NULL((void*)0)); |
| 1229 | g_assert (result == PROP_ENABLE_TOOLTIPS)do { if (result == PROP_ENABLE_TOOLTIPS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1229, ((const char*) (__func__)), "result == PROP_ENABLE_TOOLTIPS" ); } while (0); |
| 1230 | |
| 1231 | /** |
| 1232 | * CtkSettings:ctk-toolbar-style: |
| 1233 | * |
| 1234 | * The size of icons in default toolbars. |
| 1235 | * |
| 1236 | * Deprecated: 3.10: This setting is ignored. |
| 1237 | */ |
| 1238 | result = settings_install_property_parser (class, |
| 1239 | g_param_spec_enum ("ctk-toolbar-style", |
| 1240 | P_("Toolbar style")g_dgettext("ctk30" "-properties","Toolbar style"), |
| 1241 | P_("Whether default toolbars have text only, text and icons, icons only, etc.")g_dgettext("ctk30" "-properties","Whether default toolbars have text only, text and icons, icons only, etc." ), |
| 1242 | CTK_TYPE_TOOLBAR_STYLE(ctk_toolbar_style_get_type ()), |
| 1243 | CTK_TOOLBAR_BOTH_HORIZ, |
| 1244 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1245 | ctk_rc_property_parse_enum); |
| 1246 | g_assert (result == PROP_TOOLBAR_STYLE)do { if (result == PROP_TOOLBAR_STYLE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1246, ((const char*) (__func__)), "result == PROP_TOOLBAR_STYLE" ); } while (0); |
| 1247 | |
| 1248 | /** |
| 1249 | * CtkSettings:ctk-toolbar-icon-size: |
| 1250 | * |
| 1251 | * The size of icons in default toolbars. |
| 1252 | * |
| 1253 | * Deprecated: 3.10: This setting is ignored. |
| 1254 | */ |
| 1255 | result = settings_install_property_parser (class, |
| 1256 | g_param_spec_enum ("ctk-toolbar-icon-size", |
| 1257 | P_("Toolbar Icon Size")g_dgettext("ctk30" "-properties","Toolbar Icon Size"), |
| 1258 | P_("The size of icons in default toolbars.")g_dgettext("ctk30" "-properties","The size of icons in default toolbars." ), |
| 1259 | CTK_TYPE_ICON_SIZE(ctk_icon_size_get_type ()), |
| 1260 | CTK_ICON_SIZE_LARGE_TOOLBAR, |
| 1261 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1262 | ctk_rc_property_parse_enum); |
| 1263 | g_assert (result == PROP_TOOLBAR_ICON_SIZE)do { if (result == PROP_TOOLBAR_ICON_SIZE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1263, ((const char*) (__func__)), "result == PROP_TOOLBAR_ICON_SIZE" ); } while (0); |
| 1264 | |
| 1265 | /** |
| 1266 | * CtkSettings:ctk-auto-mnemonics: |
| 1267 | * |
| 1268 | * Whether mnemonics should be automatically shown and hidden when the user |
| 1269 | * presses the mnemonic activator. |
| 1270 | * |
| 1271 | * Since: 2.20 |
| 1272 | * |
| 1273 | * Deprecated: 3.10: This setting is ignored |
| 1274 | */ |
| 1275 | result = settings_install_property_parser (class, |
| 1276 | g_param_spec_boolean ("ctk-auto-mnemonics", |
| 1277 | P_("Auto Mnemonics")g_dgettext("ctk30" "-properties","Auto Mnemonics"), |
| 1278 | P_("Whether mnemonics should be automatically shown and hidden when the user presses the mnemonic activator.")g_dgettext("ctk30" "-properties","Whether mnemonics should be automatically shown and hidden when the user presses the mnemonic activator." ), |
| 1279 | TRUE(!(0)), |
| 1280 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1281 | NULL((void*)0)); |
| 1282 | g_assert (result == PROP_AUTO_MNEMONICS)do { if (result == PROP_AUTO_MNEMONICS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1282, ((const char*) (__func__)), "result == PROP_AUTO_MNEMONICS" ); } while (0); |
| 1283 | |
| 1284 | /** |
| 1285 | * CtkSettings:ctk-primary-button-warps-slider: |
| 1286 | * |
| 1287 | * If the value of this setting is %TRUE, clicking the primary button in a |
| 1288 | * #CtkRange trough will move the slider, and hence set the range’s value, to |
| 1289 | * the point that you clicked. If it is %FALSE, a primary click will cause the |
| 1290 | * slider/value to move by the range’s page-size towards the point clicked. |
| 1291 | * |
| 1292 | * Whichever action you choose for the primary button, the other action will |
| 1293 | * be available by holding Shift and primary-clicking, or (since CTK+ 3.22.25) |
| 1294 | * clicking the middle mouse button. |
| 1295 | * |
| 1296 | * Since: 3.6 |
| 1297 | */ |
| 1298 | result = settings_install_property_parser (class, |
| 1299 | g_param_spec_boolean ("ctk-primary-button-warps-slider", |
| 1300 | P_("Primary button warps slider")g_dgettext("ctk30" "-properties","Primary button warps slider" ), |
| 1301 | P_("Whether a primary click on the trough should warp the slider into position")g_dgettext("ctk30" "-properties","Whether a primary click on the trough should warp the slider into position" ), |
| 1302 | TRUE(!(0)), |
| 1303 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1304 | NULL((void*)0)); |
| 1305 | g_assert (result == PROP_PRIMARY_BUTTON_WARPS_SLIDER)do { if (result == PROP_PRIMARY_BUTTON_WARPS_SLIDER) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1305, ((const char*) (__func__)), "result == PROP_PRIMARY_BUTTON_WARPS_SLIDER" ); } while (0); |
| 1306 | |
| 1307 | /** |
| 1308 | * CtkSettings:ctk-visible-focus: |
| 1309 | * |
| 1310 | * Whether 'focus rectangles' should be always visible, never visible, |
| 1311 | * or hidden until the user starts to use the keyboard. |
| 1312 | * |
| 1313 | * Since: 3.2 |
| 1314 | * |
| 1315 | * Deprecated: 3.10: This setting is ignored |
| 1316 | */ |
| 1317 | result = settings_install_property_parser (class, |
| 1318 | g_param_spec_enum ("ctk-visible-focus", |
| 1319 | P_("Visible Focus")g_dgettext("ctk30" "-properties","Visible Focus"), |
| 1320 | P_("Whether 'focus rectangles' should be hidden until the user starts to use the keyboard.")g_dgettext("ctk30" "-properties","Whether 'focus rectangles' should be hidden until the user starts to use the keyboard." ), |
| 1321 | CTK_TYPE_POLICY_TYPE(ctk_policy_type_get_type ()), |
| 1322 | CTK_POLICY_AUTOMATIC, |
| 1323 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1324 | ctk_rc_property_parse_enum); |
| 1325 | g_assert (result == PROP_VISIBLE_FOCUS)do { if (result == PROP_VISIBLE_FOCUS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1325, ((const char*) (__func__)), "result == PROP_VISIBLE_FOCUS" ); } while (0); |
| 1326 | |
| 1327 | /** |
| 1328 | * CtkSettings:ctk-application-prefer-dark-theme: |
| 1329 | * |
| 1330 | * Whether the application prefers to use a dark theme. If a CTK+ theme |
| 1331 | * includes a dark variant, it will be used instead of the configured |
| 1332 | * theme. |
| 1333 | * |
| 1334 | * Some applications benefit from minimizing the amount of light pollution that |
| 1335 | * interferes with the content. Good candidates for dark themes are photo and |
| 1336 | * video editors that make the actual content get all the attention and minimize |
| 1337 | * the distraction of the chrome. |
| 1338 | * |
| 1339 | * Dark themes should not be used for documents, where large spaces are white/light |
| 1340 | * and the dark chrome creates too much contrast (web browser, text editor...). |
| 1341 | * |
| 1342 | * Since: 3.0 |
| 1343 | */ |
| 1344 | result = settings_install_property_parser (class, |
| 1345 | g_param_spec_boolean ("ctk-application-prefer-dark-theme", |
| 1346 | P_("Application prefers a dark theme")g_dgettext("ctk30" "-properties","Application prefers a dark theme" ), |
| 1347 | P_("Whether the application prefers to have a dark theme.")g_dgettext("ctk30" "-properties","Whether the application prefers to have a dark theme." ), |
| 1348 | FALSE(0), |
| 1349 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1350 | NULL((void*)0)); |
| 1351 | g_assert (result == PROP_APPLICATION_PREFER_DARK_THEME)do { if (result == PROP_APPLICATION_PREFER_DARK_THEME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1351, ((const char*) (__func__)), "result == PROP_APPLICATION_PREFER_DARK_THEME" ); } while (0); |
| 1352 | |
| 1353 | /** |
| 1354 | * CtkSettings:ctk-button-images: |
| 1355 | * |
| 1356 | * Whether images should be shown on buttons |
| 1357 | * |
| 1358 | * Since: 2.4 |
| 1359 | * |
| 1360 | * Deprecated: 3.10: This setting is deprecated. Application developers |
| 1361 | * control whether a button should show an icon or not, on a |
| 1362 | * per-button basis. If a #CtkButton should show an icon, use the |
| 1363 | * #CtkButton:always-show-image property of #CtkButton, and pack a |
| 1364 | * #CtkImage inside the #CtkButton |
| 1365 | */ |
| 1366 | result = settings_install_property_parser (class, |
| 1367 | g_param_spec_boolean ("ctk-button-images", |
| 1368 | P_("Show button images")g_dgettext("ctk30" "-properties","Show button images"), |
| 1369 | P_("Whether images should be shown on buttons")g_dgettext("ctk30" "-properties","Whether images should be shown on buttons" ), |
| 1370 | FALSE(0), |
| 1371 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1372 | NULL((void*)0)); |
| 1373 | g_assert (result == PROP_BUTTON_IMAGES)do { if (result == PROP_BUTTON_IMAGES) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1373, ((const char*) (__func__)), "result == PROP_BUTTON_IMAGES" ); } while (0); |
| 1374 | |
| 1375 | result = settings_install_property_parser (class, |
| 1376 | g_param_spec_boolean ("ctk-entry-select-on-focus", |
| 1377 | P_("Select on focus")g_dgettext("ctk30" "-properties","Select on focus"), |
| 1378 | P_("Whether to select the contents of an entry when it is focused")g_dgettext("ctk30" "-properties","Whether to select the contents of an entry when it is focused" ), |
| 1379 | TRUE(!(0)), |
| 1380 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1381 | NULL((void*)0)); |
| 1382 | g_assert (result == PROP_ENTRY_SELECT_ON_FOCUS)do { if (result == PROP_ENTRY_SELECT_ON_FOCUS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1382, ((const char*) (__func__)), "result == PROP_ENTRY_SELECT_ON_FOCUS" ); } while (0); |
| 1383 | |
| 1384 | /** |
| 1385 | * CtkSettings:ctk-entry-password-hint-timeout: |
| 1386 | * |
| 1387 | * How long to show the last input character in hidden |
| 1388 | * entries. This value is in milliseconds. 0 disables showing the |
| 1389 | * last char. 600 is a good value for enabling it. |
| 1390 | * |
| 1391 | * Since: 2.10 |
| 1392 | */ |
| 1393 | result = settings_install_property_parser (class, |
| 1394 | g_param_spec_uint ("ctk-entry-password-hint-timeout", |
| 1395 | P_("Password Hint Timeout")g_dgettext("ctk30" "-properties","Password Hint Timeout"), |
| 1396 | P_("How long to show the last input character in hidden entries")g_dgettext("ctk30" "-properties","How long to show the last input character in hidden entries" ), |
| 1397 | 0, G_MAXUINT(2147483647 *2U +1U), |
| 1398 | 0, |
| 1399 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1400 | NULL((void*)0)); |
| 1401 | g_assert (result == PROP_ENTRY_PASSWORD_HINT_TIMEOUT)do { if (result == PROP_ENTRY_PASSWORD_HINT_TIMEOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1401, ((const char*) (__func__)), "result == PROP_ENTRY_PASSWORD_HINT_TIMEOUT" ); } while (0); |
| 1402 | |
| 1403 | /** |
| 1404 | * CtkSettings:ctk-menu-images: |
| 1405 | * |
| 1406 | * Whether images should be shown in menu items |
| 1407 | * |
| 1408 | * Deprecated: 3.10: This setting is deprecated. Application developers |
| 1409 | * control whether or not a #CtkMenuItem should have an icon or not, |
| 1410 | * on a per widget basis. Either use a #CtkMenuItem with a #CtkBox |
| 1411 | * containing a #CtkImage and a #CtkAccelLabel, or describe your menus |
| 1412 | * using a #GMenu XML description |
| 1413 | */ |
| 1414 | result = settings_install_property_parser (class, |
| 1415 | g_param_spec_boolean ("ctk-menu-images", |
| 1416 | P_("Show menu images")g_dgettext("ctk30" "-properties","Show menu images"), |
| 1417 | P_("Whether images should be shown in menus")g_dgettext("ctk30" "-properties","Whether images should be shown in menus" ), |
| 1418 | FALSE(0), |
| 1419 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1420 | NULL((void*)0)); |
| 1421 | g_assert (result == PROP_MENU_IMAGES)do { if (result == PROP_MENU_IMAGES) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1421, ((const char*) (__func__)), "result == PROP_MENU_IMAGES" ); } while (0); |
| 1422 | |
| 1423 | /** |
| 1424 | * CtkSettings:ctk-menu-bar-popup-delay: |
| 1425 | * |
| 1426 | * Delay before the submenus of a menu bar appear. |
| 1427 | * |
| 1428 | * Deprecated: 3.10: This setting is ignored. |
| 1429 | */ |
| 1430 | result = settings_install_property_parser (class, |
| 1431 | g_param_spec_int ("ctk-menu-bar-popup-delay", |
| 1432 | P_("Delay before drop down menus appear")g_dgettext("ctk30" "-properties","Delay before drop down menus appear" ), |
| 1433 | P_("Delay before the submenus of a menu bar appear")g_dgettext("ctk30" "-properties","Delay before the submenus of a menu bar appear" ), |
| 1434 | 0, G_MAXINT2147483647, |
| 1435 | 0, |
| 1436 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1437 | NULL((void*)0)); |
| 1438 | g_assert (result == PROP_MENU_BAR_POPUP_DELAY)do { if (result == PROP_MENU_BAR_POPUP_DELAY) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1438, ((const char*) (__func__)), "result == PROP_MENU_BAR_POPUP_DELAY" ); } while (0); |
| 1439 | |
| 1440 | /** |
| 1441 | * CtkSettings:ctk-scrolled-window-placement: |
| 1442 | * |
| 1443 | * Where the contents of scrolled windows are located with respect to the |
| 1444 | * scrollbars, if not overridden by the scrolled window's own placement. |
| 1445 | * |
| 1446 | * Since: 2.10 |
| 1447 | * |
| 1448 | * Deprecated: 3.10: This setting is ignored. |
| 1449 | */ |
| 1450 | result = settings_install_property_parser (class, |
| 1451 | g_param_spec_enum ("ctk-scrolled-window-placement", |
| 1452 | P_("Scrolled Window Placement")g_dgettext("ctk30" "-properties","Scrolled Window Placement"), |
| 1453 | P_("Where the contents of scrolled windows are located with respect to the scrollbars, if not overridden by the scrolled window's own placement.")g_dgettext("ctk30" "-properties","Where the contents of scrolled windows are located with respect to the scrollbars, if not overridden by the scrolled window's own placement." ), |
| 1454 | CTK_TYPE_CORNER_TYPE(ctk_corner_type_get_type ()), |
| 1455 | CTK_CORNER_TOP_LEFT, |
| 1456 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1457 | ctk_rc_property_parse_enum); |
| 1458 | g_assert (result == PROP_SCROLLED_WINDOW_PLACEMENT)do { if (result == PROP_SCROLLED_WINDOW_PLACEMENT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1458, ((const char*) (__func__)), "result == PROP_SCROLLED_WINDOW_PLACEMENT" ); } while (0); |
| 1459 | |
| 1460 | /** |
| 1461 | * CtkSettings:ctk-can-change-accels: |
| 1462 | * |
| 1463 | * Whether menu accelerators can be changed by pressing a key over the menu item. |
| 1464 | * |
| 1465 | * Deprecated: 3.10: This setting is ignored. |
| 1466 | */ |
| 1467 | result = settings_install_property_parser (class, |
| 1468 | g_param_spec_boolean ("ctk-can-change-accels", |
| 1469 | P_("Can change accelerators")g_dgettext("ctk30" "-properties","Can change accelerators"), |
| 1470 | P_("Whether menu accelerators can be changed by pressing a key over the menu item")g_dgettext("ctk30" "-properties","Whether menu accelerators can be changed by pressing a key over the menu item" ), |
| 1471 | FALSE(0), |
| 1472 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1473 | NULL((void*)0)); |
| 1474 | g_assert (result == PROP_CAN_CHANGE_ACCELS)do { if (result == PROP_CAN_CHANGE_ACCELS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1474, ((const char*) (__func__)), "result == PROP_CAN_CHANGE_ACCELS" ); } while (0); |
| 1475 | |
| 1476 | /** |
| 1477 | * CtkSettings:ctk-menu-popup-delay: |
| 1478 | * |
| 1479 | * Minimum time the pointer must stay over a menu item before the submenu appear. |
| 1480 | * |
| 1481 | * Deprecated: 3.10: This setting is ignored. |
| 1482 | */ |
| 1483 | result = settings_install_property_parser (class, |
| 1484 | g_param_spec_int ("ctk-menu-popup-delay", |
| 1485 | P_("Delay before submenus appear")g_dgettext("ctk30" "-properties","Delay before submenus appear" ), |
| 1486 | P_("Minimum time the pointer must stay over a menu item before the submenu appear")g_dgettext("ctk30" "-properties","Minimum time the pointer must stay over a menu item before the submenu appear" ), |
| 1487 | 0, G_MAXINT2147483647, |
| 1488 | 225, |
| 1489 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1490 | NULL((void*)0)); |
| 1491 | g_assert (result == PROP_MENU_POPUP_DELAY)do { if (result == PROP_MENU_POPUP_DELAY) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1491, ((const char*) (__func__)), "result == PROP_MENU_POPUP_DELAY" ); } while (0); |
| 1492 | |
| 1493 | /** |
| 1494 | * CtkSettings:ctk-menu-popdown-delay: |
| 1495 | * |
| 1496 | * The time before hiding a submenu when the pointer is moving towards the submenu. |
| 1497 | * |
| 1498 | * Deprecated: 3.10: This setting is ignored. |
| 1499 | */ |
| 1500 | result = settings_install_property_parser (class, |
| 1501 | g_param_spec_int ("ctk-menu-popdown-delay", |
| 1502 | P_("Delay before hiding a submenu")g_dgettext("ctk30" "-properties","Delay before hiding a submenu" ), |
| 1503 | P_("The time before hiding a submenu when the pointer is moving towards the submenu")g_dgettext("ctk30" "-properties","The time before hiding a submenu when the pointer is moving towards the submenu" ), |
| 1504 | 0, G_MAXINT2147483647, |
| 1505 | 1000, |
| 1506 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1507 | NULL((void*)0)); |
| 1508 | g_assert (result == PROP_MENU_POPDOWN_DELAY)do { if (result == PROP_MENU_POPDOWN_DELAY) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1508, ((const char*) (__func__)), "result == PROP_MENU_POPDOWN_DELAY" ); } while (0); |
| 1509 | |
| 1510 | result = settings_install_property_parser (class, |
| 1511 | g_param_spec_boolean ("ctk-label-select-on-focus", |
| 1512 | P_("Select on focus")g_dgettext("ctk30" "-properties","Select on focus"), |
| 1513 | P_("Whether to select the contents of a selectable label when it is focused")g_dgettext("ctk30" "-properties","Whether to select the contents of a selectable label when it is focused" ), |
| 1514 | TRUE(!(0)), |
| 1515 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1516 | NULL((void*)0)); |
| 1517 | g_assert (result == PROP_LABEL_SELECT_ON_FOCUS)do { if (result == PROP_LABEL_SELECT_ON_FOCUS) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1517, ((const char*) (__func__)), "result == PROP_LABEL_SELECT_ON_FOCUS" ); } while (0); |
| 1518 | |
| 1519 | /** |
| 1520 | * CtkSettings:ctk-color-palette: |
| 1521 | * |
| 1522 | * Palette to use in the deprecated color selector. |
| 1523 | * |
| 1524 | * Deprecated: 3.10: Only used by the deprecated color selector widget. |
| 1525 | */ |
| 1526 | result = settings_install_property_parser (class, |
| 1527 | g_param_spec_string ("ctk-color-palette", |
| 1528 | P_("Custom palette")g_dgettext("ctk30" "-properties","Custom palette"), |
| 1529 | P_("Palette to use in the color selector")g_dgettext("ctk30" "-properties","Palette to use in the color selector" ), |
| 1530 | default_color_palette, |
| 1531 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1532 | NULL((void*)0)); |
| 1533 | g_assert (result == PROP_COLOR_PALETTE)do { if (result == PROP_COLOR_PALETTE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1533, ((const char*) (__func__)), "result == PROP_COLOR_PALETTE" ); } while (0); |
| 1534 | |
| 1535 | /** |
| 1536 | * CtkSettings:ctk-im-preedit-style: |
| 1537 | * |
| 1538 | * How to draw the input method preedit string. |
| 1539 | * |
| 1540 | * Deprecated: 3.10: This setting is ignored. |
| 1541 | */ |
| 1542 | result = settings_install_property_parser (class, |
| 1543 | g_param_spec_enum ("ctk-im-preedit-style", |
| 1544 | P_("IM Preedit style")g_dgettext("ctk30" "-properties","IM Preedit style"), |
| 1545 | P_("How to draw the input method preedit string")g_dgettext("ctk30" "-properties","How to draw the input method preedit string" ), |
| 1546 | CTK_TYPE_IM_PREEDIT_STYLE(ctk_im_preedit_style_get_type ()), |
| 1547 | CTK_IM_PREEDIT_CALLBACK, |
| 1548 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1549 | ctk_rc_property_parse_enum); |
| 1550 | g_assert (result == PROP_IM_PREEDIT_STYLE)do { if (result == PROP_IM_PREEDIT_STYLE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1550, ((const char*) (__func__)), "result == PROP_IM_PREEDIT_STYLE" ); } while (0); |
| 1551 | |
| 1552 | /** |
| 1553 | * CtkSettings:ctk-im-status-style: |
| 1554 | * |
| 1555 | * How to draw the input method statusbar. |
| 1556 | * |
| 1557 | * Deprecated: 3.10: This setting is ignored. |
| 1558 | */ |
| 1559 | result = settings_install_property_parser (class, |
| 1560 | g_param_spec_enum ("ctk-im-status-style", |
| 1561 | P_("IM Status style")g_dgettext("ctk30" "-properties","IM Status style"), |
| 1562 | P_("How to draw the input method statusbar")g_dgettext("ctk30" "-properties","How to draw the input method statusbar" ), |
| 1563 | CTK_TYPE_IM_STATUS_STYLE(ctk_im_status_style_get_type ()), |
| 1564 | CTK_IM_STATUS_CALLBACK, |
| 1565 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB | G_PARAM_DEPRECATED), |
| 1566 | ctk_rc_property_parse_enum); |
| 1567 | g_assert (result == PROP_IM_STATUS_STYLE)do { if (result == PROP_IM_STATUS_STYLE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1567, ((const char*) (__func__)), "result == PROP_IM_STATUS_STYLE" ); } while (0); |
| 1568 | |
| 1569 | result = settings_install_property_parser (class, |
| 1570 | g_param_spec_boolean ("ctk-shell-shows-app-menu", |
| 1571 | P_("Desktop shell shows app menu")g_dgettext("ctk30" "-properties","Desktop shell shows app menu" ), |
| 1572 | P_("Set to TRUE if the desktop environment "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the app menu, FALSE if " "the app should display it itself." ) |
| 1573 | "is displaying the app menu, FALSE if "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the app menu, FALSE if " "the app should display it itself." ) |
| 1574 | "the app should display it itself.")g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the app menu, FALSE if " "the app should display it itself." ), |
| 1575 | FALSE(0), CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1576 | NULL((void*)0)); |
| 1577 | g_assert (result == PROP_SHELL_SHOWS_APP_MENU)do { if (result == PROP_SHELL_SHOWS_APP_MENU) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1577, ((const char*) (__func__)), "result == PROP_SHELL_SHOWS_APP_MENU" ); } while (0); |
| 1578 | |
| 1579 | result = settings_install_property_parser (class, |
| 1580 | g_param_spec_boolean ("ctk-shell-shows-menubar", |
| 1581 | P_("Desktop shell shows the menubar")g_dgettext("ctk30" "-properties","Desktop shell shows the menubar" ), |
| 1582 | P_("Set to TRUE if the desktop environment "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the menubar, FALSE if " "the app should display it itself." ) |
| 1583 | "is displaying the menubar, FALSE if "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the menubar, FALSE if " "the app should display it itself." ) |
| 1584 | "the app should display it itself.")g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the menubar, FALSE if " "the app should display it itself." ), |
| 1585 | FALSE(0), CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1586 | NULL((void*)0)); |
| 1587 | g_assert (result == PROP_SHELL_SHOWS_MENUBAR)do { if (result == PROP_SHELL_SHOWS_MENUBAR) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1587, ((const char*) (__func__)), "result == PROP_SHELL_SHOWS_MENUBAR" ); } while (0); |
| 1588 | |
| 1589 | result = settings_install_property_parser (class, |
| 1590 | g_param_spec_boolean ("ctk-shell-shows-desktop", |
| 1591 | P_("Desktop environment shows the desktop folder")g_dgettext("ctk30" "-properties","Desktop environment shows the desktop folder" ), |
| 1592 | P_("Set to TRUE if the desktop environment "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the desktop folder, FALSE " "if not.") |
| 1593 | "is displaying the desktop folder, FALSE "g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the desktop folder, FALSE " "if not.") |
| 1594 | "if not.")g_dgettext("ctk30" "-properties","Set to TRUE if the desktop environment " "is displaying the desktop folder, FALSE " "if not."), |
| 1595 | TRUE(!(0)), CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1596 | NULL((void*)0)); |
| 1597 | g_assert (result == PROP_SHELL_SHOWS_DESKTOP)do { if (result == PROP_SHELL_SHOWS_DESKTOP) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1597, ((const char*) (__func__)), "result == PROP_SHELL_SHOWS_DESKTOP" ); } while (0); |
| 1598 | |
| 1599 | /** |
| 1600 | * CtkSettings:ctk-decoration-layout: |
| 1601 | * |
| 1602 | * This setting determines which buttons should be put in the |
| 1603 | * titlebar of client-side decorated windows, and whether they |
| 1604 | * should be placed at the left of right. |
| 1605 | * |
| 1606 | * The format of the string is button names, separated by commas. |
| 1607 | * A colon separates the buttons that should appear on the left |
| 1608 | * from those on the right. Recognized button names are minimize, |
| 1609 | * maximize, close, icon (the window icon) and menu (a menu button |
| 1610 | * for the fallback app menu). |
| 1611 | * |
| 1612 | * For example, "menu:minimize,maximize,close" specifies a menu |
| 1613 | * on the left, and minimize, maximize and close buttons on the right. |
| 1614 | * |
| 1615 | * Note that buttons will only be shown when they are meaningful. |
| 1616 | * E.g. a menu button only appears when the desktop shell does not |
| 1617 | * show the app menu, and a close button only appears on a window |
| 1618 | * that can be closed. |
| 1619 | * |
| 1620 | * Also note that the setting can be overridden with the |
| 1621 | * #CtkHeaderBar:decoration-layout property. |
| 1622 | * |
| 1623 | * Since: 3.12 |
| 1624 | */ |
| 1625 | result = settings_install_property_parser (class, |
| 1626 | g_param_spec_string ("ctk-decoration-layout", |
| 1627 | P_("Decoration Layout")g_dgettext("ctk30" "-properties","Decoration Layout"), |
| 1628 | P_("The layout for window decorations")g_dgettext("ctk30" "-properties","The layout for window decorations" ), |
| 1629 | "menu:minimize,maximize,close", CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1630 | NULL((void*)0)); |
| 1631 | g_assert (result == PROP_DECORATION_LAYOUT)do { if (result == PROP_DECORATION_LAYOUT) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1631, ((const char*) (__func__)), "result == PROP_DECORATION_LAYOUT" ); } while (0); |
| 1632 | |
| 1633 | /** |
| 1634 | * CtkSettings:ctk-titlebar-double-click: |
| 1635 | * |
| 1636 | * This setting determines the action to take when a double-click |
| 1637 | * occurs on the titlebar of client-side decorated windows. |
| 1638 | * |
| 1639 | * Recognized actions are minimize, toggle-maximize, menu, lower |
| 1640 | * or none. |
| 1641 | * |
| 1642 | * Since: 3.14 |
| 1643 | */ |
| 1644 | result = settings_install_property_parser (class, |
| 1645 | g_param_spec_string ("ctk-titlebar-double-click", |
| 1646 | P_("Titlebar double-click action")g_dgettext("ctk30" "-properties","Titlebar double-click action" ), |
| 1647 | P_("The action to take on titlebar double-click")g_dgettext("ctk30" "-properties","The action to take on titlebar double-click" ), |
| 1648 | "toggle-maximize", CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1649 | NULL((void*)0)); |
| 1650 | g_assert (result == PROP_TITLEBAR_DOUBLE_CLICK)do { if (result == PROP_TITLEBAR_DOUBLE_CLICK) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1650, ((const char*) (__func__)), "result == PROP_TITLEBAR_DOUBLE_CLICK" ); } while (0); |
| 1651 | |
| 1652 | /** |
| 1653 | * CtkSettings:ctk-titlebar-middle-click: |
| 1654 | * |
| 1655 | * This setting determines the action to take when a middle-click |
| 1656 | * occurs on the titlebar of client-side decorated windows. |
| 1657 | * |
| 1658 | * Recognized actions are minimize, toggle-maximize, menu, lower |
| 1659 | * or none. |
| 1660 | * |
| 1661 | * Since: 3.14 |
| 1662 | */ |
| 1663 | result = settings_install_property_parser (class, |
| 1664 | g_param_spec_string ("ctk-titlebar-middle-click", |
| 1665 | P_("Titlebar middle-click action")g_dgettext("ctk30" "-properties","Titlebar middle-click action" ), |
| 1666 | P_("The action to take on titlebar middle-click")g_dgettext("ctk30" "-properties","The action to take on titlebar middle-click" ), |
| 1667 | "none", CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1668 | NULL((void*)0)); |
| 1669 | g_assert (result == PROP_TITLEBAR_MIDDLE_CLICK)do { if (result == PROP_TITLEBAR_MIDDLE_CLICK) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1669, ((const char*) (__func__)), "result == PROP_TITLEBAR_MIDDLE_CLICK" ); } while (0); |
| 1670 | |
| 1671 | /** |
| 1672 | * CtkSettings:ctk-titlebar-right-click: |
| 1673 | * |
| 1674 | * This setting determines the action to take when a right-click |
| 1675 | * occurs on the titlebar of client-side decorated windows. |
| 1676 | * |
| 1677 | * Recognized actions are minimize, toggle-maximize, menu, lower |
| 1678 | * or none. |
| 1679 | * |
| 1680 | * Since: 3.14 |
| 1681 | */ |
| 1682 | result = settings_install_property_parser (class, |
| 1683 | g_param_spec_string ("ctk-titlebar-right-click", |
| 1684 | P_("Titlebar right-click action")g_dgettext("ctk30" "-properties","Titlebar right-click action" ), |
| 1685 | P_("The action to take on titlebar right-click")g_dgettext("ctk30" "-properties","The action to take on titlebar right-click" ), |
| 1686 | "menu", CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1687 | NULL((void*)0)); |
| 1688 | g_assert (result == PROP_TITLEBAR_RIGHT_CLICK)do { if (result == PROP_TITLEBAR_RIGHT_CLICK) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1688, ((const char*) (__func__)), "result == PROP_TITLEBAR_RIGHT_CLICK" ); } while (0); |
| 1689 | |
| 1690 | |
| 1691 | |
| 1692 | |
| 1693 | /** |
| 1694 | * CtkSettings:ctk-dialogs-use-header: |
| 1695 | * |
| 1696 | * Whether builtin CTK+ dialogs such as the file chooser, the |
| 1697 | * color chooser or the font chooser will use a header bar at |
| 1698 | * the top to show action widgets, or an action area at the bottom. |
| 1699 | * |
| 1700 | * This setting does not affect custom dialogs using CtkDialog |
| 1701 | * directly, or message dialogs. |
| 1702 | * |
| 1703 | * Since: 3.12 |
| 1704 | */ |
| 1705 | result = settings_install_property_parser (class, |
| 1706 | g_param_spec_boolean ("ctk-dialogs-use-header", |
| 1707 | P_("Dialogs use header bar")g_dgettext("ctk30" "-properties","Dialogs use header bar"), |
| 1708 | P_("Whether builtin CTK+ dialogs should use a header bar instead of an action area.")g_dgettext("ctk30" "-properties","Whether builtin CTK+ dialogs should use a header bar instead of an action area." ), |
| 1709 | FALSE(0), |
| 1710 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1711 | NULL((void*)0)); |
| 1712 | g_assert (result == PROP_DIALOGS_USE_HEADER)do { if (result == PROP_DIALOGS_USE_HEADER) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1712, ((const char*) (__func__)), "result == PROP_DIALOGS_USE_HEADER" ); } while (0); |
| 1713 | |
| 1714 | /** |
| 1715 | * CtkSettings:ctk-enable-primary-paste: |
| 1716 | * |
| 1717 | * Whether a middle click on a mouse should paste the |
| 1718 | * 'PRIMARY' clipboard content at the cursor location. |
| 1719 | * |
| 1720 | * Since: 3.4 |
| 1721 | */ |
| 1722 | result = settings_install_property_parser (class, |
| 1723 | g_param_spec_boolean ("ctk-enable-primary-paste", |
| 1724 | P_("Enable primary paste")g_dgettext("ctk30" "-properties","Enable primary paste"), |
| 1725 | P_("Whether a middle click on a mouse should paste the 'PRIMARY' clipboard content at the cursor location.")g_dgettext("ctk30" "-properties","Whether a middle click on a mouse should paste the 'PRIMARY' clipboard content at the cursor location." ), |
| 1726 | TRUE(!(0)), |
| 1727 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1728 | NULL((void*)0)); |
| 1729 | g_assert (result == PROP_ENABLE_PRIMARY_PASTE)do { if (result == PROP_ENABLE_PRIMARY_PASTE) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1729, ((const char*) (__func__)), "result == PROP_ENABLE_PRIMARY_PASTE" ); } while (0); |
| 1730 | |
| 1731 | /** |
| 1732 | * CtkSettings:ctk-recent-files-enabled: |
| 1733 | * |
| 1734 | * Whether CTK+ should keep track of items inside the recently used |
| 1735 | * resources list. If set to %FALSE, the list will always be empty. |
| 1736 | * |
| 1737 | * Since: 3.8 |
| 1738 | */ |
| 1739 | result = settings_install_property_parser (class, |
| 1740 | g_param_spec_boolean ("ctk-recent-files-enabled", |
| 1741 | P_("Recent Files Enabled")g_dgettext("ctk30" "-properties","Recent Files Enabled"), |
| 1742 | P_("Whether CTK+ remembers recent files")g_dgettext("ctk30" "-properties","Whether CTK+ remembers recent files" ), |
| 1743 | TRUE(!(0)), |
| 1744 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1745 | NULL((void*)0)); |
| 1746 | g_assert (result == PROP_RECENT_FILES_ENABLED)do { if (result == PROP_RECENT_FILES_ENABLED) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1746, ((const char*) (__func__)), "result == PROP_RECENT_FILES_ENABLED" ); } while (0); |
| 1747 | |
| 1748 | /** |
| 1749 | * CtkSettings:ctk-long-press-time: |
| 1750 | * |
| 1751 | * The time for a button or touch press to be considered a "long press". |
| 1752 | * |
| 1753 | * Since: 3.14 |
| 1754 | */ |
| 1755 | result = settings_install_property_parser (class, |
| 1756 | g_param_spec_uint ("ctk-long-press-time", |
| 1757 | P_("Long press time")g_dgettext("ctk30" "-properties","Long press time"), |
| 1758 | P_("Time for a button/touch press to be considered a long press (in milliseconds)")g_dgettext("ctk30" "-properties","Time for a button/touch press to be considered a long press (in milliseconds)" ), |
| 1759 | 0, G_MAXINT2147483647, 500, |
| 1760 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1761 | NULL((void*)0)); |
| 1762 | g_assert (result == PROP_LONG_PRESS_TIME)do { if (result == PROP_LONG_PRESS_TIME) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1762, ((const char*) (__func__)), "result == PROP_LONG_PRESS_TIME" ); } while (0); |
| 1763 | |
| 1764 | /** |
| 1765 | * CtkSettings:ctk-keynav-use-caret: |
| 1766 | * |
| 1767 | * Whether CTK+ should make sure that text can be navigated with |
| 1768 | * a caret, even if it is not editable. This is useful when using |
| 1769 | * a screen reader. |
| 1770 | * |
| 1771 | * Since: 3.20 |
| 1772 | */ |
| 1773 | result = settings_install_property_parser (class, |
| 1774 | g_param_spec_boolean ("ctk-keynav-use-caret", |
| 1775 | P_("Whether to show cursor in text")g_dgettext("ctk30" "-properties","Whether to show cursor in text" ), |
| 1776 | P_("Whether to show cursor in text")g_dgettext("ctk30" "-properties","Whether to show cursor in text" ), |
| 1777 | FALSE(0), |
| 1778 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1779 | NULL((void*)0)); |
| 1780 | g_assert (result == PROP_KEYNAV_USE_CARET)do { if (result == PROP_KEYNAV_USE_CARET) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1780, ((const char*) (__func__)), "result == PROP_KEYNAV_USE_CARET" ); } while (0); |
| 1781 | |
| 1782 | /** |
| 1783 | * CtkSettings:ctk-overlay-scrolling: |
| 1784 | * |
| 1785 | * Whether scrolled windows may use overlayed scrolling indicators. |
| 1786 | * If this is set to %FALSE, scrolled windows will have permanent |
| 1787 | * scrollbars. |
| 1788 | * |
| 1789 | * Since: 3.24.9 |
| 1790 | */ |
| 1791 | result = settings_install_property_parser (class, |
| 1792 | g_param_spec_boolean ("ctk-overlay-scrolling", |
| 1793 | P_("Whether to use overlay scrollbars")g_dgettext("ctk30" "-properties","Whether to use overlay scrollbars" ), |
| 1794 | P_("Whether to use overlay scrollbars")g_dgettext("ctk30" "-properties","Whether to use overlay scrollbars" ), |
| 1795 | TRUE(!(0)), |
| 1796 | CTK_PARAM_READWRITEG_PARAM_READWRITE|G_PARAM_STATIC_NAME|G_PARAM_STATIC_NICK|G_PARAM_STATIC_BLURB), |
| 1797 | NULL((void*)0)); |
| 1798 | g_assert (result == PROP_OVERLAY_SCROLLING)do { if (result == PROP_OVERLAY_SCROLLING) ; else g_assertion_message_expr ("Ctk", "ctksettings.c", 1798, ((const char*) (__func__)), "result == PROP_OVERLAY_SCROLLING" ); } while (0); |
| 1799 | } |
| 1800 | |
| 1801 | static void |
| 1802 | ctk_settings_provider_iface_init (CtkStyleProviderIface *iface G_GNUC_UNUSED__attribute__ ((__unused__))) |
| 1803 | { |
| 1804 | } |
| 1805 | |
| 1806 | static CtkSettings * |
| 1807 | ctk_settings_style_provider_get_settings (CtkStyleProviderPrivate *provider) |
| 1808 | { |
| 1809 | return CTK_SETTINGS (provider)((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((provider)), ((ctk_settings_get_type ())))))); |
| 1810 | } |
| 1811 | |
| 1812 | static void |
| 1813 | ctk_settings_provider_private_init (CtkStyleProviderPrivateInterface *iface) |
| 1814 | { |
| 1815 | iface->get_settings = ctk_settings_style_provider_get_settings; |
| 1816 | } |
| 1817 | |
| 1818 | static void |
| 1819 | ctk_settings_finalize (GObject *object) |
| 1820 | { |
| 1821 | CtkSettings *settings = CTK_SETTINGS (object)((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((object)), ((ctk_settings_get_type ())))))); |
| 1822 | CtkSettingsPrivate *priv = settings->priv; |
| 1823 | guint i; |
| 1824 | |
| 1825 | object_list = g_slist_remove (object_list, settings); |
| 1826 | |
| 1827 | for (i = 0; i < class_n_properties; i++) |
| 1828 | g_value_unset (&priv->property_values[i].value); |
| 1829 | g_free (priv->property_values); |
| 1830 | |
| 1831 | g_datalist_clear (&priv->queued_settings); |
| 1832 | |
| 1833 | settings_update_provider (priv->screen, &priv->theme_provider, NULL((void*)0)); |
| 1834 | settings_update_provider (priv->screen, &priv->key_theme_provider, NULL((void*)0)); |
| 1835 | g_slist_free_full (priv->style_cascades, g_object_unref); |
| 1836 | |
| 1837 | g_free (priv->font_family); |
| 1838 | |
| 1839 | G_OBJECT_CLASS (ctk_settings_parent_class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass *) ((ctk_settings_parent_class)), (((GType) ((20) << (2 ))))))))->finalize (object); |
| 1840 | } |
| 1841 | |
| 1842 | CtkStyleCascade * |
| 1843 | _ctk_settings_get_style_cascade (CtkSettings *settings, |
| 1844 | gint scale) |
| 1845 | { |
| 1846 | CtkSettingsPrivate *priv; |
| 1847 | CtkStyleCascade *new_cascade; |
| 1848 | GSList *list; |
| 1849 | |
| 1850 | g_return_val_if_fail (CTK_IS_SETTINGS (settings), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((settings)); GType __t = ((ctk_settings_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__ )), "CTK_IS_SETTINGS (settings)"); return (((void*)0)); } } while (0); |
| 1851 | |
| 1852 | priv = settings->priv; |
| 1853 | for (list = priv->style_cascades; list; list = list->next) |
| 1854 | { |
| 1855 | if (_ctk_style_cascade_get_scale (list->data) == scale) |
| 1856 | return list->data; |
| 1857 | } |
| 1858 | |
| 1859 | /* We are guaranteed to have the special cascade with scale == 1. |
| 1860 | * It's created in ctk_settings_init() |
| 1861 | */ |
| 1862 | g_assert (scale != 1)do { if (scale != 1) ; else g_assertion_message_expr ("Ctk", "ctksettings.c" , 1862, ((const char*) (__func__)), "scale != 1"); } while (0 ); |
| 1863 | |
| 1864 | new_cascade = _ctk_style_cascade_new (); |
| 1865 | _ctk_style_cascade_set_parent (new_cascade, _ctk_settings_get_style_cascade (settings, 1)); |
| 1866 | _ctk_style_cascade_set_scale (new_cascade, scale); |
| 1867 | |
| 1868 | priv->style_cascades = g_slist_prepend (priv->style_cascades, new_cascade); |
| 1869 | |
| 1870 | return new_cascade; |
| 1871 | } |
| 1872 | |
| 1873 | static void |
| 1874 | settings_init_style (CtkSettings *settings) |
| 1875 | { |
| 1876 | static CtkCssProvider *css_provider = NULL((void*)0); |
| 1877 | CtkStyleCascade *cascade; |
| 1878 | |
| 1879 | /* Add provider for user file */ |
| 1880 | if (G_UNLIKELY (!css_provider)(!css_provider)) |
| 1881 | { |
| 1882 | gchar *css_path; |
| 1883 | |
| 1884 | css_provider = ctk_css_provider_new (); |
| 1885 | css_path = g_build_filename (g_get_user_config_dir (), |
| 1886 | "ctk-3.0", |
| 1887 | "ctk.css", |
| 1888 | NULL((void*)0)); |
| 1889 | |
| 1890 | if (g_file_test (css_path, |
| 1891 | G_FILE_TEST_IS_REGULAR)) |
| 1892 | ctk_css_provider_load_from_path (css_provider, css_path, NULL((void*)0)); |
| 1893 | |
| 1894 | g_free (css_path); |
| 1895 | } |
| 1896 | |
| 1897 | cascade = _ctk_settings_get_style_cascade (settings, 1); |
| 1898 | _ctk_style_cascade_add_provider (cascade, |
| 1899 | CTK_STYLE_PROVIDER (css_provider)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((css_provider)), ((ctk_style_provider_get_type ())))))), |
| 1900 | CTK_STYLE_PROVIDER_PRIORITY_USER800); |
| 1901 | |
| 1902 | _ctk_style_cascade_add_provider (cascade, |
| 1903 | CTK_STYLE_PROVIDER (settings)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((settings)), ((ctk_style_provider_get_type ( ))))))), |
| 1904 | CTK_STYLE_PROVIDER_PRIORITY_SETTINGS400); |
| 1905 | |
| 1906 | _ctk_style_cascade_add_provider (cascade, |
| 1907 | CTK_STYLE_PROVIDER (settings->priv->theme_provider)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((settings->priv->theme_provider)), ((ctk_style_provider_get_type ())))))), |
| 1908 | CTK_STYLE_PROVIDER_PRIORITY_SETTINGS400); |
| 1909 | |
| 1910 | settings_update_theme (settings); |
| 1911 | settings_update_key_theme (settings); |
| 1912 | } |
| 1913 | |
| 1914 | static void |
| 1915 | settings_display_closed (CdkDisplay *display, |
| 1916 | gboolean is_error G_GNUC_UNUSED__attribute__ ((__unused__)), |
| 1917 | gpointer data G_GNUC_UNUSED__attribute__ ((__unused__))) |
| 1918 | { |
| 1919 | DisplaySettings *ds; |
| 1920 | int i; |
| 1921 | |
| 1922 | if (G_UNLIKELY (display_settings == NULL)(display_settings == ((void*)0))) |
| 1923 | return; |
| 1924 | |
| 1925 | ds = (DisplaySettings *)display_settings->data; |
| 1926 | for (i = 0; i < display_settings->len; i++) |
| 1927 | { |
| 1928 | if (ds[i].display == display) |
| 1929 | { |
| 1930 | g_clear_object (&ds[i].settings)do { _Static_assert (sizeof *((&ds[i].settings)) == sizeof (gpointer), "Expression evaluates to false"); __typeof__ ((( &ds[i].settings))) _pp = ((&ds[i].settings)); __typeof__ (*((&ds[i].settings))) _ptr = *_pp; *_pp = ((void*)0); if (_ptr) (g_object_unref) (_ptr); } while (0); |
| 1931 | display_settings = g_array_remove_index_fast (display_settings, i); |
| 1932 | break; |
| 1933 | } |
| 1934 | } |
| 1935 | } |
| 1936 | |
| 1937 | static CtkSettings * |
| 1938 | ctk_settings_create_for_display (CdkDisplay *display) |
| 1939 | { |
| 1940 | CtkSettings *settings; |
| 1941 | DisplaySettings v; |
| 1942 | |
| 1943 | #ifdef CDK_WINDOWING_QUARTZ |
| 1944 | if (CDK_IS_QUARTZ_DISPLAY (display)) |
| 1945 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), |
| 1946 | "ctk-key-theme-name", "Mac", |
| 1947 | "ctk-shell-shows-app-menu", TRUE(!(0)), |
| 1948 | "ctk-shell-shows-menubar", TRUE(!(0)), |
| 1949 | NULL((void*)0)); |
| 1950 | else |
| 1951 | #endif |
| 1952 | #ifdef CDK_WINDOWING_BROADWAY |
| 1953 | if (CDK_IS_BROADWAY_DISPLAY (display)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (display)); GType __t = ((cdk_broadway_display_get_type())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) |
| 1954 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), |
| 1955 | "ctk-im-module", "broadway", |
| 1956 | NULL((void*)0)); |
| 1957 | else |
| 1958 | #endif |
| 1959 | #ifdef CDK_WINDOWING_WAYLAND |
| 1960 | if (CDK_IS_WAYLAND_DISPLAY (display)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (display)); GType __t = ((cdk_wayland_display_get_type())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) |
| 1961 | { |
| 1962 | if (cdk_wayland_display_query_registry (display, |
| 1963 | "zwp_text_input_manager_v3")) |
| 1964 | { |
| 1965 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), |
| 1966 | "ctk-im-module", "wayland", |
| 1967 | NULL((void*)0)); |
| 1968 | } |
| 1969 | else if (cdk_wayland_display_query_registry (display, |
| 1970 | "ctk_text_input_manager")) |
| 1971 | { |
| 1972 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), |
| 1973 | "ctk-im-module", "waylandctk", |
| 1974 | NULL((void*)0)); |
| 1975 | } |
| 1976 | else |
| 1977 | { |
| 1978 | /* Fallback to other IM methods if the compositor does not |
| 1979 | * implement the interface(s). |
| 1980 | */ |
| 1981 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), NULL((void*)0)); |
| 1982 | } |
| 1983 | } |
| 1984 | else |
| 1985 | #endif |
| 1986 | settings = g_object_new (CTK_TYPE_SETTINGS(ctk_settings_get_type ()), NULL((void*)0)); |
| 1987 | |
| 1988 | settings->priv->screen = cdk_display_get_default_screen (display); |
| 1989 | |
| 1990 | v.display = display; |
| 1991 | v.settings = settings; |
| 1992 | display_settings = g_array_append_val (display_settings, v)g_array_append_vals (display_settings, &(v), 1); |
| 1993 | g_signal_connect (display, "closed",g_signal_connect_data ((display), ("closed"), (((GCallback) ( settings_display_closed))), (((void*)0)), ((void*)0), (GConnectFlags ) 0) |
| 1994 | G_CALLBACK (settings_display_closed), NULL)g_signal_connect_data ((display), ("closed"), (((GCallback) ( settings_display_closed))), (((void*)0)), ((void*)0), (GConnectFlags ) 0); |
| 1995 | |
| 1996 | settings_init_style (settings); |
| 1997 | settings_update_xsettings (settings); |
| 1998 | settings_update_modules (settings); |
| 1999 | settings_update_double_click (settings); |
| 2000 | settings_update_cursor_theme (settings); |
| 2001 | settings_update_resolution (settings); |
| 2002 | settings_update_font_options (settings); |
| 2003 | settings_update_font_values (settings); |
| 2004 | |
| 2005 | return settings; |
| 2006 | } |
| 2007 | |
| 2008 | static CtkSettings * |
| 2009 | ctk_settings_get_for_display (CdkDisplay *display) |
| 2010 | { |
| 2011 | DisplaySettings *ds; |
| 2012 | int i; |
| 2013 | |
| 2014 | /* If the display is closed, we don't want to recreate the settings! */ |
| 2015 | if G_UNLIKELY (cdk_display_is_closed (display))(cdk_display_is_closed (display)) |
| 2016 | return NULL((void*)0); |
| 2017 | |
| 2018 | if G_UNLIKELY (display_settings == NULL)(display_settings == ((void*)0)) |
| 2019 | display_settings = g_array_new (FALSE(0), TRUE(!(0)), sizeof (DisplaySettings)); |
| 2020 | |
| 2021 | ds = (DisplaySettings *)display_settings->data; |
Casting a non-structure type to a structure type and accessing a field can lead to memory access errors or data corruption | |
| 2022 | for (i = 0; i < display_settings->len; i++) |
| 2023 | { |
| 2024 | if (ds[i].display == display) |
| 2025 | return ds[i].settings; |
| 2026 | } |
| 2027 | |
| 2028 | return ctk_settings_create_for_display (display); |
| 2029 | } |
| 2030 | |
| 2031 | /** |
| 2032 | * ctk_settings_get_for_screen: |
| 2033 | * @screen: a #CdkScreen. |
| 2034 | * |
| 2035 | * Gets the #CtkSettings object for @screen, creating it if necessary. |
| 2036 | * |
| 2037 | * Returns: (transfer none): a #CtkSettings object. |
| 2038 | * |
| 2039 | * Since: 2.2 |
| 2040 | */ |
| 2041 | CtkSettings * |
| 2042 | ctk_settings_get_for_screen (CdkScreen *screen) |
| 2043 | { |
| 2044 | g_return_val_if_fail (CDK_IS_SCREEN (screen), NULL)do { if (((((__extension__ ({ GTypeInstance *__inst = (GTypeInstance *) ((screen)); GType __t = ((cdk_screen_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__ )), "CDK_IS_SCREEN (screen)"); return (((void*)0)); } } while (0); |
| 2045 | |
| 2046 | return ctk_settings_get_for_display (cdk_screen_get_display (screen)); |
| 2047 | } |
| 2048 | |
| 2049 | /** |
| 2050 | * ctk_settings_get_default: |
| 2051 | * |
| 2052 | * Gets the #CtkSettings object for the default CDK screen, creating |
| 2053 | * it if necessary. See ctk_settings_get_for_screen(). |
| 2054 | * |
| 2055 | * Returns: (nullable) (transfer none): a #CtkSettings object. If there is |
| 2056 | * no default screen, then returns %NULL. |
| 2057 | **/ |
| 2058 | CtkSettings* |
| 2059 | ctk_settings_get_default (void) |
| 2060 | { |
| 2061 | CdkDisplay *display = cdk_display_get_default (); |
| 2062 | |
| 2063 | if (display) |
| 2064 | return ctk_settings_get_for_display (display); |
| 2065 | else |
| 2066 | return NULL((void*)0); |
| 2067 | } |
| 2068 | |
| 2069 | static void |
| 2070 | ctk_settings_set_property (GObject *object, |
| 2071 | guint property_id, |
| 2072 | const GValue *value, |
| 2073 | GParamSpec *pspec G_GNUC_UNUSED__attribute__ ((__unused__))) |
| 2074 | { |
| 2075 | CtkSettings *settings = CTK_SETTINGS (object)((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((object)), ((ctk_settings_get_type ())))))); |
| 2076 | CtkSettingsPrivate *priv = settings->priv; |
| 2077 | |
| 2078 | g_value_copy (value, &priv->property_values[property_id - 1].value); |
| 2079 | priv->property_values[property_id - 1].source = CTK_SETTINGS_SOURCE_APPLICATION; |
| 2080 | } |
| 2081 | |
| 2082 | static void |
| 2083 | settings_invalidate_style (CtkSettings *settings) |
| 2084 | { |
| 2085 | _ctk_style_provider_private_changed (CTK_STYLE_PROVIDER_PRIVATE (settings)((((CtkStyleProviderPrivate*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((_ctk_style_provider_private_get_type ()))))))); |
| 2086 | } |
| 2087 | |
| 2088 | static void |
| 2089 | settings_update_font_values (CtkSettings *settings) |
| 2090 | { |
| 2091 | CtkSettingsPrivate *priv = settings->priv; |
| 2092 | PangoFontDescription *desc; |
| 2093 | const gchar *font_name; |
| 2094 | |
| 2095 | font_name = g_value_get_string (&priv->property_values[PROP_FONT_NAME - 1].value); |
| 2096 | desc = pango_font_description_from_string (font_name); |
| 2097 | |
| 2098 | if (desc != NULL((void*)0) && |
| 2099 | (pango_font_description_get_set_fields (desc) & PANGO_FONT_MASK_SIZE) != 0) |
| 2100 | { |
| 2101 | priv->font_size = pango_font_description_get_size (desc); |
| 2102 | priv->font_size_absolute = pango_font_description_get_size_is_absolute (desc); |
| 2103 | } |
| 2104 | else |
| 2105 | { |
| 2106 | priv->font_size = 10 * PANGO_SCALE1024; |
| 2107 | priv->font_size_absolute = FALSE(0); |
| 2108 | } |
| 2109 | |
| 2110 | g_free (priv->font_family); |
| 2111 | |
| 2112 | if (desc != NULL((void*)0) && |
| 2113 | (pango_font_description_get_set_fields (desc) & PANGO_FONT_MASK_FAMILY) != 0) |
| 2114 | { |
| 2115 | priv->font_family = g_strdup (pango_font_description_get_family (desc))g_strdup_inline (pango_font_description_get_family (desc)); |
| 2116 | } |
| 2117 | else |
| 2118 | { |
| 2119 | priv->font_family = g_strdup ("Sans")g_strdup_inline ("Sans"); |
| 2120 | } |
| 2121 | |
| 2122 | if (desc) |
| 2123 | pango_font_description_free (desc); |
| 2124 | } |
| 2125 | |
| 2126 | static void |
| 2127 | ctk_settings_notify (GObject *object, |
| 2128 | GParamSpec *pspec) |
| 2129 | { |
| 2130 | CtkSettings *settings = CTK_SETTINGS (object)((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((object)), ((ctk_settings_get_type ())))))); |
| 2131 | CtkSettingsPrivate *priv = settings->priv; |
| 2132 | guint property_id = pspec->param_id; |
| 2133 | |
| 2134 | if (priv->screen == NULL((void*)0)) /* initialization */ |
| 2135 | return; |
| 2136 | |
| 2137 | switch (property_id) |
| 2138 | { |
| 2139 | case PROP_MODULES: |
| 2140 | settings_update_modules (settings); |
| 2141 | break; |
| 2142 | case PROP_DOUBLE_CLICK_TIME: |
| 2143 | case PROP_DOUBLE_CLICK_DISTANCE: |
| 2144 | settings_update_double_click (settings); |
| 2145 | break; |
| 2146 | case PROP_FONT_NAME: |
| 2147 | settings_update_font_values (settings); |
| 2148 | settings_invalidate_style (settings); |
| 2149 | ctk_style_context_reset_widgets (priv->screen); |
| 2150 | break; |
| 2151 | case PROP_KEY_THEME_NAME: |
| 2152 | settings_update_key_theme (settings); |
| 2153 | break; |
| 2154 | case PROP_THEME_NAME: |
| 2155 | case PROP_APPLICATION_PREFER_DARK_THEME: |
| 2156 | settings_update_theme (settings); |
| 2157 | break; |
| 2158 | case PROP_XFT_DPI: |
| 2159 | settings_update_resolution (settings); |
| 2160 | /* This is a hack because with ctk_rc_reset_styles() doesn't get |
| 2161 | * widgets with ctk_widget_style_set(), and also causes more |
| 2162 | * recomputation than necessary. |
| 2163 | */ |
| 2164 | ctk_style_context_reset_widgets (priv->screen); |
| 2165 | break; |
| 2166 | case PROP_XFT_ANTIALIAS: |
| 2167 | case PROP_XFT_HINTING: |
| 2168 | case PROP_XFT_HINTSTYLE: |
| 2169 | case PROP_XFT_RGBA: |
| 2170 | settings_update_font_options (settings); |
| 2171 | ctk_style_context_reset_widgets (priv->screen); |
| 2172 | break; |
| 2173 | case PROP_FONTCONFIG_TIMESTAMP: |
| 2174 | if (settings_update_fontconfig (settings)) |
| 2175 | ctk_style_context_reset_widgets (priv->screen); |
| 2176 | break; |
| 2177 | case PROP_ENABLE_ANIMATIONS: |
| 2178 | ctk_style_context_reset_widgets (priv->screen); |
| 2179 | break; |
| 2180 | case PROP_CURSOR_THEME_NAME: |
| 2181 | case PROP_CURSOR_THEME_SIZE: |
| 2182 | settings_update_cursor_theme (settings); |
| 2183 | break; |
| 2184 | } |
| 2185 | } |
| 2186 | |
| 2187 | gboolean |
| 2188 | _ctk_settings_parse_convert (CtkRcPropertyParser parser, |
| 2189 | const GValue *src_value, |
| 2190 | GParamSpec *pspec, |
| 2191 | GValue *dest_value) |
| 2192 | { |
| 2193 | gboolean success = FALSE(0); |
| 2194 | |
| 2195 | g_return_val_if_fail (G_VALUE_HOLDS (dest_value, G_PARAM_SPEC_VALUE_TYPE (pspec)), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((dest_value)); GType __t = (((((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((pspec)), (((GType) ((19) << (2)))) ))))->value_type))); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_VALUE_HOLDS (dest_value, G_PARAM_SPEC_VALUE_TYPE (pspec))" ); return ((0)); } } while (0); |
| 2196 | |
| 2197 | if (parser) |
| 2198 | { |
| 2199 | GString *gstring; |
| 2200 | gboolean free_gstring = TRUE(!(0)); |
| 2201 | |
| 2202 | if (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING)(((__extension__ ({ const GValue *__val = (const GValue*) ((src_value )); GType __t = (((g_gstring_get_type ()))); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = ( !(0)); else __r = g_type_check_value_holds (__val, __t); __r; }))))) |
| 2203 | { |
| 2204 | gstring = g_value_get_boxed (src_value); |
| 2205 | free_gstring = FALSE(0); |
| 2206 | } |
| 2207 | else if (G_VALUE_HOLDS_LONG (src_value)(((__extension__ ({ const GValue *__val = (const GValue*) ((src_value )); GType __t = (((GType) ((8) << (2)))); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r ; }))))) |
| 2208 | { |
| 2209 | gstring = g_string_new (NULL((void*)0)); |
| 2210 | g_string_append_printf (gstring, "%ld", g_value_get_long (src_value)); |
| 2211 | } |
| 2212 | else if (G_VALUE_HOLDS_DOUBLE (src_value)(((__extension__ ({ const GValue *__val = (const GValue*) ((src_value )); GType __t = (((GType) ((15) << (2)))); gboolean __r ; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r ; }))))) |
| 2213 | { |
| 2214 | gstring = g_string_new (NULL((void*)0)); |
| 2215 | g_string_append_printf (gstring, "%f", g_value_get_double (src_value)); |
| 2216 | } |
| 2217 | else if (G_VALUE_HOLDS_STRING (src_value)(((__extension__ ({ const GValue *__val = (const GValue*) ((src_value )); GType __t = (((GType) ((16) << (2)))); gboolean __r ; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r ; }))))) |
| 2218 | { |
| 2219 | gchar *tstr = g_strescape (g_value_get_string (src_value), NULL((void*)0)); |
| 2220 | |
| 2221 | gstring = g_string_new (NULL((void*)0)); |
| 2222 | g_string_append_c (gstring, '\"')g_string_append_c_inline (gstring, '\"'); |
| 2223 | g_string_append (gstring, tstr)(__builtin_constant_p (tstr) ? __extension__ ({ const char * const __val = (tstr); g_string_append_len_inline (gstring, __val, ( __val != ((void*)0)) ? (gssize) strlen (((__val) + !(__val))) : (gssize) -1); }) : g_string_append_len_inline (gstring, tstr , (gssize) -1)); |
| 2224 | g_string_append_c (gstring, '\"')g_string_append_c_inline (gstring, '\"'); |
| 2225 | g_free (tstr); |
| 2226 | } |
| 2227 | else |
| 2228 | { |
| 2229 | g_return_val_if_fail (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((src_value)); GType __t = (((g_gstring_get_type ()))); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t ) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t ); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ( (const char*) (__func__)), "G_VALUE_HOLDS (src_value, G_TYPE_GSTRING)" ); return ((0)); } } while (0); |
| 2230 | gstring = NULL((void*)0); /* silence compiler */ |
| 2231 | } |
| 2232 | |
| 2233 | success = (parser (pspec, gstring, dest_value) && |
| 2234 | !g_param_value_validate (pspec, dest_value)); |
| 2235 | |
| 2236 | if (free_gstring) |
| 2237 | g_string_free (gstring, TRUE)(__builtin_constant_p ((!(0))) ? (((!(0))) ? (g_string_free) ( (gstring), ((!(0)))) : g_string_free_and_steal (gstring)) : ( g_string_free) ((gstring), ((!(0))))); |
| 2238 | } |
| 2239 | else if (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING)(((__extension__ ({ const GValue *__val = (const GValue*) ((src_value )); GType __t = (((g_gstring_get_type ()))); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = ( !(0)); else __r = g_type_check_value_holds (__val, __t); __r; }))))) |
| 2240 | { |
| 2241 | if (G_VALUE_HOLDS (dest_value, G_TYPE_STRING)(((__extension__ ({ const GValue *__val = (const GValue*) ((dest_value )); GType __t = ((((GType) ((16) << (2))))); gboolean __r ; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r ; }))))) |
| 2242 | { |
| 2243 | GString *gstring = g_value_get_boxed (src_value); |
| 2244 | |
| 2245 | g_value_set_string (dest_value, gstring ? gstring->str : NULL((void*)0)); |
| 2246 | success = !g_param_value_validate (pspec, dest_value); |
| 2247 | } |
| 2248 | } |
| 2249 | else if (g_value_type_transformable (G_VALUE_TYPE (src_value)(((GValue*) (src_value))->g_type), G_VALUE_TYPE (dest_value)(((GValue*) (dest_value))->g_type))) |
| 2250 | success = g_param_value_convert (pspec, src_value, dest_value, TRUE(!(0))); |
| 2251 | |
| 2252 | return success; |
| 2253 | } |
| 2254 | |
| 2255 | static void |
| 2256 | apply_queued_setting (CtkSettings *settings, |
| 2257 | GParamSpec *pspec, |
| 2258 | CtkSettingsValuePrivate *qvalue) |
| 2259 | { |
| 2260 | CtkSettingsPrivate *priv = settings->priv; |
| 2261 | GValue tmp_value = G_VALUE_INIT{ 0, { { 0 } } }; |
| 2262 | CtkRcPropertyParser parser = (CtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser); |
| 2263 | |
| 2264 | g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type )); |
| 2265 | if (_ctk_settings_parse_convert (parser, &qvalue->public.value, |
| 2266 | pspec, &tmp_value)) |
| 2267 | { |
| 2268 | if (priv->property_values[pspec->param_id - 1].source <= qvalue->source) |
| 2269 | { |
| 2270 | g_value_copy (&tmp_value, &priv->property_values[pspec->param_id - 1].value); |
| 2271 | priv->property_values[pspec->param_id - 1].source = qvalue->source; |
| 2272 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 2273 | } |
| 2274 | |
| 2275 | } |
| 2276 | else |
| 2277 | { |
| 2278 | gchar *debug = g_strdup_value_contents (&qvalue->public.value); |
| 2279 | |
| 2280 | g_message ("%s: failed to retrieve property '%s' of type '%s' from rc file value \"%s\" of type '%s'", |
| 2281 | qvalue->public.origin ? qvalue->public.origin : "(for origin information, set CTK_DEBUG)", |
| 2282 | pspec->name, |
| 2283 | g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type )), |
| 2284 | debug, |
| 2285 | G_VALUE_TYPE_NAME (&tmp_value)(g_type_name ((((GValue*) (&tmp_value))->g_type)))); |
| 2286 | g_free (debug); |
| 2287 | } |
| 2288 | g_value_unset (&tmp_value); |
| 2289 | } |
| 2290 | |
| 2291 | static guint |
| 2292 | settings_install_property_parser (CtkSettingsClass *class, |
| 2293 | GParamSpec *pspec, |
| 2294 | CtkRcPropertyParser parser) |
| 2295 | { |
| 2296 | GSList *node, *next; |
| 2297 | |
| 2298 | switch (G_TYPE_FUNDAMENTAL (G_PARAM_SPEC_VALUE_TYPE (pspec))(g_type_fundamental ((((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((pspec)), (((GType) ((19) << (2)))) ))))->value_type)))) |
| 2299 | { |
| 2300 | case G_TYPE_BOOLEAN((GType) ((5) << (2))): |
| 2301 | case G_TYPE_UCHAR((GType) ((4) << (2))): |
| 2302 | case G_TYPE_CHAR((GType) ((3) << (2))): |
| 2303 | case G_TYPE_UINT((GType) ((7) << (2))): |
| 2304 | case G_TYPE_INT((GType) ((6) << (2))): |
| 2305 | case G_TYPE_ULONG((GType) ((9) << (2))): |
| 2306 | case G_TYPE_LONG((GType) ((8) << (2))): |
| 2307 | case G_TYPE_FLOAT((GType) ((14) << (2))): |
| 2308 | case G_TYPE_DOUBLE((GType) ((15) << (2))): |
| 2309 | case G_TYPE_STRING((GType) ((16) << (2))): |
| 2310 | case G_TYPE_ENUM((GType) ((12) << (2))): |
| 2311 | break; |
| 2312 | case G_TYPE_BOXED((GType) ((18) << (2))): |
| 2313 | if (strcmp (g_param_spec_get_name (pspec), "color-hash") == 0) |
| 2314 | { |
| 2315 | break; |
| 2316 | } |
| 2317 | /* fall through */ |
| 2318 | default: |
| 2319 | if (!parser) |
| 2320 | { |
| 2321 | g_warning (G_STRLOC"ctksettings.c" ":" "2321" ": parser needs to be specified for property \"%s\" of type '%s'", |
| 2322 | pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type ))); |
| 2323 | return 0; |
| 2324 | } |
| 2325 | } |
| 2326 | if (g_object_class_find_property (G_OBJECT_CLASS (class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass *) ((class)), (((GType) ((20) << (2)))))))), pspec->name)) |
| 2327 | { |
| 2328 | g_warning (G_STRLOC"ctksettings.c" ":" "2328" ": an rc-data property \"%s\" already exists", |
| 2329 | pspec->name); |
| 2330 | return 0; |
| 2331 | } |
| 2332 | |
| 2333 | for (node = object_list; node; node = node->next) |
| 2334 | g_object_freeze_notify (node->data); |
| 2335 | |
| 2336 | g_object_class_install_property (G_OBJECT_CLASS (class)((((GObjectClass*) (void *) g_type_check_class_cast ((GTypeClass *) ((class)), (((GType) ((20) << (2)))))))), ++class_n_properties, pspec); |
| 2337 | g_param_spec_set_qdata (pspec, quark_property_parser, (gpointer) parser); |
| 2338 | |
| 2339 | for (node = object_list; node; node = node->next) |
| 2340 | { |
| 2341 | CtkSettings *settings = node->data; |
| 2342 | CtkSettingsPrivate *priv = settings->priv; |
| 2343 | CtkSettingsValuePrivate *qvalue; |
| 2344 | |
| 2345 | priv->property_values = g_renew (CtkSettingsPropertyValue, priv->property_values, class_n_properties)((CtkSettingsPropertyValue *) g_realloc_n (priv->property_values , (class_n_properties), sizeof (CtkSettingsPropertyValue))); |
| 2346 | priv->property_values[class_n_properties - 1].value.g_type = 0; |
| 2347 | g_value_init (&priv->property_values[class_n_properties - 1].value, G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type )); |
| 2348 | g_param_value_set_default (pspec, &priv->property_values[class_n_properties - 1].value); |
| 2349 | priv->property_values[class_n_properties - 1].source = CTK_SETTINGS_SOURCE_DEFAULT; |
| 2350 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 2351 | |
| 2352 | qvalue = g_datalist_id_dup_data (&priv->queued_settings, g_param_spec_get_name_quark (pspec), NULL((void*)0), NULL((void*)0)); |
| 2353 | if (qvalue) |
| 2354 | apply_queued_setting (settings, pspec, qvalue); |
| 2355 | } |
| 2356 | |
| 2357 | for (node = object_list; node; node = next) |
| 2358 | { |
| 2359 | next = node->next; |
| 2360 | g_object_thaw_notify (node->data); |
| 2361 | } |
| 2362 | |
| 2363 | return class_n_properties; |
| 2364 | } |
| 2365 | |
| 2366 | CtkRcPropertyParser |
| 2367 | _ctk_rc_property_parser_from_type (GType type) |
| 2368 | { |
| 2369 | if (type == g_type_from_name ("CdkColor")) |
| 2370 | return ctk_rc_property_parse_color; |
| 2371 | else if (type == CTK_TYPE_REQUISITION(ctk_requisition_get_type ())) |
| 2372 | return ctk_rc_property_parse_requisition; |
| 2373 | else if (type == CTK_TYPE_BORDER(ctk_border_get_type ())) |
| 2374 | return ctk_rc_property_parse_border; |
| 2375 | else if (G_TYPE_FUNDAMENTAL (type)(g_type_fundamental (type)) == G_TYPE_ENUM((GType) ((12) << (2))) && G_TYPE_IS_DERIVED (type)((type) > (255 << (2)))) |
| 2376 | return ctk_rc_property_parse_enum; |
| 2377 | else if (G_TYPE_FUNDAMENTAL (type)(g_type_fundamental (type)) == G_TYPE_FLAGS((GType) ((13) << (2))) && G_TYPE_IS_DERIVED (type)((type) > (255 << (2)))) |
| 2378 | return ctk_rc_property_parse_flags; |
| 2379 | else |
| 2380 | return NULL((void*)0); |
| 2381 | } |
| 2382 | |
| 2383 | /** |
| 2384 | * ctk_settings_install_property: |
| 2385 | * @pspec: |
| 2386 | * |
| 2387 | * Deprecated: 3.16: This function is not useful outside CTK+. |
| 2388 | */ |
| 2389 | void |
| 2390 | ctk_settings_install_property (GParamSpec *pspec) |
| 2391 | { |
| 2392 | static CtkSettingsClass *klass = NULL((void*)0); |
| 2393 | |
| 2394 | CtkRcPropertyParser parser; |
| 2395 | |
| 2396 | g_return_if_fail (G_IS_PARAM_SPEC (pspec))do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return; } } while (0); |
| 2397 | |
| 2398 | if (! klass) |
| 2399 | klass = g_type_class_ref (CTK_TYPE_SETTINGS(ctk_settings_get_type ())); |
| 2400 | |
| 2401 | parser = _ctk_rc_property_parser_from_type (G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type )); |
| 2402 | |
| 2403 | settings_install_property_parser (klass, pspec, parser); |
| 2404 | } |
| 2405 | |
| 2406 | /** |
| 2407 | * ctk_settings_install_property_parser: |
| 2408 | * @pspec: |
| 2409 | * @parser: (scope call): |
| 2410 | * |
| 2411 | * Deprecated: 3.16: This function is not useful outside CTK+. |
| 2412 | */ |
| 2413 | void |
| 2414 | ctk_settings_install_property_parser (GParamSpec *pspec, |
| 2415 | CtkRcPropertyParser parser) |
| 2416 | { |
| 2417 | static CtkSettingsClass *klass = NULL((void*)0); |
| 2418 | |
| 2419 | g_return_if_fail (G_IS_PARAM_SPEC (pspec))do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return; } } while (0); |
| 2420 | g_return_if_fail (parser != NULL)do { if ((parser != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "parser != NULL"); return ; } } while (0); |
| 2421 | |
| 2422 | if (! klass) |
| 2423 | klass = g_type_class_ref (CTK_TYPE_SETTINGS(ctk_settings_get_type ())); |
| 2424 | |
| 2425 | settings_install_property_parser (klass, pspec, parser); |
| 2426 | } |
| 2427 | |
| 2428 | static void |
| 2429 | free_value (gpointer data) |
| 2430 | { |
| 2431 | CtkSettingsValuePrivate *qvalue = data; |
| 2432 | |
| 2433 | g_value_unset (&qvalue->public.value); |
| 2434 | g_free (qvalue->public.origin); |
| 2435 | g_slice_free (CtkSettingsValuePrivate, qvalue)do { if (1) g_slice_free1 (sizeof (CtkSettingsValuePrivate), ( qvalue)); else (void) ((CtkSettingsValuePrivate*) 0 == (qvalue )); } while (0); |
| 2436 | } |
| 2437 | |
| 2438 | static void |
| 2439 | ctk_settings_set_property_value_internal (CtkSettings *settings, |
| 2440 | const gchar *prop_name, |
| 2441 | const CtkSettingsValue *new_value, |
| 2442 | CtkSettingsSource source) |
| 2443 | { |
| 2444 | CtkSettingsPrivate *priv = settings->priv; |
| 2445 | CtkSettingsValuePrivate *qvalue; |
| 2446 | GParamSpec *pspec; |
| 2447 | gchar *name; |
| 2448 | GQuark name_quark; |
| 2449 | |
| 2450 | if (!G_VALUE_HOLDS_LONG (&new_value->value)(((__extension__ ({ const GValue *__val = (const GValue*) ((& new_value->value)); GType __t = (((GType) ((8) << (2 )))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))) && |
| 2451 | !G_VALUE_HOLDS_DOUBLE (&new_value->value)(((__extension__ ({ const GValue *__val = (const GValue*) ((& new_value->value)); GType __t = (((GType) ((15) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))) && |
| 2452 | !G_VALUE_HOLDS_STRING (&new_value->value)(((__extension__ ({ const GValue *__val = (const GValue*) ((& new_value->value)); GType __t = (((GType) ((16) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))) && |
| 2453 | !G_VALUE_HOLDS (&new_value->value, G_TYPE_GSTRING)(((__extension__ ({ const GValue *__val = (const GValue*) ((& new_value->value)); GType __t = (((g_gstring_get_type ())) ); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val , __t); __r; }))))) |
| 2454 | { |
| 2455 | g_warning (G_STRLOC"ctksettings.c" ":" "2455" ": value type invalid (%s)", g_type_name (G_VALUE_TYPE (&new_value->value)(((GValue*) (&new_value->value))->g_type))); |
| 2456 | return; |
| 2457 | } |
| 2458 | |
| 2459 | name = g_strdup (prop_name)g_strdup_inline (prop_name); |
| 2460 | g_strcanon (name, G_CSET_DIGITS"0123456789" "-" G_CSET_a_2_z"abcdefghijklmnopqrstuvwxyz" G_CSET_A_2_Z"ABCDEFGHIJKLMNOPQRSTUVWXYZ", '-'); |
| 2461 | name_quark = g_quark_from_string (name); |
| 2462 | g_free (name); |
| 2463 | |
| 2464 | qvalue = g_datalist_id_dup_data (&priv->queued_settings, name_quark, NULL((void*)0), NULL((void*)0)); |
| 2465 | if (!qvalue) |
| 2466 | { |
| 2467 | qvalue = g_slice_new0 (CtkSettingsValuePrivate)((CtkSettingsValuePrivate*) g_slice_alloc0 (sizeof (CtkSettingsValuePrivate ))); |
| 2468 | g_datalist_id_set_data_full (&priv->queued_settings, name_quark, qvalue, free_value); |
| 2469 | } |
| 2470 | else |
| 2471 | { |
| 2472 | g_free (qvalue->public.origin); |
| 2473 | g_value_unset (&qvalue->public.value); |
| 2474 | } |
| 2475 | qvalue->public.origin = g_strdup (new_value->origin)g_strdup_inline (new_value->origin); |
| 2476 | g_value_init (&qvalue->public.value, G_VALUE_TYPE (&new_value->value)(((GValue*) (&new_value->value))->g_type)); |
| 2477 | g_value_copy (&new_value->value, &qvalue->public.value); |
| 2478 | qvalue->source = source; |
| 2479 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), g_quark_to_string (name_quark)); |
| 2480 | if (pspec) |
| 2481 | apply_queued_setting (settings, pspec, qvalue); |
| 2482 | } |
| 2483 | |
| 2484 | /** |
| 2485 | * ctk_settings_set_property_value: |
| 2486 | * @settings: |
| 2487 | * @name: |
| 2488 | * @svalue: |
| 2489 | * |
| 2490 | * Deprecated: 3.16: Use g_object_set() instead. |
| 2491 | */ |
| 2492 | void |
| 2493 | ctk_settings_set_property_value (CtkSettings *settings, |
| 2494 | const gchar *name, |
| 2495 | const CtkSettingsValue *svalue) |
| 2496 | { |
| 2497 | g_return_if_fail (CTK_SETTINGS (settings))do { if ((((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((ctk_settings_get_type ())) )))))) { } else { g_return_if_fail_warning ("Ctk", ((const char *) (__func__)), "CTK_SETTINGS (settings)"); return; } } while (0); |
| 2498 | g_return_if_fail (name != NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "name != NULL"); return; } } while (0); |
| 2499 | g_return_if_fail (svalue != NULL)do { if ((svalue != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "svalue != NULL"); return ; } } while (0); |
| 2500 | |
| 2501 | ctk_settings_set_property_value_internal (settings, name, svalue, |
| 2502 | CTK_SETTINGS_SOURCE_APPLICATION); |
| 2503 | } |
| 2504 | |
| 2505 | void |
| 2506 | _ctk_settings_set_property_value_from_rc (CtkSettings *settings, |
| 2507 | const gchar *prop_name, |
| 2508 | const CtkSettingsValue *new_value) |
| 2509 | { |
| 2510 | g_return_if_fail (CTK_SETTINGS (settings))do { if ((((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((ctk_settings_get_type ())) )))))) { } else { g_return_if_fail_warning ("Ctk", ((const char *) (__func__)), "CTK_SETTINGS (settings)"); return; } } while (0); |
| 2511 | g_return_if_fail (prop_name != NULL)do { if ((prop_name != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "prop_name != NULL"); return ; } } while (0); |
| 2512 | g_return_if_fail (new_value != NULL)do { if ((new_value != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "new_value != NULL"); return ; } } while (0); |
| 2513 | |
| 2514 | ctk_settings_set_property_value_internal (settings, prop_name, new_value, |
| 2515 | CTK_SETTINGS_SOURCE_THEME); |
| 2516 | } |
| 2517 | |
| 2518 | /** |
| 2519 | * ctk_settings_set_string_property: |
| 2520 | * @settings: |
| 2521 | * @name: |
| 2522 | * @v_string: |
| 2523 | * @origin: |
| 2524 | * |
| 2525 | * Deprecated: 3.16: Use g_object_set() instead. |
| 2526 | */ |
| 2527 | void |
| 2528 | ctk_settings_set_string_property (CtkSettings *settings, |
| 2529 | const gchar *name, |
| 2530 | const gchar *v_string, |
| 2531 | const gchar *origin) |
| 2532 | { |
| 2533 | CtkSettingsValue svalue = { NULL((void*)0), { 0, }, }; |
| 2534 | |
| 2535 | g_return_if_fail (CTK_SETTINGS (settings))do { if ((((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((ctk_settings_get_type ())) )))))) { } else { g_return_if_fail_warning ("Ctk", ((const char *) (__func__)), "CTK_SETTINGS (settings)"); return; } } while (0); |
| 2536 | g_return_if_fail (name != NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "name != NULL"); return; } } while (0); |
| 2537 | g_return_if_fail (v_string != NULL)do { if ((v_string != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "v_string != NULL"); return ; } } while (0); |
| 2538 | |
| 2539 | svalue.origin = (gchar*) origin; |
| 2540 | g_value_init (&svalue.value, G_TYPE_STRING((GType) ((16) << (2)))); |
| 2541 | g_value_set_static_string (&svalue.value, v_string); |
| 2542 | ctk_settings_set_property_value_internal (settings, name, &svalue, |
| 2543 | CTK_SETTINGS_SOURCE_APPLICATION); |
| 2544 | g_value_unset (&svalue.value); |
| 2545 | } |
| 2546 | |
| 2547 | /** |
| 2548 | * ctk_settings_set_long_property: |
| 2549 | * @settings: |
| 2550 | * @name: |
| 2551 | * @v_long: |
| 2552 | * @origin: |
| 2553 | * |
| 2554 | * Deprecated: 3.16: Use g_object_set() instead. |
| 2555 | */ |
| 2556 | void |
| 2557 | ctk_settings_set_long_property (CtkSettings *settings, |
| 2558 | const gchar *name, |
| 2559 | glong v_long, |
| 2560 | const gchar *origin) |
| 2561 | { |
| 2562 | CtkSettingsValue svalue = { NULL((void*)0), { 0, }, }; |
| 2563 | |
| 2564 | g_return_if_fail (CTK_SETTINGS (settings))do { if ((((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((ctk_settings_get_type ())) )))))) { } else { g_return_if_fail_warning ("Ctk", ((const char *) (__func__)), "CTK_SETTINGS (settings)"); return; } } while (0); |
| 2565 | g_return_if_fail (name != NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "name != NULL"); return; } } while (0); |
| 2566 | |
| 2567 | svalue.origin = (gchar*) origin; |
| 2568 | g_value_init (&svalue.value, G_TYPE_LONG((GType) ((8) << (2)))); |
| 2569 | g_value_set_long (&svalue.value, v_long); |
| 2570 | ctk_settings_set_property_value_internal (settings, name, &svalue, |
| 2571 | CTK_SETTINGS_SOURCE_APPLICATION); |
| 2572 | g_value_unset (&svalue.value); |
| 2573 | } |
| 2574 | |
| 2575 | /** |
| 2576 | * ctk_settings_set_double_property: |
| 2577 | * @settings: |
| 2578 | * @name: |
| 2579 | * @v_double: |
| 2580 | * @origin: |
| 2581 | * |
| 2582 | * Deprecated: 3.16: Use g_object_set() instead. |
| 2583 | */ |
| 2584 | void |
| 2585 | ctk_settings_set_double_property (CtkSettings *settings, |
| 2586 | const gchar *name, |
| 2587 | gdouble v_double, |
| 2588 | const gchar *origin) |
| 2589 | { |
| 2590 | CtkSettingsValue svalue = { NULL((void*)0), { 0, }, }; |
| 2591 | |
| 2592 | g_return_if_fail (CTK_SETTINGS (settings))do { if ((((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance*) ((settings)), ((ctk_settings_get_type ())) )))))) { } else { g_return_if_fail_warning ("Ctk", ((const char *) (__func__)), "CTK_SETTINGS (settings)"); return; } } while (0); |
| 2593 | g_return_if_fail (name != NULL)do { if ((name != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "name != NULL"); return; } } while (0); |
| 2594 | |
| 2595 | svalue.origin = (gchar*) origin; |
| 2596 | g_value_init (&svalue.value, G_TYPE_DOUBLE((GType) ((15) << (2)))); |
| 2597 | g_value_set_double (&svalue.value, v_double); |
| 2598 | ctk_settings_set_property_value_internal (settings, name, &svalue, |
| 2599 | CTK_SETTINGS_SOURCE_APPLICATION); |
| 2600 | g_value_unset (&svalue.value); |
| 2601 | } |
| 2602 | |
| 2603 | G_GNUC_BEGIN_IGNORE_DEPRECATIONSclang diagnostic push
clang diagnostic ignored "-Wdeprecated-declarations" |
| 2604 | |
| 2605 | /** |
| 2606 | * ctk_rc_property_parse_color: |
| 2607 | * @pspec: a #GParamSpec |
| 2608 | * @gstring: the #GString to be parsed |
| 2609 | * @property_value: a #GValue which must hold #CdkColor values. |
| 2610 | * |
| 2611 | * A #CtkRcPropertyParser for use with ctk_settings_install_property_parser() |
| 2612 | * or ctk_widget_class_install_style_property_parser() which parses a |
| 2613 | * color given either by its name or in the form |
| 2614 | * `{ red, green, blue }` where red, green and |
| 2615 | * blue are integers between 0 and 65535 or floating-point numbers |
| 2616 | * between 0 and 1. |
| 2617 | * |
| 2618 | * Returns: %TRUE if @gstring could be parsed and @property_value |
| 2619 | * has been set to the resulting #CdkColor. |
| 2620 | **/ |
| 2621 | gboolean |
| 2622 | ctk_rc_property_parse_color (const GParamSpec *pspec, |
| 2623 | const GString *gstring, |
| 2624 | GValue *property_value) |
| 2625 | { |
| 2626 | CdkColor color = { 0, 0, 0, 0, }; |
| 2627 | GScanner *scanner; |
| 2628 | gboolean success; |
| 2629 | |
| 2630 | g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE)do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return ((0)); } } while (0); |
| 2631 | g_return_val_if_fail (G_VALUE_HOLDS (property_value, CDK_TYPE_COLOR), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((property_value)); GType __t = (((cdk_color_get_type ())) ); gboolean __r; if (!__val) __r = (0); else if (__val->g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val , __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk" , ((const char*) (__func__)), "G_VALUE_HOLDS (property_value, CDK_TYPE_COLOR)" ); return ((0)); } } while (0); |
| 2632 | |
| 2633 | scanner = ctk_rc_scanner_new (); |
| 2634 | g_scanner_input_text (scanner, gstring->str, gstring->len); |
| 2635 | if (ctk_rc_parse_color (scanner, &color) == G_TOKEN_NONE && |
| 2636 | g_scanner_get_next_token (scanner) == G_TOKEN_EOF) |
| 2637 | { |
| 2638 | g_value_set_boxed (property_value, &color); |
| 2639 | success = TRUE(!(0)); |
| 2640 | } |
| 2641 | else |
| 2642 | success = FALSE(0); |
| 2643 | g_scanner_destroy (scanner); |
| 2644 | |
| 2645 | return success; |
| 2646 | } |
| 2647 | |
| 2648 | /** |
| 2649 | * ctk_rc_property_parse_enum: |
| 2650 | * @pspec: a #GParamSpec |
| 2651 | * @gstring: the #GString to be parsed |
| 2652 | * @property_value: a #GValue which must hold enum values. |
| 2653 | * |
| 2654 | * A #CtkRcPropertyParser for use with ctk_settings_install_property_parser() |
| 2655 | * or ctk_widget_class_install_style_property_parser() which parses a single |
| 2656 | * enumeration value. |
| 2657 | * |
| 2658 | * The enumeration value can be specified by its name, its nickname or |
| 2659 | * its numeric value. For consistency with flags parsing, the value |
| 2660 | * may be surrounded by parentheses. |
| 2661 | * |
| 2662 | * Returns: %TRUE if @gstring could be parsed and @property_value |
| 2663 | * has been set to the resulting #GEnumValue. |
| 2664 | **/ |
| 2665 | gboolean |
| 2666 | ctk_rc_property_parse_enum (const GParamSpec *pspec, |
| 2667 | const GString *gstring, |
| 2668 | GValue *property_value) |
| 2669 | { |
| 2670 | gboolean need_closing_brace = FALSE(0), success = FALSE(0); |
| 2671 | GScanner *scanner; |
| 2672 | GEnumValue *enum_value = NULL((void*)0); |
| 2673 | |
| 2674 | g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE)do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return ((0)); } } while (0); |
| 2675 | g_return_val_if_fail (G_VALUE_HOLDS_ENUM (property_value), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((property_value)); GType __t = (((GType) ((12) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_VALUE_HOLDS_ENUM (property_value)" ); return ((0)); } } while (0); |
| 2676 | |
| 2677 | scanner = ctk_rc_scanner_new (); |
| 2678 | g_scanner_input_text (scanner, gstring->str, gstring->len); |
| 2679 | |
| 2680 | /* we just want to parse _one_ value, but for consistency with flags parsing |
| 2681 | * we support optional parenthesis |
| 2682 | */ |
| 2683 | g_scanner_get_next_token (scanner); |
| 2684 | if (scanner->token == '(') |
| 2685 | { |
| 2686 | need_closing_brace = TRUE(!(0)); |
| 2687 | g_scanner_get_next_token (scanner); |
| 2688 | } |
| 2689 | if (scanner->token == G_TOKEN_IDENTIFIER) |
| 2690 | { |
| 2691 | GEnumClass *class = G_PARAM_SPEC_ENUM (pspec)((((GParamSpecEnum*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), ((g_param_spec_types[10]))))))->enum_class; |
| 2692 | |
| 2693 | enum_value = g_enum_get_value_by_name (class, scanner->value.v_identifier); |
| 2694 | if (!enum_value) |
| 2695 | enum_value = g_enum_get_value_by_nick (class, scanner->value.v_identifier); |
| 2696 | if (enum_value) |
| 2697 | { |
| 2698 | g_value_set_enum (property_value, enum_value->value); |
| 2699 | success = TRUE(!(0)); |
| 2700 | } |
| 2701 | } |
| 2702 | else if (scanner->token == G_TOKEN_INT) |
| 2703 | { |
| 2704 | g_value_set_enum (property_value, scanner->value.v_int); |
| 2705 | success = TRUE(!(0)); |
| 2706 | } |
| 2707 | if (need_closing_brace && g_scanner_get_next_token (scanner) != ')') |
| 2708 | success = FALSE(0); |
| 2709 | if (g_scanner_get_next_token (scanner) != G_TOKEN_EOF) |
| 2710 | success = FALSE(0); |
| 2711 | |
| 2712 | g_scanner_destroy (scanner); |
| 2713 | |
| 2714 | return success; |
| 2715 | } |
| 2716 | |
| 2717 | static guint |
| 2718 | parse_flags_value (GScanner *scanner, |
| 2719 | GFlagsClass *class, |
| 2720 | guint *number) |
| 2721 | { |
| 2722 | g_scanner_get_next_token (scanner); |
| 2723 | if (scanner->token == G_TOKEN_IDENTIFIER) |
| 2724 | { |
| 2725 | GFlagsValue *flags_value; |
| 2726 | |
| 2727 | flags_value = g_flags_get_value_by_name (class, scanner->value.v_identifier); |
| 2728 | if (!flags_value) |
| 2729 | flags_value = g_flags_get_value_by_nick (class, scanner->value.v_identifier); |
| 2730 | if (flags_value) |
| 2731 | { |
| 2732 | *number |= flags_value->value; |
| 2733 | return G_TOKEN_NONE; |
| 2734 | } |
| 2735 | } |
| 2736 | else if (scanner->token == G_TOKEN_INT) |
| 2737 | { |
| 2738 | *number |= scanner->value.v_int; |
| 2739 | return G_TOKEN_NONE; |
| 2740 | } |
| 2741 | return G_TOKEN_IDENTIFIER; |
| 2742 | } |
| 2743 | |
| 2744 | /** |
| 2745 | * ctk_rc_property_parse_flags: |
| 2746 | * @pspec: a #GParamSpec |
| 2747 | * @gstring: the #GString to be parsed |
| 2748 | * @property_value: a #GValue which must hold flags values. |
| 2749 | * |
| 2750 | * A #CtkRcPropertyParser for use with ctk_settings_install_property_parser() |
| 2751 | * or ctk_widget_class_install_style_property_parser() which parses flags. |
| 2752 | * |
| 2753 | * Flags can be specified by their name, their nickname or |
| 2754 | * numerically. Multiple flags can be specified in the form |
| 2755 | * `"( flag1 | flag2 | ... )"`. |
| 2756 | * |
| 2757 | * Returns: %TRUE if @gstring could be parsed and @property_value |
| 2758 | * has been set to the resulting flags value. |
| 2759 | **/ |
| 2760 | gboolean |
| 2761 | ctk_rc_property_parse_flags (const GParamSpec *pspec, |
| 2762 | const GString *gstring, |
| 2763 | GValue *property_value) |
| 2764 | { |
| 2765 | GFlagsClass *class; |
| 2766 | gboolean success = FALSE(0); |
| 2767 | GScanner *scanner; |
| 2768 | |
| 2769 | g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE)do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return ((0)); } } while (0); |
| 2770 | g_return_val_if_fail (G_VALUE_HOLDS_FLAGS (property_value), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((property_value)); GType __t = (((GType) ((13) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_VALUE_HOLDS_FLAGS (property_value)" ); return ((0)); } } while (0); |
| 2771 | |
| 2772 | class = G_PARAM_SPEC_FLAGS (pspec)((((GParamSpecFlags*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), ((g_param_spec_types[11]))))))->flags_class; |
| 2773 | scanner = ctk_rc_scanner_new (); |
| 2774 | g_scanner_input_text (scanner, gstring->str, gstring->len); |
| 2775 | |
| 2776 | /* parse either a single flags value or a "\( ... [ \| ... ] \)" compound */ |
| 2777 | if (g_scanner_peek_next_token (scanner) == G_TOKEN_IDENTIFIER || |
| 2778 | scanner->next_token == G_TOKEN_INT) |
| 2779 | { |
| 2780 | guint token, flags_value = 0; |
| 2781 | |
| 2782 | token = parse_flags_value (scanner, class, &flags_value); |
| 2783 | |
| 2784 | if (token == G_TOKEN_NONE && g_scanner_peek_next_token (scanner) == G_TOKEN_EOF) |
| 2785 | { |
| 2786 | success = TRUE(!(0)); |
| 2787 | g_value_set_flags (property_value, flags_value); |
| 2788 | } |
| 2789 | |
| 2790 | } |
| 2791 | else if (g_scanner_get_next_token (scanner) == '(') |
| 2792 | { |
| 2793 | guint token, flags_value = 0; |
| 2794 | |
| 2795 | /* parse first value */ |
| 2796 | token = parse_flags_value (scanner, class, &flags_value); |
| 2797 | |
| 2798 | /* parse nth values, preceeded by '|' */ |
| 2799 | while (token == G_TOKEN_NONE && g_scanner_get_next_token (scanner) == '|') |
| 2800 | token = parse_flags_value (scanner, class, &flags_value); |
| 2801 | |
| 2802 | /* done, last token must have closed expression */ |
| 2803 | if (token == G_TOKEN_NONE && scanner->token == ')' && |
| 2804 | g_scanner_peek_next_token (scanner) == G_TOKEN_EOF) |
| 2805 | { |
| 2806 | g_value_set_flags (property_value, flags_value); |
| 2807 | success = TRUE(!(0)); |
| 2808 | } |
| 2809 | } |
| 2810 | g_scanner_destroy (scanner); |
| 2811 | |
| 2812 | return success; |
| 2813 | } |
| 2814 | |
| 2815 | static gboolean |
| 2816 | get_braced_int (GScanner *scanner, |
| 2817 | gboolean first, |
| 2818 | gboolean last, |
| 2819 | gint *value) |
| 2820 | { |
| 2821 | if (first) |
| 2822 | { |
| 2823 | g_scanner_get_next_token (scanner); |
| 2824 | if (scanner->token != '{') |
| 2825 | return FALSE(0); |
| 2826 | } |
| 2827 | |
| 2828 | g_scanner_get_next_token (scanner); |
| 2829 | if (scanner->token != G_TOKEN_INT) |
| 2830 | return FALSE(0); |
| 2831 | |
| 2832 | *value = scanner->value.v_int; |
| 2833 | |
| 2834 | if (last) |
| 2835 | { |
| 2836 | g_scanner_get_next_token (scanner); |
| 2837 | if (scanner->token != '}') |
| 2838 | return FALSE(0); |
| 2839 | } |
| 2840 | else |
| 2841 | { |
| 2842 | g_scanner_get_next_token (scanner); |
| 2843 | if (scanner->token != ',') |
| 2844 | return FALSE(0); |
| 2845 | } |
| 2846 | |
| 2847 | return TRUE(!(0)); |
| 2848 | } |
| 2849 | |
| 2850 | /** |
| 2851 | * ctk_rc_property_parse_requisition: |
| 2852 | * @pspec: a #GParamSpec |
| 2853 | * @gstring: the #GString to be parsed |
| 2854 | * @property_value: a #GValue which must hold boxed values. |
| 2855 | * |
| 2856 | * A #CtkRcPropertyParser for use with ctk_settings_install_property_parser() |
| 2857 | * or ctk_widget_class_install_style_property_parser() which parses a |
| 2858 | * requisition in the form |
| 2859 | * `"{ width, height }"` for integers %width and %height. |
| 2860 | * |
| 2861 | * Returns: %TRUE if @gstring could be parsed and @property_value |
| 2862 | * has been set to the resulting #CtkRequisition. |
| 2863 | **/ |
| 2864 | gboolean |
| 2865 | ctk_rc_property_parse_requisition (const GParamSpec *pspec, |
| 2866 | const GString *gstring, |
| 2867 | GValue *property_value) |
| 2868 | { |
| 2869 | CtkRequisition requisition; |
| 2870 | GScanner *scanner; |
| 2871 | gboolean success = FALSE(0); |
| 2872 | |
| 2873 | g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE)do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return ((0)); } } while (0); |
| 2874 | g_return_val_if_fail (G_VALUE_HOLDS_BOXED (property_value), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((property_value)); GType __t = (((GType) ((18) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_VALUE_HOLDS_BOXED (property_value)" ); return ((0)); } } while (0); |
| 2875 | |
| 2876 | scanner = ctk_rc_scanner_new (); |
| 2877 | g_scanner_input_text (scanner, gstring->str, gstring->len); |
| 2878 | |
| 2879 | if (get_braced_int (scanner, TRUE(!(0)), FALSE(0), &requisition.width) && |
| 2880 | get_braced_int (scanner, FALSE(0), TRUE(!(0)), &requisition.height)) |
| 2881 | { |
| 2882 | g_value_set_boxed (property_value, &requisition); |
| 2883 | success = TRUE(!(0)); |
| 2884 | } |
| 2885 | |
| 2886 | g_scanner_destroy (scanner); |
| 2887 | |
| 2888 | return success; |
| 2889 | } |
| 2890 | |
| 2891 | /** |
| 2892 | * ctk_rc_property_parse_border: |
| 2893 | * @pspec: a #GParamSpec |
| 2894 | * @gstring: the #GString to be parsed |
| 2895 | * @property_value: a #GValue which must hold boxed values. |
| 2896 | * |
| 2897 | * A #CtkRcPropertyParser for use with ctk_settings_install_property_parser() |
| 2898 | * or ctk_widget_class_install_style_property_parser() which parses |
| 2899 | * borders in the form |
| 2900 | * `"{ left, right, top, bottom }"` for integers |
| 2901 | * left, right, top and bottom. |
| 2902 | * |
| 2903 | * Returns: %TRUE if @gstring could be parsed and @property_value |
| 2904 | * has been set to the resulting #CtkBorder. |
| 2905 | **/ |
| 2906 | gboolean |
| 2907 | ctk_rc_property_parse_border (const GParamSpec *pspec, |
| 2908 | const GString *gstring, |
| 2909 | GValue *property_value) |
| 2910 | { |
| 2911 | CtkBorder border; |
| 2912 | GScanner *scanner; |
| 2913 | gboolean success = FALSE(0); |
| 2914 | int left, right, top, bottom; |
| 2915 | |
| 2916 | g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE)do { if (((((g_type_check_instance_is_fundamentally_a ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2)))))))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_IS_PARAM_SPEC (pspec)"); return ((0)); } } while (0); |
| 2917 | g_return_val_if_fail (G_VALUE_HOLDS_BOXED (property_value), FALSE)do { if (((((__extension__ ({ const GValue *__val = (const GValue *) ((property_value)); GType __t = (((GType) ((18) << ( 2)))); gboolean __r; if (!__val) __r = (0); else if (__val-> g_type == __t) __r = (!(0)); else __r = g_type_check_value_holds (__val, __t); __r; })))))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "G_VALUE_HOLDS_BOXED (property_value)" ); return ((0)); } } while (0); |
| 2918 | |
| 2919 | scanner = ctk_rc_scanner_new (); |
| 2920 | g_scanner_input_text (scanner, gstring->str, gstring->len); |
| 2921 | |
| 2922 | if (get_braced_int (scanner, TRUE(!(0)), FALSE(0), &left) && |
| 2923 | get_braced_int (scanner, FALSE(0), FALSE(0), &right) && |
| 2924 | get_braced_int (scanner, FALSE(0), FALSE(0), &top) && |
| 2925 | get_braced_int (scanner, FALSE(0), TRUE(!(0)), &bottom)) |
| 2926 | { |
| 2927 | border.left = left; |
| 2928 | border.right = right; |
| 2929 | border.top = top; |
| 2930 | border.bottom = bottom; |
| 2931 | g_value_set_boxed (property_value, &border); |
| 2932 | success = TRUE(!(0)); |
| 2933 | } |
| 2934 | |
| 2935 | g_scanner_destroy (scanner); |
| 2936 | |
| 2937 | return success; |
| 2938 | } |
| 2939 | |
| 2940 | G_GNUC_END_IGNORE_DEPRECATIONSclang diagnostic pop |
| 2941 | |
| 2942 | void |
| 2943 | _ctk_settings_handle_event (CdkEventSetting *event) |
| 2944 | { |
| 2945 | CdkScreen *screen; |
| 2946 | CtkSettings *settings; |
| 2947 | GParamSpec *pspec; |
| 2948 | |
| 2949 | screen = cdk_window_get_screen (event->window); |
| 2950 | settings = ctk_settings_get_for_screen (screen); |
| 2951 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), event->name); |
| 2952 | |
| 2953 | if (!pspec) |
| 2954 | return; |
| 2955 | |
| 2956 | if (settings_update_xsetting (settings, pspec, TRUE(!(0)))) |
| 2957 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 2958 | } |
| 2959 | |
| 2960 | static void |
| 2961 | reset_rc_values_foreach (GQuark key_id, |
| 2962 | gpointer data, |
| 2963 | gpointer user_data) |
| 2964 | { |
| 2965 | CtkSettingsValuePrivate *qvalue = data; |
| 2966 | GSList **to_reset = user_data; |
| 2967 | |
| 2968 | if (qvalue->source == CTK_SETTINGS_SOURCE_THEME) |
| 2969 | *to_reset = g_slist_prepend (*to_reset, GUINT_TO_POINTER (key_id)((gpointer) (gulong) (key_id))); |
| 2970 | } |
| 2971 | |
| 2972 | void |
| 2973 | _ctk_settings_reset_rc_values (CtkSettings *settings) |
| 2974 | { |
| 2975 | CtkSettingsPrivate *priv = settings->priv; |
| 2976 | GSList *to_reset = NULL((void*)0); |
| 2977 | GSList *tmp_list; |
| 2978 | GParamSpec **pspecs, **p; |
| 2979 | gint i; |
| 2980 | |
| 2981 | /* Remove any queued settings */ |
| 2982 | g_datalist_foreach (&priv->queued_settings, |
| 2983 | reset_rc_values_foreach, |
| 2984 | &to_reset); |
| 2985 | |
| 2986 | for (tmp_list = to_reset; tmp_list; tmp_list = tmp_list->next) |
| 2987 | { |
| 2988 | GQuark key_id = GPOINTER_TO_UINT (tmp_list->data)((guint) (gulong) (tmp_list->data)); |
| 2989 | g_datalist_id_remove_data (&priv->queued_settings, key_id)g_datalist_id_set_data_full (((&priv->queued_settings) ), ((key_id)), (((void*)0)), ((void*)0)); |
| 2990 | } |
| 2991 | |
| 2992 | g_slist_free (to_reset); |
| 2993 | |
| 2994 | /* Now reset the active settings |
| 2995 | */ |
| 2996 | pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), NULL((void*)0)); |
| 2997 | i = 0; |
| 2998 | |
| 2999 | g_object_freeze_notify (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2))))))))); |
| 3000 | for (p = pspecs; *p; p++) |
| 3001 | { |
| 3002 | if (priv->property_values[i].source == CTK_SETTINGS_SOURCE_THEME) |
| 3003 | { |
| 3004 | GParamSpec *pspec = *p; |
| 3005 | |
| 3006 | g_param_value_set_default (pspec, &priv->property_values[i].value); |
| 3007 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 3008 | } |
| 3009 | i++; |
| 3010 | } |
| 3011 | g_object_thaw_notify (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2))))))))); |
| 3012 | g_free (pspecs); |
| 3013 | } |
| 3014 | |
| 3015 | static void |
| 3016 | settings_update_double_click (CtkSettings *settings) |
| 3017 | { |
| 3018 | CtkSettingsPrivate *priv = settings->priv; |
| 3019 | CdkDisplay *display = cdk_screen_get_display (priv->screen); |
| 3020 | gint double_click_time; |
| 3021 | gint double_click_distance; |
| 3022 | |
| 3023 | g_object_get (settings, |
| 3024 | "ctk-double-click-time", &double_click_time, |
| 3025 | "ctk-double-click-distance", &double_click_distance, |
| 3026 | NULL((void*)0)); |
| 3027 | |
| 3028 | cdk_display_set_double_click_time (display, double_click_time); |
| 3029 | cdk_display_set_double_click_distance (display, double_click_distance); |
| 3030 | } |
| 3031 | |
| 3032 | static void |
| 3033 | settings_update_modules (CtkSettings *settings) |
| 3034 | { |
| 3035 | gchar *modules; |
| 3036 | |
| 3037 | g_object_get (settings, |
| 3038 | "ctk-modules", &modules, |
| 3039 | NULL((void*)0)); |
| 3040 | |
| 3041 | _ctk_modules_settings_changed (settings, modules); |
| 3042 | |
| 3043 | g_free (modules); |
| 3044 | } |
| 3045 | |
| 3046 | static void |
| 3047 | settings_update_cursor_theme (CtkSettings *settings) |
| 3048 | { |
| 3049 | gchar *theme = NULL((void*)0); |
| 3050 | gint size = 0; |
| 3051 | #if defined(CDK_WINDOWING_X11) || defined(CDK_WINDOWING_WAYLAND) || defined(CDK_WINDOWING_WIN32) |
| 3052 | CdkDisplay *display = cdk_screen_get_display (settings->priv->screen); |
| 3053 | #endif |
| 3054 | |
| 3055 | g_object_get (settings, |
| 3056 | "ctk-cursor-theme-name", &theme, |
| 3057 | "ctk-cursor-theme-size", &size, |
| 3058 | NULL((void*)0)); |
| 3059 | if (theme == NULL((void*)0)) |
| 3060 | return; |
| 3061 | #ifdef CDK_WINDOWING_X11 |
| 3062 | if (CDK_IS_X11_DISPLAY (display)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (display)); GType __t = ((cdk_x11_display_get_type())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) |
| 3063 | cdk_x11_display_set_cursor_theme (display, theme, size); |
| 3064 | else |
| 3065 | #endif |
| 3066 | #ifdef CDK_WINDOWING_WAYLAND |
| 3067 | if (CDK_IS_WAYLAND_DISPLAY (display)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (display)); GType __t = ((cdk_wayland_display_get_type())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; }))))) |
| 3068 | cdk_wayland_display_set_cursor_theme (display, theme, size); |
| 3069 | else |
| 3070 | #endif |
| 3071 | #ifdef CDK_WINDOWING_WIN32 |
| 3072 | if (CDK_IS_WIN32_DISPLAY (display)) |
| 3073 | cdk_win32_display_set_cursor_theme (display, theme, size); |
| 3074 | else |
| 3075 | #endif |
| 3076 | g_warning ("CtkSettings Cursor Theme: Unsupported CDK backend"); |
| 3077 | g_free (theme); |
| 3078 | } |
| 3079 | |
| 3080 | static void |
| 3081 | settings_update_font_options (CtkSettings *settings) |
| 3082 | { |
| 3083 | CtkSettingsPrivate *priv = settings->priv; |
| 3084 | gint hinting; |
| 3085 | gchar *hint_style_str; |
| 3086 | cairo_hint_style_t hint_style; |
| 3087 | gint antialias; |
| 3088 | cairo_antialias_t antialias_mode; |
| 3089 | gchar *rgba_str; |
| 3090 | cairo_subpixel_order_t subpixel_order; |
| 3091 | cairo_font_options_t *options; |
| 3092 | |
| 3093 | g_object_get (settings, |
| 3094 | "ctk-xft-antialias", &antialias, |
| 3095 | "ctk-xft-hinting", &hinting, |
| 3096 | "ctk-xft-hintstyle", &hint_style_str, |
| 3097 | "ctk-xft-rgba", &rgba_str, |
| 3098 | NULL((void*)0)); |
| 3099 | |
| 3100 | options = cairo_font_options_create (); |
| 3101 | |
| 3102 | cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_ON); |
| 3103 | |
| 3104 | hint_style = CAIRO_HINT_STYLE_DEFAULT; |
| 3105 | if (hinting == 0) |
| 3106 | { |
| 3107 | hint_style = CAIRO_HINT_STYLE_NONE; |
| 3108 | } |
| 3109 | else if (hinting == 1) |
| 3110 | { |
| 3111 | if (hint_style_str) |
| 3112 | { |
| 3113 | if (strcmp (hint_style_str, "hintnone") == 0) |
| 3114 | hint_style = CAIRO_HINT_STYLE_NONE; |
| 3115 | else if (strcmp (hint_style_str, "hintslight") == 0) |
| 3116 | hint_style = CAIRO_HINT_STYLE_SLIGHT; |
| 3117 | else if (strcmp (hint_style_str, "hintmedium") == 0) |
| 3118 | hint_style = CAIRO_HINT_STYLE_MEDIUM; |
| 3119 | else if (strcmp (hint_style_str, "hintfull") == 0) |
| 3120 | hint_style = CAIRO_HINT_STYLE_FULL; |
| 3121 | } |
| 3122 | } |
| 3123 | |
| 3124 | g_free (hint_style_str); |
| 3125 | |
| 3126 | cairo_font_options_set_hint_style (options, hint_style); |
| 3127 | |
| 3128 | subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT; |
| 3129 | if (rgba_str) |
| 3130 | { |
| 3131 | if (strcmp (rgba_str, "rgb") == 0) |
| 3132 | subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB; |
| 3133 | else if (strcmp (rgba_str, "bgr") == 0) |
| 3134 | subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR; |
| 3135 | else if (strcmp (rgba_str, "vrgb") == 0) |
| 3136 | subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB; |
| 3137 | else if (strcmp (rgba_str, "vbgr") == 0) |
| 3138 | subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR; |
| 3139 | } |
| 3140 | |
| 3141 | g_free (rgba_str); |
| 3142 | |
| 3143 | cairo_font_options_set_subpixel_order (options, subpixel_order); |
| 3144 | |
| 3145 | antialias_mode = CAIRO_ANTIALIAS_DEFAULT; |
| 3146 | if (antialias == 0) |
| 3147 | { |
| 3148 | antialias_mode = CAIRO_ANTIALIAS_NONE; |
| 3149 | } |
| 3150 | else if (antialias == 1) |
| 3151 | { |
| 3152 | if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT) |
| 3153 | antialias_mode = CAIRO_ANTIALIAS_SUBPIXEL; |
| 3154 | else |
| 3155 | antialias_mode = CAIRO_ANTIALIAS_GRAY; |
| 3156 | } |
| 3157 | |
| 3158 | cairo_font_options_set_antialias (options, antialias_mode); |
| 3159 | |
| 3160 | cdk_screen_set_font_options (priv->screen, options); |
| 3161 | |
| 3162 | cairo_font_options_destroy (options); |
| 3163 | } |
| 3164 | |
| 3165 | static gboolean |
| 3166 | settings_update_fontconfig (CtkSettings *settings) |
| 3167 | { |
| 3168 | #if defined(CDK_WINDOWING_X11) || defined(CDK_WINDOWING_WAYLAND) |
| 3169 | static guint last_update_timestamp; |
| 3170 | static gboolean last_update_needed; |
| 3171 | |
| 3172 | guint timestamp; |
| 3173 | |
| 3174 | g_object_get (settings, |
| 3175 | "ctk-fontconfig-timestamp", ×tamp, |
| 3176 | NULL((void*)0)); |
| 3177 | |
| 3178 | /* if timestamp is the same as last_update_timestamp, we already have |
| 3179 | * updated fontconig on this timestamp (another screen requested it perhaps?), |
| 3180 | * just return the cached result.*/ |
| 3181 | |
| 3182 | if (timestamp != last_update_timestamp) |
| 3183 | { |
| 3184 | PangoFontMap *fontmap = pango_cairo_font_map_get_default (); |
| 3185 | gboolean update_needed = FALSE(0); |
| 3186 | |
| 3187 | /* bug 547680 */ |
| 3188 | if (PANGO_IS_FC_FONT_MAP (fontmap)(((__extension__ ({ GTypeInstance *__inst = (GTypeInstance*) ( (fontmap)); GType __t = ((pango_fc_font_map_get_type ())); gboolean __r; if (!__inst) __r = (0); else if (__inst->g_class && __inst->g_class->g_type == __t) __r = (!(0)); else __r = g_type_check_instance_is_a (__inst, __t); __r; })))) && !FcConfigUptoDate (NULL((void*)0))) |
| 3189 | { |
| 3190 | pango_fc_font_map_config_changed (PANGO_FC_FONT_MAP (fontmap)((((PangoFcFontMap*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((fontmap)), ((pango_fc_font_map_get_type ()))))))); |
| 3191 | if (FcInitReinitialize ()) |
| 3192 | update_needed = TRUE(!(0)); |
| 3193 | } |
| 3194 | |
| 3195 | last_update_timestamp = timestamp; |
| 3196 | last_update_needed = update_needed; |
| 3197 | } |
| 3198 | |
| 3199 | return last_update_needed; |
| 3200 | #else |
| 3201 | return FALSE(0); |
| 3202 | #endif /* CDK_WINDOWING_X11 || CDK_WINDOWING_WAYLAND */ |
| 3203 | } |
| 3204 | |
| 3205 | static void |
| 3206 | settings_update_resolution (CtkSettings *settings) |
| 3207 | { |
| 3208 | CtkSettingsPrivate *priv = settings->priv; |
| 3209 | gint dpi_int; |
| 3210 | gdouble dpi; |
| 3211 | const char *scale_env; |
| 3212 | double scale; |
| 3213 | |
| 3214 | /* We handle this here in the case that the dpi was set on the CtkSettings |
| 3215 | * object by the application. Other cases are handled in |
| 3216 | * xsettings-client.c:read-settings(). See comment there for the rationale. |
| 3217 | */ |
| 3218 | if (priv->property_values[PROP_XFT_DPI - 1].source == CTK_SETTINGS_SOURCE_APPLICATION) |
| 3219 | { |
| 3220 | g_object_get (settings, |
| 3221 | "ctk-xft-dpi", &dpi_int, |
| 3222 | NULL((void*)0)); |
| 3223 | |
| 3224 | if (dpi_int > 0) |
| 3225 | dpi = dpi_int / 1024.; |
| 3226 | else |
| 3227 | dpi = -1.; |
| 3228 | |
| 3229 | scale_env = g_getenv ("CDK_DPI_SCALE"); |
| 3230 | if (scale_env) |
| 3231 | { |
| 3232 | scale = g_ascii_strtod (scale_env, NULL((void*)0)); |
| 3233 | if (scale != 0 && dpi > 0) |
| 3234 | dpi *= scale; |
| 3235 | } |
| 3236 | |
| 3237 | cdk_screen_set_resolution (priv->screen, dpi); |
| 3238 | } |
| 3239 | } |
| 3240 | |
| 3241 | static void |
| 3242 | settings_update_provider (CdkScreen *screen, |
| 3243 | CtkCssProvider **old, |
| 3244 | CtkCssProvider *new) |
| 3245 | { |
| 3246 | if (screen != NULL((void*)0) && *old != new) |
| 3247 | { |
| 3248 | if (*old) |
| 3249 | { |
| 3250 | ctk_style_context_remove_provider_for_screen (screen, |
| 3251 | CTK_STYLE_PROVIDER (*old)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((*old)), ((ctk_style_provider_get_type ()))) )))); |
| 3252 | g_object_unref (*old); |
| 3253 | *old = NULL((void*)0); |
| 3254 | } |
| 3255 | |
| 3256 | if (new) |
| 3257 | { |
| 3258 | ctk_style_context_add_provider_for_screen (screen, |
| 3259 | CTK_STYLE_PROVIDER (new)((((CtkStyleProvider*) (void *) g_type_check_instance_cast (( GTypeInstance*) ((new)), ((ctk_style_provider_get_type ())))) )), |
| 3260 | CTK_STYLE_PROVIDER_PRIORITY_THEME200); |
| 3261 | *old = g_object_ref (new)((__typeof__ (new)) (g_object_ref) (new)); |
| 3262 | } |
| 3263 | } |
| 3264 | } |
| 3265 | |
| 3266 | static void |
| 3267 | get_theme_name (CtkSettings *settings, |
| 3268 | gchar **theme_name, |
| 3269 | gchar **theme_variant) |
| 3270 | { |
| 3271 | gboolean prefer_dark; |
| 3272 | |
| 3273 | *theme_name = NULL((void*)0); |
| 3274 | *theme_variant = NULL((void*)0); |
| 3275 | |
| 3276 | if (g_getenv ("CTK_THEME")) |
| 3277 | *theme_name = g_strdup (g_getenv ("CTK_THEME"))g_strdup_inline (g_getenv ("CTK_THEME")); |
| 3278 | |
| 3279 | if (*theme_name && **theme_name) |
| 3280 | { |
| 3281 | char *p; |
| 3282 | p = strrchr (*theme_name, ':'); |
| 3283 | if (p) { |
| 3284 | *p = '\0'; |
| 3285 | p++; |
| 3286 | *theme_variant = g_strdup (p)g_strdup_inline (p); |
| 3287 | } |
| 3288 | |
| 3289 | return; |
| 3290 | } |
| 3291 | |
| 3292 | g_free (*theme_name); |
| 3293 | |
| 3294 | g_object_get (settings, |
| 3295 | "ctk-theme-name", theme_name, |
| 3296 | "ctk-application-prefer-dark-theme", &prefer_dark, |
| 3297 | NULL((void*)0)); |
| 3298 | |
| 3299 | if (prefer_dark) |
| 3300 | *theme_variant = g_strdup ("dark")g_strdup_inline ("dark"); |
| 3301 | |
| 3302 | if (*theme_name && **theme_name) |
| 3303 | return; |
| 3304 | |
| 3305 | g_free (*theme_name); |
| 3306 | *theme_name = g_strdup (DEFAULT_THEME_NAME)g_strdup_inline ("Advaita"); |
| 3307 | } |
| 3308 | |
| 3309 | static void |
| 3310 | settings_update_theme (CtkSettings *settings) |
| 3311 | { |
| 3312 | CtkSettingsPrivate *priv = settings->priv; |
| 3313 | gchar *theme_name; |
| 3314 | gchar *theme_variant; |
| 3315 | const gchar *theme_dir; |
| 3316 | gchar *path; |
| 3317 | |
| 3318 | get_theme_name (settings, &theme_name, &theme_variant); |
| 3319 | |
| 3320 | _ctk_css_provider_load_named (priv->theme_provider, |
| 3321 | theme_name, theme_variant); |
| 3322 | |
| 3323 | /* reload per-theme settings */ |
| 3324 | theme_dir = _ctk_css_provider_get_theme_dir (priv->theme_provider); |
| 3325 | if (theme_dir) |
| 3326 | { |
| 3327 | path = g_build_filename (theme_dir, "settings.ini", NULL((void*)0)); |
| 3328 | if (g_file_test (path, G_FILE_TEST_EXISTS)) |
| 3329 | ctk_settings_load_from_key_file (settings, path, CTK_SETTINGS_SOURCE_THEME); |
| 3330 | g_free (path); |
| 3331 | } |
| 3332 | |
| 3333 | g_free (theme_name); |
| 3334 | g_free (theme_variant); |
| 3335 | } |
| 3336 | |
| 3337 | static void |
| 3338 | settings_update_key_theme (CtkSettings *settings) |
| 3339 | { |
| 3340 | CtkSettingsPrivate *priv = settings->priv; |
| 3341 | CtkCssProvider *provider = NULL((void*)0); |
| 3342 | gchar *key_theme_name; |
| 3343 | |
| 3344 | g_object_get (settings, |
| 3345 | "ctk-key-theme-name", &key_theme_name, |
| 3346 | NULL((void*)0)); |
| 3347 | |
| 3348 | if (key_theme_name && *key_theme_name) |
| 3349 | provider = ctk_css_provider_get_named (key_theme_name, "keys"); |
| 3350 | |
| 3351 | settings_update_provider (priv->screen, &priv->key_theme_provider, provider); |
| 3352 | g_free (key_theme_name); |
| 3353 | } |
| 3354 | |
| 3355 | |
| 3356 | CdkScreen * |
| 3357 | _ctk_settings_get_screen (CtkSettings *settings) |
| 3358 | { |
| 3359 | return settings->priv->screen; |
| 3360 | } |
| 3361 | |
| 3362 | static void |
| 3363 | gvalue_free (gpointer data) |
| 3364 | { |
| 3365 | g_value_unset (data); |
| 3366 | g_free (data); |
| 3367 | } |
| 3368 | |
| 3369 | static void |
| 3370 | ctk_settings_load_from_key_file (CtkSettings *settings, |
| 3371 | const gchar *path, |
| 3372 | CtkSettingsSource source) |
| 3373 | { |
| 3374 | GError *error; |
| 3375 | GKeyFile *keyfile; |
| 3376 | gchar **keys; |
| 3377 | gsize n_keys; |
| 3378 | gint i; |
| 3379 | |
| 3380 | error = NULL((void*)0); |
| 3381 | keys = NULL((void*)0); |
| 3382 | |
| 3383 | keyfile = g_key_file_new (); |
| 3384 | |
| 3385 | if (!g_key_file_load_from_file (keyfile, path, G_KEY_FILE_NONE, &error)) |
| 3386 | { |
| 3387 | g_warning ("Failed to parse %s: %s", path, error->message); |
| 3388 | |
| 3389 | g_error_free (error); |
| 3390 | |
| 3391 | goto out; |
| 3392 | } |
| 3393 | |
| 3394 | keys = g_key_file_get_keys (keyfile, "Settings", &n_keys, &error); |
| 3395 | if (error) |
| 3396 | { |
| 3397 | g_warning ("Failed to parse %s: %s", path, error->message); |
| 3398 | g_error_free (error); |
| 3399 | goto out; |
| 3400 | } |
| 3401 | |
| 3402 | for (i = 0; i < n_keys; i++) |
| 3403 | { |
| 3404 | gchar *key; |
| 3405 | GParamSpec *pspec; |
| 3406 | GType value_type; |
| 3407 | CtkSettingsValue svalue = { NULL((void*)0), { 0, }, }; |
| 3408 | |
| 3409 | key = keys[i]; |
| 3410 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), key); |
| 3411 | if (!pspec) |
| 3412 | { |
| 3413 | g_warning ("Unknown key %s in %s", key, path); |
| 3414 | continue; |
| 3415 | } |
| 3416 | |
| 3417 | if (pspec->owner_type != G_OBJECT_TYPE (settings)(((((GTypeClass*) (((GTypeInstance*) (settings))->g_class) )->g_type)))) |
| 3418 | continue; |
| 3419 | |
| 3420 | value_type = G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type ); |
| 3421 | switch (value_type) |
| 3422 | { |
| 3423 | case G_TYPE_BOOLEAN((GType) ((5) << (2))): |
| 3424 | { |
| 3425 | gboolean b_val; |
| 3426 | |
| 3427 | g_value_init (&svalue.value, G_TYPE_LONG((GType) ((8) << (2)))); |
| 3428 | b_val = g_key_file_get_boolean (keyfile, "Settings", key, &error); |
| 3429 | if (!error) |
| 3430 | g_value_set_long (&svalue.value, b_val); |
| 3431 | break; |
| 3432 | } |
| 3433 | |
| 3434 | case G_TYPE_INT((GType) ((6) << (2))): |
| 3435 | case G_TYPE_UINT((GType) ((7) << (2))): |
| 3436 | { |
| 3437 | gint i_val; |
| 3438 | |
| 3439 | g_value_init (&svalue.value, G_TYPE_LONG((GType) ((8) << (2)))); |
| 3440 | i_val = g_key_file_get_integer (keyfile, "Settings", key, &error); |
| 3441 | if (!error) |
| 3442 | g_value_set_long (&svalue.value, i_val); |
| 3443 | break; |
| 3444 | } |
| 3445 | |
| 3446 | case G_TYPE_DOUBLE((GType) ((15) << (2))): |
| 3447 | { |
| 3448 | gdouble d_val; |
| 3449 | |
| 3450 | g_value_init (&svalue.value, G_TYPE_DOUBLE((GType) ((15) << (2)))); |
| 3451 | d_val = g_key_file_get_double (keyfile, "Settings", key, &error); |
| 3452 | if (!error) |
| 3453 | g_value_set_double (&svalue.value, d_val); |
| 3454 | break; |
| 3455 | } |
| 3456 | |
| 3457 | default: |
| 3458 | { |
| 3459 | gchar *s_val; |
| 3460 | |
| 3461 | g_value_init (&svalue.value, G_TYPE_GSTRING(g_gstring_get_type ())); |
| 3462 | s_val = g_key_file_get_string (keyfile, "Settings", key, &error); |
| 3463 | if (!error) |
| 3464 | g_value_take_boxed (&svalue.value, g_string_new (s_val)); |
| 3465 | g_free (s_val); |
| 3466 | break; |
| 3467 | } |
| 3468 | } |
| 3469 | if (error) |
| 3470 | { |
| 3471 | g_warning ("Error setting %s in %s: %s", key, path, error->message); |
| 3472 | g_error_free (error); |
| 3473 | error = NULL((void*)0); |
| 3474 | } |
| 3475 | else |
| 3476 | { |
| 3477 | GValue *copy; |
| 3478 | |
| 3479 | copy = g_new0 (GValue, 1)((GValue *) g_malloc0_n ((1), sizeof (GValue))); |
| 3480 | |
| 3481 | g_value_init (copy, G_VALUE_TYPE (&svalue.value)(((GValue*) (&svalue.value))->g_type)); |
| 3482 | g_value_copy (&svalue.value, copy); |
| 3483 | |
| 3484 | g_param_spec_set_qdata_full (pspec, g_quark_from_string (key), |
| 3485 | copy, gvalue_free); |
| 3486 | |
| 3487 | if (g_getenv ("CTK_DEBUG")) |
| 3488 | svalue.origin = (gchar *)path; |
| 3489 | |
| 3490 | ctk_settings_set_property_value_internal (settings, key, &svalue, source); |
| 3491 | g_value_unset (&svalue.value); |
| 3492 | } |
| 3493 | } |
| 3494 | |
| 3495 | out: |
| 3496 | g_strfreev (keys); |
| 3497 | g_key_file_free (keyfile); |
| 3498 | } |
| 3499 | |
| 3500 | static gboolean |
| 3501 | settings_update_xsetting (CtkSettings *settings, |
| 3502 | GParamSpec *pspec, |
| 3503 | gboolean force) |
| 3504 | { |
| 3505 | CtkSettingsPrivate *priv = settings->priv; |
| 3506 | GType value_type; |
| 3507 | GType fundamental_type; |
| 3508 | gboolean retval = FALSE(0); |
| 3509 | |
| 3510 | if (priv->property_values[pspec->param_id - 1].source == CTK_SETTINGS_SOURCE_APPLICATION) |
| 3511 | return FALSE(0); |
| 3512 | |
| 3513 | if (priv->property_values[pspec->param_id - 1].source == CTK_SETTINGS_SOURCE_XSETTING && !force) |
| 3514 | return FALSE(0); |
| 3515 | |
| 3516 | value_type = G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type ); |
| 3517 | fundamental_type = G_TYPE_FUNDAMENTAL (value_type)(g_type_fundamental (value_type)); |
| 3518 | |
| 3519 | if ((g_value_type_transformable (G_TYPE_INT((GType) ((6) << (2))), value_type) && |
| 3520 | !(fundamental_type == G_TYPE_ENUM((GType) ((12) << (2))) || fundamental_type == G_TYPE_FLAGS((GType) ((13) << (2))))) || |
| 3521 | g_value_type_transformable (G_TYPE_STRING((GType) ((16) << (2))), value_type) || |
| 3522 | g_value_type_transformable (CDK_TYPE_RGBA(cdk_rgba_get_type ()), value_type)) |
| 3523 | { |
| 3524 | GValue val = G_VALUE_INIT{ 0, { { 0 } } }; |
| 3525 | |
| 3526 | g_value_init (&val, value_type); |
| 3527 | |
| 3528 | if (!cdk_screen_get_setting (priv->screen, pspec->name, &val)) |
| 3529 | return FALSE(0); |
| 3530 | |
| 3531 | g_param_value_validate (pspec, &val); |
| 3532 | g_value_copy (&val, &priv->property_values[pspec->param_id - 1].value); |
| 3533 | priv->property_values[pspec->param_id - 1].source = CTK_SETTINGS_SOURCE_XSETTING; |
| 3534 | |
| 3535 | g_value_unset (&val); |
| 3536 | |
| 3537 | retval = TRUE(!(0)); |
| 3538 | } |
| 3539 | else |
| 3540 | { |
| 3541 | GValue tmp_value = G_VALUE_INIT{ 0, { { 0 } } }; |
| 3542 | GValue gstring_value = G_VALUE_INIT{ 0, { { 0 } } }; |
| 3543 | GValue val = G_VALUE_INIT{ 0, { { 0 } } }; |
| 3544 | CtkRcPropertyParser parser = (CtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser); |
| 3545 | |
| 3546 | g_value_init (&val, G_TYPE_STRING((GType) ((16) << (2)))); |
| 3547 | |
| 3548 | if (!cdk_screen_get_setting (priv->screen, pspec->name, &val)) |
| 3549 | return FALSE(0); |
| 3550 | |
| 3551 | g_value_init (&gstring_value, G_TYPE_GSTRING(g_gstring_get_type ())); |
| 3552 | g_value_take_boxed (&gstring_value, g_string_new (g_value_get_string (&val))); |
| 3553 | |
| 3554 | g_value_init (&tmp_value, value_type); |
| 3555 | if (parser && _ctk_settings_parse_convert (parser, &gstring_value, |
| 3556 | pspec, &tmp_value)) |
| 3557 | { |
| 3558 | g_param_value_validate (pspec, &tmp_value); |
| 3559 | g_value_copy (&tmp_value, &priv->property_values[pspec->param_id - 1].value); |
| 3560 | priv->property_values[pspec->param_id - 1].source = CTK_SETTINGS_SOURCE_XSETTING; |
| 3561 | retval = TRUE(!(0)); |
| 3562 | } |
| 3563 | |
| 3564 | g_value_unset (&gstring_value); |
| 3565 | g_value_unset (&tmp_value); |
| 3566 | |
| 3567 | g_value_unset (&val); |
| 3568 | } |
| 3569 | |
| 3570 | return retval; |
| 3571 | } |
| 3572 | |
| 3573 | static void |
| 3574 | settings_update_xsettings (CtkSettings *settings) |
| 3575 | { |
| 3576 | GParamSpec **pspecs; |
| 3577 | gint i; |
| 3578 | |
| 3579 | pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), NULL((void*)0)); |
| 3580 | for (i = 0; pspecs[i]; i++) |
| 3581 | settings_update_xsetting (settings, pspecs[i], FALSE(0)); |
| 3582 | g_free (pspecs); |
| 3583 | } |
| 3584 | |
| 3585 | static void |
| 3586 | ctk_settings_get_property (GObject *object, |
| 3587 | guint property_id, |
| 3588 | GValue *value, |
| 3589 | GParamSpec *pspec) |
| 3590 | { |
| 3591 | CtkSettings *settings = CTK_SETTINGS (object)((((CtkSettings*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((object)), ((ctk_settings_get_type ())))))); |
| 3592 | CtkSettingsPrivate *priv = settings->priv; |
| 3593 | |
| 3594 | /* handle internal properties */ |
| 3595 | switch (property_id) |
| 3596 | { |
| 3597 | case PROP_COLOR_HASH: |
| 3598 | g_value_take_boxed (value, g_hash_table_new (g_str_hash, g_str_equal)); |
| 3599 | return; |
| 3600 | default: ; |
| 3601 | } |
| 3602 | |
| 3603 | settings_update_xsetting (settings, pspec, FALSE(0)); |
| 3604 | |
| 3605 | g_value_copy (&priv->property_values[property_id - 1].value, value); |
| 3606 | } |
| 3607 | |
| 3608 | CtkSettingsSource |
| 3609 | _ctk_settings_get_setting_source (CtkSettings *settings, |
| 3610 | const gchar *name) |
| 3611 | { |
| 3612 | CtkSettingsPrivate *priv = settings->priv; |
| 3613 | GParamSpec *pspec; |
| 3614 | |
| 3615 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), name); |
| 3616 | if (!pspec) |
| 3617 | return CTK_SETTINGS_SOURCE_DEFAULT; |
| 3618 | |
| 3619 | return priv->property_values[pspec->param_id - 1].source; |
| 3620 | } |
| 3621 | |
| 3622 | /** |
| 3623 | * ctk_settings_reset_property: |
| 3624 | * @settings: a #CtkSettings object |
| 3625 | * @name: the name of the setting to reset |
| 3626 | * |
| 3627 | * Undoes the effect of calling g_object_set() to install an |
| 3628 | * application-specific value for a setting. After this call, |
| 3629 | * the setting will again follow the session-wide value for |
| 3630 | * this setting. |
| 3631 | * |
| 3632 | * Since: 3.20 |
| 3633 | */ |
| 3634 | void |
| 3635 | ctk_settings_reset_property (CtkSettings *settings, |
| 3636 | const gchar *name) |
| 3637 | { |
| 3638 | CtkSettingsPrivate *priv = settings->priv; |
| 3639 | GParamSpec *pspec; |
| 3640 | CtkRcPropertyParser parser; |
| 3641 | GValue *value; |
| 3642 | GValue tmp_value = G_VALUE_INIT{ 0, { { 0 } } }; |
| 3643 | |
| 3644 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), name); |
| 3645 | |
| 3646 | g_return_if_fail (pspec != NULL)do { if ((pspec != ((void*)0))) { } else { g_return_if_fail_warning ("Ctk", ((const char*) (__func__)), "pspec != NULL"); return ; } } while (0); |
| 3647 | |
| 3648 | parser = (CtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser); |
| 3649 | value = g_param_spec_get_qdata (pspec, g_quark_from_string (name)); |
| 3650 | |
| 3651 | g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec)(((((GParamSpec*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((pspec)), (((GType) ((19) << (2))))))))->value_type )); |
| 3652 | if (value && _ctk_settings_parse_convert (parser, value, pspec, &tmp_value)) |
| 3653 | g_value_copy (&tmp_value, &priv->property_values[pspec->param_id - 1].value); |
| 3654 | else |
| 3655 | g_param_value_set_default (pspec, &priv->property_values[pspec->param_id - 1].value); |
| 3656 | |
| 3657 | priv->property_values[pspec->param_id - 1].source = CTK_SETTINGS_SOURCE_DEFAULT; |
| 3658 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 3659 | } |
| 3660 | |
| 3661 | gboolean |
| 3662 | ctk_settings_get_enable_animations (CtkSettings *settings) |
| 3663 | { |
| 3664 | CtkSettingsPrivate *priv = settings->priv; |
| 3665 | CtkSettingsPropertyValue *svalue = &priv->property_values[PROP_ENABLE_ANIMATIONS - 1]; |
| 3666 | |
| 3667 | if (svalue->source < CTK_SETTINGS_SOURCE_XSETTING) |
| 3668 | { |
| 3669 | GParamSpec *pspec; |
| 3670 | |
| 3671 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), "ctk-enable-animations"); |
| 3672 | if (settings_update_xsetting (settings, pspec, FALSE(0))) |
| 3673 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 3674 | } |
| 3675 | |
| 3676 | return g_value_get_boolean (&svalue->value); |
| 3677 | } |
| 3678 | |
| 3679 | gint |
| 3680 | ctk_settings_get_dnd_drag_threshold (CtkSettings *settings) |
| 3681 | { |
| 3682 | CtkSettingsPrivate *priv = settings->priv; |
| 3683 | CtkSettingsPropertyValue *svalue = &priv->property_values[PROP_DND_DRAG_THRESHOLD - 1]; |
| 3684 | |
| 3685 | if (svalue->source < CTK_SETTINGS_SOURCE_XSETTING) |
| 3686 | { |
| 3687 | GParamSpec *pspec; |
| 3688 | |
| 3689 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), "ctk-dnd-drag-threshold"); |
| 3690 | if (settings_update_xsetting (settings, pspec, FALSE(0))) |
| 3691 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 3692 | } |
| 3693 | |
| 3694 | return g_value_get_int (&svalue->value); |
| 3695 | } |
| 3696 | |
| 3697 | static void |
| 3698 | settings_update_font_name (CtkSettings *settings) |
| 3699 | { |
| 3700 | CtkSettingsPrivate *priv = settings->priv; |
| 3701 | CtkSettingsPropertyValue *svalue = &priv->property_values[PROP_FONT_NAME - 1]; |
| 3702 | |
| 3703 | if (svalue->source < CTK_SETTINGS_SOURCE_XSETTING) |
| 3704 | { |
| 3705 | GParamSpec *pspec; |
| 3706 | |
| 3707 | pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings)((((GObjectClass*) (((GTypeInstance*) ((settings)))->g_class )))), "ctk-font-name"); |
| 3708 | if (settings_update_xsetting (settings, pspec, FALSE(0))) |
| 3709 | g_object_notify_by_pspec (G_OBJECT (settings)((((GObject*) (void *) g_type_check_instance_cast ((GTypeInstance *) ((settings)), (((GType) ((20) << (2)))))))), pspec); |
| 3710 | } |
| 3711 | } |
| 3712 | |
| 3713 | const gchar * |
| 3714 | ctk_settings_get_font_family (CtkSettings *settings) |
| 3715 | { |
| 3716 | settings_update_font_name (settings); |
| 3717 | |
| 3718 | return settings->priv->font_family; |
| 3719 | } |
| 3720 | |
| 3721 | gint |
| 3722 | ctk_settings_get_font_size (CtkSettings *settings) |
| 3723 | { |
| 3724 | settings_update_font_name (settings); |
| 3725 | |
| 3726 | return settings->priv->font_size; |
| 3727 | } |
| 3728 | |
| 3729 | gboolean |
| 3730 | ctk_settings_get_font_size_is_absolute (CtkSettings *settings) |
| 3731 | { |
| 3732 | settings_update_font_name (settings); |
| 3733 | |
| 3734 | return settings->priv->font_size_absolute; |
| 3735 | } |