2001-03-18 04:50:34 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* 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
|
|
|
|
* License along with this library; if not, write to the Free
|
|
|
|
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
2004-03-06 03:38:59 +00:00
|
|
|
#include <config.h>
|
2005-08-24 16:17:56 +00:00
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
2004-09-13 16:00:00 +00:00
|
|
|
#include "gtkmodules.h"
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
#include "gtksettings.h"
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
#include "gtkrc.h"
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
#include "gtkintl.h"
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
#include "gtkwidget.h"
|
2005-03-22 02:14:55 +00:00
|
|
|
#include "gtkprivate.h"
|
2005-03-20 07:01:23 +00:00
|
|
|
#include "gtkalias.h"
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2005-06-15 19:25:49 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
#include "x11/gdkx.h"
|
|
|
|
#endif
|
|
|
|
|
2005-11-22 12:40:15 +00:00
|
|
|
#define DEFAULT_TIMEOUT_INITIAL 200
|
|
|
|
#define DEFAULT_TIMEOUT_REPEAT 20
|
2006-03-22 20:17:23 +00:00
|
|
|
#define DEFAULT_TIMEOUT_EXPAND 500
|
2005-11-22 12:40:15 +00:00
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
typedef struct _GtkSettingsValuePrivate GtkSettingsValuePrivate;
|
|
|
|
|
2002-11-16 01:30:12 +00:00
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
GTK_SETTINGS_SOURCE_DEFAULT,
|
|
|
|
GTK_SETTINGS_SOURCE_RC_FILE,
|
2005-12-16 18:45:31 +00:00
|
|
|
GTK_SETTINGS_SOURCE_XSETTING,
|
2002-11-16 01:30:12 +00:00
|
|
|
GTK_SETTINGS_SOURCE_APPLICATION
|
|
|
|
} GtkSettingsSource;
|
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
struct _GtkSettingsValuePrivate
|
|
|
|
{
|
|
|
|
GtkSettingsValue public;
|
2002-11-16 01:30:12 +00:00
|
|
|
GtkSettingsSource source;
|
2002-10-02 14:22:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct _GtkSettingsPropertyValue
|
|
|
|
{
|
|
|
|
GValue value;
|
2002-11-16 01:30:12 +00:00
|
|
|
GtkSettingsSource source;
|
2002-10-02 14:22:31 +00:00
|
|
|
};
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
enum {
|
|
|
|
PROP_0,
|
2001-05-30 20:40:28 +00:00
|
|
|
PROP_DOUBLE_CLICK_TIME,
|
2003-12-16 00:56:48 +00:00
|
|
|
PROP_DOUBLE_CLICK_DISTANCE,
|
2001-05-30 20:40:28 +00:00
|
|
|
PROP_CURSOR_BLINK,
|
|
|
|
PROP_CURSOR_BLINK_TIME,
|
2006-09-01 02:14:30 +00:00
|
|
|
PROP_CURSOR_BLINK_TIMEOUT,
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
PROP_SPLIT_CURSOR,
|
|
|
|
PROP_THEME_NAME,
|
2003-07-02 22:44:09 +00:00
|
|
|
PROP_ICON_THEME_NAME,
|
2006-01-11 06:20:17 +00:00
|
|
|
PROP_FALLBACK_ICON_THEME,
|
2001-10-04 06:48:09 +00:00
|
|
|
PROP_KEY_THEME_NAME,
|
2001-12-09 22:08:30 +00:00
|
|
|
PROP_MENU_BAR_ACCEL,
|
2002-02-24 02:24:51 +00:00
|
|
|
PROP_DND_DRAG_THRESHOLD,
|
2002-09-24 21:03:58 +00:00
|
|
|
PROP_FONT_NAME,
|
2004-02-21 19:17:48 +00:00
|
|
|
PROP_ICON_SIZES,
|
2004-09-01 20:30:24 +00:00
|
|
|
PROP_MODULES,
|
2004-10-27 18:53:29 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
2004-02-21 19:17:48 +00:00
|
|
|
PROP_XFT_ANTIALIAS,
|
|
|
|
PROP_XFT_HINTING,
|
|
|
|
PROP_XFT_HINTSTYLE,
|
|
|
|
PROP_XFT_RGBA,
|
2004-10-25 05:43:29 +00:00
|
|
|
PROP_XFT_DPI,
|
2005-06-15 19:25:49 +00:00
|
|
|
PROP_CURSOR_THEME_NAME,
|
|
|
|
PROP_CURSOR_THEME_SIZE,
|
2004-10-27 18:53:29 +00:00
|
|
|
#endif
|
2005-10-24 20:01:57 +00:00
|
|
|
PROP_ALTERNATIVE_BUTTON_ORDER,
|
2006-12-27 19:52:25 +00:00
|
|
|
PROP_ALTERNATIVE_SORT_ARROWS,
|
2005-10-24 20:01:57 +00:00
|
|
|
PROP_SHOW_INPUT_METHOD_MENU,
|
2005-11-22 12:40:15 +00:00
|
|
|
PROP_SHOW_UNICODE_MENU,
|
|
|
|
PROP_TIMEOUT_INITIAL,
|
2005-11-23 10:33:58 +00:00
|
|
|
PROP_TIMEOUT_REPEAT,
|
2006-03-22 20:17:23 +00:00
|
|
|
PROP_TIMEOUT_EXPAND,
|
2005-12-01 20:49:17 +00:00
|
|
|
PROP_COLOR_SCHEME,
|
2005-12-16 18:45:31 +00:00
|
|
|
PROP_ENABLE_ANIMATIONS,
|
2006-02-22 10:10:23 +00:00
|
|
|
PROP_TOUCHSCREEN_MODE,
|
2007-02-06 10:25:21 +00:00
|
|
|
PROP_TOOLTIP_TIMEOUT,
|
|
|
|
PROP_TOOLTIP_BROWSE_TIMEOUT,
|
|
|
|
PROP_TOOLTIP_BROWSE_MODE_TIMEOUT,
|
2006-11-16 12:56:30 +00:00
|
|
|
PROP_KEYNAV_CURSOR_ONLY,
|
|
|
|
PROP_KEYNAV_WRAP_AROUND,
|
|
|
|
PROP_ERROR_BELL,
|
2006-12-31 05:54:46 +00:00
|
|
|
PROP_COLOR_HASH,
|
|
|
|
PROP_FILE_CHOOSER_BACKEND,
|
|
|
|
PROP_PRINT_BACKENDS,
|
2007-02-05 14:11:39 +00:00
|
|
|
PROP_PRINT_PREVIEW_COMMAND,
|
|
|
|
PROP_ENABLE_MNEMONICS,
|
|
|
|
PROP_ENABLE_ACCELS
|
2001-03-18 04:50:34 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* --- prototypes --- */
|
|
|
|
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);
|
2003-12-16 00:56:48 +00:00
|
|
|
static void settings_update_double_click (GtkSettings *settings);
|
2004-09-01 20:30:24 +00:00
|
|
|
static void settings_update_modules (GtkSettings *settings);
|
|
|
|
|
2005-06-15 19:25:49 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
static void settings_update_cursor_theme (GtkSettings *settings);
|
2005-08-24 16:17:56 +00:00
|
|
|
static void settings_update_resolution (GtkSettings *settings);
|
|
|
|
static void settings_update_font_options (GtkSettings *settings);
|
2005-06-15 19:25:49 +00:00
|
|
|
#endif
|
2005-12-16 18:45:31 +00:00
|
|
|
static void settings_update_color_scheme (GtkSettings *settings);
|
2005-06-15 19:25:49 +00:00
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
static void merge_color_scheme (GtkSettings *settings,
|
2007-03-01 06:44:00 +00:00
|
|
|
const GValue *value,
|
2005-12-16 18:45:31 +00:00
|
|
|
GtkSettingsSource source);
|
|
|
|
static gchar *get_color_scheme (GtkSettings *settings);
|
|
|
|
static GHashTable *get_color_hash (GtkSettings *settings);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* --- variables --- */
|
|
|
|
static GQuark quark_property_parser = 0;
|
|
|
|
static GSList *object_list = NULL;
|
|
|
|
static guint class_n_properties = 0;
|
|
|
|
|
|
|
|
|
2006-05-14 04:25:34 +00:00
|
|
|
G_DEFINE_TYPE (GtkSettings, gtk_settings, G_TYPE_OBJECT)
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
/* --- functions --- */
|
2001-03-18 04:50:34 +00:00
|
|
|
static void
|
|
|
|
gtk_settings_init (GtkSettings *settings)
|
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GParamSpec **pspecs, **p;
|
|
|
|
guint i = 0;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
g_datalist_init (&settings->queued_settings);
|
|
|
|
object_list = g_slist_prepend (object_list, settings);
|
|
|
|
|
|
|
|
/* build up property array for all yet existing properties and queue
|
|
|
|
* notification for them (at least notification for internal properties
|
|
|
|
* will instantly be caught)
|
|
|
|
*/
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
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++;
|
2002-10-02 14:22:31 +00:00
|
|
|
settings->property_values = g_new0 (GtkSettingsPropertyValue, i);
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
i = 0;
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (settings));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
for (p = pspecs; *p; p++)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
GParamSpec *pspec = *p;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
if (pspec->owner_type != G_OBJECT_TYPE (settings))
|
|
|
|
continue;
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_init (&settings->property_values[i].value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
|
|
|
g_param_value_set_default (pspec, &settings->property_values[i].value);
|
2001-03-18 04:50:34 +00:00
|
|
|
g_object_notify (G_OBJECT (settings), pspec->name);
|
2002-11-16 01:30:12 +00:00
|
|
|
settings->property_values[i].source = GTK_SETTINGS_SOURCE_DEFAULT;
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
i++;
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
coalescing property notifies
2001-08-11 Hans Breuer <hans@breuer.org>
* gtk/gtkalignment.c, gtk/gtkarrow.c, gtk/gtkaspectframe.c,
gtk/gtkcellrenderer.c, gtk/gtkcellrenderertext.c,
gtk/gtkcombo.c, gtk/gtkcurve.c, gtk/gtkfontsel.c,
gtk/gtklayout.c, gtk/gtkmisc.c, gtk/gtkpacker.c,
gtk/gtkprogress.c, gtk/gtkruler.c,, gtk/gtksettings.c,
gtk/gtkspinbutton.c, gtk/gtktexttag.c : coalescing property notifies
* gtk/gtkclist.c, gtk/gtktipsquery.c, gtk/gtktexttag.c,
gtk/gtkwidget.c : added G_SIGNAL_TYPE_STATIC_SCOPE to all
GDK_TYPE_EVENT signals
* gtk/gtkalignment.c : removed 'direct allocation bug',
which Tim discovered while reading the patch
2001-08-11 20:27:36 +00:00
|
|
|
g_object_thaw_notify (G_OBJECT (settings));
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
g_free (pspecs);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_settings_class_init (GtkSettingsClass *class)
|
|
|
|
{
|
|
|
|
GObjectClass *gobject_class = G_OBJECT_CLASS (class);
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
guint result;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
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");
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
result = settings_install_property_parser (class,
|
2001-05-30 20:40:28 +00:00
|
|
|
g_param_spec_int ("gtk-double-click-time",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Double Click Time"),
|
|
|
|
P_("Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)"),
|
2001-05-03 11:15:26 +00:00
|
|
|
0, G_MAXINT, 250,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
fix warning
2001-04-27 Havoc Pennington <hp@redhat.com>
* gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning
* gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable
* gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip
line/para separators
(gtk_entry_create_layout): set single paragraph mode on the layout
* gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much
spacing between the image and label; instead, inside a button box
the button will get extra space that will go there, but if people
configure button box for 0 chubbiness, then there's no spacing.
* gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding
and min/max size style properties, so people can tune their
chubbiness.
* tests/testgtk.c (make_toolbar): remove calls to removed toolbar
functions
* gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size,
space_style, and button_relief into style properties, remove
functions for setting them
* gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop
it back down
* gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed
types from gtk_widget_style_get
* gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace
with a style property.
* gdk/x11/gdkevents-x11.c: namespace the settings
* gtk/gtkmenubar.c: Add F10 accelerator to move between menubars.
* gtk/gtksettings.c (gtk_settings_class_init): remove code with
side effects from inside g_assert(), so that G_DISABLE_ASSERT can
be used. Also, translate doc strings for settings. Also, namespace
the double-click-time property. Also, remove bell properties crap.
2001-04-28 00:12:47 +00:00
|
|
|
NULL);
|
2001-05-30 20:40:28 +00:00
|
|
|
g_assert (result == PROP_DOUBLE_CLICK_TIME);
|
2003-12-16 00:56:48 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-double-click-distance",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Double Click Distance"),
|
|
|
|
P_("Maximum distance allowed between two clicks for them to be considered a double click (in pixels)"),
|
2003-12-16 00:56:48 +00:00
|
|
|
0, G_MAXINT, 5,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2003-12-16 00:56:48 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_DOUBLE_CLICK_DISTANCE);
|
2006-09-01 02:14:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkSettings:gtk-cursor-blink:
|
|
|
|
*
|
|
|
|
* Whether the cursor should blink.
|
|
|
|
*
|
|
|
|
* Also see the gtk-cursor-blink-timeout setting, which allows
|
|
|
|
* more flexible control over cursor blinking.
|
|
|
|
*/
|
2001-05-30 20:40:28 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boolean ("gtk-cursor-blink",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Cursor Blink"),
|
|
|
|
P_("Whether the cursor should blink"),
|
2001-05-30 20:40:28 +00:00
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2001-05-30 20:40:28 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_CURSOR_BLINK);
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-cursor-blink-time",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Cursor Blink Time"),
|
2006-09-01 02:14:30 +00:00
|
|
|
P_("Length of the cursor blink cycle, in milliseconds"),
|
2001-05-30 20:40:28 +00:00
|
|
|
100, G_MAXINT, 1200,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2001-05-30 20:40:28 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_CURSOR_BLINK_TIME);
|
2006-09-01 02:14:30 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
* gtk-cursor-blinks to %FALSE.
|
|
|
|
*
|
|
|
|
* 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"),
|
|
|
|
1, G_MAXINT, G_MAXINT,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_CURSOR_BLINK_TIMEOUT);
|
2001-06-08 16:07:00 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boolean ("gtk-split-cursor",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Split Cursor"),
|
|
|
|
P_("Whether two cursors should be displayed for mixed left-to-right and right-to-left text"),
|
2001-06-08 16:07:00 +00:00
|
|
|
TRUE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2001-06-08 16:07:00 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_SPLIT_CURSOR);
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-theme-name",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Theme Name"),
|
|
|
|
P_("Name of theme RC file to load"),
|
2005-08-01 19:21:00 +00:00
|
|
|
"Raleigh",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_THEME_NAME);
|
2006-01-11 06:20:17 +00:00
|
|
|
|
2003-07-02 22:44:09 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-icon-theme-name",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Icon Theme Name"),
|
|
|
|
P_("Name of icon theme to use"),
|
2003-07-02 22:44:09 +00:00
|
|
|
"hicolor",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2003-07-02 22:44:09 +00:00
|
|
|
NULL);
|
2004-03-01 19:40:47 +00:00
|
|
|
g_assert (result == PROP_ICON_THEME_NAME);
|
2006-01-11 06:20:17 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-fallback-icon-theme",
|
|
|
|
P_("Fallback Icon Theme Name"),
|
|
|
|
P_("Name of a icon theme to fall back to"),
|
|
|
|
NULL,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_FALLBACK_ICON_THEME);
|
2004-03-01 19:40:47 +00:00
|
|
|
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-key-theme-name",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Key Theme Name"),
|
|
|
|
P_("Name of key theme RC file to load"),
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
NULL);
|
2001-10-04 06:48:09 +00:00
|
|
|
g_assert (result == PROP_KEY_THEME_NAME);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-menu-bar-accel",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Menu bar accelerator"),
|
|
|
|
P_("Keybinding to activate the menu bar"),
|
2001-10-04 06:48:09 +00:00
|
|
|
"F10",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2001-10-04 06:48:09 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_MENU_BAR_ACCEL);
|
2001-12-09 22:08:30 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-dnd-drag-threshold",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Drag threshold"),
|
|
|
|
P_("Number of pixels the cursor can move before dragging"),
|
2001-12-09 22:08:30 +00:00
|
|
|
1, G_MAXINT, 8,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2001-12-09 22:08:30 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_DND_DRAG_THRESHOLD);
|
2002-02-24 02:24:51 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-font-name",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Font Name"),
|
|
|
|
P_("Name of default font to use"),
|
2002-02-24 02:24:51 +00:00
|
|
|
"Sans 10",
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2002-02-24 02:24:51 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_FONT_NAME);
|
2002-09-24 21:03:58 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-icon-sizes",
|
2004-01-16 23:10:05 +00:00
|
|
|
P_("Icon Sizes"),
|
2005-07-03 04:52:46 +00:00
|
|
|
P_("List of icon sizes (gtk-menu=16,16:gtk-button=20,20..."),
|
2002-09-24 21:03:58 +00:00
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2002-09-24 21:03:58 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_ICON_SIZES);
|
2004-02-21 19:17:48 +00:00
|
|
|
|
2004-09-01 20:30:24 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-modules",
|
|
|
|
P_("GTK Modules"),
|
|
|
|
P_("List of currently active GTK modules"),
|
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-09-01 20:30:24 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_MODULES);
|
|
|
|
|
2004-02-21 19:17:48 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-xft-antialias",
|
2004-02-21 19:28:20 +00:00
|
|
|
P_("Xft Antialias"),
|
|
|
|
P_("Whether to antialias Xft fonts; 0=no, 1=yes, -1=default"),
|
2004-02-21 19:17:48 +00:00
|
|
|
-1, 1, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_XFT_ANTIALIAS);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-xft-hinting",
|
2004-02-21 19:28:20 +00:00
|
|
|
P_("Xft Hinting"),
|
|
|
|
P_("Whether to hint Xft fonts; 0=no, 1=yes, -1=default"),
|
2004-02-21 19:17:48 +00:00
|
|
|
-1, 1, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_XFT_HINTING);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-xft-hintstyle",
|
2004-02-21 19:28:20 +00:00
|
|
|
P_("Xft Hint Style"),
|
2005-07-21 13:59:22 +00:00
|
|
|
P_("What degree of hinting to use; hintnone, hintslight, hintmedium, or hintfull"),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_XFT_HINTSTYLE);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-xft-rgba",
|
2004-02-21 19:28:20 +00:00
|
|
|
P_("Xft RGBA"),
|
|
|
|
P_("Type of subpixel antialiasing; none, rgb, bgr, vrgb, vbgr"),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_XFT_RGBA);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-xft-dpi",
|
2004-02-21 19:28:20 +00:00
|
|
|
P_("Xft DPI"),
|
|
|
|
P_("Resolution for Xft, in 1024 * dots/inch. -1 to use default value"),
|
2004-02-21 19:17:48 +00:00
|
|
|
-1, 1024*1024, -1,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-02-21 19:17:48 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_XFT_DPI);
|
2005-06-15 19:25:49 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-cursor-theme-name",
|
|
|
|
P_("Cursor theme name"),
|
2006-01-25 15:41:40 +00:00
|
|
|
P_("Name of the cursor theme to use, or NULL to use the default theme"),
|
2005-06-15 19:25:49 +00:00
|
|
|
NULL,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_CURSOR_THEME_NAME);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-cursor-theme-size",
|
|
|
|
P_("Cursor theme size"),
|
2006-01-25 15:41:40 +00:00
|
|
|
P_("Size to use for cursors, or 0 to use the default size"),
|
|
|
|
0, 128, 0,
|
2005-06-15 19:25:49 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_CURSOR_THEME_SIZE);
|
|
|
|
|
2004-02-21 19:17:48 +00:00
|
|
|
#endif /* GDK_WINDOWING_X11 */
|
2004-10-25 05:43:29 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boolean ("gtk-alternative-button-order",
|
|
|
|
P_("Alternative button order"),
|
|
|
|
P_("Whether buttons in dialogs should use the alternative button order"),
|
|
|
|
FALSE,
|
2005-03-22 02:14:55 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2004-10-25 05:43:29 +00:00
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_ALTERNATIVE_BUTTON_ORDER);
|
2005-10-24 20:01:57 +00:00
|
|
|
|
2006-12-27 19:52:25 +00:00
|
|
|
/**
|
|
|
|
* GtkSettings:gtk-alternative-sort-arrows:
|
|
|
|
*
|
|
|
|
* Controls the direction of the sort indicators in sorted list and tree
|
|
|
|
* views. By default an arrow pointing down means the column is sorted
|
|
|
|
* in ascending order. When set to %TRUE, this order will be inverted.
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boolean ("gtk-alternative-sort-arrows",
|
|
|
|
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),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_ALTERNATIVE_SORT_ARROWS);
|
|
|
|
|
2005-10-24 20:01:57 +00:00
|
|
|
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"),
|
|
|
|
TRUE,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_SHOW_INPUT_METHOD_MENU);
|
|
|
|
|
|
|
|
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"),
|
|
|
|
TRUE,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_SHOW_UNICODE_MENU);
|
|
|
|
|
2005-11-22 12:40:15 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
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,
|
2005-11-23 10:33:58 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2005-11-22 12:40:15 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_TIMEOUT_INITIAL);
|
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
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,
|
2005-11-23 10:33:58 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
2005-11-22 12:40:15 +00:00
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_TIMEOUT_REPEAT);
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2006-03-22 20:17:23 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
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,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_TIMEOUT_EXPAND);
|
|
|
|
|
2005-11-23 17:11:36 +00:00
|
|
|
/**
|
|
|
|
* GtkSettings:gtk-color-scheme:
|
|
|
|
*
|
|
|
|
* A palette of named colors for use in themes. The format of the string is
|
|
|
|
* <programlisting>
|
|
|
|
* name1: color1
|
|
|
|
* name2: color2
|
|
|
|
* ...
|
|
|
|
* </programlisting>
|
|
|
|
* Color names must be acceptable as identifiers in the
|
|
|
|
* <link linkend="gtk-Resource-Files">gtkrc</link> syntax, and
|
|
|
|
* color specifications must be in the format accepted by
|
|
|
|
* gdk_color_parse().
|
|
|
|
*
|
2005-12-16 18:45:31 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2006-12-11 06:16:21 +00:00
|
|
|
* Starting with GTK+ 2.12, the entries can alternatively be separated
|
|
|
|
* by ';' instead of newlines:
|
|
|
|
* <programlisting>
|
|
|
|
* name1: color1; name2: color2; ...
|
|
|
|
* </programlisting>
|
|
|
|
*
|
2005-11-23 17:11:36 +00:00
|
|
|
* Since: 2.10
|
|
|
|
*/
|
2005-11-23 10:33:58 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-color-scheme",
|
|
|
|
P_("Color scheme"),
|
|
|
|
P_("A palette of named colors for use in themes"),
|
2006-04-30 06:10:37 +00:00
|
|
|
"",
|
2005-11-23 10:33:58 +00:00
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_COLOR_SCHEME);
|
2005-12-01 20:49:17 +00:00
|
|
|
|
|
|
|
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);
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2006-02-22 10:10:23 +00:00
|
|
|
/**
|
|
|
|
* GtkSettings:gtk-touchscreen-mode:
|
|
|
|
*
|
2006-11-16 12:56:30 +00:00
|
|
|
* When %TRUE, there are no motion notify events delivered on this screen,
|
2006-02-22 10:10:23 +00:00
|
|
|
* and widgets can't use the pointer hovering them for any essential
|
|
|
|
* functionality.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
*/
|
|
|
|
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,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_TOUCHSCREEN_MODE);
|
2005-12-21 21:05:22 +00:00
|
|
|
|
2007-02-06 10:25:21 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_int ("gtk-tooltip-timeout",
|
|
|
|
P_("Tooltip timeout"),
|
|
|
|
P_("Timeout before tooltip is shown"),
|
|
|
|
0, G_MAXINT,
|
|
|
|
1500,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
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
|
|
|
|
* where a tooltip was currently being displayed. If the mouse pointer
|
|
|
|
* hits another object before the browse mode timeout expires (see
|
|
|
|
* gtk-tooltip-browse-mode-timeout), it will take the amount of
|
|
|
|
* milliseconds specified by this setting to popup the tooltip
|
|
|
|
* for the new object.
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
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,
|
|
|
|
100,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
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.
|
|
|
|
*
|
|
|
|
* See GtkSettings:gtk-tooltip-browse-timeout for more information
|
|
|
|
* about browse mode.
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
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,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
g_assert (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT);
|
|
|
|
|
2006-11-16 12:56:30 +00:00
|
|
|
/**
|
|
|
|
* 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
|
|
|
|
*/
|
|
|
|
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,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
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
|
|
|
|
*/
|
|
|
|
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,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
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);
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
/**
|
|
|
|
* GtkSettings:color-hash:
|
|
|
|
*
|
|
|
|
* Holds a hash table representation of the gtk-color-scheme setting,
|
|
|
|
* mapping color names to #GdkColor<!-- -->s.
|
|
|
|
*
|
|
|
|
* Since: 2.10
|
|
|
|
*/
|
2007-01-30 11:10:22 +00:00
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boxed ("color-hash",
|
|
|
|
P_("Color Hash"),
|
|
|
|
P_("A hash table representation of the color scheme."),
|
|
|
|
G_TYPE_HASH_TABLE,
|
|
|
|
GTK_PARAM_READABLE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_COLOR_HASH);
|
2006-12-31 05:54:46 +00:00
|
|
|
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_string ("gtk-file-chooser-backend",
|
|
|
|
P_("Default file chooser backend"),
|
|
|
|
P_("Name of the GtkFileChooser backend to use by default"),
|
|
|
|
NULL,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
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,
|
|
|
|
* and may include "pdf", "cups" or "lpr".
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* should contain a %f placeholder, which will get replaced by
|
|
|
|
* the path to the pdf file.
|
|
|
|
*
|
|
|
|
* The preview application is responsible for removing the pdf file
|
|
|
|
* when it is done.
|
|
|
|
*
|
|
|
|
* 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"),
|
|
|
|
GTK_PRINT_PREVIEW_COMMAND,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
NULL);
|
|
|
|
g_assert (result == PROP_PRINT_PREVIEW_COMMAND);
|
2007-02-05 14:11:39 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* GtkSettings:gtk-enable-mnemonics:
|
|
|
|
*
|
|
|
|
* Whether labels and menu items should have visible mnemonics which
|
|
|
|
* can be activated.
|
|
|
|
*
|
|
|
|
* Since: 2.12
|
|
|
|
*/
|
|
|
|
result = settings_install_property_parser (class,
|
|
|
|
g_param_spec_boolean ("gtk-enable-mnemonics",
|
|
|
|
P_("Enable Mnemonics"),
|
|
|
|
P_("Whether labels should have mnemonics"),
|
|
|
|
TRUE,
|
|
|
|
GTK_PARAM_READWRITE),
|
|
|
|
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);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_settings_finalize (GObject *object)
|
|
|
|
{
|
|
|
|
GtkSettings *settings = GTK_SETTINGS (object);
|
|
|
|
guint i;
|
|
|
|
|
|
|
|
object_list = g_slist_remove (object_list, settings);
|
|
|
|
|
2006-07-27 14:13:18 +00:00
|
|
|
_gtk_rc_context_destroy (settings);
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
for (i = 0; i < class_n_properties; i++)
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_unset (&settings->property_values[i].value);
|
2001-03-18 04:50:34 +00:00
|
|
|
g_free (settings->property_values);
|
2006-07-21 16:12:44 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
g_datalist_clear (&settings->queued_settings);
|
|
|
|
|
2006-05-02 23:56:43 +00:00
|
|
|
G_OBJECT_CLASS (gtk_settings_parent_class)->finalize (object);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
/**
|
|
|
|
* gtk_settings_get_for_screen:
|
|
|
|
* @screen : a #GdkScreen.
|
|
|
|
*
|
|
|
|
* Gets the #GtkSettings object for @screen, creating it if necessary.
|
|
|
|
*
|
|
|
|
* Return value: a #GtkSettings object.
|
2002-11-28 00:33:17 +00:00
|
|
|
*
|
|
|
|
* Since: 2.2
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
*/
|
|
|
|
GtkSettings*
|
|
|
|
gtk_settings_get_for_screen (GdkScreen *screen)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
GtkSettings *settings;
|
|
|
|
|
|
|
|
g_return_val_if_fail (GDK_IS_SCREEN (screen), NULL);
|
|
|
|
|
|
|
|
settings = g_object_get_data (G_OBJECT (screen), "gtk-settings");
|
|
|
|
if (!settings)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
settings = g_object_new (GTK_TYPE_SETTINGS, NULL);
|
|
|
|
settings->screen = screen;
|
2006-07-21 16:12:44 +00:00
|
|
|
g_object_set_data_full (G_OBJECT (screen), I_("gtk-settings"),
|
|
|
|
settings, g_object_unref);
|
2004-02-21 19:17:48 +00:00
|
|
|
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
gtk_rc_reparse_all_for_settings (settings, TRUE);
|
2003-12-16 00:56:48 +00:00
|
|
|
settings_update_double_click (settings);
|
2005-08-24 16:17:56 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
2005-08-24 15:47:28 +00:00
|
|
|
settings_update_cursor_theme (settings);
|
|
|
|
settings_update_resolution (settings);
|
2005-08-24 16:17:56 +00:00
|
|
|
settings_update_font_options (settings);
|
|
|
|
#endif
|
2005-12-16 18:45:31 +00:00
|
|
|
settings_update_color_scheme (settings);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
|
|
|
return settings;
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
/**
|
|
|
|
* gtk_settings_get_default:
|
|
|
|
*
|
|
|
|
* Gets the #GtkSettings object for the default GDK screen, creating
|
|
|
|
* it if necessary. See gtk_settings_get_for_screen().
|
|
|
|
*
|
2002-08-01 23:43:13 +00:00
|
|
|
* Return value: a #GtkSettings object. If there is no default
|
|
|
|
* screen, then returns %NULL.
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
**/
|
2001-03-18 04:50:34 +00:00
|
|
|
GtkSettings*
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
gtk_settings_get_default (void)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
2002-08-01 23:43:13 +00:00
|
|
|
GdkScreen *screen = gdk_screen_get_default ();
|
|
|
|
|
|
|
|
if (screen)
|
|
|
|
return gtk_settings_get_for_screen (screen);
|
|
|
|
else
|
|
|
|
return NULL;
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_settings_set_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
const GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkSettings *settings = GTK_SETTINGS (object);
|
2002-11-16 01:30:12 +00:00
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_copy (value, &settings->property_values[property_id - 1].value);
|
2002-11-16 01:30:12 +00:00
|
|
|
settings->property_values[property_id - 1].source = GTK_SETTINGS_SOURCE_APPLICATION;
|
2007-03-01 06:44:00 +00:00
|
|
|
|
|
|
|
if (pspec->param_id == PROP_COLOR_SCHEME)
|
|
|
|
merge_color_scheme (settings, value, GTK_SETTINGS_SOURCE_APPLICATION);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_settings_get_property (GObject *object,
|
|
|
|
guint property_id,
|
|
|
|
GValue *value,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
|
|
|
GtkSettings *settings = GTK_SETTINGS (object);
|
2001-12-12 20:26:50 +00:00
|
|
|
GType value_type = G_VALUE_TYPE (value);
|
|
|
|
GType fundamental_type = G_TYPE_FUNDAMENTAL (value_type);
|
2001-04-02 23:33:47 +00:00
|
|
|
|
2007-01-30 11:10:22 +00:00
|
|
|
/* handle internal properties */
|
|
|
|
switch (property_id)
|
2005-12-16 18:45:31 +00:00
|
|
|
{
|
2007-01-30 11:10:22 +00:00
|
|
|
case PROP_COLOR_HASH:
|
2005-12-16 18:45:31 +00:00
|
|
|
g_value_set_boxed (value, get_color_hash (settings));
|
|
|
|
return;
|
2007-03-01 06:44:00 +00:00
|
|
|
case PROP_COLOR_SCHEME:
|
|
|
|
g_value_take_string (value, get_color_scheme (settings));
|
|
|
|
return;
|
|
|
|
default: ;
|
2005-12-16 18:45:31 +00:00
|
|
|
}
|
|
|
|
|
2001-12-12 20:26:50 +00:00
|
|
|
/* For enums and strings, we need to get the value as a string,
|
|
|
|
* not as an int, since we support using names/nicks as the setting
|
|
|
|
* value.
|
|
|
|
*/
|
|
|
|
if ((g_value_type_transformable (G_TYPE_INT, value_type) &&
|
|
|
|
!(fundamental_type == G_TYPE_ENUM || fundamental_type == G_TYPE_FLAGS)) ||
|
2001-06-04 23:15:51 +00:00
|
|
|
g_value_type_transformable (G_TYPE_STRING, G_VALUE_TYPE (value)) ||
|
|
|
|
g_value_type_transformable (GDK_TYPE_COLOR, G_VALUE_TYPE (value)))
|
|
|
|
{
|
2002-11-25 22:29:32 +00:00
|
|
|
if (settings->property_values[property_id - 1].source == GTK_SETTINGS_SOURCE_APPLICATION ||
|
|
|
|
!gdk_screen_get_setting (settings->screen, pspec->name, value))
|
2002-11-16 01:30:12 +00:00
|
|
|
g_value_copy (&settings->property_values[property_id - 1].value, value);
|
2005-12-16 18:45:31 +00:00
|
|
|
else
|
2007-03-01 06:44:00 +00:00
|
|
|
g_param_value_validate (pspec, value);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
2001-05-30 20:40:28 +00:00
|
|
|
else
|
2001-06-04 23:15:51 +00:00
|
|
|
{
|
|
|
|
GValue val = { 0, };
|
|
|
|
|
|
|
|
/* Try to get xsetting as a string and parse it. */
|
|
|
|
|
|
|
|
g_value_init (&val, G_TYPE_STRING);
|
|
|
|
|
2002-11-18 23:18:13 +00:00
|
|
|
if (settings->property_values[property_id - 1].source == GTK_SETTINGS_SOURCE_APPLICATION ||
|
|
|
|
!gdk_screen_get_setting (settings->screen, pspec->name, &val))
|
2001-06-04 23:15:51 +00:00
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_copy (&settings->property_values[property_id - 1].value, value);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
GValue tmp_value = { 0, };
|
|
|
|
GValue gstring_value = { 0, };
|
2002-03-20 21:47:01 +00:00
|
|
|
GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser);
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
g_value_init (&gstring_value, G_TYPE_GSTRING);
|
2005-03-03 14:15:14 +00:00
|
|
|
g_value_take_boxed (&gstring_value,
|
|
|
|
g_string_new (g_value_get_string (&val)));
|
2001-06-04 23:15:51 +00:00
|
|
|
|
|
|
|
g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
|
|
|
|
|
|
|
if (parser && _gtk_settings_parse_convert (parser, &gstring_value,
|
|
|
|
pspec, &tmp_value))
|
|
|
|
{
|
|
|
|
g_value_copy (&tmp_value, value);
|
|
|
|
g_param_value_validate (pspec, value);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_copy (&settings->property_values[property_id - 1].value, value);
|
2001-06-04 23:15:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&gstring_value);
|
|
|
|
g_value_unset (&tmp_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
g_value_unset (&val);
|
|
|
|
}
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_settings_notify (GObject *object,
|
|
|
|
GParamSpec *pspec)
|
|
|
|
{
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
GtkSettings *settings = GTK_SETTINGS (object);
|
fix PROP_EVENTS.
Mon Jun 18 02:00:49 2001 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_get_property): fix PROP_EVENTS.
* gtk/Makefile.am:
* gtk/gtk.h: disabled GtkPacker compilation.
* gtk/gtkarg.[hc], gtk/gtkargcollector.c: got rid of these.
* gtk/gtknotebook.c:
* gtk/gtktable.c:
* gtk/gtkbox.c: ported this over to child properties.
* gtk/gtksettings.c: fetch class properties via
g_object_class_list_properties().
* gtk/gtkcontainer.[hc]: implemented child properties, got rid of the
child arg interface. use gobjectnotifyqueue.c for child property
notification.
* gtk/gtkwidget.[hc]: provide necessary means for container child
properties, i.e. ::child_notify signal,
gtk_widget_freeze_child_notify(),
gtk_widget_child_notify(),
gtk_widget_thaw_child_notify().
* tests/testgtk.c: removed inferior property handling code, for
property editing, a generic module should be used, and GLE
coincidentally fullfills that purpose.
* docs/reference/Makefile.am: disabled gtk docs building, gtk-doc
needs to be adapted to g_object_class_list_properties() before this
builds again.
2001-06-19 12:54:10 +00:00
|
|
|
guint property_id = pspec->param_id;
|
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
Mon Apr 29 18:28:00 2002 Owen Taylor <otaylor@redhat.com>
Integrate Erwann Chenede's multihead changes for the gtk/ directory.
* gtk/gtkclipboard.[ch]: Add gtk_clipboard_get_for_display(),
make internals multihead aware.
* gtk/gtkcolorsel.[ch]: Add
gtk_color_selection_set_change_palette_with_screen_hook () [ugh!]
make up for non-multihead safety of
gtk_color_selection_set_change_palette_hook()
* gtk/gtkinvisible.[ch] gtk/gtkmenu.[ch] gtkwindow.[ch]: Add
gtk_{invisible,menu,window}_set_screen(); add "screen" properties
for GtkWindow and GtkMenu.
* gtk/gtkplug.[ch]: Add gtk_plug_construct_for_display(),
gtk_plug_new_for_display(). Multihead fixes.
* gtk/gtkselection.[ch]: Add gtk_selection_owner_set_for_display(),
make internals multihead aware.
* gtk/gtksettings.[ch]: Add gtk_settings_get_for_screen(), get
rid of now-useless gtk_settings_constructor().
* gtk/gtkstyle.[ch]: Add gtk_style_get_font_for_display(), fix
check/radio button indicators bitmap handling to be multihead
safe.
* gtk/gtkwidget.[ch]: Add gtk_widget_get_screen(), gtk_widget_has_screen(),
gtk_widget_get_display(), gtk_widget_get_clipboard(),
gtk_widget_get_root_window().
* gtk/gtkbindings.c gtk/gtkbutton.c gtk/gtkclist.c gtk/gtkcombo.c
gtk/gtkctree.c gtk/gtkdnd.c gtk/gtkfilesel.c gtk/gtkgamma.c
gtk/gtkhandlebox.c gtk/gtkhsv.c gtk/gtkimcontext.c gtk/gtklabel.c
gtk/gtklist.c gtk/gtkmain.c gtk/gtkmenuitem.c gtk/gtkmenushell.c
gtk/gtknotebook.c gtk/gtkoldeditable.c gtk/gtkoptionmenu.c
gtk/gtkpaned.c gtk/gtkpreview.c gtk/gtksocket.c gtk/gtktext.c
gtk/gtktextbuffer.c gtk/gtktextview.c gtk/gtktipsquery.c
gtk/gtktooltips.c gtk/gtktreeview.c gtk/gtktreeviewcolumn.c:
misc mechanical multihead-safety fixes.
* gtk/gtkclipboard.c: Use a GtkImage rather than a pixmap for
the dropper, look up the color palette only at realization time,
other multihead fixes.
* gtk/gtkcombo.c (gtk_combo_unrealize): Popdown the list when
unrealizing.
* gtk/gtkentry.c: Only claim ownership of the primary selection
when realized, misc multihead fixes.
* gtk/gtkfontsel.c: Only fill in fonts when attached to a screen,
fix gtk_font_selection_get_font() for multihead.
* gtk/gtkgc.c: make the depth => drawable hash per-screen.
* gtk/gtkinvisible.c: Add a constructor that realizes the
widget, so we get a realized widget with g_object_new() as
well gtk_invisible_new() as before.
* gtk/gtkmain.c: Get rid of unused gtk_visual/gtk_colormap
variables.
* gtk/gtktextdisplay.c: Add warnings if stipple bitmaps
are used on the wrong screen.
* gtk/gtktoolbar.c: Make handling of GtkSettings-based layout
read properties and connect to settings when the screen is changed,
rather than on init/finalize.
* gtk/gtkwindow.c: Fix icon handing to be multihead safe ...
default icon pixmaps/mask are only shared between windows on the
same screen. Misc multihead fixes.
Sat Apr 27 13:49:53 2002 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclipboard.c (gtk_clipboard_get_for_display):
Update docs to reference GDK_SELECTION_CLIPBOARD rather GDK_NONE.
2002-04-29 Alex Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkproperty-fb.c (gdk_property_get):
Fix silly bug, noticed by Sven Neumann.
Sun Apr 28 22:43:55 2002 Jonathan Blandford <jrb@gnome.org>
* gtk/gtktreemodelsort.c (gtk_tree_model_sort_set_sort_func): Fix
so that you can set a new sort func.
2002-04-29 22:53:45 +00:00
|
|
|
|
|
|
|
if (settings->screen == NULL) /* initialization */
|
|
|
|
return;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
switch (property_id)
|
|
|
|
{
|
2004-09-01 20:30:24 +00:00
|
|
|
case PROP_MODULES:
|
|
|
|
settings_update_modules (settings);
|
|
|
|
break;
|
2001-05-30 20:40:28 +00:00
|
|
|
case PROP_DOUBLE_CLICK_TIME:
|
2003-12-16 00:56:48 +00:00
|
|
|
case PROP_DOUBLE_CLICK_DISTANCE:
|
|
|
|
settings_update_double_click (settings);
|
2003-01-15 21:01:54 +00:00
|
|
|
break;
|
2005-12-16 18:45:31 +00:00
|
|
|
case PROP_COLOR_SCHEME:
|
|
|
|
settings_update_color_scheme (settings);
|
|
|
|
break;
|
2005-07-21 13:59:22 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
case PROP_XFT_DPI:
|
2005-08-24 16:17:56 +00:00
|
|
|
settings_update_resolution (settings);
|
2005-08-24 15:47:28 +00:00
|
|
|
/* This is a hack because with gtk_rc_reset_styles() doesn't get
|
|
|
|
* widgets with gtk_widget_style_set(), and also causes more
|
|
|
|
* recomputation than necessary.
|
|
|
|
*/
|
2005-08-24 03:29:06 +00:00
|
|
|
gtk_rc_reset_styles (GTK_SETTINGS (object));
|
|
|
|
break;
|
2005-08-24 16:17:56 +00:00
|
|
|
case PROP_XFT_ANTIALIAS:
|
|
|
|
case PROP_XFT_HINTING:
|
|
|
|
case PROP_XFT_HINTSTYLE:
|
|
|
|
case PROP_XFT_RGBA:
|
|
|
|
settings_update_font_options (settings);
|
|
|
|
gtk_rc_reset_styles (GTK_SETTINGS (object));
|
|
|
|
break;
|
2005-06-15 19:25:49 +00:00
|
|
|
case PROP_CURSOR_THEME_NAME:
|
|
|
|
case PROP_CURSOR_THEME_SIZE:
|
|
|
|
settings_update_cursor_theme (settings);
|
|
|
|
break;
|
2004-02-21 19:17:48 +00:00
|
|
|
#endif /* GDK_WINDOWING_X11 */
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2001-04-03 13:18:00 +00:00
|
|
|
gboolean
|
|
|
|
_gtk_settings_parse_convert (GtkRcPropertyParser parser,
|
|
|
|
const GValue *src_value,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GValue *dest_value)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
2001-04-03 13:18:00 +00:00
|
|
|
gboolean success = FALSE;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2001-04-03 13:18:00 +00:00
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS (dest_value, G_PARAM_SPEC_VALUE_TYPE (pspec)), FALSE);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2001-04-03 13:18:00 +00:00
|
|
|
if (parser)
|
|
|
|
{
|
|
|
|
GString *gstring;
|
|
|
|
gboolean free_gstring = TRUE;
|
|
|
|
|
|
|
|
if (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING))
|
|
|
|
{
|
|
|
|
gstring = g_value_get_boxed (src_value);
|
|
|
|
free_gstring = FALSE;
|
|
|
|
}
|
|
|
|
else if (G_VALUE_HOLDS_LONG (src_value))
|
|
|
|
{
|
2003-05-27 21:21:00 +00:00
|
|
|
gstring = g_string_new (NULL);
|
2001-10-01 20:35:02 +00:00
|
|
|
g_string_append_printf (gstring, "%ld", g_value_get_long (src_value));
|
2001-04-03 13:18:00 +00:00
|
|
|
}
|
|
|
|
else if (G_VALUE_HOLDS_DOUBLE (src_value))
|
|
|
|
{
|
2003-05-27 21:21:00 +00:00
|
|
|
gstring = g_string_new (NULL);
|
2001-10-01 20:35:02 +00:00
|
|
|
g_string_append_printf (gstring, "%f", g_value_get_double (src_value));
|
2001-04-03 13:18:00 +00:00
|
|
|
}
|
|
|
|
else if (G_VALUE_HOLDS_STRING (src_value))
|
|
|
|
{
|
|
|
|
gchar *tstr = g_strescape (g_value_get_string (src_value), NULL);
|
|
|
|
|
|
|
|
gstring = g_string_new ("\"");
|
|
|
|
g_string_append (gstring, tstr);
|
|
|
|
g_string_append_c (gstring, '\"');
|
|
|
|
g_free (tstr);
|
|
|
|
}
|
2001-03-18 04:50:34 +00:00
|
|
|
else
|
|
|
|
{
|
2001-04-03 13:18:00 +00:00
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING), FALSE);
|
|
|
|
gstring = NULL; /* silence compiler */
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
2001-04-03 13:18:00 +00:00
|
|
|
|
|
|
|
success = (parser (pspec, gstring, dest_value) &&
|
|
|
|
!g_param_value_validate (pspec, dest_value));
|
|
|
|
|
|
|
|
if (free_gstring)
|
|
|
|
g_string_free (gstring, TRUE);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
else if (G_VALUE_HOLDS (src_value, G_TYPE_GSTRING))
|
|
|
|
{
|
|
|
|
if (G_VALUE_HOLDS (dest_value, G_TYPE_STRING))
|
|
|
|
{
|
|
|
|
GString *gstring = g_value_get_boxed (src_value);
|
|
|
|
|
|
|
|
g_value_set_string (dest_value, gstring ? gstring->str : NULL);
|
|
|
|
success = !g_param_value_validate (pspec, dest_value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (g_value_type_transformable (G_VALUE_TYPE (src_value), G_VALUE_TYPE (dest_value)))
|
2001-04-03 13:18:00 +00:00
|
|
|
success = g_param_value_convert (pspec, src_value, dest_value, TRUE);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2002-10-02 14:22:31 +00:00
|
|
|
apply_queued_setting (GtkSettings *data,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkSettingsValuePrivate *qvalue)
|
2001-04-03 13:18:00 +00:00
|
|
|
{
|
|
|
|
GValue tmp_value = { 0, };
|
2002-03-20 21:47:01 +00:00
|
|
|
GtkRcPropertyParser parser = (GtkRcPropertyParser) g_param_spec_get_qdata (pspec, quark_property_parser);
|
2001-04-03 13:18:00 +00:00
|
|
|
|
|
|
|
g_value_init (&tmp_value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
2002-10-02 14:22:31 +00:00
|
|
|
if (_gtk_settings_parse_convert (parser, &qvalue->public.value,
|
2001-04-03 13:18:00 +00:00
|
|
|
pspec, &tmp_value))
|
2002-10-02 14:22:31 +00:00
|
|
|
{
|
2007-03-01 06:44:00 +00:00
|
|
|
if (data->property_values[pspec->param_id - 1].source <= qvalue->source)
|
2004-03-11 17:54:19 +00:00
|
|
|
{
|
2007-03-01 06:44:00 +00:00
|
|
|
g_value_copy (&tmp_value, &data->property_values[pspec->param_id - 1].value);
|
2004-03-11 17:54:19 +00:00
|
|
|
data->property_values[pspec->param_id - 1].source = qvalue->source;
|
2007-03-01 06:44:00 +00:00
|
|
|
g_object_notify (G_OBJECT (data), g_param_spec_get_name (pspec));
|
2004-03-11 17:54:19 +00:00
|
|
|
}
|
2007-03-01 06:44:00 +00:00
|
|
|
|
|
|
|
if (pspec->param_id == PROP_COLOR_SCHEME)
|
|
|
|
merge_color_scheme (data, &tmp_value, qvalue->source);
|
2002-10-02 14:22:31 +00:00
|
|
|
}
|
2001-03-18 04:50:34 +00:00
|
|
|
else
|
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
gchar *debug = g_strdup_value_contents (&qvalue->public.value);
|
2001-04-03 13:18:00 +00:00
|
|
|
|
2001-10-03 19:48:55 +00:00
|
|
|
g_message ("%s: failed to retrieve property `%s' of type `%s' from rc file value \"%s\" of type `%s'",
|
2006-07-06 05:14:03 +00:00
|
|
|
qvalue->public.origin ? qvalue->public.origin : "(for origin information, set GTK_DEBUG)",
|
2001-04-03 13:18:00 +00:00
|
|
|
pspec->name,
|
|
|
|
g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)),
|
|
|
|
debug,
|
|
|
|
G_VALUE_TYPE_NAME (&tmp_value));
|
|
|
|
g_free (debug);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
2001-04-03 13:18:00 +00:00
|
|
|
g_value_unset (&tmp_value);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
|
|
|
settings_install_property_parser (GtkSettingsClass *class,
|
|
|
|
GParamSpec *pspec,
|
|
|
|
GtkRcPropertyParser parser)
|
|
|
|
{
|
|
|
|
GSList *node, *next;
|
|
|
|
|
|
|
|
switch (G_TYPE_FUNDAMENTAL (G_PARAM_SPEC_VALUE_TYPE (pspec)))
|
|
|
|
{
|
|
|
|
case G_TYPE_BOOLEAN:
|
|
|
|
case G_TYPE_UCHAR:
|
|
|
|
case G_TYPE_CHAR:
|
|
|
|
case G_TYPE_UINT:
|
|
|
|
case G_TYPE_INT:
|
|
|
|
case G_TYPE_ULONG:
|
|
|
|
case G_TYPE_LONG:
|
|
|
|
case G_TYPE_FLOAT:
|
|
|
|
case G_TYPE_DOUBLE:
|
|
|
|
case G_TYPE_STRING:
|
|
|
|
break;
|
2007-01-30 11:10:22 +00:00
|
|
|
case G_TYPE_BOXED:
|
|
|
|
if (strcmp (g_param_spec_get_name (pspec), "color-hash") == 0)
|
|
|
|
{
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
/* fall through */
|
2001-03-18 04:50:34 +00:00
|
|
|
default:
|
|
|
|
if (!parser)
|
2001-06-04 23:15:51 +00:00
|
|
|
{
|
|
|
|
g_warning (G_STRLOC ": parser needs to be specified for property \"%s\" of type `%s'",
|
|
|
|
pspec->name, g_type_name (G_PARAM_SPEC_VALUE_TYPE (pspec)));
|
|
|
|
return 0;
|
|
|
|
}
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
if (g_object_class_find_property (G_OBJECT_CLASS (class), pspec->name))
|
|
|
|
{
|
|
|
|
g_warning (G_STRLOC ": an rc-data property \"%s\" already exists",
|
|
|
|
pspec->name);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (node = object_list; node; node = node->next)
|
|
|
|
g_object_freeze_notify (node->data);
|
|
|
|
|
|
|
|
g_object_class_install_property (G_OBJECT_CLASS (class), ++class_n_properties, pspec);
|
2002-03-20 21:47:01 +00:00
|
|
|
g_param_spec_set_qdata (pspec, quark_property_parser, (gpointer) parser);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
for (node = object_list; node; node = node->next)
|
|
|
|
{
|
|
|
|
GtkSettings *settings = node->data;
|
2002-10-02 14:22:31 +00:00
|
|
|
GtkSettingsValuePrivate *qvalue;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
settings->property_values = g_renew (GtkSettingsPropertyValue, settings->property_values, class_n_properties);
|
|
|
|
settings->property_values[class_n_properties - 1].value.g_type = 0;
|
|
|
|
g_value_init (&settings->property_values[class_n_properties - 1].value, G_PARAM_SPEC_VALUE_TYPE (pspec));
|
|
|
|
g_param_value_set_default (pspec, &settings->property_values[class_n_properties - 1].value);
|
2002-11-16 01:30:12 +00:00
|
|
|
settings->property_values[class_n_properties - 1].source = GTK_SETTINGS_SOURCE_DEFAULT;
|
2001-03-18 04:50:34 +00:00
|
|
|
g_object_notify (G_OBJECT (settings), pspec->name);
|
|
|
|
|
|
|
|
qvalue = g_datalist_get_data (&settings->queued_settings, pspec->name);
|
|
|
|
if (qvalue)
|
|
|
|
apply_queued_setting (settings, pspec, qvalue);
|
|
|
|
}
|
|
|
|
|
|
|
|
for (node = object_list; node; node = next)
|
|
|
|
{
|
|
|
|
next = node->next;
|
|
|
|
g_object_thaw_notify (node->data);
|
|
|
|
}
|
|
|
|
|
|
|
|
return class_n_properties;
|
|
|
|
}
|
|
|
|
|
2001-04-02 03:47:25 +00:00
|
|
|
GtkRcPropertyParser
|
2001-04-03 13:18:00 +00:00
|
|
|
_gtk_rc_property_parser_from_type (GType type)
|
2001-04-02 03:47:25 +00:00
|
|
|
{
|
2001-04-02 23:33:47 +00:00
|
|
|
if (type == GDK_TYPE_COLOR)
|
2001-04-02 03:47:25 +00:00
|
|
|
return gtk_rc_property_parse_color;
|
|
|
|
else if (type == GTK_TYPE_REQUISITION)
|
|
|
|
return gtk_rc_property_parse_requisition;
|
|
|
|
else if (type == GTK_TYPE_BORDER)
|
|
|
|
return gtk_rc_property_parse_border;
|
|
|
|
else if (G_TYPE_FUNDAMENTAL (type) == G_TYPE_ENUM && G_TYPE_IS_DERIVED (type))
|
|
|
|
return gtk_rc_property_parse_enum;
|
|
|
|
else if (G_TYPE_FUNDAMENTAL (type) == G_TYPE_FLAGS && G_TYPE_IS_DERIVED (type))
|
|
|
|
return gtk_rc_property_parse_flags;
|
|
|
|
else
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
void
|
2002-10-09 00:38:22 +00:00
|
|
|
gtk_settings_install_property (GParamSpec *pspec)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:06:38 2001 Tim Janik <timj@gtk.org>
* added gtkaccelmap.sgml. other updates.
Mon Nov 12 23:08:37 2001 Tim Janik <timj@gtk.org>
* gtk/maketypes.awk: fix type utils generation on unix.
* gtk/gtkaccelmap.[hc]: new files, implementing a global accelerator
registry.
* gtk/gtkaccelgroup.[hc]: major API/implementation revamp:
removed GTK_ACCEL_SIGNAL_VISIBLE, gtk_accel_group_get_default,
gtk_accel_group_get_entry, gtk_accel_group_(un)lock_entry,
gtk_accel_group_add/remove, gtk_accel_group_handle_add/remove,
gtk_accel_group_create_add/remove, gtk_accel_group_entries_from_object.
introduced ::accel_changed signal for change notification, and
gtk_accel_group_connect/disconnect to connect closures to accel groups.
made gtk_accel_group_attach/detach and gtk_accel_group_activate private
functions.
deprecated gtk_accel_group_ref/unref.
* gtk/gtkaccellabel.[hc]: changes to make accellabels pay attention
to accel group changed notification and basically operate on closures.
removed gtk_accel_label_get_accel_object and
gtk_accel_label_set_accel_object.
introduced gtk_accel_label_set_accel_closure, and for convenience,
gtk_accel_label_set_accel_widget.
* gtk/gtkitemfactory.[hc]: removed accelerator propagation code
which mostly moved into gtkaccelmap.[hc].
removed gtk_item_factory_parse_rc*, gtk_item_factory_dump_*
and gtk_item_factory_print_func.
* gtk/gtkmain.c: call _gtk_accel_map_init().
* gtk/gtkmenuitem.[hc]: introduced gtk_menu_item_set_accel_path(),
that associates an accelerator path with menu items, through which
persistent accelerator settings on menu items are enabled.
* gtk/gtkmenu.[hc]: added gtk_menu_set_accel_path() so accelerator
paths of menu item can be default constructed to allow installation
of accelerators on menu items that don't come with an accelerator
binding by default.
* gtk/gtksettings.c: fix STRING type rc settings by special casing
them appropriately in the parser.
* gtk/gtksignal.[hc]: allow a class function offset of 0 for
gtk_signal_newv().
* gtk/gtkwidget.[hc]: accelerator API revamp.
removed ::accelerator_add/remove signals, gtk_widget_accelerator_signal,
gtk_widget_accelerators_locked, gtk_widget_remove_accelerators and
gtk_widget_(un)lock_accelerators.
accelerators maintained through gtk_widget_add/remove_accelerator()
are not runtime changable now, the correct sequence to setup a
widget for runtime changable accelerators is now:
gtk_accel_map_add_entry(accel_path, key, mods);
_gtk_widget_set_accel_path(widget, accel_path, accel_group);
* gtk/gtkwindow.[hc]: accelerator changes, proxy and coalesce accel
group changes (as well as mnemonic changes) through the new signal
::accels_changed.
Sat Nov 10 12:08:56 2001 Tim Janik <timj@gtk.org>
* gtk/gtksettings.c (_gtk_settings_parse_convert): properly handle
GString->string conversions.
2001-11-13 00:53:47 +00:00
|
|
|
GtkRcPropertyParser parser;
|
2001-04-01 04:05:42 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
2001-04-01 04:05:42 +00:00
|
|
|
|
2001-04-03 13:18:00 +00:00
|
|
|
parser = _gtk_rc_property_parser_from_type (G_PARAM_SPEC_VALUE_TYPE (pspec));
|
2001-04-02 03:47:25 +00:00
|
|
|
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
settings_install_property_parser (gtk_type_class (GTK_TYPE_SETTINGS), pspec, parser);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2002-10-09 00:38:22 +00:00
|
|
|
gtk_settings_install_property_parser (GParamSpec *pspec,
|
|
|
|
GtkRcPropertyParser parser)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
|
|
|
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
|
|
|
g_return_if_fail (parser != NULL);
|
|
|
|
|
Allow %NULL for style to mean "revert to default style"
Tue Jun 26 19:39:03 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_style): Allow %NULL
for style to mean "revert to default style"
* gtk/gtkwidget.[ch] (gtk_widget_set_rc_style,
gtk_widget_restore_default_style): Make this functions
deprecated aliases for gtk_widget_set_style (widget, NULL).
* gtk/gtkwidget.[ch]: Remove:
gtk_widget_set_default_style ()
gtk_widget_push_style ()
gtk_widget_pop_style ()
These functions interact are overriden by RC files, and
thus virtually useless, and complicated.
Fri Jun 22 18:49:48 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: Add a GtkRcContext structure to hold
most of the previous global variables in gtkrc.c. This is
in preparation for multi-head, since each screen can
have different GtkSettings and RC information.
* gtk/gtkrc.[ch]:
* gtk/gtkrc.h (struct _GtkRcStyleClass): Add a
GtkSettings parameter to GtkRcStyle::parse.
* gdk/x11/gdkevents-x11.c gtk/gtksettings.c gtk/gtkrc.c:
Add two new settings gtk-theme-name, gtk-key-theme-name,
for RC files that are loaded by name after reading
the default RC files.
* gtk/gtkrc.c: Allow priorities for styles, as wll as
bindings.
* gtk/gtkenums.h gtk/gtkrc.c: Add GTK_PATH_PRIO_THEME,
and use it by default for RC files loaded via
gtk-theme-name, gtk-key-theme-name.
* gtk/gtkiconfactory.c (gtk_icon_source_set_filename)
gtk/gtkrc.c (gtk_rc_parse_pixmap_path_string)
tests/testgtkrc: Require pathnames to be absolute.
* gtk/gtkrc.c gtk/gtkiconfactory.c: Look up the full filename for
the source when parsing, since the operation of looking up a
pixmap from an RC file depends on the parsing context.
* gtk/gtkrc.c (gtk_rc_context_reparse_all): Automatically
reset RC styles on all widgets when files are reparsed.
* tests/testgtk.c (create_rc_file)
gtk/gtkwindow.c (gtk_window_read_rcfiles):
Simplify, now that gtk_rc_reparse_all() resets styles on
all widgets itself.
* gtk/gtkmain.c (gtk_get_default_language): Fix broken
return value.
* gtk/gtksettings.[ch] (gtk_settings_install_property[_ch]): Remove
GtkSettings argument.
* gtk/gtksettings.[ch] (gtk_settings_get_default): Rename from
gtk_settings_get_global().
* gtk/gtkwidget.[ch]: Add a function gtk_widget_Get_settings()
to get the appropriate GtkSettings for a widget. (For now,
just gets the default GtkSetttings.)
* gtk/gtkcolorsel.c gtk/gtkentry.c gtk/gtkmenu.c gtk/gtkmenubar.c
gtk/gtktextview.c gtk/gtktoolbar.c: Fixes for GtkSettings
changes.
* gtk/gtkrc.[ch]: Add gtk_rc_get_style_by_paths() to allow
getting a style for a path without actually having a widget.
(Allows using a style for a subpart of a widget, for
example.)
* gtk/gtkrc.[ch]: Add gtk_rc_reparse_all_for_setting() to allow forcing
the RC files to be reloaded for just one GtkSettings
(not sure how useful this really is.)
* gtk/gtkrc.h: Deprecate
gtk_rc_add_widget_name/widget_class/class_style
2001-06-30 16:08:25 +00:00
|
|
|
settings_install_property_parser (gtk_type_class (GTK_TYPE_SETTINGS), pspec, parser);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_value (gpointer data)
|
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
GtkSettingsValuePrivate *qvalue = data;
|
2001-03-18 04:50:34 +00:00
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
g_value_unset (&qvalue->public.value);
|
|
|
|
g_free (qvalue->public.origin);
|
2001-03-18 04:50:34 +00:00
|
|
|
g_free (qvalue);
|
|
|
|
}
|
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
static void
|
|
|
|
gtk_settings_set_property_value_internal (GtkSettings *settings,
|
|
|
|
const gchar *prop_name,
|
|
|
|
const GtkSettingsValue *new_value,
|
2002-11-16 01:30:12 +00:00
|
|
|
GtkSettingsSource source)
|
2001-03-18 04:50:34 +00:00
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
GtkSettingsValuePrivate *qvalue;
|
2001-03-18 04:50:34 +00:00
|
|
|
GParamSpec *pspec;
|
|
|
|
gchar *name;
|
|
|
|
GQuark name_quark;
|
|
|
|
|
|
|
|
if (!G_VALUE_HOLDS_LONG (&new_value->value) &&
|
|
|
|
!G_VALUE_HOLDS_DOUBLE (&new_value->value) &&
|
|
|
|
!G_VALUE_HOLDS_STRING (&new_value->value) &&
|
|
|
|
!G_VALUE_HOLDS (&new_value->value, G_TYPE_GSTRING))
|
|
|
|
{
|
|
|
|
g_warning (G_STRLOC ": value type invalid");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
name = g_strdup (prop_name);
|
2006-07-07 15:54:06 +00:00
|
|
|
g_strcanon (name, G_CSET_DIGITS "-" G_CSET_a_2_z G_CSET_A_2_Z, '-');
|
2001-12-04 17:20:41 +00:00
|
|
|
name_quark = g_quark_from_string (name);
|
|
|
|
g_free (name);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
qvalue = g_datalist_id_get_data (&settings->queued_settings, name_quark);
|
|
|
|
if (!qvalue)
|
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
qvalue = g_new0 (GtkSettingsValuePrivate, 1);
|
2001-03-18 04:50:34 +00:00
|
|
|
g_datalist_id_set_data_full (&settings->queued_settings, name_quark, qvalue, free_value);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2002-10-02 14:22:31 +00:00
|
|
|
g_free (qvalue->public.origin);
|
|
|
|
g_value_unset (&qvalue->public.value);
|
2001-03-18 04:50:34 +00:00
|
|
|
}
|
2002-10-02 14:22:31 +00:00
|
|
|
qvalue->public.origin = g_strdup (new_value->origin);
|
|
|
|
g_value_init (&qvalue->public.value, G_VALUE_TYPE (&new_value->value));
|
|
|
|
g_value_copy (&new_value->value, &qvalue->public.value);
|
2002-11-16 01:30:12 +00:00
|
|
|
qvalue->source = source;
|
2001-03-18 04:50:34 +00:00
|
|
|
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), g_quark_to_string (name_quark));
|
|
|
|
if (pspec)
|
|
|
|
apply_queued_setting (settings, pspec, qvalue);
|
|
|
|
}
|
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
void
|
|
|
|
gtk_settings_set_property_value (GtkSettings *settings,
|
|
|
|
const gchar *prop_name,
|
|
|
|
const GtkSettingsValue *new_value)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_SETTINGS (settings));
|
|
|
|
g_return_if_fail (prop_name != NULL);
|
|
|
|
g_return_if_fail (new_value != NULL);
|
|
|
|
|
2002-11-25 22:29:32 +00:00
|
|
|
gtk_settings_set_property_value_internal (settings, prop_name, new_value,
|
|
|
|
GTK_SETTINGS_SOURCE_APPLICATION);
|
2002-10-02 14:22:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_settings_set_property_value_from_rc (GtkSettings *settings,
|
|
|
|
const gchar *prop_name,
|
|
|
|
const GtkSettingsValue *new_value)
|
|
|
|
{
|
|
|
|
g_return_if_fail (GTK_SETTINGS (settings));
|
|
|
|
g_return_if_fail (prop_name != NULL);
|
|
|
|
g_return_if_fail (new_value != NULL);
|
|
|
|
|
2002-11-25 22:29:32 +00:00
|
|
|
gtk_settings_set_property_value_internal (settings, prop_name, new_value,
|
|
|
|
GTK_SETTINGS_SOURCE_RC_FILE);
|
2002-10-02 14:22:31 +00:00
|
|
|
}
|
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
void
|
|
|
|
gtk_settings_set_string_property (GtkSettings *settings,
|
|
|
|
const gchar *name,
|
|
|
|
const gchar *v_string,
|
|
|
|
const gchar *origin)
|
|
|
|
{
|
|
|
|
GtkSettingsValue svalue = { NULL, { 0, }, };
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_SETTINGS (settings));
|
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
g_return_if_fail (v_string != NULL);
|
|
|
|
|
|
|
|
svalue.origin = (gchar*) origin;
|
|
|
|
g_value_init (&svalue.value, G_TYPE_STRING);
|
|
|
|
g_value_set_static_string (&svalue.value, v_string);
|
|
|
|
gtk_settings_set_property_value (settings, name, &svalue);
|
|
|
|
g_value_unset (&svalue.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_settings_set_long_property (GtkSettings *settings,
|
|
|
|
const gchar *name,
|
|
|
|
glong v_long,
|
|
|
|
const gchar *origin)
|
|
|
|
{
|
|
|
|
GtkSettingsValue svalue = { NULL, { 0, }, };
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_SETTINGS (settings));
|
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
|
|
|
|
svalue.origin = (gchar*) origin;
|
|
|
|
g_value_init (&svalue.value, G_TYPE_LONG);
|
|
|
|
g_value_set_long (&svalue.value, v_long);
|
|
|
|
gtk_settings_set_property_value (settings, name, &svalue);
|
|
|
|
g_value_unset (&svalue.value);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_settings_set_double_property (GtkSettings *settings,
|
|
|
|
const gchar *name,
|
|
|
|
gdouble v_double,
|
|
|
|
const gchar *origin)
|
|
|
|
{
|
|
|
|
GtkSettingsValue svalue = { NULL, { 0, }, };
|
|
|
|
|
|
|
|
g_return_if_fail (GTK_SETTINGS (settings));
|
|
|
|
g_return_if_fail (name != NULL);
|
|
|
|
|
|
|
|
svalue.origin = (gchar*) origin;
|
|
|
|
g_value_init (&svalue.value, G_TYPE_DOUBLE);
|
|
|
|
g_value_set_double (&svalue.value, v_double);
|
|
|
|
gtk_settings_set_property_value (settings, name, &svalue);
|
|
|
|
g_value_unset (&svalue.value);
|
|
|
|
}
|
|
|
|
|
2003-05-19 00:55:20 +00:00
|
|
|
/**
|
|
|
|
* gtk_rc_property_parse_color:
|
|
|
|
* @pspec: a #GParamSpec
|
|
|
|
* @gstring: the #GString to be parsed
|
|
|
|
* @property_value: a #GValue which must hold #GdkColor values.
|
|
|
|
*
|
|
|
|
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
|
|
|
|
* or gtk_widget_class_install_style_property_parser() which parses a
|
|
|
|
* color given either by its name or in the form
|
|
|
|
* <literal>{ red, green, blue }</literal> where %red, %green and
|
|
|
|
* %blue are integers between 0 and 65535 or floating-point numbers
|
|
|
|
* between 0 and 1.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @gstring could be parsed and @property_value
|
|
|
|
* has been set to the resulting #GdkColor.
|
|
|
|
**/
|
2001-03-18 04:50:34 +00:00
|
|
|
gboolean
|
|
|
|
gtk_rc_property_parse_color (const GParamSpec *pspec,
|
|
|
|
const GString *gstring,
|
|
|
|
GValue *property_value)
|
|
|
|
{
|
|
|
|
GdkColor color = { 0, 0, 0, 0, };
|
|
|
|
GScanner *scanner;
|
|
|
|
gboolean success;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
|
2001-04-02 23:33:47 +00:00
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS (property_value, GDK_TYPE_COLOR), FALSE);
|
2001-03-18 04:50:34 +00:00
|
|
|
|
|
|
|
scanner = gtk_rc_scanner_new ();
|
|
|
|
g_scanner_input_text (scanner, gstring->str, gstring->len);
|
|
|
|
if (gtk_rc_parse_color (scanner, &color) == G_TOKEN_NONE &&
|
|
|
|
g_scanner_get_next_token (scanner) == G_TOKEN_EOF)
|
|
|
|
{
|
|
|
|
g_value_set_boxed (property_value, &color);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
success = FALSE;
|
|
|
|
g_scanner_destroy (scanner);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2003-05-19 00:55:20 +00:00
|
|
|
/**
|
|
|
|
* gtk_rc_property_parse_enum:
|
|
|
|
* @pspec: a #GParamSpec
|
|
|
|
* @gstring: the #GString to be parsed
|
|
|
|
* @property_value: a #GValue which must hold enum values.
|
|
|
|
*
|
|
|
|
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
|
|
|
|
* or gtk_widget_class_install_style_property_parser() which parses a single
|
|
|
|
* enumeration value.
|
|
|
|
*
|
|
|
|
* The enumeration value can be specified by its name, its nickname or
|
|
|
|
* its numeric value. For consistency with flags parsing, the value
|
|
|
|
* may be surrounded by parentheses.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @gstring could be parsed and @property_value
|
|
|
|
* has been set to the resulting #GEnumValue.
|
|
|
|
**/
|
2001-03-18 04:50:34 +00:00
|
|
|
gboolean
|
|
|
|
gtk_rc_property_parse_enum (const GParamSpec *pspec,
|
|
|
|
const GString *gstring,
|
|
|
|
GValue *property_value)
|
|
|
|
{
|
|
|
|
gboolean need_closing_brace = FALSE, success = FALSE;
|
|
|
|
GScanner *scanner;
|
|
|
|
GEnumValue *enum_value = NULL;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
|
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS_ENUM (property_value), FALSE);
|
|
|
|
|
|
|
|
scanner = gtk_rc_scanner_new ();
|
|
|
|
g_scanner_input_text (scanner, gstring->str, gstring->len);
|
|
|
|
|
|
|
|
/* we just want to parse _one_ value, but for consistency with flags parsing
|
2003-05-19 00:55:20 +00:00
|
|
|
* we support optional parenthesis
|
2001-03-18 04:50:34 +00:00
|
|
|
*/
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token == '(')
|
|
|
|
{
|
|
|
|
need_closing_brace = TRUE;
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
}
|
|
|
|
if (scanner->token == G_TOKEN_IDENTIFIER)
|
|
|
|
{
|
|
|
|
GEnumClass *class = G_PARAM_SPEC_ENUM (pspec)->enum_class;
|
2001-06-04 23:15:51 +00:00
|
|
|
|
2001-03-18 04:50:34 +00:00
|
|
|
enum_value = g_enum_get_value_by_name (class, scanner->value.v_identifier);
|
|
|
|
if (!enum_value)
|
|
|
|
enum_value = g_enum_get_value_by_nick (class, scanner->value.v_identifier);
|
|
|
|
if (enum_value)
|
|
|
|
{
|
|
|
|
g_value_set_enum (property_value, enum_value->value);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (scanner->token == G_TOKEN_INT)
|
|
|
|
{
|
|
|
|
g_value_set_enum (property_value, scanner->value.v_int);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
if (need_closing_brace && g_scanner_get_next_token (scanner) != ')')
|
|
|
|
success = FALSE;
|
|
|
|
if (g_scanner_get_next_token (scanner) != G_TOKEN_EOF)
|
|
|
|
success = FALSE;
|
|
|
|
|
|
|
|
g_scanner_destroy (scanner);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
|
|
|
static guint
|
|
|
|
parse_flags_value (GScanner *scanner,
|
|
|
|
GFlagsClass *class,
|
|
|
|
guint *number)
|
|
|
|
{
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token == G_TOKEN_IDENTIFIER)
|
|
|
|
{
|
|
|
|
GFlagsValue *flags_value;
|
|
|
|
|
|
|
|
flags_value = g_flags_get_value_by_name (class, scanner->value.v_identifier);
|
|
|
|
if (!flags_value)
|
|
|
|
flags_value = g_flags_get_value_by_nick (class, scanner->value.v_identifier);
|
|
|
|
if (flags_value)
|
|
|
|
{
|
|
|
|
*number |= flags_value->value;
|
|
|
|
return G_TOKEN_NONE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (scanner->token == G_TOKEN_INT)
|
|
|
|
{
|
|
|
|
*number |= scanner->value.v_int;
|
|
|
|
return G_TOKEN_NONE;
|
|
|
|
}
|
|
|
|
return G_TOKEN_IDENTIFIER;
|
|
|
|
}
|
|
|
|
|
2003-05-19 00:55:20 +00:00
|
|
|
/**
|
|
|
|
* gtk_rc_property_parse_flags:
|
|
|
|
* @pspec: a #GParamSpec
|
|
|
|
* @gstring: the #GString to be parsed
|
|
|
|
* @property_value: a #GValue which must hold flags values.
|
|
|
|
*
|
|
|
|
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
|
|
|
|
* or gtk_widget_class_install_style_property_parser() which parses flags.
|
|
|
|
*
|
|
|
|
* Flags can be specified by their name, their nickname or
|
|
|
|
* numerically. Multiple flags can be specified in the form
|
|
|
|
* <literal>"( flag1 | flag2 | ... )"</literal>.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @gstring could be parsed and @property_value
|
|
|
|
* has been set to the resulting flags value.
|
|
|
|
**/
|
2001-03-18 04:50:34 +00:00
|
|
|
gboolean
|
|
|
|
gtk_rc_property_parse_flags (const GParamSpec *pspec,
|
|
|
|
const GString *gstring,
|
|
|
|
GValue *property_value)
|
|
|
|
{
|
|
|
|
GFlagsClass *class;
|
2003-05-19 00:55:20 +00:00
|
|
|
gboolean success = FALSE;
|
2001-03-18 04:50:34 +00:00
|
|
|
GScanner *scanner;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
|
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS_FLAGS (property_value), FALSE);
|
|
|
|
|
|
|
|
class = G_PARAM_SPEC_FLAGS (pspec)->flags_class;
|
|
|
|
scanner = gtk_rc_scanner_new ();
|
|
|
|
g_scanner_input_text (scanner, gstring->str, gstring->len);
|
|
|
|
|
|
|
|
/* parse either a single flags value or a "\( ... [ \| ... ] \)" compound */
|
|
|
|
if (g_scanner_peek_next_token (scanner) == G_TOKEN_IDENTIFIER ||
|
|
|
|
scanner->next_token == G_TOKEN_INT)
|
|
|
|
{
|
|
|
|
guint token, flags_value = 0;
|
|
|
|
|
|
|
|
token = parse_flags_value (scanner, class, &flags_value);
|
|
|
|
|
|
|
|
if (token == G_TOKEN_NONE && g_scanner_peek_next_token (scanner) == G_TOKEN_EOF)
|
|
|
|
{
|
|
|
|
success = TRUE;
|
|
|
|
g_value_set_flags (property_value, flags_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
else if (g_scanner_get_next_token (scanner) == '(')
|
|
|
|
{
|
|
|
|
guint token, flags_value = 0;
|
|
|
|
|
|
|
|
/* parse first value */
|
|
|
|
token = parse_flags_value (scanner, class, &flags_value);
|
|
|
|
|
|
|
|
/* parse nth values, preceeded by '|' */
|
|
|
|
while (token == G_TOKEN_NONE && g_scanner_get_next_token (scanner) == '|')
|
|
|
|
token = parse_flags_value (scanner, class, &flags_value);
|
|
|
|
|
|
|
|
/* done, last token must have closed expression */
|
|
|
|
if (token == G_TOKEN_NONE && scanner->token == ')' &&
|
|
|
|
g_scanner_peek_next_token (scanner) == G_TOKEN_EOF)
|
|
|
|
{
|
|
|
|
g_value_set_flags (property_value, flags_value);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
g_scanner_destroy (scanner);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2001-04-02 03:47:25 +00:00
|
|
|
|
|
|
|
static gboolean
|
|
|
|
get_braced_int (GScanner *scanner,
|
|
|
|
gboolean first,
|
|
|
|
gboolean last,
|
|
|
|
gint *value)
|
|
|
|
{
|
|
|
|
if (first)
|
|
|
|
{
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token != '{')
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token != G_TOKEN_INT)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
*value = scanner->value.v_int;
|
|
|
|
|
|
|
|
if (last)
|
|
|
|
{
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token != '}')
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_scanner_get_next_token (scanner);
|
|
|
|
if (scanner->token != ',')
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-05-19 00:55:20 +00:00
|
|
|
/**
|
|
|
|
* gtk_rc_property_parse_requisition:
|
|
|
|
* @pspec: a #GParamSpec
|
|
|
|
* @gstring: the #GString to be parsed
|
|
|
|
* @property_value: a #GValue which must hold boxed values.
|
|
|
|
*
|
|
|
|
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
|
|
|
|
* or gtk_widget_class_install_style_property_parser() which parses a
|
|
|
|
* requisition in the form
|
|
|
|
* <literal>"{ width, height }"</literal> for integers %width and %height.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @gstring could be parsed and @property_value
|
|
|
|
* has been set to the resulting #GtkRequisition.
|
|
|
|
**/
|
2001-04-02 03:47:25 +00:00
|
|
|
gboolean
|
|
|
|
gtk_rc_property_parse_requisition (const GParamSpec *pspec,
|
|
|
|
const GString *gstring,
|
|
|
|
GValue *property_value)
|
|
|
|
{
|
|
|
|
GtkRequisition requisition;
|
|
|
|
GScanner *scanner;
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
|
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS_BOXED (property_value), FALSE);
|
|
|
|
|
|
|
|
scanner = gtk_rc_scanner_new ();
|
|
|
|
g_scanner_input_text (scanner, gstring->str, gstring->len);
|
|
|
|
|
|
|
|
if (get_braced_int (scanner, TRUE, FALSE, &requisition.width) &&
|
|
|
|
get_braced_int (scanner, FALSE, TRUE, &requisition.height))
|
|
|
|
{
|
|
|
|
g_value_set_boxed (property_value, &requisition);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_scanner_destroy (scanner);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
|
|
|
|
2003-05-19 00:55:20 +00:00
|
|
|
/**
|
|
|
|
* gtk_rc_property_parse_border:
|
|
|
|
* @pspec: a #GParamSpec
|
|
|
|
* @gstring: the #GString to be parsed
|
|
|
|
* @property_value: a #GValue which must hold boxed values.
|
|
|
|
*
|
|
|
|
* A #GtkRcPropertyParser for use with gtk_settings_install_property_parser()
|
|
|
|
* or gtk_widget_class_install_style_property_parser() which parses
|
|
|
|
* borders in the form
|
|
|
|
* <literal>"{ left, right, top, bottom }"</literal> for integers
|
|
|
|
* %left, %right, %top and %bottom.
|
|
|
|
*
|
|
|
|
* Return value: %TRUE if @gstring could be parsed and @property_value
|
|
|
|
* has been set to the resulting #GtkBorder.
|
|
|
|
**/
|
2001-04-02 03:47:25 +00:00
|
|
|
gboolean
|
|
|
|
gtk_rc_property_parse_border (const GParamSpec *pspec,
|
|
|
|
const GString *gstring,
|
|
|
|
GValue *property_value)
|
|
|
|
{
|
|
|
|
GtkBorder border;
|
|
|
|
GScanner *scanner;
|
|
|
|
gboolean success = FALSE;
|
|
|
|
|
|
|
|
g_return_val_if_fail (G_IS_PARAM_SPEC (pspec), FALSE);
|
|
|
|
g_return_val_if_fail (G_VALUE_HOLDS_BOXED (property_value), FALSE);
|
|
|
|
|
|
|
|
scanner = gtk_rc_scanner_new ();
|
|
|
|
g_scanner_input_text (scanner, gstring->str, gstring->len);
|
|
|
|
|
|
|
|
if (get_braced_int (scanner, TRUE, FALSE, &border.left) &&
|
|
|
|
get_braced_int (scanner, FALSE, FALSE, &border.right) &&
|
|
|
|
get_braced_int (scanner, FALSE, FALSE, &border.top) &&
|
|
|
|
get_braced_int (scanner, FALSE, TRUE, &border.bottom))
|
|
|
|
{
|
|
|
|
g_value_set_boxed (property_value, &border);
|
|
|
|
success = TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_scanner_destroy (scanner);
|
|
|
|
|
|
|
|
return success;
|
|
|
|
}
|
2001-04-02 23:33:47 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_settings_handle_event (GdkEventSetting *event)
|
|
|
|
{
|
2007-03-01 06:44:00 +00:00
|
|
|
GtkSettings *settings;
|
|
|
|
GParamSpec *pspec;
|
|
|
|
guint property_id;
|
|
|
|
|
|
|
|
settings = gtk_settings_get_for_screen (gdk_drawable_get_screen (event->window));
|
|
|
|
pspec = g_object_class_find_property (G_OBJECT_GET_CLASS (settings), event->name);
|
|
|
|
|
|
|
|
if (pspec)
|
|
|
|
{
|
2007-03-22 21:09:08 +00:00
|
|
|
property_id = pspec->param_id;
|
2007-03-01 06:44:00 +00:00
|
|
|
|
|
|
|
if (property_id == PROP_COLOR_SCHEME)
|
|
|
|
{
|
|
|
|
GValue value = { 0, };
|
|
|
|
|
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
2007-03-22 21:09:08 +00:00
|
|
|
if (!gdk_screen_get_setting (settings->screen, pspec->name, &value))
|
|
|
|
g_value_set_static_string (&value, "");
|
|
|
|
merge_color_scheme (settings, &value, GTK_SETTINGS_SOURCE_XSETTING);
|
|
|
|
g_value_unset (&value);
|
2007-03-01 06:44:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_object_notify (G_OBJECT (settings), pspec->name);
|
|
|
|
}
|
2001-04-02 23:33:47 +00:00
|
|
|
}
|
2002-10-02 14:22:31 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
reset_rc_values_foreach (GQuark key_id,
|
|
|
|
gpointer data,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkSettingsValuePrivate *qvalue = data;
|
|
|
|
GSList **to_reset = user_data;
|
|
|
|
|
2002-11-16 01:30:12 +00:00
|
|
|
if (qvalue->source == GTK_SETTINGS_SOURCE_RC_FILE)
|
2002-10-02 14:22:31 +00:00
|
|
|
*to_reset = g_slist_prepend (*to_reset, GUINT_TO_POINTER (key_id));
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_gtk_settings_reset_rc_values (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
GSList *to_reset = NULL;
|
|
|
|
GSList *tmp_list;
|
|
|
|
GParamSpec **pspecs, **p;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
/* Remove any queued settings
|
|
|
|
*/
|
|
|
|
g_datalist_foreach (&settings->queued_settings,
|
|
|
|
reset_rc_values_foreach,
|
|
|
|
&to_reset);
|
|
|
|
|
|
|
|
for (tmp_list = to_reset; tmp_list; tmp_list = tmp_list->next)
|
|
|
|
{
|
|
|
|
GQuark key_id = GPOINTER_TO_UINT (tmp_list->data);
|
|
|
|
g_datalist_id_remove_data (&settings->queued_settings, key_id);
|
|
|
|
}
|
|
|
|
|
2006-09-09 05:22:16 +00:00
|
|
|
g_slist_free (to_reset);
|
|
|
|
|
2002-10-02 14:22:31 +00:00
|
|
|
/* Now reset the active settings
|
|
|
|
*/
|
|
|
|
pspecs = g_object_class_list_properties (G_OBJECT_GET_CLASS (settings), NULL);
|
|
|
|
i = 0;
|
|
|
|
|
|
|
|
g_object_freeze_notify (G_OBJECT (settings));
|
|
|
|
for (p = pspecs; *p; p++)
|
|
|
|
{
|
2002-11-16 01:30:12 +00:00
|
|
|
if (settings->property_values[i].source == GTK_SETTINGS_SOURCE_RC_FILE)
|
2002-10-02 14:22:31 +00:00
|
|
|
{
|
|
|
|
GParamSpec *pspec = *p;
|
|
|
|
|
|
|
|
g_param_value_set_default (pspec, &settings->property_values[i].value);
|
|
|
|
g_object_notify (G_OBJECT (settings), pspec->name);
|
|
|
|
}
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
g_object_thaw_notify (G_OBJECT (settings));
|
|
|
|
g_free (pspecs);
|
|
|
|
}
|
|
|
|
|
2003-01-15 21:01:54 +00:00
|
|
|
static void
|
2003-12-16 00:56:48 +00:00
|
|
|
settings_update_double_click (GtkSettings *settings)
|
2003-01-15 21:01:54 +00:00
|
|
|
{
|
|
|
|
if (gdk_screen_get_number (settings->screen) == 0)
|
|
|
|
{
|
|
|
|
GdkDisplay *display = gdk_screen_get_display (settings->screen);
|
|
|
|
gint double_click_time;
|
2003-12-16 00:56:48 +00:00
|
|
|
gint double_click_distance;
|
2003-01-15 21:01:54 +00:00
|
|
|
|
2003-12-16 00:56:48 +00:00
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-double-click-time", &double_click_time,
|
|
|
|
"gtk-double-click-distance", &double_click_distance,
|
|
|
|
NULL);
|
2003-01-15 21:01:54 +00:00
|
|
|
|
|
|
|
gdk_display_set_double_click_time (display, double_click_time);
|
2003-12-16 00:56:48 +00:00
|
|
|
gdk_display_set_double_click_distance (display, double_click_distance);
|
2003-01-15 21:01:54 +00:00
|
|
|
}
|
|
|
|
}
|
2004-09-01 20:30:24 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
settings_update_modules (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
gchar *modules;
|
|
|
|
|
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-modules", &modules,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
_gtk_modules_settings_changed (settings, modules);
|
|
|
|
|
|
|
|
g_free (modules);
|
|
|
|
}
|
2005-03-20 07:01:23 +00:00
|
|
|
|
2005-06-15 19:25:49 +00:00
|
|
|
#ifdef GDK_WINDOWING_X11
|
|
|
|
static void
|
|
|
|
settings_update_cursor_theme (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
GdkDisplay *display = gdk_screen_get_display (settings->screen);
|
|
|
|
gchar *theme = NULL;
|
|
|
|
gint size = 0;
|
|
|
|
|
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-cursor-theme-name", &theme,
|
|
|
|
"gtk-cursor-theme-size", &size,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
gdk_x11_display_set_cursor_theme (display, theme, size);
|
2005-08-29 04:48:19 +00:00
|
|
|
|
|
|
|
g_free (theme);
|
2005-06-15 19:25:49 +00:00
|
|
|
}
|
2005-08-24 16:17:56 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
settings_update_font_options (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
gint hinting;
|
|
|
|
gchar *hint_style_str;
|
|
|
|
cairo_hint_style_t hint_style = CAIRO_HINT_STYLE_DEFAULT;
|
|
|
|
gint antialias;
|
|
|
|
cairo_antialias_t antialias_mode = CAIRO_ANTIALIAS_DEFAULT;
|
|
|
|
gchar *rgba_str;
|
|
|
|
cairo_subpixel_order_t subpixel_order = CAIRO_SUBPIXEL_ORDER_DEFAULT;
|
|
|
|
cairo_font_options_t *options;
|
|
|
|
|
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-xft-antialias", &antialias,
|
|
|
|
"gtk-xft-hinting", &hinting,
|
|
|
|
"gtk-xft-hintstyle", &hint_style_str,
|
|
|
|
"gtk-xft-rgba", &rgba_str,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
options = cairo_font_options_create ();
|
|
|
|
|
|
|
|
if (hinting >= 0 && !hinting)
|
|
|
|
{
|
|
|
|
hint_style = CAIRO_HINT_STYLE_NONE;
|
|
|
|
}
|
|
|
|
else if (hint_style_str)
|
|
|
|
{
|
|
|
|
if (strcmp (hint_style_str, "hintnone") == 0)
|
|
|
|
hint_style = CAIRO_HINT_STYLE_NONE;
|
|
|
|
else if (strcmp (hint_style_str, "hintslight") == 0)
|
|
|
|
hint_style = CAIRO_HINT_STYLE_SLIGHT;
|
|
|
|
else if (strcmp (hint_style_str, "hintmedium") == 0)
|
|
|
|
hint_style = CAIRO_HINT_STYLE_MEDIUM;
|
|
|
|
else if (strcmp (hint_style_str, "hintfull") == 0)
|
|
|
|
hint_style = CAIRO_HINT_STYLE_FULL;
|
|
|
|
}
|
|
|
|
|
2007-03-09 21:57:37 +00:00
|
|
|
g_free (hint_style_str);
|
2005-08-24 16:17:56 +00:00
|
|
|
|
|
|
|
cairo_font_options_set_hint_style (options, hint_style);
|
|
|
|
|
|
|
|
if (rgba_str)
|
|
|
|
{
|
|
|
|
if (strcmp (rgba_str, "rgb") == 0)
|
|
|
|
subpixel_order = CAIRO_SUBPIXEL_ORDER_RGB;
|
|
|
|
else if (strcmp (rgba_str, "bgr") == 0)
|
|
|
|
subpixel_order = CAIRO_SUBPIXEL_ORDER_BGR;
|
|
|
|
else if (strcmp (rgba_str, "vrgb") == 0)
|
|
|
|
subpixel_order = CAIRO_SUBPIXEL_ORDER_VRGB;
|
|
|
|
else if (strcmp (rgba_str, "vbgr") == 0)
|
|
|
|
subpixel_order = CAIRO_SUBPIXEL_ORDER_VBGR;
|
|
|
|
|
|
|
|
g_free (rgba_str);
|
|
|
|
}
|
|
|
|
|
|
|
|
cairo_font_options_set_subpixel_order (options, subpixel_order);
|
|
|
|
|
|
|
|
if (antialias >= 0 && !antialias)
|
|
|
|
antialias_mode = CAIRO_ANTIALIAS_NONE;
|
|
|
|
else if (subpixel_order != CAIRO_SUBPIXEL_ORDER_DEFAULT)
|
|
|
|
antialias_mode = CAIRO_ANTIALIAS_SUBPIXEL;
|
|
|
|
else if (antialias >= 0)
|
|
|
|
antialias_mode = CAIRO_ANTIALIAS_GRAY;
|
|
|
|
|
|
|
|
cairo_font_options_set_antialias (options, antialias_mode);
|
|
|
|
|
2005-08-26 18:49:52 +00:00
|
|
|
gdk_screen_set_font_options (settings->screen, options);
|
2005-08-24 16:17:56 +00:00
|
|
|
|
|
|
|
cairo_font_options_destroy (options);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
settings_update_resolution (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
gint dpi_int;
|
|
|
|
double dpi;
|
|
|
|
|
|
|
|
g_object_get (settings,
|
|
|
|
"gtk-xft-dpi", &dpi_int,
|
|
|
|
NULL);
|
|
|
|
|
|
|
|
if (dpi_int > 0)
|
|
|
|
dpi = dpi_int / 1024.;
|
|
|
|
else
|
|
|
|
dpi = -1.;
|
|
|
|
|
2005-08-26 18:49:52 +00:00
|
|
|
gdk_screen_set_resolution (settings->screen, dpi);
|
2005-08-24 16:17:56 +00:00
|
|
|
}
|
2005-06-15 19:25:49 +00:00
|
|
|
#endif
|
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
typedef struct {
|
|
|
|
GHashTable *color_hash;
|
|
|
|
GHashTable *tables[GTK_SETTINGS_SOURCE_APPLICATION + 1];
|
|
|
|
gchar *lastentry[GTK_SETTINGS_SOURCE_APPLICATION + 1];
|
|
|
|
} ColorSchemeData;
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
static void
|
2007-03-01 06:44:00 +00:00
|
|
|
color_scheme_data_free (ColorSchemeData *data)
|
2005-12-16 18:45:31 +00:00
|
|
|
{
|
2007-03-01 06:44:00 +00:00
|
|
|
gint i;
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
g_hash_table_unref (data->color_hash);
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
for (i = 0; i <= GTK_SETTINGS_SOURCE_APPLICATION; i++)
|
|
|
|
{
|
|
|
|
if (data->tables[i])
|
|
|
|
g_hash_table_unref (data->tables[i]);
|
|
|
|
g_free (data->lastentry[i]);
|
|
|
|
}
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
g_free (data);
|
2005-12-16 18:45:31 +00:00
|
|
|
}
|
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
static void
|
|
|
|
settings_update_color_scheme (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
if (!g_object_get_data (G_OBJECT (settings), "gtk-color-scheme"))
|
|
|
|
{
|
|
|
|
ColorSchemeData *data;
|
|
|
|
GValue value = { 0, };
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
data = g_new0 (ColorSchemeData, 1);
|
|
|
|
g_object_set_data_full (G_OBJECT (settings), "gtk-color-scheme",
|
|
|
|
data, (GDestroyNotify) color_scheme_data_free);
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
g_value_init (&value, G_TYPE_STRING);
|
|
|
|
if (gdk_screen_get_setting (settings->screen, "gtk-color-scheme", &value))
|
|
|
|
{
|
|
|
|
merge_color_scheme (settings, &value, GTK_SETTINGS_SOURCE_XSETTING);
|
|
|
|
g_value_unset (&value);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2005-12-16 18:45:31 +00:00
|
|
|
|
|
|
|
static gboolean
|
2006-12-11 06:16:21 +00:00
|
|
|
add_color_to_hash (gchar *name,
|
|
|
|
GdkColor *color,
|
|
|
|
GHashTable *target)
|
2005-11-23 10:33:58 +00:00
|
|
|
{
|
2007-02-28 19:37:08 +00:00
|
|
|
GdkColor *old;
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2006-12-11 06:16:21 +00:00
|
|
|
old = g_hash_table_lookup (target, name);
|
|
|
|
if (!old || !gdk_color_equal (old, color))
|
|
|
|
{
|
2007-02-28 19:37:08 +00:00
|
|
|
g_hash_table_insert (target, g_strdup (name), gdk_color_copy (color));
|
2006-12-11 06:16:21 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2005-12-16 18:45:31 +00:00
|
|
|
|
2006-12-11 06:16:21 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2006-12-11 06:16:21 +00:00
|
|
|
static gboolean
|
|
|
|
add_colors_to_hash_from_string (GHashTable *hash,
|
|
|
|
const gchar *colors)
|
|
|
|
{
|
|
|
|
gchar *s, *p, *name;
|
|
|
|
GdkColor color;
|
|
|
|
gboolean changed = FALSE;
|
|
|
|
gchar *copy;
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2006-12-11 06:16:21 +00:00
|
|
|
copy = g_strdup (colors);
|
2005-11-23 10:33:58 +00:00
|
|
|
s = copy;
|
|
|
|
while (s && *s)
|
|
|
|
{
|
|
|
|
name = s;
|
|
|
|
p = strchr (s, ':');
|
|
|
|
if (p)
|
|
|
|
{
|
|
|
|
*p = '\0';
|
|
|
|
p++;
|
|
|
|
}
|
|
|
|
else
|
2005-12-16 18:45:31 +00:00
|
|
|
break;
|
2005-11-23 10:33:58 +00:00
|
|
|
|
|
|
|
while (*p == ' ')
|
|
|
|
p++;
|
|
|
|
|
2005-12-12 15:48:43 +00:00
|
|
|
s = p;
|
|
|
|
while (*s)
|
|
|
|
{
|
2006-12-11 06:16:21 +00:00
|
|
|
if (*s == '\n' || *s == ';')
|
2005-12-12 15:48:43 +00:00
|
|
|
{
|
|
|
|
*s = '\0';
|
|
|
|
s++;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
s++;
|
|
|
|
}
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
if (gdk_color_parse (p, &color))
|
2007-02-28 19:37:08 +00:00
|
|
|
changed |= add_color_to_hash (name, &color, hash);
|
2005-11-23 10:33:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
g_free (copy);
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
return changed;
|
2005-11-23 10:33:58 +00:00
|
|
|
}
|
|
|
|
|
2006-12-11 06:16:21 +00:00
|
|
|
static gboolean
|
|
|
|
update_color_hash (ColorSchemeData *data,
|
|
|
|
const gchar *str,
|
|
|
|
GtkSettingsSource source)
|
|
|
|
{
|
|
|
|
gboolean changed = FALSE;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if ((str == NULL || *str == '\0') &&
|
|
|
|
(data->lastentry[source] == NULL || data->lastentry[source][0] == '\0'))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (str && data->lastentry[source] && strcmp (str, data->lastentry[source]) == 0)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* For the RC_FILE source we merge the values rather than over-writing
|
|
|
|
* them, since multiple rc files might define independent sets of colors
|
|
|
|
*/
|
|
|
|
if ((source != GTK_SETTINGS_SOURCE_RC_FILE) &&
|
|
|
|
data->tables[source] && g_hash_table_size (data->tables[source]) > 0)
|
|
|
|
{
|
|
|
|
g_hash_table_unref (data->tables[source]);
|
|
|
|
data->tables[source] = NULL;
|
|
|
|
changed = TRUE; /* We can't rely on the code below since str might be "" */
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data->tables[source] == NULL)
|
|
|
|
data->tables[source] = g_hash_table_new_full (g_str_hash, g_str_equal,
|
|
|
|
g_free,
|
|
|
|
(GDestroyNotify) gdk_color_free);
|
|
|
|
|
|
|
|
g_free (data->lastentry[source]);
|
|
|
|
data->lastentry[source] = g_strdup (str);
|
|
|
|
|
|
|
|
changed |= add_colors_to_hash_from_string (data->tables[source], str);
|
|
|
|
|
|
|
|
if (!changed)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Rebuild the merged hash table. */
|
2007-03-01 06:44:00 +00:00
|
|
|
if (data->color_hash)
|
|
|
|
g_hash_table_unref (data->color_hash);
|
2006-12-11 06:16:21 +00:00
|
|
|
data->color_hash = g_hash_table_new_full (g_str_hash, g_str_equal, g_free,
|
|
|
|
(GDestroyNotify) gdk_color_free);
|
|
|
|
for (i = 0; i <= GTK_SETTINGS_SOURCE_APPLICATION; i++)
|
|
|
|
{
|
|
|
|
if (data->tables[i])
|
|
|
|
g_hash_table_foreach (data->tables[i], (GHFunc) add_color_to_hash,
|
|
|
|
data->color_hash);
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
static void
|
|
|
|
merge_color_scheme (GtkSettings *settings,
|
2007-03-01 06:44:00 +00:00
|
|
|
const GValue *value,
|
2005-12-16 18:45:31 +00:00
|
|
|
GtkSettingsSource source)
|
|
|
|
{
|
|
|
|
ColorSchemeData *data;
|
|
|
|
const gchar *colors;
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2007-03-22 21:09:08 +00:00
|
|
|
g_object_freeze_notify (G_OBJECT (settings));
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
colors = g_value_get_string (value);
|
2005-11-23 10:33:58 +00:00
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
settings_update_color_scheme (settings);
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
data = (ColorSchemeData *) g_object_get_data (G_OBJECT (settings),
|
2006-12-11 06:16:21 +00:00
|
|
|
"gtk-color-scheme");
|
2005-12-16 18:45:31 +00:00
|
|
|
|
|
|
|
if (update_color_hash (data, colors, source))
|
|
|
|
g_object_notify (G_OBJECT (settings), "color-hash");
|
2007-03-22 21:09:08 +00:00
|
|
|
|
|
|
|
g_object_thaw_notify (G_OBJECT (settings));
|
2005-11-23 10:33:58 +00:00
|
|
|
}
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
static GHashTable *
|
|
|
|
get_color_hash (GtkSettings *settings)
|
2005-12-12 15:48:43 +00:00
|
|
|
{
|
2005-12-16 18:45:31 +00:00
|
|
|
ColorSchemeData *data;
|
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
settings_update_color_scheme (settings);
|
2005-12-16 18:45:31 +00:00
|
|
|
|
|
|
|
data = (ColorSchemeData *)g_object_get_data (G_OBJECT (settings),
|
|
|
|
"gtk-color-scheme");
|
|
|
|
|
|
|
|
return data->color_hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
append_color_scheme (gpointer key,
|
|
|
|
gpointer value,
|
|
|
|
gpointer data)
|
|
|
|
{
|
|
|
|
gchar *name = (gchar *)key;
|
|
|
|
GdkColor *color = (GdkColor *)value;
|
|
|
|
GString *string = (GString *)data;
|
|
|
|
|
|
|
|
g_string_append_printf (string, "%s: #%04x%04x%04x\n",
|
|
|
|
name, color->red, color->green, color->blue);
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar *
|
|
|
|
get_color_scheme (GtkSettings *settings)
|
|
|
|
{
|
|
|
|
ColorSchemeData *data;
|
|
|
|
GString *string;
|
|
|
|
|
2007-03-01 06:44:00 +00:00
|
|
|
settings_update_color_scheme (settings);
|
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
data = (ColorSchemeData *) g_object_get_data (G_OBJECT (settings),
|
|
|
|
"gtk-color-scheme");
|
|
|
|
|
|
|
|
string = g_string_new ("");
|
|
|
|
|
|
|
|
g_hash_table_foreach (data->color_hash, append_color_scheme, string);
|
2005-12-12 15:48:43 +00:00
|
|
|
|
2005-12-16 18:45:31 +00:00
|
|
|
return g_string_free (string, FALSE);
|
2005-12-12 15:48:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2005-03-20 07:01:23 +00:00
|
|
|
#define __GTK_SETTINGS_C__
|
|
|
|
#include "gtkaliasdef.c"
|