Compare commits
271 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0542d5461f | |||
| 28033a25dd | |||
| 536e38aef6 | |||
| 867f70586c | |||
| 8e461c2ecd | |||
| e3930f2342 | |||
| 24f5412b3d | |||
| 36200036db | |||
| 67c62fff13 | |||
| 55f8bb5279 | |||
| 736d1bccf6 | |||
| ef1dbc7c36 | |||
| f11013e80a | |||
| d40d532067 | |||
| 64d8034164 | |||
| d9357402ed | |||
| 6702974e32 | |||
| 18536fc044 | |||
| fa2f5eee64 | |||
| b70bac8b76 | |||
| b786ccc6d9 | |||
| af7c38c60c | |||
| 943de24211 | |||
| db6d6fcc84 | |||
| 941851fc86 | |||
| e8659679cd | |||
| 693581250e | |||
| ceb866dfe6 | |||
| 788f1a0934 | |||
| 6b33ee9c53 | |||
| 239c631ad3 | |||
| 4498ff314e | |||
| 87b351e6e6 | |||
| 1d805139db | |||
| f204473ee0 | |||
| 2ab65ef771 | |||
| da7a4089fe | |||
| 41486895d5 | |||
| 0862afaded | |||
| fb643c1c12 | |||
| df25349d63 | |||
| 9aac4dffc5 | |||
| 4f9a8e6b3d | |||
| 42dc0ea0fd | |||
| 08ac1504d2 | |||
| b8e58015eb | |||
| 94b80cc774 | |||
| 5ca35bd5dd | |||
| 932794e105 | |||
| 324ff12553 | |||
| 45b4fb02b1 | |||
| fbdb81bbdf | |||
| 840f09bdc8 | |||
| b05ee6aa29 | |||
| 73c436f43e | |||
| c627b22126 | |||
| e677cee28f | |||
| 2927383b5f | |||
| 2d9454363f | |||
| eb7bf0a2f4 | |||
| 4f6e1fdf16 | |||
| ddceddaa84 | |||
| da09447914 | |||
| d0af25f12c | |||
| 6e3d687386 | |||
| 6333cd8e83 | |||
| 8d28e2d8e9 | |||
| e5948f5713 | |||
| d967500c92 | |||
| 4be82195e4 | |||
| 455a0ecc1c | |||
| 2d5ad5f54e | |||
| 352c7f5120 | |||
| c3f3a82db9 | |||
| b55724e3a7 | |||
| f2e05e2b41 | |||
| bfbb9a58ae | |||
| 870657d57b | |||
| 4bc264a514 | |||
| 18fdc975be | |||
| ed5d7fed89 | |||
| 2f8c2a3244 | |||
| 5671a869c2 | |||
| f9b2edff39 | |||
| 53262cf7a6 | |||
| 6d3b4d9382 | |||
| d3143779d2 | |||
| 43fc428cf0 | |||
| 70ba973d1d | |||
| fd6ea42319 | |||
| 0e0ee480d3 | |||
| 78d0ef1d0b | |||
| 14c8e33ab9 | |||
| c08efb2b32 | |||
| c98ee1ec39 | |||
| 4366f80aab | |||
| 15570dd63d | |||
| 10c47c0226 | |||
| 0a1a2ac148 | |||
| aa989a637a | |||
| 50a09957a4 | |||
| e57ecafb6b | |||
| b7743430aa | |||
| 77c0f9d8e6 | |||
| 872097603f | |||
| 5e01a05b30 | |||
| a08eb4d58a | |||
| 8449e05865 | |||
| b0f3aa82b7 | |||
| 4950f68a87 | |||
| 5f20d909e6 | |||
| c59e8de533 | |||
| e8f2eeac92 | |||
| aae2bf91cb | |||
| 10c3a66e40 | |||
| 42fc6ab5d3 | |||
| c8de9abe98 | |||
| e60c9219f1 | |||
| 1c4158a649 | |||
| 55d65571f3 | |||
| 77912a65e2 | |||
| 8a40d8fe2a | |||
| c94002f8c0 | |||
| f4438a1ffc | |||
| 3563d11fc6 | |||
| 7b950944b0 | |||
| ffeef28dbc | |||
| 0d9a45d460 | |||
| 947fed0961 | |||
| ba88174614 | |||
| 598f86eaf3 | |||
| 3cb6ae3df3 | |||
| bd31bd6d63 | |||
| e3f407a71d | |||
| 1a213679bd | |||
| e063a0fdf1 | |||
| cff4718e91 | |||
| ffa42cb5bb | |||
| f9db800713 | |||
| 178e072e8a | |||
| b42a4e2276 | |||
| 5e59033eb3 | |||
| 58021c9e98 | |||
| e9dc0e391d | |||
| 9876fc4f17 | |||
| aa534812f5 | |||
| 959bfbb66e | |||
| debe81b1ea | |||
| cdadbb069f | |||
| 9ebeb4e68a | |||
| 8bdc2aa228 | |||
| 075667e927 | |||
| a46368dede | |||
| 1beb9db7b0 | |||
| 5830363787 | |||
| 7f870abf17 | |||
| 7501f9770f | |||
| 8bdff7a564 | |||
| 1ef057f983 | |||
| 756ebea036 | |||
| dd6931d1ba | |||
| c3148a81d2 | |||
| aba0c5cc3b | |||
| f55fe7e20b | |||
| 035e55d1ab | |||
| f48b30c13a | |||
| 02bc589583 | |||
| 1d6e896fef | |||
| 62f5414742 | |||
| be1bde9111 | |||
| 48ff2fc7ed | |||
| 9f6067a804 | |||
| c8f2328337 | |||
| dbbdefe4e0 | |||
| dfea266e1f | |||
| a1f6887f17 | |||
| 8796fe6d1c | |||
| 8710d97945 | |||
| 9c6e560819 | |||
| ea3a750f13 | |||
| 94e3d7faf1 | |||
| 1cee5ff0dd | |||
| 0306278145 | |||
| 4067a45aff | |||
| 625f8a6dd3 | |||
| 0bfbf39306 | |||
| f39f574914 | |||
| 281c592ea9 | |||
| 86ecf54139 | |||
| 2e287576b4 | |||
| 762e2d9322 | |||
| fd73c1f8d9 | |||
| 1e08fe8646 | |||
| 6821a8f7b2 | |||
| 5e7949c47b | |||
| ba96c34787 | |||
| 12dec5279e | |||
| e9dbfc0e06 | |||
| 0ccb7db245 | |||
| ccaf1c2c67 | |||
| ce56248930 | |||
| 016647edb1 | |||
| a68e76e058 | |||
| 67302c5ee0 | |||
| 16677bb85a | |||
| c13efbf8b0 | |||
| 73fe9a2acf | |||
| b1ad5c8abc | |||
| b41215bdea | |||
| 738b453c66 | |||
| 9c9d82f1a9 | |||
| bae55eaa80 | |||
| beb02a5b4b | |||
| 840855d401 | |||
| c9d035bde3 | |||
| 128437cc76 | |||
| e903ff8f86 | |||
| 21cf5a7e00 | |||
| 3338f6cb5b | |||
| 249d2a8030 | |||
| dc85125737 | |||
| 11825afc3e | |||
| 99e194e7cc | |||
| 63c75a2384 | |||
| 0eb09ac0f2 | |||
| f6952ceb82 | |||
| 237e984a52 | |||
| 41f29032d2 | |||
| 019bb37dd3 | |||
| ca0662dba4 | |||
| 5aff66f391 | |||
| 6245362a52 | |||
| 2b7ebd93f2 | |||
| b5495cd7da | |||
| bec6b260b4 | |||
| c51157d437 | |||
| 4e42bd055d | |||
| f67273c579 | |||
| 5a497e9fb8 | |||
| 288ed1f920 | |||
| 852d4d618c | |||
| 42da600eb1 | |||
| 67fec32d27 | |||
| ad22a1faf6 | |||
| ef027c93d4 | |||
| 247bc3ad69 | |||
| aa81b0db2c | |||
| c2032dec6d | |||
| f8c81ad788 | |||
| 488e124f6a | |||
| f0a211a1df | |||
| e5b88f1bdd | |||
| 7151b1a28a | |||
| f75498d8e1 | |||
| eda0d9ba10 | |||
| 15fe3038be | |||
| 9d1b576af6 | |||
| 2ad31feaaa | |||
| 2216a6f658 | |||
| fa2ed6b8a2 | |||
| 4c9db15212 | |||
| 5e55bf1d53 | |||
| e5de18cbf9 | |||
| 0f36b16733 | |||
| 7c6454246e | |||
| a021b72c71 | |||
| 6b3416a2d7 | |||
| 17760bd2eb | |||
| 97f49c681b | |||
| 6fb66261ca | |||
| 3b7e390484 |
@@ -1,101 +1,90 @@
|
||||
Overview of Changes in GTK+ 3.6.5
|
||||
Overview of Changes in GTK+ 3.7.2
|
||||
=================================
|
||||
|
||||
* Bug fixes:
|
||||
669808 fullscreen/unscreen was broken for Quartz on OS X
|
||||
672271 File chooser seems over-enthusiastic about using sub...
|
||||
687066 gtk 3.6.1 fails to build for win32
|
||||
688534 gdk 3.6.2 does not build with mesa 9.0.1
|
||||
691426 get_current_desktop does not interpret property data...
|
||||
691515 Insufficient checks for EWMH support
|
||||
691572 Touch: strengthen synthesized touch crossing events...
|
||||
694742 Fix possible memory leak when GlobalAlloc() fails
|
||||
694755 When clicking Activities, sometimes gnome-shell cras...
|
||||
695278 Avoid passing a NULL title to setTitle
|
||||
695312 Initial 'text' set in the non-numeric-only GtkSpinBu...
|
||||
696171 GtkAssistant highlighted font unreadable
|
||||
696202 Add GtkSpinner animation back to Win32 theme
|
||||
win32: add more width to the slider to not cut it wh...
|
||||
win32: add margin to scale trough
|
||||
win32: set color for scale marks
|
||||
win32: scale slider with marks was off by 2 pixels
|
||||
win32: handle again gtk-font-name
|
||||
* Theming:
|
||||
- Improve touch text handle theming
|
||||
- Always draw background of menuitems
|
||||
|
||||
* Geometry management
|
||||
- Size groups now handle height-for-width
|
||||
- Fix corner cases in label size allocation
|
||||
|
||||
* Accessibility
|
||||
- Make entry icons accessible
|
||||
|
||||
* Filechooser
|
||||
- Don't add duplicate bookmarks
|
||||
- Remember sidebar width
|
||||
|
||||
* Wayland: Build against wayland-client 1.0
|
||||
|
||||
* Bugs fixed:
|
||||
524295 remember the file chooser side pane's position
|
||||
577806 gtk_file_chooser_add_shortcut_folder adds duplicates...
|
||||
677609 GtkSizeGroup regression in GTK+ 3.3.20
|
||||
683896 Clean up global resources when the display is closed
|
||||
686021 spinner animation should not be subject to enable-an...
|
||||
686347 Clickable icons are not accessible as children of te...
|
||||
687059 icon-theme: support loading symbolic GFileIcons from...
|
||||
687196 filesystemmodel: invalidate nodes on file remove
|
||||
687467 Commit "Implement proper cross-fades for gradients" ...
|
||||
687842 Support partially transparent widgets
|
||||
687872 Segfault when attempting to get character extents fo...
|
||||
687977 icon-theme: Add some preconditions for NULL arguments
|
||||
|
||||
* Translation updates:
|
||||
Brazlian Portuguese
|
||||
Catalan
|
||||
Czech
|
||||
French
|
||||
Assamese
|
||||
Brazilian Portuguese
|
||||
Estonian
|
||||
Galician
|
||||
German
|
||||
Hungarian
|
||||
Greek
|
||||
Gujarati
|
||||
Indonesian
|
||||
Interlingua
|
||||
Latvian
|
||||
Lithuanian
|
||||
Polish
|
||||
Marathi
|
||||
Norwegian bokmål
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.4
|
||||
=================================
|
||||
|
||||
* Bug fixes:
|
||||
691186 stylecontext: Make font hack not crash
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.3
|
||||
=================================
|
||||
|
||||
* The Wayland backend works with Wayland 1.0.0 now
|
||||
|
||||
|
||||
* Bug fixes:
|
||||
132333 Can't add a palette to the dialog of a color button
|
||||
371034 Doc for gtk_file_chooser_get_filename: Is the resulting...
|
||||
548793 funny pattern for iterating GtkTreeModel
|
||||
577806 gtk_file_chooser_add_shortcut_folder adds duplicates of...
|
||||
626499 GtkClipboard unnotified on change of OS X pasteboard owner
|
||||
668239 texts disappear when notebook switch page at zh_CN locate!
|
||||
672193 windows (including menus) shown multiple times don't ge...
|
||||
677339 GTK+ 3 documentation wrong about GtkWidget scroll-event...
|
||||
683072 Print dialog shows cryptic status message and displays ...
|
||||
687065 InstallableOptions is not filtered in cups backend
|
||||
687816 GtkTreeView does not draw correctly since commit aaedc7b6
|
||||
688710 [PATCH] Splash screens shouldn't stay on top of all app...
|
||||
688884 Typo in gtk_tree_view_set_tooltip_column documentation
|
||||
689235 Broken function declarations corrupt the stack on windows
|
||||
690266 Freeze with F10/Shift-F10 on submenus
|
||||
Win32: Avoid infinite recursion in the ime input module
|
||||
Quartz: Fixes for splashscreen and tooltip windows
|
||||
|
||||
* Translation updates:
|
||||
Dutch
|
||||
German
|
||||
Gujarati
|
||||
Tamil
|
||||
Uyghur
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.2
|
||||
=================================
|
||||
|
||||
* Bug fixes:
|
||||
677609 GtkSizeGroup regression in GTK+ 3.3.20
|
||||
686021 spinner animation should not be subject to...
|
||||
686265 scrolledwindow: set GDK_EXPOSURE_MASK on t...
|
||||
686280 GtkScrollbar and GtkScale rendering broken...
|
||||
687196 filesystemmodel: invalidate nodes on file ...
|
||||
687467 Commit "Implement proper cross-fades for g...
|
||||
687872 Segfault when attempting to get character ...
|
||||
|
||||
* Translation updates:
|
||||
Irish
|
||||
Traditional Chinese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.0
|
||||
=================================
|
||||
|
||||
* Add an "inverted" property to GtkLevelBar
|
||||
|
||||
* Support RTL flipping in GtkLevelBar
|
||||
|
||||
* Various memory leak fixes
|
||||
|
||||
* Wayland: Update for protocol changes
|
||||
|
||||
* Bugs fixed:
|
||||
684288 level-bar: add an "inverted" property like GtkProgr...
|
||||
684415 Fix drag-motion event handling
|
||||
684980 Improve the appearance of the dragged header
|
||||
686013 CSS: crash drawing a GtkEntry in gedit
|
||||
686152 Calls gdk_window_get_frame_extents with a potential...
|
||||
686209 memleak with "text-shadow" css
|
||||
686265 scrolledwindow: set GDK_EXPOSURE_MASK on the oversh...
|
||||
686280 GtkScrollbar and GtkScale rendering broken in gtk 3.6
|
||||
686366 Use named union for _GtkSymbolicColor in gtk/gtksym...
|
||||
|
||||
* Translation updates:
|
||||
Czech
|
||||
Estonian
|
||||
Galician
|
||||
Indonesian
|
||||
Lithuanian
|
||||
Serbian
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.6.1
|
||||
=================================
|
||||
|
||||
|
||||
+5
-6
@@ -9,9 +9,9 @@
|
||||
# set GTK_BINARY_AGE and GTK_INTERFACE_AGE to 0.
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [6])
|
||||
m4_define([gtk_micro_version], [5])
|
||||
m4_define([gtk_interface_age], [5])
|
||||
m4_define([gtk_minor_version], [7])
|
||||
m4_define([gtk_micro_version], [3])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -39,7 +39,7 @@ AC_CONFIG_AUX_DIR([build-aux])
|
||||
m4_define([gtk_binary_version], [3.0.0])
|
||||
|
||||
# required versions of other packages
|
||||
m4_define([glib_required_version], [2.33.1])
|
||||
m4_define([glib_required_version], [2.35.0])
|
||||
m4_define([pango_required_version], [1.30.0])
|
||||
m4_define([atk_required_version], [2.5.3])
|
||||
m4_define([cairo_required_version], [1.10.0])
|
||||
@@ -324,8 +324,7 @@ AC_ARG_ENABLE(quartz-relocation,
|
||||
AC_ARG_ENABLE(wayland-cairo-gl,
|
||||
AS_HELP_STRING([--enable-wayland-cairo-gl],
|
||||
[enable the use of Cairo GL in the Wayland backend]),
|
||||
[],
|
||||
[enable_wayland_cairo_gl=no])
|
||||
[enable_wayland_cairo_gl=yes])
|
||||
|
||||
|
||||
cairo_backends=
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<chapter id="gtk-getting-started" xmlns:xi="http://www.w3.org/2003/XInclude">
|
||||
<title>Getting Started with GTK+</title>
|
||||
|
||||
<para>This chapter is contains some tutorial information to get you
|
||||
<para>This chapter contains some tutorial information to get you
|
||||
started with GTK+ programming. It assumes that you have GTK+, its
|
||||
dependencies and a C compiler installed and ready to use. If you
|
||||
need to build GTK+ itself first, refer to the
|
||||
|
||||
@@ -3281,6 +3281,8 @@ gtk_level_bar_set_min_value
|
||||
gtk_level_bar_get_min_value
|
||||
gtk_level_bar_set_max_value
|
||||
gtk_level_bar_get_max_value
|
||||
gtk_level_bar_set_inverted
|
||||
gtk_level_bar_get_inverted
|
||||
gtk_level_bar_add_offset_value
|
||||
gtk_level_bar_remove_offset_value
|
||||
gtk_level_bar_get_offset_value
|
||||
@@ -5289,6 +5291,7 @@ gtk_widget_get_sensitive
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_get_state
|
||||
gtk_widget_get_visible
|
||||
gtk_widget_is_visible
|
||||
gtk_widget_set_visible
|
||||
gtk_widget_set_state_flags
|
||||
gtk_widget_unset_state_flags
|
||||
@@ -5777,6 +5780,7 @@ GTK_STYLE_CLASS_ARROW
|
||||
GTK_STYLE_CLASS_OSD
|
||||
GTK_STYLE_CLASS_LEVEL_BAR
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_REGION_COLUMN
|
||||
GTK_STYLE_REGION_COLUMN_HEADER
|
||||
GTK_STYLE_REGION_ROW
|
||||
|
||||
@@ -411,8 +411,6 @@ bloat_pad_new (void)
|
||||
{
|
||||
BloatPad *bloat_pad;
|
||||
|
||||
g_type_init ();
|
||||
|
||||
g_set_application_name ("Bloatpad");
|
||||
|
||||
bloat_pad = g_object_new (bloat_pad_get_type (),
|
||||
|
||||
@@ -465,8 +465,6 @@ plug_man_class_init (PlugManClass *class)
|
||||
PlugMan *
|
||||
plug_man_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (plug_man_get_type (),
|
||||
"application-id", "org.gtk.Test.plugman",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
||||
@@ -191,8 +191,6 @@ menu_button_class_init (MenuButtonClass *class)
|
||||
MenuButton *
|
||||
menu_button_new (void)
|
||||
{
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (menu_button_get_type (),
|
||||
"application-id", "org.gtk.Test.Sunny",
|
||||
"flags", G_APPLICATION_HANDLES_OPEN,
|
||||
|
||||
@@ -31,12 +31,12 @@ libbroadway_la_SOURCES = \
|
||||
broadway.c
|
||||
|
||||
clienthtml.h: client.html
|
||||
$(PERL) ./toarray.pl client.html client_html > $@
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/client.html client_html > $@
|
||||
|
||||
EXTRA_DIST += client.html
|
||||
|
||||
broadwayjs.h: broadway.js
|
||||
$(PERL) ./toarray.pl broadway.js broadway_js > $@
|
||||
$(PERL) $(srcdir)/toarray.pl $(srcdir)/broadway.js broadway_js > $@
|
||||
|
||||
EXTRA_DIST += broadway.js
|
||||
|
||||
|
||||
@@ -274,8 +274,6 @@ gdk_pre_parse_libgtk_only (void)
|
||||
_gdk_rendering_mode = GDK_RENDERING_MODE_RECORDING;
|
||||
}
|
||||
|
||||
g_type_init ();
|
||||
|
||||
/* Do any setup particular to the windowing system */
|
||||
gdk_display_manager_get ();
|
||||
}
|
||||
|
||||
+1
-2
@@ -985,8 +985,7 @@ switch_to_pointer_grab (GdkDisplay *display,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
if (!info->need_touch_press_enter &&
|
||||
pointer_window != last_grab->window)
|
||||
if (pointer_window != last_grab->window)
|
||||
synthesize_crossing_events (display, device, source_device,
|
||||
last_grab->window, pointer_window,
|
||||
GDK_CROSSING_UNGRAB, time, serial);
|
||||
|
||||
@@ -90,6 +90,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_6 (G_ENCODE_VERSION (3, 6))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_8:
|
||||
*
|
||||
* A macro that evaluates to the 3.8 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -217,4 +227,18 @@
|
||||
# define GDK_AVAILABLE_IN_3_6
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_8
|
||||
# define GDK_DEPRECATED_IN_3_8_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_8
|
||||
# define GDK_AVAILABLE_IN_3_8 GDK_UNAVAILABLE(3, 8)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_8
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
+14
-10
@@ -668,6 +668,13 @@ gdk_window_has_no_impl (GdkWindow *window)
|
||||
return window->impl_window != window;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gdk_window_has_alpha (GdkWindow *window)
|
||||
{
|
||||
return !gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background;
|
||||
}
|
||||
|
||||
static void
|
||||
remove_layered_child_area (GdkWindow *window,
|
||||
cairo_region_t *region)
|
||||
@@ -695,7 +702,7 @@ remove_layered_child_area (GdkWindow *window,
|
||||
continue;
|
||||
|
||||
/* Only non-impl children with alpha add to the layered region */
|
||||
if (!child->has_alpha_background && gdk_window_has_impl (child))
|
||||
if (!gdk_window_has_alpha (child))
|
||||
continue;
|
||||
|
||||
r.x = child->x;
|
||||
@@ -797,7 +804,7 @@ remove_child_area (GdkWindow *window,
|
||||
}
|
||||
}
|
||||
|
||||
if (child->has_alpha_background)
|
||||
if (gdk_window_has_alpha (child))
|
||||
{
|
||||
if (layered_region != NULL)
|
||||
cairo_region_union (layered_region, child_region);
|
||||
@@ -2989,8 +2996,7 @@ gdk_window_begin_paint_region (GdkWindow *window,
|
||||
by being drawn in back to front order. However, if implicit paints are not used, for
|
||||
instance if it was flushed due to a non-double-buffered paint in the middle of the
|
||||
expose we need to copy in the existing data here. */
|
||||
if (!gdk_window_has_impl (window) &&
|
||||
window->has_alpha_background &&
|
||||
if (gdk_window_has_alpha (window) &&
|
||||
(!implicit_paint ||
|
||||
(implicit_paint && implicit_paint->flushed != NULL && !cairo_region_is_empty (implicit_paint->flushed))))
|
||||
{
|
||||
@@ -6161,7 +6167,7 @@ gdk_window_move_resize_internal (GdkWindow *window,
|
||||
* Everything in the old and new regions that is not copied must be
|
||||
* invalidated (including children) as this is newly exposed
|
||||
*/
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (new_region);
|
||||
@@ -6385,7 +6391,7 @@ gdk_window_scroll (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* Calculate the area that can be gotten by copying the old area */
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (window->clip_region);
|
||||
@@ -6473,7 +6479,7 @@ gdk_window_move_region (GdkWindow *window,
|
||||
impl_window = gdk_window_get_impl_window (window);
|
||||
|
||||
/* compute source regions */
|
||||
if (window->has_alpha_background)
|
||||
if (gdk_window_has_alpha (window))
|
||||
copy_area = cairo_region_create (); /* Copy nothing for alpha windows */
|
||||
else
|
||||
copy_area = cairo_region_copy (region);
|
||||
@@ -8367,12 +8373,10 @@ send_crossing_event (GdkDisplay *display,
|
||||
window_event_mask = window->event_mask;
|
||||
|
||||
if (type == GDK_ENTER_NOTIFY &&
|
||||
(pointer_info->need_touch_press_enter ||
|
||||
gdk_device_get_source (source_device) == GDK_SOURCE_TOUCHSCREEN) &&
|
||||
pointer_info->need_touch_press_enter &&
|
||||
mode != GDK_CROSSING_TOUCH_BEGIN &&
|
||||
mode != GDK_CROSSING_TOUCH_END)
|
||||
{
|
||||
pointer_info->need_touch_press_enter = TRUE;
|
||||
block_event = TRUE;
|
||||
}
|
||||
else if (type == GDK_LEAVE_NOTIFY)
|
||||
|
||||
@@ -28,14 +28,9 @@ GdkWindow *_gdk_root = NULL;
|
||||
GdkOSXVersion
|
||||
gdk_quartz_osx_version (void)
|
||||
{
|
||||
static gint32 minor = GDK_OSX_UNSUPPORTED;
|
||||
|
||||
if (minor == GDK_OSX_UNSUPPORTED)
|
||||
{
|
||||
OSErr err = Gestalt (gestaltSystemVersionMinor, (SInt32*)&minor);
|
||||
|
||||
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
|
||||
}
|
||||
gint minor;
|
||||
OSErr err = Gestalt (gestaltSystemVersionMinor, &minor);
|
||||
g_return_val_if_fail (err == noErr, GDK_OSX_UNSUPPORTED);
|
||||
|
||||
if (minor < GDK_OSX_MIN)
|
||||
return GDK_OSX_UNSUPPORTED;
|
||||
|
||||
@@ -48,8 +48,7 @@ typedef enum
|
||||
GDK_OSX_LEOPARD = 5,
|
||||
GDK_OSX_SNOW_LEOPARD = 6,
|
||||
GDK_OSX_LION = 7,
|
||||
GDK_OSX_MOUNTAIN_LION = 8,
|
||||
GDK_OSX_CURRENT = 8,
|
||||
GDK_OSX_CURRENT = 7,
|
||||
GDK_OSX_NEW = 99
|
||||
} GdkOSXVersion;
|
||||
|
||||
|
||||
@@ -2605,7 +2605,7 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
{
|
||||
NSRect rect;
|
||||
|
||||
old_view = [[impl->toplevel contentView] retain];
|
||||
old_view = [impl->toplevel contentView];
|
||||
|
||||
rect = [impl->toplevel frame];
|
||||
|
||||
@@ -2624,67 +2624,34 @@ gdk_quartz_window_set_decorations (GdkWindow *window,
|
||||
rect = [NSWindow contentRectForFrameRect:rect styleMask:old_mask];
|
||||
}
|
||||
|
||||
/* Note, before OS 10.6 there doesn't seem to be a way to change this
|
||||
* without recreating the toplevel. From 10.6 onward, a simple call to
|
||||
* setStyleMask takes care of most of this, except for ensuring that the
|
||||
* title is set.
|
||||
/* Note, before OS 10.6 there doesn't seem to be a way to change this without
|
||||
* recreating the toplevel. There might be bad side-effects of doing
|
||||
* that, but it seems alright.
|
||||
*/
|
||||
if ([impl->toplevel respondsToSelector:@selector(setStyleMask:)])
|
||||
{
|
||||
NSString *title = [impl->toplevel title];
|
||||
|
||||
[(id<CanSetStyleMask>)impl->toplevel setStyleMask:new_mask];
|
||||
|
||||
/* It appears that unsetting and then resetting NSTitledWindowMask
|
||||
* does not reset the title in the title bar as might be expected.
|
||||
*
|
||||
* In theory we only need to set this if new_mask includes
|
||||
* NSTitledWindowMask. This behaved extremely oddly when
|
||||
* conditionalized upon that and since it has no side effects (i.e.
|
||||
* if NSTitledWindowMask is not requested, the title will not be
|
||||
* displayed) just do it unconditionally. We also must null check
|
||||
* 'title' before setting it to avoid crashing.
|
||||
*/
|
||||
if (title)
|
||||
[impl->toplevel setTitle:title];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *title = [impl->toplevel title];
|
||||
NSColor *bg = [impl->toplevel backgroundColor];
|
||||
NSScreen *screen = [impl->toplevel screen];
|
||||
|
||||
/* Make sure the old window is closed, recall that releasedWhenClosed
|
||||
* is set on GdkQuartzWindows.
|
||||
*/
|
||||
[impl->toplevel close];
|
||||
|
||||
[impl->toplevel release];
|
||||
impl->toplevel = [[GdkQuartzNSWindow alloc] initWithContentRect:rect
|
||||
styleMask:new_mask
|
||||
backing:NSBackingStoreBuffered
|
||||
defer:NO
|
||||
screen:screen];
|
||||
defer:NO];
|
||||
[impl->toplevel setHasShadow: window_type_hint_to_shadow (impl->type_hint)];
|
||||
[impl->toplevel setLevel: window_type_hint_to_level (impl->type_hint)];
|
||||
if (title)
|
||||
[impl->toplevel setTitle:title];
|
||||
[impl->toplevel setBackgroundColor:bg];
|
||||
[impl->toplevel setHidesOnDeactivate: window_type_hint_to_hides_on_deactivate (impl->type_hint)];
|
||||
[impl->toplevel setContentView:old_view];
|
||||
}
|
||||
|
||||
if (new_mask == NSBorderlessWindowMask)
|
||||
[impl->toplevel setContentSize:rect.size];
|
||||
else
|
||||
[impl->toplevel setFrame:rect display:YES];
|
||||
[impl->toplevel setFrame:rect display:YES];
|
||||
|
||||
/* Invalidate the window shadow for non-opaque views that have shadow
|
||||
* enabled, to get the shadow shape updated.
|
||||
*/
|
||||
if (![old_view isOpaque] && [impl->toplevel hasShadow])
|
||||
[(GdkQuartzView*)old_view setNeedsInvalidateShadow:YES];
|
||||
|
||||
[old_view release];
|
||||
}
|
||||
|
||||
GDK_QUARTZ_RELEASE_POOL;
|
||||
@@ -2873,7 +2840,6 @@ static void
|
||||
gdk_quartz_window_fullscreen (GdkWindow *window)
|
||||
{
|
||||
FullscreenSavedGeometry *geometry;
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
NSRect frame;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
@@ -2899,14 +2865,10 @@ gdk_quartz_window_fullscreen (GdkWindow *window)
|
||||
|
||||
gdk_window_set_decorations (window, 0);
|
||||
|
||||
frame = [[impl->toplevel screen] frame];
|
||||
frame = [[NSScreen mainScreen] frame];
|
||||
move_resize_window_internal (window,
|
||||
0, 0,
|
||||
frame.size.width, frame.size.height);
|
||||
[impl->toplevel setContentSize:frame.size];
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
|
||||
clear_toplevel_order ();
|
||||
}
|
||||
|
||||
SetSystemUIMode (kUIModeAllHidden, kUIOptionAutoShowMenuBar);
|
||||
@@ -2917,7 +2879,6 @@ gdk_quartz_window_fullscreen (GdkWindow *window)
|
||||
static void
|
||||
gdk_quartz_window_unfullscreen (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplQuartz *impl = GDK_WINDOW_IMPL_QUARTZ (window->impl);
|
||||
FullscreenSavedGeometry *geometry;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
@@ -2939,9 +2900,6 @@ gdk_quartz_window_unfullscreen (GdkWindow *window)
|
||||
|
||||
g_object_set_data (G_OBJECT (window), FULLSCREEN_DATA, NULL);
|
||||
|
||||
[impl->toplevel makeKeyAndOrderFront:impl->toplevel];
|
||||
clear_toplevel_order ();
|
||||
|
||||
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,7 +147,7 @@ _gdk_win32_window_change_property (GdkWindow *window,
|
||||
{
|
||||
HGLOBAL hdata;
|
||||
gint i, size;
|
||||
guchar *ucptr;
|
||||
guchar *ucptr, *buf = NULL;
|
||||
wchar_t *wcptr, *p;
|
||||
glong wclen;
|
||||
|
||||
@@ -206,7 +206,7 @@ _gdk_win32_window_change_property (GdkWindow *window,
|
||||
WIN32_API_FAILED ("GlobalAlloc");
|
||||
if (!CloseClipboard ())
|
||||
WIN32_API_FAILED ("CloseClipboard");
|
||||
g_free (wcptr);
|
||||
g_free (buf);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -399,6 +399,7 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
g_value_set_boolean (value, TRUE);
|
||||
return TRUE;
|
||||
}
|
||||
#if 0
|
||||
/*
|
||||
* With 'MS Sans Serif' as windows menu font (default on win98se) you'll get a
|
||||
* bunch of :
|
||||
@@ -415,7 +416,7 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
/* Pango finally uses GetDeviceCaps to scale, we use simple
|
||||
* approximation here.
|
||||
*/
|
||||
int nHeight = (0 > ncm.lfMenuFont.lfHeight ? - 3 * ncm.lfMenuFont.lfHeight / 4 : 10);
|
||||
int nHeight = (0 > ncm.lfMenuFont.lfHeight ? -3*ncm.lfMenuFont.lfHeight/4 : 10);
|
||||
if (OUT_STRING_PRECIS == ncm.lfMenuFont.lfOutPrecision)
|
||||
GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : ignoring bitmap font '%s'\n",
|
||||
name, ncm.lfMenuFont.lfFaceName));
|
||||
@@ -423,7 +424,7 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
/* Avoid issues like those described in bug #135098 */
|
||||
g_utf8_validate (ncm.lfMenuFont.lfFaceName, -1, NULL))
|
||||
{
|
||||
char *s = g_strdup_printf ("%s %d", ncm.lfMenuFont.lfFaceName, nHeight);
|
||||
char* s = g_strdup_printf ("%s %d", ncm.lfMenuFont.lfFaceName, nHeight);
|
||||
GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : %s\n", name, s));
|
||||
g_value_set_string (value, s);
|
||||
|
||||
@@ -432,6 +433,7 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include "config.h"
|
||||
#include <stdlib.h>
|
||||
#include <windows.h>
|
||||
|
||||
#include "gdk.h"
|
||||
#include "gdkwindowimpl.h"
|
||||
@@ -1534,7 +1533,7 @@ gdk_win32_window_set_urgency_hint (GdkWindow *window,
|
||||
gboolean urgent)
|
||||
{
|
||||
FLASHWINFO flashwinfo;
|
||||
typedef BOOL (WINAPI *PFN_FlashWindowEx) (FLASHWINFO*);
|
||||
typedef BOOL (*PFN_FlashWindowEx) (FLASHWINFO*);
|
||||
PFN_FlashWindowEx flashWindowEx = NULL;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -3265,7 +3264,7 @@ gdk_win32_window_set_opacity (GdkWindow *window,
|
||||
gdouble opacity)
|
||||
{
|
||||
LONG exstyle;
|
||||
typedef BOOL (WINAPI *PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
|
||||
typedef BOOL (*PFN_SetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
|
||||
PFN_SetLayeredWindowAttributes setLayeredWindowAttributes = NULL;
|
||||
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
|
||||
@@ -280,10 +280,6 @@ get_current_desktop (GdkScreen *screen)
|
||||
unsigned char *data_return = NULL;
|
||||
int workspace = 0;
|
||||
|
||||
if (!gdk_x11_screen_supports_net_wm_hint (screen,
|
||||
gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP")))
|
||||
return workspace;
|
||||
|
||||
display = GDK_DISPLAY_XDISPLAY (gdk_screen_get_display (screen));
|
||||
win = XRootWindow (display, GDK_SCREEN_XNUMBER (screen));
|
||||
|
||||
@@ -298,7 +294,7 @@ get_current_desktop (GdkScreen *screen)
|
||||
&data_return);
|
||||
|
||||
if (type == XA_CARDINAL && format == 32 && n_items > 0)
|
||||
workspace = ((long *) data_return)[0];
|
||||
workspace = (int) data_return[0];
|
||||
|
||||
if (data_return)
|
||||
XFree (data_return);
|
||||
@@ -334,10 +330,6 @@ get_work_area (GdkScreen *screen,
|
||||
area->width = gdk_screen_get_width (screen);
|
||||
area->height = gdk_screen_get_height (screen);
|
||||
|
||||
if (!gdk_x11_screen_supports_net_wm_hint (screen,
|
||||
gdk_atom_intern_static_string ("_NET_WORKAREA")))
|
||||
return;
|
||||
|
||||
if (workarea == None)
|
||||
return;
|
||||
|
||||
|
||||
@@ -1738,9 +1738,7 @@ static void
|
||||
move_to_current_desktop (GdkWindow *window)
|
||||
{
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_WM_DESKTOP")) &&
|
||||
gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_CURRENT_DESKTOP")))
|
||||
gdk_atom_intern_static_string ("_NET_WM_DESKTOP")))
|
||||
{
|
||||
Atom type;
|
||||
gint format;
|
||||
@@ -2719,9 +2717,7 @@ gdk_x11_window_get_frame_extents (GdkWindow *window,
|
||||
xwindow = GDK_WINDOW_XID (window);
|
||||
|
||||
/* first try: use _NET_FRAME_EXTENTS */
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_FRAME_EXTENTS")) &&
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), xwindow,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_FRAME_EXTENTS"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type_return,
|
||||
@@ -2768,9 +2764,7 @@ gdk_x11_window_get_frame_extents (GdkWindow *window,
|
||||
/* use NETWM_VIRTUAL_ROOTS if available */
|
||||
root = GDK_WINDOW_XROOTWIN (window);
|
||||
|
||||
if (gdk_x11_screen_supports_net_wm_hint (GDK_WINDOW_SCREEN (window),
|
||||
gdk_atom_intern_static_string ("_NET_VIRTUAL_ROOTS")) &&
|
||||
XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
|
||||
if (XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), root,
|
||||
gdk_x11_get_xatom_by_name_for_display (display,
|
||||
"_NET_VIRTUAL_ROOTS"),
|
||||
0, G_MAXLONG, False, XA_WINDOW, &type_return,
|
||||
|
||||
+16
-7
@@ -148,6 +148,7 @@ deprecated_h_sources = \
|
||||
deprecated/gtkcolorsel.h \
|
||||
deprecated/gtkcolorseldialog.h \
|
||||
deprecated/gtkfontsel.h \
|
||||
deprecated/gtkgradient.h \
|
||||
deprecated/gtkhandlebox.h \
|
||||
deprecated/gtkhbbox.h \
|
||||
deprecated/gtkhbox.h \
|
||||
@@ -156,8 +157,9 @@ deprecated_h_sources = \
|
||||
deprecated/gtkhscrollbar.h \
|
||||
deprecated/gtkhseparator.h \
|
||||
deprecated/gtkhsv.h \
|
||||
deprecated/gtkstyle.h \
|
||||
deprecated/gtkrc.h \
|
||||
deprecated/gtkstyle.h \
|
||||
deprecated/gtksymboliccolor.h \
|
||||
deprecated/gtktable.h \
|
||||
deprecated/gtktearoffmenuitem.h \
|
||||
deprecated/gtkvbbox.h \
|
||||
@@ -167,6 +169,10 @@ deprecated_h_sources = \
|
||||
deprecated/gtkvseparator.h \
|
||||
deprecated/gtkvpaned.h
|
||||
|
||||
deprecated_private_h_sources = \
|
||||
deprecated/gtkgradientprivate.h \
|
||||
deprecated/gtksymboliccolorprivate.h
|
||||
|
||||
gtk_public_h_sources = \
|
||||
gtk.h \
|
||||
gtkx.h \
|
||||
@@ -249,7 +255,6 @@ gtk_public_h_sources = \
|
||||
gtkfontchooserdialog.h \
|
||||
gtkfontchooserwidget.h \
|
||||
gtkframe.h \
|
||||
gtkgradient.h \
|
||||
gtkgrid.h \
|
||||
gtkiconfactory.h \
|
||||
gtkicontheme.h \
|
||||
@@ -330,7 +335,6 @@ gtk_public_h_sources = \
|
||||
gtkstyleproperties.h \
|
||||
gtkstyleprovider.h \
|
||||
gtkswitch.h \
|
||||
gtksymboliccolor.h \
|
||||
gtktestutils.h \
|
||||
gtktextattributes.h \
|
||||
gtktextbuffer.h \
|
||||
@@ -431,6 +435,7 @@ gtk_private_h_sources = \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscomputedvaluesprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
@@ -477,7 +482,7 @@ gtk_private_h_sources = \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkgradientprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
@@ -517,6 +522,7 @@ gtk_private_h_sources = \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
@@ -524,7 +530,6 @@ gtk_private_h_sources = \
|
||||
gtkstylepropertiesprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtksymboliccolorprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextchildprivate.h \
|
||||
@@ -553,6 +558,7 @@ deprecated_c_sources = \
|
||||
deprecated/gtkcolorsel.c \
|
||||
deprecated/gtkcolorseldialog.c \
|
||||
deprecated/gtkfontsel.c \
|
||||
deprecated/gtkgradient.c \
|
||||
deprecated/gtkhandlebox.c \
|
||||
deprecated/gtkhbbox.c \
|
||||
deprecated/gtkhbox.c \
|
||||
@@ -563,6 +569,7 @@ deprecated_c_sources = \
|
||||
deprecated/gtkhsv.c \
|
||||
deprecated/gtkrc.c \
|
||||
deprecated/gtkstyle.c \
|
||||
deprecated/gtksymboliccolor.c \
|
||||
deprecated/gtktable.c \
|
||||
deprecated/gtktearoffmenuitem.c \
|
||||
deprecated/gtkvbbox.c \
|
||||
@@ -653,6 +660,7 @@ gtk_base_c_sources = \
|
||||
gtkcssarrayvalue.c \
|
||||
gtkcssbgsizevalue.c \
|
||||
gtkcssbordervalue.c \
|
||||
gtkcsscolorvalue.c \
|
||||
gtkcsscomputedvalues.c \
|
||||
gtkcsscornervalue.c \
|
||||
gtkcsscustomproperty.c \
|
||||
@@ -717,8 +725,8 @@ gtk_base_c_sources = \
|
||||
gtkfontchooserutils.c \
|
||||
gtkfontchooserwidget.c \
|
||||
gtkframe.c \
|
||||
gtkgradient.c \
|
||||
gtkgrid.c \
|
||||
gtkhsla.c \
|
||||
gtkiconcache.c \
|
||||
gtkiconcachevalidator.c \
|
||||
gtkiconfactory.c \
|
||||
@@ -804,6 +812,7 @@ gtk_base_c_sources = \
|
||||
gtksettings.c \
|
||||
gtksizegroup.c \
|
||||
gtksizerequest.c \
|
||||
gtksizerequestcache.c \
|
||||
gtkshow.c \
|
||||
gtkspinbutton.c \
|
||||
gtkspinner.c \
|
||||
@@ -818,7 +827,6 @@ gtk_base_c_sources = \
|
||||
gtkstyleprovider.c \
|
||||
gtkstyleproviderprivate.c \
|
||||
gtkswitch.c \
|
||||
gtksymboliccolor.c \
|
||||
gtktestutils.c \
|
||||
gtktextattributes.c \
|
||||
gtktextbtree.c \
|
||||
@@ -967,6 +975,7 @@ gtk_private_h_sources += $(gtk_use_quartz_private_h_sources)
|
||||
endif
|
||||
|
||||
gtk_all_private_h_sources = \
|
||||
$(deprecated_private_h_sources) \
|
||||
$(gtk_private_h_sources) \
|
||||
$(gtk_use_x11_private_h_sources) \
|
||||
$(gtk_use_win32_private_h_sources) \
|
||||
|
||||
@@ -6,7 +6,6 @@ gail_c_sources = \
|
||||
gail.c \
|
||||
gtkarrowaccessible.c \
|
||||
gtkbooleancellaccessible.c \
|
||||
gtkboxaccessible.c \
|
||||
gtkbuttonaccessible.c \
|
||||
gtkcellaccessible.c \
|
||||
gtkcellaccessibleparent.c \
|
||||
@@ -57,7 +56,6 @@ gail_private_h_sources = \
|
||||
gail.h \
|
||||
gtkarrowaccessible.h \
|
||||
gtkbooleancellaccessible.h \
|
||||
gtkboxaccessible.h \
|
||||
gtkbuttonaccessible.h \
|
||||
gtkcellaccessible.h \
|
||||
gtkcellaccessibleparent.h \
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/* GAIL - The GNOME Accessibility Implementation Library
|
||||
* Copyright 2004 Sun Microsystems 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkboxaccessible.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkBoxAccessible, _gtk_box_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
|
||||
|
||||
static void
|
||||
gtk_box_accessible_initialize (AtkObject *accessible,
|
||||
gpointer data)
|
||||
{
|
||||
ATK_OBJECT_CLASS (_gtk_box_accessible_parent_class)->initialize (accessible, data);
|
||||
accessible->role = ATK_ROLE_FILLER;
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_box_accessible_class_init (GtkBoxAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->initialize = gtk_box_accessible_initialize;
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_box_accessible_init (GtkBoxAccessible *scale)
|
||||
{
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
/* GAIL - The GNOME Accessibility Implementation Library
|
||||
* Copyright 2004 Sun Microsystems Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library 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
|
||||
* Library General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Library General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_BOX_ACCESSIBLE_H__
|
||||
#define __GTK_BOX_ACCESSIBLE_H__
|
||||
|
||||
#include "gtkcontaineraccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_BOX_ACCESSIBLE (_gtk_box_accessible_get_type ())
|
||||
#define GTK_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessible))
|
||||
#define GTK_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
|
||||
#define GTK_IS_BOX_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_BOX_ACCESSIBLE))
|
||||
#define GTK_IS_BOX_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_BOX_ACCESSIBLE))
|
||||
#define GTK_BOX_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_BOX_ACCESSIBLE, GtkBoxAccessibleClass))
|
||||
|
||||
typedef struct _GtkBoxAccessible GtkBoxAccessible;
|
||||
typedef struct _GtkBoxAccessibleClass GtkBoxAccessibleClass;
|
||||
typedef struct _GtkBoxAccessiblePrivate GtkBoxAccessiblePrivate;
|
||||
|
||||
struct _GtkBoxAccessible
|
||||
{
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkBoxAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkBoxAccessibleClass
|
||||
{
|
||||
GtkContainerAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GType _gtk_box_accessible_get_type (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_BOX_ACCESSIBLE_H__ */
|
||||
@@ -287,13 +287,10 @@ gtk_cell_accessible_action_do_action (AtkAction *action,
|
||||
{
|
||||
case 0:
|
||||
_gtk_cell_accessible_parent_expand_collapse (parent, cell);
|
||||
break;
|
||||
case 1:
|
||||
_gtk_cell_accessible_parent_edit (parent, cell);
|
||||
break;
|
||||
case 2:
|
||||
_gtk_cell_accessible_parent_activate (parent, cell);
|
||||
break;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -17,18 +17,351 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <string.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include "gtkpango.h"
|
||||
#include "gtkentryaccessible.h"
|
||||
#include "gtkentryprivate.h"
|
||||
#include "gtkcomboboxaccessible.h"
|
||||
|
||||
#define GTK_TYPE_ENTRY_ICON_ACCESSIBLE (_gtk_entry_icon_accessible_get_type ())
|
||||
#define GTK_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE, GtkEntryIconAccessible))
|
||||
#define GTK_IS_ENTRY_ICON_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ENTRY_ICON_ACCESSIBLE))
|
||||
|
||||
struct _GtkEntryAccessiblePrivate
|
||||
{
|
||||
gint cursor_position;
|
||||
gint selection_bound;
|
||||
AtkObject *icons[2];
|
||||
};
|
||||
|
||||
typedef struct _GtkEntryIconAccessible GtkEntryIconAccessible;
|
||||
typedef struct _GtkEntryIconAccessibleClass GtkEntryIconAccessibleClass;
|
||||
|
||||
struct _GtkEntryIconAccessible
|
||||
{
|
||||
AtkObject parent;
|
||||
|
||||
GtkEntryAccessible *entry;
|
||||
GtkEntryIconPosition pos;
|
||||
};
|
||||
|
||||
struct _GtkEntryIconAccessibleClass
|
||||
{
|
||||
AtkObjectClass parent_class;
|
||||
};
|
||||
|
||||
static void atk_action_interface_init (AtkActionIface *iface);
|
||||
|
||||
static void icon_atk_action_interface_init (AtkActionIface *iface);
|
||||
static void icon_atk_component_interface_init (AtkComponentIface *iface);
|
||||
|
||||
GType _gtk_entry_icon_accessible_get_type (void);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkEntryIconAccessible, _gtk_entry_icon_accessible, ATK_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, icon_atk_action_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, icon_atk_component_interface_init))
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_remove_entry (gpointer data, GObject *obj)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = data;
|
||||
|
||||
if (icon->entry)
|
||||
{
|
||||
icon->entry = NULL;
|
||||
g_object_notify (G_OBJECT (icon), "accessible-parent");
|
||||
atk_object_notify_state_change (ATK_OBJECT (icon), ATK_STATE_DEFUNCT, TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_icon_accessible_new (GtkEntryAccessible *entry,
|
||||
GtkEntryIconPosition pos)
|
||||
{
|
||||
GtkEntryIconAccessible *icon;
|
||||
AtkObject *accessible;
|
||||
|
||||
icon = g_object_new (_gtk_entry_icon_accessible_get_type (), NULL);
|
||||
icon->entry = entry;
|
||||
g_object_weak_ref (G_OBJECT (entry),
|
||||
gtk_entry_icon_accessible_remove_entry,
|
||||
icon);
|
||||
icon->pos = pos;
|
||||
|
||||
accessible = ATK_OBJECT (icon);
|
||||
atk_object_initialize (accessible, NULL);
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_icon_accessible_init (GtkEntryIconAccessible *icon)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_initialize (AtkObject *obj,
|
||||
gpointer data)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (obj);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
const gchar *name;
|
||||
gchar *text;
|
||||
|
||||
ATK_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->initialize (obj, data);
|
||||
atk_object_set_role (obj, ATK_ROLE_ICON);
|
||||
|
||||
name = gtk_entry_get_icon_name (gtk_entry, icon->pos);
|
||||
if (name)
|
||||
atk_object_set_name (obj, name);
|
||||
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry, icon->pos);
|
||||
if (text)
|
||||
{
|
||||
atk_object_set_description (obj, text);
|
||||
g_free (text);
|
||||
}
|
||||
|
||||
atk_object_set_parent (obj, ATK_OBJECT (icon->entry));
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_icon_accessible_get_parent (AtkObject *accessible)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
|
||||
|
||||
return ATK_OBJECT (icon->entry);
|
||||
}
|
||||
|
||||
static AtkStateSet *
|
||||
gtk_entry_icon_accessible_ref_state_set (AtkObject *accessible)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (accessible);
|
||||
AtkStateSet *set = atk_state_set_new ();
|
||||
AtkStateSet *entry_set;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *gtk_entry;
|
||||
|
||||
if (!icon->entry)
|
||||
{
|
||||
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
|
||||
return set;
|
||||
}
|
||||
|
||||
entry_set = atk_object_ref_state_set (ATK_OBJECT (icon->entry));
|
||||
if (!entry_set || atk_state_set_contains_state (entry_set, ATK_STATE_DEFUNCT))
|
||||
{
|
||||
atk_state_set_add_state (set, ATK_STATE_DEFUNCT);
|
||||
g_clear_object (&entry_set);
|
||||
return set;
|
||||
}
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_ENABLED))
|
||||
atk_state_set_add_state (set, ATK_STATE_ENABLED);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_SENSITIVE))
|
||||
atk_state_set_add_state (set, ATK_STATE_SENSITIVE);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_SHOWING))
|
||||
atk_state_set_add_state (set, ATK_STATE_SHOWING);
|
||||
if (atk_state_set_contains_state (entry_set, ATK_STATE_VISIBLE))
|
||||
atk_state_set_add_state (set, ATK_STATE_VISIBLE);
|
||||
|
||||
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos))
|
||||
atk_state_set_remove_state (set, ATK_STATE_SENSITIVE);
|
||||
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
atk_state_set_remove_state (set, ATK_STATE_ENABLED);
|
||||
|
||||
g_object_unref (entry_set);
|
||||
return set;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_invalidate (GtkEntryIconAccessible *icon)
|
||||
{
|
||||
if (!icon->entry)
|
||||
return;
|
||||
g_object_weak_unref (G_OBJECT (icon->entry),
|
||||
gtk_entry_icon_accessible_remove_entry,
|
||||
icon);
|
||||
gtk_entry_icon_accessible_remove_entry (icon, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (object);
|
||||
|
||||
gtk_entry_icon_accessible_invalidate (icon);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_entry_icon_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_icon_accessible_class_init (GtkEntryIconAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
atk_class->initialize = gtk_entry_icon_accessible_initialize;
|
||||
atk_class->get_parent = gtk_entry_icon_accessible_get_parent;
|
||||
atk_class->ref_state_set = gtk_entry_icon_accessible_ref_state_set;
|
||||
|
||||
gobject_class->finalize = gtk_entry_icon_accessible_finalize;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_entry_icon_accessible_do_action (AtkAction *action,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = (GtkEntryIconAccessible *)action;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *gtk_entry;
|
||||
GdkEvent event;
|
||||
GdkRectangle icon_area;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
if (widget == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (i != 0)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_widget_is_sensitive (widget) || !gtk_widget_get_visible (widget))
|
||||
return FALSE;
|
||||
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (!gtk_entry_get_icon_sensitive (gtk_entry, icon->pos) ||
|
||||
!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
return FALSE;
|
||||
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
memset (&event, 0, sizeof (event));
|
||||
event.button.type = GDK_BUTTON_PRESS;
|
||||
event.button.window = gtk_widget_get_window (widget);
|
||||
event.button.button = 1;
|
||||
event.button.send_event = TRUE;
|
||||
event.button.time = GDK_CURRENT_TIME;
|
||||
event.button.x = icon_area.x;
|
||||
event.button.y = icon_area.y;
|
||||
|
||||
g_signal_emit_by_name (widget, "icon-press", 0, icon->pos, &event);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_entry_icon_accessible_get_n_actions (AtkAction *action)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
return (gtk_entry_get_icon_activatable (gtk_entry, icon->pos) ? 1 : 0);
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gtk_entry_icon_accessible_get_name (AtkAction *action,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (action);
|
||||
GtkWidget *widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
GtkEntry *gtk_entry = GTK_ENTRY (widget);
|
||||
|
||||
if (i != 0)
|
||||
return NULL;
|
||||
if (!gtk_entry_get_icon_activatable (gtk_entry, icon->pos))
|
||||
return NULL;
|
||||
|
||||
return "activate";
|
||||
}
|
||||
|
||||
static void
|
||||
icon_atk_action_interface_init (AtkActionIface *iface)
|
||||
{
|
||||
iface->do_action = gtk_entry_icon_accessible_do_action;
|
||||
iface->get_n_actions = gtk_entry_icon_accessible_get_n_actions;
|
||||
iface->get_name = gtk_entry_icon_accessible_get_name;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_extents (AtkComponent *component,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gint *width,
|
||||
gint *height,
|
||||
AtkCoordType coord_type)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
*x = G_MININT;
|
||||
atk_component_get_extents (ATK_COMPONENT (icon->entry), x, y, width, height,
|
||||
coord_type);
|
||||
if (*x == G_MININT)
|
||||
return;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*width = icon_area.width;
|
||||
*height = icon_area.height;
|
||||
*x += icon_area.x;
|
||||
*y += icon_area.y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_position (AtkComponent *component,
|
||||
gint *x,
|
||||
gint *y,
|
||||
AtkCoordType coord_type)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
*x = G_MININT;
|
||||
atk_component_get_position (ATK_COMPONENT (icon->entry), x, y, coord_type);
|
||||
if (*x == G_MININT)
|
||||
return;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*x += icon_area.x;
|
||||
*y += icon_area.y;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_icon_accessible_get_size (AtkComponent *component,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkEntryIconAccessible *icon = GTK_ENTRY_ICON_ACCESSIBLE (component);
|
||||
GdkRectangle icon_area;
|
||||
GtkEntry *gtk_entry;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (icon->entry));
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
gtk_entry_get_icon_area (gtk_entry, icon->pos, &icon_area);
|
||||
*width = icon_area.width;
|
||||
*height = icon_area.height;
|
||||
}
|
||||
|
||||
static void
|
||||
icon_atk_component_interface_init (AtkComponentIface *iface)
|
||||
{
|
||||
iface->get_extents = gtk_entry_icon_accessible_get_extents;
|
||||
iface->get_size = gtk_entry_icon_accessible_get_size;
|
||||
iface->get_position = gtk_entry_icon_accessible_get_position;
|
||||
}
|
||||
|
||||
/* Callbacks */
|
||||
|
||||
static void insert_text_cb (GtkEditable *editable,
|
||||
@@ -137,11 +470,13 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
|
||||
AtkObject* atk_obj;
|
||||
GtkEntry* gtk_entry;
|
||||
GtkEntryAccessible* entry;
|
||||
GtkEntryAccessiblePrivate *priv;
|
||||
|
||||
widget = GTK_WIDGET (obj);
|
||||
atk_obj = gtk_widget_get_accessible (widget);
|
||||
gtk_entry = GTK_ENTRY (widget);
|
||||
entry = GTK_ENTRY_ACCESSIBLE (atk_obj);
|
||||
priv = entry->priv;
|
||||
|
||||
if (g_strcmp0 (pspec->name, "cursor-position") == 0)
|
||||
{
|
||||
@@ -174,6 +509,119 @@ gtk_entry_accessible_notify_gtk (GObject *obj,
|
||||
new_role = visibility ? ATK_ROLE_TEXT : ATK_ROLE_PASSWORD_TEXT;
|
||||
atk_object_set_role (atk_obj, new_role);
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-storage-type") == 0)
|
||||
{
|
||||
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
g_signal_emit_by_name (entry, "children-changed::add", 0,
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
|
||||
}
|
||||
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_PRIMARY]));
|
||||
g_signal_emit_by_name (entry, "children-changed::remove", 0,
|
||||
priv->icons[GTK_ENTRY_ICON_PRIMARY], NULL);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-storage-type") == 0)
|
||||
{
|
||||
gint index = (priv->icons[GTK_ENTRY_ICON_PRIMARY] ? 1 : 0);
|
||||
if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY && !priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY] = gtk_entry_icon_accessible_new (entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
g_signal_emit_by_name (entry, "children-changed::add", index,
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
|
||||
}
|
||||
else if (gtk_entry_get_icon_storage_type (gtk_entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY && priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gtk_entry_icon_accessible_invalidate (GTK_ENTRY_ICON_ACCESSIBLE (priv->icons[GTK_ENTRY_ICON_SECONDARY]));
|
||||
g_signal_emit_by_name (entry, "children-changed::remove", index,
|
||||
priv->icons[GTK_ENTRY_ICON_SECONDARY], NULL);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-name") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
const gchar *name;
|
||||
name = gtk_entry_get_icon_name (gtk_entry,
|
||||
GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_PRIMARY], name);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-name") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
const gchar *name;
|
||||
name = gtk_entry_get_icon_name (gtk_entry,
|
||||
GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_set_name (priv->icons[GTK_ENTRY_ICON_SECONDARY], name);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-tooltip-text") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gchar *text;
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
|
||||
GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
text);
|
||||
g_free (text);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-tooltip-text") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gchar *text;
|
||||
text = gtk_entry_get_icon_tooltip_text (gtk_entry,
|
||||
GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_set_description (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
text);
|
||||
g_free (text);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-activatable") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
ATK_STATE_ENABLED, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-activatable") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_activatable (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
ATK_STATE_ENABLED, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "primary-icon-sensitive") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_PRIMARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_PRIMARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_PRIMARY],
|
||||
ATK_STATE_SENSITIVE, on);
|
||||
}
|
||||
}
|
||||
else if (g_strcmp0 (pspec->name, "secondary-icon-sensitive") == 0)
|
||||
{
|
||||
if (priv->icons[GTK_ENTRY_ICON_SECONDARY])
|
||||
{
|
||||
gboolean on = gtk_entry_get_icon_sensitive (gtk_entry, GTK_ENTRY_ICON_SECONDARY);
|
||||
atk_object_notify_state_change (priv->icons[GTK_ENTRY_ICON_SECONDARY],
|
||||
ATK_STATE_SENSITIVE, on);
|
||||
}
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_entry_accessible_parent_class)->notify_gtk (obj, pspec);
|
||||
}
|
||||
@@ -192,19 +640,98 @@ gtk_entry_accessible_get_index_in_parent (AtkObject *accessible)
|
||||
return ATK_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->get_index_in_parent (accessible);
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_entry_accessible_get_n_children (AtkObject* obj)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkEntry *entry;
|
||||
gint count = 0;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return 0;
|
||||
|
||||
entry = GTK_ENTRY (widget);
|
||||
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
|
||||
count++;
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
|
||||
count++;
|
||||
return count;
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_entry_accessible_ref_child (AtkObject *obj,
|
||||
gint i)
|
||||
{
|
||||
GtkEntryAccessible *accessible = GTK_ENTRY_ACCESSIBLE (obj);
|
||||
GtkEntryAccessiblePrivate *priv = accessible->priv;
|
||||
GtkWidget *widget;
|
||||
GtkEntry *entry;
|
||||
GtkEntryIconPosition pos;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
entry = GTK_ENTRY (widget);
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) != GTK_IMAGE_EMPTY)
|
||||
pos = GTK_ENTRY_ICON_PRIMARY;
|
||||
else if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) != GTK_IMAGE_EMPTY)
|
||||
pos = GTK_ENTRY_ICON_SECONDARY;
|
||||
else
|
||||
return NULL;
|
||||
break;
|
||||
case 1:
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_PRIMARY) == GTK_IMAGE_EMPTY)
|
||||
return NULL;
|
||||
if (gtk_entry_get_icon_storage_type (entry, GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
|
||||
return NULL;
|
||||
pos = GTK_ENTRY_ICON_SECONDARY;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!priv->icons[pos])
|
||||
priv->icons[pos] = gtk_entry_icon_accessible_new (accessible, pos);
|
||||
return g_object_ref (priv->icons[pos]);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_accessible_finalize (GObject *object)
|
||||
{
|
||||
GtkEntryAccessible *entry = GTK_ENTRY_ACCESSIBLE (object);
|
||||
GtkEntryAccessiblePrivate *priv = entry->priv;
|
||||
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_PRIMARY]);
|
||||
g_clear_object (&priv->icons[GTK_ENTRY_ICON_SECONDARY]);
|
||||
|
||||
G_OBJECT_CLASS (_gtk_entry_accessible_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_entry_accessible_class_init (GtkEntryAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
class->ref_state_set = gtk_entry_accessible_ref_state_set;
|
||||
class->get_index_in_parent = gtk_entry_accessible_get_index_in_parent;
|
||||
class->initialize = gtk_entry_accessible_initialize;
|
||||
class->get_attributes = gtk_entry_accessible_get_attributes;
|
||||
class->get_n_children = gtk_entry_accessible_get_n_children;
|
||||
class->ref_child = gtk_entry_accessible_ref_child;
|
||||
|
||||
widget_class->notify_gtk = gtk_entry_accessible_notify_gtk;
|
||||
|
||||
gobject_class->finalize = gtk_entry_accessible_finalize;
|
||||
|
||||
g_type_class_add_private (klass, sizeof (GtkEntryAccessiblePrivate));
|
||||
}
|
||||
|
||||
|
||||
@@ -708,7 +708,7 @@ gtk_icon_view_item_accessible_is_showing (GtkIconViewItemAccessible *item)
|
||||
if (icon_view->priv->hadjustment)
|
||||
visible_rect.x += gtk_adjustment_get_value (icon_view->priv->hadjustment);
|
||||
visible_rect.y = 0;
|
||||
if (icon_view->priv->vadjustment)
|
||||
if (icon_view->priv->hadjustment)
|
||||
visible_rect.y += gtk_adjustment_get_value (icon_view->priv->vadjustment);
|
||||
visible_rect.width = allocation.width;
|
||||
visible_rect.height = allocation.height;
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "gtkstatusbaraccessible.h"
|
||||
|
||||
|
||||
G_DEFINE_TYPE (GtkStatusbarAccessible, _gtk_statusbar_accessible, GTK_TYPE_BOX_ACCESSIBLE)
|
||||
G_DEFINE_TYPE (GtkStatusbarAccessible, _gtk_statusbar_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE)
|
||||
|
||||
static void
|
||||
text_changed (GtkStatusbar *statusbar,
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
#ifndef __GTK_STATUSBAR_ACCESSIBLE_H__
|
||||
#define __GTK_STATUSBAR_ACCESSIBLE_H__
|
||||
|
||||
#include "gtkboxaccessible.h"
|
||||
#include "gtkcontaineraccessible.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -35,14 +35,14 @@ typedef struct _GtkStatusbarAccessiblePrivate GtkStatusbarAccessiblePrivate;
|
||||
|
||||
struct _GtkStatusbarAccessible
|
||||
{
|
||||
GtkBoxAccessible parent;
|
||||
GtkContainerAccessible parent;
|
||||
|
||||
GtkStatusbarAccessiblePrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkStatusbarAccessibleClass
|
||||
{
|
||||
GtkBoxAccessibleClass parent_class;
|
||||
GtkContainerAccessibleClass parent_class;
|
||||
};
|
||||
|
||||
GType _gtk_statusbar_accessible_get_type (void);
|
||||
|
||||
@@ -499,7 +499,6 @@ gtk_widget_accessible_notify_gtk (GObject *obj,
|
||||
gtk_widget_accessible_update_tooltip (GTK_WIDGET_ACCESSIBLE (atk_obj),
|
||||
widget);
|
||||
}
|
||||
else
|
||||
return;
|
||||
|
||||
atk_object_notify_state_change (atk_obj, state, value);
|
||||
|
||||
@@ -262,7 +262,7 @@ gtk_window_accessible_ref_state_set (AtkObject *accessible)
|
||||
atk_state_set_add_state (state_set, ATK_STATE_ACTIVE);
|
||||
|
||||
gdk_window = gtk_widget_get_window (widget);
|
||||
if (window)
|
||||
if (gdk_window)
|
||||
{
|
||||
state = gdk_window_get_state (gdk_window);
|
||||
if (state & GDK_WINDOW_STATE_ICONIFIED)
|
||||
@@ -307,6 +307,7 @@ gtk_window_accessible_get_extents (AtkComponent *component,
|
||||
AtkCoordType coord_type)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GdkWindow *window;
|
||||
GdkRectangle rect;
|
||||
gint x_toplevel, y_toplevel;
|
||||
|
||||
@@ -323,7 +324,11 @@ gtk_window_accessible_get_extents (AtkComponent *component,
|
||||
return;
|
||||
}
|
||||
|
||||
gdk_window_get_frame_extents (gtk_widget_get_window (widget), &rect);
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
gdk_window_get_frame_extents (window, &rect);
|
||||
|
||||
*width = rect.width;
|
||||
*height = rect.height;
|
||||
@@ -338,8 +343,7 @@ gtk_window_accessible_get_extents (AtkComponent *component,
|
||||
*y = rect.y;
|
||||
if (coord_type == ATK_XY_WINDOW)
|
||||
{
|
||||
gdk_window_get_origin (gtk_widget_get_window (widget),
|
||||
&x_toplevel, &y_toplevel);
|
||||
gdk_window_get_origin (window, &x_toplevel, &y_toplevel);
|
||||
*x -= x_toplevel;
|
||||
*y -= y_toplevel;
|
||||
}
|
||||
@@ -351,6 +355,7 @@ gtk_window_accessible_get_size (AtkComponent *component,
|
||||
gint *height)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GdkWindow *window;
|
||||
GdkRectangle rect;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (component));
|
||||
@@ -366,7 +371,11 @@ gtk_window_accessible_get_size (AtkComponent *component,
|
||||
return;
|
||||
}
|
||||
|
||||
gdk_window_get_frame_extents (gtk_widget_get_window (widget), &rect);
|
||||
window = gtk_widget_get_window (widget);
|
||||
if (window == NULL)
|
||||
return;
|
||||
|
||||
gdk_window_get_frame_extents (window, &rect);
|
||||
|
||||
*width = rect.width;
|
||||
*height = rect.height;
|
||||
|
||||
@@ -17,8 +17,11 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "gtkgradientprivate.h"
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtkstyleproperties.h"
|
||||
@@ -40,6 +43,11 @@
|
||||
* It is not normally necessary to deal directly with #GtkGradients,
|
||||
* since they are mostly used behind the scenes by #GtkStyleContext and
|
||||
* #GtkCssProvider.
|
||||
*
|
||||
* #GtkGradient is deprecated. It was used internally by GTK's CSS engine
|
||||
* to represent gradients. As its handling is not conforming to modern
|
||||
* web standards, it is not used anymore. If you want to use gradients in
|
||||
* your own code, please use Cairo directly.
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GtkGradient, gtk_gradient,
|
||||
@@ -80,6 +88,8 @@ struct _GtkGradient
|
||||
* Returns: A newly created #GtkGradient
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
GtkGradient *
|
||||
gtk_gradient_new_linear (gdouble x0,
|
||||
@@ -120,6 +130,8 @@ gtk_gradient_new_linear (gdouble x0,
|
||||
* Returns: A newly created #GtkGradient
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
GtkGradient *
|
||||
gtk_gradient_new_radial (gdouble x0,
|
||||
@@ -155,6 +167,8 @@ gtk_gradient_new_radial (gdouble x0,
|
||||
* Adds a stop color to @gradient.
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
void
|
||||
gtk_gradient_add_color_stop (GtkGradient *gradient,
|
||||
@@ -180,6 +194,8 @@ gtk_gradient_add_color_stop (GtkGradient *gradient,
|
||||
* Returns: The same @gradient
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
GtkGradient *
|
||||
gtk_gradient_ref (GtkGradient *gradient)
|
||||
@@ -199,6 +215,8 @@ gtk_gradient_ref (GtkGradient *gradient)
|
||||
* if the reference count reaches 0.
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
void
|
||||
gtk_gradient_unref (GtkGradient *gradient)
|
||||
@@ -239,6 +257,8 @@ gtk_gradient_unref (GtkGradient *gradient)
|
||||
* Returns: %TRUE if the gradient has been resolved
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
gboolean
|
||||
gtk_gradient_resolve (GtkGradient *gradient,
|
||||
@@ -318,11 +338,11 @@ _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
stop = &g_array_index (gradient->stops, ColorStop, i);
|
||||
|
||||
/* if color resolving fails, assume transparency */
|
||||
val = _gtk_symbolic_color_resolve_full (stop->color,
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
&stop_deps);
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (stop->color),
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
&stop_deps);
|
||||
if (val)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
@@ -372,6 +392,8 @@ append_number (GString *str,
|
||||
* for using in GTK CSS files.
|
||||
*
|
||||
* Returns: A string representation for @gradient
|
||||
*
|
||||
* Deprecated: 3.8: #GtkGradient is deprecated.
|
||||
**/
|
||||
char *
|
||||
gtk_gradient_to_string (GtkGradient *gradient)
|
||||
@@ -518,11 +540,9 @@ _gtk_gradient_transition (GtkGradient *start,
|
||||
end_stop = &g_array_index (end->stops, ColorStop, i);
|
||||
|
||||
offset = (1 - progress) * start_stop->offset + progress * end_stop->offset;
|
||||
color = (GtkSymbolicColor *) _gtk_css_value_transition ((GtkCssValue *) start_stop->color,
|
||||
(GtkCssValue *) end_stop->color,
|
||||
property_id,
|
||||
progress);
|
||||
g_assert (color);
|
||||
color = gtk_symbolic_color_new_mix (start_stop->color,
|
||||
end_stop->color,
|
||||
progress);
|
||||
gtk_gradient_add_color_stop (gradient, offset, color);
|
||||
gtk_symbolic_color_unref (color);
|
||||
}
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <gtk/gtkstylecontext.h>
|
||||
#include <gtk/gtkstyleproperties.h>
|
||||
#include <gtk/gtksymboliccolor.h>
|
||||
#include <gtk/deprecated/gtksymboliccolor.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -33,10 +33,12 @@ G_BEGIN_DECLS
|
||||
|
||||
GType gtk_gradient_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkGradient * gtk_gradient_new_linear (gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble x1,
|
||||
gdouble y1);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkGradient * gtk_gradient_new_radial (gdouble x0,
|
||||
gdouble y0,
|
||||
gdouble radius0,
|
||||
@@ -44,21 +46,27 @@ GtkGradient * gtk_gradient_new_radial (gdouble x0,
|
||||
gdouble y1,
|
||||
gdouble radius1);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
void gtk_gradient_add_color_stop (GtkGradient *gradient,
|
||||
gdouble offset,
|
||||
GtkSymbolicColor *color);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkGradient * gtk_gradient_ref (GtkGradient *gradient);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
void gtk_gradient_unref (GtkGradient *gradient);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
gboolean gtk_gradient_resolve (GtkGradient *gradient,
|
||||
GtkStyleProperties *props,
|
||||
cairo_pattern_t **resolved_gradient);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
cairo_pattern_t *
|
||||
gtk_gradient_resolve_for_context
|
||||
(GtkGradient *gradient,
|
||||
GtkStyleContext *context);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
char * gtk_gradient_to_string (GtkGradient *gradient);
|
||||
|
||||
G_END_DECLS
|
||||
@@ -0,0 +1,359 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkhslaprivate.h"
|
||||
#include "gtkstylepropertyprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
#include "gtkstyleproperties.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkwin32themeprivate.h"
|
||||
|
||||
/**
|
||||
* SECTION:gtksymboliccolor
|
||||
* @Short_description: Symbolic colors
|
||||
* @Title: GtkSymbolicColor
|
||||
*
|
||||
* GtkSymbolicColor is a boxed type that represents a symbolic color.
|
||||
* It is the result of parsing a
|
||||
* <link linkend="gtkcssprovider-symbolic-colors">color expression</link>.
|
||||
* To obtain the color represented by a GtkSymbolicColor, it has to
|
||||
* be resolved with gtk_symbolic_color_resolve(), which replaces all
|
||||
* symbolic color references by the colors they refer to (in a given
|
||||
* context) and evaluates mix, shade and other expressions, resulting
|
||||
* in a #GdkRGBA value.
|
||||
*
|
||||
* It is not normally necessary to deal directly with #GtkSymbolicColors,
|
||||
* since they are mostly used behind the scenes by #GtkStyleContext and
|
||||
* #GtkCssProvider.
|
||||
*
|
||||
* #GtkSymbolicColor is deprecated. Symbolic colors are considered an
|
||||
* implementation detail of GTK+.
|
||||
*/
|
||||
|
||||
G_DEFINE_BOXED_TYPE (GtkSymbolicColor, gtk_symbolic_color,
|
||||
gtk_symbolic_color_ref, gtk_symbolic_color_unref)
|
||||
|
||||
struct _GtkSymbolicColor
|
||||
{
|
||||
GtkCssValue *value;
|
||||
gint ref_count;
|
||||
};
|
||||
|
||||
static GtkSymbolicColor *
|
||||
gtk_symbolic_color_new (GtkCssValue *value)
|
||||
{
|
||||
GtkSymbolicColor *symbolic;
|
||||
|
||||
symbolic = g_slice_new0 (GtkSymbolicColor);
|
||||
symbolic->value = value;
|
||||
symbolic->ref_count = 1;
|
||||
|
||||
return symbolic;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_literal:
|
||||
* @color: a #GdkRGBA
|
||||
*
|
||||
* Creates a symbolic color pointing to a literal color.
|
||||
*
|
||||
* Returns: a newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_literal (const GdkRGBA *color)
|
||||
{
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_literal (color));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_name:
|
||||
* @name: color name
|
||||
*
|
||||
* Creates a symbolic color pointing to an unresolved named
|
||||
* color. See gtk_style_context_lookup_color() and
|
||||
* gtk_style_properties_lookup_color().
|
||||
*
|
||||
* Returns: a newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_name (const gchar *name)
|
||||
{
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_name (name));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_shade: (constructor)
|
||||
* @color: another #GtkSymbolicColor
|
||||
* @factor: shading factor to apply to @color
|
||||
*
|
||||
* Creates a symbolic color defined as a shade of
|
||||
* another color. A factor > 1.0 would resolve to
|
||||
* a brighter color, while < 1.0 would resolve to
|
||||
* a darker color.
|
||||
*
|
||||
* Returns: A newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_shade (GtkSymbolicColor *color,
|
||||
gdouble factor)
|
||||
{
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_shade (color->value,
|
||||
factor));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_alpha: (constructor)
|
||||
* @color: another #GtkSymbolicColor
|
||||
* @factor: factor to apply to @color alpha
|
||||
*
|
||||
* Creates a symbolic color by modifying the relative alpha
|
||||
* value of @color. A factor < 1.0 would resolve to a more
|
||||
* transparent color, while > 1.0 would resolve to a more
|
||||
* opaque color.
|
||||
*
|
||||
* Returns: A newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_alpha (GtkSymbolicColor *color,
|
||||
gdouble factor)
|
||||
{
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_alpha (color->value,
|
||||
factor));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_mix: (constructor)
|
||||
* @color1: color to mix
|
||||
* @color2: another color to mix
|
||||
* @factor: mix factor
|
||||
*
|
||||
* Creates a symbolic color defined as a mix of another
|
||||
* two colors. a mix factor of 0 would resolve to @color1,
|
||||
* while a factor of 1 would resolve to @color2.
|
||||
*
|
||||
* Returns: A newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_mix (GtkSymbolicColor *color1,
|
||||
GtkSymbolicColor *color2,
|
||||
gdouble factor)
|
||||
{
|
||||
g_return_val_if_fail (color1 != NULL, NULL);
|
||||
g_return_val_if_fail (color1 != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_mix (color1->value,
|
||||
color2->value,
|
||||
factor));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_new_win32: (constructor)
|
||||
* @theme_class: The theme class to pull color from
|
||||
* @id: The color id
|
||||
*
|
||||
* Creates a symbolic color based on the current win32
|
||||
* theme.
|
||||
*
|
||||
* Note that while this call is available on all platforms
|
||||
* the actual value returned is not reliable on non-win32
|
||||
* platforms.
|
||||
*
|
||||
* Returns: A newly created #GtkSymbolicColor
|
||||
*
|
||||
* Since: 3.4
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
*/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_win32 (const gchar *theme_class,
|
||||
gint id)
|
||||
{
|
||||
g_return_val_if_fail (theme_class != NULL, NULL);
|
||||
|
||||
return gtk_symbolic_color_new (_gtk_css_color_value_new_win32 (theme_class, id));
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_ref:
|
||||
* @color: a #GtkSymbolicColor
|
||||
*
|
||||
* Increases the reference count of @color
|
||||
*
|
||||
* Returns: the same @color
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
GtkSymbolicColor *
|
||||
gtk_symbolic_color_ref (GtkSymbolicColor *color)
|
||||
{
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
color->ref_count++;
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_unref:
|
||||
* @color: a #GtkSymbolicColor
|
||||
*
|
||||
* Decreases the reference count of @color, freeing its memory if the
|
||||
* reference count reaches 0.
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
void
|
||||
gtk_symbolic_color_unref (GtkSymbolicColor *color)
|
||||
{
|
||||
g_return_if_fail (color != NULL);
|
||||
|
||||
if (--color->ref_count)
|
||||
return;
|
||||
|
||||
_gtk_css_value_unref (color->value);
|
||||
|
||||
g_slice_free (GtkSymbolicColor, color);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_resolve:
|
||||
* @color: a #GtkSymbolicColor
|
||||
* @props: (allow-none): #GtkStyleProperties to use when resolving
|
||||
* named colors, or %NULL
|
||||
* @resolved_color: (out): return location for the resolved color
|
||||
*
|
||||
* If @color is resolvable, @resolved_color will be filled in
|
||||
* with the resolved color, and %TRUE will be returned. Generally,
|
||||
* if @color can't be resolved, it is due to it being defined on
|
||||
* top of a named color that doesn't exist in @props.
|
||||
*
|
||||
* When @props is %NULL, resolving of named colors will fail, so if
|
||||
* your @color is or references such a color, this function will
|
||||
* return %FALSE.
|
||||
*
|
||||
* Returns: %TRUE if the color has been resolved
|
||||
*
|
||||
* Since: 3.0
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
gboolean
|
||||
gtk_symbolic_color_resolve (GtkSymbolicColor *color,
|
||||
GtkStyleProperties *props,
|
||||
GdkRGBA *resolved_color)
|
||||
{
|
||||
GdkRGBA pink = { 1.0, 0.5, 0.5, 1.0 };
|
||||
GtkCssValue *v, *current;
|
||||
|
||||
g_return_val_if_fail (color != NULL, FALSE);
|
||||
g_return_val_if_fail (resolved_color != NULL, FALSE);
|
||||
g_return_val_if_fail (props == NULL || GTK_IS_STYLE_PROPERTIES (props), FALSE);
|
||||
|
||||
current = _gtk_css_rgba_value_new_from_rgba (&pink);
|
||||
v = _gtk_css_color_value_resolve (color->value,
|
||||
GTK_STYLE_PROVIDER_PRIVATE (props),
|
||||
current,
|
||||
0,
|
||||
NULL);
|
||||
_gtk_css_value_unref (current);
|
||||
if (v == NULL)
|
||||
return FALSE;
|
||||
|
||||
*resolved_color = *_gtk_css_rgba_value_get_rgba (v);
|
||||
_gtk_css_value_unref (v);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_symbolic_color_to_string:
|
||||
* @color: color to convert to a string
|
||||
*
|
||||
* Converts the given @color to a string representation. This is useful
|
||||
* both for debugging and for serialization of strings. The format of
|
||||
* the string may change between different versions of GTK, but it is
|
||||
* guaranteed that the GTK css parser is able to read the string and
|
||||
* create the same symbolic color from it.
|
||||
*
|
||||
* Returns: a new string representing @color
|
||||
*
|
||||
* Deprecated: 3.8: #GtkSymbolicColor is deprecated.
|
||||
**/
|
||||
char *
|
||||
gtk_symbolic_color_to_string (GtkSymbolicColor *color)
|
||||
{
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
return _gtk_css_value_to_string (color->value);
|
||||
}
|
||||
|
||||
GtkSymbolicColor *
|
||||
_gtk_css_symbolic_value_new (GtkCssParser *parser)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
value = _gtk_css_color_value_parse (parser);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
|
||||
return gtk_symbolic_color_new (value);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_symbolic_color_get_css_value (GtkSymbolicColor *symbolic)
|
||||
{
|
||||
return symbolic->value;
|
||||
}
|
||||
|
||||
@@ -31,23 +31,33 @@ G_BEGIN_DECLS
|
||||
|
||||
GType gtk_symbolic_color_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_literal (const GdkRGBA *color);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_name (const gchar *name);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_shade (GtkSymbolicColor *color,
|
||||
gdouble factor);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_alpha (GtkSymbolicColor *color,
|
||||
gdouble factor);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_mix (GtkSymbolicColor *color1,
|
||||
GtkSymbolicColor *color2,
|
||||
gdouble factor);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_new_win32 (const gchar *theme_class,
|
||||
gint id);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
GtkSymbolicColor * gtk_symbolic_color_ref (GtkSymbolicColor *color);
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
void gtk_symbolic_color_unref (GtkSymbolicColor *color);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
char * gtk_symbolic_color_to_string (GtkSymbolicColor *color);
|
||||
|
||||
GDK_DEPRECATED_IN_3_8
|
||||
gboolean gtk_symbolic_color_resolve (GtkSymbolicColor *color,
|
||||
GtkStyleProperties *props,
|
||||
GdkRGBA *resolved_color);
|
||||
@@ -0,0 +1,33 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2011 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_SYMBOLIC_COLOR_PRIVATE_H__
|
||||
#define __GTK_SYMBOLIC_COLOR_PRIVATE_H__
|
||||
|
||||
#include "gtk/deprecated/gtksymboliccolor.h"
|
||||
#include "gtk/gtkcssparserprivate.h"
|
||||
#include "gtk/gtkcssvalueprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GtkSymbolicColor * _gtk_css_symbolic_value_new (GtkCssParser *parser);
|
||||
|
||||
GtkCssValue * _gtk_symbolic_color_get_css_value (GtkSymbolicColor *symbolic);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_SYMBOLIC_COLOR_PRIVATE_H__ */
|
||||
+2
-4
@@ -65,12 +65,10 @@ main (int argc, char *argv[])
|
||||
#endif
|
||||
#endif
|
||||
|
||||
g_type_init ();
|
||||
|
||||
/* Translators: this message will appear immediately after the */
|
||||
/* usage string - Usage: COMMAND [OPTION]... <THIS_MESSAGE> */
|
||||
/* usage string - Usage: COMMAND [OPTION]… <THIS_MESSAGE> */
|
||||
context =
|
||||
g_option_context_new (_("APPLICATION [URI...] - launch an APPLICATION with URI."));
|
||||
g_option_context_new (_("APPLICATION [URI…] — launch an APPLICATION with URI."));
|
||||
|
||||
/* Translators: this message will appear after the usage string */
|
||||
/* and before the list of options. */
|
||||
|
||||
+24
-382
@@ -432,26 +432,19 @@ GtkButton.check:active:prelight {
|
||||
.scale {
|
||||
background-color: transparent;
|
||||
-GtkScale-value-spacing: 0;
|
||||
-GtkScale-slider-length: 12;
|
||||
-GtkScale-slider-length: 9;
|
||||
-GtkRange-slider-width: 20;
|
||||
-GtkRange-trough-border: 0;
|
||||
}
|
||||
|
||||
.scale.trough {
|
||||
margin: 8px 0;
|
||||
border-style: none;
|
||||
border-width: 0;
|
||||
background-image: -gtk-win32-theme-part(trackbar, 1 1);
|
||||
background-image: -gtk-win32-theme-part(trackbar, 1 1, margins (2 0 2 0));
|
||||
}
|
||||
|
||||
.scale.trough.vertical {
|
||||
margin: 0 8px;
|
||||
background-image: -gtk-win32-theme-part(trackbar, 1 1);
|
||||
}
|
||||
|
||||
.scale.mark {
|
||||
/* defines the color of the actuall marks on the scale */
|
||||
color: shade(@bg_color, 0.6);
|
||||
background-image: -gtk-win32-theme-part(trackbar, 1 1, margins (0 2 0 2));
|
||||
}
|
||||
|
||||
.scale.slider {
|
||||
@@ -500,89 +493,89 @@ GtkButton.check:active:prelight {
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 1, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 1);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below:prelight {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 2, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 2);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below:active,
|
||||
.scale.slider.scale-has-marks-below:prelight:active {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 3, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 3);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below:focus {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 4, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 4);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below:insensitive {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 5, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 4 5);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below.vertical {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 1, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 1);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below.vertical:prelight {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 2, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 2);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below.vertical:active,
|
||||
.scale.slider.scale-has-marks-below.vertical:prelight:active {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 3, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 3);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below.vertical:focus {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 4, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 4);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-below.vertical:insensitive {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 5, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 8 5);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.scale.slider.scale-has-marks-above {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 1, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 1);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above:prelight {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 2, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 2);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above:active,
|
||||
.scale.slider.scale-has-marks-above:prelight:active {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 3, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 3);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above:focus {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 4, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 4);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above:insensitive {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 5, margins(0 -2 0 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 5 5);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above.vertical {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 1, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 1);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above.vertical:prelight {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 2, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 2);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above.vertical:active,
|
||||
.scale.slider.scale-has-marks-above.vertical:prelight:active {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 3, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 3);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above.vertical:focus {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 4, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 4);
|
||||
}
|
||||
|
||||
.scale.slider.scale-has-marks-above.vertical:insensitive {
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 5, margins(0 0 -2 0));
|
||||
background-image: -gtk-win32-theme-part(trackbar, 7 5);
|
||||
}
|
||||
|
||||
/* Progress bars */
|
||||
@@ -798,7 +791,7 @@ GtkSwitch.trough:active {
|
||||
/* Assistant */
|
||||
|
||||
GtkAssistant .sidebar .highlight {
|
||||
background-color: gray;
|
||||
background-color: blue;
|
||||
font: bold;
|
||||
}
|
||||
|
||||
@@ -841,354 +834,3 @@ GtkStatusbar > GtkFrame {
|
||||
background-image: -gtk-win32-theme-part(status, 3 1);
|
||||
}
|
||||
*/
|
||||
|
||||
@keyframes spinner {
|
||||
0% { background-image: none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
0% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none; }
|
||||
8% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)); }
|
||||
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
|
||||
16% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)); }
|
||||
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
|
||||
25% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)); }
|
||||
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
|
||||
33% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)); }
|
||||
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
|
||||
41% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)); }
|
||||
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
|
||||
50% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)); }
|
||||
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
|
||||
58% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)); }
|
||||
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
|
||||
66% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)); }
|
||||
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
|
||||
75% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)); }
|
||||
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
|
||||
83% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)); }
|
||||
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
|
||||
91% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)); }
|
||||
100% { background-image: none,
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
100% { background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)); }
|
||||
}
|
||||
|
||||
.spinner {
|
||||
background-color: transparent;
|
||||
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
|
||||
background-position: 25.00% 6.70%, 6.70% 25.00%, 0.00% 50.00%, 6.70% 75.00%, 25.00% 93.30%, 50.00% 100.00%, 75.00% 93.30%, 93.30% 75.00%, 100.00% 50.00%, 93.30% 25.00%, 75.00% 6.70%, 50.00% 0.00%;
|
||||
background-size: 20% 20%;
|
||||
background-repeat: no-repeat;
|
||||
transition: background-image 500ms ease-out;
|
||||
}
|
||||
|
||||
.spinner:active {
|
||||
background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.916667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.75)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.666667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.583333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.5)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.416667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.333333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.25)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.166667)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(alpha(currentColor, 0.0833333)), to(transparent)),
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
|
||||
animation: spinner 1s infinite linear;
|
||||
}
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
#include <gtk/gtkfontchooserdialog.h>
|
||||
#include <gtk/gtkfontchooserwidget.h>
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtkgradient.h>
|
||||
#include <gtk/gtkgrid.h>
|
||||
#include <gtk/gtkiconfactory.h>
|
||||
#include <gtk/gtkicontheme.h>
|
||||
@@ -185,7 +184,6 @@
|
||||
#include <gtk/gtkstyleproperties.h>
|
||||
#include <gtk/gtkstyleprovider.h>
|
||||
#include <gtk/gtkswitch.h>
|
||||
#include <gtk/gtksymboliccolor.h>
|
||||
#include <gtk/gtktextattributes.h>
|
||||
#include <gtk/gtktextbuffer.h>
|
||||
#include <gtk/gtktextbufferrichtext.h>
|
||||
@@ -229,6 +227,7 @@
|
||||
#include <gtk/deprecated/gtkcolorsel.h>
|
||||
#include <gtk/deprecated/gtkcolorseldialog.h>
|
||||
#include <gtk/deprecated/gtkfontsel.h>
|
||||
#include <gtk/deprecated/gtkgradient.h>
|
||||
#include <gtk/deprecated/gtkhandlebox.h>
|
||||
#include <gtk/deprecated/gtkhbbox.h>
|
||||
#include <gtk/deprecated/gtkhbox.h>
|
||||
@@ -239,6 +238,7 @@
|
||||
#include <gtk/deprecated/gtkhseparator.h>
|
||||
#include <gtk/deprecated/gtkrc.h>
|
||||
#include <gtk/deprecated/gtkstyle.h>
|
||||
#include <gtk/deprecated/gtksymboliccolor.h>
|
||||
#include <gtk/deprecated/gtktable.h>
|
||||
#include <gtk/deprecated/gtktearoffmenuitem.h>
|
||||
#include <gtk/deprecated/gtkvbbox.h>
|
||||
|
||||
@@ -2589,6 +2589,8 @@ gtk_level_bar_set_min_value
|
||||
gtk_level_bar_get_min_value
|
||||
gtk_level_bar_set_max_value
|
||||
gtk_level_bar_get_max_value
|
||||
gtk_level_bar_set_inverted
|
||||
gtk_level_bar_get_inverted
|
||||
gtk_level_bar_add_offset_value
|
||||
gtk_level_bar_remove_offset_value
|
||||
gtk_level_bar_get_offset_value
|
||||
@@ -3706,6 +3708,7 @@ gtk_widget_is_composited
|
||||
gtk_widget_is_drawable
|
||||
gtk_widget_is_focus
|
||||
gtk_widget_is_sensitive
|
||||
gtk_widget_is_visible
|
||||
gtk_widget_is_toplevel
|
||||
gtk_widget_keynav_failed
|
||||
gtk_widget_list_accel_closures
|
||||
|
||||
@@ -2395,8 +2395,6 @@ create_credits_page (GtkAboutDialog *about)
|
||||
gtk_widget_set_valign (grid, GTK_ALIGN_START);
|
||||
gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (sw), grid);
|
||||
|
||||
row = 0;
|
||||
|
||||
if (priv->authors != NULL)
|
||||
add_credits_section (about, GTK_GRID (grid), &row, _("Created by"), priv->authors);
|
||||
|
||||
|
||||
@@ -189,7 +189,7 @@ gtk_action_helper_action_removed (GtkActionHelper *helper)
|
||||
|
||||
if (helper->active)
|
||||
{
|
||||
helper->active = FALSE;
|
||||
helper->enabled = FALSE;
|
||||
gtk_action_helper_report_change (helper, PROP_ACTIVE);
|
||||
}
|
||||
|
||||
|
||||
@@ -225,7 +225,7 @@ other_application_dialog_response_cb (GtkDialog *dialog,
|
||||
if (response_id != GTK_RESPONSE_OK)
|
||||
{
|
||||
/* reset the active item, otherwise we are stuck on
|
||||
* 'Other application...'
|
||||
* 'Other application…'
|
||||
*/
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (self), self->priv->last_active);
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
@@ -287,7 +287,7 @@ gtk_app_chooser_button_ensure_dialog_item (GtkAppChooserButton *self,
|
||||
|
||||
gtk_list_store_insert_after (self->priv->store, &iter, &iter2);
|
||||
real_insert_custom_item (self, CUSTOM_ITEM_OTHER_APP,
|
||||
_("Other application..."), NULL,
|
||||
_("Other application…"), NULL,
|
||||
FALSE, &iter);
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ gtk_app_chooser_button_class_init (GtkAppChooserButtonClass *klass)
|
||||
*/
|
||||
pspec =
|
||||
g_param_spec_boolean ("show-dialog-item",
|
||||
P_("Include an 'Other...' item"),
|
||||
P_("Include an 'Other…' item"),
|
||||
P_("Whether the combobox should include an item that triggers a GtkAppChooserDialog"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -768,8 +768,9 @@ gtk_application_class_init (GtkApplicationClass *class)
|
||||
*
|
||||
* Creates a new #GtkApplication instance.
|
||||
*
|
||||
* This function calls g_type_init() for you. gtk_init() is called
|
||||
* as soon as the application gets registered as the primary instance.
|
||||
* When using #GtkApplication, it is not necessary to call gtk_init()
|
||||
* manually. It is called as soon as the application gets registered as
|
||||
* the primary instance.
|
||||
*
|
||||
* Concretely, gtk_init() is called in the default handler for the
|
||||
* #GApplication::startup signal. Therefore, #GtkApplication subclasses should
|
||||
@@ -800,8 +801,6 @@ gtk_application_new (const gchar *application_id,
|
||||
{
|
||||
g_return_val_if_fail (application_id == NULL || g_application_id_is_valid (application_id), NULL);
|
||||
|
||||
g_type_init ();
|
||||
|
||||
return g_object_new (GTK_TYPE_APPLICATION,
|
||||
"application-id", application_id,
|
||||
"flags", flags,
|
||||
|
||||
+102
-58
@@ -56,7 +56,12 @@ static void gtk_bin_forall (GtkContainer *container,
|
||||
gpointer callback_data);
|
||||
static GType gtk_bin_child_type (GtkContainer *container);
|
||||
|
||||
|
||||
static void gtk_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
gint *natural_width);
|
||||
static void gtk_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_bin_get_preferred_width_for_height (GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
@@ -65,6 +70,8 @@ static void gtk_bin_get_preferred_height_for_width (GtkWidget
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GtkBin, gtk_bin, GTK_TYPE_CONTAINER)
|
||||
|
||||
@@ -74,8 +81,11 @@ gtk_bin_class_init (GtkBinClass *class)
|
||||
GtkWidgetClass *widget_class = (GtkWidgetClass*) class;
|
||||
GtkContainerClass *container_class = (GtkContainerClass*) class;
|
||||
|
||||
widget_class->get_preferred_width = gtk_bin_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_bin_get_preferred_height;
|
||||
widget_class->get_preferred_width_for_height = gtk_bin_get_preferred_width_for_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_bin_get_preferred_height_for_width;
|
||||
widget_class->size_allocate = gtk_bin_size_allocate;
|
||||
|
||||
container_class->add = gtk_bin_add;
|
||||
container_class->remove = gtk_bin_remove;
|
||||
@@ -170,43 +180,59 @@ gtk_bin_forall (GtkContainer *container,
|
||||
(* callback) (priv->child, callback_data);
|
||||
}
|
||||
|
||||
|
||||
/* GtkBin widgets define the padding and borders independantly so
|
||||
* we cannot provide a generic get_size() for the same reason
|
||||
* we never implemented size_request() here.
|
||||
*
|
||||
* But for cases where the GtkBin class's padding is constant and
|
||||
* does not vary based on allocation (most cases), we can at least
|
||||
* deduce a common code path for the get_width_for_height()/get_height_for_width()
|
||||
* cases by using the delta of the base size requsts.
|
||||
*/
|
||||
static void
|
||||
get_child_padding_delta (GtkBin *bin,
|
||||
gint *delta_h,
|
||||
gint *delta_v)
|
||||
static int
|
||||
gtk_bin_get_effective_border_width (GtkBin *bin)
|
||||
{
|
||||
if (GTK_CONTAINER_CLASS (GTK_BIN_GET_CLASS (bin))->_handle_border_width)
|
||||
return 0;
|
||||
|
||||
return gtk_container_get_border_width (GTK_CONTAINER (bin));
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
gint hmin, vmin, hnat, vnat, child_hmin, child_vmin;
|
||||
gint border_width;
|
||||
|
||||
/* we can't use gtk_widget_get_preferred_width() wrapper
|
||||
* because we want our "original" request, not any external
|
||||
* adjustments from set_size_request() or whatever. we have
|
||||
* to ask for natural also because NULL isn't allowed for the
|
||||
* direct vfuncs
|
||||
*/
|
||||
GTK_WIDGET_GET_CLASS (bin)->get_preferred_width (GTK_WIDGET (bin), &hmin, &hnat);
|
||||
GTK_WIDGET_GET_CLASS (bin)->adjust_size_request (GTK_WIDGET (bin),
|
||||
GTK_ORIENTATION_HORIZONTAL, &hmin, &hnat);
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gtk_widget_get_preferred_width (priv->child,
|
||||
&child_min, &child_nat);
|
||||
*minimum_width = child_min;
|
||||
*natural_width = child_nat;
|
||||
}
|
||||
|
||||
GTK_WIDGET_GET_CLASS (bin)->get_preferred_height (GTK_WIDGET (bin), &vmin, &vnat);
|
||||
GTK_WIDGET_GET_CLASS (bin)->adjust_size_request (GTK_WIDGET (bin),
|
||||
GTK_ORIENTATION_VERTICAL, &vmin, &vnat);
|
||||
border_width = gtk_bin_get_effective_border_width (bin);
|
||||
*minimum_width += 2 * border_width;
|
||||
*natural_width += 2 * border_width;
|
||||
}
|
||||
|
||||
gtk_widget_get_preferred_width (priv->child, &child_hmin, NULL);
|
||||
gtk_widget_get_preferred_height (priv->child, &child_vmin, NULL);
|
||||
static void
|
||||
gtk_bin_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
gint border_width;
|
||||
|
||||
*delta_h = hmin - child_hmin;
|
||||
*delta_v = vmin - child_vmin;
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gtk_widget_get_preferred_height (priv->child,
|
||||
&child_min, &child_nat);
|
||||
*minimum_height = child_min;
|
||||
*natural_height = child_nat;
|
||||
}
|
||||
|
||||
border_width = gtk_bin_get_effective_border_width (bin);
|
||||
*minimum_height += 2 * border_width;
|
||||
*natural_height += 2 * border_width;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -217,24 +243,22 @@ gtk_bin_get_preferred_width_for_height (GtkWidget *widget,
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
gint hdelta, vdelta, child_min, child_nat;
|
||||
gint border_width;
|
||||
|
||||
if (priv->child)
|
||||
border_width = gtk_bin_get_effective_border_width (bin);
|
||||
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
get_child_padding_delta (bin, &hdelta, &vdelta);
|
||||
|
||||
gtk_widget_get_preferred_width_for_height (priv->child,
|
||||
height - vdelta,
|
||||
gint child_min, child_nat;
|
||||
gtk_widget_get_preferred_width_for_height (priv->child, height - 2 * border_width,
|
||||
&child_min, &child_nat);
|
||||
|
||||
if (minimum_width)
|
||||
*minimum_width = child_min + hdelta;
|
||||
|
||||
if (natural_width)
|
||||
*natural_width = child_nat + hdelta;
|
||||
*minimum_width = child_min;
|
||||
*natural_width = child_nat;
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_GET_CLASS (widget)->get_preferred_width (widget, minimum_width, natural_width);
|
||||
|
||||
*minimum_width += 2 * border_width;
|
||||
*natural_width += 2 * border_width;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -245,26 +269,46 @@ gtk_bin_get_preferred_height_for_width (GtkWidget *widget,
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
gint hdelta, vdelta, child_min, child_nat;
|
||||
gint border_width;
|
||||
|
||||
if (priv->child)
|
||||
border_width = gtk_bin_get_effective_border_width (bin);
|
||||
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
get_child_padding_delta (bin, &hdelta, &vdelta);
|
||||
|
||||
gtk_widget_get_preferred_height_for_width (priv->child,
|
||||
width - hdelta,
|
||||
gint child_min, child_nat;
|
||||
gtk_widget_get_preferred_height_for_width (priv->child, width - 2 * border_width,
|
||||
&child_min, &child_nat);
|
||||
|
||||
if (minimum_height)
|
||||
*minimum_height = child_min + vdelta;
|
||||
|
||||
if (natural_height)
|
||||
*natural_height = child_nat + vdelta;
|
||||
*minimum_height = child_min;
|
||||
*natural_height = child_nat;
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height (widget, minimum_height, natural_height);
|
||||
|
||||
*minimum_height += 2 * border_width;
|
||||
*natural_height += 2 * border_width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
if (priv->child && gtk_widget_get_visible (priv->child))
|
||||
{
|
||||
GtkAllocation child_allocation;
|
||||
gint border_width = gtk_bin_get_effective_border_width (bin);
|
||||
|
||||
child_allocation.x = allocation->x + border_width;
|
||||
child_allocation.y = allocation->y + border_width;
|
||||
child_allocation.width = allocation->width - 2 * border_width;
|
||||
child_allocation.height = allocation->height - 2 * border_width;
|
||||
|
||||
gtk_widget_size_allocate (priv->child, &child_allocation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_bin_get_child:
|
||||
|
||||
@@ -62,8 +62,8 @@ static void
|
||||
gtk_border_image_compute_border_size (GtkBorderImageSliceSize sizes[3],
|
||||
double offset,
|
||||
double area_size,
|
||||
int start_border_width,
|
||||
int end_border_width,
|
||||
double start_border_width,
|
||||
double end_border_width,
|
||||
const GtkCssValue *start_border,
|
||||
const GtkCssValue *end_border)
|
||||
{
|
||||
@@ -235,7 +235,7 @@ gtk_border_image_compute_slice_size (GtkBorderImageSliceSize sizes[3],
|
||||
|
||||
void
|
||||
_gtk_border_image_render (GtkBorderImage *image,
|
||||
GtkBorder *border_width,
|
||||
const double border_width[4],
|
||||
cairo_t *cr,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
@@ -270,15 +270,15 @@ _gtk_border_image_render (GtkBorderImage *image,
|
||||
gtk_border_image_compute_border_size (horizontal_border,
|
||||
x,
|
||||
width,
|
||||
border_width->left,
|
||||
border_width->right,
|
||||
border_width[GTK_CSS_LEFT],
|
||||
border_width[GTK_CSS_RIGHT],
|
||||
_gtk_css_border_value_get_left (image->width),
|
||||
_gtk_css_border_value_get_right (image->width));
|
||||
gtk_border_image_compute_border_size (vertical_border,
|
||||
y,
|
||||
height,
|
||||
border_width->top,
|
||||
border_width->bottom,
|
||||
border_width[GTK_CSS_TOP],
|
||||
border_width[GTK_CSS_BOTTOM],
|
||||
_gtk_css_border_value_get_top (image->width),
|
||||
_gtk_css_border_value_get_bottom(image->width));
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ gboolean _gtk_border_image_init (GtkBorderImage *imag
|
||||
GtkThemingEngine *engine);
|
||||
|
||||
void _gtk_border_image_render (GtkBorderImage *image,
|
||||
GtkBorder *border_width,
|
||||
const double border_width[4],
|
||||
cairo_t *cr,
|
||||
gdouble x,
|
||||
gdouble y,
|
||||
|
||||
+2
-2
@@ -87,7 +87,7 @@
|
||||
#include "gtksizerequest.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "a11y/gtkboxaccessible.h"
|
||||
#include "a11y/gtkcontaineraccessible.h"
|
||||
|
||||
|
||||
enum {
|
||||
@@ -317,7 +317,7 @@ gtk_box_class_init (GtkBoxClass *class)
|
||||
|
||||
g_type_class_add_private (object_class, sizeof (GtkBoxPrivate));
|
||||
|
||||
gtk_widget_class_set_accessible_type (widget_class, GTK_TYPE_BOX_ACCESSIBLE);
|
||||
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_FILLER);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -413,7 +413,7 @@ gtk_cell_renderer_accel_get_preferred_width (GtkCellRenderer *cell,
|
||||
GtkRequisition min_req, nat_req;
|
||||
|
||||
if (priv->sizing_label == NULL)
|
||||
priv->sizing_label = gtk_label_new (_("New accelerator..."));
|
||||
priv->sizing_label = gtk_label_new (_("New accelerator…"));
|
||||
|
||||
gtk_widget_get_preferred_size (priv->sizing_label, &min_req, &nat_req);
|
||||
|
||||
@@ -744,7 +744,7 @@ gtk_cell_renderer_accel_start_editing (GtkCellRenderer *cell,
|
||||
* an accelerator when the cell is clicked to change the
|
||||
* acelerator.
|
||||
*/
|
||||
gtk_label_set_text (GTK_LABEL (label), _("New accelerator..."));
|
||||
gtk_label_set_text (GTK_LABEL (label), _("New accelerator…"));
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (eventbox), label);
|
||||
|
||||
|
||||
+37
-137
@@ -38,14 +38,6 @@ enum {
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@interface GtkClipboardOwner : NSObject {
|
||||
GtkClipboard *clipboard;
|
||||
@public
|
||||
gboolean setting_same_owner;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
typedef struct _GtkClipboardClass GtkClipboardClass;
|
||||
|
||||
struct _GtkClipboard
|
||||
@@ -53,8 +45,6 @@ struct _GtkClipboard
|
||||
GObject parent_instance;
|
||||
|
||||
NSPasteboard *pasteboard;
|
||||
GtkClipboardOwner *owner;
|
||||
NSInteger change_count;
|
||||
|
||||
GdkAtom selection;
|
||||
|
||||
@@ -86,15 +76,16 @@ struct _GtkClipboardClass
|
||||
GdkEventOwnerChange *event);
|
||||
};
|
||||
|
||||
static void gtk_clipboard_class_init (GtkClipboardClass *class);
|
||||
static void gtk_clipboard_finalize (GObject *object);
|
||||
static void gtk_clipboard_owner_change (GtkClipboard *clipboard,
|
||||
GdkEventOwnerChange *event);
|
||||
@interface GtkClipboardOwner : NSObject {
|
||||
GtkClipboard *clipboard;
|
||||
|
||||
static void clipboard_unset (GtkClipboard *clipboard);
|
||||
static GtkClipboard *clipboard_peek (GdkDisplay *display,
|
||||
GdkAtom selection,
|
||||
gboolean only_if_exists);
|
||||
GtkClipboardGetFunc get_func;
|
||||
GtkClipboardClearFunc clear_func;
|
||||
gpointer user_data;
|
||||
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation GtkClipboardOwner
|
||||
-(void)pasteboard:(NSPasteboard *)sender provideDataForType:(NSString *)type
|
||||
@@ -126,16 +117,12 @@ static GtkClipboard *clipboard_peek (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
/* pasteboardChangedOwner is not called immediately, and it's not called
|
||||
* reliably. It is somehow documented in the apple api docs, but the docs
|
||||
* suck and don't really give clear instructions. Therefore we track
|
||||
* changeCount in several places below and clear the clipboard if it
|
||||
* changed.
|
||||
*/
|
||||
- (void)pasteboardChangedOwner:(NSPasteboard *)sender
|
||||
{
|
||||
if (! setting_same_owner)
|
||||
clipboard_unset (clipboard);
|
||||
if (clear_func)
|
||||
clear_func (clipboard, user_data);
|
||||
|
||||
[self release];
|
||||
}
|
||||
|
||||
- (id)initWithClipboard:(GtkClipboard *)aClipboard
|
||||
@@ -145,7 +132,6 @@ static GtkClipboard *clipboard_peek (GdkDisplay *display,
|
||||
if (self)
|
||||
{
|
||||
clipboard = aClipboard;
|
||||
setting_same_owner = FALSE;
|
||||
}
|
||||
|
||||
return self;
|
||||
@@ -153,6 +139,15 @@ static GtkClipboard *clipboard_peek (GdkDisplay *display,
|
||||
|
||||
@end
|
||||
|
||||
static void gtk_clipboard_class_init (GtkClipboardClass *class);
|
||||
static void gtk_clipboard_finalize (GObject *object);
|
||||
static void gtk_clipboard_owner_change (GtkClipboard *clipboard,
|
||||
GdkEventOwnerChange *event);
|
||||
|
||||
static void clipboard_unset (GtkClipboard *clipboard);
|
||||
static GtkClipboard *clipboard_peek (GdkDisplay *display,
|
||||
GdkAtom selection,
|
||||
gboolean only_if_exists);
|
||||
|
||||
static const gchar clipboards_owned_key[] = "gtk-clipboards-owned";
|
||||
static GQuark clipboards_owned_key_id = 0;
|
||||
@@ -336,6 +331,10 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
|
||||
NSSet *types;
|
||||
NSAutoreleasePool *pool;
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
owner = [[GtkClipboardOwner alloc] initWithClipboard:clipboard];
|
||||
|
||||
if (!(clipboard->have_owner && have_owner) ||
|
||||
clipboard->user_data != user_data)
|
||||
{
|
||||
@@ -350,44 +349,17 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
|
||||
clipboard->user_data != user_data)
|
||||
{
|
||||
(*clear_func) (clipboard, user_data);
|
||||
[pool release];
|
||||
return FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
[pool release];
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
types = _gtk_quartz_target_entries_to_pasteboard_types (targets, n_targets);
|
||||
|
||||
/* call declareTypes before setting the clipboard members because
|
||||
* declareTypes might clear the clipboard
|
||||
*/
|
||||
if (user_data && user_data == clipboard->user_data)
|
||||
{
|
||||
owner = [clipboard->owner retain];
|
||||
|
||||
owner->setting_same_owner = TRUE;
|
||||
clipboard->change_count = [clipboard->pasteboard declareTypes: [types allObjects]
|
||||
owner: owner];
|
||||
owner->setting_same_owner = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
owner = [[GtkClipboardOwner alloc] initWithClipboard:clipboard];
|
||||
|
||||
clipboard->change_count = [clipboard->pasteboard declareTypes: [types allObjects]
|
||||
owner: owner];
|
||||
}
|
||||
|
||||
[owner release];
|
||||
[types release];
|
||||
[pool release];
|
||||
|
||||
clipboard->owner = owner;
|
||||
clipboard->user_data = user_data;
|
||||
clipboard->have_owner = have_owner;
|
||||
if (have_owner)
|
||||
@@ -399,6 +371,12 @@ gtk_clipboard_set_contents (GtkClipboard *clipboard,
|
||||
gtk_target_list_unref (clipboard->target_list);
|
||||
clipboard->target_list = gtk_target_list_new (targets, n_targets);
|
||||
|
||||
types = _gtk_quartz_target_entries_to_pasteboard_types (targets, n_targets);
|
||||
|
||||
[clipboard->pasteboard declareTypes:[types allObjects] owner:owner];
|
||||
[types release];
|
||||
[pool release];
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -442,12 +420,6 @@ gtk_clipboard_get_owner (GtkClipboard *clipboard)
|
||||
{
|
||||
g_return_val_if_fail (clipboard != NULL, NULL);
|
||||
|
||||
if (clipboard->change_count < [clipboard->pasteboard changeCount])
|
||||
{
|
||||
clipboard_unset (clipboard);
|
||||
clipboard->change_count = [clipboard->pasteboard changeCount];
|
||||
}
|
||||
|
||||
if (clipboard->have_owner)
|
||||
return clipboard->user_data;
|
||||
else
|
||||
@@ -476,8 +448,7 @@ clipboard_unset (GtkClipboard *clipboard)
|
||||
clipboard->n_storable_targets = -1;
|
||||
g_free (clipboard->storable_targets);
|
||||
clipboard->storable_targets = NULL;
|
||||
|
||||
clipboard->owner = NULL;
|
||||
|
||||
clipboard->get_func = NULL;
|
||||
clipboard->clear_func = NULL;
|
||||
clipboard->user_data = NULL;
|
||||
@@ -502,8 +473,6 @@ clipboard_unset (GtkClipboard *clipboard)
|
||||
void
|
||||
gtk_clipboard_clear (GtkClipboard *clipboard)
|
||||
{
|
||||
clipboard_unset (clipboard);
|
||||
|
||||
[clipboard->pasteboard declareTypes:nil owner:nil];
|
||||
}
|
||||
|
||||
@@ -687,12 +656,6 @@ gtk_clipboard_wait_for_contents (GtkClipboard *clipboard,
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
GtkSelectionData *selection_data = NULL;
|
||||
|
||||
if (clipboard->change_count < [clipboard->pasteboard changeCount])
|
||||
{
|
||||
clipboard_unset (clipboard);
|
||||
clipboard->change_count = [clipboard->pasteboard changeCount];
|
||||
}
|
||||
|
||||
if (target == gdk_atom_intern_static_string ("TARGETS"))
|
||||
{
|
||||
NSArray *types = [clipboard->pasteboard types];
|
||||
@@ -1039,74 +1002,11 @@ gtk_clipboard_set_can_store (GtkClipboard *clipboard,
|
||||
void
|
||||
gtk_clipboard_store (GtkClipboard *clipboard)
|
||||
{
|
||||
int i;
|
||||
int n_targets = 0;
|
||||
GtkTargetEntry *targets;
|
||||
|
||||
g_return_if_fail (GTK_IS_CLIPBOARD (clipboard));
|
||||
|
||||
if (!clipboard->target_list || !clipboard->get_func)
|
||||
return;
|
||||
|
||||
/* We simply store all targets into the OS X clipboard. We should be
|
||||
* using the functions gdk_display_supports_clipboard_persistence() and
|
||||
* gdk_display_store_clipboard(), but since for OS X the clipboard support
|
||||
* was implemented in GTK+ and not through GdkSelections, we do it this
|
||||
* way. Doing this properly could be worthwhile to implement in the future.
|
||||
*/
|
||||
|
||||
targets = gtk_target_table_new_from_list (clipboard->target_list,
|
||||
&n_targets);
|
||||
for (i = 0; i < n_targets; i++)
|
||||
{
|
||||
GtkSelectionData selection_data;
|
||||
|
||||
/* in each loop iteration, check if the content is still
|
||||
* there, because calling get_func() can do anything to
|
||||
* the clipboard
|
||||
*/
|
||||
if (!clipboard->target_list || !clipboard->get_func)
|
||||
break;
|
||||
|
||||
memset (&selection_data, 0, sizeof (GtkSelectionData));
|
||||
|
||||
selection_data.selection = clipboard->selection;
|
||||
selection_data.target = gdk_atom_intern_static_string (targets[i].target);
|
||||
selection_data.display = gdk_display_get_default ();
|
||||
selection_data.length = -1;
|
||||
|
||||
clipboard->get_func (clipboard, &selection_data,
|
||||
targets[i].info, clipboard->user_data);
|
||||
|
||||
if (selection_data.length >= 0)
|
||||
_gtk_quartz_set_selection_data_for_pasteboard (clipboard->pasteboard,
|
||||
&selection_data);
|
||||
|
||||
g_free (selection_data.data);
|
||||
}
|
||||
|
||||
if (targets)
|
||||
gtk_target_table_free (targets, n_targets);
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_clipboard_store_all (void)
|
||||
{
|
||||
GtkClipboard *clipboard;
|
||||
GSList *displays, *list;
|
||||
|
||||
displays = gdk_display_manager_list_displays (gdk_display_manager_get ());
|
||||
|
||||
list = displays;
|
||||
while (list)
|
||||
{
|
||||
GdkDisplay *display = list->data;
|
||||
|
||||
clipboard = clipboard_peek (display, GDK_SELECTION_CLIPBOARD, TRUE);
|
||||
|
||||
if (clipboard)
|
||||
gtk_clipboard_store (clipboard);
|
||||
|
||||
list = list->next;
|
||||
}
|
||||
/* FIXME: Implement */
|
||||
}
|
||||
|
||||
+26
-33
@@ -584,42 +584,36 @@ dialog_response (GtkDialog *dialog,
|
||||
}
|
||||
}
|
||||
|
||||
/* Create the dialog and connects its buttons */
|
||||
static void
|
||||
ensure_dialog (GtkColorButton *button)
|
||||
{
|
||||
GtkWidget *parent, *dialog;
|
||||
|
||||
if (button->priv->cs_dialog != NULL)
|
||||
return;
|
||||
|
||||
parent = gtk_widget_get_toplevel (GTK_WIDGET (button));
|
||||
|
||||
button->priv->cs_dialog = dialog = gtk_color_chooser_dialog_new (button->priv->title, NULL);
|
||||
|
||||
if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
|
||||
{
|
||||
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (dialog)))
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog),
|
||||
gtk_window_get_modal (GTK_WINDOW (parent)));
|
||||
}
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (dialog_response), button);
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (dialog_destroy), button);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
gtk_color_button_clicked (GtkButton *b)
|
||||
{
|
||||
GtkColorButton *button = GTK_COLOR_BUTTON (b);
|
||||
GtkWidget *dialog;
|
||||
|
||||
/* if dialog already exists, make sure it's shown and raised */
|
||||
ensure_dialog (button);
|
||||
if (!button->priv->cs_dialog)
|
||||
{
|
||||
/* Create the dialog and connects its buttons */
|
||||
GtkWidget *parent;
|
||||
|
||||
parent = gtk_widget_get_toplevel (GTK_WIDGET (button));
|
||||
|
||||
button->priv->cs_dialog = dialog = gtk_color_chooser_dialog_new (button->priv->title, NULL);
|
||||
|
||||
if (gtk_widget_is_toplevel (parent) && GTK_IS_WINDOW (parent))
|
||||
{
|
||||
if (GTK_WINDOW (parent) != gtk_window_get_transient_for (GTK_WINDOW (dialog)))
|
||||
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
|
||||
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog),
|
||||
gtk_window_get_modal (GTK_WINDOW (parent)));
|
||||
}
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (dialog_response), button);
|
||||
g_signal_connect (dialog, "destroy",
|
||||
G_CALLBACK (dialog_destroy), button);
|
||||
}
|
||||
|
||||
gtk_color_chooser_set_use_alpha (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
|
||||
button->priv->use_alpha);
|
||||
@@ -968,9 +962,8 @@ gtk_color_button_add_palette (GtkColorChooser *chooser,
|
||||
{
|
||||
GtkColorButton *button = GTK_COLOR_BUTTON (chooser);
|
||||
|
||||
ensure_dialog (button);
|
||||
|
||||
gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
|
||||
if (button->priv->cs_dialog)
|
||||
gtk_color_chooser_add_palette (GTK_COLOR_CHOOSER (button->priv->cs_dialog),
|
||||
orientation, colors_per_line, n_colors, colors);
|
||||
}
|
||||
|
||||
|
||||
+14
-45
@@ -42,6 +42,7 @@
|
||||
#include "gtkmain.h"
|
||||
#include "gtkmarshalers.h"
|
||||
#include "gtksizerequest.h"
|
||||
#include "gtksizerequestcacheprivate.h"
|
||||
#include "gtkwidgetprivate.h"
|
||||
#include "gtkwindow.h"
|
||||
#include "gtkassistant.h"
|
||||
@@ -1753,8 +1754,7 @@ _gtk_container_queue_resize_internal (GtkContainer *container,
|
||||
do
|
||||
{
|
||||
_gtk_widget_set_alloc_needed (widget, TRUE);
|
||||
_gtk_widget_set_width_request_needed (widget, TRUE);
|
||||
_gtk_widget_set_height_request_needed (widget, TRUE);
|
||||
_gtk_size_request_cache_clear (_gtk_widget_peek_request_cache (widget));
|
||||
|
||||
if (GTK_IS_RESIZE_CONTAINER (widget))
|
||||
break;
|
||||
@@ -1918,32 +1918,11 @@ gtk_container_adjust_size_allocation (GtkWidget *widget,
|
||||
|
||||
container = GTK_CONTAINER (widget);
|
||||
|
||||
if (!GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width)
|
||||
if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width)
|
||||
{
|
||||
parent_class->adjust_size_allocation (widget, orientation,
|
||||
minimum_size, natural_size, allocated_pos,
|
||||
allocated_size);
|
||||
return;
|
||||
}
|
||||
border_width = container->priv->border_width;
|
||||
|
||||
border_width = container->priv->border_width;
|
||||
|
||||
*allocated_size -= border_width * 2;
|
||||
|
||||
/* If we get a pathological too-small allocation to hold
|
||||
* even the border width, leave all allocation to the actual
|
||||
* widget, and leave x,y unchanged. (GtkWidget's min size is
|
||||
* 1x1 if you're wondering why <1 and not <0)
|
||||
*
|
||||
* As long as we have space, set x,y properly.
|
||||
*/
|
||||
|
||||
if (*allocated_size < 1)
|
||||
{
|
||||
*allocated_size += border_width * 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
*allocated_size -= border_width * 2;
|
||||
*allocated_pos += border_width;
|
||||
*minimum_size -= border_width * 2;
|
||||
*natural_size -= border_width * 2;
|
||||
@@ -1989,27 +1968,17 @@ count_request_modes (GtkWidget *widget,
|
||||
static GtkSizeRequestMode
|
||||
gtk_container_get_request_mode (GtkWidget *widget)
|
||||
{
|
||||
GtkContainer *container = GTK_CONTAINER (widget);
|
||||
GtkContainerPrivate *priv = container->priv;
|
||||
GtkContainer *container = GTK_CONTAINER (widget);
|
||||
RequestModeCount count = { 0, 0 };
|
||||
|
||||
/* Recalculate the request mode of the children by majority
|
||||
* vote whenever the internal content changes */
|
||||
if (_gtk_widget_get_width_request_needed (widget) ||
|
||||
_gtk_widget_get_height_request_needed (widget))
|
||||
{
|
||||
RequestModeCount count = { 0, 0 };
|
||||
gtk_container_forall (container, (GtkCallback)count_request_modes, &count);
|
||||
|
||||
gtk_container_forall (container, (GtkCallback)count_request_modes, &count);
|
||||
|
||||
if (!count.hfw && !count.wfh)
|
||||
priv->request_mode = GTK_SIZE_REQUEST_CONSTANT_SIZE;
|
||||
else
|
||||
priv->request_mode = count.wfh > count.hfw ?
|
||||
GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT :
|
||||
GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
|
||||
}
|
||||
|
||||
return priv->request_mode;
|
||||
if (!count.hfw && !count.wfh)
|
||||
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
|
||||
else
|
||||
return count.wfh > count.hfw ?
|
||||
GTK_SIZE_REQUEST_WIDTH_FOR_HEIGHT :
|
||||
GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+28
-11
@@ -74,7 +74,7 @@ gtk_css_value_bg_size_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
{
|
||||
return value1->cover == value2->cover &&
|
||||
value1->contain == value2->contain &&
|
||||
value2->contain == value2->contain &&
|
||||
(value1->x == value2->x ||
|
||||
(value1->x != NULL && value2->x != NULL &&
|
||||
_gtk_css_value_equal (value1->x, value2->x))) &&
|
||||
@@ -261,16 +261,33 @@ _gtk_css_bg_size_value_compute_size (const GtkCssValue *value,
|
||||
g_return_if_fail (value->class == >K_CSS_VALUE_BG_SIZE);
|
||||
|
||||
if (value->contain || value->cover)
|
||||
gtk_css_bg_size_compute_size_for_cover_contain (value->cover,
|
||||
image,
|
||||
area_width, area_height,
|
||||
out_width, out_height);
|
||||
{
|
||||
gtk_css_bg_size_compute_size_for_cover_contain (value->cover,
|
||||
image,
|
||||
area_width, area_height,
|
||||
out_width, out_height);
|
||||
}
|
||||
else
|
||||
_gtk_css_image_get_concrete_size (image,
|
||||
/* note: 0 does the right thing here for 'auto' */
|
||||
value->x ? _gtk_css_number_value_get (value->x, area_width) : 0,
|
||||
value->y ? _gtk_css_number_value_get (value->y, area_height) : 0,
|
||||
area_width, area_height,
|
||||
out_width, out_height);
|
||||
{
|
||||
double x, y;
|
||||
|
||||
/* note: 0 does the right thing later for 'auto' */
|
||||
x = value->x ? _gtk_css_number_value_get (value->x, area_width) : 0;
|
||||
y = value->y ? _gtk_css_number_value_get (value->y, area_height) : 0;
|
||||
|
||||
if ((x <= 0 && value->x) ||
|
||||
(y <= 0 && value->y))
|
||||
{
|
||||
*out_width = 0;
|
||||
*out_height = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
_gtk_css_image_get_concrete_size (image,
|
||||
x, y,
|
||||
area_width, area_height,
|
||||
out_width, out_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,841 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkhslaprivate.h"
|
||||
#include "gtkstylepropertyprivate.h"
|
||||
#include "gtkstyleproperties.h"
|
||||
#include "gtkwin32themeprivate.h"
|
||||
|
||||
typedef enum {
|
||||
COLOR_TYPE_LITERAL,
|
||||
COLOR_TYPE_NAME,
|
||||
COLOR_TYPE_SHADE,
|
||||
COLOR_TYPE_ALPHA,
|
||||
COLOR_TYPE_MIX,
|
||||
COLOR_TYPE_WIN32,
|
||||
COLOR_TYPE_CURRENT_COLOR
|
||||
} ColorType;
|
||||
|
||||
struct _GtkCssValue
|
||||
{
|
||||
GTK_CSS_VALUE_BASE
|
||||
ColorType type;
|
||||
GtkCssValue *last_value;
|
||||
|
||||
union
|
||||
{
|
||||
gchar *name;
|
||||
|
||||
struct
|
||||
{
|
||||
GtkCssValue *color;
|
||||
gdouble factor;
|
||||
} shade, alpha;
|
||||
|
||||
struct
|
||||
{
|
||||
GtkCssValue *color1;
|
||||
GtkCssValue *color2;
|
||||
gdouble factor;
|
||||
} mix;
|
||||
|
||||
struct
|
||||
{
|
||||
gchar *theme_class;
|
||||
gint id;
|
||||
} win32;
|
||||
} sym_col;
|
||||
};
|
||||
|
||||
static void
|
||||
gtk_css_value_color_free (GtkCssValue *color)
|
||||
{
|
||||
if (color->last_value)
|
||||
_gtk_css_value_unref (color->last_value);
|
||||
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_NAME:
|
||||
g_free (color->sym_col.name);
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
_gtk_css_value_unref (color->sym_col.shade.color);
|
||||
break;
|
||||
case COLOR_TYPE_ALPHA:
|
||||
_gtk_css_value_unref (color->sym_col.alpha.color);
|
||||
break;
|
||||
case COLOR_TYPE_MIX:
|
||||
_gtk_css_value_unref (color->sym_col.mix.color1);
|
||||
_gtk_css_value_unref (color->sym_col.mix.color2);
|
||||
break;
|
||||
case COLOR_TYPE_WIN32:
|
||||
g_free (color->sym_col.win32.theme_class);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
g_slice_free (GtkCssValue, color);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_color_get_fallback (guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *parent_values)
|
||||
{
|
||||
static const GdkRGBA transparent = { 0, 0, 0, 0 };
|
||||
|
||||
switch (property_id)
|
||||
{
|
||||
case GTK_CSS_PROPERTY_BACKGROUND_IMAGE:
|
||||
case GTK_CSS_PROPERTY_BORDER_IMAGE_SOURCE:
|
||||
case GTK_CSS_PROPERTY_TEXT_SHADOW:
|
||||
case GTK_CSS_PROPERTY_ICON_SHADOW:
|
||||
case GTK_CSS_PROPERTY_BOX_SHADOW:
|
||||
return _gtk_css_rgba_value_new_from_rgba (&transparent);
|
||||
case GTK_CSS_PROPERTY_COLOR:
|
||||
case GTK_CSS_PROPERTY_BACKGROUND_COLOR:
|
||||
case GTK_CSS_PROPERTY_BORDER_TOP_COLOR:
|
||||
case GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR:
|
||||
case GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR:
|
||||
case GTK_CSS_PROPERTY_BORDER_LEFT_COLOR:
|
||||
case GTK_CSS_PROPERTY_OUTLINE_COLOR:
|
||||
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
property_id,
|
||||
provider,
|
||||
values,
|
||||
parent_values,
|
||||
NULL);
|
||||
default:
|
||||
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
|
||||
g_warning ("No fallback color defined for property '%s'",
|
||||
_gtk_style_property_get_name (GTK_STYLE_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id))));
|
||||
return _gtk_css_rgba_value_new_from_rgba (&transparent);
|
||||
}
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color != NULL, FALSE);
|
||||
g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), FALSE);
|
||||
g_return_val_if_fail (current != NULL, FALSE);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
*dependencies = 0;
|
||||
|
||||
value = NULL;
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
return _gtk_css_value_ref (color->last_value);
|
||||
case COLOR_TYPE_NAME:
|
||||
{
|
||||
GtkCssValue *named;
|
||||
|
||||
named = _gtk_style_provider_private_get_color (provider, color->sym_col.name);
|
||||
if (named == NULL)
|
||||
return NULL;
|
||||
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, current_deps, dependencies);
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
{
|
||||
GtkCssValue *val;
|
||||
GtkHSLA hsla;
|
||||
GdkRGBA shade;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, current_deps, dependencies);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
|
||||
_gtk_hsla_init_from_rgba (&hsla, _gtk_css_rgba_value_get_rgba (val));
|
||||
_gtk_hsla_shade (&hsla, &hsla, color->sym_col.shade.factor);
|
||||
|
||||
_gdk_rgba_init_from_hsla (&shade, &hsla);
|
||||
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
value = _gtk_css_rgba_value_new_from_rgba (&shade);
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_ALPHA:
|
||||
{
|
||||
GtkCssValue *val;
|
||||
GdkRGBA alpha;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, current_deps, dependencies);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
alpha = *_gtk_css_rgba_value_get_rgba (val);
|
||||
alpha.alpha = CLAMP (alpha.alpha * color->sym_col.alpha.factor, 0, 1);
|
||||
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
value = _gtk_css_rgba_value_new_from_rgba (&alpha);
|
||||
}
|
||||
break;
|
||||
|
||||
case COLOR_TYPE_MIX:
|
||||
{
|
||||
GtkCssValue *val;
|
||||
GdkRGBA color1, color2, res;
|
||||
GtkCssDependencies dep1, dep2;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, current_deps, &dep1);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
color1 = *_gtk_css_rgba_value_get_rgba (val);
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, current_deps, &dep2);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
color2 = *_gtk_css_rgba_value_get_rgba (val);
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (dep1, dep2);
|
||||
res.red = CLAMP (color1.red + ((color2.red - color1.red) * color->sym_col.mix.factor), 0, 1);
|
||||
res.green = CLAMP (color1.green + ((color2.green - color1.green) * color->sym_col.mix.factor), 0, 1);
|
||||
res.blue = CLAMP (color1.blue + ((color2.blue - color1.blue) * color->sym_col.mix.factor), 0, 1);
|
||||
res.alpha = CLAMP (color1.alpha + ((color2.alpha - color1.alpha) * color->sym_col.mix.factor), 0, 1);
|
||||
|
||||
value =_gtk_css_rgba_value_new_from_rgba (&res);
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_WIN32:
|
||||
{
|
||||
GdkRGBA res;
|
||||
|
||||
if (!_gtk_win32_theme_color_resolve (color->sym_col.win32.theme_class,
|
||||
color->sym_col.win32.id,
|
||||
&res))
|
||||
return NULL;
|
||||
|
||||
value = _gtk_css_rgba_value_new_from_rgba (&res);
|
||||
}
|
||||
|
||||
break;
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
if (current)
|
||||
{
|
||||
*dependencies = current_deps;
|
||||
return _gtk_css_value_ref (current);
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (value != NULL)
|
||||
{
|
||||
if (color->last_value != NULL &&
|
||||
_gtk_css_value_equal (color->last_value, value))
|
||||
{
|
||||
_gtk_css_value_unref (value);
|
||||
value = _gtk_css_value_ref (color->last_value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (color->last_value != NULL)
|
||||
_gtk_css_value_unref (color->last_value);
|
||||
color->last_value = _gtk_css_value_ref (value);
|
||||
}
|
||||
}
|
||||
|
||||
_gtk_css_rgba_value_get_rgba (value);
|
||||
return value;
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_color_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *parent_values,
|
||||
GtkCssDependencies *dependencies)
|
||||
{
|
||||
GtkCssValue *resolved, *current;
|
||||
GtkCssDependencies current_deps;
|
||||
|
||||
/* The computed value of the ‘currentColor’ keyword is the computed
|
||||
* value of the ‘color’ property. If the ‘currentColor’ keyword is
|
||||
* set on the ‘color’ property itself, it is treated as ‘color: inherit’.
|
||||
*/
|
||||
if (property_id == GTK_CSS_PROPERTY_COLOR)
|
||||
{
|
||||
if (parent_values)
|
||||
{
|
||||
current = _gtk_css_computed_values_get_value (parent_values, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_EQUALS_PARENT;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = _gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR));
|
||||
current_deps = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
current = _gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
}
|
||||
|
||||
resolved = _gtk_css_color_value_resolve (value,
|
||||
provider,
|
||||
current,
|
||||
current_deps,
|
||||
dependencies);
|
||||
|
||||
if (resolved == NULL)
|
||||
return gtk_css_value_color_get_fallback (property_id, provider, values, parent_values);
|
||||
|
||||
return resolved;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_value_color_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
{
|
||||
if (value1->type != value2->type)
|
||||
return FALSE;
|
||||
|
||||
switch (value1->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
return _gtk_css_value_equal (value1->last_value, value2->last_value);
|
||||
case COLOR_TYPE_NAME:
|
||||
return g_str_equal (value1->sym_col.name, value2->sym_col.name);
|
||||
case COLOR_TYPE_SHADE:
|
||||
return value1->sym_col.shade.factor == value2->sym_col.shade.factor &&
|
||||
_gtk_css_value_equal (value1->sym_col.shade.color,
|
||||
value2->sym_col.shade.color);
|
||||
case COLOR_TYPE_ALPHA:
|
||||
return value1->sym_col.alpha.factor == value2->sym_col.alpha.factor &&
|
||||
_gtk_css_value_equal (value1->sym_col.alpha.color,
|
||||
value2->sym_col.alpha.color);
|
||||
case COLOR_TYPE_MIX:
|
||||
return value1->sym_col.mix.factor == value2->sym_col.mix.factor &&
|
||||
_gtk_css_value_equal (value1->sym_col.mix.color1,
|
||||
value2->sym_col.mix.color1) &&
|
||||
_gtk_css_value_equal (value1->sym_col.mix.color2,
|
||||
value2->sym_col.mix.color2);
|
||||
case COLOR_TYPE_WIN32:
|
||||
return g_str_equal (value1->sym_col.win32.theme_class, value2->sym_col.win32.theme_class) &&
|
||||
value1->sym_col.win32.id == value2->sym_col.win32.id;
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
return TRUE;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_value_color_transition (GtkCssValue *start,
|
||||
GtkCssValue *end,
|
||||
guint property_id,
|
||||
double progress)
|
||||
{
|
||||
return _gtk_css_color_value_new_mix (start, end, progress);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_value_color_print (const GtkCssValue *value,
|
||||
GString *string)
|
||||
{
|
||||
switch (value->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
_gtk_css_value_print (value->last_value, string);
|
||||
break;
|
||||
case COLOR_TYPE_NAME:
|
||||
g_string_append (string, "@");
|
||||
g_string_append (string, value->sym_col.name);
|
||||
break;
|
||||
case COLOR_TYPE_SHADE:
|
||||
{
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "shade(");
|
||||
_gtk_css_value_print (value->sym_col.shade.color, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.shade.factor);
|
||||
g_string_append (string, factor);
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
break;
|
||||
case COLOR_TYPE_ALPHA:
|
||||
{
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "alpha(");
|
||||
_gtk_css_value_print (value->sym_col.alpha.color, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.alpha.factor);
|
||||
g_string_append (string, factor);
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
break;
|
||||
case COLOR_TYPE_MIX:
|
||||
{
|
||||
char factor[G_ASCII_DTOSTR_BUF_SIZE];
|
||||
|
||||
g_string_append (string, "mix(");
|
||||
_gtk_css_value_print (value->sym_col.mix.color1, string);
|
||||
g_string_append (string, ", ");
|
||||
_gtk_css_value_print (value->sym_col.mix.color2, string);
|
||||
g_string_append (string, ", ");
|
||||
g_ascii_dtostr (factor, sizeof (factor), value->sym_col.mix.factor);
|
||||
g_string_append (string, factor);
|
||||
g_string_append (string, ")");
|
||||
}
|
||||
break;
|
||||
case COLOR_TYPE_WIN32:
|
||||
{
|
||||
g_string_append_printf (string, GTK_WIN32_THEME_SYMBOLIC_COLOR_NAME"(%s, %d)",
|
||||
value->sym_col.win32.theme_class, value->sym_col.win32.id);
|
||||
}
|
||||
break;
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
g_string_append (string, "currentColor");
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
}
|
||||
|
||||
static const GtkCssValueClass GTK_CSS_VALUE_COLOR = {
|
||||
gtk_css_value_color_free,
|
||||
gtk_css_value_color_compute,
|
||||
gtk_css_value_color_equal,
|
||||
gtk_css_value_color_transition,
|
||||
gtk_css_value_color_print
|
||||
};
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_literal (const GdkRGBA *color)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_LITERAL;
|
||||
value->last_value = _gtk_css_rgba_value_new_from_rgba (color);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_rgba (double red,
|
||||
double green,
|
||||
double blue,
|
||||
double alpha)
|
||||
{
|
||||
GdkRGBA rgba = { red, green, blue, alpha };
|
||||
|
||||
return _gtk_css_color_value_new_literal (&rgba);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_name (const gchar *name)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (name != NULL, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_NAME;
|
||||
value->sym_col.name = g_strdup (name);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_shade (GtkCssValue *color,
|
||||
gdouble factor)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color->class == >K_CSS_VALUE_COLOR, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_SHADE;
|
||||
value->sym_col.shade.color = _gtk_css_value_ref (color);
|
||||
value->sym_col.shade.factor = factor;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_alpha (GtkCssValue *color,
|
||||
gdouble factor)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color->class == >K_CSS_VALUE_COLOR, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_ALPHA;
|
||||
value->sym_col.alpha.color = _gtk_css_value_ref (color);
|
||||
value->sym_col.alpha.factor = factor;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_mix (GtkCssValue *color1,
|
||||
GtkCssValue *color2,
|
||||
gdouble factor)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color1->class == >K_CSS_VALUE_COLOR, NULL);
|
||||
g_return_val_if_fail (color2->class == >K_CSS_VALUE_COLOR, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_MIX;
|
||||
value->sym_col.mix.color1 = _gtk_css_value_ref (color1);
|
||||
value->sym_col.mix.color2 = _gtk_css_value_ref (color2);
|
||||
value->sym_col.mix.factor = factor;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_win32 (const gchar *theme_class,
|
||||
gint id)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (theme_class != NULL, NULL);
|
||||
|
||||
value = _gtk_css_value_new (GtkCssValue, >K_CSS_VALUE_COLOR);
|
||||
value->type = COLOR_TYPE_WIN32;
|
||||
value->sym_col.win32.theme_class = g_strdup (theme_class);
|
||||
value->sym_col.win32.id = id;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_new_current_color (void)
|
||||
{
|
||||
static GtkCssValue current_color = { >K_CSS_VALUE_COLOR, 1, COLOR_TYPE_CURRENT_COLOR, NULL, };
|
||||
|
||||
return _gtk_css_value_ref (¤t_color);
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
COLOR_RGBA,
|
||||
COLOR_RGB,
|
||||
COLOR_LIGHTER,
|
||||
COLOR_DARKER,
|
||||
COLOR_SHADE,
|
||||
COLOR_ALPHA,
|
||||
COLOR_MIX,
|
||||
COLOR_WIN32
|
||||
} ColorParseType;
|
||||
|
||||
static GtkCssValue *
|
||||
gtk_css_color_parse_win32 (GtkCssParser *parser)
|
||||
{
|
||||
GtkCssValue *color;
|
||||
char *class;
|
||||
int id;
|
||||
|
||||
class = _gtk_css_parser_try_name (parser, TRUE);
|
||||
if (class == NULL)
|
||||
{
|
||||
_gtk_css_parser_error (parser,
|
||||
"Expected name as first argument to '-gtk-win32-color'");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (! _gtk_css_parser_try (parser, ",", TRUE))
|
||||
{
|
||||
g_free (class);
|
||||
_gtk_css_parser_error (parser,
|
||||
"Expected ','");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try_int (parser, &id))
|
||||
{
|
||||
g_free (class);
|
||||
_gtk_css_parser_error (parser, "Expected a valid integer value");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
color = _gtk_css_color_value_new_win32 (class, id);
|
||||
g_free (class);
|
||||
return color;
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
_gtk_css_color_value_parse_function (GtkCssParser *parser,
|
||||
ColorParseType color)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
GtkCssValue *child1, *child2;
|
||||
double d;
|
||||
|
||||
if (!_gtk_css_parser_try (parser, "(", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Missing opening bracket in color definition");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (color == COLOR_RGB || color == COLOR_RGBA)
|
||||
{
|
||||
GdkRGBA rgba;
|
||||
double tmp;
|
||||
guint i;
|
||||
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
if (i > 0 && !_gtk_css_parser_try (parser, ",", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected ',' in color definition");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try_double (parser, &tmp))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Invalid number for color value");
|
||||
return NULL;
|
||||
}
|
||||
if (_gtk_css_parser_try (parser, "%", TRUE))
|
||||
tmp /= 100.0;
|
||||
else
|
||||
tmp /= 255.0;
|
||||
if (i == 0)
|
||||
rgba.red = tmp;
|
||||
else if (i == 1)
|
||||
rgba.green = tmp;
|
||||
else if (i == 2)
|
||||
rgba.blue = tmp;
|
||||
else
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
if (color == COLOR_RGBA)
|
||||
{
|
||||
if (i > 0 && !_gtk_css_parser_try (parser, ",", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected ',' in color definition");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try_double (parser, &rgba.alpha))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Invalid number for alpha value");
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
rgba.alpha = 1.0;
|
||||
|
||||
value = _gtk_css_color_value_new_literal (&rgba);
|
||||
}
|
||||
else if (color == COLOR_WIN32)
|
||||
{
|
||||
value = gtk_css_color_parse_win32 (parser);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
child1 = _gtk_css_color_value_parse (parser);
|
||||
if (child1 == NULL)
|
||||
return NULL;
|
||||
|
||||
if (color == COLOR_MIX)
|
||||
{
|
||||
if (!_gtk_css_parser_try (parser, ",", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected ',' in color definition");
|
||||
_gtk_css_value_unref (child1);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
child2 = _gtk_css_color_value_parse (parser);
|
||||
if (child2 == NULL)
|
||||
{
|
||||
_gtk_css_value_unref (child1);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
child2 = NULL;
|
||||
|
||||
if (color == COLOR_LIGHTER)
|
||||
d = 1.3;
|
||||
else if (color == COLOR_DARKER)
|
||||
d = 0.7;
|
||||
else
|
||||
{
|
||||
if (!_gtk_css_parser_try (parser, ",", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected ',' in color definition");
|
||||
_gtk_css_value_unref (child1);
|
||||
if (child2)
|
||||
_gtk_css_value_unref (child2);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try_double (parser, &d))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected number in color definition");
|
||||
_gtk_css_value_unref (child1);
|
||||
if (child2)
|
||||
_gtk_css_value_unref (child2);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
switch (color)
|
||||
{
|
||||
case COLOR_LIGHTER:
|
||||
case COLOR_DARKER:
|
||||
case COLOR_SHADE:
|
||||
value = _gtk_css_color_value_new_shade (child1, d);
|
||||
break;
|
||||
case COLOR_ALPHA:
|
||||
value = _gtk_css_color_value_new_alpha (child1, d);
|
||||
break;
|
||||
case COLOR_MIX:
|
||||
value = _gtk_css_color_value_new_mix (child1, child2, d);
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
_gtk_css_value_unref (child1);
|
||||
if (child2)
|
||||
_gtk_css_value_unref (child2);
|
||||
}
|
||||
|
||||
if (!_gtk_css_parser_try (parser, ")", TRUE))
|
||||
{
|
||||
_gtk_css_parser_error (parser, "Expected ')' in color definition");
|
||||
_gtk_css_value_unref (value);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_color_value_parse (GtkCssParser *parser)
|
||||
{
|
||||
GtkCssValue *value;
|
||||
GdkRGBA rgba;
|
||||
guint color;
|
||||
const char *names[] = {"rgba", "rgb", "lighter", "darker", "shade", "alpha", "mix",
|
||||
GTK_WIN32_THEME_SYMBOLIC_COLOR_NAME};
|
||||
char *name;
|
||||
|
||||
if (_gtk_css_parser_try (parser, "currentColor", TRUE))
|
||||
return _gtk_css_color_value_new_current_color ();
|
||||
|
||||
if (_gtk_css_parser_try (parser, "transparent", TRUE))
|
||||
{
|
||||
GdkRGBA transparent = { 0, 0, 0, 0 };
|
||||
|
||||
return _gtk_css_color_value_new_literal (&transparent);
|
||||
}
|
||||
|
||||
if (_gtk_css_parser_try (parser, "@", FALSE))
|
||||
{
|
||||
name = _gtk_css_parser_try_name (parser, TRUE);
|
||||
|
||||
if (name)
|
||||
{
|
||||
value = _gtk_css_color_value_new_name (name);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gtk_css_parser_error (parser, "'%s' is not a valid color color name", name);
|
||||
value = NULL;
|
||||
}
|
||||
|
||||
g_free (name);
|
||||
return value;
|
||||
}
|
||||
|
||||
for (color = 0; color < G_N_ELEMENTS (names); color++)
|
||||
{
|
||||
if (_gtk_css_parser_try (parser, names[color], TRUE))
|
||||
break;
|
||||
}
|
||||
|
||||
if (color < G_N_ELEMENTS (names))
|
||||
return _gtk_css_color_value_parse_function (parser, color);
|
||||
|
||||
if (_gtk_css_parser_try_hash_color (parser, &rgba))
|
||||
return _gtk_css_color_value_new_literal (&rgba);
|
||||
|
||||
name = _gtk_css_parser_try_name (parser, TRUE);
|
||||
if (name)
|
||||
{
|
||||
if (gdk_rgba_parse (&rgba, name))
|
||||
{
|
||||
value = _gtk_css_color_value_new_literal (&rgba);
|
||||
}
|
||||
else
|
||||
{
|
||||
_gtk_css_parser_error (parser, "'%s' is not a valid color name", name);
|
||||
value = NULL;
|
||||
}
|
||||
g_free (name);
|
||||
return value;
|
||||
}
|
||||
|
||||
_gtk_css_parser_error (parser, "Not a color definition");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2010 Carlos Garnacho <carlosg@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_CSS_COLOR_VALUE_PRIVATE_H__
|
||||
#define __GTK_CSS_COLOR_VALUE_PRIVATE_H__
|
||||
|
||||
#include "gtkcssparserprivate.h"
|
||||
#include "gtkcssvalueprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
GtkCssValue * _gtk_css_color_value_new_literal (const GdkRGBA *color);
|
||||
GtkCssValue * _gtk_css_color_value_new_rgba (double red,
|
||||
double green,
|
||||
double blue,
|
||||
double alpha);
|
||||
GtkCssValue * _gtk_css_color_value_new_name (const gchar *name);
|
||||
GtkCssValue * _gtk_css_color_value_new_shade (GtkCssValue *color,
|
||||
gdouble factor);
|
||||
GtkCssValue * _gtk_css_color_value_new_alpha (GtkCssValue *color,
|
||||
gdouble factor);
|
||||
GtkCssValue * _gtk_css_color_value_new_mix (GtkCssValue *color1,
|
||||
GtkCssValue *color2,
|
||||
gdouble factor);
|
||||
GtkCssValue * _gtk_css_color_value_new_win32 (const gchar *theme_class,
|
||||
gint id);
|
||||
GtkCssValue * _gtk_css_color_value_new_current_color (void);
|
||||
|
||||
GtkCssValue * _gtk_css_color_value_parse (GtkCssParser *parser);
|
||||
|
||||
GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_COLOR_VALUE_PRIVATE_H__ */
|
||||
@@ -499,7 +499,6 @@ gtk_css_computed_values_create_css_animations (GtkCssComputedValues *values,
|
||||
_gtk_css_play_state_value_get (_gtk_css_array_value_get_nth (play_states, i)),
|
||||
_gtk_css_fill_mode_value_get (_gtk_css_array_value_get_nth (fill_modes, i)),
|
||||
_gtk_css_number_value_get (_gtk_css_array_value_get_nth (iteration_counts, i), 100));
|
||||
|
||||
_gtk_css_keyframes_unref (keyframes);
|
||||
}
|
||||
values->animations = g_slist_prepend (values->animations, animation);
|
||||
@@ -605,3 +604,21 @@ _gtk_css_computed_values_cancel_animations (GtkCssComputedValues *values)
|
||||
values->animations = NULL;
|
||||
}
|
||||
|
||||
GtkBitmask *
|
||||
_gtk_css_computed_values_compute_dependencies (GtkCssComputedValues *values,
|
||||
const GtkBitmask *parent_changes)
|
||||
{
|
||||
GtkBitmask *changes;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CSS_COMPUTED_VALUES (values), _gtk_bitmask_new ());
|
||||
|
||||
changes = _gtk_bitmask_copy (parent_changes);
|
||||
changes = _gtk_bitmask_intersect (changes, values->depends_on_parent);
|
||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_COLOR))
|
||||
changes = _gtk_bitmask_union (changes, values->depends_on_color);
|
||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
|
||||
changes = _gtk_bitmask_union (changes, values->depends_on_font_size);
|
||||
|
||||
return changes;
|
||||
}
|
||||
|
||||
|
||||
@@ -87,6 +87,8 @@ GtkCssValue * _gtk_css_computed_values_get_intrinsic_value (GtkCssCom
|
||||
guint id);
|
||||
GtkBitmask * _gtk_css_computed_values_get_difference (GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *other);
|
||||
GtkBitmask * _gtk_css_computed_values_compute_dependencies (GtkCssComputedValues *values,
|
||||
const GtkBitmask *parent_changes);
|
||||
|
||||
void _gtk_css_computed_values_create_animations (GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *parent_values,
|
||||
|
||||
@@ -28,16 +28,22 @@
|
||||
#include "gtkstylepropertiesprivate.h"
|
||||
#include "gtkthemingengine.h"
|
||||
|
||||
#include "deprecated/gtksymboliccolor.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkCssCustomProperty, _gtk_css_custom_property, GTK_TYPE_CSS_STYLE_PROPERTY)
|
||||
|
||||
static GType
|
||||
gtk_css_custom_property_get_specified_type (GParamSpec *pspec)
|
||||
{
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (pspec->value_type == GDK_TYPE_RGBA ||
|
||||
pspec->value_type == GDK_TYPE_COLOR)
|
||||
return GTK_TYPE_SYMBOLIC_COLOR;
|
||||
else
|
||||
return pspec->value_type;
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
|
||||
@@ -69,6 +69,13 @@ gtk_css_image_real_compute (GtkCssImage *image,
|
||||
return g_object_ref (image);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_image_real_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GtkCssImage *
|
||||
gtk_css_image_real_transition (GtkCssImage *start,
|
||||
GtkCssImage *end,
|
||||
@@ -90,6 +97,7 @@ _gtk_css_image_class_init (GtkCssImageClass *klass)
|
||||
klass->get_height = gtk_css_image_real_get_height;
|
||||
klass->get_aspect_ratio = gtk_css_image_real_get_aspect_ratio;
|
||||
klass->compute = gtk_css_image_real_compute;
|
||||
klass->equal = gtk_css_image_real_equal;
|
||||
klass->transition = gtk_css_image_real_transition;
|
||||
}
|
||||
|
||||
@@ -188,6 +196,29 @@ _gtk_css_image_transition (GtkCssImage *start,
|
||||
return klass->transition (start, end, property_id, progress);
|
||||
}
|
||||
|
||||
gboolean
|
||||
_gtk_css_image_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2)
|
||||
{
|
||||
GtkCssImageClass *klass;
|
||||
|
||||
g_return_val_if_fail (image1 == NULL || GTK_IS_CSS_IMAGE (image1), FALSE);
|
||||
g_return_val_if_fail (image2 == NULL || GTK_IS_CSS_IMAGE (image2), FALSE);
|
||||
|
||||
if (image1 == image2)
|
||||
return TRUE;
|
||||
|
||||
if (image1 == NULL || image2 == NULL)
|
||||
return FALSE;
|
||||
|
||||
if (G_OBJECT_TYPE (image1) != G_OBJECT_TYPE (image2))
|
||||
return FALSE;
|
||||
|
||||
klass = GTK_CSS_IMAGE_GET_CLASS (image1);
|
||||
|
||||
return klass->equal (image1, image2);
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_css_image_draw (GtkCssImage *image,
|
||||
cairo_t *cr,
|
||||
@@ -198,6 +229,8 @@ _gtk_css_image_draw (GtkCssImage *image,
|
||||
|
||||
g_return_if_fail (GTK_IS_CSS_IMAGE (image));
|
||||
g_return_if_fail (cr != NULL);
|
||||
g_return_if_fail (width > 0);
|
||||
g_return_if_fail (height > 0);
|
||||
|
||||
cairo_save (cr);
|
||||
|
||||
|
||||
@@ -86,6 +86,18 @@ gtk_css_image_cross_fade_get_height (GtkCssImage *image)
|
||||
return start_height + (end_height - start_height) * cross_fade->progress;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_image_cross_fade_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2)
|
||||
{
|
||||
GtkCssImageCrossFade *cross_fade1 = GTK_CSS_IMAGE_CROSS_FADE (image1);
|
||||
GtkCssImageCrossFade *cross_fade2 = GTK_CSS_IMAGE_CROSS_FADE (image2);
|
||||
|
||||
return cross_fade1->progress == cross_fade2->progress &&
|
||||
_gtk_css_image_equal (cross_fade1->start, cross_fade2->start) &&
|
||||
_gtk_css_image_equal (cross_fade1->end, cross_fade2->end);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_image_cross_fade_draw (GtkCssImage *image,
|
||||
cairo_t *cr,
|
||||
@@ -234,6 +246,7 @@ _gtk_css_image_cross_fade_class_init (GtkCssImageCrossFadeClass *klass)
|
||||
|
||||
image_class->get_width = gtk_css_image_cross_fade_get_width;
|
||||
image_class->get_height = gtk_css_image_cross_fade_get_height;
|
||||
image_class->equal = gtk_css_image_cross_fade_equal;
|
||||
image_class->draw = gtk_css_image_cross_fade_draw;
|
||||
image_class->parse = gtk_css_image_cross_fade_parse;
|
||||
image_class->print = gtk_css_image_cross_fade_print;
|
||||
|
||||
@@ -19,11 +19,14 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define GDK_DISABLE_DEPRECATION_WARNINGS
|
||||
|
||||
#include "gtkcssimagegradientprivate.h"
|
||||
|
||||
#include "gtkcssprovider.h"
|
||||
#include "gtkgradientprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
|
||||
#include "deprecated/gtkgradientprivate.h"
|
||||
#include "deprecated/gtksymboliccolorprivate.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkCssImageGradient, _gtk_css_image_gradient, GTK_TYPE_CSS_IMAGE)
|
||||
|
||||
@@ -474,7 +477,7 @@ _gtk_gradient_parse (GtkCssParser *parser)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
color = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
|
||||
color = _gtk_css_symbolic_value_new (parser);
|
||||
if (color == NULL)
|
||||
{
|
||||
gtk_gradient_unref (gradient);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include "gtk/gtkcssimageprivate.h"
|
||||
|
||||
#include <gtk/gtkgradient.h>
|
||||
#include <gtk/deprecated/gtkgradient.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
+31
-2
@@ -23,10 +23,10 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkcssprovider.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkCssImageLinear, _gtk_css_image_linear, GTK_TYPE_CSS_IMAGE)
|
||||
|
||||
@@ -323,7 +323,7 @@ gtk_css_image_linear_parse (GtkCssImage *image,
|
||||
do {
|
||||
GtkCssImageLinearColorStop stop;
|
||||
|
||||
stop.color = _gtk_css_symbolic_value_new (parser);
|
||||
stop.color = _gtk_css_color_value_parse (parser);
|
||||
if (stop.color == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -533,6 +533,34 @@ fail:
|
||||
return GTK_CSS_IMAGE_CLASS (_gtk_css_image_linear_parent_class)->transition (start_image, end_image, property_id, progress);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_image_linear_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2)
|
||||
{
|
||||
GtkCssImageLinear *linear1 = GTK_CSS_IMAGE_LINEAR (image1);
|
||||
GtkCssImageLinear *linear2 = GTK_CSS_IMAGE_LINEAR (image2);
|
||||
guint i;
|
||||
|
||||
if (linear1->repeating != linear2->repeating ||
|
||||
!_gtk_css_value_equal (linear1->angle, linear2->angle) ||
|
||||
linear1->stops->len != linear2->stops->len)
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < linear1->stops->len; i++)
|
||||
{
|
||||
GtkCssImageLinearColorStop *stop1, *stop2;
|
||||
|
||||
stop1 = &g_array_index (linear1->stops, GtkCssImageLinearColorStop, i);
|
||||
stop2 = &g_array_index (linear2->stops, GtkCssImageLinearColorStop, i);
|
||||
|
||||
if (!_gtk_css_value_equal0 (stop1->offset, stop2->offset) ||
|
||||
!_gtk_css_value_equal (stop1->color, stop2->color))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_image_linear_dispose (GObject *object)
|
||||
{
|
||||
@@ -563,6 +591,7 @@ _gtk_css_image_linear_class_init (GtkCssImageLinearClass *klass)
|
||||
image_class->parse = gtk_css_image_linear_parse;
|
||||
image_class->print = gtk_css_image_linear_print;
|
||||
image_class->compute = gtk_css_image_linear_compute;
|
||||
image_class->equal = gtk_css_image_linear_equal;
|
||||
image_class->transition = gtk_css_image_linear_transition;
|
||||
|
||||
object_class->dispose = gtk_css_image_linear_dispose;
|
||||
|
||||
@@ -61,6 +61,9 @@ struct _GtkCssImageClass
|
||||
GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *parent_values,
|
||||
GtkCssDependencies *dependencies);
|
||||
/* compare two images for equality */
|
||||
gboolean (* equal) (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
/* transition between start and end image (end may be NULL), returns new reference */
|
||||
GtkCssImage *(* transition) (GtkCssImage *start,
|
||||
GtkCssImage *end,
|
||||
@@ -95,6 +98,8 @@ GtkCssImage * _gtk_css_image_compute (GtkCssImage *
|
||||
GtkCssComputedValues *values,
|
||||
GtkCssComputedValues *parent_values,
|
||||
GtkCssDependencies *dependencies);
|
||||
gboolean _gtk_css_image_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
GtkCssImage * _gtk_css_image_transition (GtkCssImage *start,
|
||||
GtkCssImage *end,
|
||||
guint property_id,
|
||||
|
||||
@@ -63,7 +63,7 @@ static gboolean
|
||||
gtk_css_value_image_equal (const GtkCssValue *value1,
|
||||
const GtkCssValue *value2)
|
||||
{
|
||||
return value1->image == value2->image;
|
||||
return _gtk_css_image_equal (value1->image, value2->image);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "gtkcssinheritvalueprivate.h"
|
||||
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkcssinitialvalueprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
|
||||
struct _GtkCssValue {
|
||||
@@ -48,7 +48,7 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
|
||||
}
|
||||
else
|
||||
{
|
||||
return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)),
|
||||
return _gtk_css_value_compute (_gtk_css_initial_value_get (),
|
||||
property_id,
|
||||
provider,
|
||||
values,
|
||||
|
||||
@@ -86,3 +86,9 @@ _gtk_css_initial_value_new (void)
|
||||
{
|
||||
return _gtk_css_value_ref (&initial);
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
_gtk_css_initial_value_get (void)
|
||||
{
|
||||
return &initial;
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
GtkCssValue * _gtk_css_initial_value_new (void);
|
||||
GtkCssValue * _gtk_css_initial_value_get (void);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -185,6 +185,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
|
||||
gtk_css_matcher_widget_path_has_regions,
|
||||
gtk_css_matcher_widget_path_has_region,
|
||||
gtk_css_matcher_widget_path_has_position,
|
||||
FALSE
|
||||
};
|
||||
|
||||
gboolean
|
||||
@@ -288,6 +289,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_ANY = {
|
||||
gtk_css_matcher_any_has_regions,
|
||||
gtk_css_matcher_any_has_region,
|
||||
gtk_css_matcher_any_has_position,
|
||||
TRUE
|
||||
};
|
||||
|
||||
void
|
||||
@@ -406,6 +408,7 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_SUPERSET = {
|
||||
gtk_css_matcher_superset_has_regions,
|
||||
gtk_css_matcher_superset_has_region,
|
||||
gtk_css_matcher_superset_has_position,
|
||||
FALSE
|
||||
};
|
||||
|
||||
void
|
||||
|
||||
@@ -50,6 +50,7 @@ struct _GtkCssMatcherClass {
|
||||
gboolean forward,
|
||||
int a,
|
||||
int b);
|
||||
gboolean is_any;
|
||||
};
|
||||
|
||||
struct _GtkCssMatcherWidgetPath {
|
||||
@@ -146,6 +147,12 @@ _gtk_css_matcher_has_position (const GtkCssMatcher *matcher,
|
||||
return matcher->klass->has_position (matcher, forward, a, b);
|
||||
}
|
||||
|
||||
static inline gboolean
|
||||
_gtk_css_matcher_matches_any (const GtkCssMatcher *matcher)
|
||||
{
|
||||
return matcher->klass->is_any;
|
||||
}
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
+225
-195
@@ -27,13 +27,13 @@
|
||||
|
||||
#include "gtkbitmaskprivate.h"
|
||||
#include "gtkcssarrayvalueprivate.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcsskeyframesprivate.h"
|
||||
#include "gtkcssparserprivate.h"
|
||||
#include "gtkcsssectionprivate.h"
|
||||
#include "gtkcssselectorprivate.h"
|
||||
#include "gtkcssshorthandpropertyprivate.h"
|
||||
#include "gtkcssstylefuncsprivate.h"
|
||||
#include "gtksymboliccolor.h"
|
||||
#include "gtkstyleprovider.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtkstylepropertiesprivate.h"
|
||||
@@ -986,6 +986,7 @@ struct _WidgetPropertyValue {
|
||||
struct GtkCssRuleset
|
||||
{
|
||||
GtkCssSelector *selector;
|
||||
GtkCssSelectorTree *selector_match;
|
||||
WidgetPropertyValue *widget_style;
|
||||
PropertyValue *styles;
|
||||
GtkBitmask *set_styles;
|
||||
@@ -1011,6 +1012,7 @@ struct _GtkCssProviderPrivate
|
||||
GHashTable *keyframes;
|
||||
|
||||
GArray *rulesets;
|
||||
GtkCssSelectorTree *tree;
|
||||
GResource *resource;
|
||||
};
|
||||
|
||||
@@ -1271,17 +1273,10 @@ gtk_css_ruleset_add (GtkCssRuleset *ruleset,
|
||||
ruleset->styles[i].section = NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_ruleset_matches (GtkCssRuleset *ruleset,
|
||||
const GtkCssMatcher *matcher)
|
||||
{
|
||||
return _gtk_css_selector_matches (ruleset->selector, matcher);
|
||||
}
|
||||
|
||||
static GtkCssChange
|
||||
gtk_css_ruleset_get_change (GtkCssRuleset *ruleset)
|
||||
{
|
||||
return _gtk_css_selector_get_change (ruleset->selector);
|
||||
return _gtk_css_selector_tree_match_get_change (ruleset->selector_match);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1403,73 +1398,47 @@ gtk_css_provider_init (GtkCssProvider *css_provider)
|
||||
|
||||
priv->symbolic_colors = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) gtk_symbolic_color_unref);
|
||||
(GDestroyNotify) _gtk_css_value_unref);
|
||||
priv->keyframes = g_hash_table_new_full (g_str_hash, g_str_equal,
|
||||
(GDestroyNotify) g_free,
|
||||
(GDestroyNotify) _gtk_css_value_unref);
|
||||
}
|
||||
|
||||
static void
|
||||
css_provider_dump_symbolic_colors (GtkCssProvider *css_provider,
|
||||
GtkStyleProperties *props)
|
||||
verify_tree_match_results (GtkCssProvider *provider,
|
||||
const GtkCssMatcher *matcher,
|
||||
GPtrArray *tree_rules)
|
||||
{
|
||||
GtkCssProviderPrivate *priv;
|
||||
GHashTableIter iter;
|
||||
gpointer key, value;
|
||||
#ifdef VERIFY_TREE
|
||||
GtkCssProviderPrivate *priv = provider->priv;
|
||||
GtkCssRuleset *ruleset;
|
||||
gboolean should_match;
|
||||
int i, j;
|
||||
|
||||
priv = css_provider->priv;
|
||||
g_hash_table_iter_init (&iter, priv->symbolic_colors);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, &key, &value))
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
{
|
||||
const gchar *name;
|
||||
GtkSymbolicColor *color;
|
||||
gboolean found = FALSE;
|
||||
|
||||
name = key;
|
||||
color = value;
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
|
||||
gtk_style_properties_map_color (props, name, color);
|
||||
for (j = 0; j < tree_rules->len; j++)
|
||||
{
|
||||
if (ruleset == tree_rules->pdata[j])
|
||||
{
|
||||
found = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
should_match = _gtk_css_selector_matches (ruleset->selector, matcher);
|
||||
if (found != !!should_match)
|
||||
{
|
||||
g_error ("expected rule '%s' to %s, but it %s\n",
|
||||
_gtk_css_selector_to_string (ruleset->selector),
|
||||
should_match ? "match" : "not match",
|
||||
found ? "matched" : "didn't match");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static GtkStyleProperties *
|
||||
gtk_css_provider_get_style (GtkStyleProvider *provider,
|
||||
GtkWidgetPath *path)
|
||||
{
|
||||
GtkCssMatcher matcher;
|
||||
GtkCssProvider *css_provider;
|
||||
GtkCssProviderPrivate *priv;
|
||||
GtkStyleProperties *props;
|
||||
guint i, j;
|
||||
|
||||
css_provider = GTK_CSS_PROVIDER (provider);
|
||||
priv = css_provider->priv;
|
||||
props = gtk_style_properties_new ();
|
||||
|
||||
css_provider_dump_symbolic_colors (css_provider, props);
|
||||
if (_gtk_css_matcher_init (&matcher, path, 0))
|
||||
{
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
{
|
||||
GtkCssRuleset *ruleset;
|
||||
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
|
||||
if (ruleset->styles == NULL)
|
||||
continue;
|
||||
|
||||
if (!gtk_css_ruleset_matches (ruleset, &matcher))
|
||||
continue;
|
||||
|
||||
for (j = 0; j < ruleset->n_styles; j++)
|
||||
_gtk_style_properties_set_property_by_property (props,
|
||||
GTK_CSS_STYLE_PROPERTY (ruleset->styles[i].property),
|
||||
_gtk_css_selector_get_state_flags (ruleset->selector),
|
||||
ruleset->styles[i].value);
|
||||
}
|
||||
}
|
||||
|
||||
return props;
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -1482,6 +1451,7 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
|
||||
GtkCssProvider *css_provider = GTK_CSS_PROVIDER (provider);
|
||||
GtkCssProviderPrivate *priv = css_provider->priv;
|
||||
WidgetPropertyValue *val;
|
||||
GPtrArray *tree_rules;
|
||||
GtkCssMatcher matcher;
|
||||
gboolean found = FALSE;
|
||||
gchar *prop_name;
|
||||
@@ -1490,22 +1460,20 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
|
||||
if (!_gtk_css_matcher_init (&matcher, path, state))
|
||||
return FALSE;
|
||||
|
||||
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, &matcher);
|
||||
verify_tree_match_results (css_provider, &matcher, tree_rules);
|
||||
|
||||
prop_name = g_strdup_printf ("-%s-%s",
|
||||
g_type_name (pspec->owner_type),
|
||||
pspec->name);
|
||||
|
||||
for (i = priv->rulesets->len - 1; i >= 0; i--)
|
||||
for (i = tree_rules->len - 1; i >= 0; i--)
|
||||
{
|
||||
GtkCssRuleset *ruleset;
|
||||
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
GtkCssRuleset *ruleset = tree_rules->pdata[i];
|
||||
|
||||
if (ruleset->widget_style == NULL)
|
||||
continue;
|
||||
|
||||
if (!gtk_css_ruleset_matches (ruleset, &matcher))
|
||||
continue;
|
||||
|
||||
for (val = ruleset->widget_style; val != NULL; val = val->next)
|
||||
{
|
||||
if (strcmp (val->name, prop_name) == 0)
|
||||
@@ -1532,6 +1500,7 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
|
||||
}
|
||||
|
||||
g_free (prop_name);
|
||||
g_ptr_array_free (tree_rules, TRUE);
|
||||
|
||||
return found;
|
||||
}
|
||||
@@ -1539,11 +1508,10 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
|
||||
static void
|
||||
gtk_css_style_provider_iface_init (GtkStyleProviderIface *iface)
|
||||
{
|
||||
iface->get_style = gtk_css_provider_get_style;
|
||||
iface->get_style_property = gtk_css_provider_get_style_property;
|
||||
}
|
||||
|
||||
static GtkSymbolicColor *
|
||||
static GtkCssValue *
|
||||
gtk_css_style_provider_get_color (GtkStyleProviderPrivate *provider,
|
||||
const char *name)
|
||||
{
|
||||
@@ -1570,17 +1538,19 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
|
||||
GtkCssProviderPrivate *priv;
|
||||
GtkCssRuleset *ruleset;
|
||||
guint j;
|
||||
int i;
|
||||
GPtrArray *tree_rules;
|
||||
|
||||
css_provider = GTK_CSS_PROVIDER (provider);
|
||||
priv = css_provider->priv;
|
||||
|
||||
if (priv->rulesets->len == 0)
|
||||
return;
|
||||
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
|
||||
verify_tree_match_results (css_provider, matcher, tree_rules);
|
||||
|
||||
for (ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, priv->rulesets->len - 1);
|
||||
ruleset >= &g_array_index (priv->rulesets, GtkCssRuleset, 0);
|
||||
ruleset--)
|
||||
for (i = tree_rules->len - 1; i >= 0; i--)
|
||||
{
|
||||
ruleset = tree_rules->pdata[i];
|
||||
|
||||
if (ruleset->styles == NULL)
|
||||
continue;
|
||||
|
||||
@@ -1588,9 +1558,6 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
|
||||
ruleset->set_styles))
|
||||
continue;
|
||||
|
||||
if (!gtk_css_ruleset_matches (ruleset, matcher))
|
||||
continue;
|
||||
|
||||
for (j = 0; j < ruleset->n_styles; j++)
|
||||
{
|
||||
GtkCssStyleProperty *prop = ruleset->styles[j].property;
|
||||
@@ -1608,6 +1575,8 @@ gtk_css_style_provider_lookup (GtkStyleProviderPrivate *provider,
|
||||
if (_gtk_bitmask_is_empty (_gtk_css_lookup_get_missing (lookup)))
|
||||
break;
|
||||
}
|
||||
|
||||
g_ptr_array_free (tree_rules, TRUE);
|
||||
}
|
||||
|
||||
static GtkCssChange
|
||||
@@ -1617,26 +1586,29 @@ gtk_css_style_provider_get_change (GtkStyleProviderPrivate *provider,
|
||||
GtkCssProvider *css_provider;
|
||||
GtkCssProviderPrivate *priv;
|
||||
GtkCssChange change = 0;
|
||||
GPtrArray *tree_rules;
|
||||
int i;
|
||||
|
||||
css_provider = GTK_CSS_PROVIDER (provider);
|
||||
priv = css_provider->priv;
|
||||
|
||||
for (i = priv->rulesets->len - 1; i >= 0; i--)
|
||||
tree_rules = _gtk_css_selector_tree_match_all (priv->tree, matcher);
|
||||
verify_tree_match_results (css_provider, matcher, tree_rules);
|
||||
|
||||
for (i = tree_rules->len - 1; i >= 0; i--)
|
||||
{
|
||||
GtkCssRuleset *ruleset;
|
||||
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
ruleset = tree_rules->pdata[i];
|
||||
|
||||
if (ruleset->styles == NULL)
|
||||
continue;
|
||||
|
||||
if (!gtk_css_ruleset_matches (ruleset, matcher))
|
||||
continue;
|
||||
|
||||
change |= gtk_css_ruleset_get_change (ruleset);
|
||||
}
|
||||
|
||||
g_ptr_array_free (tree_rules, TRUE);
|
||||
|
||||
return change;
|
||||
}
|
||||
|
||||
@@ -1663,6 +1635,7 @@ gtk_css_provider_finalize (GObject *object)
|
||||
gtk_css_ruleset_clear (&g_array_index (priv->rulesets, GtkCssRuleset, i));
|
||||
|
||||
g_array_free (priv->rulesets, TRUE);
|
||||
_gtk_css_selector_tree_free (priv->tree);
|
||||
|
||||
g_hash_table_destroy (priv->symbolic_colors);
|
||||
g_hash_table_destroy (priv->keyframes);
|
||||
@@ -1800,6 +1773,9 @@ gtk_css_provider_reset (GtkCssProvider *css_provider)
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
gtk_css_ruleset_clear (&g_array_index (priv->rulesets, GtkCssRuleset, i));
|
||||
g_array_set_size (priv->rulesets, 0);
|
||||
_gtk_css_selector_tree_free (priv->tree);
|
||||
priv->tree = NULL;
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1902,7 +1878,7 @@ parse_import (GtkCssScanner *scanner)
|
||||
static gboolean
|
||||
parse_color_definition (GtkCssScanner *scanner)
|
||||
{
|
||||
GtkCssValue *symbolic;
|
||||
GtkCssValue *color;
|
||||
char *name;
|
||||
|
||||
gtk_css_scanner_push_section (scanner, GTK_CSS_SECTION_COLOR_DEFINITION);
|
||||
@@ -1926,8 +1902,8 @@ parse_color_definition (GtkCssScanner *scanner)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
symbolic = _gtk_css_symbolic_value_new (scanner->parser);
|
||||
if (symbolic == NULL)
|
||||
color = _gtk_css_color_value_parse (scanner->parser);
|
||||
if (color == NULL)
|
||||
{
|
||||
g_free (name);
|
||||
_gtk_css_parser_resync (scanner->parser, TRUE, 0);
|
||||
@@ -1938,7 +1914,7 @@ parse_color_definition (GtkCssScanner *scanner)
|
||||
if (!_gtk_css_parser_try (scanner->parser, ";", TRUE))
|
||||
{
|
||||
g_free (name);
|
||||
_gtk_css_value_unref (symbolic);
|
||||
_gtk_css_value_unref (color);
|
||||
gtk_css_provider_error_literal (scanner->provider,
|
||||
scanner,
|
||||
GTK_CSS_PROVIDER_ERROR,
|
||||
@@ -1950,7 +1926,7 @@ parse_color_definition (GtkCssScanner *scanner)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
g_hash_table_insert (scanner->provider->priv->symbolic_colors, name, symbolic);
|
||||
g_hash_table_insert (scanner->provider->priv->symbolic_colors, name, color);
|
||||
|
||||
gtk_css_scanner_pop_section (scanner, GTK_CSS_SECTION_COLOR_DEFINITION);
|
||||
return TRUE;
|
||||
@@ -2434,8 +2410,38 @@ static void
|
||||
gtk_css_provider_postprocess (GtkCssProvider *css_provider)
|
||||
{
|
||||
GtkCssProviderPrivate *priv = css_provider->priv;
|
||||
GtkCssSelectorTreeBuilder *builder;
|
||||
guint i;
|
||||
|
||||
g_array_sort (priv->rulesets, gtk_css_provider_compare_rule);
|
||||
|
||||
builder = _gtk_css_selector_tree_builder_new ();
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
{
|
||||
GtkCssRuleset *ruleset;
|
||||
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
|
||||
_gtk_css_selector_tree_builder_add (builder,
|
||||
ruleset->selector,
|
||||
&ruleset->selector_match,
|
||||
ruleset);
|
||||
}
|
||||
|
||||
priv->tree = _gtk_css_selector_tree_builder_build (builder);
|
||||
_gtk_css_selector_tree_builder_free (builder);
|
||||
|
||||
#ifndef VERIFY_TREE
|
||||
for (i = 0; i < priv->rulesets->len; i++)
|
||||
{
|
||||
GtkCssRuleset *ruleset;
|
||||
|
||||
ruleset = &g_array_index (priv->rulesets, GtkCssRuleset, i);
|
||||
|
||||
_gtk_css_selector_free (ruleset->selector);
|
||||
ruleset->selector = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -2699,6 +2705,124 @@ _gtk_css_provider_get_theme_dir (void)
|
||||
return path;
|
||||
}
|
||||
|
||||
/**
|
||||
* _gtk_css_provider_load_named:
|
||||
* @provider: a #GtkCssProvider
|
||||
* @name: A theme name
|
||||
* @variant: (allow-none): variant to load, for example, "dark", or
|
||||
* %NULL for the default
|
||||
*
|
||||
* Loads a theme from the usual theme paths. The actual process of
|
||||
* finding the theme might change between releases, but it is
|
||||
* guaranteed that this function uses the same mechanism to load the
|
||||
* theme than GTK uses for loading its own theme.
|
||||
**/
|
||||
void
|
||||
_gtk_css_provider_load_named (GtkCssProvider *provider,
|
||||
const gchar *name,
|
||||
const gchar *variant)
|
||||
{
|
||||
gchar *subpath, *path;
|
||||
gchar *resource_path;
|
||||
|
||||
g_return_if_fail (GTK_IS_CSS_PROVIDER (provider));
|
||||
g_return_if_fail (name != NULL);
|
||||
|
||||
gtk_css_provider_reset (provider);
|
||||
|
||||
/* try loading the resource for the theme. This is mostly meant for built-in
|
||||
* themes.
|
||||
*/
|
||||
if (variant)
|
||||
resource_path = g_strdup_printf ("/org/gtk/libgtk/%s-%s.css", name, variant);
|
||||
else
|
||||
resource_path = g_strdup_printf ("/org/gtk/libgtk/%s.css", name);
|
||||
|
||||
if (g_resources_get_info (resource_path, 0, NULL, NULL, NULL))
|
||||
{
|
||||
gtk_css_provider_load_from_resource (provider, resource_path);
|
||||
g_free (resource_path);
|
||||
return;
|
||||
}
|
||||
g_free (resource_path);
|
||||
|
||||
|
||||
/* Next try looking for files in the various theme directories.
|
||||
*/
|
||||
if (variant)
|
||||
subpath = g_strdup_printf ("gtk-3.0" G_DIR_SEPARATOR_S "gtk-%s.css", variant);
|
||||
else
|
||||
subpath = g_strdup ("gtk-3.0" G_DIR_SEPARATOR_S "gtk.css");
|
||||
|
||||
/* First look in the user's config directory
|
||||
*/
|
||||
path = g_build_filename (g_get_user_data_dir (), "themes", name, subpath, NULL);
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (path);
|
||||
/* Next look in the user's home directory
|
||||
*/
|
||||
path = g_build_filename (g_get_home_dir (), ".themes", name, subpath, NULL);
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
gchar *theme_dir;
|
||||
|
||||
g_free (path);
|
||||
|
||||
/* Finally, try in the default theme directory */
|
||||
theme_dir = _gtk_css_provider_get_theme_dir ();
|
||||
path = g_build_filename (theme_dir, name, subpath, NULL);
|
||||
g_free (theme_dir);
|
||||
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (path);
|
||||
path = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
g_free (subpath);
|
||||
|
||||
if (path)
|
||||
{
|
||||
char *dir, *resource_file;
|
||||
GResource *resource;
|
||||
|
||||
dir = g_path_get_dirname (path);
|
||||
resource_file = g_build_filename (dir, "gtk.gresource", NULL);
|
||||
resource = g_resource_load (resource_file, NULL);
|
||||
g_free (resource_file);
|
||||
|
||||
if (resource != NULL)
|
||||
g_resources_register (resource);
|
||||
|
||||
gtk_css_provider_load_from_path (provider, path, NULL);
|
||||
|
||||
/* Only set this after load, as load_from_path will clear it */
|
||||
provider->priv->resource = resource;
|
||||
|
||||
g_free (path);
|
||||
g_free (dir);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Things failed! Fall back! Fall back! */
|
||||
|
||||
if (variant)
|
||||
{
|
||||
/* If there was a variant, try without */
|
||||
_gtk_css_provider_load_named (provider, name, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Worst case, fall back to Raleigh */
|
||||
g_return_if_fail (!g_str_equal (name, "Raleigh")); /* infloop protection */
|
||||
_gtk_css_provider_load_named (provider, "Raleigh", NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_css_provider_get_named:
|
||||
* @name: A theme name
|
||||
@@ -2719,113 +2843,22 @@ gtk_css_provider_get_named (const gchar *name,
|
||||
gchar *key;
|
||||
|
||||
if (variant == NULL)
|
||||
key = (gchar *)name;
|
||||
key = g_strdup (name);
|
||||
else
|
||||
key = g_strconcat (name, "-", variant, NULL);
|
||||
if (G_UNLIKELY (!themes))
|
||||
themes = g_hash_table_new (g_str_hash, g_str_equal);
|
||||
|
||||
provider = g_hash_table_lookup (themes, key);
|
||||
|
||||
|
||||
if (!provider)
|
||||
{
|
||||
gchar *resource_path = NULL;
|
||||
|
||||
if (variant)
|
||||
resource_path = g_strdup_printf ("/org/gtk/libgtk/%s-%s.css", name, variant);
|
||||
else
|
||||
resource_path = g_strdup_printf ("/org/gtk/libgtk/%s.css", name);
|
||||
|
||||
if (g_resources_get_info (resource_path, 0, NULL, NULL, NULL))
|
||||
{
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_resource (provider, resource_path);
|
||||
}
|
||||
g_free (resource_path);
|
||||
provider = gtk_css_provider_new ();
|
||||
_gtk_css_provider_load_named (provider, name, variant);
|
||||
g_hash_table_insert (themes, g_strdup (key), provider);
|
||||
}
|
||||
|
||||
if (!provider)
|
||||
{
|
||||
gchar *subpath, *path = NULL;
|
||||
|
||||
if (variant)
|
||||
subpath = g_strdup_printf ("gtk-3.0" G_DIR_SEPARATOR_S "gtk-%s.css", variant);
|
||||
else
|
||||
subpath = g_strdup ("gtk-3.0" G_DIR_SEPARATOR_S "gtk.css");
|
||||
|
||||
/* First look in the user's config directory
|
||||
*/
|
||||
path = g_build_filename (g_get_user_data_dir (), "themes", name, subpath, NULL);
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (path);
|
||||
path = NULL;
|
||||
}
|
||||
|
||||
/* Next look in the user's home directory
|
||||
*/
|
||||
if (!path)
|
||||
{
|
||||
const gchar *home_dir;
|
||||
|
||||
home_dir = g_get_home_dir ();
|
||||
if (home_dir)
|
||||
{
|
||||
path = g_build_filename (home_dir, ".themes", name, subpath, NULL);
|
||||
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (path);
|
||||
path = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!path)
|
||||
{
|
||||
gchar *theme_dir;
|
||||
|
||||
theme_dir = _gtk_css_provider_get_theme_dir ();
|
||||
path = g_build_filename (theme_dir, name, subpath, NULL);
|
||||
g_free (theme_dir);
|
||||
|
||||
if (!g_file_test (path, G_FILE_TEST_EXISTS))
|
||||
{
|
||||
g_free (path);
|
||||
path = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
g_free (subpath);
|
||||
|
||||
if (path)
|
||||
{
|
||||
char *dir, *resource_file;
|
||||
GResource *resource;
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
|
||||
dir = g_path_get_dirname (path);
|
||||
resource_file = g_build_filename (dir, "gtk.gresource", NULL);
|
||||
resource = g_resource_load (resource_file, NULL);
|
||||
g_free (resource_file);
|
||||
|
||||
if (resource != NULL)
|
||||
g_resources_register (resource);
|
||||
|
||||
gtk_css_provider_load_from_path (provider, path, NULL);
|
||||
|
||||
/* Only set this after load, as load_from_path will clear it */
|
||||
provider->priv->resource = resource;
|
||||
g_hash_table_insert (themes, g_strdup (key), provider);
|
||||
|
||||
g_free (path);
|
||||
g_free (dir);
|
||||
}
|
||||
}
|
||||
|
||||
if (key != name)
|
||||
g_free (key);
|
||||
|
||||
g_free (key);
|
||||
|
||||
return provider;
|
||||
}
|
||||
@@ -2857,7 +2890,7 @@ gtk_css_ruleset_print (const GtkCssRuleset *ruleset,
|
||||
WidgetPropertyValue *widget_value;
|
||||
guint i;
|
||||
|
||||
_gtk_css_selector_print (ruleset->selector, str);
|
||||
_gtk_css_selector_tree_match_print (ruleset->selector_match, str);
|
||||
|
||||
g_string_append (str, " {\n");
|
||||
|
||||
@@ -2915,7 +2948,6 @@ gtk_css_provider_print_colors (GHashTable *colors,
|
||||
GString *str)
|
||||
{
|
||||
GList *keys, *walk;
|
||||
char *s;
|
||||
|
||||
keys = g_hash_table_get_keys (colors);
|
||||
/* so the output is identical for identical styles */
|
||||
@@ -2924,14 +2956,12 @@ gtk_css_provider_print_colors (GHashTable *colors,
|
||||
for (walk = keys; walk; walk = walk->next)
|
||||
{
|
||||
const char *name = walk->data;
|
||||
GtkSymbolicColor *symbolic = g_hash_table_lookup (colors, (gpointer) name);
|
||||
GtkCssValue *color = g_hash_table_lookup (colors, (gpointer) name);
|
||||
|
||||
g_string_append (str, "@define-color ");
|
||||
g_string_append (str, name);
|
||||
g_string_append (str, " ");
|
||||
s = gtk_symbolic_color_to_string (symbolic);
|
||||
g_string_append (str, s);
|
||||
g_free (s);
|
||||
_gtk_css_value_print (color, str);
|
||||
g_string_append (str, ";\n");
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,10 @@ G_BEGIN_DECLS
|
||||
|
||||
gchar *_gtk_css_provider_get_theme_dir (void);
|
||||
|
||||
void _gtk_css_provider_load_named (GtkCssProvider *provider,
|
||||
const gchar *name,
|
||||
const gchar *variant);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_PROVIDER_PRIVATE_H__ */
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
|
||||
struct _GtkCssValue {
|
||||
GTK_CSS_VALUE_BASE
|
||||
|
||||
+984
-66
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,8 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GtkCssSelector GtkCssSelector;
|
||||
typedef struct _GtkCssSelectorTree GtkCssSelectorTree;
|
||||
typedef struct _GtkCssSelectorTreeBuilder GtkCssSelectorTreeBuilder;
|
||||
|
||||
GtkCssSelector * _gtk_css_selector_parse (GtkCssParser *parser);
|
||||
void _gtk_css_selector_free (GtkCssSelector *selector);
|
||||
@@ -32,14 +34,27 @@ char * _gtk_css_selector_to_string (const GtkCssSelector *sel
|
||||
void _gtk_css_selector_print (const GtkCssSelector *selector,
|
||||
GString *str);
|
||||
|
||||
GtkStateFlags _gtk_css_selector_get_state_flags (const GtkCssSelector *selector);
|
||||
|
||||
GtkCssChange _gtk_css_selector_get_change (const GtkCssSelector *selector);
|
||||
gboolean _gtk_css_selector_matches (const GtkCssSelector *selector,
|
||||
const GtkCssMatcher *matcher);
|
||||
int _gtk_css_selector_compare (const GtkCssSelector *a,
|
||||
const GtkCssSelector *b);
|
||||
|
||||
void _gtk_css_selector_tree_free (GtkCssSelectorTree *tree);
|
||||
GPtrArray * _gtk_css_selector_tree_match_all (const GtkCssSelectorTree *tree,
|
||||
const GtkCssMatcher *matcher);
|
||||
void _gtk_css_selector_tree_match_print (const GtkCssSelectorTree *tree,
|
||||
GString *str);
|
||||
GtkCssChange _gtk_css_selector_tree_match_get_change (const GtkCssSelectorTree *tree);
|
||||
|
||||
|
||||
GtkCssSelectorTreeBuilder *_gtk_css_selector_tree_builder_new (void);
|
||||
void _gtk_css_selector_tree_builder_add (GtkCssSelectorTreeBuilder *builder,
|
||||
GtkCssSelector *selectors,
|
||||
GtkCssSelectorTree **selector_match,
|
||||
gpointer match);
|
||||
GtkCssSelectorTree * _gtk_css_selector_tree_builder_build (GtkCssSelectorTreeBuilder *builder);
|
||||
void _gtk_css_selector_tree_builder_free (GtkCssSelectorTreeBuilder *builder);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_SELECTOR_PRIVATE_H__ */
|
||||
|
||||
@@ -22,10 +22,10 @@
|
||||
#include "gtkcssshadowvalueprivate.h"
|
||||
|
||||
#include "gtkcairoblurprivate.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
#include "gtkthemingengineprivate.h"
|
||||
#include "gtkpango.h"
|
||||
|
||||
@@ -271,7 +271,7 @@ _gtk_css_shadow_value_parse (GtkCssParser *parser)
|
||||
}
|
||||
else if (values[COLOR] == NULL)
|
||||
{
|
||||
values[COLOR] = _gtk_css_symbolic_value_new (parser);
|
||||
values[COLOR] = _gtk_css_color_value_parse (parser);
|
||||
|
||||
if (values[COLOR] == NULL)
|
||||
goto fail;
|
||||
@@ -287,9 +287,7 @@ _gtk_css_shadow_value_parse (GtkCssParser *parser)
|
||||
while (values[HOFFSET] == NULL || !value_is_done_parsing (parser));
|
||||
|
||||
if (values[COLOR] == NULL)
|
||||
values[COLOR] = _gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ()));
|
||||
values[COLOR] = _gtk_css_color_value_new_current_color ();
|
||||
|
||||
return gtk_css_shadow_value_new (values[HOFFSET], values[VOFFSET],
|
||||
values[RADIUS], values[SPREAD],
|
||||
@@ -363,6 +361,7 @@ gtk_css_shadow_value_finish_drawing (const GtkCssValue *shadow,
|
||||
cairo_paint (original_cr);
|
||||
|
||||
cairo_destroy (cr);
|
||||
cairo_surface_destroy (surface);
|
||||
|
||||
return original_cr;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "gtkcssarrayvalueprivate.h"
|
||||
#include "gtkcssbgsizevalueprivate.h"
|
||||
#include "gtkcssbordervalueprivate.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcsscornervalueprivate.h"
|
||||
#include "gtkcsseasevalueprivate.h"
|
||||
#include "gtkcssenumvalueprivate.h"
|
||||
@@ -39,7 +40,6 @@
|
||||
#include "gtkcssstylefuncsprivate.h"
|
||||
#include "gtkcssvalueprivate.h"
|
||||
#include "gtkstylepropertiesprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
|
||||
/* this is in case round() is not provided by the compiler,
|
||||
@@ -217,7 +217,7 @@ parse_border_color (GtkCssShorthandProperty *shorthand,
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
values[i] = _gtk_css_symbolic_value_new (parser);
|
||||
values[i] = _gtk_css_color_value_parse (parser);
|
||||
if (values[i] == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -349,7 +349,7 @@ parse_border_side (GtkCssShorthandProperty *shorthand,
|
||||
}
|
||||
else if (values[2] == NULL)
|
||||
{
|
||||
values[2] = _gtk_css_symbolic_value_new (parser);
|
||||
values[2] = _gtk_css_color_value_parse (parser);
|
||||
if (values[2] == NULL)
|
||||
return FALSE;
|
||||
}
|
||||
@@ -388,7 +388,7 @@ parse_border (GtkCssShorthandProperty *shorthand,
|
||||
}
|
||||
else if (!G_IS_VALUE (&values[8]))
|
||||
{
|
||||
values[8] = _gtk_css_symbolic_value_new (parser);
|
||||
values[8] = _gtk_css_color_value_parse (parser);
|
||||
if (values[8] == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -516,7 +516,7 @@ parse_one_background (GtkCssShorthandProperty *shorthand,
|
||||
}
|
||||
else if (values[6] == NULL)
|
||||
{
|
||||
value = _gtk_css_symbolic_value_new (parser);
|
||||
value = _gtk_css_color_value_parse (parser);
|
||||
if (value == NULL)
|
||||
values[6] = _gtk_css_value_ref (_gtk_css_style_property_get_initial_value
|
||||
(_gtk_css_shorthand_property_get_subproperty (shorthand, 6)));
|
||||
@@ -565,8 +565,8 @@ parse_background (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
@@ -668,8 +668,8 @@ parse_transition (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
@@ -784,8 +784,8 @@ parse_animation (GtkCssShorthandProperty *shorthand,
|
||||
{
|
||||
g_ptr_array_set_free_func (arrays[i], (GDestroyNotify) _gtk_css_value_unref);
|
||||
g_ptr_array_unref (arrays[i]);
|
||||
return FALSE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
|
||||
+33
-16
@@ -27,20 +27,21 @@
|
||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||
#include <cairo-gobject.h>
|
||||
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcssimagegradientprivate.h"
|
||||
#include "gtkcssprovider.h"
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkcsstypedvalueprivate.h"
|
||||
#include "gtkcsstypesprivate.h"
|
||||
#include "gtkgradient.h"
|
||||
#include "gtkgradientprivate.h"
|
||||
#include "gtkprivatetypebuiltins.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
#include "gtkthemingengine.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkwin32themeprivate.h"
|
||||
|
||||
#include "deprecated/gtkgradientprivate.h"
|
||||
#include "deprecated/gtksymboliccolorprivate.h"
|
||||
|
||||
/* this is in case round() is not provided by the compiler,
|
||||
* such as in the case of C89 compilers, like MSVC
|
||||
*/
|
||||
@@ -171,7 +172,9 @@ rgba_value_parse (GtkCssParser *parser,
|
||||
GtkSymbolicColor *symbolic;
|
||||
GdkRGBA rgba;
|
||||
|
||||
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
symbolic = _gtk_css_symbolic_value_new (parser);
|
||||
if (symbolic == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -187,6 +190,8 @@ rgba_value_parse (GtkCssParser *parser,
|
||||
g_value_take_boxed (value, symbolic);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -225,11 +230,11 @@ rgba_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GValue new_value = G_VALUE_INIT;
|
||||
GdkRGBA rgba;
|
||||
|
||||
val = _gtk_symbolic_color_resolve_full (symbolic,
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies);
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (symbolic),
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies);
|
||||
if (val != NULL)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
@@ -253,7 +258,9 @@ color_value_parse (GtkCssParser *parser,
|
||||
GtkSymbolicColor *symbolic;
|
||||
GdkRGBA rgba;
|
||||
|
||||
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
symbolic = _gtk_css_symbolic_value_new (parser);
|
||||
if (symbolic == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -274,6 +281,8 @@ color_value_parse (GtkCssParser *parser,
|
||||
g_value_take_boxed (value, symbolic);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -310,11 +319,11 @@ color_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GValue new_value = G_VALUE_INIT;
|
||||
GtkCssValue *val;
|
||||
|
||||
val = _gtk_symbolic_color_resolve_full ((GtkSymbolicColor *) g_value_get_boxed (value),
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies);
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (g_value_get_boxed (value)),
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies);
|
||||
if (val != NULL)
|
||||
{
|
||||
const GdkRGBA *rgba = _gtk_css_rgba_value_get_rgba (val);
|
||||
@@ -338,7 +347,7 @@ symbolic_color_value_parse (GtkCssParser *parser,
|
||||
{
|
||||
GtkSymbolicColor *symbolic;
|
||||
|
||||
symbolic = _gtk_symbolic_color_new_take_value (_gtk_css_symbolic_value_new (parser));
|
||||
symbolic = _gtk_css_symbolic_value_new (parser);
|
||||
if (symbolic == NULL)
|
||||
return FALSE;
|
||||
|
||||
@@ -352,6 +361,8 @@ symbolic_color_value_print (const GValue *value,
|
||||
{
|
||||
GtkSymbolicColor *symbolic = g_value_get_boxed (value);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (symbolic == NULL)
|
||||
g_string_append (string, "none");
|
||||
else
|
||||
@@ -360,6 +371,8 @@ symbolic_color_value_print (const GValue *value,
|
||||
g_string_append (string, s);
|
||||
g_free (s);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -702,6 +715,8 @@ gradient_value_print (const GValue *value,
|
||||
{
|
||||
GtkGradient *gradient = g_value_get_boxed (value);
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
||||
|
||||
if (gradient == NULL)
|
||||
g_string_append (string, "none");
|
||||
else
|
||||
@@ -710,6 +725,8 @@ gradient_value_print (const GValue *value,
|
||||
g_string_append (string, s);
|
||||
g_free (s);
|
||||
}
|
||||
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -42,12 +42,14 @@
|
||||
#include "gtkcssarrayvalueprivate.h"
|
||||
#include "gtkcssbgsizevalueprivate.h"
|
||||
#include "gtkcssbordervalueprivate.h"
|
||||
#include "gtkcsscolorvalueprivate.h"
|
||||
#include "gtkcsscornervalueprivate.h"
|
||||
#include "gtkcsseasevalueprivate.h"
|
||||
#include "gtkcssenginevalueprivate.h"
|
||||
#include "gtkcssimagegradientprivate.h"
|
||||
#include "gtkcssimageprivate.h"
|
||||
#include "gtkcssimagegradientprivate.h"
|
||||
#include "gtkcssimagevalueprivate.h"
|
||||
#include "gtkcssinitialvalueprivate.h"
|
||||
#include "gtkcssenumvalueprivate.h"
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcsspositionvalueprivate.h"
|
||||
@@ -55,7 +57,6 @@
|
||||
#include "gtkcssrgbavalueprivate.h"
|
||||
#include "gtkcssshadowsvalueprivate.h"
|
||||
#include "gtkcssstringvalueprivate.h"
|
||||
#include "gtksymboliccolorprivate.h"
|
||||
#include "gtkthemingengine.h"
|
||||
#include "gtktypebuiltins.h"
|
||||
#include "gtkwin32themeprivate.h"
|
||||
@@ -159,7 +160,7 @@ assign_border (GtkCssStyleProperty *property,
|
||||
const GtkBorder *border = g_value_get_boxed (value);
|
||||
|
||||
if (border == NULL)
|
||||
return _gtk_css_value_ref (_gtk_css_style_property_get_initial_value (property));
|
||||
return _gtk_css_initial_value_new ();
|
||||
else
|
||||
return _gtk_css_border_value_new (_gtk_css_number_value_new (border->top, GTK_CSS_PX),
|
||||
_gtk_css_number_value_new (border->right, GTK_CSS_PX),
|
||||
@@ -171,7 +172,7 @@ static GtkCssValue *
|
||||
color_parse (GtkCssStyleProperty *property,
|
||||
GtkCssParser *parser)
|
||||
{
|
||||
return _gtk_css_symbolic_value_new (parser);
|
||||
return _gtk_css_color_value_parse (parser);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -853,17 +854,6 @@ background_position_parse (GtkCssStyleProperty *property,
|
||||
|
||||
/*** REGISTRATION ***/
|
||||
|
||||
static GtkSymbolicColor *
|
||||
gtk_symbolic_color_new_rgba (double red,
|
||||
double green,
|
||||
double blue,
|
||||
double alpha)
|
||||
{
|
||||
GdkRGBA rgba = { red, green, blue, alpha };
|
||||
|
||||
return gtk_symbolic_color_new_literal (&rgba);
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_css_style_property_init_properties (void)
|
||||
{
|
||||
@@ -878,8 +868,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_new_rgba (1, 1, 1, 1)));
|
||||
_gtk_css_color_value_new_rgba (1, 1, 1, 1));
|
||||
gtk_css_style_property_register ("font-size",
|
||||
GTK_CSS_PROPERTY_FONT_SIZE,
|
||||
G_TYPE_DOUBLE,
|
||||
@@ -899,8 +888,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_new_rgba (0, 0, 0, 0)));
|
||||
_gtk_css_color_value_new_rgba (0, 0, 0, 0));
|
||||
|
||||
gtk_css_style_property_register ("font-family",
|
||||
GTK_CSS_PROPERTY_FONT_FAMILY,
|
||||
@@ -1197,9 +1185,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ())));
|
||||
_gtk_css_color_value_new_current_color ());
|
||||
gtk_css_style_property_register ("border-right-color",
|
||||
GTK_CSS_PROPERTY_BORDER_RIGHT_COLOR,
|
||||
GDK_TYPE_RGBA,
|
||||
@@ -1207,9 +1193,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ())));
|
||||
_gtk_css_color_value_new_current_color ());
|
||||
gtk_css_style_property_register ("border-bottom-color",
|
||||
GTK_CSS_PROPERTY_BORDER_BOTTOM_COLOR,
|
||||
GDK_TYPE_RGBA,
|
||||
@@ -1217,9 +1201,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ())));
|
||||
_gtk_css_color_value_new_current_color ());
|
||||
gtk_css_style_property_register ("border-left-color",
|
||||
GTK_CSS_PROPERTY_BORDER_LEFT_COLOR,
|
||||
GDK_TYPE_RGBA,
|
||||
@@ -1227,9 +1209,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ())));
|
||||
_gtk_css_color_value_new_current_color ());
|
||||
gtk_css_style_property_register ("outline-color",
|
||||
GTK_CSS_PROPERTY_OUTLINE_COLOR,
|
||||
GDK_TYPE_RGBA,
|
||||
@@ -1237,9 +1217,7 @@ _gtk_css_style_property_init_properties (void)
|
||||
color_parse,
|
||||
color_query,
|
||||
color_assign,
|
||||
_gtk_css_symbolic_value_new_take_symbolic_color (
|
||||
gtk_symbolic_color_ref (
|
||||
_gtk_symbolic_color_get_current_color ())));
|
||||
_gtk_css_color_value_new_current_color ());
|
||||
|
||||
gtk_css_style_property_register ("background-repeat",
|
||||
GTK_CSS_PROPERTY_BACKGROUND_REPEAT,
|
||||
|
||||
@@ -602,7 +602,7 @@ custom_paper_printer_data_func (GtkCellLayout *cell_layout,
|
||||
if (printer)
|
||||
g_object_set (cell, "text", gtk_printer_get_name (printer), NULL);
|
||||
else
|
||||
g_object_set (cell, "text", _("Margins from Printer..."), NULL);
|
||||
g_object_set (cell, "text", _("Margins from Printer…"), NULL);
|
||||
|
||||
if (printer)
|
||||
g_object_unref (printer);
|
||||
|
||||
@@ -8807,6 +8807,9 @@ gtk_entry_set_icon_tooltip_text (GtkEntry *entry,
|
||||
icon_info->tooltip = tooltip ? g_markup_escape_text (tooltip, -1) : NULL;
|
||||
|
||||
ensure_has_tooltip (entry);
|
||||
|
||||
g_object_notify (G_OBJECT (entry),
|
||||
icon_pos == GTK_ENTRY_ICON_PRIMARY ? "primary-icon-tooltip-text" : "secondary-icon-tooltip-text");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -803,6 +803,23 @@ typedef enum
|
||||
GTK_DRAG_RESULT_ERROR
|
||||
} GtkDragResult;
|
||||
|
||||
/**
|
||||
* GtkSizeGroupMode:
|
||||
* @GTK_SIZE_GROUP_NONE: group has no effect
|
||||
* @GTK_SIZE_GROUP_HORIZONTAL: group affects horizontal requisition
|
||||
* @GTK_SIZE_GROUP_VERTICAL: group affects vertical requisition
|
||||
* @GTK_SIZE_GROUP_BOTH: group affects both horizontal and vertical requisition
|
||||
*
|
||||
* The mode of the size group determines the directions in which the size
|
||||
* group affects the requested sizes of its component widgets.
|
||||
**/
|
||||
typedef enum {
|
||||
GTK_SIZE_GROUP_NONE,
|
||||
GTK_SIZE_GROUP_HORIZONTAL,
|
||||
GTK_SIZE_GROUP_VERTICAL,
|
||||
GTK_SIZE_GROUP_BOTH
|
||||
} GtkSizeGroupMode;
|
||||
|
||||
/**
|
||||
* GtkSizeRequestMode:
|
||||
* @GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH: Prefer height-for-width geometry management
|
||||
|
||||
+2
-4
@@ -1251,7 +1251,6 @@ get_next_site (GtkExpander *expander,
|
||||
case GTK_DIR_RIGHT:
|
||||
return FOCUS_WIDGET;
|
||||
}
|
||||
break;
|
||||
case FOCUS_WIDGET:
|
||||
switch (direction)
|
||||
{
|
||||
@@ -1265,8 +1264,8 @@ get_next_site (GtkExpander *expander,
|
||||
return FOCUS_LABEL;
|
||||
case GTK_DIR_RIGHT:
|
||||
return ltr ? FOCUS_LABEL : FOCUS_NONE;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FOCUS_LABEL:
|
||||
switch (direction)
|
||||
{
|
||||
@@ -1280,8 +1279,8 @@ get_next_site (GtkExpander *expander,
|
||||
return FOCUS_CHILD;
|
||||
case GTK_DIR_RIGHT:
|
||||
return ltr ? FOCUS_CHILD : FOCUS_WIDGET;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case FOCUS_CHILD:
|
||||
switch (direction)
|
||||
{
|
||||
@@ -1294,7 +1293,6 @@ get_next_site (GtkExpander *expander,
|
||||
case GTK_DIR_RIGHT:
|
||||
return FOCUS_NONE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
g_assert_not_reached ();
|
||||
|
||||
@@ -2043,7 +2043,7 @@ model_add_other (GtkFileChooserButton *button)
|
||||
gtk_list_store_insert (store, &iter, pos);
|
||||
gtk_list_store_set (store, &iter,
|
||||
ICON_COLUMN, NULL,
|
||||
DISPLAY_NAME_COLUMN, _("Other..."),
|
||||
DISPLAY_NAME_COLUMN, _("Other…"),
|
||||
TYPE_COLUMN, ROW_TYPE_OTHER,
|
||||
DATA_COLUMN, NULL,
|
||||
IS_FOLDER_COLUMN, FALSE,
|
||||
|
||||
@@ -264,6 +264,7 @@ typedef enum {
|
||||
#define SETTINGS_KEY_SORT_ORDER "sort-order"
|
||||
#define SETTINGS_KEY_WINDOW_POSITION "window-position"
|
||||
#define SETTINGS_KEY_WINDOW_SIZE "window-size"
|
||||
#define SETTINGS_KEY_SIDEBAR_WIDTH "sidebar-width"
|
||||
|
||||
static void gtk_file_chooser_default_iface_init (GtkFileChooserIface *iface);
|
||||
static void gtk_file_chooser_embed_default_iface_init (GtkFileChooserEmbedIface *iface);
|
||||
@@ -3385,7 +3386,7 @@ shortcuts_build_popup_menu (GtkFileChooserDefault *impl)
|
||||
gtk_widget_show (item);
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (impl->browse_shortcuts_popup_menu), item);
|
||||
|
||||
item = gtk_menu_item_new_with_label (_("Rename..."));
|
||||
item = gtk_menu_item_new_with_label (_("Rename…"));
|
||||
impl->browse_shortcuts_popup_menu_rename_item = item;
|
||||
g_signal_connect (item, "activate",
|
||||
G_CALLBACK (rename_shortcut_cb), impl);
|
||||
@@ -5057,7 +5058,7 @@ browse_widgets_create (GtkFileChooserDefault *impl)
|
||||
|
||||
/* Paned widget */
|
||||
|
||||
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
hpaned = impl->browse_widgets_hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_widget_show (hpaned);
|
||||
gtk_box_pack_start (GTK_BOX (impl->browse_widgets_box), hpaned, TRUE, TRUE, 0);
|
||||
|
||||
@@ -5065,7 +5066,6 @@ browse_widgets_create (GtkFileChooserDefault *impl)
|
||||
gtk_paned_pack1 (GTK_PANED (hpaned), widget, FALSE, FALSE);
|
||||
widget = file_pane_create (impl, size_group);
|
||||
gtk_paned_pack2 (GTK_PANED (hpaned), widget, TRUE, FALSE);
|
||||
gtk_paned_set_position (GTK_PANED (hpaned), 148);
|
||||
g_object_unref (size_group);
|
||||
}
|
||||
|
||||
@@ -6037,6 +6037,7 @@ settings_load (GtkFileChooserDefault *impl)
|
||||
gboolean show_size_column;
|
||||
gint sort_column;
|
||||
GtkSortType sort_order;
|
||||
gint sidebar_width;
|
||||
|
||||
settings_ensure (impl);
|
||||
|
||||
@@ -6045,6 +6046,7 @@ settings_load (GtkFileChooserDefault *impl)
|
||||
show_size_column = g_settings_get_boolean (impl->settings, SETTINGS_KEY_SHOW_SIZE_COLUMN);
|
||||
sort_column = g_settings_get_enum (impl->settings, SETTINGS_KEY_SORT_COLUMN);
|
||||
sort_order = g_settings_get_enum (impl->settings, SETTINGS_KEY_SORT_ORDER);
|
||||
sidebar_width = g_settings_get_int (impl->settings, SETTINGS_KEY_SIDEBAR_WIDTH);
|
||||
|
||||
location_mode_set (impl, location_mode, TRUE);
|
||||
|
||||
@@ -6059,6 +6061,8 @@ settings_load (GtkFileChooserDefault *impl)
|
||||
* created yet. The individual functions that create and set the models will
|
||||
* call set_sort_column() themselves.
|
||||
*/
|
||||
|
||||
gtk_paned_set_position (GTK_PANED (impl->browse_widgets_hpaned), sidebar_width);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -6106,6 +6110,8 @@ settings_save (GtkFileChooserDefault *impl)
|
||||
g_settings_set_boolean (impl->settings, SETTINGS_KEY_SHOW_SIZE_COLUMN, impl->show_size_column);
|
||||
g_settings_set_enum (impl->settings, SETTINGS_KEY_SORT_COLUMN, impl->sort_column);
|
||||
g_settings_set_enum (impl->settings, SETTINGS_KEY_SORT_ORDER, impl->sort_order);
|
||||
g_settings_set_int (impl->settings, SETTINGS_KEY_SIDEBAR_WIDTH,
|
||||
gtk_paned_get_position (GTK_PANED (impl->browse_widgets_hpaned)));
|
||||
|
||||
save_dialog_geometry (impl);
|
||||
|
||||
|
||||
@@ -548,12 +548,8 @@ finished_loading_cb (GtkFileSystemModel *model,
|
||||
|
||||
completion = gtk_entry_get_completion (GTK_ENTRY (chooser_entry));
|
||||
update_inline_completion (chooser_entry);
|
||||
|
||||
if (gtk_widget_has_focus (GTK_WIDGET (chooser_entry)))
|
||||
{
|
||||
gtk_entry_completion_complete (completion);
|
||||
gtk_entry_completion_insert_prefix (completion);
|
||||
}
|
||||
gtk_entry_completion_complete (completion);
|
||||
gtk_entry_completion_insert_prefix (completion);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -166,6 +166,7 @@ struct _GtkFileChooserDefault
|
||||
|
||||
/* The file browsing widgets */
|
||||
GtkWidget *browse_widgets_box;
|
||||
GtkWidget *browse_widgets_hpaned;
|
||||
GtkWidget *browse_header_box;
|
||||
GtkWidget *browse_shortcuts_tree_view;
|
||||
GtkWidget *browse_shortcuts_add_button;
|
||||
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2012 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkhslaprivate.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
void
|
||||
_gtk_hsla_init (GtkHSLA *hsla,
|
||||
double hue,
|
||||
double saturation,
|
||||
double lightness,
|
||||
double alpha)
|
||||
{
|
||||
g_return_if_fail (hsla != NULL);
|
||||
|
||||
if (hue >= 0)
|
||||
hsla->hue = fmod (hue, 360);
|
||||
else
|
||||
hsla->hue = fmod (hue, 360) + 360;
|
||||
hsla->saturation = CLAMP (saturation, 0, 1);
|
||||
hsla->lightness = CLAMP (lightness, 0, 1);
|
||||
hsla->alpha = CLAMP (alpha, 0, 1);
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_hsla_init_from_rgba (GtkHSLA *hsla,
|
||||
const GdkRGBA *rgba)
|
||||
{
|
||||
gdouble min;
|
||||
gdouble max;
|
||||
gdouble red;
|
||||
gdouble green;
|
||||
gdouble blue;
|
||||
gdouble delta;
|
||||
|
||||
g_return_if_fail (hsla != NULL);
|
||||
g_return_if_fail (rgba != NULL);
|
||||
|
||||
red = rgba->red;
|
||||
green = rgba->green;
|
||||
blue = rgba->blue;
|
||||
|
||||
if (red > green)
|
||||
{
|
||||
if (red > blue)
|
||||
max = red;
|
||||
else
|
||||
max = blue;
|
||||
|
||||
if (green < blue)
|
||||
min = green;
|
||||
else
|
||||
min = blue;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (green > blue)
|
||||
max = green;
|
||||
else
|
||||
max = blue;
|
||||
|
||||
if (red < blue)
|
||||
min = red;
|
||||
else
|
||||
min = blue;
|
||||
}
|
||||
|
||||
hsla->lightness = (max + min) / 2;
|
||||
hsla->saturation = 0;
|
||||
hsla->hue = 0;
|
||||
hsla->alpha = rgba->alpha;
|
||||
|
||||
if (max != min)
|
||||
{
|
||||
if (hsla->lightness <= 0.5)
|
||||
hsla->saturation = (max - min) / (max + min);
|
||||
else
|
||||
hsla->saturation = (max - min) / (2 - max - min);
|
||||
|
||||
delta = max -min;
|
||||
if (red == max)
|
||||
hsla->hue = (green - blue) / delta;
|
||||
else if (green == max)
|
||||
hsla->hue = 2 + (blue - red) / delta;
|
||||
else if (blue == max)
|
||||
hsla->hue = 4 + (red - green) / delta;
|
||||
|
||||
hsla->hue *= 60;
|
||||
if (hsla->hue < 0.0)
|
||||
hsla->hue += 360;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_rgba_init_from_hsla (GdkRGBA *rgba,
|
||||
const GtkHSLA *hsla)
|
||||
{
|
||||
gdouble hue;
|
||||
gdouble lightness;
|
||||
gdouble saturation;
|
||||
gdouble m1, m2;
|
||||
|
||||
lightness = hsla->lightness;
|
||||
saturation = hsla->saturation;
|
||||
|
||||
if (lightness <= 0.5)
|
||||
m2 = lightness * (1 + saturation);
|
||||
else
|
||||
m2 = lightness + saturation - lightness * saturation;
|
||||
m1 = 2 * lightness - m2;
|
||||
|
||||
rgba->alpha = hsla->alpha;
|
||||
|
||||
if (saturation == 0)
|
||||
{
|
||||
rgba->red = lightness;
|
||||
rgba->green = lightness;
|
||||
rgba->blue = lightness;
|
||||
}
|
||||
else
|
||||
{
|
||||
hue = hsla->hue + 120;
|
||||
while (hue > 360)
|
||||
hue -= 360;
|
||||
while (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->red = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->red = m2;
|
||||
else if (hue < 240)
|
||||
rgba->red = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->red = m1;
|
||||
|
||||
hue = hsla->hue;
|
||||
while (hue > 360)
|
||||
hue -= 360;
|
||||
while (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->green = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->green = m2;
|
||||
else if (hue < 240)
|
||||
rgba->green = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->green = m1;
|
||||
|
||||
hue = hsla->hue - 120;
|
||||
while (hue > 360)
|
||||
hue -= 360;
|
||||
while (hue < 0)
|
||||
hue += 360;
|
||||
|
||||
if (hue < 60)
|
||||
rgba->blue = m1 + (m2 - m1) * hue / 60;
|
||||
else if (hue < 180)
|
||||
rgba->blue = m2;
|
||||
else if (hue < 240)
|
||||
rgba->blue = m1 + (m2 - m1) * (240 - hue) / 60;
|
||||
else
|
||||
rgba->blue = m1;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gtk_hsla_shade (GtkHSLA *dest,
|
||||
const GtkHSLA *src,
|
||||
double factor)
|
||||
{
|
||||
g_return_if_fail (dest != NULL);
|
||||
g_return_if_fail (src != NULL);
|
||||
|
||||
dest->hue = src->hue;
|
||||
|
||||
dest->lightness = src->lightness * factor;
|
||||
dest->lightness = CLAMP (dest->lightness, 0.0, 1.0);
|
||||
|
||||
dest->saturation = src->saturation * factor;
|
||||
dest->saturation = CLAMP (dest->saturation, 0.0, 1.0);
|
||||
|
||||
dest->alpha = src->alpha;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2012 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* 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, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_HSLA_PRIVATE_H__
|
||||
#define __GTK_HSLA_PRIVATE_H__
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GtkHSLA GtkHSLA;
|
||||
|
||||
struct _GtkHSLA {
|
||||
double hue;
|
||||
double saturation;
|
||||
double lightness;
|
||||
double alpha;
|
||||
};
|
||||
|
||||
void _gtk_hsla_init (GtkHSLA *hsla,
|
||||
double hue,
|
||||
double saturation,
|
||||
double lightness,
|
||||
double alpha);
|
||||
void _gtk_hsla_init_from_rgba (GtkHSLA *hsla,
|
||||
const GdkRGBA *rgba);
|
||||
/* Yes, I can name that function like this! */
|
||||
void _gdk_rgba_init_from_hsla (GdkRGBA *rgba,
|
||||
const GtkHSLA *hsla);
|
||||
|
||||
void _gtk_hsla_shade (GtkHSLA *dest,
|
||||
const GtkHSLA *src,
|
||||
double factor);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_HSLA_PRIVATE_H__ */
|
||||
+1
-3
@@ -20,7 +20,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkiconhelperprivate.h"
|
||||
#include "string.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkIconHelper, _gtk_icon_helper, G_TYPE_OBJECT)
|
||||
|
||||
@@ -467,8 +466,7 @@ _gtk_icon_helper_set_stock_id (GtkIconHelper *self,
|
||||
{
|
||||
_gtk_icon_helper_clear (self);
|
||||
|
||||
if (stock_id != NULL &&
|
||||
g_strcmp0 (stock_id, "") != 0)
|
||||
if (stock_id != NULL)
|
||||
{
|
||||
self->priv->storage_type = GTK_IMAGE_STOCK;
|
||||
self->priv->stock_id = g_strdup (stock_id);
|
||||
|
||||
+82
-57
@@ -194,7 +194,7 @@ struct _GtkIconThemePrivate
|
||||
glong last_stat_time;
|
||||
GList *dir_mtimes;
|
||||
|
||||
gulong theme_changed_idle;
|
||||
gulong reset_styles_idle;
|
||||
};
|
||||
|
||||
struct _GtkIconInfo
|
||||
@@ -202,6 +202,7 @@ struct _GtkIconInfo
|
||||
/* Information about the source
|
||||
*/
|
||||
gchar *filename;
|
||||
GFile *icon_file;
|
||||
GLoadableIcon *loadable;
|
||||
GSList *emblem_infos;
|
||||
|
||||
@@ -690,7 +691,7 @@ free_dir_mtime (IconThemeDirMtime *dir_mtime)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
theme_changed_idle (gpointer user_data)
|
||||
reset_styles_idle (gpointer user_data)
|
||||
{
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconThemePrivate *priv;
|
||||
@@ -698,27 +699,14 @@ theme_changed_idle (gpointer user_data)
|
||||
icon_theme = GTK_ICON_THEME (user_data);
|
||||
priv = icon_theme->priv;
|
||||
|
||||
g_signal_emit (icon_theme, signal_changed, 0);
|
||||
|
||||
if (priv->screen && priv->is_screen_singleton)
|
||||
gtk_style_context_reset_widgets (priv->screen);
|
||||
|
||||
priv->theme_changed_idle = 0;
|
||||
priv->reset_styles_idle = 0;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
queue_theme_changed (GtkIconTheme *icon_theme)
|
||||
{
|
||||
GtkIconThemePrivate *priv = icon_theme->priv;
|
||||
|
||||
if (!priv->theme_changed_idle)
|
||||
priv->theme_changed_idle =
|
||||
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2,
|
||||
theme_changed_idle, icon_theme, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
do_theme_change (GtkIconTheme *icon_theme)
|
||||
{
|
||||
@@ -730,7 +718,12 @@ do_theme_change (GtkIconTheme *icon_theme)
|
||||
GTK_NOTE (ICONTHEME,
|
||||
g_print ("change to icon theme \"%s\"\n", priv->current_theme));
|
||||
blow_themes (icon_theme);
|
||||
queue_theme_changed (icon_theme);
|
||||
g_signal_emit (icon_theme, signal_changed, 0);
|
||||
|
||||
if (!priv->reset_styles_idle)
|
||||
priv->reset_styles_idle =
|
||||
gdk_threads_add_idle_full (GTK_PRIORITY_RESIZE - 2,
|
||||
reset_styles_idle, icon_theme, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -762,10 +755,10 @@ gtk_icon_theme_finalize (GObject *object)
|
||||
icon_theme = GTK_ICON_THEME (object);
|
||||
priv = icon_theme->priv;
|
||||
|
||||
if (priv->theme_changed_idle)
|
||||
if (priv->reset_styles_idle)
|
||||
{
|
||||
g_source_remove (priv->theme_changed_idle);
|
||||
priv->theme_changed_idle = 0;
|
||||
g_source_remove (priv->reset_styles_idle);
|
||||
priv->reset_styles_idle = 0;
|
||||
}
|
||||
|
||||
unset_screen (icon_theme);
|
||||
@@ -1305,7 +1298,9 @@ ensure_valid_themes (GtkIconTheme *icon_theme)
|
||||
load_themes (icon_theme);
|
||||
|
||||
if (was_valid)
|
||||
queue_theme_changed (icon_theme);
|
||||
{
|
||||
g_signal_emit (icon_theme, signal_changed, 0);
|
||||
}
|
||||
}
|
||||
|
||||
priv->loading_themes = FALSE;
|
||||
@@ -1415,6 +1410,8 @@ choose_icon (GtkIconTheme *icon_theme,
|
||||
else if (unthemed_icon->no_svg_filename)
|
||||
icon_info->filename = g_strdup (unthemed_icon->no_svg_filename);
|
||||
|
||||
icon_info->icon_file = g_file_new_for_path (icon_info->filename);
|
||||
|
||||
icon_info->dir_type = ICON_THEME_DIR_UNTHEMED;
|
||||
icon_info->dir_size = size;
|
||||
}
|
||||
@@ -2297,11 +2294,13 @@ theme_lookup_icon (IconTheme *theme,
|
||||
{
|
||||
file = g_strconcat (icon_name, string_from_suffix (suffix), NULL);
|
||||
icon_info->filename = g_build_filename (min_dir->dir, file, NULL);
|
||||
icon_info->icon_file = g_file_new_for_path (icon_info->filename);
|
||||
g_free (file);
|
||||
}
|
||||
else
|
||||
{
|
||||
icon_info->filename = NULL;
|
||||
icon_info->icon_file = NULL;
|
||||
}
|
||||
|
||||
if (min_dir->icon_data != NULL)
|
||||
@@ -2738,6 +2737,8 @@ gtk_icon_info_free (GtkIconInfo *icon_info)
|
||||
return;
|
||||
|
||||
g_free (icon_info->filename);
|
||||
g_clear_object (&icon_info->icon_file);
|
||||
|
||||
if (icon_info->loadable)
|
||||
g_object_unref (icon_info->loadable);
|
||||
g_slist_free_full (icon_info->emblem_infos, (GDestroyNotify) gtk_icon_info_free);
|
||||
@@ -2943,14 +2944,8 @@ icon_info_ensure_scale_and_pixbuf (GtkIconInfo *icon_info,
|
||||
/* SVG icons are a special case - we just immediately scale them
|
||||
* to the desired size
|
||||
*/
|
||||
if (icon_info->filename && !icon_info->loadable)
|
||||
{
|
||||
GFile *file;
|
||||
|
||||
file = g_file_new_for_path (icon_info->filename);
|
||||
icon_info->loadable = G_LOADABLE_ICON (g_file_icon_new (file));
|
||||
g_object_unref (file);
|
||||
}
|
||||
if (icon_info->icon_file && !icon_info->loadable)
|
||||
icon_info->loadable = G_LOADABLE_ICON (g_file_icon_new (icon_info->icon_file));
|
||||
|
||||
is_svg = FALSE;
|
||||
if (G_IS_FILE_ICON (icon_info->loadable))
|
||||
@@ -3179,7 +3174,7 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
|
||||
GdkPixbuf *pixbuf;
|
||||
gchar *data;
|
||||
gchar *success, *warning, *err;
|
||||
gchar *width, *height;
|
||||
gchar *width, *height, *uri;
|
||||
|
||||
/* css_fg can't possibly have failed, otherwise
|
||||
* that would mean we have a broken style */
|
||||
@@ -3205,8 +3200,14 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
|
||||
|
||||
if (!icon_info->symbolic_pixbuf_size)
|
||||
{
|
||||
stream = G_INPUT_STREAM (g_file_read (icon_info->icon_file, NULL, error));
|
||||
|
||||
if (!stream)
|
||||
return NULL;
|
||||
|
||||
/* Fetch size from the original icon */
|
||||
pixbuf = gdk_pixbuf_new_from_file (icon_info->filename, error);
|
||||
pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, error);
|
||||
g_object_unref (stream);
|
||||
|
||||
if (!pixbuf)
|
||||
return NULL;
|
||||
@@ -3219,6 +3220,7 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
|
||||
|
||||
width = g_strdup_printf ("%d", icon_info->symbolic_pixbuf_size->width);
|
||||
height = g_strdup_printf ("%d", icon_info->symbolic_pixbuf_size->height);
|
||||
uri = g_file_get_uri (icon_info->icon_file);
|
||||
|
||||
data = g_strconcat ("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
|
||||
"<svg version=\"1.1\"\n"
|
||||
@@ -3240,7 +3242,7 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
|
||||
" fill: ", css_success ? css_success : success," !important;\n"
|
||||
" }\n"
|
||||
" </style>\n"
|
||||
" <xi:include href=\"", icon_info->filename, "\"/>\n"
|
||||
" <xi:include href=\"", uri, "\"/>\n"
|
||||
"</svg>",
|
||||
NULL);
|
||||
g_free (warning);
|
||||
@@ -3248,6 +3250,7 @@ _gtk_icon_info_load_symbolic_internal (GtkIconInfo *icon_info,
|
||||
g_free (success);
|
||||
g_free (width);
|
||||
g_free (height);
|
||||
g_free (uri);
|
||||
|
||||
stream = g_memory_input_stream_new_from_data (data, -1, g_free);
|
||||
pixbuf = gdk_pixbuf_new_from_stream_at_scale (stream,
|
||||
@@ -3312,19 +3315,24 @@ gtk_icon_info_load_symbolic (GtkIconInfo *icon_info,
|
||||
gchar *css_success;
|
||||
gchar *css_warning;
|
||||
gchar *css_error;
|
||||
gchar *icon_uri;
|
||||
gboolean is_symbolic;
|
||||
|
||||
g_return_val_if_fail (icon_info != NULL, NULL);
|
||||
g_return_val_if_fail (fg != NULL, NULL);
|
||||
|
||||
if (!icon_info->filename ||
|
||||
!g_str_has_suffix (icon_info->filename, "-symbolic.svg"))
|
||||
{
|
||||
if (was_symbolic)
|
||||
*was_symbolic = FALSE;
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
}
|
||||
icon_uri = NULL;
|
||||
if (icon_info->icon_file)
|
||||
icon_uri = g_file_get_uri (icon_info->icon_file);
|
||||
|
||||
is_symbolic = (icon_uri != NULL) && (g_str_has_suffix (icon_uri, "-symbolic.svg"));
|
||||
g_free (icon_uri);
|
||||
|
||||
if (was_symbolic)
|
||||
*was_symbolic = TRUE;
|
||||
*was_symbolic = is_symbolic;
|
||||
|
||||
if (!is_symbolic)
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
|
||||
css_fg = gdk_rgba_to_css (fg);
|
||||
|
||||
@@ -3388,17 +3396,24 @@ gtk_icon_info_load_symbolic_for_context (GtkIconInfo *icon_info,
|
||||
gchar *css_fg = NULL, *css_success;
|
||||
gchar *css_warning, *css_error;
|
||||
GtkStateFlags state;
|
||||
gchar *icon_uri;
|
||||
gboolean is_symbolic;
|
||||
|
||||
if (!icon_info->filename ||
|
||||
!g_str_has_suffix (icon_info->filename, "-symbolic.svg"))
|
||||
{
|
||||
if (was_symbolic)
|
||||
*was_symbolic = FALSE;
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
}
|
||||
g_return_val_if_fail (icon_info != NULL, NULL);
|
||||
g_return_val_if_fail (context != NULL, NULL);
|
||||
|
||||
icon_uri = NULL;
|
||||
if (icon_info->icon_file)
|
||||
icon_uri = g_file_get_uri (icon_info->icon_file);
|
||||
|
||||
is_symbolic = (icon_uri != NULL) && (g_str_has_suffix (icon_uri, "-symbolic.svg"));
|
||||
g_free (icon_uri);
|
||||
|
||||
if (was_symbolic)
|
||||
*was_symbolic = TRUE;
|
||||
*was_symbolic = is_symbolic;
|
||||
|
||||
if (!is_symbolic)
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
|
||||
state = gtk_style_context_get_state (context);
|
||||
gtk_style_context_get (context, state, "color", &color, NULL);
|
||||
@@ -3471,17 +3486,24 @@ gtk_icon_info_load_symbolic_for_style (GtkIconInfo *icon_info,
|
||||
GdkColor *fg;
|
||||
gchar *css_fg, *css_success;
|
||||
gchar *css_warning, *css_error;
|
||||
gchar *icon_uri;
|
||||
gboolean is_symbolic;
|
||||
|
||||
if (!icon_info->filename ||
|
||||
!g_str_has_suffix (icon_info->filename, "-symbolic.svg"))
|
||||
{
|
||||
if (was_symbolic)
|
||||
*was_symbolic = FALSE;
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
}
|
||||
g_return_val_if_fail (icon_info != NULL, NULL);
|
||||
g_return_val_if_fail (style != NULL, NULL);
|
||||
|
||||
icon_uri = NULL;
|
||||
if (icon_info->icon_file)
|
||||
icon_uri = g_file_get_uri (icon_info->icon_file);
|
||||
|
||||
is_symbolic = (icon_uri != NULL) && (g_str_has_suffix (icon_uri, "-symbolic.svg"));
|
||||
g_free (icon_uri);
|
||||
|
||||
if (was_symbolic)
|
||||
*was_symbolic = TRUE;
|
||||
*was_symbolic = is_symbolic;
|
||||
|
||||
if (!is_symbolic)
|
||||
return gtk_icon_info_load_icon (icon_info, error);
|
||||
|
||||
fg = &style->fg[state];
|
||||
css_fg = gdk_color_to_css (fg);
|
||||
@@ -3895,7 +3917,10 @@ gtk_icon_theme_lookup_by_gicon (GtkIconTheme *icon_theme,
|
||||
{
|
||||
GFile *file = g_file_icon_get_file (G_FILE_ICON (icon));
|
||||
if (file != NULL)
|
||||
info->filename = g_file_get_path (file);
|
||||
{
|
||||
info->icon_file = g_object_ref (file);
|
||||
info->filename = g_file_get_path (file);
|
||||
}
|
||||
}
|
||||
|
||||
info->dir_type = ICON_THEME_DIR_UNTHEMED;
|
||||
|
||||
+10
-54
@@ -133,9 +133,6 @@ static void gtk_icon_view_get_property (GObject
|
||||
static void gtk_icon_view_destroy (GtkWidget *widget);
|
||||
static void gtk_icon_view_realize (GtkWidget *widget);
|
||||
static void gtk_icon_view_unrealize (GtkWidget *widget);
|
||||
static void gtk_icon_view_style_updated (GtkWidget *widget);
|
||||
static void gtk_icon_view_state_flags_changed (GtkWidget *widget,
|
||||
GtkStateFlags previous_state);
|
||||
static GtkSizeRequestMode gtk_icon_view_get_request_mode (GtkWidget *widget);
|
||||
static void gtk_icon_view_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
@@ -352,7 +349,6 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
widget_class->destroy = gtk_icon_view_destroy;
|
||||
widget_class->realize = gtk_icon_view_realize;
|
||||
widget_class->unrealize = gtk_icon_view_unrealize;
|
||||
widget_class->style_updated = gtk_icon_view_style_updated;
|
||||
widget_class->get_request_mode = gtk_icon_view_get_request_mode;
|
||||
widget_class->get_preferred_width = gtk_icon_view_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_icon_view_get_preferred_height;
|
||||
@@ -373,7 +369,6 @@ gtk_icon_view_class_init (GtkIconViewClass *klass)
|
||||
widget_class->drag_motion = gtk_icon_view_drag_motion;
|
||||
widget_class->drag_drop = gtk_icon_view_drag_drop;
|
||||
widget_class->drag_data_received = gtk_icon_view_drag_data_received;
|
||||
widget_class->state_flags_changed = gtk_icon_view_state_flags_changed;
|
||||
|
||||
container_class->remove = gtk_icon_view_remove;
|
||||
container_class->forall = gtk_icon_view_forall;
|
||||
@@ -974,6 +969,9 @@ gtk_icon_view_init (GtkIconView *icon_view)
|
||||
|
||||
icon_view->priv->row_contexts =
|
||||
g_ptr_array_new_with_free_func ((GDestroyNotify)g_object_unref);
|
||||
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (icon_view)),
|
||||
GTK_STYLE_CLASS_VIEW);
|
||||
}
|
||||
|
||||
/* GObject methods */
|
||||
@@ -1251,7 +1249,6 @@ gtk_icon_view_realize (GtkWidget *widget)
|
||||
GdkWindow *window;
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
GtkStyleContext *context;
|
||||
|
||||
gtk_widget_set_realized (widget, TRUE);
|
||||
|
||||
@@ -1294,15 +1291,6 @@ gtk_icon_view_realize (GtkWidget *widget)
|
||||
icon_view->priv->bin_window = gdk_window_new (window,
|
||||
&attributes, attributes_mask);
|
||||
gdk_window_set_user_data (icon_view->priv->bin_window, widget);
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
|
||||
gtk_style_context_set_background (context, icon_view->priv->bin_window);
|
||||
gtk_style_context_set_background (context, window);
|
||||
gtk_style_context_restore (context);
|
||||
|
||||
gdk_window_show (icon_view->priv->bin_window);
|
||||
}
|
||||
|
||||
@@ -1320,44 +1308,6 @@ gtk_icon_view_unrealize (GtkWidget *widget)
|
||||
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->unrealize (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
_gtk_icon_view_update_background (GtkIconView *icon_view)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (icon_view);
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
gtk_style_context_save (context);
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_VIEW);
|
||||
|
||||
gtk_style_context_set_background (context, gtk_widget_get_window (widget));
|
||||
gtk_style_context_set_background (context, icon_view->priv->bin_window);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_view_state_flags_changed (GtkWidget *widget,
|
||||
GtkStateFlags previous_state)
|
||||
{
|
||||
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
|
||||
gtk_widget_queue_draw (widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_icon_view_style_updated (GtkWidget *widget)
|
||||
{
|
||||
GTK_WIDGET_CLASS (gtk_icon_view_parent_class)->style_updated (widget);
|
||||
|
||||
_gtk_icon_view_update_background (GTK_ICON_VIEW (widget));
|
||||
gtk_widget_queue_resize (widget);
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_icon_view_get_n_items (GtkIconView *icon_view)
|
||||
{
|
||||
@@ -1823,9 +1773,16 @@ gtk_icon_view_draw (GtkWidget *widget,
|
||||
gint dest_index;
|
||||
GtkIconViewDropPosition dest_pos;
|
||||
GtkIconViewItem *dest_item = NULL;
|
||||
GtkStyleContext *context;
|
||||
|
||||
icon_view = GTK_ICON_VIEW (widget);
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_render_background (context, cr,
|
||||
0, 0,
|
||||
gtk_widget_get_allocated_width (widget),
|
||||
gtk_widget_get_allocated_height (widget));
|
||||
|
||||
if (!gtk_cairo_should_draw_window (cr, icon_view->priv->bin_window))
|
||||
return FALSE;
|
||||
|
||||
@@ -3037,7 +2994,6 @@ gtk_icon_view_paint_item (GtkIconView *icon_view,
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
|
||||
gtk_style_context_save (style_context);
|
||||
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_VIEW);
|
||||
gtk_style_context_add_class (style_context, GTK_STYLE_CLASS_CELL);
|
||||
|
||||
state &= ~(GTK_STATE_FLAG_SELECTED | GTK_STATE_FLAG_PRELIGHT);
|
||||
|
||||
+12
-38
@@ -371,52 +371,26 @@ check_quartz_special_cases (GtkIMContextSimple *context_simple,
|
||||
gint n_compose)
|
||||
{
|
||||
GtkIMContextSimplePrivate *priv = context_simple->priv;
|
||||
guint value = 0;
|
||||
|
||||
if (n_compose == 2)
|
||||
if (n_compose == 2 &&
|
||||
priv->compose_buffer[1] == GDK_KEY_space)
|
||||
{
|
||||
gunichar value = 0;
|
||||
|
||||
switch (priv->compose_buffer[0])
|
||||
{
|
||||
case GDK_KEY_dead_doubleacute:
|
||||
switch (priv->compose_buffer[1])
|
||||
{
|
||||
case GDK_KEY_dead_doubleacute:
|
||||
case GDK_KEY_space:
|
||||
value = GDK_KEY_quotedbl; break;
|
||||
|
||||
case 'a': value = GDK_KEY_adiaeresis; break;
|
||||
case 'A': value = GDK_KEY_Adiaeresis; break;
|
||||
case 'e': value = GDK_KEY_ediaeresis; break;
|
||||
case 'E': value = GDK_KEY_Ediaeresis; break;
|
||||
case 'i': value = GDK_KEY_idiaeresis; break;
|
||||
case 'I': value = GDK_KEY_Idiaeresis; break;
|
||||
case 'o': value = GDK_KEY_odiaeresis; break;
|
||||
case 'O': value = GDK_KEY_Odiaeresis; break;
|
||||
case 'u': value = GDK_KEY_udiaeresis; break;
|
||||
case 'U': value = GDK_KEY_Udiaeresis; break;
|
||||
case 'y': value = GDK_KEY_ydiaeresis; break;
|
||||
case 'Y': value = GDK_KEY_Ydiaeresis; break;
|
||||
}
|
||||
break;
|
||||
|
||||
case GDK_KEY_dead_acute:
|
||||
switch (priv->compose_buffer[1])
|
||||
{
|
||||
case 'c': value = GDK_KEY_ccedilla; break;
|
||||
case 'C': value = GDK_KEY_Ccedilla; break;
|
||||
}
|
||||
break;
|
||||
value = '"'; break;
|
||||
}
|
||||
}
|
||||
|
||||
if (value > 0)
|
||||
{
|
||||
gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple),
|
||||
gdk_keyval_to_unicode (value));
|
||||
priv->compose_buffer[0] = 0;
|
||||
if (value > 0)
|
||||
{
|
||||
gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
|
||||
priv->compose_buffer[0] = 0;
|
||||
|
||||
GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
|
||||
return TRUE;
|
||||
GTK_NOTE (MISC, g_print ("quartz: U+%04X\n", value));
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
||||
+58
-99
@@ -3158,7 +3158,6 @@ get_font_metrics (PangoContext *context, GtkWidget *widget)
|
||||
* @label: the label
|
||||
* @existing_layout: %NULL or an existing layout already in use.
|
||||
* @width: the width to measure with in pango units, or -1 for infinite
|
||||
* @height: the height to measure with in pango units, or -1 for infinite
|
||||
*
|
||||
* Gets a layout that can be used for measuring sizes. The returned
|
||||
* layout will be identical to the label's layout except for the
|
||||
@@ -3170,8 +3169,7 @@ get_font_metrics (PangoContext *context, GtkWidget *widget)
|
||||
static PangoLayout *
|
||||
gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
PangoLayout *existing_layout,
|
||||
int width,
|
||||
int height)
|
||||
int width)
|
||||
{
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
PangoRectangle rect;
|
||||
@@ -3182,7 +3180,6 @@ gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
if (existing_layout != priv->layout)
|
||||
{
|
||||
pango_layout_set_width (existing_layout, width);
|
||||
pango_layout_set_height (existing_layout, height);
|
||||
return existing_layout;
|
||||
}
|
||||
|
||||
@@ -3191,8 +3188,7 @@ gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
|
||||
gtk_label_ensure_layout (label);
|
||||
|
||||
if (pango_layout_get_width (priv->layout) == width &&
|
||||
pango_layout_get_height (priv->layout) == height)
|
||||
if (pango_layout_get_width (priv->layout) == width)
|
||||
{
|
||||
g_object_ref (priv->layout);
|
||||
return priv->layout;
|
||||
@@ -3206,7 +3202,6 @@ gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
{
|
||||
g_object_ref (priv->layout);
|
||||
pango_layout_set_width (priv->layout, width);
|
||||
pango_layout_set_height (priv->layout, height);
|
||||
return priv->layout;
|
||||
}
|
||||
|
||||
@@ -3217,7 +3212,6 @@ gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
*/
|
||||
pango_layout_get_extents (priv->layout, NULL, &rect);
|
||||
if ((width == -1 || rect.width <= width) &&
|
||||
(height == -1 || rect.height <= height) &&
|
||||
!pango_layout_is_wrapped (priv->layout) &&
|
||||
!pango_layout_is_ellipsized (priv->layout))
|
||||
{
|
||||
@@ -3227,7 +3221,6 @@ gtk_label_get_measuring_layout (GtkLabel * label,
|
||||
|
||||
copy = pango_layout_copy (priv->layout);
|
||||
pango_layout_set_width (copy, width);
|
||||
pango_layout_set_height (copy, height);
|
||||
return copy;
|
||||
}
|
||||
|
||||
@@ -3258,7 +3251,6 @@ gtk_label_update_layout_width (GtkLabel *label)
|
||||
const gdouble dy = matrix->xy; /* sin (M_PI * angle / 180) */
|
||||
|
||||
pango_layout_set_width (priv->layout, -1);
|
||||
pango_layout_set_height (priv->layout, -1);
|
||||
pango_layout_get_pixel_extents (priv->layout, NULL, &logical);
|
||||
|
||||
if (fabs (dy) < 0.01)
|
||||
@@ -3312,13 +3304,11 @@ gtk_label_update_layout_width (GtkLabel *label)
|
||||
else
|
||||
{
|
||||
pango_layout_set_width (priv->layout, width * PANGO_SCALE);
|
||||
pango_layout_set_height (priv->layout, priv->ellipsize ? height * PANGO_SCALE : -1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pango_layout_set_width (priv->layout, -1);
|
||||
pango_layout_set_height (priv->layout, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3394,7 +3384,7 @@ gtk_label_ensure_layout (GtkLabel *label)
|
||||
pango_attr_list_insert (attrs, attribute);
|
||||
}
|
||||
}
|
||||
else if (priv->markup_attrs || priv->attrs)
|
||||
else if (priv->markup_attrs && priv->markup_attrs)
|
||||
attrs = pango_attr_list_new ();
|
||||
else
|
||||
attrs = NULL;
|
||||
@@ -3449,23 +3439,6 @@ gtk_label_ensure_layout (GtkLabel *label)
|
||||
}
|
||||
}
|
||||
|
||||
static gint
|
||||
get_single_line_height (GtkWidget *widget,
|
||||
PangoLayout *layout)
|
||||
{
|
||||
PangoContext *context;
|
||||
PangoFontMetrics *metrics;
|
||||
gint ascent, descent;
|
||||
|
||||
context = pango_layout_get_context (layout);
|
||||
metrics = get_font_metrics (context, widget);
|
||||
ascent = pango_font_metrics_get_ascent (metrics);
|
||||
descent = pango_font_metrics_get_descent (metrics);
|
||||
pango_font_metrics_unref (metrics);
|
||||
|
||||
return ascent + descent;
|
||||
}
|
||||
|
||||
static GtkSizeRequestMode
|
||||
gtk_label_get_request_mode (GtkWidget *widget)
|
||||
{
|
||||
@@ -3487,11 +3460,10 @@ get_size_for_allocation (GtkLabel *label,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
PangoLayout *layout;
|
||||
gint text_height;
|
||||
|
||||
layout = gtk_label_get_measuring_layout (label, NULL, allocation * PANGO_SCALE, -1);
|
||||
layout = gtk_label_get_measuring_layout (label, NULL, allocation * PANGO_SCALE);
|
||||
|
||||
pango_layout_get_pixel_size (layout, NULL, &text_height);
|
||||
|
||||
@@ -3499,15 +3471,7 @@ get_size_for_allocation (GtkLabel *label,
|
||||
*minimum_size = text_height;
|
||||
|
||||
if (natural_size)
|
||||
{
|
||||
if (priv->ellipsize && priv->wrap)
|
||||
{
|
||||
layout = gtk_label_get_measuring_layout (label, layout, allocation * PANGO_SCALE, G_MAXINT);
|
||||
pango_layout_get_pixel_size (layout, NULL, &text_height);
|
||||
}
|
||||
|
||||
*natural_size = text_height;
|
||||
}
|
||||
*natural_size = text_height;
|
||||
|
||||
g_object_unref (layout);
|
||||
}
|
||||
@@ -3531,11 +3495,12 @@ get_char_pixels (GtkWidget *label,
|
||||
|
||||
static void
|
||||
gtk_label_get_preferred_layout_size (GtkLabel *label,
|
||||
PangoRectangle *required,
|
||||
PangoRectangle *natural)
|
||||
PangoRectangle *smallest,
|
||||
PangoRectangle *widest)
|
||||
{
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
PangoLayout *layout;
|
||||
gint char_pixels;
|
||||
|
||||
/* "width-chars" Hard-coded minimum width:
|
||||
* - minimum size should be MAX (width-chars, strlen ("..."));
|
||||
@@ -3554,46 +3519,46 @@ gtk_label_get_preferred_layout_size (GtkLabel *label,
|
||||
*/
|
||||
|
||||
/* Start off with the pixel extents of an as-wide-as-possible layout */
|
||||
layout = gtk_label_get_measuring_layout (label, NULL, -1, -1);
|
||||
layout = gtk_label_get_measuring_layout (label, NULL, -1);
|
||||
|
||||
pango_layout_get_extents (layout, NULL, natural);
|
||||
natural->x = natural->y = 0;
|
||||
|
||||
if (priv->wrap)
|
||||
natural->height = get_single_line_height (GTK_WIDGET (label), layout);
|
||||
if (priv->width_chars > -1 || priv->max_width_chars > -1)
|
||||
char_pixels = get_char_pixels (GTK_WIDGET (label), layout);
|
||||
else
|
||||
char_pixels = 0;
|
||||
|
||||
pango_layout_get_extents (layout, NULL, widest);
|
||||
widest->width = MAX (widest->width, char_pixels * priv->width_chars);
|
||||
widest->x = widest->y = 0;
|
||||
|
||||
if (priv->ellipsize || priv->wrap)
|
||||
{
|
||||
/* a layout with width 0 will be as small as humanly possible */
|
||||
layout = gtk_label_get_measuring_layout (label, layout, 0, -1);
|
||||
layout = gtk_label_get_measuring_layout (label,
|
||||
layout,
|
||||
priv->width_chars > -1 ? char_pixels * priv->width_chars
|
||||
: 0);
|
||||
|
||||
pango_layout_get_extents (layout, NULL, required);
|
||||
pango_layout_get_extents (layout, NULL, smallest);
|
||||
smallest->width = MAX (smallest->width, char_pixels * priv->width_chars);
|
||||
smallest->x = smallest->y = 0;
|
||||
|
||||
/* can happen when Pango decides to ellipsize text */
|
||||
if (required->width > natural->width)
|
||||
required->width = natural->width;
|
||||
|
||||
required->x = required->y = 0;
|
||||
required->height = natural->height;
|
||||
if (priv->max_width_chars > -1 && widest->width > char_pixels * priv->max_width_chars)
|
||||
{
|
||||
layout = gtk_label_get_measuring_layout (label,
|
||||
layout,
|
||||
MAX (smallest->width, char_pixels * priv->max_width_chars));
|
||||
pango_layout_get_extents (layout, NULL, widest);
|
||||
widest->width = MAX (widest->width, char_pixels * priv->width_chars);
|
||||
widest->x = widest->y = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
*required = *natural;
|
||||
*smallest = *widest;
|
||||
}
|
||||
|
||||
if (priv->width_chars > -1 || priv->max_width_chars > -1)
|
||||
{
|
||||
gint char_pixels;
|
||||
|
||||
char_pixels = get_char_pixels (GTK_WIDGET (label), layout);
|
||||
|
||||
if (priv->width_chars > -1)
|
||||
required->width = MAX (required->width, char_pixels * priv->width_chars);
|
||||
|
||||
if (priv->max_width_chars > -1)
|
||||
natural->width = MIN (natural->width, priv->max_width_chars * char_pixels);
|
||||
natural->width = MAX (natural->width, required->width);
|
||||
}
|
||||
if (widest->width < smallest->width)
|
||||
*smallest = *widest;
|
||||
|
||||
g_object_unref (layout);
|
||||
}
|
||||
@@ -3606,36 +3571,28 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (widget);
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
PangoRectangle required_rect;
|
||||
PangoRectangle natural_rect;
|
||||
PangoRectangle widest_rect;
|
||||
PangoRectangle smallest_rect;
|
||||
GtkBorder border;
|
||||
|
||||
gtk_label_get_preferred_layout_size (label, &required_rect, &natural_rect);
|
||||
gtk_label_get_preferred_layout_size (label, &smallest_rect, &widest_rect);
|
||||
|
||||
/* Now that we have minimum and natural sizes in pango extents, apply a possible transform */
|
||||
if (priv->have_transform)
|
||||
{
|
||||
PangoLayout *copy;
|
||||
PangoContext *context;
|
||||
const PangoMatrix *matrix;
|
||||
|
||||
copy = pango_layout_copy (priv->layout);
|
||||
context = pango_layout_get_context (copy);
|
||||
context = pango_layout_get_context (priv->layout);
|
||||
matrix = pango_context_get_matrix (context);
|
||||
|
||||
pango_layout_set_width (copy, -1);
|
||||
pango_layout_set_ellipsize (copy, PANGO_ELLIPSIZE_NONE);
|
||||
pango_matrix_transform_rectangle (matrix, &widest_rect);
|
||||
pango_matrix_transform_rectangle (matrix, &smallest_rect);
|
||||
|
||||
pango_layout_get_extents (copy, NULL, &natural_rect);
|
||||
g_object_unref (copy);
|
||||
|
||||
pango_matrix_transform_rectangle (matrix, &required_rect);
|
||||
pango_matrix_transform_rectangle (matrix, &natural_rect);
|
||||
|
||||
/* Bump the natural size in case of ellipsize to ensure pango has
|
||||
/* Bump the size in case of ellipsize to ensure pango has
|
||||
* enough space in the angles (note, we could alternatively set the
|
||||
* layout to not ellipsize when we know we have been allocated our
|
||||
* full natural size, or it may be that pango needs a fix here).
|
||||
* full size, or it may be that pango needs a fix here).
|
||||
*/
|
||||
if (priv->ellipsize && priv->angle != 0 && priv->angle != 90 &&
|
||||
priv->angle != 180 && priv->angle != 270 && priv->angle != 360)
|
||||
@@ -3643,16 +3600,18 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
/* For some reason we only need this at about 110 degrees, and only
|
||||
* when gaining in height
|
||||
*/
|
||||
natural_rect.height += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
natural_rect.width += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
widest_rect.height += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
widest_rect.width += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
smallest_rect.height += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
smallest_rect.width += ROTATION_ELLIPSIZE_PADDING * 2 * PANGO_SCALE;
|
||||
}
|
||||
}
|
||||
|
||||
required_rect.width = PANGO_PIXELS_CEIL (required_rect.width);
|
||||
required_rect.height = PANGO_PIXELS_CEIL (required_rect.height);
|
||||
widest_rect.width = PANGO_PIXELS_CEIL (widest_rect.width);
|
||||
widest_rect.height = PANGO_PIXELS_CEIL (widest_rect.height);
|
||||
|
||||
natural_rect.width = PANGO_PIXELS_CEIL (natural_rect.width);
|
||||
natural_rect.height = PANGO_PIXELS_CEIL (natural_rect.height);
|
||||
smallest_rect.width = PANGO_PIXELS_CEIL (smallest_rect.width);
|
||||
smallest_rect.height = PANGO_PIXELS_CEIL (smallest_rect.height);
|
||||
|
||||
_gtk_misc_get_padding_and_border (GTK_MISC (label), &border);
|
||||
|
||||
@@ -3669,15 +3628,15 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
*/
|
||||
get_size_for_allocation (label,
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
required_rect.height,
|
||||
smallest_rect.height,
|
||||
minimum_size, natural_size);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Normal desired width */
|
||||
*minimum_size = required_rect.width;
|
||||
*natural_size = natural_rect.width;
|
||||
*minimum_size = smallest_rect.width;
|
||||
*natural_size = widest_rect.width;
|
||||
}
|
||||
|
||||
*minimum_size += border.left + border.right;
|
||||
@@ -3696,7 +3655,7 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
*/
|
||||
get_size_for_allocation (label,
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
required_rect.width,
|
||||
widest_rect.width,
|
||||
minimum_size, natural_size);
|
||||
}
|
||||
else
|
||||
@@ -3704,8 +3663,8 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
/* A vertically rotated label does w4h, so return the base
|
||||
* desired height (text length)
|
||||
*/
|
||||
*minimum_size = required_rect.height;
|
||||
*natural_size = natural_rect.height;
|
||||
*minimum_size = MIN (smallest_rect.height, widest_rect.height);
|
||||
*natural_size = MAX (smallest_rect.height, widest_rect.height);
|
||||
}
|
||||
|
||||
*minimum_size += border.top + border.bottom;
|
||||
|
||||
+127
-8
@@ -120,6 +120,7 @@ enum {
|
||||
PROP_MIN_VALUE,
|
||||
PROP_MAX_VALUE,
|
||||
PROP_MODE,
|
||||
PROP_INVERTED,
|
||||
LAST_PROPERTY,
|
||||
PROP_ORIENTATION /* overridden */
|
||||
};
|
||||
@@ -147,6 +148,8 @@ struct _GtkLevelBarPrivate {
|
||||
GList *offsets;
|
||||
|
||||
GtkLevelBarMode bar_mode;
|
||||
|
||||
guint inverted : 1;
|
||||
};
|
||||
|
||||
static void gtk_level_bar_set_value_internal (GtkLevelBar *self,
|
||||
@@ -303,6 +306,7 @@ gtk_level_bar_get_borders (GtkLevelBar *self,
|
||||
static void
|
||||
gtk_level_bar_draw_fill_continuous (GtkLevelBar *self,
|
||||
cairo_t *cr,
|
||||
gboolean inverted,
|
||||
cairo_rectangle_int_t *fill_area)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
@@ -339,9 +343,19 @@ gtk_level_bar_draw_fill_continuous (GtkLevelBar *self,
|
||||
(self->priv->max_value - self->priv->min_value);
|
||||
|
||||
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
block_area.width = (gint) floor (block_area.width * fill_percentage);
|
||||
{
|
||||
block_area.width = (gint) floor (block_area.width * fill_percentage);
|
||||
|
||||
if (inverted)
|
||||
block_area.x += base_area.width - block_area.width;
|
||||
}
|
||||
else
|
||||
block_area.height = (gint) floor (block_area.height * fill_percentage);
|
||||
{
|
||||
block_area.height = (gint) floor (block_area.height * fill_percentage);
|
||||
|
||||
if (inverted)
|
||||
block_area.y += base_area.height - block_area.height;
|
||||
}
|
||||
|
||||
gtk_render_background (context, cr, block_area.x, block_area.y,
|
||||
block_area.width, block_area.height);
|
||||
@@ -354,6 +368,7 @@ gtk_level_bar_draw_fill_continuous (GtkLevelBar *self,
|
||||
static void
|
||||
gtk_level_bar_draw_fill_discrete (GtkLevelBar *self,
|
||||
cairo_t *cr,
|
||||
gboolean inverted,
|
||||
cairo_rectangle_int_t *fill_area)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
@@ -387,19 +402,35 @@ gtk_level_bar_draw_fill_discrete (GtkLevelBar *self,
|
||||
{
|
||||
block_draw_height = MAX (block_draw_height, block_area.height - block_margin.top - block_margin.bottom);
|
||||
block_area.y += block_margin.top;
|
||||
|
||||
if (inverted)
|
||||
block_area.x += block_area.width - block_draw_width;
|
||||
}
|
||||
else
|
||||
{
|
||||
block_draw_width = MAX (block_draw_width, block_area.width - block_margin.left - block_margin.right);
|
||||
block_area.x += block_margin.left;
|
||||
|
||||
if (inverted)
|
||||
block_area.y += block_area.height - block_draw_height;
|
||||
}
|
||||
|
||||
for (idx = 0; idx < num_blocks; idx++)
|
||||
{
|
||||
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
block_area.x += block_margin.left;
|
||||
{
|
||||
if (inverted)
|
||||
block_area.x -= block_margin.right;
|
||||
else
|
||||
block_area.x += block_margin.left;
|
||||
}
|
||||
else
|
||||
block_area.y += block_margin.top;
|
||||
{
|
||||
if (inverted)
|
||||
block_area.y -= block_margin.bottom;
|
||||
else
|
||||
block_area.y += block_margin.top;
|
||||
}
|
||||
|
||||
if (idx > num_filled - 1)
|
||||
gtk_style_context_add_class (context, STYLE_CLASS_EMPTY_FILL_BLOCK);
|
||||
@@ -412,9 +443,19 @@ gtk_level_bar_draw_fill_discrete (GtkLevelBar *self,
|
||||
block_draw_width, block_draw_height);
|
||||
|
||||
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
block_area.x += block_draw_width + block_margin.right;
|
||||
{
|
||||
if (inverted)
|
||||
block_area.x -= block_draw_width + block_margin.left;
|
||||
else
|
||||
block_area.x += block_draw_width + block_margin.right;
|
||||
}
|
||||
else
|
||||
block_area.y += block_draw_height + block_margin.bottom;
|
||||
{
|
||||
if (inverted)
|
||||
block_area.y -= block_draw_height + block_margin.top;
|
||||
else
|
||||
block_area.y += block_draw_height + block_margin.bottom;
|
||||
}
|
||||
}
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
@@ -426,6 +467,7 @@ gtk_level_bar_draw_fill (GtkLevelBar *self,
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (self);
|
||||
GtkBorder trough_borders;
|
||||
gboolean inverted;
|
||||
cairo_rectangle_int_t fill_area;
|
||||
|
||||
gtk_level_bar_get_borders (self, &trough_borders);
|
||||
@@ -437,10 +479,17 @@ gtk_level_bar_draw_fill (GtkLevelBar *self,
|
||||
fill_area.height = gtk_widget_get_allocated_height (widget) -
|
||||
trough_borders.top - trough_borders.bottom;
|
||||
|
||||
inverted = self->priv->inverted;
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
if (self->priv->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
inverted = !inverted;
|
||||
}
|
||||
|
||||
if (self->priv->bar_mode == GTK_LEVEL_BAR_MODE_CONTINUOUS)
|
||||
gtk_level_bar_draw_fill_continuous (self, cr, &fill_area);
|
||||
gtk_level_bar_draw_fill_continuous (self, cr, inverted, &fill_area);
|
||||
else if (self->priv->bar_mode == GTK_LEVEL_BAR_MODE_DISCRETE)
|
||||
gtk_level_bar_draw_fill_discrete (self, cr, &fill_area);
|
||||
gtk_level_bar_draw_fill_discrete (self, cr, inverted, &fill_area);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -769,6 +818,9 @@ gtk_level_bar_get_property (GObject *obj,
|
||||
case PROP_MODE:
|
||||
g_value_set_enum (value, gtk_level_bar_get_mode (self));
|
||||
break;
|
||||
case PROP_INVERTED:
|
||||
g_value_set_boolean (value, gtk_level_bar_get_inverted (self));
|
||||
break;
|
||||
case PROP_ORIENTATION:
|
||||
g_value_set_enum (value, self->priv->orientation);
|
||||
break;
|
||||
@@ -800,6 +852,9 @@ gtk_level_bar_set_property (GObject *obj,
|
||||
case PROP_MODE:
|
||||
gtk_level_bar_set_mode (self, g_value_get_enum (value));
|
||||
break;
|
||||
case PROP_INVERTED:
|
||||
gtk_level_bar_set_inverted (self, g_value_get_boolean (value));
|
||||
break;
|
||||
case PROP_ORIENTATION:
|
||||
gtk_level_bar_set_orientation (self, g_value_get_enum (value));
|
||||
break;
|
||||
@@ -923,6 +978,21 @@ gtk_level_bar_class_init (GtkLevelBarClass *klass)
|
||||
GTK_LEVEL_BAR_MODE_CONTINUOUS,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GtkLevelBar:inverted:
|
||||
*
|
||||
* Level bars normally grow from top to bottom or left to right.
|
||||
* Inverted level bars grow in the opposite direction.
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
properties[PROP_INVERTED] =
|
||||
g_param_spec_boolean ("inverted",
|
||||
P_("Inverted"),
|
||||
P_("Invert the direction in which the level bar grows"),
|
||||
FALSE,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
/**
|
||||
* GtkLevelBar:min-block-height:
|
||||
*
|
||||
@@ -981,6 +1051,8 @@ gtk_level_bar_init (GtkLevelBar *self)
|
||||
self->priv->orientation = GTK_ORIENTATION_HORIZONTAL;
|
||||
_gtk_orientable_set_style_classes (GTK_ORIENTABLE (self));
|
||||
|
||||
self->priv->inverted = FALSE;
|
||||
|
||||
gtk_widget_set_has_window (GTK_WIDGET (self), FALSE);
|
||||
}
|
||||
|
||||
@@ -1208,6 +1280,53 @@ gtk_level_bar_set_mode (GtkLevelBar *self,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_level_bar_get_inverted:
|
||||
* @self: a #GtkLevelBar
|
||||
*
|
||||
* Return the value of the #GtkLevelBar:inverted property.
|
||||
*
|
||||
* Return value: %TRUE if the level bar is inverted
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
gboolean
|
||||
gtk_level_bar_get_inverted (GtkLevelBar *self)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_LEVEL_BAR (self), FALSE);
|
||||
|
||||
return self->priv->inverted;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_level_bar_set_inverted:
|
||||
* @self: a #GtkLevelBar
|
||||
* @inverted: %TRUE to invert the level bar
|
||||
*
|
||||
* Sets the value of the #GtkLevelBar:inverted property.
|
||||
*
|
||||
* Since: 3.8
|
||||
*/
|
||||
void
|
||||
gtk_level_bar_set_inverted (GtkLevelBar *self,
|
||||
gboolean inverted)
|
||||
{
|
||||
GtkLevelBarPrivate *priv;
|
||||
|
||||
g_return_if_fail (GTK_IS_LEVEL_BAR (self));
|
||||
|
||||
priv = self->priv;
|
||||
|
||||
if (priv->inverted != inverted)
|
||||
{
|
||||
priv->inverted = inverted;
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify (G_OBJECT (self), "inverted");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_level_bar_remove_offset_value:
|
||||
* @self: a #GtkLevelBar
|
||||
|
||||
@@ -110,6 +110,13 @@ void gtk_level_bar_set_max_value (GtkLevelBar *self,
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
gdouble gtk_level_bar_get_max_value (GtkLevelBar *self);
|
||||
|
||||
GDK_AVAILABLE_IN_3_8
|
||||
void gtk_level_bar_set_inverted (GtkLevelBar *self,
|
||||
gboolean inverted);
|
||||
|
||||
GDK_AVAILABLE_IN_3_8
|
||||
gboolean gtk_level_bar_get_inverted (GtkLevelBar *self);
|
||||
|
||||
GDK_AVAILABLE_IN_3_6
|
||||
void gtk_level_bar_add_offset_value (GtkLevelBar *self,
|
||||
const gchar *name,
|
||||
|
||||
+4
-6
@@ -2437,12 +2437,10 @@ list_store_start_element (GMarkupParseContext *context,
|
||||
else if (strcmp (element_name, "row") == 0)
|
||||
;
|
||||
else if (strcmp (element_name, "column") == 0)
|
||||
{
|
||||
for (i = 0; names[i]; i++)
|
||||
if (strcmp (names[i], "type") == 0)
|
||||
data->column_type_names = g_slist_prepend (data->column_type_names,
|
||||
g_strdup (values[i]));
|
||||
}
|
||||
for (i = 0; names[i]; i++)
|
||||
if (strcmp (names[i], "type") == 0)
|
||||
data->column_type_names = g_slist_prepend (data->column_type_names,
|
||||
g_strdup (values[i]));
|
||||
else if (strcmp (element_name, "columns") == 0)
|
||||
;
|
||||
else if (strcmp (element_name, "data") == 0)
|
||||
|
||||
+1
-4
@@ -710,9 +710,6 @@ do_post_parse_initialization (int *argc,
|
||||
|
||||
_gtk_register_resource ();
|
||||
|
||||
/* do what the call to gtk_type_init() used to do */
|
||||
g_type_init ();
|
||||
|
||||
_gtk_accel_map_init ();
|
||||
|
||||
/* Set the 'initialized' flag.
|
||||
@@ -1558,7 +1555,7 @@ gtk_main_do_event (GdkEvent *event)
|
||||
* This is the key to implementing modality.
|
||||
*/
|
||||
if (!grab_widget ||
|
||||
((gtk_widget_is_sensitive (event_widget) || event->type == GDK_SCROLL) &&
|
||||
(gtk_widget_is_sensitive (event_widget) &&
|
||||
gtk_widget_is_ancestor (event_widget, grab_widget)))
|
||||
grab_widget = event_widget;
|
||||
|
||||
|
||||
+2
-17
@@ -516,22 +516,7 @@ gtk_menu_button_class_init (GtkMenuButtonClass *klass)
|
||||
P_("The dropdown menu."),
|
||||
GTK_TYPE_MENU,
|
||||
G_PARAM_READWRITE));
|
||||
/**
|
||||
* GtkMenuButton:menu:
|
||||
*
|
||||
* The #GtkMenu that will be popped up when the button is clicked.
|
||||
* This property has been renamed to "popup". "menu" will be
|
||||
* removed before 3.6.0.
|
||||
*
|
||||
* Since: 3.6
|
||||
*/
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_POPUP, /* [sic] */
|
||||
g_param_spec_object ("menu",
|
||||
P_("menu"),
|
||||
P_("The dropdown menu."),
|
||||
GTK_TYPE_MENU,
|
||||
G_PARAM_DEPRECATED | G_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkMenuButton:menu-model:
|
||||
*
|
||||
@@ -699,7 +684,7 @@ _gtk_menu_button_set_popup_with_func (GtkMenuButton *menu_button
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (menu_button), FALSE);
|
||||
}
|
||||
|
||||
g_object_notify (G_OBJECT (menu_button), "menu");
|
||||
g_object_notify (G_OBJECT (menu_button), "popup");
|
||||
g_object_notify (G_OBJECT (menu_button), "menu-model");
|
||||
}
|
||||
|
||||
|
||||
+2
-5
@@ -1719,11 +1719,8 @@ gtk_menu_item_draw (GtkWidget *widget,
|
||||
|
||||
gtk_style_context_get_padding (context, state, &padding);
|
||||
|
||||
if (child && (state & GTK_STATE_FLAG_PRELIGHT))
|
||||
{
|
||||
gtk_render_background (context, cr, x, y, w, h);
|
||||
gtk_render_frame (context, cr, x, y, w, h);
|
||||
}
|
||||
gtk_render_background (context, cr, x, y, w, h);
|
||||
gtk_render_frame (context, cr, x, y, w, h);
|
||||
|
||||
if (priv->submenu && !GTK_IS_MENU_BAR (parent))
|
||||
{
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user