gtksettings.c 131 KB
Newer Older
Cody Russell's avatar
Cody Russell committed
1
/* GTK - The GIMP Toolkit
2 3 4 5 6 7 8 9 10 11 12 13 14
 * Copyright (C) 2000 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
Javier Jardón's avatar
Javier Jardón committed
15
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.Free
16 17
 */

18

19
#include "config.h"
20 21 22

#include <string.h>

23 24
#include "gtksettings.h"

25
#include "gtkmodules.h"
26
#include "gtkmodulesprivate.h"
27
#include "gtksettingsprivate.h"
Havoc Pennington's avatar
Havoc Pennington committed
28
#include "gtkintl.h"
29
#include "gtkwidget.h"
30
#include "gtkprivate.h"
31
#include "gtkcssproviderprivate.h"
32
#include "gtkstyleproviderprivate.h"
33
#include "gtktypebuiltins.h"
34
#include "gtkversion.h"
Matthias Clasen's avatar
Matthias Clasen committed
35
#include "gtkscrolledwindow.h"
36

37 38
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
39
#include <pango/pangofc-fontmap.h>
40 41
#endif

42 43
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
44
#include <pango/pangofc-fontmap.h>
45 46
#endif

47 48 49 50
#ifdef GDK_WINDOWING_BROADWAY
#include "broadway/gdkbroadway.h"
#endif

51 52 53 54
#ifdef GDK_WINDOWING_QUARTZ
#include "quartz/gdkquartz.h"
#endif

55 56 57 58
#ifdef GDK_WINDOWING_WIN32
#include "win32/gdkwin32.h"
#endif

59 60 61 62
#ifdef G_OS_WIN32
#include "gtkwin32themeprivate.h"
#endif

63 64
#include "deprecated/gtkrc.h"

65 66 67 68 69 70
#ifdef GDK_WINDOWING_QUARTZ
#define PRINT_PREVIEW_COMMAND "open -a /Applications/Preview.app %f"
#else
#define PRINT_PREVIEW_COMMAND "evince --unlink-tempfile --preview --print-settings %s %f"
#endif

71 72 73 74 75
/**
 * SECTION:gtksettings
 * @Short_description: Sharing settings between applications
 * @Title: Settings
 *
76 77 78
 * GtkSettings provide a mechanism to share global settings between
 * applications.
 *
79
 * On the X window system, this sharing is realized by an
80
 * [XSettings](http://www.freedesktop.org/wiki/Specifications/xsettings-spec)
81 82 83
 * manager that is usually part of the desktop environment, along with
 * utilities that let the user change these settings. In the absence of
 * an Xsettings manager, GTK+ reads default values for settings from
84 85 86
 * `settings.ini` files in
 * `/etc/gtk-3.0`, `$XDG_CONFIG_DIRS/gtk-3.0`
 * and `$XDG_CONFIG_HOME/gtk-3.0`.
87
 * These files must be valid key files (see #GKeyFile), and have
88
 * a section called Settings. Themes can also provide default values
89 90
 * for settings by installing a `settings.ini` file
 * next to their `gtk.css` file.
91
 *
92 93 94 95 96 97 98
 * Applications can override system-wide settings by setting the property
 * of the GtkSettings object with g_object_set(). This should be restricted
 * to special cases though; GtkSettings are not meant as an application
 * configuration facility. When doing so, you need to be aware that settings
 * that are specific to individual widgets may not be available before the
 * widget type has been realized at least once. The following example
 * demonstrates a way to do this:
99
 * |[<!-- language="C" -->
100 101
 *   gtk_init (&argc, &argv);
 *
102
 *   // make sure the type is realized
103 104
 *   g_type_class_unref (g_type_class_ref (GTK_TYPE_IMAGE_MENU_ITEM));
 *
105
 *   g_object_set (gtk_settings_get_default (), "gtk-enable-animations", FALSE, NULL);
106
 * ]|
107 108 109 110 111 112 113 114
 *
 * There is one GtkSettings instance per screen. It can be obtained with
 * gtk_settings_get_for_screen(), but in many cases, it is more convenient
 * to use gtk_widget_get_settings(). gtk_settings_get_default() returns the
 * GtkSettings instance for the default screen.
 */


115 116
#define DEFAULT_TIMEOUT_INITIAL 500
#define DEFAULT_TIMEOUT_REPEAT   50
117
#define DEFAULT_TIMEOUT_EXPAND  500
118

119
typedef struct _GtkSettingsPropertyValue GtkSettingsPropertyValue;
120 121
typedef struct _GtkSettingsValuePrivate GtkSettingsValuePrivate;

122 123 124 125 126
struct _GtkSettingsPrivate
{
  GData *queued_settings;      /* of type GtkSettingsValue* */
  GtkSettingsPropertyValue *property_values;
  GdkScreen *screen;
127
  GSList *style_cascades;
128 129
  GtkCssProvider *theme_provider;
  GtkCssProvider *key_theme_provider;
130 131
};

132 133 134
struct _GtkSettingsValuePrivate
{
  GtkSettingsValue public;
135
  GtkSettingsSource source;
136 137 138 139 140
};

struct _GtkSettingsPropertyValue
{
  GValue value;
141
  GtkSettingsSource source;
142 143
};

