mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-11 13:10:07 +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
This commit is contained in:
parent
ba02311234
commit
fbfc305174
85
ChangeLog
85
ChangeLog
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -1,3 +1,88 @@
|
||||
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 Alex Larsson <alexl@redhat.com>
|
||||
|
||||
* gdk/linux-fb/gdkinput-none.c:
|
||||
|
@ -367,6 +367,11 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0:
|
||||
* gtk_rc_set_image_loader() and gtk_rc_load_image() has been removed, now
|
||||
that GTK+ includes decent image loading capabilities itself.
|
||||
|
||||
* An extra GtkSettings argument has been added to
|
||||
gtk_rc_find_pixmap_in_path(). This function is only actually useful
|
||||
from a theme engine during parsing, at which point the GtkSettings
|
||||
is provided.
|
||||
|
||||
* The child argument facility in gtkcontainer.c has been converted
|
||||
to a child property facility using GParamSpec and other facilities
|
||||
for GObject.
|
||||
|
@ -182,6 +182,7 @@ Represents the packing location #GtkBox children. (See: #GtkVBox,
|
||||
@GTK_PATH_PRIO_LOWEST:
|
||||
@GTK_PATH_PRIO_GTK:
|
||||
@GTK_PATH_PRIO_APPLICATION:
|
||||
@GTK_PATH_PRIO_THEME:
|
||||
@GTK_PATH_PRIO_RC:
|
||||
@GTK_PATH_PRIO_HIGHEST:
|
||||
@GTK_PATH_PRIO_MASK:
|
||||
|
@ -589,6 +589,7 @@ specific portions of a RC file.
|
||||
@GTK_RC_TOKEN_LOWEST:
|
||||
@GTK_RC_TOKEN_GTK:
|
||||
@GTK_RC_TOKEN_APPLICATION:
|
||||
@GTK_RC_TOKEN_THEME:
|
||||
@GTK_RC_TOKEN_RC:
|
||||
@GTK_RC_TOKEN_HIGHEST:
|
||||
@GTK_RC_TOKEN_ENGINE:
|
||||
@ -610,19 +611,10 @@ specific portions of a RC file.
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_get_style ##### -->
|
||||
<para>
|
||||
Finds all matching RC styles for a given widget,
|
||||
composites them together, and then creates a
|
||||
#GtkStyle representing the composite appearance.
|
||||
(GTK+ actually keeps a cache of previously
|
||||
created styles, so a new style may not be
|
||||
created.)
|
||||
</para>
|
||||
|
||||
@widget: a #GtkWidget
|
||||
@Returns: the resulting style. The caller should
|
||||
reference the result, since GTK+ will retain the
|
||||
initial reference count itself for the cache
|
||||
of created styles.
|
||||
@widget:
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_add_widget_name_style ##### -->
|
||||
@ -686,42 +678,30 @@ Parse resource information directly from a string.
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_reparse_all ##### -->
|
||||
<para>
|
||||
If the modification time on any previously read file
|
||||
has changed, discard all style information
|
||||
and then reread all previously read RC files.
|
||||
</para>
|
||||
|
||||
@Returns: %TRUE if the files were reread.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_add_default_file ##### -->
|
||||
<para>
|
||||
Adds a file to the list of files to be parsed at the
|
||||
end of gtk_init().
|
||||
</para>
|
||||
|
||||
@filename: the pathname to the file.
|
||||
@filename:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_get_default_files ##### -->
|
||||
<para>
|
||||
Retrieves the current list of RC files that will be parsed
|
||||
at the end of gtk_init()
|
||||
</para>
|
||||
|
||||
@Returns: A NULL terminated array of filenames. This memory
|
||||
is owned by GTK+ and must not be freed by the application.
|
||||
If you want to store this information, you should make a
|
||||
copy.
|
||||
@Returns:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_set_default_files ##### -->
|
||||
<para>
|
||||
Sets the list of files that GTK+ will read at the
|
||||
end of gtk_init()
|
||||
</para>
|
||||
|
||||
@filenames: A %NULL terminated list of filenames.
|
||||
@filenames:
|
||||
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_parse_color ##### -->
|
||||
@ -773,11 +753,9 @@ otherwise %NULL.
|
||||
|
||||
<!-- ##### FUNCTION gtk_rc_find_pixmap_in_path ##### -->
|
||||
<para>
|
||||
Looks up a file in the current pixmap path. If the file is
|
||||
not found, it outputs a warning message using g_warning()
|
||||
and returns %NULL.
|
||||
</para>
|
||||
|
||||
@context:
|
||||
@scanner: a #GtkScanner. Used for printing out warning messages
|
||||
if the file is not found.
|
||||
@pixmap_file: The name of the file to search for.
|
||||
|
@ -2027,7 +2027,9 @@ static struct
|
||||
{ "Gtk/ToolbarStyle", "gtk-toolbar-style" },
|
||||
{ "Gtk/ToolbarIconSize", "gtk-toolbar-icon-size" },
|
||||
{ "Net/CursorBlink", "gtk-cursor-blink" },
|
||||
{ "Net/CursorBlinkTime", "gtk-cursor-blink-time" }
|
||||
{ "Net/CursorBlinkTime", "gtk-cursor-blink-time" },
|
||||
{ "Net/ThemeName", "gtk-theme-name" },
|
||||
{ "Gtk/KeyThemeName", "gtk-key-theme-name" }
|
||||
};
|
||||
|
||||
static void
|
||||
|
@ -1586,7 +1586,7 @@ default_change_palette_func (const GdkColor *colors,
|
||||
|
||||
str = gtk_color_selection_palette_to_string (colors, n_colors);
|
||||
|
||||
gtk_settings_set_string_property (gtk_settings_get_global (),
|
||||
gtk_settings_set_string_property (gtk_settings_get_default (),
|
||||
"gtk-color-palette",
|
||||
str,
|
||||
"gtk_color_selection_palette_to_string");
|
||||
@ -1642,14 +1642,13 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
gtk_marshal_VOID__VOID,
|
||||
GTK_TYPE_NONE, 0);
|
||||
|
||||
gtk_settings_install_property (gtk_settings_get_global (),
|
||||
g_param_spec_string ("gtk-color-palette",
|
||||
gtk_settings_install_property (g_param_spec_string ("gtk-color-palette",
|
||||
_("Custom palette"),
|
||||
_("Palette to use in the color selector"),
|
||||
default_colors,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
g_object_get (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_object_get (G_OBJECT (gtk_settings_get_default ()),
|
||||
"gtk-color-palette",
|
||||
&palette,
|
||||
NULL);
|
||||
@ -1659,7 +1658,7 @@ gtk_color_selection_class_init (GtkColorSelectionClass *klass)
|
||||
|
||||
change_palette_hook = default_change_palette_func;
|
||||
|
||||
g_signal_connect_data (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_connect_data (G_OBJECT (gtk_settings_get_default ()),
|
||||
"notify::gtk-color-palette",
|
||||
G_CALLBACK (palette_change_notify_class),
|
||||
NULL, NULL, 0);
|
||||
@ -1825,7 +1824,7 @@ gtk_color_selection_init (GtkColorSelection *colorsel)
|
||||
update_palette (colorsel);
|
||||
|
||||
priv->settings_connection =
|
||||
g_signal_connect_data (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_connect_data (G_OBJECT (gtk_settings_get_default ()),
|
||||
"notify::gtk-color-palette",
|
||||
G_CALLBACK (palette_change_notify_instance),
|
||||
colorsel, NULL, 0);
|
||||
@ -1877,7 +1876,7 @@ gtk_color_selection_finalize (GObject *object)
|
||||
|
||||
priv = cselection->private_data;
|
||||
|
||||
g_signal_handler_disconnect (gtk_settings_get_global (),
|
||||
g_signal_handler_disconnect (gtk_settings_get_default (),
|
||||
priv->settings_connection);
|
||||
|
||||
g_free (cselection->private_data);
|
||||
|
@ -2467,7 +2467,7 @@ gtk_entry_draw_cursor (GtkEntry *entry,
|
||||
|
||||
gtk_entry_get_cursor_locations (entry, type, &strong_x, &weak_x);
|
||||
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (gtk_widget_get_settings (widget),
|
||||
"gtk-split-cursor", &split_cursor,
|
||||
NULL);
|
||||
|
||||
@ -2694,7 +2694,7 @@ gtk_entry_move_visually (GtkEntry *entry,
|
||||
gboolean split_cursor;
|
||||
gboolean strong;
|
||||
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (gtk_widget_get_settings (GTK_WIDGET (entry)),
|
||||
"gtk-split-cursor", &split_cursor,
|
||||
NULL);
|
||||
|
||||
@ -3749,7 +3749,7 @@ gtk_entry_drag_data_delete (GtkWidget *widget,
|
||||
static gboolean
|
||||
cursor_blinks (GtkEntry *entry)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_global ();
|
||||
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (entry));
|
||||
gboolean blink;
|
||||
|
||||
if (GTK_WIDGET_HAS_FOCUS (entry) &&
|
||||
@ -3765,7 +3765,7 @@ cursor_blinks (GtkEntry *entry)
|
||||
static gint
|
||||
get_cursor_time (GtkEntry *entry)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_global ();
|
||||
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (entry));
|
||||
gint time;
|
||||
|
||||
g_object_get (G_OBJECT (settings), "gtk-cursor-blink-time", &time, NULL);
|
||||
|
@ -221,6 +221,7 @@ typedef enum
|
||||
GTK_PATH_PRIO_LOWEST = 0,
|
||||
GTK_PATH_PRIO_GTK = 4,
|
||||
GTK_PATH_PRIO_APPLICATION = 8,
|
||||
GTK_PATH_PRIO_THEME = 10,
|
||||
GTK_PATH_PRIO_RC = 12,
|
||||
GTK_PATH_PRIO_HIGHEST = 15,
|
||||
GTK_PATH_PRIO_MASK = 0x0f
|
||||
|
@ -1038,20 +1038,10 @@ find_and_prep_icon_source (GtkIconSet *icon_set,
|
||||
if (source->pixbuf == NULL)
|
||||
{
|
||||
GError *error;
|
||||
gchar *full;
|
||||
|
||||
g_assert (source->filename);
|
||||
source->pixbuf = gdk_pixbuf_new_from_file (source->filename, &error);
|
||||
|
||||
if (g_path_is_absolute (source->filename))
|
||||
full = g_strdup (source->filename);
|
||||
else
|
||||
full = gtk_rc_find_pixmap_in_path (NULL, source->filename);
|
||||
|
||||
error = NULL;
|
||||
source->pixbuf = gdk_pixbuf_new_from_file (full, &error);
|
||||
|
||||
g_free (full);
|
||||
|
||||
if (source->pixbuf == NULL)
|
||||
{
|
||||
/* Remove this icon source so we don't keep trying to
|
||||
@ -1435,19 +1425,15 @@ gtk_icon_source_free (GtkIconSource *source)
|
||||
* @source: a #GtkIconSource
|
||||
* @filename: image file to use
|
||||
*
|
||||
* Sets the name of an image file to use as a base image when creating icon
|
||||
* variants for #GtkIconSet. If the filename is absolute, GTK+ will
|
||||
* attempt to open the exact file given. If the filename is relative,
|
||||
* GTK+ will search for it in the "pixmap path" which can be configured
|
||||
* by users in their gtkrc files or specified as part of a theme's gtkrc
|
||||
* file. See #GtkRcStyle for information on gtkrc files.
|
||||
*
|
||||
* Sets the name of an image file to use as a base image when creating
|
||||
* icon variants for #GtkIconSet. The filename must be absolute.
|
||||
**/
|
||||
void
|
||||
gtk_icon_source_set_filename (GtkIconSource *source,
|
||||
const gchar *filename)
|
||||
gtk_icon_source_set_filename (GtkIconSource *source,
|
||||
const gchar *filename)
|
||||
{
|
||||
g_return_if_fail (source != NULL);
|
||||
g_return_if_fail (filename == NULL || g_path_is_absolute (filename));
|
||||
|
||||
if (source->filename == filename)
|
||||
return;
|
||||
|
@ -1443,7 +1443,7 @@ gtk_menu_key_press (GtkWidget *widget,
|
||||
if (GTK_WIDGET_CLASS (parent_class)->key_press_event (widget, event))
|
||||
return TRUE;
|
||||
|
||||
g_object_get (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_object_get (G_OBJECT (gtk_settings_get_default ()),
|
||||
"gtk-menu-bar-accel",
|
||||
&accel,
|
||||
NULL);
|
||||
|
@ -142,8 +142,7 @@ gtk_menu_bar_class_init (GtkMenuBarClass *class)
|
||||
GTK_TYPE_MENU_DIRECTION_TYPE,
|
||||
GTK_MENU_DIR_CHILD);
|
||||
|
||||
gtk_settings_install_property (gtk_settings_get_global (),
|
||||
g_param_spec_string ("gtk-menu-bar-accel",
|
||||
gtk_settings_install_property (g_param_spec_string ("gtk-menu-bar-accel",
|
||||
_("Menu bar accelerator"),
|
||||
_("Keybinding to activate the menu bar"),
|
||||
"F10",
|
||||
@ -395,7 +394,7 @@ window_key_press_handler (GtkWidget *widget,
|
||||
gchar *accel = NULL;
|
||||
gboolean retval = FALSE;
|
||||
|
||||
g_object_get (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_object_get (G_OBJECT (gtk_widget_get_settings (widget)),
|
||||
"gtk-menu-bar-accel",
|
||||
&accel,
|
||||
NULL);
|
||||
|
1116
gtk/gtkrc.c
1116
gtk/gtkrc.c
File diff suppressed because it is too large
Load Diff
47
gtk/gtkrc.h
47
gtk/gtkrc.h
@ -29,17 +29,17 @@
|
||||
|
||||
|
||||
#include <gtk/gtkstyle.h>
|
||||
#include <gtk/gtkwidget.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/* Forward declaration */
|
||||
typedef struct _GtkIconFactory GtkIconFactory;
|
||||
/* Forward declarations */
|
||||
typedef struct _GtkIconFactory GtkIconFactory;
|
||||
typedef struct _GtkRcContext GtkRcContext;
|
||||
typedef struct _GtkSettings GtkSettings;
|
||||
|
||||
typedef struct _GtkRcStyleClass GtkRcStyleClass;
|
||||
typedef struct _GtkRCContext GtkRcContext;
|
||||
|
||||
#define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ())
|
||||
#define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle))
|
||||
@ -74,7 +74,7 @@ struct _GtkRcStyle
|
||||
|
||||
gint xthickness;
|
||||
gint ythickness;
|
||||
|
||||
|
||||
/*< private >*/
|
||||
GBSearchArray *rc_properties;
|
||||
|
||||
@ -99,8 +99,9 @@ struct _GtkRcStyleClass
|
||||
* of brackets. Returns G_TOKEN_NONE if succesful, otherwise returns
|
||||
* the token it expected but didn't get.
|
||||
*/
|
||||
guint (*parse) (GtkRcStyle *rc_style,
|
||||
GScanner *scanner);
|
||||
guint (*parse) (GtkRcStyle *rc_style,
|
||||
GtkSettings *settings,
|
||||
GScanner *scanner);
|
||||
|
||||
/* Combine RC style data from src into dest. If overriden, this
|
||||
* function should chain to the parent.
|
||||
@ -117,18 +118,30 @@ void _gtk_rc_init (void);
|
||||
void gtk_rc_add_default_file (const gchar *filename);
|
||||
void gtk_rc_set_default_files (gchar **filenames);
|
||||
gchar** gtk_rc_get_default_files (void);
|
||||
GtkStyle* gtk_rc_get_style (GtkWidget *widget);
|
||||
GtkStyle* gtk_rc_get_style_by_paths (GtkSettings *settings,
|
||||
const char *widget_path,
|
||||
const char *class_path,
|
||||
GType type);
|
||||
|
||||
gboolean gtk_rc_reparse_all_for_settings (GtkSettings *settings,
|
||||
gboolean force_load);
|
||||
gchar* gtk_rc_find_pixmap_in_path (GtkSettings *context,
|
||||
GScanner *scanner,
|
||||
const gchar *pixmap_file);
|
||||
|
||||
void gtk_rc_parse (const gchar *filename);
|
||||
void gtk_rc_parse_string (const gchar *rc_string);
|
||||
GtkStyle* gtk_rc_get_style (GtkWidget *widget);
|
||||
|
||||
gboolean gtk_rc_reparse_all (void);
|
||||
void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
void gtk_rc_add_class_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
void gtk_rc_add_class_style (GtkRcStyle *rc_style,
|
||||
const gchar *pattern);
|
||||
#endif /* GTK_DISABLE_DEPRECATED */
|
||||
|
||||
|
||||
GType gtk_rc_style_get_type (void) G_GNUC_CONST;
|
||||
@ -137,8 +150,6 @@ GtkRcStyle* gtk_rc_style_copy (GtkRcStyle *orig);
|
||||
void gtk_rc_style_ref (GtkRcStyle *rc_style);
|
||||
void gtk_rc_style_unref (GtkRcStyle *rc_style);
|
||||
|
||||
gchar* gtk_rc_find_pixmap_in_path (GScanner *scanner,
|
||||
const gchar *pixmap_file);
|
||||
gchar* gtk_rc_find_module_in_path (const gchar *module_file);
|
||||
gchar* gtk_rc_get_theme_dir (void);
|
||||
gchar* gtk_rc_get_module_dir (void);
|
||||
@ -174,6 +185,7 @@ typedef enum {
|
||||
GTK_RC_TOKEN_LOWEST,
|
||||
GTK_RC_TOKEN_GTK,
|
||||
GTK_RC_TOKEN_APPLICATION,
|
||||
GTK_RC_TOKEN_THEME,
|
||||
GTK_RC_TOKEN_RC,
|
||||
GTK_RC_TOKEN_HIGHEST,
|
||||
GTK_RC_TOKEN_ENGINE,
|
||||
@ -212,7 +224,6 @@ const GtkRcProperty* _gtk_rc_style_lookup_rc_property (GtkRcStyle *rc_style,
|
||||
GQuark type_name,
|
||||
GQuark property_name);
|
||||
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
gchar* gtk_win32_get_installation_directory (void);
|
||||
#endif
|
||||
|
@ -17,14 +17,18 @@
|
||||
*/
|
||||
|
||||
#include "gtksettings.h"
|
||||
#include "gtkrc.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkwidget.h"
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
PROP_DOUBLE_CLICK_TIME,
|
||||
PROP_CURSOR_BLINK,
|
||||
PROP_CURSOR_BLINK_TIME,
|
||||
PROP_SPLIT_CURSOR
|
||||
PROP_SPLIT_CURSOR,
|
||||
PROP_THEME_NAME,
|
||||
PROP_KEY_THEME_NAME
|
||||
};
|
||||
|
||||
|
||||
@ -166,6 +170,22 @@ gtk_settings_class_init (GtkSettingsClass *class)
|
||||
G_PARAM_READWRITE),
|
||||
NULL);
|
||||
g_assert (result == PROP_SPLIT_CURSOR);
|
||||
result = settings_install_property_parser (class,
|
||||
g_param_spec_string ("gtk-theme-name",
|
||||
_("Theme Name"),
|
||||
_("Name of theme RC file to load"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE),
|
||||
NULL);
|
||||
g_assert (result == PROP_THEME_NAME);
|
||||
result = settings_install_property_parser (class,
|
||||
g_param_spec_string ("gtk-key-theme-name",
|
||||
_("Key Theme Name"),
|
||||
_("Name of key theme RC file to load"),
|
||||
NULL,
|
||||
G_PARAM_READWRITE),
|
||||
NULL);
|
||||
g_assert (result == PROP_KEY_THEME_NAME);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -207,7 +227,7 @@ gtk_settings_constructor (GType type,
|
||||
}
|
||||
|
||||
GtkSettings*
|
||||
gtk_settings_get_global (void)
|
||||
gtk_settings_get_default (void)
|
||||
{
|
||||
if (!the_singleton)
|
||||
g_object_new (GTK_TYPE_SETTINGS, NULL);
|
||||
@ -294,6 +314,7 @@ gtk_settings_notify (GObject *object,
|
||||
{
|
||||
guint property_id = pspec->param_id;
|
||||
gint double_click_time;
|
||||
gchar *str_value;
|
||||
|
||||
#if 1
|
||||
GValue tmp_value = { 0, };
|
||||
@ -484,29 +505,25 @@ _gtk_rc_property_parser_from_type (GType type)
|
||||
}
|
||||
|
||||
void
|
||||
gtk_settings_install_property (GtkSettings *settings,
|
||||
GParamSpec *pspec)
|
||||
gtk_settings_install_property (GParamSpec *pspec)
|
||||
{
|
||||
GtkRcPropertyParser parser = NULL;
|
||||
|
||||
g_return_if_fail (GTK_IS_SETTINGS (settings));
|
||||
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
||||
|
||||
parser = _gtk_rc_property_parser_from_type (G_PARAM_SPEC_VALUE_TYPE (pspec));
|
||||
|
||||
settings_install_property_parser (GTK_SETTINGS_GET_CLASS (settings), pspec, parser);
|
||||
settings_install_property_parser (gtk_type_class (GTK_TYPE_SETTINGS), pspec, parser);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_settings_install_property_parser (GtkSettings *settings,
|
||||
GParamSpec *pspec,
|
||||
gtk_settings_install_property_parser (GParamSpec *pspec,
|
||||
GtkRcPropertyParser parser)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_SETTINGS (settings));
|
||||
g_return_if_fail (G_IS_PARAM_SPEC (pspec));
|
||||
g_return_if_fail (parser != NULL);
|
||||
|
||||
settings_install_property_parser (GTK_SETTINGS_GET_CLASS (settings), pspec, parser);
|
||||
settings_install_property_parser (gtk_type_class (GTK_TYPE_SETTINGS), pspec, parser);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -884,7 +901,7 @@ gtk_rc_property_parse_border (const GParamSpec *pspec,
|
||||
void
|
||||
_gtk_settings_handle_event (GdkEventSetting *event)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_global ();
|
||||
GtkSettings *settings = gtk_settings_get_default ();
|
||||
|
||||
if (g_object_class_find_property (G_OBJECT_GET_CLASS (settings), event->name))
|
||||
g_object_notify (G_OBJECT (settings), event->name);
|
||||
|
@ -35,7 +35,6 @@ extern "C" {
|
||||
|
||||
|
||||
/* --- typedefs --- */
|
||||
typedef struct _GtkSettings GtkSettings;
|
||||
typedef struct _GtkSettingsClass GtkSettingsClass;
|
||||
typedef struct _GtkSettingsValue GtkSettingsValue;
|
||||
|
||||
@ -47,6 +46,8 @@ struct _GtkSettings
|
||||
|
||||
GData *queued_settings; /* of type GtkSettingsValue* */
|
||||
GValue *property_values;
|
||||
|
||||
GtkRcContext *rc_context;
|
||||
};
|
||||
struct _GtkSettingsClass
|
||||
{
|
||||
@ -69,11 +70,9 @@ struct _GtkSettingsValue
|
||||
|
||||
/* --- functions --- */
|
||||
GType gtk_settings_get_type (void);
|
||||
GtkSettings* gtk_settings_get_global (void); /* singleton */
|
||||
void gtk_settings_install_property (GtkSettings *settings,
|
||||
GParamSpec *pspec);
|
||||
void gtk_settings_install_property_parser (GtkSettings *settings,
|
||||
GParamSpec *pspec,
|
||||
GtkSettings* gtk_settings_get_default (void);
|
||||
void gtk_settings_install_property (GParamSpec *pspec);
|
||||
void gtk_settings_install_property_parser (GParamSpec *pspec,
|
||||
GtkRcPropertyParser parser);
|
||||
|
||||
/* --- precoded parsing functions --- */
|
||||
|
@ -3663,7 +3663,7 @@ gtk_text_view_forall (GtkContainer *container,
|
||||
static gboolean
|
||||
cursor_blinks (GtkTextView *text_view)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_global ();
|
||||
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
|
||||
gboolean blink;
|
||||
|
||||
g_object_get (G_OBJECT (settings), "gtk-cursor-blink", &blink, NULL);
|
||||
@ -3673,7 +3673,7 @@ cursor_blinks (GtkTextView *text_view)
|
||||
static gint
|
||||
get_cursor_time (GtkTextView *text_view)
|
||||
{
|
||||
GtkSettings *settings = gtk_settings_get_global ();
|
||||
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
|
||||
gint time;
|
||||
|
||||
g_object_get (G_OBJECT (settings), "gtk-cursor-blink-time", &time, NULL);
|
||||
@ -4352,8 +4352,9 @@ gtk_text_view_check_keymap_direction (GtkTextView *text_view)
|
||||
{
|
||||
gboolean split_cursor;
|
||||
GtkTextDirection new_dir;
|
||||
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
|
||||
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (G_OBJECT (settings),
|
||||
"gtk-split-cursor", &split_cursor,
|
||||
NULL);
|
||||
if (split_cursor)
|
||||
|
@ -283,16 +283,14 @@ gtk_toolbar_class_init (GtkToolbarClass *class)
|
||||
GTK_SHADOW_OUT,
|
||||
G_PARAM_READABLE));
|
||||
|
||||
gtk_settings_install_property (gtk_settings_get_global (),
|
||||
g_param_spec_enum ("gtk-toolbar-style",
|
||||
gtk_settings_install_property (g_param_spec_enum ("gtk-toolbar-style",
|
||||
_("Toolbar style"),
|
||||
_("Whether default toolbars have text only, text and icons, icons only, etc."),
|
||||
GTK_TYPE_TOOLBAR_STYLE,
|
||||
GTK_TOOLBAR_BOTH,
|
||||
G_PARAM_READWRITE));
|
||||
|
||||
gtk_settings_install_property (gtk_settings_get_global (),
|
||||
g_param_spec_enum ("gtk-toolbar-icon-size",
|
||||
gtk_settings_install_property (g_param_spec_enum ("gtk-toolbar-icon-size",
|
||||
_("Toolbar icon size"),
|
||||
_("Size of icons in default toolbars"),
|
||||
GTK_TYPE_ICON_SIZE,
|
||||
@ -350,7 +348,7 @@ gtk_toolbar_init (GtkToolbar *toolbar)
|
||||
|
||||
toolbar->style_set = FALSE;
|
||||
toolbar->icon_size_set = FALSE;
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-toolbar-icon-size",
|
||||
&toolbar->icon_size,
|
||||
"gtk-toolbar-style",
|
||||
@ -358,13 +356,13 @@ gtk_toolbar_init (GtkToolbar *toolbar)
|
||||
NULL);
|
||||
|
||||
toolbar->style_set_connection =
|
||||
g_signal_connect (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_connect (G_OBJECT (gtk_settings_get_default ()),
|
||||
"notify::gtk-toolbar-style",
|
||||
G_CALLBACK (style_change_notify),
|
||||
toolbar);
|
||||
|
||||
toolbar->icon_size_connection =
|
||||
g_signal_connect (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_connect (G_OBJECT (gtk_settings_get_default ()),
|
||||
"notify::gtk-toolbar-icon-size",
|
||||
G_CALLBACK (icon_size_change_notify),
|
||||
toolbar);
|
||||
@ -377,9 +375,9 @@ gtk_toolbar_finalize (GObject *object)
|
||||
|
||||
toolbar = GTK_TOOLBAR (object);
|
||||
|
||||
g_signal_handler_disconnect (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_handler_disconnect (G_OBJECT (gtk_settings_get_default ()),
|
||||
toolbar->style_set_connection);
|
||||
g_signal_handler_disconnect (G_OBJECT (gtk_settings_get_global ()),
|
||||
g_signal_handler_disconnect (G_OBJECT (gtk_settings_get_default ()),
|
||||
toolbar->icon_size_connection);
|
||||
|
||||
G_OBJECT_CLASS (parent_class)->finalize (object);
|
||||
@ -1087,7 +1085,7 @@ gtk_toolbar_unset_icon_size (GtkToolbar *toolbar)
|
||||
|
||||
if (toolbar->icon_size_set)
|
||||
{
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-toolbar-icon-size",
|
||||
&size, NULL);
|
||||
|
||||
@ -1542,7 +1540,7 @@ gtk_toolbar_unset_style (GtkToolbar *toolbar)
|
||||
|
||||
if (toolbar->style_set)
|
||||
{
|
||||
g_object_get (gtk_settings_get_global (),
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-toolbar-style",
|
||||
&style,
|
||||
NULL);
|
||||
|
184
gtk/gtkwidget.c
184
gtk/gtkwidget.c
@ -197,12 +197,12 @@ static gboolean gtk_widget_real_focus_out_event (GtkWidget *widget,
|
||||
static gboolean gtk_widget_real_focus (GtkWidget *widget,
|
||||
GtkDirectionType direction);
|
||||
static GdkColormap* gtk_widget_peek_colormap (void);
|
||||
static GtkStyle* gtk_widget_peek_style (void);
|
||||
static PangoContext* gtk_widget_peek_pango_context (GtkWidget *widget);
|
||||
static void gtk_widget_reparent_container_child (GtkWidget *widget,
|
||||
gpointer client_data);
|
||||
static void gtk_widget_propagate_state (GtkWidget *widget,
|
||||
GtkStateData *data);
|
||||
static void gtk_widget_reset_rc_style (GtkWidget *widget);
|
||||
static void gtk_widget_set_style_internal (GtkWidget *widget,
|
||||
GtkStyle *style,
|
||||
gboolean initial_emission);
|
||||
@ -227,7 +227,6 @@ static GMemChunk *aux_info_mem_chunk = NULL;
|
||||
static GdkColormap *default_colormap = NULL;
|
||||
static GtkStyle *gtk_default_style = NULL;
|
||||
static GSList *colormap_stack = NULL;
|
||||
static GSList *style_stack = NULL;
|
||||
static guint composite_child_stack = 0;
|
||||
static GtkTextDirection gtk_default_direction = GTK_TEXT_DIR_LTR;
|
||||
static GParamSpecPool *style_property_spec_pool = NULL;
|
||||
@ -237,7 +236,6 @@ static GQuark quark_aux_info = 0;
|
||||
static GQuark quark_event_mask = 0;
|
||||
static GQuark quark_extension_event_mode = 0;
|
||||
static GQuark quark_parent_window = 0;
|
||||
static GQuark quark_saved_default_style = 0;
|
||||
static GQuark quark_shape_info = 0;
|
||||
static GQuark quark_colormap = 0;
|
||||
static GQuark quark_pango_context = 0;
|
||||
@ -307,7 +305,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
|
||||
quark_event_mask = g_quark_from_static_string ("gtk-event-mask");
|
||||
quark_extension_event_mode = g_quark_from_static_string ("gtk-extension-event-mode");
|
||||
quark_parent_window = g_quark_from_static_string ("gtk-parent-window");
|
||||
quark_saved_default_style = g_quark_from_static_string ("gtk-saved-default-style");
|
||||
quark_shape_info = g_quark_from_static_string ("gtk-shape-info");
|
||||
quark_colormap = g_quark_from_static_string ("gtk-colormap");
|
||||
quark_pango_context = g_quark_from_static_string ("gtk-pango-context");
|
||||
@ -1309,7 +1306,7 @@ gtk_widget_init (GtkWidget *widget)
|
||||
(composite_child_stack ? GTK_COMPOSITE_CHILD : 0) |
|
||||
GTK_DOUBLE_BUFFERED);
|
||||
|
||||
widget->style = gtk_widget_peek_style ();
|
||||
widget->style = gtk_widget_get_default_style ();
|
||||
gtk_style_ref (widget->style);
|
||||
|
||||
colormap = gtk_widget_peek_colormap ();
|
||||
@ -3239,7 +3236,7 @@ gtk_widget_set_name (GtkWidget *widget,
|
||||
widget->name = g_strdup (name);
|
||||
|
||||
if (GTK_WIDGET_RC_STYLE (widget))
|
||||
gtk_widget_set_rc_style (widget);
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
|
||||
g_object_notify (G_OBJECT (widget), "name");
|
||||
}
|
||||
@ -3486,7 +3483,8 @@ gtk_widget_get_parent (GtkWidget *widget)
|
||||
/**
|
||||
* gtk_widget_set_style:
|
||||
* @widget: a #GtkWidget
|
||||
* @style: a #GtkStyle
|
||||
* @style: a #GtkStyle, or %NULL to remove the effect of a previous
|
||||
* gtk_widget_set_style and go back to the default style
|
||||
*
|
||||
* Sets the #GtkStyle for a widget (widget->style). You probably don't
|
||||
* want to use this function; it interacts badly with themes, because
|
||||
@ -3498,26 +3496,25 @@ void
|
||||
gtk_widget_set_style (GtkWidget *widget,
|
||||
GtkStyle *style)
|
||||
{
|
||||
GtkStyle *default_style;
|
||||
gboolean initial_emission;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
g_return_if_fail (style != NULL);
|
||||
|
||||
initial_emission = !GTK_WIDGET_RC_STYLE (widget) && !GTK_WIDGET_USER_STYLE (widget);
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS (widget, GTK_RC_STYLE);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_USER_STYLE);
|
||||
|
||||
default_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
if (!default_style)
|
||||
if (style)
|
||||
{
|
||||
gtk_style_ref (widget->style);
|
||||
gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_saved_default_style, widget->style);
|
||||
}
|
||||
gboolean initial_emission;
|
||||
|
||||
gtk_widget_set_style_internal (widget, style, initial_emission);
|
||||
initial_emission = !GTK_WIDGET_RC_STYLE (widget) && !GTK_WIDGET_USER_STYLE (widget);
|
||||
|
||||
GTK_WIDGET_UNSET_FLAGS (widget, GTK_RC_STYLE);
|
||||
GTK_PRIVATE_SET_FLAG (widget, GTK_USER_STYLE);
|
||||
|
||||
gtk_widget_set_style_internal (widget, style, initial_emission);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (GTK_WIDGET_USER_STYLE (widget))
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3538,19 +3535,15 @@ gtk_widget_ensure_style (GtkWidget *widget)
|
||||
|
||||
if (!GTK_WIDGET_USER_STYLE (widget) &&
|
||||
!GTK_WIDGET_RC_STYLE (widget))
|
||||
gtk_widget_set_rc_style (widget);
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_set_rc_style:
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
*
|
||||
/* Look up the RC style for this widget, unsetting any user style that
|
||||
* may be in effect currently
|
||||
**/
|
||||
void
|
||||
gtk_widget_set_rc_style (GtkWidget *widget)
|
||||
static void
|
||||
gtk_widget_reset_rc_style (GtkWidget *widget)
|
||||
{
|
||||
GtkStyle *saved_style;
|
||||
GtkStyle *new_style;
|
||||
gboolean initial_emission;
|
||||
|
||||
@ -3562,52 +3555,12 @@ gtk_widget_set_rc_style (GtkWidget *widget)
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
|
||||
GTK_WIDGET_SET_FLAGS (widget, GTK_RC_STYLE);
|
||||
|
||||
saved_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
new_style = gtk_rc_get_style (widget);
|
||||
if (new_style)
|
||||
{
|
||||
if (!saved_style)
|
||||
{
|
||||
gtk_style_ref (widget->style);
|
||||
gtk_object_set_data_by_id (GTK_OBJECT (widget), quark_saved_default_style, widget->style);
|
||||
}
|
||||
gtk_widget_set_style_internal (widget, new_style, initial_emission);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (saved_style)
|
||||
{
|
||||
g_assert (initial_emission == FALSE); /* FIXME: remove this line */
|
||||
if (!new_style)
|
||||
new_style = gtk_widget_get_default_style ();
|
||||
|
||||
gtk_object_remove_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
gtk_widget_set_style_internal (widget, saved_style, initial_emission);
|
||||
gtk_style_unref (saved_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (initial_emission)
|
||||
gtk_widget_set_style_internal (widget, widget->style, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_restore_default_style (GtkWidget *widget)
|
||||
{
|
||||
GtkStyle *default_style;
|
||||
|
||||
g_return_if_fail (widget != NULL);
|
||||
g_return_if_fail (GTK_IS_WIDGET (widget));
|
||||
|
||||
GTK_PRIVATE_UNSET_FLAG (widget, GTK_USER_STYLE);
|
||||
|
||||
default_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
if (default_style)
|
||||
{
|
||||
gtk_object_remove_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
gtk_widget_set_style_internal (widget, default_style, FALSE);
|
||||
gtk_style_unref (default_style);
|
||||
}
|
||||
if (initial_emission || new_style != widget->style)
|
||||
gtk_widget_set_style_internal (widget, widget->style, TRUE);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3671,7 +3624,7 @@ gtk_widget_modify_style (GtkWidget *widget,
|
||||
*/
|
||||
|
||||
if (GTK_WIDGET_RC_STYLE (widget))
|
||||
gtk_widget_set_rc_style (widget);
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -3950,7 +3903,7 @@ gtk_widget_set_style_recurse (GtkWidget *widget,
|
||||
gpointer client_data)
|
||||
{
|
||||
if (GTK_WIDGET_RC_STYLE (widget))
|
||||
gtk_widget_set_rc_style (widget);
|
||||
gtk_widget_reset_rc_style (widget);
|
||||
|
||||
if (GTK_IS_CONTAINER (widget))
|
||||
gtk_container_forall (GTK_CONTAINER (widget),
|
||||
@ -3995,19 +3948,6 @@ gtk_widget_reset_rc_styles (GtkWidget *widget)
|
||||
gtk_widget_set_style_recurse (widget, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_set_default_style (GtkStyle *style)
|
||||
{
|
||||
if (style != gtk_default_style)
|
||||
{
|
||||
if (gtk_default_style)
|
||||
gtk_style_unref (gtk_default_style);
|
||||
gtk_default_style = style;
|
||||
if (gtk_default_style)
|
||||
gtk_style_ref (gtk_default_style);
|
||||
}
|
||||
}
|
||||
|
||||
GtkStyle*
|
||||
gtk_widget_get_default_style (void)
|
||||
{
|
||||
@ -4020,38 +3960,6 @@ gtk_widget_get_default_style (void)
|
||||
return gtk_default_style;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_push_style (GtkStyle *style)
|
||||
{
|
||||
g_return_if_fail (style != NULL);
|
||||
|
||||
gtk_style_ref (style);
|
||||
style_stack = g_slist_prepend (style_stack, style);
|
||||
}
|
||||
|
||||
static GtkStyle*
|
||||
gtk_widget_peek_style (void)
|
||||
{
|
||||
if (style_stack)
|
||||
return (GtkStyle*) style_stack->data;
|
||||
else
|
||||
return gtk_widget_get_default_style ();
|
||||
}
|
||||
|
||||
void
|
||||
gtk_widget_pop_style (void)
|
||||
{
|
||||
GSList *tmp;
|
||||
|
||||
if (style_stack)
|
||||
{
|
||||
tmp = style_stack;
|
||||
style_stack = style_stack->next;
|
||||
gtk_style_unref ((GtkStyle*) tmp->data);
|
||||
g_slist_free_1 (tmp);
|
||||
}
|
||||
}
|
||||
|
||||
static PangoContext *
|
||||
gtk_widget_peek_pango_context (GtkWidget *widget)
|
||||
{
|
||||
@ -4717,6 +4625,20 @@ gtk_widget_get_visual (GtkWidget *widget)
|
||||
return gdk_colormap_get_visual (gtk_widget_get_colormap (widget));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_get_settings:
|
||||
* @widget: a #GtkWidget
|
||||
*
|
||||
* Get the settings object holding the settings (global property
|
||||
* settings, RC file information, etc) used for this widget.
|
||||
*
|
||||
* Return value: the relevant #GtkSettings object
|
||||
**/
|
||||
GtkSettings*
|
||||
gtk_widget_get_settings (GtkWidget *widget)
|
||||
{
|
||||
return gtk_settings_get_default ();
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_widget_set_colormap:
|
||||
@ -5161,7 +5083,6 @@ static void
|
||||
gtk_widget_real_destroy (GtkObject *object)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkStyle *saved_style;
|
||||
|
||||
/* gtk_object_destroy() will already hold a refcount on object
|
||||
*/
|
||||
@ -5170,15 +5091,8 @@ gtk_widget_real_destroy (GtkObject *object)
|
||||
gtk_grab_remove (widget);
|
||||
gtk_selection_remove_all (widget);
|
||||
|
||||
saved_style = gtk_object_get_data_by_id (object, quark_saved_default_style);
|
||||
if (saved_style)
|
||||
{
|
||||
gtk_style_unref (saved_style);
|
||||
gtk_object_remove_data_by_id (object, quark_saved_default_style);
|
||||
}
|
||||
|
||||
gtk_style_unref (widget->style);
|
||||
widget->style = gtk_widget_peek_style ();
|
||||
widget->style = gtk_widget_get_default_style ();
|
||||
gtk_style_ref (widget->style);
|
||||
|
||||
GTK_OBJECT_CLASS (parent_class)->destroy (object);
|
||||
@ -5191,19 +5105,11 @@ gtk_widget_finalize (GObject *object)
|
||||
GtkWidgetAuxInfo *aux_info;
|
||||
gint *events;
|
||||
GdkExtensionMode *mode;
|
||||
GtkStyle *saved_style;
|
||||
GtkAccessible *accessible;
|
||||
|
||||
gtk_grab_remove (widget);
|
||||
gtk_selection_remove_all (widget);
|
||||
|
||||
saved_style = gtk_object_get_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
if (saved_style)
|
||||
{
|
||||
gtk_style_unref (saved_style);
|
||||
gtk_object_remove_data_by_id (GTK_OBJECT (widget), quark_saved_default_style);
|
||||
}
|
||||
|
||||
gtk_style_unref (widget->style);
|
||||
widget->style = NULL;
|
||||
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <gtk/gtkobject.h>
|
||||
#include <gtk/gtkadjustment.h>
|
||||
#include <gtk/gtkstyle.h>
|
||||
#include <gtk/gtksettings.h>
|
||||
#include <atk/atkobject.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -579,6 +580,8 @@ GtkWidget* gtk_widget_get_ancestor (GtkWidget *widget,
|
||||
GdkColormap* gtk_widget_get_colormap (GtkWidget *widget);
|
||||
GdkVisual* gtk_widget_get_visual (GtkWidget *widget);
|
||||
|
||||
GtkSettings* gtk_widget_get_settings (GtkWidget *widget);
|
||||
|
||||
|
||||
/* Accessibility support */
|
||||
AtkObject* gtk_widget_get_accessible (GtkWidget *widget);
|
||||
@ -608,10 +611,8 @@ gboolean gtk_widget_hide_on_delete (GtkWidget *widget);
|
||||
*/
|
||||
void gtk_widget_set_style (GtkWidget *widget,
|
||||
GtkStyle *style);
|
||||
void gtk_widget_set_rc_style (GtkWidget *widget);
|
||||
void gtk_widget_ensure_style (GtkWidget *widget);
|
||||
GtkStyle* gtk_widget_get_style (GtkWidget *widget);
|
||||
void gtk_widget_restore_default_style (GtkWidget *widget);
|
||||
|
||||
void gtk_widget_modify_style (GtkWidget *widget,
|
||||
GtkRcStyle *style);
|
||||
@ -631,6 +632,11 @@ void gtk_widget_modify_base (GtkWidget *widget,
|
||||
void gtk_widget_modify_font (GtkWidget *widget,
|
||||
PangoFontDescription *font_desc);
|
||||
|
||||
#ifndef GTK_DISABLE_DEPRECATED
|
||||
#define gtk_widget_set_rc_style(widget) (gtk_widget_set_style (widget, NULL))
|
||||
#define gtk_widget_restore_default_style(widget) (gtk_widget_set_style (widget, NULL))
|
||||
#endif
|
||||
|
||||
PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
|
||||
PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
|
||||
PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
|
||||
@ -655,11 +661,9 @@ void gtk_widget_reset_rc_styles (GtkWidget *widget);
|
||||
* This will override the values that got set by the
|
||||
* gtk_widget_set_default_* () functions.
|
||||
*/
|
||||
void gtk_widget_push_style (GtkStyle *style);
|
||||
void gtk_widget_push_colormap (GdkColormap *cmap);
|
||||
void gtk_widget_push_composite_child (void);
|
||||
void gtk_widget_pop_composite_child (void);
|
||||
void gtk_widget_pop_style (void);
|
||||
void gtk_widget_pop_colormap (void);
|
||||
|
||||
/* widget style properties
|
||||
|
@ -2524,29 +2524,7 @@ gtk_window_read_rcfiles (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
if (gtk_rc_reparse_all ())
|
||||
{
|
||||
/* If the above returned true, some of our RC files are out
|
||||
* of date, so we need to reset all our widgets. Our other
|
||||
* toplevel windows will also get the message, but by
|
||||
* then, the RC file will up to date, so we have to tell
|
||||
* them now. Also, we have to invalidate cached icons in
|
||||
* icon sets so they get re-rendered.
|
||||
*/
|
||||
GList *list, *toplevels;
|
||||
|
||||
_gtk_icon_set_invalidate_caches ();
|
||||
|
||||
toplevels = gtk_window_list_toplevels ();
|
||||
g_list_foreach (toplevels, (GFunc)g_object_ref, NULL);
|
||||
|
||||
for (list = toplevels; list; list = list->next)
|
||||
{
|
||||
gtk_widget_reset_rc_styles (list->data);
|
||||
gtk_widget_unref (list->data);
|
||||
}
|
||||
g_list_free (toplevels);
|
||||
}
|
||||
gtk_rc_reparse_all ();
|
||||
}
|
||||
|
||||
static gint
|
||||
|
@ -9882,28 +9882,6 @@ create_idle_test (void)
|
||||
* rc file test
|
||||
*/
|
||||
|
||||
void
|
||||
reload_rc_file (void)
|
||||
{
|
||||
GList *toplevels;
|
||||
|
||||
if (gtk_rc_reparse_all ())
|
||||
{
|
||||
toplevels = gdk_window_get_toplevels();
|
||||
while (toplevels)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
gdk_window_get_user_data (toplevels->data, (gpointer *)&widget);
|
||||
|
||||
if (widget)
|
||||
gtk_widget_reset_rc_styles (widget);
|
||||
|
||||
toplevels = toplevels->next;
|
||||
}
|
||||
g_list_free (toplevels);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
reload_all_rc_files (void)
|
||||
{
|
||||
@ -9941,7 +9919,7 @@ create_rc_file (void)
|
||||
|
||||
button = gtk_button_new_with_label ("Reload");
|
||||
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
||||
GTK_SIGNAL_FUNC(reload_rc_file), NULL);
|
||||
GTK_SIGNAL_FUNC(gtk_rc_reparse_all), NULL);
|
||||
GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT);
|
||||
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->action_area),
|
||||
button, TRUE, TRUE, 0);
|
||||
|
@ -26,8 +26,6 @@ double-click_timeout = 42
|
||||
bell-duration = 39
|
||||
bell_duration = 40
|
||||
|
||||
pixmap_path "."
|
||||
|
||||
style "global-style-properties"
|
||||
{
|
||||
# xthickness = 20
|
||||
|
Loading…
Reference in New Issue
Block a user