144 145
enum {
  PROP_0,
146
  PROP_DOUBLE_CLICK_TIME,
147
  PROP_DOUBLE_CLICK_DISTANCE,
148 149
  PROP_CURSOR_BLINK,
  PROP_CURSOR_BLINK_TIME,
150
  PROP_CURSOR_BLINK_TIMEOUT,
151 152
  PROP_SPLIT_CURSOR,
  PROP_THEME_NAME,
153
  PROP_ICON_THEME_NAME,
154
  PROP_FALLBACK_ICON_THEME,
Havoc Pennington's avatar
Havoc Pennington committed
155
  PROP_KEY_THEME_NAME,
Anders Carlsson's avatar
Anders Carlsson committed
156
  PROP_MENU_BAR_ACCEL,
157
  PROP_DND_DRAG_THRESHOLD,
158
  PROP_FONT_NAME,
159
  PROP_ICON_SIZES,
160
  PROP_MODULES,
161 162 163 164
  PROP_XFT_ANTIALIAS,
  PROP_XFT_HINTING,
  PROP_XFT_HINTSTYLE,
  PROP_XFT_RGBA,
165
  PROP_XFT_DPI,
166 167
  PROP_CURSOR_THEME_NAME,
  PROP_CURSOR_THEME_SIZE,
168
  PROP_ALTERNATIVE_BUTTON_ORDER,
169
  PROP_ALTERNATIVE_SORT_ARROWS,
170 171
  PROP_SHOW_INPUT_METHOD_MENU,
  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,
Kristian Rietveld's avatar
Kristian Rietveld committed
178 179 180
  PROP_TOOLTIP_TIMEOUT,
  PROP_TOOLTIP_BROWSE_TIMEOUT,
  PROP_TOOLTIP_BROWSE_MODE_TIMEOUT,
181 182 183
  PROP_KEYNAV_CURSOR_ONLY,
  PROP_KEYNAV_WRAP_AROUND,
  PROP_ERROR_BELL,
184 185 186
  PROP_COLOR_HASH,
  PROP_FILE_CHOOSER_BACKEND,
  PROP_PRINT_BACKENDS,
187 188
  PROP_PRINT_PREVIEW_COMMAND,
  PROP_ENABLE_MNEMONICS,
189
  PROP_ENABLE_ACCELS,
190
  PROP_RECENT_FILES_LIMIT,
191
  PROP_IM_MODULE,
192
  PROP_RECENT_FILES_MAX_AGE,
193 194 195
  PROP_FONTCONFIG_TIMESTAMP,
  PROP_SOUND_THEME_NAME,
  PROP_ENABLE_INPUT_FEEDBACK_SOUNDS,
196
  PROP_ENABLE_EVENT_SOUNDS,
197 198
  PROP_ENABLE_TOOLTIPS,
  PROP_TOOLBAR_STYLE,
199
  PROP_TOOLBAR_ICON_SIZE,
200
  PROP_AUTO_MNEMONICS,
201
  PROP_PRIMARY_BUTTON_WARPS_SLIDER,
202
  PROP_VISIBLE_FOCUS,
203 204 205 206 207 208 209 210 211 212 213 214 215
  PROP_APPLICATION_PREFER_DARK_THEME,
  PROP_BUTTON_IMAGES,
  PROP_ENTRY_SELECT_ON_FOCUS,
  PROP_ENTRY_PASSWORD_HINT_TIMEOUT,
  PROP_MENU_IMAGES,
  PROP_MENU_BAR_POPUP_DELAY,
  PROP_SCROLLED_WINDOW_PLACEMENT,
  PROP_CAN_CHANGE_ACCELS,
  PROP_MENU_POPUP_DELAY,
  PROP_MENU_POPDOWN_DELAY,
  PROP_LABEL_SELECT_ON_FOCUS,
  PROP_COLOR_PALETTE,
  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 222 223
  PROP_TITLEBAR_DOUBLE_CLICK,
  PROP_TITLEBAR_MIDDLE_CLICK,
  PROP_TITLEBAR_RIGHT_CLICK,
224
  PROP_DIALOGS_USE_HEADER,
225
  PROP_ENABLE_PRIMARY_PASTE,
226 227
  PROP_RECENT_FILES_ENABLED,
  PROP_LONG_PRESS_TIME
228 229 230
};

/* --- prototypes --- */
231
static void     gtk_settings_provider_iface_init (GtkStyleProviderIface *iface);
232
static void     gtk_settings_provider_private_init (GtkStyleProviderPrivateInterface *iface);
233

234 235 236 237 238 239 240 241 242 243 244 245 246 247
static void     gtk_settings_finalize            (GObject               *object);
static void     gtk_settings_get_property        (GObject               *object,
                                                  guint                  property_id,
                                                  GValue                *value,
                                                  GParamSpec            *pspec);
static void     gtk_settings_set_property        (GObject               *object,
                                                  guint                  property_id,
                                                  const GValue          *value,
                                                  GParamSpec            *pspec);
static void     gtk_settings_notify              (GObject               *object,
                                                  GParamSpec            *pspec);
static guint    settings_install_property_parser (GtkSettingsClass      *class,
                                                  GParamSpec            *pspec,
                                                  GtkRcPropertyParser    parser);
248
static void    settings_update_double_click      (GtkSettings           *settings);
249 250
static void    settings_update_modules           (GtkSettings           *settings);

251
static void    settings_update_cursor_theme      (GtkSettings           *settings);
252 253
static void    settings_update_resolution        (GtkSettings           *settings);
static void    settings_update_font_options      (GtkSettings           *settings);
254
static gboolean settings_update_fontconfig       (GtkSettings           *settings);
255
static void    settings_update_theme             (GtkSettings *settings);
256
static void    settings_update_key_theme         (GtkSettings *settings);
257

258 259 260
static void gtk_settings_load_from_key_file      (GtkSettings           *settings,
                                                  const gchar           *path,
                                                  GtkSettingsSource      source);
261 262 263
static void settings_update_provider             (GdkScreen             *screen,
                                                  GtkCssProvider       **old,
                                                  GtkCssProvider        *new);
264

265 266 267 268
/* the default palette for GtkColorSelelection */
static const gchar default_color_palette[] =
  "black:white:gray50:red:purple:blue:light blue:green:yellow:orange:"
  "lavender:brown:goldenrod4:dodger blue:pink:light green:gray10:gray30:gray75:gray90";
269 270

/* --- variables --- */
271
static GQuark            quark_property_parser = 0;
272
static GSList           *object_list = NULL;
273
static guint             class_n_properties = 0;
274 275


276
G_DEFINE_TYPE_EXTENDED (GtkSettings, gtk_settings, G_TYPE_OBJECT, 0,
277
                        G_ADD_PRIVATE (GtkSettings)
278
                        G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER,
279 280 281
                                               gtk_settings_provider_iface_init)
                        G_IMPLEMENT_INTERFACE (GTK_TYPE_STYLE_PROVIDER_PRIVATE,
                                               gtk_settings_provider_private_init));
282

Matthias Clasen's avatar
Matthias Clasen committed
283
/* --- functions --- */
284 285 286
static void
gtk_settings_init (GtkSettings *settings)
{
287
  GtkSettingsPrivate *priv;
Tim Janik's avatar
Tim Janik committed
288 289
  GParamSpec **pspecs, **p;
  guint i = 0;
290
  gchar *path;
291 292
  const gchar * const *config_dirs;
  const gchar *config_dir;
293

294
  priv = gtk_settings_get_instance_private (settings);
295
  settings->priv = priv;
296

297
  g_datalist_init (&priv->queued_settings);
298 299
  object_list = g_slist_prepend (object_list, settings);

300
  priv->style_cascades = g_slist_prepend (NULL, _gtk_style_cascade_new ());
301 302
  priv->theme_provider = gtk_css_provider_new ();

303 304 305 306
  /* build up property array for all yet existing properties and queue
   * notification for them (at least notification for internal properties
   * will instantly be caught)
   */
Tim Janik's avatar
Tim Janik committed
307 308 309 310
  pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (settings), NULL);
  for (p = pspecs; *p; p++)
    if ((*p)->owner_type == G_OBJECT_TYPE (settings))
      i++;
311
  priv->property_values = g_new0 (GtkSettingsPropertyValue, i);
Tim Janik's avatar
Tim Janik committed
312
  i = 0;
313
  g_object_freeze_notify (G_OBJECT (settings));
314

Tim Janik's avatar
Tim Janik committed
315
  for (p = pspecs; *p; p++)
316
    {
Tim Janik's avatar
Tim Janik committed
317
      GParamSpec *pspec = *p;
318
      GType value_type = G_PARAM_SPEC_VALUE_TYPE (pspec);
319

Tim Janik's avatar
Tim Janik committed
320
      if (pspec->owner_type != G_OBJECT_TYPE (settings))
321
        continue;
322
      g_value_init (&priv->property_values[i].value, value_type);
323
      g_param_value_set_default (pspec, &priv->property_values[i].value);
324

325
      g_object_notify_by_pspec (G_OBJECT (settings), pspec);
326
      priv->property_values[i].source = GTK_SETTINGS_SOURCE_DEFAULT;
Tim Janik's avatar
Tim Janik committed
327
      i++;
328
    }
329
  g_free (pspecs);
330

331 332 333 334 335
  path = g_build_filename (_gtk_get_data_prefix (), "share", "gtk-3.0", "settings.ini", NULL);
  if (g_file_test (path, G_FILE_TEST_EXISTS))
    gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
  g_free (path);

336
  path = g_build_filename (_gtk_get_sysconfdir (), "gtk-3.0", "settings.ini", NULL);
337 338 339 340
  if (g_file_test (path, G_FILE_TEST_EXISTS))
    gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
  g_free (path);

341 342 343 344 345 346 347 348 349
  config_dirs = g_get_system_config_dirs ();
  for (config_dir = *config_dirs; *config_dirs != NULL; config_dirs++)
    {
      path = g_build_filename (config_dir, "gtk-3.0", "settings.ini", NULL);
      if (g_file_test (path, G_FILE_TEST_EXISTS))
        gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
      g_free (path);
    }

350 351 352
  path = g_build_filename (g_get_user_config_dir (), "gtk-3.0", "settings.ini", NULL);
  if (g_file_test (path, G_FILE_TEST_EXISTS))
    gtk_settings_load_from_key_file (settings, path, GTK_SETTINGS_SOURCE_DEFAULT);
353 354
  g_free (path);

355
  g_object_thaw_notify (G_OBJECT (settings));
356 357 358 359 360 361
}

static void
gtk_settings_class_init (GtkSettingsClass *class)
{
  GObjectClass *gobject_class = G_OBJECT_CLASS (class);
Havoc Pennington's avatar
Havoc Pennington committed
362
  guint result;
363

364 365 366 367 368 369
  gobject_class->finalize = gtk_settings_finalize;
  gobject_class->get_property = gtk_settings_get_property;
  gobject_class->set_property = gtk_settings_set_property;
  gobject_class->notify = gtk_settings_notify;

  quark_property_parser = g_quark_from_static_string ("gtk-rc-property-parser");
Havoc Pennington's avatar
Havoc Pennington committed
370
  result = settings_install_property_parser (class,
371
                                             g_param_spec_int ("gtk-double-click-time",
372 373
                                                               P_("Double Click Time"),
                                                               P_("Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)"),
374
                                                               0, G_MAXINT, 250,
375
                                                               GTK_PARAM_READWRITE),
Havoc Pennington's avatar
Havoc Pennington committed
376
                                             NULL);
377
  g_assert (result == PROP_DOUBLE_CLICK_TIME);
378 379
  result = settings_install_property_parser (class,
                                             g_param_spec_int ("gtk-double-click-distance",
380 381
                                                               P_("Double Click Distance"),
                                                               P_("Maximum distance allowed between two clicks for them to be considered a double click (in pixels)"),
382
                                                               0, G_MAXINT, 5,
383
                                                               GTK_PARAM_READWRITE),
384 385
                                             NULL);
  g_assert (result == PROP_DOUBLE_CLICK_DISTANCE);
386 387 388 389

  /**
   * GtkSettings:gtk-cursor-blink:
   *
390
   * Whether the cursor should blink.
391
   *
392 393
   * Also see the #GtkSettings:gtk-cursor-blink-timeout setting,
   * which allows more flexible control over cursor blinking.
394
   */
395 396
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-cursor-blink",
397 398 399
                                                                   P_("Cursor Blink"),
                                                                   P_("Whether the cursor should blink"),
                                                                   TRUE,
400
                                                                   GTK_PARAM_READWRITE ),
401
                                             NULL);
402 403 404
  g_assert (result == PROP_CURSOR_BLINK);
  result = settings_install_property_parser (class,
                                             g_param_spec_int ("gtk-cursor-blink-time",
405
                                                               P_("Cursor Blink Time"),
406
                                                               P_("Length of the cursor blink cycle, in milliseconds"),
407
                                                               100, G_MAXINT, 1200,
408
                                                               GTK_PARAM_READWRITE),
409 410
                                             NULL);
  g_assert (result == PROP_CURSOR_BLINK_TIME);
411

412 413 414 415 416 417 418
  /**
   * GtkSettings:gtk-cursor-blink-timeout:
   *
   * Time after which the cursor stops blinking, in seconds.
   * The timer is reset after each user interaction.
   *
   * Setting this to zero has the same effect as setting
419
   * #GtkSettings:gtk-cursor-blink to %FALSE.
420 421 422 423 424 425 426
   *
   * Since: 2.12
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_int ("gtk-cursor-blink-timeout",
                                                               P_("Cursor Blink Timeout"),
                                                               P_("Time after which the cursor stops blinking, in seconds"),
427
                                                               1, G_MAXINT, 10,
428
                                                               GTK_PARAM_READWRITE),
429 430
                                             NULL);
  g_assert (result == PROP_CURSOR_BLINK_TIMEOUT);
431 432
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-split-cursor",
433 434 435 436
                                                                   P_("Split Cursor"),
                                                                   P_("Whether two cursors should be displayed for mixed left-to-right and right-to-left text"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
437 438
                                             NULL);
  g_assert (result == PROP_SPLIT_CURSOR);
439 440
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-theme-name",
441
                                                                   P_("Theme Name"),
Matthias Clasen's avatar
Matthias Clasen committed
442
                                                                   P_("Name of theme to load"),
443
                                                                  DEFAULT_THEME_NAME,
444
                                                                  GTK_PARAM_READWRITE),
445 446
                                             NULL);
  g_assert (result == PROP_THEME_NAME);
447

448 449
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-icon-theme-name",
450 451
                                                                  P_("Icon Theme Name"),
                                                                  P_("Name of icon theme to use"),
452
                                                                  DEFAULT_ICON_THEME,
453
                                                                  GTK_PARAM_READWRITE),
454
                                             NULL);
455
  g_assert (result == PROP_ICON_THEME_NAME);
456

457 458 459 460 461 462 463
  /**
   * GtkSettings:gtk-fallback-icon-theme:
   *
   * Name of a icon theme to fall back to.
   *
   * Deprecated: 3.10: This setting is ignored.
   */
464 465
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-fallback-icon-theme",
466 467 468
                                                                  P_("Fallback Icon Theme Name"),
                                                                  P_("Name of a icon theme to fall back to"),
                                                                  NULL,
469
                                                                  GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
470 471
                                             NULL);
  g_assert (result == PROP_FALLBACK_ICON_THEME);
472

473 474
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-key-theme-name",
475
                                                                  P_("Key Theme Name"),
Matthias Clasen's avatar
Matthias Clasen committed
476
                                                                  P_("Name of key theme to load"),
477
                                                                  NULL,
478
                                                                  GTK_PARAM_READWRITE),
479
                                             NULL);
480
  g_assert (result == PROP_KEY_THEME_NAME);
Havoc Pennington's avatar
Havoc Pennington committed
481

482 483 484 485 486
  /**
   * GtkSettings:gtk-menu-bar-accel:
   *
   * Keybinding to activate the menu bar.
   *
487 488
   * Deprecated: 3.10: This setting can still be used for application
   *      overrides, but will be ignored in the future
489
   */
Havoc Pennington's avatar
Havoc Pennington committed
490 491
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-menu-bar-accel",
492 493
                                                                  P_("Menu bar accelerator"),
                                                                  P_("Keybinding to activate the menu bar"),
Havoc Pennington's avatar
Havoc Pennington committed
494
                                                                  "F10",
495
                                                                  GTK_PARAM_READWRITE),
Havoc Pennington's avatar
Havoc Pennington committed
496 497
                                             NULL);
  g_assert (result == PROP_MENU_BAR_ACCEL);
Anders Carlsson's avatar
Anders Carlsson committed
498 499

  result = settings_install_property_parser (class,
500 501 502 503
                                             g_param_spec_int ("gtk-dnd-drag-threshold",
                                                               P_("Drag threshold"),
                                                               P_("Number of pixels the cursor can move before dragging"),
                                                               1, G_MAXINT, 8,
504
                                                               GTK_PARAM_READWRITE),
505
                                             NULL);
Anders Carlsson's avatar
Anders Carlsson committed
506
  g_assert (result == PROP_DND_DRAG_THRESHOLD);
507 508 509

  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-font-name",
510 511 512 513
                                                                   P_("Font Name"),
                                                                   P_("Name of default font to use"),
                                                                  "Sans 10",
                                                                  GTK_PARAM_READWRITE),
514 515
                                             NULL);
  g_assert (result == PROP_FONT_NAME);
516

517 518 519 520 521 522
  /**
   * GtkSettings:gtk-icon-sizes:
   *
   * A list of icon sizes. The list is separated by colons, and
   * item has the form:
   *
523
   * `size-name` = `width` , `height`
524
   *
525 526 527 528
   * E.g. "gtk-menu=16,16:gtk-button=20,20:gtk-dialog=48,48".
   * GTK+ itself use the following named icon sizes: gtk-menu,
   * gtk-button, gtk-small-toolbar, gtk-large-toolbar, gtk-dnd,
   * gtk-dialog. Applications can register their own named icon
529
   * sizes with gtk_icon_size_register().
530 531
   *
   * Deprecated: 3.10: This setting is ignored.
532
   */
533 534
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-icon-sizes",
535 536 537
                                                                   P_("Icon Sizes"),
                                                                   P_("List of icon sizes (gtk-menu=16,16:gtk-button=20,20..."),
                                                                  NULL,
538
                                                                  GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
539 540
                                             NULL);
  g_assert (result == PROP_ICON_SIZES);
541

542 543
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-modules",
544 545 546 547
                                                                  P_("GTK Modules"),
                                                                  P_("List of currently active GTK modules"),
                                                                  NULL,
                                                                  GTK_PARAM_READWRITE),
548 549 550
                                             NULL);
  g_assert (result == PROP_MODULES);

551
  result = settings_install_property_parser (class,
552 553 554 555 556 557 558
                                             g_param_spec_int ("gtk-xft-antialias",
                                                               P_("Xft Antialias"),
                                                               P_("Whether to antialias Xft fonts; 0=no, 1=yes, -1=default"),
                                                               -1, 1, -1,
                                                               GTK_PARAM_READWRITE),
                                             NULL);

559
  g_assert (result == PROP_XFT_ANTIALIAS);
560 561 562 563 564 565 566 567 568

  result = settings_install_property_parser (class,
                                             g_param_spec_int ("gtk-xft-hinting",
                                                               P_("Xft Hinting"),
                                                               P_("Whether to hint Xft fonts; 0=no, 1=yes, -1=default"),
                                                               -1, 1, -1,
                                                               GTK_PARAM_READWRITE),
                                             NULL);

569
  g_assert (result == PROP_XFT_HINTING);
570

571
  result = settings_install_property_parser (class,
572 573 574 575 576
                                             g_param_spec_string ("gtk-xft-hintstyle",
                                                                  P_("Xft Hint Style"),
                                                                  P_("What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull"),
                                                                  NULL,
                                                                  GTK_PARAM_READWRITE),
577
                                              NULL);
578

579
  g_assert (result == PROP_XFT_HINTSTYLE);
580 581 582 583 584 585 586 587 588

  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-xft-rgba",
                                                                  P_("Xft RGBA"),
                                                                  P_("Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr"),
                                                                  NULL,
                                                                  GTK_PARAM_READWRITE),
                                             NULL);

589
  g_assert (result == PROP_XFT_RGBA);
590 591 592 593 594 595 596 597 598

  result = settings_install_property_parser (class,
                                             g_param_spec_int ("gtk-xft-dpi",
                                                               P_("Xft DPI"),
                                                               P_("Resolution for Xft, in 1024 * dots/inch. -1 to use default value"),
                                                               -1, 1024*1024, -1,
                                                               GTK_PARAM_READWRITE),
                                             NULL);

599
  g_assert (result == PROP_XFT_DPI);
600 601 602

  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-cursor-theme-name",
603 604 605 606
                                                                  P_("Cursor theme name"),
                                                                  P_("Name of the cursor theme to use, or NULL to use the default theme"),
                                                                  NULL,
                                                                  GTK_PARAM_READWRITE),
607 608 609 610
                                             NULL);
  g_assert (result == PROP_CURSOR_THEME_NAME);

  result = settings_install_property_parser (class,
611 612 613 614 615 616 617
                                             g_param_spec_int ("gtk-cursor-theme-size",
                                                               P_("Cursor theme size"),
                                                               P_("Size to use for cursors, or 0 to use the default size"),
                                                               0, 128, 0,
                                                               GTK_PARAM_READWRITE),
                                             NULL);

618 619
  g_assert (result == PROP_CURSOR_THEME_SIZE);

620 621
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-alternative-button-order",
622 623 624 625
                                                                   P_("Alternative button order"),
                                                                   P_("Whether buttons in dialogs should use the alternative button order"),
                                                                   FALSE,
                                                                   GTK_PARAM_READWRITE),
626 627
                                             NULL);
  g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER);
628

629 630 631 632
  /**
   * GtkSettings:gtk-alternative-sort-arrows:
   *
   * Controls the direction of the sort indicators in sorted list and tree
633 634
   * views. By default an arrow pointing down means the column is sorted
   * in ascending order. When set to %TRUE, this order will be inverted.
635 636 637 638 639
   *
   * Since: 2.12
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-alternative-sort-arrows",
640 641 642 643
                                                                   P_("Alternative sort indicator direction"),
                                                                   P_("Whether the direction of the sort indicators in list and tree views is inverted compared to the default (where down means ascending)"),
                                                                   FALSE,
                                                                   GTK_PARAM_READWRITE),
644 645 646
                                             NULL);
  g_assert (result == PROP_ALTERNATIVE_SORT_ARROWS);

647 648 649 650 651
  /**
   * GtkSettings:gtk-show-input-method-menu:
   *
   * Deprecated: 3.10: This setting is ignored.
   */
652 653 654 655
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-show-input-method-menu",
                                                                   P_("Show the 'Input Methods' menu"),
                                                                   P_("Whether the context menus of entries and text views should offer to change the input method"),
656
                                                                   FALSE,
657
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
658 659 660
                                             NULL);
  g_assert (result == PROP_SHOW_INPUT_METHOD_MENU);

661 662 663 664 665
  /**
   * GtkSettings:gtk-show-unicode-menu:
   *
   * Deprecated: 3.10: This setting is ignored.
   */
666 667 668 669
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-show-unicode-menu",
                                                                   P_("Show the 'Insert Unicode Control Character' menu"),
                                                                   P_("Whether the context menus of entries and text views should offer to insert control characters"),
670
                                                                   FALSE,
671
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
672 673 674
                                             NULL);
  g_assert (result == PROP_SHOW_UNICODE_MENU);

675 676 677 678 679
  /**
   * GtkSettings:gtk-timeout-initial:
   *
   * Deprecated: 3.10: This setting is ignored.
   */
680
  result = settings_install_property_parser (class,
681 682 683 684
                                             g_param_spec_int ("gtk-timeout-initial",
                                                               P_("Start timeout"),
                                                               P_("Starting value for timeouts, when button is pressed"),
                                                               0, G_MAXINT, DEFAULT_TIMEOUT_INITIAL,
685
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
686
                                             NULL);
687 688 689

  g_assert (result == PROP_TIMEOUT_INITIAL);

690 691 692 693 694
  /**
   * GtkSettings:gtk-timeout-repeat:
   *
   * Deprecated: 3.10: This setting is ignored.
   */
695
  result = settings_install_property_parser (class,
696 697 698 699
                                             g_param_spec_int ("gtk-timeout-repeat",
                                                               P_("Repeat timeout"),
                                                               P_("Repeat value for timeouts, when button is pressed"),
                                                               0, G_MAXINT, DEFAULT_TIMEOUT_REPEAT,
700
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
701
                                             NULL);
702 703

  g_assert (result == PROP_TIMEOUT_REPEAT);
704

705 706 707 708 709
  /**
   * GtkSettings:gtk-timeout-expand:
   *
   * Deprecated: 3.10: This setting is ignored.
   */
710
  result = settings_install_property_parser (class,
711 712 713 714
                                             g_param_spec_int ("gtk-timeout-expand",
                                                               P_("Expand timeout"),
                                                               P_("Expand value for timeouts, when a widget is expanding a new region"),
                                                               0, G_MAXINT, DEFAULT_TIMEOUT_EXPAND,
715
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
716
                                             NULL);
717 718 719

  g_assert (result == PROP_TIMEOUT_EXPAND);

720 721 722 723
  /**
   * GtkSettings:gtk-color-scheme:
   *
   * A palette of named colors for use in themes. The format of the string is
724
   * |[
725 726 727
   * name1: color1
   * name2: color2
   * ...
728
   * ]|
729
   * Color names must be acceptable as identifiers in the
730
   * [gtkrc][gtk3-Resource-Files] syntax, and
731
   * color specifications must be in the format accepted by
732
   * gdk_color_parse().
733
   *
734 735 736 737
   * Note that due to the way the color tables from different sources are
   * merged, color specifications will be converted to hexadecimal form
   * when getting this property.
   *
738 739
   * Starting with GTK+ 2.12, the entries can alternatively be separated
   * by ';' instead of newlines:
740
   * |[
741
   * name1: color1; name2: color2; ...
742
   * ]|
743
   *
744
   * Since: 2.10
745 746 747
   *
   * Deprecated: 3.8: Color scheme support was dropped and is no longer supported.
   *     You can still set this property, but it will be ignored.
748
   */
749
  result = settings_install_property_parser (class,
750 751 752 753
                                             g_param_spec_string ("gtk-color-scheme",
                                                                  P_("Color scheme"),
                                                                  P_("A palette of named colors for use in themes"),
                                                                  "",
754
                                                                  GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
755
                                             NULL);
756 757

  g_assert (result == PROP_COLOR_SCHEME);
758 759 760 761 762 763 764 765 766 767

  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-animations",
                                                                   P_("Enable Animations"),
                                                                   P_("Whether to enable toolkit-wide animations."),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
                                             NULL);

  g_assert (result == PROP_ENABLE_ANIMATIONS);
768

769 770 771
  /**
   * GtkSettings:gtk-touchscreen-mode:
   *
772
   * When %TRUE, there are no motion notify events delivered on this screen,
773 774 775 776
   * and widgets can't use the pointer hovering them for any essential
   * functionality.
   *
   * Since: 2.10
777
   *
778
   * Deprecated: 3.4. Generally, the behavior for touchscreen input should be
779
   *             performed dynamically based on gdk_event_get_source_device().
780 781 782 783 784 785
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-touchscreen-mode",
                                                                   P_("Enable Touchscreen Mode"),
                                                                   P_("When TRUE, there are no motion notify events delivered on this screen"),
                                                                   FALSE,
786
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
787 788 789
                                             NULL);

  g_assert (result == PROP_TOUCHSCREEN_MODE);
790

Kristian Rietveld's avatar
Kristian Rietveld committed
791 792 793 794 795 796 797
  /**
   * GtkSettings:gtk-tooltip-timeout:
   *
   * Time, in milliseconds, after which a tooltip could appear if the
   * cursor is hovering on top of a widget.
   *
   * Since: 2.12
798 799
   *
   * Deprecated: 3.10: This setting is ignored.
Kristian Rietveld's avatar
Kristian Rietveld committed
800 801
   */
  result = settings_install_property_parser (class,
802 803 804 805 806
                                             g_param_spec_int ("gtk-tooltip-timeout",
                                                               P_("Tooltip timeout"),
                                                               P_("Timeout before tooltip is shown"),
                                                               0, G_MAXINT,
                                                               500,
807
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
808
                                             NULL);
Kristian Rietveld's avatar
Kristian Rietveld committed
809 810 811 812 813 814 815 816 817 818

  g_assert (result == PROP_TOOLTIP_TIMEOUT);

  /**
   * GtkSettings:gtk-tooltip-browse-timeout:
   *
   * Controls the time after which tooltips will appear when
   * browse mode is enabled, in milliseconds.
   *
   * Browse mode is enabled when the mouse pointer moves off an object
819
   * where a tooltip was currently being displayed. If the mouse pointer
Kristian Rietveld's avatar
Kristian Rietveld committed
820
   * hits another object before the browse mode timeout expires (see
821
   * #GtkSettings:gtk-tooltip-browse-mode-timeout), it will take the
822
   * amount of milliseconds specified by this setting to popup the tooltip
Kristian Rietveld's avatar
Kristian Rietveld committed
823 824 825
   * for the new object.
   *
   * Since: 2.12
826 827
   *
   * Deprecated: 3.10: This setting is ignored.
Kristian Rietveld's avatar
Kristian Rietveld committed
828 829
   */
  result = settings_install_property_parser (class,
830 831 832 833 834
                                             g_param_spec_int ("gtk-tooltip-browse-timeout",
                                                               P_("Tooltip browse timeout"),
                                                               P_("Timeout before tooltip is shown when browse mode is enabled"),
                                                               0, G_MAXINT,
                                                               60,
835
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
836
                                             NULL);
Kristian Rietveld's avatar
Kristian Rietveld committed
837 838 839 840 841 842 843 844 845

  g_assert (result == PROP_TOOLTIP_BROWSE_TIMEOUT);

  /**
   * GtkSettings:gtk-tooltip-browse-mode-timeout:
   *
   * Amount of time, in milliseconds, after which the browse mode
   * will be disabled.
   *
846
   * See #GtkSettings:gtk-tooltip-browse-timeout for more information
Kristian Rietveld's avatar
Kristian Rietveld committed
847 848 849
   * about browse mode.
   *
   * Since: 2.12
850 851
   *
   * Deprecated: 3.10: This setting is ignored.
Kristian Rietveld's avatar
Kristian Rietveld committed
852 853
   */
  result = settings_install_property_parser (class,
854 855 856 857 858
                                             g_param_spec_int ("gtk-tooltip-browse-mode-timeout",
                                                               P_("Tooltip browse mode timeout"),
                                                               P_("Timeout after which browse mode is disabled"),
                                                               0, G_MAXINT,
                                                               500,
859
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
860
                                             NULL);
Kristian Rietveld's avatar
Kristian Rietveld committed
861 862 863

  g_assert (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT);

864 865 866 867 868 869 870 871
  /**
   * GtkSettings:gtk-keynav-cursor-only:
   *
   * When %TRUE, keyboard navigation should be able to reach all widgets
   * by using the cursor keys only. Tab, Shift etc. keys can't be expected
   * to be present on the used input device.
   *
   * Since: 2.12
872 873 874
   *
   * Deprecated: 3.10: Generally, the behavior for touchscreen input should be
   *             performed dynamically based on gdk_event_get_source_device().
875 876 877 878 879 880
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-keynav-cursor-only",
                                                                   P_("Keynav Cursor Only"),
                                                                   P_("When TRUE, there are only cursor keys available to navigate widgets"),
                                                                   FALSE,
881
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
882 883 884 885 886 887 888 889 890 891 892
                                             NULL);

  g_assert (result == PROP_KEYNAV_CURSOR_ONLY);

  /**
   * GtkSettings:gtk-keynav-wrap-around:
   *
   * When %TRUE, some widgets will wrap around when doing keyboard
   * navigation, such as menus, menubars and notebooks.
   *
   * Since: 2.12
893 894
   *
   * Deprecated: 3.10: This setting is ignored.
895 896 897 898 899 900
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-keynav-wrap-around",
                                                                   P_("Keynav Wrap Around"),
                                                                   P_("Whether to wrap around when keyboard-navigating widgets"),
                                                                   TRUE,
901
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
                                             NULL);

  g_assert (result == PROP_KEYNAV_WRAP_AROUND);

  /**
   * GtkSettings:gtk-error-bell:
   *
   * When %TRUE, keyboard navigation and other input-related errors
   * will cause a beep. Since the error bell is implemented using
   * gdk_window_beep(), the windowing system may offer ways to
   * configure the error bell in many ways, such as flashing the
   * window or similar visual effects.
   *
   * Since: 2.12
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-error-bell",
                                                                   P_("Error Bell"),
                                                                   P_("When TRUE, keyboard navigation and other errors will cause a beep"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
                                             NULL);

  g_assert (result == PROP_ERROR_BELL);

927
  /**
928
   * GtkSettings:color-hash: (type GLib.HashTable(utf8,Gdk.Color)) (transfer container)
929
   *
930
   * Holds a hash table representation of the #GtkSettings:gtk-color-scheme
931
   * setting, mapping color names to #GdkColors.
932 933
   *
   * Since: 2.10
934 935
   *
   * Deprecated: 3.8: Will always return an empty hash table.
936
   */
937
  result = settings_install_property_parser (class,
938 939 940 941
                                             g_param_spec_boxed ("color-hash",
                                                                 P_("Color Hash"),
                                                                 P_("A hash table representation of the color scheme."),
                                                                 G_TYPE_HASH_TABLE,
942
                                                                 GTK_PARAM_READABLE | G_PARAM_DEPRECATED),
943 944
                                             NULL);
  g_assert (result == PROP_COLOR_HASH);
945

946 947 948 949 950 951 952
  /**
   * GtkSettings:gtk-file-chooser-backend:
   *
   * Name of the GtkFileChooser backend to use by default.
   *
   * Deprecated: 3.10: This setting is ignored. #GtkFileChooser uses GIO by default.
   */
953
  result = settings_install_property_parser (class,
954 955 956 957
                                             g_param_spec_string ("gtk-file-chooser-backend",
                                                                  P_("Default file chooser backend"),
                                                                  P_("Name of the GtkFileChooser backend to use by default"),
                                                                  NULL,
958
                                                                  GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
959 960 961 962 963 964 965 966
                                             NULL);
  g_assert (result == PROP_FILE_CHOOSER_BACKEND);

  /**
   * GtkSettings:gtk-print-backends:
   *
   * A comma-separated list of print backends to use in the print
   * dialog. Available print backends depend on the GTK+ installation,
Matthias Clasen's avatar
Matthias Clasen committed
967
   * and may include "file", "cups", "lpr" or "papi".
968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983
   *
   * Since: 2.10
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-print-backends",
                                                                  P_("Default print backend"),
                                                                  P_("List of the GtkPrintBackend backends to use by default"),
                                                                  GTK_PRINT_BACKENDS,
                                                                  GTK_PARAM_READWRITE),
                                             NULL);
  g_assert (result == PROP_PRINT_BACKENDS);

  /**
   * GtkSettings:gtk-print-preview-command:
   *
   * A command to run for displaying the print preview. The command
984 985
   * should contain a `%f` placeholder, which will get replaced by
   * the path to the pdf file. The command may also contain a `%s`
986
   * placeholder, which will get replaced by the path to a file
987
   * containing the print settings in the format produced by
988
   * gtk_print_settings_to_file().
989 990
   *
   * The preview application is responsible for removing the pdf file
991
   * and the print settings file when it is done.
992 993 994 995 996 997 998
   *
   * Since: 2.10
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-print-preview-command",
                                                                  P_("Default command to run when displaying a print preview"),
                                                                  P_("Command to run when displaying a print preview"),
999
                                                                  PRINT_PREVIEW_COMMAND,
1000
                                                                  GTK_PARAM_READWRITE),
1001
                                             NULL);
1002
  g_assert (result == PROP_PRINT_PREVIEW_COMMAND);
1003 1004 1005 1006 1007 1008 1009 1010

  /**
   * GtkSettings:gtk-enable-mnemonics:
   *
   * Whether labels and menu items should have visible mnemonics which
   * can be activated.
   *
   * Since: 2.12
1011
   *
1012 1013
   * Deprecated: 3.10: This setting can still be used for application
   *      overrides, but will be ignored in the future
1014 1015 1016 1017 1018 1019
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-mnemonics",
                                                                   P_("Enable Mnemonics"),
                                                                   P_("Whether labels should have mnemonics"),
                                                                   TRUE,
1020
                                                                   GTK_PARAM_READWRITE),
1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039
                                             NULL);
  g_assert (result == PROP_ENABLE_MNEMONICS);

  /**
   * GtkSettings:gtk-enable-accels:
   *
   * Whether menu items should have visible accelerators which can be
   * activated.
   *
   * Since: 2.12
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-accels",
                                                                   P_("Enable Accelerators"),
                                                                   P_("Whether menu items should have accelerators"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
                                             NULL);
  g_assert (result == PROP_ENABLE_ACCELS);
1040 1041 1042 1043 1044 1045 1046 1047 1048

  /**
   * GtkSettings:gtk-recent-files-limit:
   *
   * The number of recently used files that should be displayed by default by
   * #GtkRecentChooser implementations and by the #GtkFileChooser. A value of
   * -1 means every recently used file stored.
   *
   * Since: 2.12
1049 1050
   *
   * Deprecated: 3.10: This setting is ignored
1051 1052
   */
  result = settings_install_property_parser (class,
1053 1054 1055 1056 1057
                                             g_param_spec_int ("gtk-recent-files-limit",
                                                               P_("Recent Files Limit"),
                                                               P_("Number of recently used files"),
                                                               -1, G_MAXINT,
                                                               50,
1058
                                                               GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1059
                                             NULL);
1060
  g_assert (result == PROP_RECENT_FILES_LIMIT);
1061 1062 1063 1064

  /**
   * GtkSettings:gtk-im-module:
   *
1065 1066 1067
   * Which IM (input method) module should be used by default. This is the
   * input method that will be used if the user has not explicitly chosen
   * another input method from the IM context menu.
1068 1069
   * This also can be a colon-separated list of input methods, which GTK+
   * will try in turn until it finds one available on the system.
1070
   *
1071
   * See #GtkIMContext.
1072 1073
   */
  result = settings_install_property_parser (class,
1074 1075 1076 1077 1078 1079
                                             g_param_spec_string ("gtk-im-module",
                                                                  P_("Default IM module"),
                                                                  P_("Which IM module should be used by default"),
                                                                  NULL,
                                                                  GTK_PARAM_READWRITE),
                                             NULL);
1080
  g_assert (result == PROP_IM_MODULE);
1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092

  /**
   * GtkSettings:gtk-recent-files-max-age:
   *
   * The maximum age, in days, of the items inside the recently used
   * resources list. Items older than this setting will be excised
   * from the list. If set to 0, the list will always be empty; if
   * set to -1, no item will be removed.
   *
   * Since: 2.14
   */
  result = settings_install_property_parser (class,
1093 1094 1095 1096 1097 1098 1099
                                             g_param_spec_int ("gtk-recent-files-max-age",
                                                               P_("Recent Files Max Age"),
                                                               P_("Maximum age of recently used files, in days"),
                                                               -1, G_MAXINT,
                                                               30,
                                                               GTK_PARAM_READWRITE),
                                             NULL);
1100
  g_assert (result == PROP_RECENT_FILES_MAX_AGE);
1101 1102

  result = settings_install_property_parser (class,
1103 1104 1105 1106 1107 1108 1109
                                             g_param_spec_uint ("gtk-fontconfig-timestamp",
                                                                P_("Fontconfig configuration timestamp"),
                                                                P_("Timestamp of current fontconfig configuration"),
                                                                0, G_MAXUINT, 0,
                                                                GTK_PARAM_READWRITE),
                                             NULL);

1110
  g_assert (result == PROP_FONTCONFIG_TIMESTAMP);
1111

1112 1113 1114 1115 1116
  /**
   * GtkSettings:gtk-sound-theme-name:
   *
   * The XDG sound theme to use for event sounds.
   *
1117
   * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1118 1119
   * for more information on event sounds and sound themes.
   *
1120
   * GTK+ itself does not support event sounds, you have to use a loadable
1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138
   * module like the one that comes with libcanberra.
   *
   * Since: 2.14
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_string ("gtk-sound-theme-name",
                                                                  P_("Sound Theme Name"),
                                                                  P_("XDG sound theme name"),
                                                                  "freedesktop",
                                                                  GTK_PARAM_READWRITE),
                                             NULL);
  g_assert (result == PROP_SOUND_THEME_NAME);

  /**
   * GtkSettings:gtk-enable-input-feedback-sounds:
   *
   * Whether to play event sounds as feedback to user input.
   *
1139
   * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1140 1141
   * for more information on event sounds and sound themes.
   *
1142
   * GTK+ itself does not support event sounds, you have to use a loadable
1143 1144 1145 1146 1147 1148
   * module like the one that comes with libcanberra.
   *
   * Since: 2.14
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-input-feedback-sounds",
Matthias Clasen's avatar
Matthias Clasen committed
1149
                                                                   /* Translators: this means sounds that are played as feedback to user input */
1150 1151 1152 1153
                                                                   P_("Audible Input Feedback"),
                                                                   P_("Whether to play event sounds as feedback to user input"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
1154 1155 1156 1157 1158 1159 1160 1161
                                             NULL);
  g_assert (result == PROP_ENABLE_INPUT_FEEDBACK_SOUNDS);

  /**
   * GtkSettings:gtk-enable-event-sounds:
   *
   * Whether to play any event sounds at all.
   *
1162
   * See the [Sound Theme Specifications](http://www.freedesktop.org/wiki/Specifications/sound-theme-spec)
1163 1164
   * for more information on event sounds and sound themes.
   *
1165
   * GTK+ itself does not support event sounds, you have to use a loadable
1166 1167 1168 1169 1170 1171
   * module like the one that comes with libcanberra.
   *
   * Since: 2.14
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-event-sounds",
1172 1173 1174 1175
                                                                   P_("Enable Event Sounds"),
                                                                   P_("Whether to play any event sounds at all"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
1176 1177
                                             NULL);
  g_assert (result == PROP_ENABLE_EVENT_SOUNDS);
1178 1179 1180 1181 1182 1183 1184

  /**
   * GtkSettings:gtk-enable-tooltips:
   *
   * Whether tooltips should be shown on widgets.
   *
   * Since: 2.14
1185 1186
   *
   * Deprecated: 3.10: This setting is ignored.
1187 1188 1189 1190 1191 1192
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-enable-tooltips",
                                                                   P_("Enable Tooltips"),
                                                                   P_("Whether tooltips should be shown on widgets"),
                                                                   TRUE,
1193
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1194 1195
                                             NULL);
  g_assert (result == PROP_ENABLE_TOOLTIPS);
1196 1197

  /**
1198
   * GtkSettings:gtk-toolbar-style:
1199 1200
   *
   * The size of icons in default toolbars.
1201 1202
   *
   * Deprecated: 3.10: This setting is ignored.
1203 1204 1205 1206 1207 1208
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_enum ("gtk-toolbar-style",
                                                                   P_("Toolbar style"),
                                                                   P_("Whether default toolbars have text only, text and icons, icons only, etc."),
                                                                   GTK_TYPE_TOOLBAR_STYLE,
1209
                                                                   GTK_TOOLBAR_BOTH_HORIZ,
1210
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1211
                                             gtk_rc_property_parse_enum);
1212 1213 1214
  g_assert (result == PROP_TOOLBAR_STYLE);

  /**
1215
   * GtkSettings:gtk-toolbar-icon-size:
1216 1217
   *
   * The size of icons in default toolbars.
1218 1219
   *
   * Deprecated: 3.10: This setting is ignored.
1220 1221 1222 1223 1224 1225 1226
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_enum ("gtk-toolbar-icon-size",
                                                                   P_("Toolbar Icon Size"),
                                                                   P_("The size of icons in default toolbars."),
                                                                   GTK_TYPE_ICON_SIZE,
                                                                   GTK_ICON_SIZE_LARGE_TOOLBAR,
1227
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1228
                                             gtk_rc_property_parse_enum);
1229
  g_assert (result == PROP_TOOLBAR_ICON_SIZE);
1230 1231 1232 1233 1234 1235 1236 1237

  /**
   * GtkSettings:gtk-auto-mnemonics:
   *
   * Whether mnemonics should be automatically shown and hidden when the user
   * presses the mnemonic activator.
   *
   * Since: 2.20
1238 1239
   *
   * Deprecated: 3.10: This setting is ignored
1240 1241 1242 1243 1244
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-auto-mnemonics",
                                                                   P_("Auto Mnemonics"),
                                                                   P_("Whether mnemonics should be automatically shown and hidden when the user presses the mnemonic activator."),
1245
                                                                   TRUE,
1246
                                                                   GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1247 1248
                                             NULL);
  g_assert (result == PROP_AUTO_MNEMONICS);
1249

1250
  /**
Matthias Clasen's avatar
Matthias Clasen committed
1251
   * GtkSettings:gtk-primary-button-warps-slider:
1252 1253 1254 1255
   *
   * Whether a click in a #GtkRange trough should scroll to the click position or
   * scroll by a single page in the respective direction.
   *
Matthias Clasen's avatar
Matthias Clasen committed
1256
   * Since: 3.6
1257 1258 1259 1260 1261 1262 1263 1264 1265 1266
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-primary-button-warps-slider",
                                                                   P_("Primary button warps slider"),
                                                                   P_("Whether a primary click on the trough should warp the slider into position"),
                                                                   TRUE,
                                                                   GTK_PARAM_READWRITE),
                                             NULL);
  g_assert (result == PROP_PRIMARY_BUTTON_WARPS_SLIDER);

1267 1268 1269 1270 1271 1272 1273
  /**
   * GtkSettings:gtk-visible-focus:
   *
   * Whether 'focus rectangles' should be always visible, never visible,
   * or hidden until the user starts to use the keyboard.
   *
   * Since: 3.2
1274 1275
   *
   * Deprecated: 3.10: This setting is ignored
1276 1277 1278 1279 1280 1281
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_enum ("gtk-visible-focus",
                                                                P_("Visible Focus"),
                                                                P_("Whether 'focus rectangles' should be hidden until the user starts to use the keyboard."),
                                                                GTK_TYPE_POLICY_TYPE,
1282
                                                                GTK_POLICY_AUTOMATIC,
1283
                                                                GTK_PARAM_READWRITE | G_PARAM_DEPRECATED),
1284
                                             gtk_rc_property_parse_enum);
1285 1286
  g_assert (result == PROP_VISIBLE_FOCUS);

1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301
  /**
   * GtkSettings:gtk-application-prefer-dark-theme:
   *
   * Whether the application prefers to use a dark theme. If a GTK+ theme
   * includes a dark variant, it will be used instead of the configured
   * theme.
   *
   * Some applications benefit from minimizing the amount of light pollution that
   * interferes with the content. Good candidates for dark themes are photo and
   * video editors that make the actual content get all the attention and minimize
   * the distraction of the chrome.
   *
   * Dark themes should not be used for documents, where large spaces are white/light
   * and the dark chrome creates too much contrast (web browser, text editor...).
   *
1302
   * Since: 3.0
1303 1304 1305 1306 1307 1308 1309 1310 1311
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-application-prefer-dark-theme",
                                                                 P_("Application prefers a dark theme"),
                                                                 P_("Whether the application prefers to have a dark theme."),
                                                                 FALSE,
                                                                 GTK_PARAM_READWRITE),
                                             NULL);
  g_assert (result == PROP_APPLICATION_PREFER_DARK_THEME);
1312 1313

  /**
1314
   * GtkSettings:gtk-button-images:
1315 1316 1317 1318
   *
   * Whether images should be shown on buttons
   *
   * Since: 2.4
1319
   *
1320
   * Deprecated: 3.10: This setting is deprecated. Application developers
1321
   *   control whether a button should show an icon or not, on a
1322 1323 1324
   *   per-button basis. If a #GtkButton should show an icon, use the
   *   #GtkButton:always-show-image property of #GtkButton, and pack a
   *   #GtkImage inside the #GtkButton
1325 1326 1327 1328 1329
   */
  result = settings_install_property_parser (class,
                                             g_param_spec_boolean ("gtk-button-images",
                                                                   P_("Show button images"),
                                                                   P_("Whether images should be shown on buttons"),
1330
                                                                   FALSE,