Compare commits
141 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1c2393cc73 | |||
| 75fe9b5f57 | |||
| 3de86b38a0 | |||
| 95d5f0c33b | |||
| 9269fc82b1 | |||
| 0c4103f9b7 | |||
| 4034a13263 | |||
| 926c50c3f9 | |||
| 0fca2a0f82 | |||
| a4f1bc97a5 | |||
| 6ce70b33c6 | |||
| 8535e32b8d | |||
| e240742d0a | |||
| c75e10e9ea | |||
| 5405383cb2 | |||
| aeab118289 | |||
| fc5ba0a6ef | |||
| 3d92798c96 | |||
| 8cb229a847 | |||
| 9cfb89990e | |||
| 8b8d6e188d | |||
| f7863d7fa5 | |||
| 7918b3d1a3 | |||
| 601b5f4f52 | |||
| 89ef97cd25 | |||
| 8f17db9b4a | |||
| dcacd41641 | |||
| 6b3f27c76c | |||
| faf2d7aab7 | |||
| 2725f74d92 | |||
| 498bb2046a | |||
| c7c2767d76 | |||
| e3345e74c5 | |||
| 361ff36120 | |||
| 37c9c5e49e | |||
| d0ab7336ba | |||
| 639f1407c9 | |||
| 62952efc04 | |||
| 21c2e6da9a | |||
| 3e2606f4f4 | |||
| ac7dcd90cc | |||
| e6b12e0fd7 | |||
| f76e22b39e | |||
| 7a568a6127 | |||
| df6dcfb511 | |||
| 76e466197a | |||
| b20fde048f | |||
| 9103dbb81d | |||
| 4b2243c8af | |||
| 1d5afb8613 | |||
| 33d409d9fd | |||
| 3731a2bd90 | |||
| d42c2c3f19 | |||
| 2648ba45c6 | |||
| 3289b3efbf | |||
| 2f9726b4a4 | |||
| 1b15b9e1bc | |||
| 8cdbee7fd2 | |||
| 1be7f3dee9 | |||
| 8fb60cda19 | |||
| 99cc5758b1 | |||
| 953253f685 | |||
| c4dc3a779a | |||
| 55969a8a0c | |||
| 30d0542309 | |||
| 4afbaf699f | |||
| 105c808d0a | |||
| 4a2c3bbf3c | |||
| e29c25cd1b | |||
| 63f0f03a73 | |||
| 0d2c461720 | |||
| 50cde3658a | |||
| d8507a3a83 | |||
| 89b1947631 | |||
| 5149ea7c66 | |||
| 9dbf0512c8 | |||
| 6252ee2753 | |||
| 83f94ed1b9 | |||
| bec5798180 | |||
| 4fd67b8c62 | |||
| 30a1a79322 | |||
| 2fe07c9068 | |||
| 75a1e8251e | |||
| 68b9bafd1d | |||
| cfc0118f6f | |||
| ba1152df01 | |||
| df96b0239f | |||
| da961b7ab8 | |||
| 8e65fa1b43 | |||
| d310ea4d90 | |||
| 37509621bd | |||
| a41f7e4741 | |||
| 70ccfb0efc | |||
| 41aad21693 | |||
| 003d9f4225 | |||
| bf03c85e43 | |||
| 037b1435ae | |||
| 7d71f8888d | |||
| 93c345e49f | |||
| d05d08a2f3 | |||
| b141121ef6 | |||
| f17b7136dd | |||
| 4618e0dcc7 | |||
| 6a8362111e | |||
| 3f9455301e | |||
| 55a98da4d4 | |||
| 026d47d909 | |||
| 2ca30bf8e8 | |||
| 3bc8b2dea4 | |||
| cd7200fb05 | |||
| ece672ab0b | |||
| 795e90efcb | |||
| 28d288abd2 | |||
| 66dfab0b0a | |||
| 5e1a06d1b1 | |||
| e43956141b | |||
| f9f6c4fa49 | |||
| 69eb272e63 | |||
| af0007d0d8 | |||
| 2ba15221c0 | |||
| bda5987335 | |||
| 5da58aa71d | |||
| 469373a1f9 | |||
| 10a8fe9ebf | |||
| 7497cdef08 | |||
| 469368c3e8 | |||
| a731cd1ef6 | |||
| feb64f40b0 | |||
| ee44ed75ca | |||
| 64397962e8 | |||
| 370c759e65 | |||
| 05901bdbbd | |||
| a727117acf | |||
| 7529b95fab | |||
| 7dd2539e1b | |||
| 36d2324891 | |||
| b9e189150b | |||
| 9b7c7ae614 | |||
| 5e2c232145 | |||
| b7aa15f505 | |||
| 0cc688aa92 |
@@ -1,162 +1,3 @@
|
||||
Overview of Changes in GTK+ 3.8.2
|
||||
=================================
|
||||
|
||||
* Bugs fixed:
|
||||
504901 GtkCellRendererCombo requires click-and-hold
|
||||
695120 GtkMenu and GdkWindow sizes can get out of sync
|
||||
698051 Typo in documentation comment
|
||||
698181 Document icon-shadow CSS property
|
||||
699104 when nothing is selected, Add to Bookmarks is enabled...
|
||||
699239 Choose DnD/tooltip widget better on GtkOverlay and ot...
|
||||
699750 Print dialog crashes when printer does not provide pr...
|
||||
699901 GTK CSS keybinding broken
|
||||
699929 GtkCheckMenuItem: remove an unused boolean field
|
||||
700007 Various small improvements
|
||||
700079 Fix accels added after the window was shown not working
|
||||
|
||||
Translation updates:
|
||||
Brazilian Portuguese
|
||||
German
|
||||
Italian
|
||||
Japanese
|
||||
Lithuanian
|
||||
Norwegian bokmål
|
||||
Russian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.8.1
|
||||
=================================
|
||||
|
||||
* Broadway backend improvements:
|
||||
- Ensure window sizes are synched right
|
||||
- Sync surface updates with paint clock
|
||||
- Add support for password authentication
|
||||
- Reuse surfaces passed to server
|
||||
|
||||
* CSS improvements:
|
||||
- Add cycle detection to color resolving
|
||||
|
||||
* Bug fixes
|
||||
675649 gtk-demo: Fix typo
|
||||
681446 gtkdnd memory leak
|
||||
685419 gtkprintbackendfile: Infinite loop in _cairo_write()
|
||||
685420 Critical warnings when GtkPrintJob is released too early
|
||||
690275 scrolling on other windows is applied when coming back...
|
||||
696370 GtkOverlay doesn't work on top of GtkClutterEmbed
|
||||
696622 gtk option printer widget segfault in epiphany
|
||||
696623 GtkOverlay with a revealer produces warnings setting a...
|
||||
696882 GtkWindow changes size after hide/show cycle
|
||||
697144 Popup menu mnemonics fixes
|
||||
697263 Impossible to set window transparency on 3.8
|
||||
697427 Unreferencing GtkStatusIcon object causes abort
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
British English
|
||||
Catalan (Valencian)
|
||||
Czech
|
||||
Finnish
|
||||
Hungarian
|
||||
Indonesian
|
||||
Interlingua
|
||||
Kannada
|
||||
Malayalam
|
||||
Norwegian bokmål
|
||||
Polish
|
||||
Simplified Chinese
|
||||
Slovak
|
||||
Slovenian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.8.0
|
||||
=================================
|
||||
|
||||
* Bug fixes
|
||||
674759 GtkLabel: wrong value of "mnemonic-keyval" when...
|
||||
695493 testgtk: issues with the color selection example
|
||||
696051 vertical grid lines in rtl mode
|
||||
696171 GtkAssistant highlighted font unreadable
|
||||
696202 Add GtkSpinner animation back to Win32 theme
|
||||
696232 win32: do not crash on invalid utf8 conversion
|
||||
696405 appchooserbutton: filter out applications not...
|
||||
696546 Fix a crash in gtk_print_backend_cups_finalize()
|
||||
696553 Fix a crash in avahi_create_browsers()
|
||||
Use natural size to set treeview adjustments
|
||||
|
||||
* Translation updates
|
||||
Aragonese
|
||||
Czech
|
||||
French
|
||||
Galician
|
||||
German
|
||||
Gujarati
|
||||
Hindi
|
||||
Hungarian
|
||||
Italian
|
||||
Kazakh
|
||||
Marathi
|
||||
Odia
|
||||
Persian
|
||||
Punjabi
|
||||
Russian
|
||||
Slovenian
|
||||
Tamil
|
||||
Traditional Chinese
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.14
|
||||
==================================
|
||||
|
||||
* A lot of filechooser button fixes
|
||||
|
||||
* Bugs fixed:
|
||||
586367 In local_only mode, file chooser should return native...
|
||||
671939 crash on exit
|
||||
674759 GtkLabel: wrong value of "mnemonic-keyval" when "use-...
|
||||
691040 selection is reported incorrectly in file chooser button
|
||||
694339 Fix build of GTK+ on Windows
|
||||
695200 Switching apps while a combobox open makes the parent...
|
||||
695278 Avoid passing a NULL title to setTitle
|
||||
695304 GtkTextView: don't popdown a bubble if we don't have one
|
||||
695312 Initial 'text' set in the non-numeric-only GtkSpinBut...
|
||||
695375 GtkEntryAccessible: also handle entry icon tooltip NU...
|
||||
695391 wayland documentation section id is "gtk-osx"
|
||||
695473 treeview: fix a critical warning
|
||||
695482 Universal Access panel appears jumbled and horrible a...
|
||||
695682 Cannot build docs for wayland-only build
|
||||
695714 Getting of printer info can hang
|
||||
695715 Use DBus calls instead of Avahi API
|
||||
695772 Different appearance of menus within Audacious
|
||||
695783 GtkApplication: Allow passing windows on non-X11 targets
|
||||
695874 GtkFontChooser docs
|
||||
695948 GtkFontButton sets wrong show-preview-entry
|
||||
|
||||
* Translation updates:
|
||||
Arabic
|
||||
Assamese
|
||||
Belarusian
|
||||
Brazilian Portuguese
|
||||
Catalan
|
||||
Danish
|
||||
Finnish
|
||||
French
|
||||
Galician
|
||||
German
|
||||
Greek
|
||||
Indonesian
|
||||
Kazakh
|
||||
Lithuanian
|
||||
Korean
|
||||
Polish
|
||||
Portuguese
|
||||
Punjabi
|
||||
Serbian
|
||||
Slovenian
|
||||
Spanish
|
||||
Uyghur
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.7.12
|
||||
==================================
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -576,7 +576,7 @@ copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(ApiVersion
|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated
|
||||
|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\a11y
|
||||
|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;G_ENABLE_DEBUG;$(GtkDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
<PreprocessorDefinitions>_DEBUG;$(GtkPrefixDefine);%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>true</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GdkDefines);INSIDE_GDK_WIN32"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GdkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -359,7 +359,7 @@ copy ..\..\..\gtk\deprecated\gtkvscrollbar.h $(CopyDir)\include\gtk-$(ApiVersion
|
||||
copy ..\..\..\gtk\deprecated\gtkvseparator.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated

|
||||
copy ..\..\..\gtk\deprecated\gtkvpaned.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\deprecated

|
||||
|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
mkdir $(CopyDir)\include\gtk-$(ApiVersion)\a11y

|
||||
|
||||
copy ..\..\..\gtk\a11y\gtkarrowaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
copy ..\..\..\gtk\a11y\gtkbooleancellaccessible.h $(CopyDir)\include\gtk-$(ApiVersion)\gtk\a11y

|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;G_ENABLE_DEBUG;$(GtkDefines)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
PreprocessorDefinitions="_DEBUG;$(GtkPrefixDefine)"
|
||||
MinimalRebuild="true"
|
||||
BasicRuntimeChecks="3"
|
||||
RuntimeLibrary="2"
|
||||
RuntimeLibrary="3"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
|
||||
+5
-4
@@ -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], [8])
|
||||
m4_define([gtk_micro_version], [2])
|
||||
m4_define([gtk_interface_age], [2])
|
||||
m4_define([gtk_minor_version], [9])
|
||||
m4_define([gtk_micro_version], [0])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
m4_define([gtk_version],
|
||||
@@ -350,7 +350,7 @@ if test "$enable_win32_backend" = "yes"; then
|
||||
backend_immodules="$backend_immodules,ime"
|
||||
GDK_WINDOWING="$GDK_WINDOWING
|
||||
#define GDK_WINDOWING_WIN32"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm"
|
||||
GDK_EXTRA_LIBS="$GDK_EXTRA_LIBS -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid"
|
||||
AM_CONDITIONAL(USE_WIN32, true)
|
||||
PANGO_PACKAGES="pangowin32 pangocairo"
|
||||
else
|
||||
@@ -1242,6 +1242,7 @@ if test "$have_gio_unix" = "yes"; then
|
||||
else
|
||||
GDK_GIO_PACKAGE=gio-2.0
|
||||
fi
|
||||
AM_CONDITIONAL(HAVE_GIO_UNIX, test "$have_gio_unix" = "yes")
|
||||
|
||||
# Check for Pango flags
|
||||
|
||||
|
||||
+6
-11
@@ -403,7 +403,7 @@ static GtkWidget *create_text (GtkWidget **text_view, gboolean is_source);
|
||||
static void
|
||||
add_data_tab (const gchar *demoname)
|
||||
{
|
||||
gchar *resource_dir, *resource_name, *content_type, *content_mime;
|
||||
gchar *resource_dir, *resource_name, *content_type;
|
||||
gchar **resources;
|
||||
GBytes *bytes;
|
||||
GtkWidget *widget, *label;
|
||||
@@ -427,20 +427,17 @@ add_data_tab (const gchar *demoname)
|
||||
g_bytes_get_data (bytes, NULL),
|
||||
g_bytes_get_size (bytes),
|
||||
NULL);
|
||||
content_mime = g_content_type_get_mime_type (content_type);
|
||||
|
||||
/* In theory we should look at all the mime types gdk-pixbuf supports
|
||||
* and go from there, but we know what file types we've added.
|
||||
*/
|
||||
if (g_content_type_is_a (content_mime, "image/png") ||
|
||||
g_content_type_is_a (content_mime, "image/gif") ||
|
||||
g_content_type_is_a (content_mime, "image/jpeg"))
|
||||
if (g_content_type_is_a (content_type, "image/png") ||
|
||||
g_content_type_is_a (content_type, "image/gif") ||
|
||||
g_content_type_is_a (content_type, "image/jpeg"))
|
||||
{
|
||||
widget = gtk_image_new_from_resource (resource_name);
|
||||
}
|
||||
else if (g_content_type_is_a (content_mime, "text/plain") ||
|
||||
g_content_type_is_a (content_mime, "application/x-ext-ui") ||
|
||||
g_content_type_is_a (content_mime, "text/css"))
|
||||
else if (g_content_type_is_a (content_type, "text/plain"))
|
||||
{
|
||||
GtkTextBuffer *buffer;
|
||||
GtkWidget *textview;
|
||||
@@ -452,8 +449,7 @@ add_data_tab (const gchar *demoname)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
g_warning ("Don't know how to display resource '%s' of type '%s'\n", resource_name, content_mime);
|
||||
g_warning ("Don't know how to display resource '%s' of type '%s'\n", resource_name, content_type);
|
||||
widget = NULL;
|
||||
}
|
||||
|
||||
@@ -462,7 +458,6 @@ add_data_tab (const gchar *demoname)
|
||||
gtk_widget_show (label);
|
||||
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), widget, label);
|
||||
|
||||
g_free (content_mime);
|
||||
g_free (content_type);
|
||||
g_free (resource_name);
|
||||
g_bytes_unref (bytes);
|
||||
|
||||
@@ -85,7 +85,7 @@ scroll_to_bottom (GtkTextView *textview)
|
||||
gtk_text_iter_set_line_offset (&iter, 0);
|
||||
|
||||
/* and place the mark at iter. the mark will stay there after we
|
||||
* insert some text at the end because it has left gravity.
|
||||
* insert some text at the end because it has right gravity.
|
||||
*/
|
||||
mark = gtk_text_buffer_get_mark (buffer, "scroll");
|
||||
gtk_text_buffer_move_mark (buffer, mark, &iter);
|
||||
|
||||
@@ -54,15 +54,6 @@ Start your applications like this:
|
||||
BROADWAY_DISPLAY=:5 gtk3-demo
|
||||
</programlisting>
|
||||
|
||||
You can add password protection for your session by creating a file in
|
||||
<filename>$XDG_CONFIG_HOME/broadway.passwd</filename> or <filename>$HOME/.config/broadway.passwd</filename>
|
||||
with a crypt(3) style password hash.
|
||||
|
||||
A simple way to generate it is with openssl:
|
||||
<programlisting>
|
||||
openssl passwd -1 > ~/.config/broadway.passwd
|
||||
</programlisting>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -235,6 +235,7 @@
|
||||
<xi:include href="xml/gtknotebook.xml" />
|
||||
<xi:include href="xml/gtkexpander.xml" />
|
||||
<xi:include href="xml/gtkoverlay.xml" />
|
||||
<xi:include href="xml/gtkheaderbar.xml" />
|
||||
<xi:include href="xml/gtkorientable.xml" />
|
||||
</chapter>
|
||||
|
||||
@@ -416,6 +417,10 @@
|
||||
<title>Index of new symbols in 3.8</title>
|
||||
<xi:include href="xml/api-index-3.8.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
<index id="api-index-3-10" role="3.10">
|
||||
<title>Index of new symbols in 3.10</title>
|
||||
<xi:include href="xml/api-index-3.10.xml"><xi:fallback /></xi:include>
|
||||
</index>
|
||||
|
||||
<xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
|
||||
|
||||
|
||||
@@ -5513,6 +5513,7 @@ gtk_window_get_resize_grip_area
|
||||
gtk_window_get_application
|
||||
gtk_window_set_application
|
||||
gtk_window_set_has_user_ref_count
|
||||
gtk_window_set_titlebar
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_WINDOW
|
||||
@@ -7494,3 +7495,29 @@ GTK_COLOR_CHOOSER_DIALOG_GET_CLASS
|
||||
GtkColorChooserDialogPrivate
|
||||
gtk_color_chooser_dialog_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkheaderbar</FILE>
|
||||
<TITLE>GtkHeaderBar</TITLE>
|
||||
GtkHeaderBar
|
||||
gtk_header_bar_new
|
||||
gtk_header_bar_set_title
|
||||
gtk_header_bar_get_title
|
||||
gtk_header_bar_set_subtitle
|
||||
gtk_header_bar_get_subtitle
|
||||
gtk_header_bar_set_custom_title
|
||||
gtk_header_bar_get_custom_title
|
||||
gtk_header_bar_pack_start
|
||||
gtk_header_bar_pack_end
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_HEADER_BAR
|
||||
GTK_HEADER_BAR
|
||||
GTK_HEADER_BAR_CLASS
|
||||
GTK_IS_HEADER_BAR
|
||||
GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -83,7 +83,7 @@ broadwayd_SOURCES = \
|
||||
broadway-output.h \
|
||||
broadway-output.c
|
||||
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt -lcrypt
|
||||
broadwayd_LDADD = $(GDK_DEP_LIBS) -lrt
|
||||
|
||||
MAINTAINERCLEANFILES = $(broadway_built_sources)
|
||||
EXTRA_DIST += $(broadway_built_sources)
|
||||
|
||||
@@ -317,13 +317,6 @@ broadway_output_get_next_serial (BroadwayOutput *output)
|
||||
return output->serial;
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_set_next_serial (BroadwayOutput *output,
|
||||
guint32 serial)
|
||||
{
|
||||
output->serial = serial;
|
||||
}
|
||||
|
||||
|
||||
/************************************************************************
|
||||
* Core rendering operations *
|
||||
@@ -478,24 +471,6 @@ broadway_output_new_surface(BroadwayOutput *output,
|
||||
append_bool (output, is_temp);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_request_auth (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_REQUEST_AUTH);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_auth_ok (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_AUTH_OK);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_disconnected (BroadwayOutput *output)
|
||||
{
|
||||
write_header (output, BROADWAY_OP_DISCONNECTED);
|
||||
}
|
||||
|
||||
void
|
||||
broadway_output_show_surface(BroadwayOutput *output, int id)
|
||||
{
|
||||
|
||||
@@ -23,8 +23,6 @@ BroadwayOutput *broadway_output_new (GOutputStream *out,
|
||||
void broadway_output_free (BroadwayOutput *output);
|
||||
int broadway_output_flush (BroadwayOutput *output);
|
||||
int broadway_output_has_error (BroadwayOutput *output);
|
||||
void broadway_output_set_next_serial (BroadwayOutput *output,
|
||||
guint32 serial);
|
||||
guint32 broadway_output_get_next_serial (BroadwayOutput *output);
|
||||
void broadway_output_new_surface (BroadwayOutput *output,
|
||||
int id,
|
||||
@@ -33,9 +31,6 @@ void broadway_output_new_surface (BroadwayOutput *output,
|
||||
int w,
|
||||
int h,
|
||||
gboolean is_temp);
|
||||
void broadway_output_request_auth (BroadwayOutput *output);
|
||||
void broadway_output_auth_ok (BroadwayOutput *output);
|
||||
void broadway_output_disconnected (BroadwayOutput *output);
|
||||
void broadway_output_show_surface (BroadwayOutput *output,
|
||||
int id);
|
||||
void broadway_output_hide_surface (BroadwayOutput *output,
|
||||
|
||||
@@ -36,9 +36,6 @@ typedef enum {
|
||||
BROADWAY_OP_SET_TRANSIENT_FOR = 'p',
|
||||
BROADWAY_OP_PUT_RGB = 'i',
|
||||
BROADWAY_OP_FLUSH = 'f',
|
||||
BROADWAY_OP_REQUEST_AUTH = 'l',
|
||||
BROADWAY_OP_AUTH_OK = 'L',
|
||||
BROADWAY_OP_DISCONNECTED = 'D',
|
||||
} BroadwayOpType;
|
||||
|
||||
typedef struct {
|
||||
|
||||
+37
-198
@@ -2,8 +2,6 @@
|
||||
|
||||
#include "broadway-output.h"
|
||||
|
||||
#define _XOPEN_SOURCE /* for crypt */
|
||||
|
||||
#include <glib.h>
|
||||
#include <glib/gprintf.h>
|
||||
#include "gdktypes.h"
|
||||
@@ -11,10 +9,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <crypt.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
@@ -25,7 +19,6 @@ typedef struct BroadwayWindow BroadwayWindow;
|
||||
struct _BroadwayServer {
|
||||
GObject parent_instance;
|
||||
|
||||
char *password;
|
||||
char *address;
|
||||
int port;
|
||||
GSocketService *service;
|
||||
@@ -76,7 +69,6 @@ typedef struct HttpRequest {
|
||||
|
||||
struct BroadwayInput {
|
||||
BroadwayServer *server;
|
||||
BroadwayOutput *output;
|
||||
GSocketConnection *connection;
|
||||
GByteArray *buffer;
|
||||
GSource *source;
|
||||
@@ -84,7 +76,6 @@ struct BroadwayInput {
|
||||
gint64 time_base;
|
||||
gboolean proto_v7_plus;
|
||||
gboolean binary;
|
||||
gboolean active;
|
||||
};
|
||||
|
||||
struct BroadwayWindow {
|
||||
@@ -99,9 +90,6 @@ struct BroadwayWindow {
|
||||
gint32 transient_for;
|
||||
|
||||
cairo_surface_t *last_surface;
|
||||
|
||||
char *cached_surface_name;
|
||||
cairo_surface_t *cached_surface;
|
||||
};
|
||||
|
||||
static void broadway_server_resync_windows (BroadwayServer *server);
|
||||
@@ -112,8 +100,6 @@ static void
|
||||
broadway_server_init (BroadwayServer *server)
|
||||
{
|
||||
BroadwayWindow *root;
|
||||
char *passwd_file;
|
||||
char *password, *p;
|
||||
|
||||
server->service = g_socket_service_new ();
|
||||
server->pointer_grab_window_id = -1;
|
||||
@@ -122,22 +108,6 @@ broadway_server_init (BroadwayServer *server)
|
||||
server->id_ht = g_hash_table_new (NULL, NULL);
|
||||
server->id_counter = 0;
|
||||
|
||||
passwd_file = g_build_filename (g_get_user_config_dir (),
|
||||
"broadway.passwd", NULL);
|
||||
|
||||
if (g_file_get_contents (passwd_file,
|
||||
&password, NULL, NULL))
|
||||
{
|
||||
p = strchr (password, '\n');
|
||||
if (p)
|
||||
*p = 0;
|
||||
g_strstrip (password);
|
||||
if (strlen (password) > 3)
|
||||
server->password = password;
|
||||
else
|
||||
g_free (password);
|
||||
}
|
||||
|
||||
root = g_new0 (BroadwayWindow, 1);
|
||||
root->id = server->id_counter++;
|
||||
root->width = 1024;
|
||||
@@ -169,7 +139,7 @@ broadway_server_class_init (BroadwayServerClass * class)
|
||||
object_class->finalize = broadway_server_finalize;
|
||||
}
|
||||
|
||||
static void start (BroadwayInput *input);
|
||||
static void start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary);
|
||||
|
||||
static void
|
||||
http_request_free (HttpRequest *request)
|
||||
@@ -379,14 +349,6 @@ update_future_pointer_info (BroadwayServer *server, BroadwayInputPointerMsg *dat
|
||||
server->future_mouse_in_toplevel = data->mouse_window_id;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
verify_password (BroadwayServer *server, const char *password)
|
||||
{
|
||||
char *hash;
|
||||
hash = crypt (password, server->password);
|
||||
return strcmp (hash, server->password) == 0;
|
||||
}
|
||||
|
||||
static void
|
||||
parse_input_message (BroadwayInput *input, const char *message)
|
||||
{
|
||||
@@ -395,22 +357,6 @@ parse_input_message (BroadwayInput *input, const char *message)
|
||||
char *p;
|
||||
gint64 time_;
|
||||
|
||||
if (!input->active)
|
||||
{
|
||||
/* The input has not been activated yet, handle auth/start */
|
||||
|
||||
if (message[0] != 'l' ||
|
||||
!verify_password (server, message+1))
|
||||
{
|
||||
broadway_output_request_auth (input->output);
|
||||
broadway_output_flush (input->output);
|
||||
}
|
||||
else
|
||||
start (input);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
memset (&msg, 0, sizeof (msg));
|
||||
|
||||
p = (char *)message;
|
||||
@@ -624,7 +570,7 @@ parse_input (BroadwayInput *input)
|
||||
}
|
||||
break;
|
||||
case BROADWAY_WS_CNX_PING:
|
||||
broadway_output_pong (input->output);
|
||||
broadway_output_pong (server->output);
|
||||
break;
|
||||
case BROADWAY_WS_CNX_PONG:
|
||||
break; /* we never send pings, but tolerate pongs */
|
||||
@@ -650,8 +596,7 @@ parse_input (BroadwayInput *input)
|
||||
|
||||
if (buf[0] != 0)
|
||||
{
|
||||
if (server->input == input)
|
||||
server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
return;
|
||||
}
|
||||
@@ -668,8 +613,7 @@ parse_input (BroadwayInput *input)
|
||||
|
||||
if (len > 0 && buf[0] != 0)
|
||||
{
|
||||
if (server->input == input)
|
||||
server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
break;
|
||||
}
|
||||
@@ -696,16 +640,19 @@ queue_process_input_at_idle (BroadwayServer *server)
|
||||
}
|
||||
|
||||
static void
|
||||
broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
broadway_server_read_all_input_nonblocking (BroadwayServer *server)
|
||||
{
|
||||
GInputStream *in;
|
||||
gssize res;
|
||||
guint8 buffer[1024];
|
||||
GError *error;
|
||||
BroadwayInput *input;
|
||||
|
||||
if (input == NULL)
|
||||
if (server->input == NULL)
|
||||
return;
|
||||
|
||||
input = server->input;
|
||||
|
||||
in = g_io_stream_get_input_stream (G_IO_STREAM (input->connection));
|
||||
|
||||
error = NULL;
|
||||
@@ -721,8 +668,7 @@ broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
return;
|
||||
}
|
||||
|
||||
if (input->server->input == input)
|
||||
input->server->input = NULL;
|
||||
server->input = NULL;
|
||||
broadway_input_free (input);
|
||||
if (res < 0)
|
||||
{
|
||||
@@ -740,7 +686,7 @@ broadway_server_read_all_input_nonblocking (BroadwayInput *input)
|
||||
static void
|
||||
broadway_server_consume_all_input (BroadwayServer *server)
|
||||
{
|
||||
broadway_server_read_all_input_nonblocking (server->input);
|
||||
broadway_server_read_all_input_nonblocking (server);
|
||||
|
||||
/* Since we're parsing input but not processing the resulting messages
|
||||
we might not get a readable callback on the stream, so queue an idle to
|
||||
@@ -755,10 +701,9 @@ input_data_cb (GObject *stream,
|
||||
{
|
||||
BroadwayServer *server = input->server;
|
||||
|
||||
broadway_server_read_all_input_nonblocking (input);
|
||||
broadway_server_read_all_input_nonblocking (server);
|
||||
|
||||
if (input->active)
|
||||
process_input_messages (server);
|
||||
process_input_messages (server);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -933,14 +878,15 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
gsize len;
|
||||
GChecksum *checksum;
|
||||
char *origin, *host;
|
||||
BroadwayServer *server;
|
||||
BroadwayInput *input;
|
||||
const void *data_buffer;
|
||||
gsize data_buffer_size;
|
||||
GInputStream *in;
|
||||
char *key_v7;
|
||||
gboolean proto_v7_plus;
|
||||
GSocket *socket;
|
||||
int flag = 1;
|
||||
|
||||
server = request->server;
|
||||
|
||||
#ifdef DEBUG_WEBSOCKETS
|
||||
g_print ("incoming request:\n%s\n", request->request->str);
|
||||
@@ -1087,11 +1033,15 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
proto_v7_plus = FALSE;
|
||||
}
|
||||
|
||||
socket = g_socket_connection_get_socket (request->connection);
|
||||
setsockopt (g_socket_get_fd (socket), IPPROTO_TCP,
|
||||
TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||
|
||||
if (server->input != NULL)
|
||||
{
|
||||
broadway_input_free (server->input);
|
||||
server->input = NULL;
|
||||
}
|
||||
|
||||
input = g_new0 (BroadwayInput, 1);
|
||||
|
||||
input->server = request->server;
|
||||
input->connection = g_object_ref (request->connection);
|
||||
input->proto_v7_plus = proto_v7_plus;
|
||||
@@ -1101,9 +1051,9 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
input->buffer = g_byte_array_sized_new (data_buffer_size);
|
||||
g_byte_array_append (input->buffer, data_buffer, data_buffer_size);
|
||||
|
||||
input->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
0, proto_v7_plus, binary);
|
||||
server->input = input;
|
||||
|
||||
start_output (request, proto_v7_plus, binary);
|
||||
|
||||
/* This will free and close the data input stream, but we got all the buffered content already */
|
||||
http_request_free (request);
|
||||
@@ -1113,53 +1063,35 @@ start_input (HttpRequest *request, gboolean binary)
|
||||
g_source_set_callback (input->source, (GSourceFunc)input_data_cb, input, NULL);
|
||||
g_source_attach (input->source, NULL);
|
||||
|
||||
if (input->server->password)
|
||||
{
|
||||
broadway_output_request_auth (input->output);
|
||||
broadway_output_flush (input->output);
|
||||
}
|
||||
else
|
||||
start (input);
|
||||
|
||||
/* Process any data in the pipe already */
|
||||
parse_input (input);
|
||||
process_input_messages (server);
|
||||
|
||||
g_strfreev (lines);
|
||||
}
|
||||
|
||||
static void
|
||||
start (BroadwayInput *input)
|
||||
start_output (HttpRequest *request, gboolean proto_v7_plus, gboolean binary)
|
||||
{
|
||||
GSocket *socket;
|
||||
BroadwayServer *server;
|
||||
int flag = 1;
|
||||
|
||||
input->active = TRUE;
|
||||
socket = g_socket_connection_get_socket (request->connection);
|
||||
setsockopt(g_socket_get_fd (socket), IPPROTO_TCP,
|
||||
TCP_NODELAY, (char *) &flag, sizeof(int));
|
||||
|
||||
server = BROADWAY_SERVER (input->server);
|
||||
|
||||
if (server->output)
|
||||
{
|
||||
broadway_output_disconnected (server->output);
|
||||
broadway_output_flush (server->output);
|
||||
}
|
||||
|
||||
if (server->input != NULL)
|
||||
{
|
||||
broadway_input_free (server->input);
|
||||
server->input = NULL;
|
||||
}
|
||||
|
||||
server->input = input;
|
||||
server = BROADWAY_SERVER (request->server);
|
||||
|
||||
if (server->output)
|
||||
{
|
||||
server->saved_serial = broadway_output_get_next_serial (server->output);
|
||||
broadway_output_free (server->output);
|
||||
}
|
||||
server->output = input->output;
|
||||
|
||||
broadway_output_set_next_serial (server->output, server->saved_serial);
|
||||
broadway_output_auth_ok (server->output);
|
||||
broadway_output_flush (server->output);
|
||||
server->output =
|
||||
broadway_output_new (g_io_stream_get_output_stream (G_IO_STREAM (request->connection)),
|
||||
server->saved_serial, proto_v7_plus, binary);
|
||||
|
||||
broadway_server_resync_windows (server);
|
||||
|
||||
@@ -1167,8 +1099,6 @@ start (BroadwayInput *input)
|
||||
broadway_output_grab_pointer (server->output,
|
||||
server->pointer_grab_window_id,
|
||||
server->pointer_grab_owner_events);
|
||||
|
||||
process_input_messages (server);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1419,12 +1349,6 @@ broadway_server_destroy_window (BroadwayServer *server,
|
||||
server->toplevels = g_list_remove (server->toplevels, window);
|
||||
g_hash_table_remove (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
|
||||
g_free (window);
|
||||
}
|
||||
}
|
||||
@@ -1659,11 +1583,6 @@ broadway_server_window_update (BroadwayServer *server,
|
||||
window->width,
|
||||
window->height);
|
||||
|
||||
g_assert (window->width == cairo_image_surface_get_width (window->last_surface));
|
||||
g_assert (window->width == cairo_image_surface_get_width (surface));
|
||||
g_assert (window->height == cairo_image_surface_get_height (window->last_surface));
|
||||
g_assert (window->height == cairo_image_surface_get_height (surface));
|
||||
|
||||
if (server->output != NULL)
|
||||
{
|
||||
if (window->last_synced)
|
||||
@@ -1820,86 +1739,6 @@ broadway_server_ungrab_pointer (BroadwayServer *server,
|
||||
return serial;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} ShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_unmap (void *_data)
|
||||
{
|
||||
ShmSurfaceData *data = _data;
|
||||
munmap (data->data, data->data_size);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
broadway_server_open_surface (BroadwayServer *server,
|
||||
guint32 id,
|
||||
char *name,
|
||||
int width,
|
||||
int height)
|
||||
{
|
||||
BroadwayWindow *window;
|
||||
ShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
gsize size;
|
||||
void *ptr;
|
||||
int fd;
|
||||
|
||||
window = g_hash_table_lookup (server->id_ht,
|
||||
GINT_TO_POINTER (id));
|
||||
if (window == NULL)
|
||||
return NULL;
|
||||
|
||||
if (window->cached_surface_name != NULL &&
|
||||
strcmp (name, window->cached_surface_name) == 0)
|
||||
return cairo_surface_reference (window->cached_surface);
|
||||
|
||||
size = width * height * sizeof (guint32);
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to shm_open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
shm_unlink (name);
|
||||
|
||||
if (ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
data = g_new0 (ShmSurfaceData, 1);
|
||||
|
||||
data->data = ptr;
|
||||
data->data_size = size;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
if (window->cached_surface_name != NULL)
|
||||
g_free (window->cached_surface_name);
|
||||
window->cached_surface_name = g_strdup (name);
|
||||
|
||||
if (window->cached_surface != NULL)
|
||||
cairo_surface_destroy (window->cached_surface);
|
||||
window->cached_surface = cairo_surface_reference (surface);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
guint32
|
||||
broadway_server_new_window (BroadwayServer *server,
|
||||
int x,
|
||||
|
||||
@@ -78,10 +78,5 @@ gboolean broadway_server_window_move_resize (BroadwayServer *
|
||||
int y,
|
||||
int width,
|
||||
int height);
|
||||
cairo_surface_t * broadway_server_open_surface (BroadwayServer *server,
|
||||
guint32 id,
|
||||
char *name,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
#endif /* __BROADWAY_SERVER__ */
|
||||
|
||||
+45
-71
@@ -225,16 +225,34 @@ function flushSurface(surface)
|
||||
context.save();
|
||||
context.beginPath();
|
||||
|
||||
var minx;
|
||||
var miny;
|
||||
var maxx;
|
||||
var maxy;
|
||||
for (var j = 0; j < cmd.rects.length; j++) {
|
||||
var rect = cmd.rects[j];
|
||||
context.rect(rect.x, rect.y, rect.w, rect.h);
|
||||
if (j == 0) {
|
||||
minx = rect.x;
|
||||
miny = rect.y;
|
||||
maxx = rect.x + rect.w;
|
||||
maxy = rect.y + rect.h;
|
||||
} else {
|
||||
if (rect.x < minx)
|
||||
minx = rect.x;
|
||||
if (rect.y < miny)
|
||||
miny = rect.y;
|
||||
if (rect.x + rect.w > maxx)
|
||||
maxx = rect.x + rect.w;
|
||||
if (rect.y + rect.h > maxy)
|
||||
maxy = rect.y + rect.h;
|
||||
}
|
||||
}
|
||||
context.clip();
|
||||
// This seems to break chrome when src overlaps dest
|
||||
// But source-over should be fine for rgb surfaces anyway
|
||||
//context.globalCompositeOperation = "copy";
|
||||
context.drawImage(surface.canvas,
|
||||
cmd.dx, cmd.dy);
|
||||
context.globalCompositeOperation = "copy";
|
||||
context.drawImage(context.canvas,
|
||||
minx - cmd.dx, miny - cmd.dy, maxx - minx, maxy - miny,
|
||||
minx, miny, maxx - minx, maxy - miny);
|
||||
context.restore();
|
||||
break;
|
||||
|
||||
@@ -478,6 +496,12 @@ function cmdMoveResizeSurface(id, has_pos, x, y, has_size, w, h)
|
||||
var xOffset = surface.x;
|
||||
var yOffset = surface.y;
|
||||
|
||||
var transientToplevel = getTransientToplevel(surface);
|
||||
if (transientToplevel) {
|
||||
xOffset = surface.x - transientToplevel.x;
|
||||
yOffset = surface.y - transientToplevel.y;
|
||||
}
|
||||
|
||||
var element = surface.canvas;
|
||||
if (surface.frame) {
|
||||
element = surface.frame;
|
||||
@@ -519,21 +543,6 @@ function handleCommands(cmd)
|
||||
var command = cmd.get_char();
|
||||
lastSerial = cmd.get_32();
|
||||
switch (command) {
|
||||
case 'l':
|
||||
login ();
|
||||
break;
|
||||
|
||||
case 'L':
|
||||
if (loginDiv != null)
|
||||
loginDiv.parentNode.removeChild(loginDiv);
|
||||
start ();
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
alert ("disconnected");
|
||||
inputSocket = null;
|
||||
break;
|
||||
|
||||
case 's': // create new surface
|
||||
id = cmd.get_16();
|
||||
x = cmd.get_16s();
|
||||
@@ -733,12 +742,8 @@ BinCommands.prototype.get_32 = function() {
|
||||
};
|
||||
BinCommands.prototype.get_image_url = function() {
|
||||
var size = this.get_32();
|
||||
var png_blob = new Blob ([new Uint8Array (this.arraybuffer, this.pos, size)], {type:"image/png"});
|
||||
var url;
|
||||
if (window.webkitURL)
|
||||
url = window.webkitURL.createObjectURL(png_blob);
|
||||
else
|
||||
url = window.URL.createObjectURL(png_blob, {oneTimeOnly: true});
|
||||
var png_blob = new Blob ([this.arraybuffer.slice (this.pos, this.pos + size)], {type:"image/png"});
|
||||
var url = URL.createObjectURL(png_blob, {oneTimeOnly: true});
|
||||
this.pos = this.pos + size;
|
||||
return url;
|
||||
};
|
||||
@@ -2585,7 +2590,7 @@ function onMouseWheel(ev)
|
||||
var id = getSurfaceId(ev);
|
||||
var pos = getPositionsFromEvent(ev, id);
|
||||
|
||||
var offset = ev.detail ? ev.detail : -ev.wheelDelta;
|
||||
var offset = ev.detail ? ev.detail : ev.wheelDelta;
|
||||
var dir = 0;
|
||||
if (offset > 0)
|
||||
dir = 1;
|
||||
@@ -2626,47 +2631,6 @@ function newWS(loc) {
|
||||
return ws;
|
||||
}
|
||||
|
||||
function start()
|
||||
{
|
||||
setupDocument(document);
|
||||
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
}
|
||||
|
||||
var loginDiv = null;
|
||||
function login()
|
||||
{
|
||||
if (loginDiv == null) {
|
||||
var div = document.createElement('div');
|
||||
document.body.appendChild(div);
|
||||
div.innerHTML = "Please enter password<br>";
|
||||
div.style.marginTop = "40px";
|
||||
div.style.textAlign = "center";
|
||||
|
||||
var input = document.createElement("input");
|
||||
input.setAttribute("type", "password");
|
||||
div.appendChild(input);
|
||||
input.focus ();
|
||||
input.onkeyup = function(e) {
|
||||
if (e.keyCode === 13 && input.value != "") {
|
||||
inputSocket.send ("l" + input.value);
|
||||
}
|
||||
}
|
||||
loginDiv = div;
|
||||
} else {
|
||||
alert ("Wrong password");
|
||||
}
|
||||
}
|
||||
|
||||
function connect()
|
||||
{
|
||||
var url = window.location.toString();
|
||||
@@ -2675,7 +2639,7 @@ function connect()
|
||||
var params = query_string[1].split("&");
|
||||
}
|
||||
|
||||
var loc = window.location.toString().replace("http:", "ws:").replace("https:", "wss:");
|
||||
var loc = window.location.toString().replace("http:", "ws:");
|
||||
loc = loc.substr(0, loc.lastIndexOf('/')) + "/socket";
|
||||
|
||||
var supports_binary = newWS (loc + "-test").binaryType == "blob";
|
||||
@@ -2688,13 +2652,23 @@ function connect()
|
||||
|
||||
ws.onopen = function() {
|
||||
inputSocket = ws;
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
window.onresize = function(ev) {
|
||||
var w, h;
|
||||
w = window.innerWidth;
|
||||
h = window.innerHeight;
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
sendInput ("d", [w, h]);
|
||||
};
|
||||
ws.onclose = function() {
|
||||
if (inputSocket != null)
|
||||
alert ("disconnected");
|
||||
inputSocket = null;
|
||||
};
|
||||
ws.onmessage = function(event) {
|
||||
handleMessage(event.data);
|
||||
};
|
||||
|
||||
setupDocument(document);
|
||||
}
|
||||
|
||||
@@ -140,6 +140,62 @@ region_from_rects (BroadwayRect *rects, int n_rects)
|
||||
return region;
|
||||
}
|
||||
|
||||
static const cairo_user_data_key_t shm_cairo_key;
|
||||
|
||||
typedef struct {
|
||||
void *data;
|
||||
gsize data_size;
|
||||
} ShmSurfaceData;
|
||||
|
||||
static void
|
||||
shm_data_unmap (void *_data)
|
||||
{
|
||||
ShmSurfaceData *data = _data;
|
||||
munmap (data->data, data->data_size);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
cairo_surface_t *
|
||||
open_surface (char *name, int width, int height)
|
||||
{
|
||||
ShmSurfaceData *data;
|
||||
cairo_surface_t *surface;
|
||||
gsize size;
|
||||
void *ptr;
|
||||
int fd;
|
||||
|
||||
size = width * height * sizeof (guint32);
|
||||
|
||||
fd = shm_open(name, O_RDONLY, 0600);
|
||||
if (fd == -1)
|
||||
{
|
||||
perror ("Failed to shm_open");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ptr = mmap(0, size, PROT_READ, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
if (ptr == NULL)
|
||||
return NULL;
|
||||
|
||||
data = g_new0 (ShmSurfaceData, 1);
|
||||
|
||||
data->data = ptr;
|
||||
data->data_size = size;
|
||||
|
||||
surface = cairo_image_surface_create_for_data ((guchar *)data->data,
|
||||
CAIRO_FORMAT_RGB24,
|
||||
width, height,
|
||||
width * sizeof (guint32));
|
||||
g_assert (surface != NULL);
|
||||
|
||||
cairo_surface_set_user_data (surface, &shm_cairo_key,
|
||||
data, shm_data_unmap);
|
||||
|
||||
return surface;
|
||||
}
|
||||
|
||||
void
|
||||
add_client_serial_mapping (BroadwayClient *client,
|
||||
guint32 client_serial,
|
||||
@@ -281,11 +337,9 @@ client_handle_request (BroadwayClient *client,
|
||||
cairo_region_destroy (area);
|
||||
break;
|
||||
case BROADWAY_REQUEST_UPDATE:
|
||||
surface = broadway_server_open_surface (server,
|
||||
request->update.id,
|
||||
request->update.name,
|
||||
request->update.width,
|
||||
request->update.height);
|
||||
surface = open_surface (request->update.name,
|
||||
request->update.width,
|
||||
request->update.height);
|
||||
if (surface != NULL)
|
||||
{
|
||||
broadway_server_window_update (server,
|
||||
|
||||
@@ -506,7 +506,7 @@ make_valid_fs_char (char c)
|
||||
{
|
||||
char chars[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890";
|
||||
|
||||
return chars[c % (sizeof (chars) - 1)];
|
||||
return chars[c % sizeof (chars)];
|
||||
}
|
||||
|
||||
/* name must have at least space for 34 bytes */
|
||||
@@ -582,13 +582,6 @@ _gdk_broadway_server_create_surface (int width,
|
||||
res = ftruncate (fd, data->data_size);
|
||||
g_assert (res != -1);
|
||||
|
||||
res = posix_fallocate (fd, 0, data->data_size);
|
||||
if (res != 0)
|
||||
{
|
||||
shm_unlink (data->name);
|
||||
g_error ("Not enough shared memory for window surface");
|
||||
}
|
||||
|
||||
data->data = mmap(0, data->data_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
(void) close(fd);
|
||||
|
||||
|
||||
@@ -188,7 +188,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
if (root_y)
|
||||
*root_y = device_root_y;
|
||||
if (win_x)
|
||||
*win_x = device_root_x - toplevel->x;
|
||||
*win_x = device_root_y - toplevel->x;
|
||||
if (win_y)
|
||||
*win_y = device_root_y - toplevel->y;
|
||||
if (mask)
|
||||
@@ -211,29 +211,6 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
||||
return;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial)
|
||||
{
|
||||
GdkDisplay *display = gdk_window_get_display (window);
|
||||
GdkDeviceManager *device_manager;
|
||||
GList *devices, *d;
|
||||
|
||||
device_manager = gdk_display_get_device_manager (display);
|
||||
|
||||
/* Get all devices */
|
||||
devices = gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_MASTER);
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_SLAVE));
|
||||
devices = g_list_concat (devices, gdk_device_manager_list_devices (device_manager, GDK_DEVICE_TYPE_FLOATING));
|
||||
|
||||
/* End all grabs on the newly hidden window */
|
||||
for (d = devices; d; d = d->next)
|
||||
_gdk_display_end_device_grab (display, d->data, serial, window, TRUE);
|
||||
|
||||
g_list_free (devices);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gdk_broadway_window_grab_check_destroy (GdkWindow *window)
|
||||
{
|
||||
|
||||
@@ -66,8 +66,6 @@ struct _GdkBroadwayDisplay
|
||||
GdkWindow *active_offscreen_window;
|
||||
|
||||
GdkBroadwayServer *server;
|
||||
|
||||
gpointer move_resize_data;
|
||||
};
|
||||
|
||||
struct _GdkBroadwayDisplayClass
|
||||
|
||||
@@ -247,7 +247,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
break;
|
||||
case BROADWAY_EVENT_GRAB_NOTIFY:
|
||||
case BROADWAY_EVENT_UNGRAB_NOTIFY:
|
||||
_gdk_display_device_grab_update (display, display->core_pointer, display->core_pointer, message->base.serial);
|
||||
_gdk_display_device_grab_update (display, display->core_pointer, NULL, message->base.serial);
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_CONFIGURE_NOTIFY:
|
||||
@@ -256,6 +256,10 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
|
||||
{
|
||||
window->x = message->configure_notify.x;
|
||||
window->y = message->configure_notify.y;
|
||||
window->width = message->configure_notify.width;
|
||||
window->height = message->configure_notify.height;
|
||||
_gdk_window_update_size (window);
|
||||
_gdk_broadway_window_resize_surface (window);
|
||||
|
||||
event = gdk_event_new (GDK_CONFIGURE);
|
||||
event->configure.window = g_object_ref (window);
|
||||
|
||||
@@ -92,8 +92,6 @@ gboolean _gdk_broadway_moveresize_configure_done (GdkDisplay *display,
|
||||
|
||||
void _gdk_broadway_selection_window_destroyed (GdkWindow *window);
|
||||
void _gdk_broadway_window_grab_check_destroy (GdkWindow *window);
|
||||
void _gdk_broadway_window_grab_check_unmap (GdkWindow *window,
|
||||
gulong serial);
|
||||
|
||||
void _gdk_keymap_keys_changed (GdkDisplay *display);
|
||||
gint _gdk_broadway_get_group_for_state (GdkDisplay *display,
|
||||
|
||||
@@ -83,16 +83,18 @@ G_DEFINE_TYPE (GdkWindowImplBroadway,
|
||||
gdk_window_impl_broadway,
|
||||
GDK_TYPE_WINDOW_IMPL)
|
||||
|
||||
static void
|
||||
update_dirty_windows_and_sync (void)
|
||||
static guint dirty_flush_id = 0;
|
||||
|
||||
static gboolean
|
||||
dirty_flush_idle (gpointer data)
|
||||
{
|
||||
GList *l;
|
||||
GdkBroadwayDisplay *display;
|
||||
gboolean updated_surface;
|
||||
|
||||
dirty_flush_id = 0;
|
||||
|
||||
display = GDK_BROADWAY_DISPLAY (gdk_display_get_default ());
|
||||
|
||||
updated_surface = FALSE;
|
||||
for (l = display->toplevels; l != NULL; l = l->next)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = l->data;
|
||||
@@ -100,7 +102,6 @@ update_dirty_windows_and_sync (void)
|
||||
if (impl->dirty)
|
||||
{
|
||||
impl->dirty = FALSE;
|
||||
updated_surface = TRUE;
|
||||
_gdk_broadway_server_window_update (display->server,
|
||||
impl->id,
|
||||
impl->surface);
|
||||
@@ -109,32 +110,16 @@ update_dirty_windows_and_sync (void)
|
||||
|
||||
/* We sync here to ensure all references to the impl->surface memory
|
||||
is done, as we may later paint new data in them. */
|
||||
if (updated_surface)
|
||||
gdk_display_sync (GDK_DISPLAY (display));
|
||||
else
|
||||
gdk_display_flush (GDK_DISPLAY (display));
|
||||
}
|
||||
|
||||
static guint flush_id = 0;
|
||||
|
||||
static gboolean
|
||||
flush_idle (gpointer data)
|
||||
{
|
||||
flush_id = 0;
|
||||
|
||||
gdk_display_flush (gdk_display_get_default ());
|
||||
gdk_display_sync (GDK_DISPLAY (display));
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* We need to flush in an idle rather than AFTER_PAINT, as the clock
|
||||
is frozen during e.g. window resizes so the paint will not happen
|
||||
and the window resize request is never flushed. */
|
||||
static void
|
||||
queue_flush (GdkWindow *window)
|
||||
queue_dirty_flush (GdkBroadwayDisplay *display)
|
||||
{
|
||||
if (flush_id == 0)
|
||||
flush_id = gdk_threads_add_idle (flush_idle, NULL);
|
||||
if (dirty_flush_id == 0)
|
||||
dirty_flush_id = gdk_threads_add_idle (dirty_flush_idle, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -212,25 +197,6 @@ _gdk_broadway_screen_init_root_window (GdkScreen * screen)
|
||||
_gdk_window_update_size (broadway_screen->root_window);
|
||||
}
|
||||
|
||||
static void
|
||||
on_frame_clock_after_paint (GdkFrameClock *clock,
|
||||
GdkWindow *window)
|
||||
{
|
||||
update_dirty_windows_and_sync ();
|
||||
}
|
||||
|
||||
static void
|
||||
connect_frame_clock (GdkWindow *window)
|
||||
{
|
||||
if (WINDOW_IS_TOPLEVEL (window))
|
||||
{
|
||||
GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
|
||||
|
||||
g_signal_connect (frame_clock, "after-paint",
|
||||
G_CALLBACK (on_frame_clock_after_paint), window);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
GdkWindow *window,
|
||||
@@ -263,21 +229,22 @@ _gdk_broadway_display_create_window_impl (GdkDisplay *display,
|
||||
g_assert (GDK_WINDOW_TYPE (window->parent) == GDK_WINDOW_ROOT);
|
||||
|
||||
broadway_display->toplevels = g_list_prepend (broadway_display->toplevels, impl);
|
||||
|
||||
connect_frame_clock (window);
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_broadway_window_resize_surface (GdkWindow *window)
|
||||
{
|
||||
GdkWindowImplBroadway *impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
cairo_surface_t *old;
|
||||
|
||||
if (impl->surface)
|
||||
{
|
||||
cairo_surface_destroy (impl->surface);
|
||||
old = impl->surface;
|
||||
|
||||
impl->surface = _gdk_broadway_server_create_surface (gdk_window_get_width (impl->wrapper),
|
||||
gdk_window_get_height (impl->wrapper));
|
||||
|
||||
cairo_surface_destroy (old);
|
||||
}
|
||||
|
||||
if (impl->ref_surface)
|
||||
@@ -417,7 +384,7 @@ gdk_window_broadway_show (GdkWindow *window, gboolean already_mapped)
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
if (_gdk_broadway_server_window_show (broadway_display->server, impl->id))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
}
|
||||
|
||||
@@ -437,12 +404,8 @@ gdk_window_broadway_hide (GdkWindow *window)
|
||||
_gdk_make_event (GDK_WINDOW (window), GDK_UNMAP, NULL, FALSE);
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
_gdk_broadway_window_grab_check_unmap (window,
|
||||
_gdk_broadway_server_get_next_serial (broadway_display->server));
|
||||
|
||||
if (_gdk_broadway_server_window_hide (broadway_display->server, impl->id))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
|
||||
_gdk_window_clear_update_area (window);
|
||||
}
|
||||
@@ -497,7 +460,7 @@ gdk_window_broadway_move_resize (GdkWindow *window,
|
||||
with_move,
|
||||
x, y,
|
||||
window->width, window->height);
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
if (size_changed)
|
||||
window->resize_count++;
|
||||
}
|
||||
@@ -582,12 +545,6 @@ gdk_broadway_window_set_geometry_hints (GdkWindow *window,
|
||||
const GdkGeometry *geometry,
|
||||
GdkWindowHints geom_mask)
|
||||
{
|
||||
GdkWindowImplBroadway *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
impl->geometry_hints = *geometry;
|
||||
impl->geometry_hints_mask = geom_mask;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -653,7 +610,7 @@ gdk_window_broadway_set_device_cursor (GdkWindow *window,
|
||||
{
|
||||
_gdk_broadway_cursor_update_theme (cursor);
|
||||
g_hash_table_replace (impl->device_cursor,
|
||||
device, g_object_ref (cursor));
|
||||
device, gdk_cursor_ref (cursor));
|
||||
}
|
||||
|
||||
if (!GDK_WINDOW_DESTROYED (window))
|
||||
@@ -1035,8 +992,6 @@ struct _MoveResizeData
|
||||
gint moveresize_orig_width;
|
||||
gint moveresize_orig_height;
|
||||
long moveresize_process_time;
|
||||
GdkWindowHints moveresize_geom_mask;
|
||||
GdkGeometry moveresize_geometry;
|
||||
BroadwayInputMsg *moveresize_pending_event;
|
||||
};
|
||||
|
||||
@@ -1044,19 +999,20 @@ static MoveResizeData *
|
||||
get_move_resize_data (GdkDisplay *display,
|
||||
gboolean create)
|
||||
{
|
||||
GdkBroadwayDisplay *broadway_display;
|
||||
MoveResizeData *mv_resize;
|
||||
static GQuark move_resize_quark = 0;
|
||||
|
||||
broadway_display = GDK_BROADWAY_DISPLAY (display);
|
||||
if (!move_resize_quark)
|
||||
move_resize_quark = g_quark_from_static_string ("gdk-window-moveresize");
|
||||
|
||||
mv_resize = broadway_display->move_resize_data;
|
||||
mv_resize = g_object_get_qdata (G_OBJECT (display), move_resize_quark);
|
||||
|
||||
if (!mv_resize && create)
|
||||
{
|
||||
mv_resize = g_new0 (MoveResizeData, 1);
|
||||
mv_resize->display = display;
|
||||
|
||||
broadway_display->move_resize_data = mv_resize;
|
||||
g_object_set_qdata (G_OBJECT (display), move_resize_quark, mv_resize);
|
||||
}
|
||||
|
||||
return mv_resize;
|
||||
@@ -1125,13 +1081,6 @@ update_pos (MoveResizeData *mv_resize,
|
||||
w = MAX (w, 1);
|
||||
h = MAX (h, 1);
|
||||
|
||||
if (mv_resize->moveresize_geom_mask)
|
||||
{
|
||||
gdk_window_constrain_size (&mv_resize->moveresize_geometry,
|
||||
mv_resize->moveresize_geom_mask,
|
||||
w, h, &w, &h);
|
||||
}
|
||||
|
||||
gdk_window_move_resize (mv_resize->moveresize_window, x, y, w, h);
|
||||
}
|
||||
else
|
||||
@@ -1186,7 +1135,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
|
||||
switch (event->base.type)
|
||||
{
|
||||
case BROADWAY_EVENT_POINTER_MOVE:
|
||||
case 'm':
|
||||
if (mv_resize->moveresize_window->resize_count > 0)
|
||||
{
|
||||
if (mv_resize->moveresize_pending_event)
|
||||
@@ -1214,7 +1163,7 @@ _gdk_broadway_moveresize_handle_event (GdkDisplay *display,
|
||||
finish_drag (mv_resize);
|
||||
break;
|
||||
|
||||
case BROADWAY_EVENT_BUTTON_RELEASE:
|
||||
case 'B':
|
||||
update_pos (mv_resize,
|
||||
event->pointer.root_x,
|
||||
event->pointer.root_y);
|
||||
@@ -1294,71 +1243,6 @@ create_moveresize_window (MoveResizeData *mv_resize,
|
||||
mv_resize->moveresize_process_time = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
calculate_unmoving_origin (MoveResizeData *mv_resize)
|
||||
{
|
||||
GdkRectangle rect;
|
||||
gint width, height;
|
||||
|
||||
if (mv_resize->moveresize_geom_mask & GDK_HINT_WIN_GRAVITY &&
|
||||
mv_resize->moveresize_geometry.win_gravity == GDK_GRAVITY_STATIC)
|
||||
{
|
||||
gdk_window_get_origin (mv_resize->moveresize_window,
|
||||
&mv_resize->moveresize_orig_x,
|
||||
&mv_resize->moveresize_orig_y);
|
||||
}
|
||||
else
|
||||
{
|
||||
gdk_window_get_frame_extents (mv_resize->moveresize_window, &rect);
|
||||
gdk_window_get_geometry (mv_resize->moveresize_window,
|
||||
NULL, NULL, &width, &height);
|
||||
|
||||
switch (mv_resize->moveresize_geometry.win_gravity)
|
||||
{
|
||||
case GDK_GRAVITY_NORTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_NORTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
case GDK_GRAVITY_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_CENTER:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height / 2 - height / 2;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_WEST:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width / 2 - width / 2;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
case GDK_GRAVITY_SOUTH_EAST:
|
||||
mv_resize->moveresize_orig_x = rect.x + rect.width - width;
|
||||
mv_resize->moveresize_orig_y = rect.y + rect.height - height;
|
||||
break;
|
||||
default:
|
||||
mv_resize->moveresize_orig_x = rect.x;
|
||||
mv_resize->moveresize_orig_y = rect.y;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
GdkWindowEdge edge,
|
||||
@@ -1369,9 +1253,6 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
guint32 timestamp)
|
||||
{
|
||||
MoveResizeData *mv_resize;
|
||||
GdkWindowImplBroadway *impl;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
@@ -1386,14 +1267,12 @@ gdk_broadway_window_begin_resize_drag (GdkWindow *window,
|
||||
mv_resize->moveresize_y = root_y;
|
||||
mv_resize->moveresize_window = g_object_ref (window);
|
||||
|
||||
gdk_window_get_origin (mv_resize->moveresize_window,
|
||||
&mv_resize->moveresize_orig_x,
|
||||
&mv_resize->moveresize_orig_y);
|
||||
mv_resize->moveresize_orig_width = gdk_window_get_width (window);
|
||||
mv_resize->moveresize_orig_height = gdk_window_get_height (window);
|
||||
|
||||
mv_resize->moveresize_geom_mask = impl->geometry_hints_mask;
|
||||
mv_resize->moveresize_geometry = impl->geometry_hints;
|
||||
|
||||
calculate_unmoving_origin (mv_resize);
|
||||
|
||||
create_moveresize_window (mv_resize, timestamp);
|
||||
}
|
||||
|
||||
@@ -1449,6 +1328,7 @@ gdk_broadway_window_process_updates_recurse (GdkWindow *window,
|
||||
|
||||
impl = GDK_WINDOW_IMPL_BROADWAY (window->impl);
|
||||
impl->dirty = TRUE;
|
||||
queue_dirty_flush (GDK_BROADWAY_DISPLAY (gdk_window_get_display (window)));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1514,7 +1394,7 @@ _gdk_broadway_window_translate (GdkWindow *window,
|
||||
if (_gdk_broadway_server_window_translate (broadway_display->server,
|
||||
impl->id,
|
||||
area, dx, dy))
|
||||
queue_flush (window);
|
||||
queue_dirty_flush (broadway_display);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,9 +64,6 @@ struct _GdkWindowImplBroadway
|
||||
gint8 toplevel_window_type;
|
||||
gboolean dirty;
|
||||
gboolean last_synced;
|
||||
|
||||
GdkGeometry geometry_hints;
|
||||
GdkWindowHints geometry_hints_mask;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplBroadwayClass
|
||||
|
||||
@@ -330,7 +330,7 @@ gdk_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
* for this application. In X11, window managers may change this depending on the interaction
|
||||
* pattern under the presence of several pointers.
|
||||
*
|
||||
* You should use this function seldomly, only in code that isn't triggered by a #GdkEvent
|
||||
* You should use this function sheldomly, only in code that isn't triggered by a #GdkEvent
|
||||
* and there aren't other means to get a meaningful #GdkDevice to operate on.
|
||||
*
|
||||
* Returns: (transfer none): The client pointer. This memory is
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@ typedef enum
|
||||
/**
|
||||
* GdkDragProtocol:
|
||||
* @GDK_DRAG_PROTO_NONE: no protocol.
|
||||
* @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol.
|
||||
* @GDK_DRAG_PROTO_MOTIF: The Motif DND protocol. No longer supported
|
||||
* @GDK_DRAG_PROTO_XDND: The Xdnd protocol.
|
||||
* @GDK_DRAG_PROTO_ROOTWIN: An extension to the Xdnd protocol for
|
||||
* unclaimed root window drops.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*** BEGIN file-header ***/
|
||||
#define GDK_ENABLE_BROKEN
|
||||
#include "config.h"
|
||||
#include "gdk.h"
|
||||
|
||||
/*** END file-header ***/
|
||||
|
||||
+2
-2
@@ -297,8 +297,8 @@ typedef enum
|
||||
* viewable.
|
||||
* @GDK_GRAB_FROZEN: the resource is frozen by an active grab of another client.
|
||||
*
|
||||
* Returned by gdk_pointer_grab() and gdk_keyboard_grab() to indicate
|
||||
* success or the reason for the failure of the grab attempt.
|
||||
* Returned by gdk_device_grab(), gdk_pointer_grab() and gdk_keyboard_grab() to
|
||||
* indicate success or the reason for the failure of the grab attempt.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
|
||||
@@ -100,6 +100,16 @@
|
||||
*/
|
||||
#define GDK_VERSION_3_8 (G_ENCODE_VERSION (3, 8))
|
||||
|
||||
/**
|
||||
* GDK_VERSION_3_10:
|
||||
*
|
||||
* A macro that evaluates to the 3.10 version of GDK, in a format
|
||||
* that can be used by the C pre-processor.
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
#define GDK_VERSION_3_10 (G_ENCODE_VERSION (3, 10))
|
||||
|
||||
|
||||
/* evaluates to the current stable version; for development cycles,
|
||||
* this means the next stable target
|
||||
@@ -241,4 +251,18 @@
|
||||
# define GDK_AVAILABLE_IN_3_8
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_10
|
||||
# define GDK_DEPRECATED_IN_3_10 GDK_DEPRECATED
|
||||
# define GDK_DEPRECATED_IN_3_10_FOR(f) GDK_DEPRECATED_FOR(f)
|
||||
#else
|
||||
# define GDK_DEPRECATED_IN_3_10
|
||||
# define GDK_DEPRECATED_IN_3_10_FOR(f)
|
||||
#endif
|
||||
|
||||
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_3_10
|
||||
# define GDK_AVAILABLE_IN_3_10 GDK_UNAVAILABLE(3, 10)
|
||||
#else
|
||||
# define GDK_AVAILABLE_IN_3_10
|
||||
#endif
|
||||
|
||||
#endif /* __GDK_VERSION_MACROS_H__ */
|
||||
|
||||
+2
-12
@@ -940,26 +940,19 @@ static void
|
||||
apply_clip_as_shape (GdkWindow *window)
|
||||
{
|
||||
GdkRectangle r;
|
||||
cairo_region_t *region;
|
||||
|
||||
r.x = r.y = 0;
|
||||
r.width = window->width;
|
||||
r.height = window->height;
|
||||
|
||||
region = cairo_region_copy (window->clip_region);
|
||||
if (window->layered_region)
|
||||
cairo_region_subtract (region, window->layered_region);
|
||||
|
||||
/* We only apply the clip region if would differ
|
||||
from the actual clip region implied by the size
|
||||
of the window. This is to avoid unneccessarily
|
||||
adding meaningless shapes to all native subwindows */
|
||||
if (!region_rect_equal (region, &r))
|
||||
apply_shape (window, region);
|
||||
if (!region_rect_equal (window->clip_region, &r))
|
||||
apply_shape (window, window->clip_region);
|
||||
else
|
||||
apply_shape (window, NULL);
|
||||
|
||||
cairo_region_destroy (region);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -10006,9 +9999,6 @@ gdk_window_print (GdkWindow *window,
|
||||
g_print (" alpha[%d]",
|
||||
window->alpha);
|
||||
|
||||
if (window->has_alpha_background)
|
||||
g_print (" alpha_bg");
|
||||
|
||||
s = print_region (window->clip_region);
|
||||
g_print (" clipbox[%s]", s);
|
||||
|
||||
|
||||
@@ -55,10 +55,6 @@ typedef enum
|
||||
|
||||
GdkOSXVersion gdk_quartz_osx_version (void);
|
||||
|
||||
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
|
||||
NSString *gdk_quartz_target_to_pasteboard_type_libgtk_only (const gchar *target);
|
||||
NSString *gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#define __GDKQUARTZ_H_INSIDE__
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
|
||||
#include "gdkselection.h"
|
||||
#include "gdkproperty.h"
|
||||
#include "gdkquartz.h"
|
||||
|
||||
gboolean
|
||||
_gdk_quartz_display_set_selection_owner (GdkDisplay *display,
|
||||
@@ -172,42 +171,3 @@ _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type)
|
||||
{
|
||||
if ([type isEqualToString:NSStringPboardType])
|
||||
return gdk_atom_intern_static_string ("UTF8_STRING");
|
||||
else if ([type isEqualToString:NSTIFFPboardType])
|
||||
return gdk_atom_intern_static_string ("image/tiff");
|
||||
else if ([type isEqualToString:NSColorPboardType])
|
||||
return gdk_atom_intern_static_string ("application/x-color");
|
||||
else if ([type isEqualToString:NSURLPboardType])
|
||||
return gdk_atom_intern_static_string ("text/uri-list");
|
||||
else
|
||||
return gdk_atom_intern ([type UTF8String], FALSE);
|
||||
}
|
||||
|
||||
NSString *
|
||||
gdk_quartz_target_to_pasteboard_type_libgtk_only (const char *target)
|
||||
{
|
||||
if (strcmp (target, "UTF8_STRING") == 0)
|
||||
return NSStringPboardType;
|
||||
else if (strcmp (target, "image/tiff") == 0)
|
||||
return NSTIFFPboardType;
|
||||
else if (strcmp (target, "application/x-color") == 0)
|
||||
return NSColorPboardType;
|
||||
else if (strcmp (target, "text/uri-list") == 0)
|
||||
return NSURLPboardType;
|
||||
else
|
||||
return [NSString stringWithUTF8String:target];
|
||||
}
|
||||
|
||||
NSString *
|
||||
gdk_quartz_atom_to_pasteboard_type_libgtk_only (GdkAtom atom)
|
||||
{
|
||||
gchar *target = gdk_atom_name (atom);
|
||||
NSString *ret = gdk_quartz_target_to_pasteboard_type_libgtk_only (target);
|
||||
g_free (target);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -91,17 +91,17 @@ struct _GdkWaylandDeviceClass
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandDevice, gdk_wayland_device, GDK_TYPE_DEVICE)
|
||||
|
||||
#define GDK_TYPE_DEVICE_MANAGER_CORE (gdk_device_manager_core_get_type ())
|
||||
#define GDK_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCore))
|
||||
#define GDK_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_IS_DEVICE_MANAGER_CORE_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_DEVICE_MANAGER_CORE))
|
||||
#define GDK_DEVICE_MANAGER_CORE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_DEVICE_MANAGER_CORE, GdkDeviceManagerCoreClass))
|
||||
#define GDK_TYPE_WAYLAND_DEVICE_MANAGER (gdk_wayland_device_manager_get_type ())
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManager))
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManagerClass))
|
||||
#define GDK_IS_WAYLAND_DEVICE_MANAGER(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER))
|
||||
#define GDK_IS_WAYLAND_DEVICE_MANAGER_CLASS(c) (G_TYPE_CHECK_CLASS_TYPE ((c), GDK_TYPE_WAYLAND_DEVICE_MANAGER))
|
||||
#define GDK_WAYLAND_DEVICE_MANAGER_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDK_TYPE_WAYLAND_DEVICE_MANAGER, GdkWaylandDeviceManagerClass))
|
||||
|
||||
typedef struct _GdkDeviceManagerCore GdkDeviceManagerCore;
|
||||
typedef struct _GdkDeviceManagerCoreClass GdkDeviceManagerCoreClass;
|
||||
typedef struct _GdkWaylandDeviceManager GdkWaylandDeviceManager;
|
||||
typedef struct _GdkWaylandDeviceManagerClass GdkWaylandDeviceManagerClass;
|
||||
|
||||
struct _GdkDeviceManagerCore
|
||||
struct _GdkWaylandDeviceManager
|
||||
{
|
||||
GdkDeviceManager parent_object;
|
||||
GdkDevice *core_pointer;
|
||||
@@ -109,13 +109,13 @@ struct _GdkDeviceManagerCore
|
||||
GList *devices;
|
||||
};
|
||||
|
||||
struct _GdkDeviceManagerCoreClass
|
||||
struct _GdkWaylandDeviceManagerClass
|
||||
{
|
||||
GdkDeviceManagerClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkDeviceManagerCore,
|
||||
gdk_device_manager_core, GDK_TYPE_DEVICE_MANAGER)
|
||||
G_DEFINE_TYPE (GdkWaylandDeviceManager,
|
||||
gdk_wayland_device_manager, GDK_TYPE_DEVICE_MANAGER)
|
||||
|
||||
static gboolean
|
||||
gdk_wayland_device_get_history (GdkDevice *device,
|
||||
@@ -1065,8 +1065,8 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
enum wl_seat_capability caps)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
GdkDeviceManagerCore *device_manager_core =
|
||||
GDK_DEVICE_MANAGER_CORE(device->device_manager);
|
||||
GdkWaylandDeviceManager *device_manager =
|
||||
GDK_WAYLAND_DEVICE_MANAGER(device->device_manager);
|
||||
|
||||
if ((caps & WL_SEAT_CAPABILITY_POINTER) && !device->wl_pointer)
|
||||
{
|
||||
@@ -1086,16 +1086,16 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
NULL);
|
||||
GDK_WAYLAND_DEVICE (device->pointer)->device = device;
|
||||
|
||||
device_manager_core->devices =
|
||||
g_list_prepend (device_manager_core->devices, device->pointer);
|
||||
device_manager->devices =
|
||||
g_list_prepend (device_manager->devices, device->pointer);
|
||||
}
|
||||
else if (!(caps & WL_SEAT_CAPABILITY_POINTER) && device->wl_pointer)
|
||||
{
|
||||
wl_pointer_destroy(device->wl_pointer);
|
||||
device->wl_pointer = NULL;
|
||||
|
||||
device_manager_core->devices =
|
||||
g_list_remove (device_manager_core->devices, device->pointer);
|
||||
device_manager->devices =
|
||||
g_list_remove (device_manager->devices, device->pointer);
|
||||
|
||||
g_object_unref (device->pointer);
|
||||
device->pointer = NULL;
|
||||
@@ -1119,16 +1119,16 @@ seat_handle_capabilities(void *data, struct wl_seat *seat,
|
||||
NULL);
|
||||
GDK_WAYLAND_DEVICE (device->keyboard)->device = device;
|
||||
|
||||
device_manager_core->devices =
|
||||
g_list_prepend (device_manager_core->devices, device->keyboard);
|
||||
device_manager->devices =
|
||||
g_list_prepend (device_manager->devices, device->keyboard);
|
||||
}
|
||||
else if (!(caps & WL_SEAT_CAPABILITY_KEYBOARD) && device->wl_keyboard)
|
||||
{
|
||||
wl_keyboard_destroy(device->wl_keyboard);
|
||||
device->wl_keyboard = NULL;
|
||||
|
||||
device_manager_core->devices =
|
||||
g_list_remove (device_manager_core->devices, device->keyboard);
|
||||
device_manager->devices =
|
||||
g_list_remove (device_manager->devices, device->keyboard);
|
||||
|
||||
g_object_unref (device->keyboard);
|
||||
device->keyboard = NULL;
|
||||
@@ -1183,43 +1183,43 @@ free_device (gpointer data)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_finalize (GObject *object)
|
||||
gdk_wayland_device_manager_finalize (GObject *object)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkWaylandDeviceManager *device_manager;
|
||||
|
||||
device_manager_core = GDK_DEVICE_MANAGER_CORE (object);
|
||||
device_manager = GDK_WAYLAND_DEVICE_MANAGER (object);
|
||||
|
||||
g_list_free_full (device_manager_core->devices, free_device);
|
||||
g_list_free_full (device_manager->devices, free_device);
|
||||
|
||||
G_OBJECT_CLASS (gdk_device_manager_core_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (gdk_wayland_device_manager_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static GList *
|
||||
gdk_device_manager_core_list_devices (GdkDeviceManager *device_manager,
|
||||
gdk_wayland_device_manager_list_devices (GdkDeviceManager *device_manager,
|
||||
GdkDeviceType type)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *devices = NULL;
|
||||
|
||||
if (type == GDK_DEVICE_TYPE_MASTER)
|
||||
{
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
devices = g_list_copy(device_manager_core->devices);
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
devices = g_list_copy(wayland_device_manager->devices);
|
||||
}
|
||||
|
||||
return devices;
|
||||
}
|
||||
|
||||
static GdkDevice *
|
||||
gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
gdk_wayland_device_manager_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
{
|
||||
GdkDeviceManagerCore *device_manager_core;
|
||||
GdkWaylandDeviceManager *wayland_device_manager;
|
||||
GList *l;
|
||||
|
||||
device_manager_core = (GdkDeviceManagerCore *) device_manager;
|
||||
wayland_device_manager = (GdkWaylandDeviceManager *) device_manager;
|
||||
|
||||
/* Find the first pointer device */
|
||||
for (l = device_manager_core->devices; l != NULL; l = l->next)
|
||||
for (l = wayland_device_manager->devices; l != NULL; l = l->next)
|
||||
{
|
||||
GdkDevice *device = l->data;
|
||||
|
||||
@@ -1231,25 +1231,25 @@ gdk_device_manager_core_get_client_pointer (GdkDeviceManager *device_manager)
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_class_init (GdkDeviceManagerCoreClass *klass)
|
||||
gdk_wayland_device_manager_class_init (GdkWaylandDeviceManagerClass *klass)
|
||||
{
|
||||
GdkDeviceManagerClass *device_manager_class = GDK_DEVICE_MANAGER_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gdk_device_manager_core_finalize;
|
||||
device_manager_class->list_devices = gdk_device_manager_core_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_device_manager_core_get_client_pointer;
|
||||
object_class->finalize = gdk_wayland_device_manager_finalize;
|
||||
device_manager_class->list_devices = gdk_wayland_device_manager_list_devices;
|
||||
device_manager_class->get_client_pointer = gdk_wayland_device_manager_get_client_pointer;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_device_manager_core_init (GdkDeviceManagerCore *device_manager)
|
||||
gdk_wayland_device_manager_init (GdkWaylandDeviceManager *device_manager)
|
||||
{
|
||||
}
|
||||
|
||||
GdkDeviceManager *
|
||||
_gdk_wayland_device_manager_new (GdkDisplay *display)
|
||||
{
|
||||
return g_object_new (GDK_TYPE_DEVICE_MANAGER_CORE,
|
||||
return g_object_new (GDK_TYPE_WAYLAND_DEVICE_MANAGER,
|
||||
"display", display,
|
||||
NULL);
|
||||
}
|
||||
@@ -1420,7 +1420,7 @@ data_source_send (void *data,
|
||||
const char *mime_type,
|
||||
int32_t fd)
|
||||
{
|
||||
GdkWaylandSelectionOffer *offer = (GdkWaylandSelectionOffer *)data;;
|
||||
GdkWaylandSelectionOffer *offer = (GdkWaylandSelectionOffer *)data;
|
||||
gchar *buf;
|
||||
gssize len, bytes_written = 0;
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ gdk_wayland_display_flush (GdkDisplay *display)
|
||||
g_return_if_fail (GDK_IS_DISPLAY (display));
|
||||
|
||||
if (!display->closed)
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);;
|
||||
wl_display_flush(GDK_WAYLAND_DISPLAY (display)->wl_display);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include <sys/mman.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include <wayland-egl.h>
|
||||
|
||||
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
@@ -115,6 +114,8 @@ struct _GdkWindowImplWayland
|
||||
*/
|
||||
cairo_surface_t *server_surface;
|
||||
|
||||
gchar *title;
|
||||
|
||||
uint32_t resize_edges;
|
||||
|
||||
int focus_count;
|
||||
@@ -135,7 +136,10 @@ struct _GdkWindowImplWayland
|
||||
guint32 grab_time;
|
||||
|
||||
gboolean fullscreen;
|
||||
int saved_width, saved_height; /* before going fullscreen */
|
||||
struct
|
||||
{
|
||||
int width, height;
|
||||
} saved_fullscreen, saved_maximized;
|
||||
};
|
||||
|
||||
struct _GdkWindowImplWaylandClass
|
||||
@@ -282,6 +286,8 @@ _gdk_wayland_display_create_window_impl (GdkDisplay *display,
|
||||
|
||||
g_object_ref (window);
|
||||
|
||||
impl->title = NULL;
|
||||
|
||||
switch (GDK_WINDOW_TYPE (window))
|
||||
{
|
||||
case GDK_WINDOW_TOPLEVEL:
|
||||
@@ -324,13 +330,6 @@ gdk_wayland_window_attach_image (GdkWindow *window)
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
/* The "drawn to" Cairo surface is the same as the Cairo surface from which
|
||||
* we are driving the buffer for the Wayland surface. Therefore we don't
|
||||
* need to do anything here
|
||||
*/
|
||||
if (impl->server_surface == impl->cairo_surface)
|
||||
return;
|
||||
|
||||
/* The wayland surface is attached to a buffer that is from the old "drawn
|
||||
* to" surface. Unref the surface and restore the state.
|
||||
*/
|
||||
@@ -727,6 +726,9 @@ gdk_wayland_window_show (GdkWindow *window, gboolean already_mapped)
|
||||
|
||||
if (impl->cairo_surface)
|
||||
gdk_wayland_window_attach_image (window);
|
||||
|
||||
if (impl->shell_surface && impl->title)
|
||||
wl_shell_surface_set_title (impl->shell_surface, impl->title);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1158,10 +1160,15 @@ static void
|
||||
gdk_wayland_window_set_title (GdkWindow *window,
|
||||
const gchar *title)
|
||||
{
|
||||
GdkWindowImplWayland *impl;
|
||||
g_return_if_fail (title != NULL);
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
impl->title = strdup (title);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1291,15 +1298,59 @@ gdk_wayland_window_unstick (GdkWindow *window)
|
||||
static void
|
||||
gdk_wayland_window_maximize (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
return;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
if (impl->surface)
|
||||
{
|
||||
impl->saved_maximized.width = gdk_window_get_width (window);
|
||||
impl->saved_maximized.height = gdk_window_get_height (window);
|
||||
|
||||
if (impl->shell_surface)
|
||||
wl_shell_surface_set_maximized (impl->shell_surface, NULL);
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
0,
|
||||
GDK_WINDOW_STATE_MAXIMIZED);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_window_unmaximize (GdkWindow *window)
|
||||
{
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
GdkWindowImplWayland *impl;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window) ||
|
||||
!WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
|
||||
return;
|
||||
|
||||
impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
|
||||
|
||||
if (GDK_WINDOW_IS_MAPPED (window))
|
||||
{
|
||||
if (impl->surface)
|
||||
{
|
||||
if (impl->shell_surface)
|
||||
wl_shell_surface_set_toplevel (impl->shell_surface);
|
||||
}
|
||||
|
||||
gdk_synthesize_window_state (window,
|
||||
GDK_WINDOW_STATE_MAXIMIZED,
|
||||
0);
|
||||
|
||||
gdk_wayland_window_configure (window,
|
||||
impl->saved_maximized.width,
|
||||
impl->saved_maximized.height,
|
||||
0);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1313,8 +1364,8 @@ gdk_wayland_window_fullscreen (GdkWindow *window)
|
||||
if (impl->fullscreen)
|
||||
return;
|
||||
|
||||
impl->saved_width = gdk_window_get_width (window);
|
||||
impl->saved_height = gdk_window_get_height (window);
|
||||
impl->saved_fullscreen.width = gdk_window_get_width (window);
|
||||
impl->saved_fullscreen.height = gdk_window_get_height (window);
|
||||
wl_shell_surface_set_fullscreen (impl->shell_surface,
|
||||
WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT,
|
||||
0,
|
||||
@@ -1338,10 +1389,11 @@ gdk_wayland_window_unfullscreen (GdkWindow *window)
|
||||
|
||||
wl_shell_surface_set_toplevel (impl->shell_surface);
|
||||
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FULLSCREEN, 0);
|
||||
gdk_wayland_window_configure (window, impl->saved_width, impl->saved_height,
|
||||
gdk_wayland_window_configure (window,
|
||||
impl->saved_fullscreen.width,
|
||||
impl->saved_fullscreen.height,
|
||||
0);
|
||||
|
||||
|
||||
impl->fullscreen = FALSE;
|
||||
}
|
||||
|
||||
|
||||
@@ -150,7 +150,6 @@ _gdk_win32_window_change_property (GdkWindow *window,
|
||||
guchar *ucptr;
|
||||
wchar_t *wcptr, *p;
|
||||
glong wclen;
|
||||
GError *err = NULL;
|
||||
|
||||
g_return_if_fail (window != NULL);
|
||||
g_return_if_fail (GDK_IS_WINDOW (window));
|
||||
@@ -194,13 +193,7 @@ _gdk_win32_window_change_property (GdkWindow *window,
|
||||
return;
|
||||
}
|
||||
|
||||
wcptr = g_utf8_to_utf16 ((char *) data, nelements, NULL, &wclen, &err);
|
||||
if (err != NULL)
|
||||
{
|
||||
g_warning ("Failed to convert utf8: %s", err->message);
|
||||
g_clear_error (&err);
|
||||
return;
|
||||
}
|
||||
wcptr = g_utf8_to_utf16 ((char *) data, nelements, NULL, &wclen, NULL);
|
||||
|
||||
wclen++; /* Terminating 0 */
|
||||
size = wclen * 2;
|
||||
|
||||
@@ -1555,20 +1555,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
source_device = g_hash_table_lookup (device_manager->id_table,
|
||||
GUINT_TO_POINTER (xev->sourceid));
|
||||
gdk_event_set_source_device (event, source_device);
|
||||
|
||||
if (gdk_device_get_device_type (source_device) != GDK_DEVICE_TYPE_MASTER)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
|
||||
else
|
||||
{
|
||||
GList *slaves, *l;
|
||||
|
||||
slaves = gdk_device_list_slave_devices (source_device);
|
||||
|
||||
for (l = slaves; l; l = l->next)
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (l->data));
|
||||
|
||||
g_list_free (slaves);
|
||||
}
|
||||
_gdk_device_xi2_reset_scroll_valuators (GDK_X11_DEVICE_XI2 (source_device));
|
||||
|
||||
event->crossing.mode = translate_crossing_mode (xev->mode);
|
||||
event->crossing.detail = translate_notify_type (xev->detail);
|
||||
|
||||
@@ -140,7 +140,6 @@ static const char *const precache_atoms[] = {
|
||||
"_NET_WM_STATE_ABOVE",
|
||||
"_NET_WM_STATE_BELOW",
|
||||
"_NET_WM_STATE_FULLSCREEN",
|
||||
"_NET_WM_STATE_HIDDEN",
|
||||
"_NET_WM_STATE_MODAL",
|
||||
"_NET_WM_STATE_MAXIMIZED_VERT",
|
||||
"_NET_WM_STATE_MAXIMIZED_HORZ",
|
||||
@@ -150,17 +149,8 @@ static const char *const precache_atoms[] = {
|
||||
"_NET_WM_SYNC_REQUEST",
|
||||
"_NET_WM_SYNC_REQUEST_COUNTER",
|
||||
"_NET_WM_WINDOW_TYPE",
|
||||
"_NET_WM_WINDOW_TYPE_COMBO",
|
||||
"_NET_WM_WINDOW_TYPE_DIALOG",
|
||||
"_NET_WM_WINDOW_TYPE_DND",
|
||||
"_NET_WM_WINDOW_TYPE_DROPDOWN_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_NORMAL",
|
||||
"_NET_WM_WINDOW_TYPE_POPUP_MENU",
|
||||
"_NET_WM_WINDOW_TYPE_TOOLTIP",
|
||||
"_NET_WM_WINDOW_TYPE_UTILITY",
|
||||
"_NET_WM_USER_TIME",
|
||||
"_NET_WM_USER_TIME_WINDOW",
|
||||
"_NET_VIRTUAL_ROOTS",
|
||||
"GDK_SELECTION",
|
||||
"_NET_WM_STATE_FOCUSED"
|
||||
|
||||
+4
-1440
File diff suppressed because it is too large
Load Diff
+10
-3
@@ -257,6 +257,7 @@ gtk_public_h_sources = \
|
||||
gtkfontchooserwidget.h \
|
||||
gtkframe.h \
|
||||
gtkgrid.h \
|
||||
gtkheaderbar.h \
|
||||
gtkiconfactory.h \
|
||||
gtkicontheme.h \
|
||||
gtkiconview.h \
|
||||
@@ -731,6 +732,7 @@ gtk_base_c_sources = \
|
||||
gtkfontchooserwidget.c \
|
||||
gtkframe.c \
|
||||
gtkgrid.c \
|
||||
gtkheaderbar.c \
|
||||
gtkhsla.c \
|
||||
gtkiconcache.c \
|
||||
gtkiconcachevalidator.c \
|
||||
@@ -1308,9 +1310,7 @@ endif
|
||||
#
|
||||
# Installed tools
|
||||
#
|
||||
bin_PROGRAMS = \
|
||||
gtk-query-immodules-3.0 \
|
||||
gtk-launch
|
||||
bin_PROGRAMS = gtk-query-immodules-3.0
|
||||
|
||||
if BUILD_ICON_CACHE
|
||||
bin_PROGRAMS += gtk-update-icon-cache
|
||||
@@ -1357,8 +1357,11 @@ gtk_update_icon_cache_LDADD = $(GDK_PIXBUF_LIBS)
|
||||
gtk_update_icon_cache_SOURCES = updateiconcache.c
|
||||
endif
|
||||
|
||||
if HAVE_GIO_UNIX
|
||||
bin_PROGRAMS += gtk-launch
|
||||
gtk_launch_LDADD = $(LDADDS)
|
||||
gtk_launch_SOURCES = gtk-launch.c
|
||||
endif
|
||||
|
||||
.PHONY: files test test-debug
|
||||
|
||||
@@ -1373,6 +1376,10 @@ STOCK_ICONS = \
|
||||
stock-icons/16/list-add.png \
|
||||
stock-icons/16/media-optical.png \
|
||||
stock-icons/16/window-close.png \
|
||||
stock-icons/16/window-minimize.png \
|
||||
stock-icons/16/window-maximize.png \
|
||||
stock-icons/16/window-restore.png \
|
||||
stock-icons/16/window-delete.png \
|
||||
stock-icons/16/gtk-connect.png \
|
||||
stock-icons/16/gtk-convert.png \
|
||||
stock-icons/16/edit-clear.png \
|
||||
|
||||
@@ -342,8 +342,7 @@ _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
&stop_deps,
|
||||
NULL);
|
||||
&stop_deps);
|
||||
if (val)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
|
||||
@@ -307,7 +307,6 @@ gtk_symbolic_color_resolve (GtkSymbolicColor *color,
|
||||
GTK_STYLE_PROVIDER_PRIVATE (props),
|
||||
current,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
_gtk_css_value_unref (current);
|
||||
if (v == NULL)
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
color: @fg_color;
|
||||
border-color: shade (@bg_color, 0.6);
|
||||
padding: 2px;
|
||||
-GtkWindow-resize-grip-width: 0;
|
||||
-GtkWindow-resize-grip-height: 0;
|
||||
-GtkWindow-decoration-button-layout: 'icon:minimize,maximize,close';
|
||||
}
|
||||
|
||||
GtkWindow, .button, .slider {
|
||||
@@ -729,3 +732,73 @@ GtkCalendar.button:hover {
|
||||
-gtk-gradient(radial, center center, 0, center center, 0.5, to(currentColor), to(transparent));
|
||||
animation: spinner 1s infinite linear;
|
||||
}
|
||||
|
||||
/* Client side decorations */
|
||||
.titlebar > GtkLabel:backdrop {
|
||||
color: darker (@bg_color);
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.titlebar GtkLabel {
|
||||
font: Sans Bold 10;
|
||||
text-shadow: 1px 1px lighter (@bg_color);
|
||||
}
|
||||
|
||||
.titlebar GtkButton:backdrop {
|
||||
border-image: none;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.titlebar GtkButton GtkLabel:backdrop {
|
||||
text-shadow: none;
|
||||
color: darker (@bg_color);
|
||||
}
|
||||
|
||||
.titlebar GtkButton GtkLabel {
|
||||
font: Sans Bold 12;
|
||||
color: white;
|
||||
text-shadow: 0px 1px darker (darker (@bg_color));
|
||||
}
|
||||
|
||||
.titlebar GtkButton {
|
||||
border-style: none;
|
||||
border-color: darker (@bg_color);
|
||||
|
||||
background-image: -gtk-gradient (linear, center top, center bottom,
|
||||
from (@bg_color),
|
||||
color-stop (0.5, darker (@bg_color)),
|
||||
to (@bg_color));
|
||||
}
|
||||
|
||||
.titlebar GtkButton:first-child {
|
||||
border-radius: 10px 0px 0px 0px;
|
||||
}
|
||||
|
||||
.titlebar GtkButton:last-child {
|
||||
border-radius: 0px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.titlebar:backdrop {
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
background-image: -gtk-gradient (linear, center top, center bottom,
|
||||
from (white),
|
||||
to (@bg_color));
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
}
|
||||
|
||||
.window-border {
|
||||
border-color: darker (@bg_color);
|
||||
border-radius: 10px;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
.window-outer-border {
|
||||
border-color: transparent;
|
||||
border-radius: 10px;
|
||||
border-width: 10px 10px 10px 10px;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
+1
-352
@@ -791,7 +791,7 @@ GtkSwitch.trough:active {
|
||||
/* Assistant */
|
||||
|
||||
GtkAssistant .sidebar .highlight {
|
||||
background-color: gray;
|
||||
background-color: blue;
|
||||
font: bold;
|
||||
}
|
||||
|
||||
@@ -834,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;
|
||||
}
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
#include <gtk/gtkfontchooserwidget.h>
|
||||
#include <gtk/gtkframe.h>
|
||||
#include <gtk/gtkgrid.h>
|
||||
#include <gtk/gtkheaderbar.h>
|
||||
#include <gtk/gtkiconfactory.h>
|
||||
#include <gtk/gtkicontheme.h>
|
||||
#include <gtk/gtkiconview.h>
|
||||
|
||||
@@ -1222,6 +1222,15 @@ gtk_hbox_get_type
|
||||
gtk_hbox_new
|
||||
gtk_hbutton_box_get_type
|
||||
gtk_hbutton_box_new
|
||||
gtk_header_bar_new
|
||||
gtk_header_bar_pack_start
|
||||
gtk_header_bar_pack_end
|
||||
gtk_header_bar_set_title
|
||||
gtk_header_bar_get_title
|
||||
gtk_header_bar_set_subtitle
|
||||
gtk_header_bar_get_subtitle
|
||||
gtk_header_bar_set_custom_title
|
||||
gtk_header_bar_get_custom_title
|
||||
gtk_hpaned_get_type
|
||||
gtk_hpaned_new
|
||||
gtk_hscale_get_type
|
||||
@@ -4044,6 +4053,7 @@ gtk_window_set_skip_pager_hint
|
||||
gtk_window_set_skip_taskbar_hint
|
||||
gtk_window_set_startup_id
|
||||
gtk_window_set_title
|
||||
gtk_window_set_titlebar
|
||||
gtk_window_set_transient_for
|
||||
gtk_window_set_attached_to
|
||||
gtk_window_set_type_hint
|
||||
|
||||
+70
-12
@@ -108,6 +108,12 @@ static void gtk_alignment_get_preferred_height_for_width (GtkWidget *w
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_alignment_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
G_DEFINE_TYPE (GtkAlignment, gtk_alignment, GTK_TYPE_BIN)
|
||||
|
||||
@@ -128,6 +134,7 @@ gtk_alignment_class_init (GtkAlignmentClass *class)
|
||||
widget_class->get_preferred_height = gtk_alignment_get_preferred_height;
|
||||
widget_class->get_preferred_width_for_height = gtk_alignment_get_preferred_width_for_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_alignment_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_alignment_get_preferred_height_and_baseline_for_width;
|
||||
|
||||
g_object_class_install_property (gobject_class,
|
||||
PROP_XALIGN,
|
||||
@@ -507,6 +514,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
gint width, height;
|
||||
guint border_width;
|
||||
gint padding_horizontal, padding_vertical;
|
||||
gint baseline;
|
||||
|
||||
padding_horizontal = 0;
|
||||
padding_vertical = 0;
|
||||
@@ -520,6 +528,7 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
gint child_nat_width;
|
||||
gint child_nat_height;
|
||||
gint child_width, child_height;
|
||||
double yalign, yscale;
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (alignment));
|
||||
|
||||
@@ -529,6 +538,25 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
width = MAX (1, allocation->width - padding_horizontal - 2 * border_width);
|
||||
height = MAX (1, allocation->height - padding_vertical - 2 * border_width);
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline != -1)
|
||||
baseline -= border_width + priv->padding_top;
|
||||
|
||||
/* If we get a baseline set that means we're baseline aligned, and the parent
|
||||
honored that. In that case we have to ignore yalign/yscale as we need
|
||||
yalign based on the baseline and always FILL mode to ensure we can place
|
||||
the baseline anywhere */
|
||||
if (baseline != -1)
|
||||
{
|
||||
yalign = 0;
|
||||
yscale = 1.0;
|
||||
}
|
||||
else
|
||||
{
|
||||
yalign = priv->yalign;
|
||||
yscale = priv->yscale;
|
||||
}
|
||||
|
||||
if (gtk_widget_get_request_mode (child) == GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH)
|
||||
{
|
||||
gtk_widget_get_preferred_width (child, NULL, &child_nat_width);
|
||||
@@ -559,8 +587,8 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
|
||||
if (height > child_height)
|
||||
child_allocation.height = (child_height *
|
||||
(1.0 - priv->yscale) +
|
||||
height * priv->yscale);
|
||||
(1.0 - yscale) +
|
||||
height * yscale);
|
||||
else
|
||||
child_allocation.height = height;
|
||||
|
||||
@@ -569,9 +597,9 @@ gtk_alignment_size_allocate (GtkWidget *widget,
|
||||
else
|
||||
child_allocation.x = priv->xalign * (width - child_allocation.width) + allocation->x + border_width + priv->padding_left;
|
||||
|
||||
child_allocation.y = priv->yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top;
|
||||
child_allocation.y = yalign * (height - child_allocation.height) + allocation->y + border_width + priv->padding_top;
|
||||
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,18 +609,30 @@ gtk_alignment_get_preferred_size (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkAlignment *alignment = GTK_ALIGNMENT (widget);
|
||||
GtkAlignmentPrivate *priv = alignment->priv;
|
||||
GtkWidget *child;
|
||||
guint minimum, natural;
|
||||
guint top_offset;
|
||||
guint border;
|
||||
|
||||
natural = minimum = gtk_container_get_border_width (GTK_CONTAINER (widget)) * 2;
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
|
||||
border = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
natural = minimum = border * 2;
|
||||
top_offset = border;
|
||||
|
||||
if ((child = gtk_bin_get_child (GTK_BIN (widget))) && gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gint child_min_baseline = -1, child_nat_baseline = -1;
|
||||
|
||||
/* Request extra space for the padding: */
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
@@ -619,9 +659,10 @@ gtk_alignment_get_preferred_size (GtkWidget *widget,
|
||||
else
|
||||
{
|
||||
minimum += (priv->padding_top + priv->padding_bottom);
|
||||
top_offset += priv->padding_top;
|
||||
|
||||
if (for_size < 0)
|
||||
gtk_widget_get_preferred_height (child, &child_min, &child_nat);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child, -1, &child_min, &child_nat, &child_min_baseline, &child_nat_baseline);
|
||||
else
|
||||
{
|
||||
gint min_width;
|
||||
@@ -634,8 +675,13 @@ gtk_alignment_get_preferred_size (GtkWidget *widget,
|
||||
for_size = (min_width * (1.0 - priv->xscale) +
|
||||
for_size * priv->xscale);
|
||||
|
||||
gtk_widget_get_preferred_height_for_width (child, for_size, &child_min, &child_nat);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child, for_size, &child_min, &child_nat, &child_min_baseline, &child_nat_baseline);
|
||||
}
|
||||
|
||||
if (minimum_baseline && child_min_baseline >= 0)
|
||||
*minimum_baseline = child_min_baseline + top_offset;
|
||||
if (natural_baseline && child_nat_baseline >= 0)
|
||||
*natural_baseline = child_nat_baseline + top_offset;
|
||||
}
|
||||
|
||||
natural = minimum;
|
||||
@@ -656,7 +702,7 @@ gtk_alignment_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, -1, minimum_size, natural_size);
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, -1, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -664,7 +710,7 @@ gtk_alignment_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, -1, minimum_size, natural_size);
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, -1, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
|
||||
@@ -674,7 +720,7 @@ gtk_alignment_get_preferred_width_for_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, for_size, minimum_size, natural_size);
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, for_size, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -683,9 +729,21 @@ gtk_alignment_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, for_size, minimum_size, natural_size);
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, for_size, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_alignment_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint for_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
gtk_alignment_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, for_size, minimum_size, natural_size, minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gtk_alignment_set_padding:
|
||||
* @alignment: a #GtkAlignment
|
||||
|
||||
@@ -348,9 +348,6 @@ gtk_app_chooser_button_populate (GtkAppChooserButton *self)
|
||||
{
|
||||
app = l->data;
|
||||
|
||||
if (!g_app_info_should_show (app))
|
||||
continue;
|
||||
|
||||
if (default_app != NULL && g_app_info_equal (app, default_app))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -216,7 +216,6 @@ struct _GtkApplicationWindowPrivate
|
||||
GtkWidget *menubar;
|
||||
GtkAccelGroup *accels;
|
||||
GSList *accel_closures;
|
||||
guint accel_map_changed_id;
|
||||
|
||||
GMenu *app_menu_section;
|
||||
GMenu *menubar_section;
|
||||
@@ -704,13 +703,17 @@ gtk_application_window_real_size_allocate (GtkWidget *widget,
|
||||
|
||||
if (window->priv->menubar != NULL)
|
||||
{
|
||||
GtkAllocation menubar_allocation = *allocation;
|
||||
GtkAllocation menubar_allocation;
|
||||
GtkAllocation child_allocation;
|
||||
gint menubar_height;
|
||||
GtkWidget *child;
|
||||
|
||||
_gtk_window_set_allocation (GTK_WINDOW (widget), allocation);
|
||||
_gtk_window_set_allocation (GTK_WINDOW (widget), allocation, &child_allocation);
|
||||
menubar_allocation = child_allocation;
|
||||
|
||||
gtk_widget_get_preferred_height_for_width (window->priv->menubar, allocation->width, &menubar_height, NULL);
|
||||
gtk_widget_get_preferred_height_for_width (window->priv->menubar,
|
||||
menubar_allocation.width,
|
||||
&menubar_height, NULL);
|
||||
|
||||
menubar_allocation.height = menubar_height;
|
||||
gtk_widget_size_allocate (window->priv->menubar, &menubar_allocation);
|
||||
@@ -718,7 +721,6 @@ gtk_application_window_real_size_allocate (GtkWidget *widget,
|
||||
child = gtk_bin_get_child (GTK_BIN (window));
|
||||
if (child != NULL && gtk_widget_get_visible (child))
|
||||
{
|
||||
GtkAllocation child_allocation = *allocation;
|
||||
gint border_width;
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (window));
|
||||
@@ -753,12 +755,7 @@ gtk_application_window_real_realize (GtkWidget *widget)
|
||||
gtk_application_window_update_shell_shows_app_menu (window, settings);
|
||||
gtk_application_window_update_shell_shows_menubar (window, settings);
|
||||
gtk_application_window_update_menubar (window);
|
||||
|
||||
/* Update the accelerators, and ensure we do again
|
||||
* if the accel map changes */
|
||||
gtk_application_window_update_accels (window);
|
||||
window->priv->accel_map_changed_id = g_signal_connect_swapped (gtk_accel_map_get (), "changed",
|
||||
G_CALLBACK (gtk_application_window_update_accels), window);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_application_window_parent_class)
|
||||
->realize (widget);
|
||||
@@ -796,7 +793,6 @@ gtk_application_window_real_realize (GtkWidget *widget)
|
||||
static void
|
||||
gtk_application_window_real_unrealize (GtkWidget *widget)
|
||||
{
|
||||
GtkApplicationWindow *window = GTK_APPLICATION_WINDOW (widget);
|
||||
GtkSettings *settings;
|
||||
|
||||
settings = gtk_widget_get_settings (widget);
|
||||
@@ -804,8 +800,6 @@ gtk_application_window_real_unrealize (GtkWidget *widget)
|
||||
g_signal_handlers_disconnect_by_func (settings, gtk_application_window_shell_shows_app_menu_changed, widget);
|
||||
g_signal_handlers_disconnect_by_func (settings, gtk_application_window_shell_shows_menubar_changed, widget);
|
||||
|
||||
g_signal_handler_disconnect (gtk_accel_map_get (), window->priv->accel_map_changed_id);
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_application_window_parent_class)
|
||||
->unrealize (widget);
|
||||
}
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@
|
||||
* one of the four cardinal directions (up, down, left, or right). The
|
||||
* style of the arrow can be one of shadow in, shadow out, etched in, or
|
||||
* etched out. Note that these directions and style types may be
|
||||
* ammended in versions of GTK+ to come.
|
||||
* amended in versions of GTK+ to come.
|
||||
*
|
||||
* GtkArrow will fill any space alloted to it, but since it is inherited
|
||||
* from #GtkMisc, it can be padded and/or aligned, to fill exactly the
|
||||
|
||||
+161
-23
@@ -101,6 +101,12 @@ static void gtk_button_box_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_button_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
static void gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
@@ -143,6 +149,7 @@ gtk_button_box_class_init (GtkButtonBoxClass *class)
|
||||
widget_class->get_preferred_height = gtk_button_box_get_preferred_height;
|
||||
widget_class->get_preferred_width_for_height = gtk_button_box_get_preferred_width_for_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_button_box_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_button_box_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->size_allocate = gtk_button_box_size_allocate;
|
||||
|
||||
container_class->remove = gtk_button_box_remove;
|
||||
@@ -438,7 +445,10 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
gint *nvis_children,
|
||||
gint *nvis_secondaries,
|
||||
gint **widths,
|
||||
gint **heights)
|
||||
gint **heights,
|
||||
gint **baselines,
|
||||
gint *baseline,
|
||||
gint *baseline_height)
|
||||
{
|
||||
GtkButtonBox *bbox;
|
||||
GList *children, *list;
|
||||
@@ -446,6 +456,7 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
gint nsecondaries;
|
||||
gint needed_width;
|
||||
gint needed_height;
|
||||
gint needed_above, needed_below;
|
||||
gint avg_w, avg_h;
|
||||
GtkRequisition child_requisition;
|
||||
gint ipad_w;
|
||||
@@ -456,11 +467,15 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
gint ipad_y;
|
||||
gboolean homogeneous;
|
||||
gint i;
|
||||
gint max_above, max_below, child_baseline;
|
||||
GtkOrientation orientation;
|
||||
gboolean have_baseline;
|
||||
|
||||
g_return_if_fail (GTK_IS_BUTTON_BOX (widget));
|
||||
|
||||
bbox = GTK_BUTTON_BOX (widget);
|
||||
|
||||
orientation = gtk_orientable_get_orientation (GTK_ORIENTABLE (widget));
|
||||
homogeneous = gtk_box_get_homogeneous (GTK_BOX (widget));
|
||||
|
||||
gtk_widget_style_get (widget,
|
||||
@@ -475,22 +490,33 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
list = children = _gtk_box_get_children (GTK_BOX (bbox));
|
||||
needed_width = child_min_width;
|
||||
needed_height = child_min_height;
|
||||
needed_above = 0;
|
||||
needed_below = 0;
|
||||
ipad_w = ipad_x * 2;
|
||||
ipad_h = ipad_y * 2;
|
||||
|
||||
have_baseline = FALSE;
|
||||
max_above = max_below = 0;
|
||||
avg_w = avg_h = 0;
|
||||
while (children)
|
||||
for (children = list; children != NULL; children = children->next)
|
||||
{
|
||||
GtkWidget *child;
|
||||
|
||||
child = children->data;
|
||||
children = children->next;
|
||||
|
||||
if (gtk_widget_get_visible (child))
|
||||
{
|
||||
nchildren += 1;
|
||||
gtk_widget_get_preferred_size (child,
|
||||
&child_requisition, NULL);
|
||||
gtk_widget_get_preferred_size_and_baseline (child,
|
||||
&child_requisition, NULL, &child_baseline, NULL);
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
|
||||
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
|
||||
child_baseline != -1)
|
||||
{
|
||||
have_baseline = TRUE;
|
||||
max_above = MAX (max_above, child_baseline + ipad_y);
|
||||
max_below = MAX (max_below , child_requisition.height + ipad_h - (child_baseline + ipad_y));
|
||||
}
|
||||
avg_w += child_requisition.width + ipad_w;
|
||||
avg_h += child_requisition.height + ipad_h;
|
||||
}
|
||||
@@ -498,8 +524,14 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
avg_w /= MAX (nchildren, 1);
|
||||
avg_h /= MAX (nchildren, 1);
|
||||
|
||||
if (baseline)
|
||||
*baseline = have_baseline ? max_above : -1;
|
||||
if (baseline_height)
|
||||
*baseline_height = max_above + max_below;
|
||||
|
||||
*widths = g_new (gint, nchildren);
|
||||
*heights = g_new (gint, nchildren);
|
||||
*baselines = g_new (gint, nchildren);
|
||||
|
||||
i = 0;
|
||||
children = list;
|
||||
@@ -520,7 +552,8 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
if (is_secondary)
|
||||
nsecondaries++;
|
||||
|
||||
gtk_widget_get_preferred_size (child, &child_requisition, NULL);
|
||||
gtk_widget_get_preferred_size_and_baseline (child,
|
||||
&child_requisition, NULL, &child_baseline, NULL);
|
||||
|
||||
if (homogeneous ||
|
||||
(!non_homogeneous && (child_requisition.width + ipad_w < avg_w * 1.5)))
|
||||
@@ -534,16 +567,38 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
(*widths)[i] = child_requisition.width + ipad_w;
|
||||
}
|
||||
|
||||
(*baselines)[i] = -1;
|
||||
|
||||
if (homogeneous ||
|
||||
(!non_homogeneous && (child_requisition.height + ipad_h < avg_h * 1.5)))
|
||||
{
|
||||
(*heights)[i] = -1;
|
||||
if (child_requisition.height + ipad_h > needed_height)
|
||||
needed_height = child_requisition.height + ipad_h;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
|
||||
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
|
||||
child_baseline != -1)
|
||||
{
|
||||
(*baselines)[i] = child_baseline + ipad_y;
|
||||
|
||||
if (child_baseline + ipad_y > needed_above)
|
||||
needed_above = child_baseline + ipad_y;
|
||||
if (child_requisition.height - child_baseline + ipad_y > needed_below)
|
||||
needed_below = child_requisition.height - child_baseline + ipad_y;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (child_requisition.height + ipad_h > needed_height)
|
||||
needed_height = child_requisition.height + ipad_h;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
(*heights)[i] = child_requisition.height + ipad_h;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL &&
|
||||
gtk_widget_get_valign_with_baseline (child) == GTK_ALIGN_BASELINE &&
|
||||
child_baseline != -1)
|
||||
(*baselines)[i] = child_baseline + ipad_y;
|
||||
}
|
||||
|
||||
i++;
|
||||
@@ -552,12 +607,18 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
|
||||
g_list_free (list);
|
||||
|
||||
needed_height = MAX (needed_height, needed_above + needed_below);
|
||||
|
||||
for (i = 0; i < nchildren; i++)
|
||||
{
|
||||
if ((*widths)[i] == -1)
|
||||
(*widths)[i] = needed_width;
|
||||
if ((*heights)[i] == -1)
|
||||
(*heights)[i] = needed_height;
|
||||
{
|
||||
(*heights)[i] = needed_height;
|
||||
if ((*baselines)[i] != -1)
|
||||
(*baselines)[i] = needed_above;
|
||||
}
|
||||
}
|
||||
|
||||
if (nvis_children)
|
||||
@@ -569,19 +630,24 @@ gtk_button_box_child_requisition (GtkWidget *widget,
|
||||
|
||||
static void
|
||||
gtk_button_box_size_request (GtkWidget *widget,
|
||||
GtkRequisition *requisition)
|
||||
GtkRequisition *requisition,
|
||||
gint *baseline)
|
||||
{
|
||||
GtkButtonBoxPrivate *priv;
|
||||
GtkButtonBox *bbox;
|
||||
gint nvis_children;
|
||||
gint max_size;
|
||||
gint max_size, max_above, max_below;
|
||||
gint total_size;
|
||||
gint spacing;
|
||||
GtkOrientation orientation;
|
||||
gint *widths;
|
||||
gint *heights;
|
||||
gint *baselines;
|
||||
gint i;
|
||||
|
||||
if (baseline)
|
||||
*baseline = -1;
|
||||
|
||||
bbox = GTK_BUTTON_BOX (widget);
|
||||
priv = bbox->priv;
|
||||
|
||||
@@ -591,16 +657,22 @@ gtk_button_box_size_request (GtkWidget *widget,
|
||||
gtk_button_box_child_requisition (widget,
|
||||
&nvis_children,
|
||||
NULL,
|
||||
&widths, &heights);
|
||||
&widths, &heights, &baselines, baseline, NULL);
|
||||
|
||||
max_size = 0;
|
||||
max_size = max_above = max_below = 0;
|
||||
total_size = 0;
|
||||
for (i = 0; i < nvis_children; i++)
|
||||
{
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
total_size += widths[i];
|
||||
max_size = MAX (max_size, heights[i]);
|
||||
if (baselines[i] == -1)
|
||||
max_size = MAX (max_size, heights[i]);
|
||||
else
|
||||
{
|
||||
max_above = MAX (max_above, baselines[i]);
|
||||
max_below = MAX (max_below, heights[i] - baselines[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -610,6 +682,23 @@ gtk_button_box_size_request (GtkWidget *widget,
|
||||
}
|
||||
g_free (widths);
|
||||
g_free (heights);
|
||||
g_free (baselines);
|
||||
|
||||
max_size = MAX (max_size, max_above + max_below);
|
||||
|
||||
switch (gtk_box_get_baseline_position (GTK_BOX (widget)))
|
||||
{
|
||||
case GTK_BASELINE_POSITION_TOP:
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_CENTER:
|
||||
if (baseline != NULL && *baseline != -1)
|
||||
*baseline += (max_size - (max_above + max_below)) / 2;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_BOTTOM:
|
||||
if (baseline != NULL && *baseline != -1)
|
||||
*baseline += max_size - (max_above + max_below);
|
||||
break;
|
||||
}
|
||||
|
||||
if (nvis_children == 0)
|
||||
{
|
||||
@@ -656,7 +745,7 @@ gtk_button_box_get_preferred_width (GtkWidget *widget,
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_button_box_size_request (widget, &requisition);
|
||||
gtk_button_box_size_request (widget, &requisition, NULL);
|
||||
|
||||
*minimum = *natural = requisition.width;
|
||||
}
|
||||
@@ -666,11 +755,9 @@ gtk_button_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
|
||||
gtk_button_box_size_request (widget, &requisition);
|
||||
|
||||
*minimum = *natural = requisition.height;
|
||||
gtk_button_box_get_preferred_height_and_baseline_for_width (widget, -1,
|
||||
minimum, natural,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -691,6 +778,26 @@ gtk_button_box_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gtk_button_box_get_preferred_height (widget, minimum, natural);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
gint baseline;
|
||||
|
||||
gtk_button_box_size_request (widget, &requisition, &baseline);
|
||||
|
||||
*minimum = *natural = requisition.height;
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = baseline;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
@@ -714,10 +821,13 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
gint ipad_x, ipad_y;
|
||||
gint *widths;
|
||||
gint *heights;
|
||||
gint *baselines;
|
||||
gint *sizes;
|
||||
gint primary_size;
|
||||
gint secondary_size;
|
||||
gint total_size;
|
||||
gint baseline, baseline_height;
|
||||
gint child_baseline, allocated_baseline;
|
||||
gint i;
|
||||
|
||||
bbox = GTK_BUTTON_BOX (widget);
|
||||
@@ -733,7 +843,27 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
gtk_button_box_child_requisition (widget,
|
||||
&nvis_children,
|
||||
&n_secondaries,
|
||||
&widths, &heights);
|
||||
&widths, &heights, &baselines, &baseline, &baseline_height);
|
||||
|
||||
allocated_baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (allocated_baseline != -1)
|
||||
baseline = allocated_baseline;
|
||||
else if (baseline != -1)
|
||||
{
|
||||
/* TODO: modify baseline based on baseline_pos && allocated_baseline*/
|
||||
switch (gtk_box_get_baseline_position (GTK_BOX (widget)))
|
||||
{
|
||||
case GTK_BASELINE_POSITION_TOP:
|
||||
baseline = baseline;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_CENTER:
|
||||
baseline = baseline + (allocation->height - baseline_height) / 2;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_BOTTOM:
|
||||
baseline = allocation->height - (baseline_height - baseline);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
n_primaries = nvis_children - n_secondaries;
|
||||
primary_size = 0;
|
||||
@@ -917,10 +1047,17 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
child_allocation.width = widths[i];
|
||||
child_allocation.height = heights[i];
|
||||
child_baseline = -1;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
child_allocation.y = allocation->y + (allocation->height - child_allocation.height) / 2;
|
||||
if (baselines[i] != -1)
|
||||
{
|
||||
child_allocation.y = allocation->y + baseline - baselines[i];
|
||||
child_baseline = baselines[i];
|
||||
}
|
||||
else
|
||||
child_allocation.y = allocation->y + (allocation->height - child_allocation.height) / 2;
|
||||
|
||||
if (gtk_button_box_get_child_secondary (bbox, child))
|
||||
{
|
||||
@@ -953,7 +1090,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
gtk_widget_size_allocate_with_baseline (child, &child_allocation, child_baseline);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@@ -961,6 +1098,7 @@ gtk_button_box_size_allocate (GtkWidget *widget,
|
||||
g_list_free (list);
|
||||
g_free (widths);
|
||||
g_free (heights);
|
||||
g_free (baselines);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+20
-58
@@ -189,44 +189,6 @@ gtk_bin_get_effective_border_width (GtkBin *bin)
|
||||
return gtk_container_get_border_width (GTK_CONTAINER (bin));
|
||||
}
|
||||
|
||||
/* 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)
|
||||
{
|
||||
GtkBinPrivate *priv = bin->priv;
|
||||
gint hmin, vmin, hnat, vnat, child_hmin, child_vmin;
|
||||
|
||||
/* 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);
|
||||
|
||||
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);
|
||||
|
||||
gtk_widget_get_preferred_width (priv->child, &child_hmin, NULL);
|
||||
gtk_widget_get_preferred_height (priv->child, &child_vmin, NULL);
|
||||
|
||||
*delta_h = hmin - child_hmin;
|
||||
*delta_v = vmin - child_vmin;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_bin_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_width,
|
||||
@@ -287,25 +249,25 @@ 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;
|
||||
|
||||
*minimum_width = 0;
|
||||
*natural_width = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
*minimum_width += 2 * border_width;
|
||||
*natural_width += 2 * border_width;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -316,25 +278,25 @@ 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;
|
||||
|
||||
*minimum_height = 0;
|
||||
*natural_height = 0;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
*minimum_height += 2 * border_width;
|
||||
*natural_height += 2 * border_width;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+332
-50
@@ -94,7 +94,8 @@ enum {
|
||||
PROP_0,
|
||||
PROP_ORIENTATION,
|
||||
PROP_SPACING,
|
||||
PROP_HOMOGENEOUS
|
||||
PROP_HOMOGENEOUS,
|
||||
PROP_BASELINE_POSITION
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -116,6 +117,7 @@ struct _GtkBoxPrivate
|
||||
guint default_expand : 1;
|
||||
guint homogeneous : 1;
|
||||
guint spacing_set : 1;
|
||||
guint baseline_pos : 2;
|
||||
};
|
||||
|
||||
typedef struct _GtkBoxChild GtkBoxChild;
|
||||
@@ -200,6 +202,12 @@ static void gtk_box_get_preferred_height_for_width (GtkWidget
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkBox, gtk_box, GTK_TYPE_CONTAINER,
|
||||
@@ -220,6 +228,7 @@ gtk_box_class_init (GtkBoxClass *class)
|
||||
widget_class->get_preferred_width = gtk_box_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_box_get_preferred_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_box_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_box_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->get_preferred_width_for_height = gtk_box_get_preferred_width_for_height;
|
||||
widget_class->compute_expand = gtk_box_compute_expand;
|
||||
widget_class->direction_changed = gtk_box_direction_changed;
|
||||
@@ -255,6 +264,15 @@ gtk_box_class_init (GtkBoxClass *class)
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_BASELINE_POSITION,
|
||||
g_param_spec_enum ("baseline-position",
|
||||
P_("Baseline position"),
|
||||
P_("The position of the baseline aligned widgets if extra space is availible"),
|
||||
GTK_TYPE_BASELINE_POSITION,
|
||||
GTK_BASELINE_POSITION_CENTER,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkBox:expand:
|
||||
*
|
||||
@@ -340,6 +358,7 @@ gtk_box_init (GtkBox *box)
|
||||
private->homogeneous = FALSE;
|
||||
private->spacing = 0;
|
||||
private->spacing_set = FALSE;
|
||||
private->baseline_pos = GTK_BASELINE_POSITION_CENTER;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -361,6 +380,9 @@ gtk_box_set_property (GObject *object,
|
||||
case PROP_SPACING:
|
||||
gtk_box_set_spacing (box, g_value_get_int (value));
|
||||
break;
|
||||
case PROP_BASELINE_POSITION:
|
||||
gtk_box_set_baseline_position (box, g_value_get_enum (value));
|
||||
break;
|
||||
case PROP_HOMOGENEOUS:
|
||||
gtk_box_set_homogeneous (box, g_value_get_boolean (value));
|
||||
break;
|
||||
@@ -387,6 +409,9 @@ gtk_box_get_property (GObject *object,
|
||||
case PROP_SPACING:
|
||||
g_value_set_int (value, private->spacing);
|
||||
break;
|
||||
case PROP_BASELINE_POSITION:
|
||||
g_value_set_enum (value, private->baseline_pos);
|
||||
break;
|
||||
case PROP_HOMOGENEOUS:
|
||||
g_value_set_boolean (value, private->homogeneous);
|
||||
break;
|
||||
@@ -435,6 +460,11 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
GtkTextDirection direction;
|
||||
GtkAllocation child_allocation;
|
||||
GtkRequestedSize *sizes;
|
||||
gint child_minimum_baseline, child_natural_baseline;
|
||||
gint minimum_above, natural_above;
|
||||
gint minimum_below, natural_below;
|
||||
gboolean have_baseline;
|
||||
gint baseline;
|
||||
|
||||
GtkPackType packing;
|
||||
|
||||
@@ -461,6 +491,10 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
else
|
||||
size = allocation->height - (nvis_children - 1) * private->spacing;
|
||||
|
||||
have_baseline = FALSE;
|
||||
minimum_above = natural_above = 0;
|
||||
minimum_below = natural_below = 0;
|
||||
|
||||
/* Retrieve desired size for visible children. */
|
||||
for (i = 0, children = private->children; children; children = children->next)
|
||||
{
|
||||
@@ -475,11 +509,11 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
&sizes[i].minimum_size,
|
||||
&sizes[i].natural_size);
|
||||
else
|
||||
gtk_widget_get_preferred_height_for_width (child->widget,
|
||||
allocation->width,
|
||||
&sizes[i].minimum_size,
|
||||
&sizes[i].natural_size);
|
||||
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
|
||||
allocation->width,
|
||||
&sizes[i].minimum_size,
|
||||
&sizes[i].natural_size,
|
||||
NULL, NULL);
|
||||
|
||||
/* Assert the api is working properly */
|
||||
if (sizes[i].minimum_size < 0)
|
||||
@@ -537,28 +571,9 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
extra = 0;
|
||||
}
|
||||
|
||||
/* Allocate child positions. */
|
||||
/* Allocate child sizes. */
|
||||
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
|
||||
{
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
child_allocation.y = allocation->y;
|
||||
child_allocation.height = MAX (1, allocation->height);
|
||||
if (packing == GTK_PACK_START)
|
||||
x = allocation->x;
|
||||
else
|
||||
x = allocation->x + allocation->width;
|
||||
}
|
||||
else
|
||||
{
|
||||
child_allocation.x = allocation->x;
|
||||
child_allocation.width = MAX (1, allocation->width);
|
||||
if (packing == GTK_PACK_START)
|
||||
y = allocation->y;
|
||||
else
|
||||
y = allocation->y + allocation->height;
|
||||
}
|
||||
|
||||
for (i = 0, children = private->children;
|
||||
children;
|
||||
children = children->next)
|
||||
@@ -605,6 +620,105 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
sizes[i].natural_size = child_size;
|
||||
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL &&
|
||||
gtk_widget_get_valign_with_baseline (child->widget) == GTK_ALIGN_BASELINE)
|
||||
{
|
||||
int child_allocation_width;
|
||||
int child_minimum_height, child_natural_height;
|
||||
|
||||
if (child->fill)
|
||||
child_allocation_width = MAX (1, child_size - child->padding * 2);
|
||||
else
|
||||
child_allocation_width = sizes[i].minimum_size;
|
||||
|
||||
child_minimum_baseline = -1;
|
||||
child_natural_baseline = -1;
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child->widget,
|
||||
child_allocation_width,
|
||||
&child_minimum_height, &child_natural_height,
|
||||
&child_minimum_baseline, &child_natural_baseline);
|
||||
|
||||
if (child_minimum_baseline >= 0)
|
||||
{
|
||||
have_baseline = TRUE;
|
||||
minimum_below = MAX (minimum_below, child_minimum_height - child_minimum_baseline);
|
||||
natural_below = MAX (natural_below, child_natural_height - child_natural_baseline);
|
||||
minimum_above = MAX (minimum_above, child_minimum_baseline);
|
||||
natural_above = MAX (natural_above, child_natural_baseline);
|
||||
}
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline == -1 && have_baseline)
|
||||
{
|
||||
gint height = MAX (1, allocation->height);
|
||||
|
||||
/* TODO: This is purely based on the minimum baseline, when things fit we should
|
||||
use the natural one? */
|
||||
|
||||
switch (private->baseline_pos)
|
||||
{
|
||||
case GTK_BASELINE_POSITION_TOP:
|
||||
baseline = minimum_above;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_CENTER:
|
||||
baseline = minimum_above + (height - (minimum_above + minimum_below)) / 2;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_BOTTOM:
|
||||
baseline = height - minimum_below;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Allocate child positions. */
|
||||
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
|
||||
{
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
child_allocation.y = allocation->y;
|
||||
child_allocation.height = MAX (1, allocation->height);
|
||||
if (packing == GTK_PACK_START)
|
||||
x = allocation->x;
|
||||
else
|
||||
x = allocation->x + allocation->width;
|
||||
}
|
||||
else
|
||||
{
|
||||
child_allocation.x = allocation->x;
|
||||
child_allocation.width = MAX (1, allocation->width);
|
||||
if (packing == GTK_PACK_START)
|
||||
y = allocation->y;
|
||||
else
|
||||
y = allocation->y + allocation->height;
|
||||
}
|
||||
|
||||
for (i = 0, children = private->children;
|
||||
children;
|
||||
children = children->next)
|
||||
{
|
||||
child = children->data;
|
||||
|
||||
/* If widget is not visible, skip it. */
|
||||
if (!gtk_widget_get_visible (child->widget))
|
||||
continue;
|
||||
|
||||
/* If widget is packed differently skip it, but still increment i,
|
||||
* since widget is visible and will be handled in next loop iteration.
|
||||
*/
|
||||
if (child->pack != packing)
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
child_size = sizes[i].natural_size;
|
||||
|
||||
/* Assign the child's position. */
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
@@ -658,7 +772,7 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
child_allocation.y -= child_size;
|
||||
}
|
||||
}
|
||||
gtk_widget_size_allocate (child->widget, &child_allocation);
|
||||
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -1015,18 +1129,28 @@ static void
|
||||
gtk_box_get_size (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBox *box;
|
||||
GtkBoxPrivate *private;
|
||||
GList *children;
|
||||
gint nvis_children;
|
||||
gint minimum, natural;
|
||||
gint minimum_above, natural_above;
|
||||
gint minimum_below, natural_below;
|
||||
gboolean have_baseline;
|
||||
gint min_baseline, nat_baseline;
|
||||
|
||||
box = GTK_BOX (widget);
|
||||
private = box->priv;
|
||||
|
||||
have_baseline = FALSE;
|
||||
minimum = natural = 0;
|
||||
minimum_above = natural_above = 0;
|
||||
minimum_below = natural_below = 0;
|
||||
min_baseline = nat_baseline = -1;
|
||||
|
||||
nvis_children = 0;
|
||||
|
||||
@@ -1037,13 +1161,15 @@ gtk_box_get_size (GtkWidget *widget,
|
||||
if (gtk_widget_get_visible (child->widget))
|
||||
{
|
||||
gint child_minimum, child_natural;
|
||||
gint child_minimum_baseline = -1, child_natural_baseline = -1;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_widget_get_preferred_width (child->widget,
|
||||
&child_minimum, &child_natural);
|
||||
else
|
||||
gtk_widget_get_preferred_height (child->widget,
|
||||
&child_minimum, &child_natural);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child->widget, -1,
|
||||
&child_minimum, &child_natural,
|
||||
&child_minimum_baseline, &child_natural_baseline);
|
||||
|
||||
if (private->orientation == orientation)
|
||||
{
|
||||
@@ -1065,9 +1191,20 @@ gtk_box_get_size (GtkWidget *widget,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The biggest mins and naturals in the opposing orientation */
|
||||
minimum = MAX (minimum, child_minimum);
|
||||
natural = MAX (natural, child_natural);
|
||||
if (child_minimum_baseline >= 0)
|
||||
{
|
||||
have_baseline = TRUE;
|
||||
minimum_below = MAX (minimum_below, child_minimum - child_minimum_baseline);
|
||||
natural_below = MAX (natural_below, child_natural - child_natural_baseline);
|
||||
minimum_above = MAX (minimum_above, child_minimum_baseline);
|
||||
natural_above = MAX (natural_above, child_natural_baseline);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The biggest mins and naturals in the opposing orientation */
|
||||
minimum = MAX (minimum, child_minimum);
|
||||
natural = MAX (natural, child_natural);
|
||||
}
|
||||
}
|
||||
|
||||
nvis_children += 1;
|
||||
@@ -1085,11 +1222,39 @@ gtk_box_get_size (GtkWidget *widget,
|
||||
natural += (nvis_children - 1) * private->spacing;
|
||||
}
|
||||
|
||||
minimum = MAX (minimum, minimum_below + minimum_above);
|
||||
natural = MAX (natural, natural_below + natural_above);
|
||||
|
||||
if (have_baseline)
|
||||
{
|
||||
switch (private->baseline_pos)
|
||||
{
|
||||
case GTK_BASELINE_POSITION_TOP:
|
||||
min_baseline = minimum_above;
|
||||
nat_baseline = natural_above;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_CENTER:
|
||||
min_baseline = minimum_above + (minimum - (minimum_above + minimum_below)) / 2;
|
||||
nat_baseline = natural_above + (natural - (natural_above + natural_below)) / 2;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_BOTTOM:
|
||||
min_baseline = minimum - minimum_below;
|
||||
nat_baseline = natural - natural_below;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = minimum;
|
||||
|
||||
if (natural_size)
|
||||
*natural_size = natural;
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = min_baseline;
|
||||
|
||||
if (natural_baseline)
|
||||
*natural_baseline = nat_baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1097,7 +1262,7 @@ gtk_box_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1105,14 +1270,16 @@ gtk_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
gint avail_size,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
GtkBoxChild *child;
|
||||
@@ -1120,11 +1287,16 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
gint nvis_children;
|
||||
gint nexpand_children;
|
||||
gint computed_minimum = 0, computed_natural = 0;
|
||||
gint computed_minimum_above = 0, computed_natural_above = 0;
|
||||
gint computed_minimum_below = 0, computed_natural_below = 0;
|
||||
gint computed_minimum_baseline = -1, computed_natural_baseline = -1;
|
||||
GtkRequestedSize *sizes;
|
||||
GtkPackType packing;
|
||||
gint size, extra, i;
|
||||
gint child_size, child_minimum, child_natural;
|
||||
gint child_minimum_baseline, child_natural_baseline;
|
||||
gint n_extra_widgets = 0;
|
||||
gboolean have_baseline;
|
||||
|
||||
count_expand_children (box, &nvis_children, &nexpand_children);
|
||||
|
||||
@@ -1199,6 +1371,7 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
extra = 0;
|
||||
}
|
||||
|
||||
have_baseline = FALSE;
|
||||
/* Allocate child positions. */
|
||||
for (packing = GTK_PACK_START; packing <= GTK_PACK_END; ++packing)
|
||||
{
|
||||
@@ -1260,26 +1433,64 @@ gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
}
|
||||
|
||||
|
||||
child_minimum_baseline = child_natural_baseline = -1;
|
||||
/* Assign the child's position. */
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_widget_get_preferred_height_for_width (child->widget,
|
||||
child_size, &child_minimum, &child_natural);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child->widget, child_size,
|
||||
&child_minimum, &child_natural,
|
||||
&child_minimum_baseline, &child_natural_baseline);
|
||||
else /* (private->orientation == GTK_ORIENTATION_VERTICAL) */
|
||||
gtk_widget_get_preferred_width_for_height (child->widget,
|
||||
child_size, &child_minimum, &child_natural);
|
||||
|
||||
|
||||
computed_minimum = MAX (computed_minimum, child_minimum);
|
||||
computed_natural = MAX (computed_natural, child_natural);
|
||||
if (child_minimum_baseline >= 0)
|
||||
{
|
||||
have_baseline = TRUE;
|
||||
computed_minimum_below = MAX (computed_minimum_below, child_minimum - child_minimum_baseline);
|
||||
computed_natural_below = MAX (computed_natural_below, child_natural - child_natural_baseline);
|
||||
computed_minimum_above = MAX (computed_minimum_above, child_minimum_baseline);
|
||||
computed_natural_above = MAX (computed_natural_above, child_natural_baseline);
|
||||
}
|
||||
else
|
||||
{
|
||||
computed_minimum = MAX (computed_minimum, child_minimum);
|
||||
computed_natural = MAX (computed_natural, child_natural);
|
||||
}
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (have_baseline)
|
||||
{
|
||||
computed_minimum = MAX (computed_minimum, computed_minimum_below + computed_minimum_above);
|
||||
computed_natural = MAX (computed_natural, computed_natural_below + computed_natural_above);
|
||||
switch (private->baseline_pos)
|
||||
{
|
||||
case GTK_BASELINE_POSITION_TOP:
|
||||
computed_minimum_baseline = computed_minimum_above;
|
||||
computed_natural_baseline = computed_natural_above;
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_CENTER:
|
||||
computed_minimum_baseline = computed_minimum_above + MAX((computed_minimum - (computed_minimum_above + computed_minimum_below)) / 2, 0);
|
||||
computed_natural_baseline = computed_natural_above + MAX((computed_natural - (computed_natural_above + computed_natural_below)) / 2, 0);
|
||||
break;
|
||||
case GTK_BASELINE_POSITION_BOTTOM:
|
||||
computed_minimum_baseline = computed_minimum - computed_minimum_below;
|
||||
computed_natural_baseline = computed_natural - computed_natural_below;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = computed_minimum_baseline;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = computed_natural_baseline;
|
||||
|
||||
if (minimum_size)
|
||||
*minimum_size = computed_minimum;
|
||||
if (natural_size)
|
||||
*natural_size = computed_natural;
|
||||
*natural_size = MAX (computed_natural, computed_natural_below + computed_natural_above);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1355,24 +1566,46 @@ gtk_box_get_preferred_width_for_height (GtkWidget *widget,
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (private->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width);
|
||||
gtk_box_compute_size_for_opposing_orientation (box, height, minimum_width, natural_width, NULL, NULL);
|
||||
else
|
||||
gtk_box_compute_size_for_orientation (box, height, minimum_width, natural_width);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (width < 0)
|
||||
gtk_box_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_height, natural_height, minimum_baseline, natural_baseline);
|
||||
else
|
||||
{
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height, minimum_baseline, natural_baseline);
|
||||
else
|
||||
{
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (private->orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_box_compute_size_for_opposing_orientation (box, width, minimum_height, natural_height);
|
||||
else
|
||||
gtk_box_compute_size_for_orientation (box, width, minimum_height, natural_height);
|
||||
gtk_box_get_preferred_height_and_baseline_for_width (widget, width, minimum_height, natural_height, NULL, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1550,6 +1783,55 @@ gtk_box_get_spacing (GtkBox *box)
|
||||
return box->priv->spacing;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_box_set_baseline_position:
|
||||
* @box: a #GtkBox
|
||||
* @position: a #GtkBaselinePosition
|
||||
*
|
||||
* Sets the baseline position of a box. This affects
|
||||
* only horizontal boxes with at least one baseline aligned
|
||||
* child. If there is more vertical space availible than requested,
|
||||
* and the baseline is not allocated by the parent then
|
||||
* @position is used to allocate the baseline wrt the
|
||||
* extra space available.
|
||||
*/
|
||||
void
|
||||
gtk_box_set_baseline_position (GtkBox *box,
|
||||
GtkBaselinePosition position)
|
||||
{
|
||||
GtkBoxPrivate *private;
|
||||
|
||||
g_return_if_fail (GTK_IS_BOX (box));
|
||||
|
||||
private = box->priv;
|
||||
|
||||
if (position != private->baseline_pos)
|
||||
{
|
||||
private->baseline_pos = position;
|
||||
|
||||
g_object_notify (G_OBJECT (box), "baseline-position");
|
||||
|
||||
gtk_widget_queue_resize (GTK_WIDGET (box));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_box_get_baseline_position:
|
||||
* @box: a #GtkBox
|
||||
*
|
||||
* Gets the value set by gtk_box_set_baseline_position().
|
||||
*
|
||||
* Return value: the baseline position
|
||||
**/
|
||||
GtkBaselinePosition
|
||||
gtk_box_get_baseline_position (GtkBox *box)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_BOX (box), GTK_BASELINE_POSITION_CENTER);
|
||||
|
||||
return box->priv->baseline_pos;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
_gtk_box_set_spacing_set (GtkBox *box,
|
||||
gboolean spacing_set)
|
||||
|
||||
@@ -89,6 +89,11 @@ gboolean gtk_box_get_homogeneous (GtkBox *box);
|
||||
void gtk_box_set_spacing (GtkBox *box,
|
||||
gint spacing);
|
||||
gint gtk_box_get_spacing (GtkBox *box);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_box_set_baseline_position (GtkBox *box,
|
||||
GtkBaselinePosition position);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GtkBaselinePosition gtk_box_get_baseline_position (GtkBox *box);
|
||||
|
||||
void gtk_box_reorder_child (GtkBox *box,
|
||||
GtkWidget *child,
|
||||
|
||||
@@ -1355,6 +1355,12 @@ gtk_builder_get_translation_domain (GtkBuilder *builder)
|
||||
*
|
||||
* Add @object to the @builder object pool so it can be referenced just like any
|
||||
* other object built by builder.
|
||||
*
|
||||
* To make this function even more useful a new special entry point element
|
||||
* <external-object> is defined. It is similar to <object> but has
|
||||
* to reference an external object exposed with this function.
|
||||
* This way you can change properties and even add children to an
|
||||
* external object using builder, not just reference it.
|
||||
*
|
||||
* Since: 3.8
|
||||
**/
|
||||
|
||||
+57
-7
@@ -170,6 +170,12 @@ static void gtk_button_get_preferred_width (GtkWidget *widget,
|
||||
static void gtk_button_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_button_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_size,
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
static guint button_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -196,6 +202,7 @@ gtk_button_class_init (GtkButtonClass *klass)
|
||||
|
||||
widget_class->get_preferred_width = gtk_button_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_button_get_preferred_height;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_button_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->destroy = gtk_button_destroy;
|
||||
widget_class->screen_changed = gtk_button_screen_changed;
|
||||
widget_class->realize = gtk_button_realize;
|
||||
@@ -1150,11 +1157,16 @@ gtk_button_construct_child (GtkButton *button)
|
||||
else
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, image_spacing);
|
||||
|
||||
gtk_widget_set_valign (image, GTK_ALIGN_BASELINE);
|
||||
gtk_widget_set_valign (box, GTK_ALIGN_BASELINE);
|
||||
|
||||
if (priv->align_set)
|
||||
align = gtk_alignment_new (priv->xalign, priv->yalign, 0.0, 0.0);
|
||||
else
|
||||
align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
|
||||
|
||||
gtk_widget_set_valign (align, GTK_ALIGN_BASELINE);
|
||||
|
||||
if (priv->image_position == GTK_POS_LEFT ||
|
||||
priv->image_position == GTK_POS_TOP)
|
||||
gtk_box_pack_start (GTK_BOX (box), priv->image, FALSE, FALSE, 0);
|
||||
@@ -1172,6 +1184,8 @@ gtk_button_construct_child (GtkButton *button)
|
||||
else
|
||||
label = gtk_label_new (label_text);
|
||||
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
||||
|
||||
if (priv->image_position == GTK_POS_RIGHT ||
|
||||
priv->image_position == GTK_POS_BOTTOM)
|
||||
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
|
||||
@@ -1196,6 +1210,8 @@ gtk_button_construct_child (GtkButton *button)
|
||||
else
|
||||
label = gtk_label_new (priv->label_text);
|
||||
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_BASELINE);
|
||||
|
||||
if (priv->align_set)
|
||||
gtk_misc_set_alignment (GTK_MISC (label), priv->xalign, priv->yalign);
|
||||
|
||||
@@ -1584,6 +1600,7 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
GtkBorder border;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint baseline;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
@@ -1635,6 +1652,10 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
child_allocation.height = child_allocation.height - (focus_width + focus_pad) * 2;
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline != -1)
|
||||
baseline -= child_allocation.y - allocation->y;
|
||||
|
||||
if (priv->depressed)
|
||||
{
|
||||
gint child_displacement_x;
|
||||
@@ -1651,7 +1672,7 @@ gtk_button_size_allocate (GtkWidget *widget,
|
||||
child_allocation.width = MAX (1, child_allocation.width);
|
||||
child_allocation.height = MAX (1, child_allocation.height);
|
||||
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2063,7 +2084,9 @@ static void
|
||||
gtk_button_get_size (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkButton *button = GTK_BUTTON (widget);
|
||||
GtkStyleContext *context;
|
||||
@@ -2074,6 +2097,7 @@ gtk_button_get_size (GtkWidget *widget,
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint minimum, natural;
|
||||
gint top_offset;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
@@ -2084,6 +2108,8 @@ gtk_button_get_size (GtkWidget *widget,
|
||||
"focus-padding", &focus_pad,
|
||||
NULL);
|
||||
|
||||
top_offset = 0;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
minimum = padding.left + padding.right +
|
||||
@@ -2097,9 +2123,14 @@ gtk_button_get_size (GtkWidget *widget,
|
||||
minimum = padding.top + padding.bottom +
|
||||
border.top + border.bottom;
|
||||
|
||||
top_offset = padding.top + border.top + focus_width + focus_pad;
|
||||
|
||||
if (gtk_widget_get_can_default (GTK_WIDGET (widget)))
|
||||
minimum += default_border.top + default_border.bottom;
|
||||
}
|
||||
{
|
||||
minimum += default_border.top + default_border.bottom;
|
||||
top_offset += default_border.top;
|
||||
}
|
||||
}
|
||||
|
||||
minimum += 2 * (focus_width + focus_pad);
|
||||
natural = minimum;
|
||||
@@ -2108,11 +2139,17 @@ gtk_button_get_size (GtkWidget *widget,
|
||||
gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gint child_min_baseline = -1, child_nat_baseline = -1;
|
||||
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
gtk_widget_get_preferred_width (child, &child_min, &child_nat);
|
||||
else
|
||||
gtk_widget_get_preferred_height (child, &child_min, &child_nat);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child, -1, &child_min, &child_nat, &child_min_baseline, &child_nat_baseline);
|
||||
|
||||
if (minimum_baseline && child_min_baseline >= 0)
|
||||
*minimum_baseline = child_min_baseline + top_offset;
|
||||
if (natural_baseline && child_nat_baseline >= 0)
|
||||
*natural_baseline = child_nat_baseline + top_offset;
|
||||
|
||||
minimum += child_min;
|
||||
natural += child_nat;
|
||||
@@ -2130,7 +2167,7 @@ gtk_button_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_button_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
gtk_button_get_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -2138,7 +2175,20 @@ gtk_button_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_button_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
gtk_button_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_button_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_size,
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
/* GtkButton is GTK_SIZE_REQUEST_CONSTANT mode, so width will be -1 all the time */
|
||||
g_assert (width == -1);
|
||||
gtk_button_get_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,6 +39,9 @@ struct _GtkButtonPrivate
|
||||
gfloat xalign;
|
||||
gfloat yalign;
|
||||
|
||||
/* This is only used by checkbox and subclasses */
|
||||
gfloat baseline_align;
|
||||
|
||||
guint activate_timeout;
|
||||
guint32 grab_time;
|
||||
|
||||
|
||||
+1
-1
@@ -3440,7 +3440,7 @@ gtk_cell_area_activate_cell (GtkCellArea *area,
|
||||
/* If the signal was successfully handled start the editing */
|
||||
if (gtk_widget_get_parent (GTK_WIDGET (editable_widget)))
|
||||
{
|
||||
gtk_cell_editable_start_editing (editable_widget, event);
|
||||
gtk_cell_editable_start_editing (editable_widget, NULL);
|
||||
gtk_widget_grab_focus (GTK_WIDGET (editable_widget));
|
||||
}
|
||||
else
|
||||
|
||||
+69
-7
@@ -58,6 +58,12 @@ static void gtk_check_button_get_preferred_width (GtkWidget *widget,
|
||||
static void gtk_check_button_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_check_button_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
static void gtk_check_button_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_check_button_draw (GtkWidget *widget,
|
||||
@@ -80,6 +86,7 @@ gtk_check_button_class_init (GtkCheckButtonClass *class)
|
||||
|
||||
widget_class->get_preferred_width = gtk_check_button_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_check_button_get_preferred_height;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_check_button_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->size_allocate = gtk_check_button_size_allocate;
|
||||
widget_class->draw = gtk_check_button_draw;
|
||||
|
||||
@@ -287,9 +294,12 @@ gtk_check_button_get_preferred_width (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_button_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
gtk_check_button_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (widget);
|
||||
|
||||
@@ -301,6 +311,7 @@ gtk_check_button_get_preferred_height (GtkWidget *widget,
|
||||
gint indicator_spacing;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint old_minimum, old_natural;
|
||||
guint border_width;
|
||||
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
@@ -320,29 +331,61 @@ gtk_check_button_get_preferred_height (GtkWidget *widget,
|
||||
if (child && gtk_widget_get_visible (child))
|
||||
{
|
||||
gint child_min, child_nat;
|
||||
gint child_min_baseline = -1, child_nat_baseline = -1;
|
||||
|
||||
gtk_widget_get_preferred_height (child, &child_min, &child_nat);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child, -1,
|
||||
&child_min, &child_nat,
|
||||
&child_min_baseline, &child_nat_baseline);
|
||||
|
||||
if (minimum_baseline && child_min_baseline >= 0)
|
||||
*minimum_baseline = child_min_baseline + border_width;
|
||||
if (natural_baseline && child_nat_baseline >= 0)
|
||||
*natural_baseline = child_nat_baseline + border_width;
|
||||
|
||||
*minimum += child_min;
|
||||
*natural += child_nat;
|
||||
|
||||
}
|
||||
|
||||
old_minimum = *minimum;
|
||||
old_natural = *natural;
|
||||
|
||||
temp = indicator_size + indicator_spacing * 2;
|
||||
*minimum = MAX (*minimum, temp) + 2 * (focus_width + focus_pad);
|
||||
*natural = MAX (*natural, temp) + 2 * (focus_width + focus_pad);
|
||||
|
||||
if (minimum_baseline && *minimum_baseline != -1)
|
||||
minimum_baseline += (*minimum - old_minimum) / 2;
|
||||
if (natural_baseline && *natural_baseline != -1)
|
||||
natural_baseline += (*natural - old_natural) / 2;
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_CLASS (gtk_check_button_parent_class)->get_preferred_height (widget, minimum, natural);
|
||||
GTK_WIDGET_CLASS (gtk_check_button_parent_class)->get_preferred_height_and_baseline_for_width (widget, width,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_button_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
gtk_check_button_get_preferred_height_and_baseline_for_width (widget, -1,
|
||||
minimum, natural,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_check_button_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
PangoContext *pango_context;
|
||||
PangoFontMetrics *metrics;
|
||||
GtkCheckButton *check_button;
|
||||
GtkToggleButton *toggle_button;
|
||||
GtkButton *button;
|
||||
GtkAllocation child_allocation;
|
||||
gint baseline;
|
||||
|
||||
button = GTK_BUTTON (widget);
|
||||
check_button = GTK_CHECK_BUTTON (widget);
|
||||
@@ -389,8 +432,21 @@ gtk_check_button_size_allocate (GtkWidget *widget,
|
||||
child_allocation.x = allocation->x + allocation->width
|
||||
- (child_allocation.x - allocation->x + child_allocation.width);
|
||||
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline != -1)
|
||||
baseline -= child_allocation.y - allocation->y;
|
||||
gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
|
||||
}
|
||||
|
||||
pango_context = gtk_widget_get_pango_context (widget);
|
||||
metrics = pango_context_get_metrics (pango_context,
|
||||
pango_context_get_font_description (pango_context),
|
||||
pango_context_get_language (pango_context));
|
||||
button->priv->baseline_align =
|
||||
(double)pango_font_metrics_get_ascent (metrics) /
|
||||
(pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
|
||||
pango_font_metrics_unref (metrics);
|
||||
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_CLASS (gtk_check_button_parent_class)->size_allocate (widget, allocation);
|
||||
@@ -448,6 +504,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
|
||||
gint indicator_spacing;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint baseline;
|
||||
guint border_width;
|
||||
gboolean interior_focus;
|
||||
GtkAllocation allocation;
|
||||
@@ -458,6 +515,7 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
|
||||
toggle_button = GTK_TOGGLE_BUTTON (check_button);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
state = gtk_widget_get_state_flags (widget);
|
||||
|
||||
@@ -472,7 +530,11 @@ gtk_real_check_button_draw_indicator (GtkCheckButton *check_button,
|
||||
border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
|
||||
|
||||
x = indicator_spacing + border_width;
|
||||
y = (allocation.height - indicator_size) / 2;
|
||||
if (baseline == -1)
|
||||
y = (allocation.height - indicator_size) / 2;
|
||||
else
|
||||
y = CLAMP (baseline - indicator_size * button->priv->baseline_align,
|
||||
0, allocation.height - indicator_size);
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (check_button));
|
||||
if (!interior_focus || !(child && gtk_widget_get_visible (child)))
|
||||
|
||||
+28
-21
@@ -53,6 +53,7 @@
|
||||
struct _GtkCheckMenuItemPrivate
|
||||
{
|
||||
guint active : 1;
|
||||
guint always_show_toggle : 1;
|
||||
guint draw_as_radio : 1;
|
||||
guint inconsistent : 1;
|
||||
};
|
||||
@@ -466,6 +467,7 @@ gtk_check_menu_item_init (GtkCheckMenuItem *check_menu_item)
|
||||
priv = check_menu_item->priv;
|
||||
|
||||
priv->active = FALSE;
|
||||
priv->always_show_toggle = TRUE;
|
||||
}
|
||||
|
||||
static gint
|
||||
@@ -554,29 +556,34 @@ gtk_real_check_menu_item_draw_indicator (GtkCheckMenuItem *check_menu_item,
|
||||
|
||||
y = (allocation.height - indicator_size) / 2;
|
||||
|
||||
gtk_style_context_save (context);
|
||||
|
||||
if (priv->inconsistent)
|
||||
state |= GTK_STATE_FLAG_INCONSISTENT;
|
||||
else if (priv->active)
|
||||
state |= GTK_STATE_FLAG_ACTIVE;
|
||||
|
||||
gtk_style_context_set_state (context, state);
|
||||
|
||||
if (priv->draw_as_radio)
|
||||
if (priv->active ||
|
||||
priv->always_show_toggle ||
|
||||
(state & GTK_STATE_FLAG_PRELIGHT))
|
||||
{
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RADIO);
|
||||
gtk_render_option (context, cr, x, y,
|
||||
indicator_size, indicator_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
|
||||
gtk_render_check (context, cr, x, y,
|
||||
indicator_size, indicator_size);
|
||||
}
|
||||
gtk_style_context_save (context);
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
if (priv->inconsistent)
|
||||
state |= GTK_STATE_FLAG_INCONSISTENT;
|
||||
else if (priv->active)
|
||||
state |= GTK_STATE_FLAG_ACTIVE;
|
||||
|
||||
gtk_style_context_set_state (context, state);
|
||||
|
||||
if (priv->draw_as_radio)
|
||||
{
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RADIO);
|
||||
gtk_render_option (context, cr, x, y,
|
||||
indicator_size, indicator_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_CHECK);
|
||||
gtk_render_check (context, cr, x, y,
|
||||
indicator_size, indicator_size);
|
||||
}
|
||||
|
||||
gtk_style_context_restore (context);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,7 @@ selected_cb (GtkButton *button,
|
||||
GtkDialog *dialog)
|
||||
{
|
||||
save_color (GTK_COLOR_CHOOSER_DIALOG (dialog));
|
||||
gtk_dialog_response (dialog, GTK_RESPONSE_OK);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -151,7 +152,8 @@ gtk_color_chooser_dialog_init (GtkColorChooserDialog *cc)
|
||||
G_CALLBACK (selected_cb), dialog);
|
||||
gtk_widget_set_can_default (priv->select_button, TRUE);
|
||||
gtk_widget_show (priv->select_button);
|
||||
gtk_dialog_add_action_widget (dialog, priv->select_button, GTK_RESPONSE_OK);
|
||||
gtk_box_pack_end (GTK_BOX (gtk_dialog_get_action_area (dialog)),
|
||||
priv->select_button, FALSE, TRUE, 0);
|
||||
gtk_widget_grab_default (priv->select_button);
|
||||
|
||||
gtk_dialog_set_alternative_button_order (dialog,
|
||||
|
||||
@@ -58,8 +58,7 @@
|
||||
* The GtkComboBoxText implementation of the GtkBuildable interface
|
||||
* supports adding items directly using the <items> element
|
||||
* and specifying <item> elements for each item. Each <item>
|
||||
* element can specify the "id" corresponding to the appended text and
|
||||
* also supports the regular translation attributes "translatable",
|
||||
* element supports the regular translation attributes "translatable",
|
||||
* "context" and "comments".
|
||||
*
|
||||
* <example>
|
||||
@@ -67,9 +66,9 @@
|
||||
* <programlisting><![CDATA[
|
||||
* <object class="GtkComboBoxText">
|
||||
* <items>
|
||||
* <item translatable="yes" id="factory">Factory</item>
|
||||
* <item translatable="yes" id="home">Home</item>
|
||||
* <item translatable="yes" id="subway">Subway</item>
|
||||
* <item translatable="yes">Factory</item>
|
||||
* <item translatable="yes">Home</item>
|
||||
* <item translatable="yes">Subway</item>
|
||||
* </items>
|
||||
* </object>
|
||||
* ]]></programlisting>
|
||||
@@ -237,6 +236,10 @@ item_end_element (GMarkupParseContext *context,
|
||||
{
|
||||
gchar *translated;
|
||||
|
||||
/* FIXME: This will not use the domain set in the .ui file,
|
||||
* since the parser is not telling the builder about the domain.
|
||||
* However, it will work for gtk_builder_set_translation_domain() calls.
|
||||
*/
|
||||
translated = _gtk_builder_parser_translate (data->domain,
|
||||
data->context,
|
||||
data->string->str);
|
||||
|
||||
@@ -309,12 +309,17 @@ static void gtk_container_adjust_size_request (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size);
|
||||
static void gtk_container_adjust_baseline_request (GtkWidget *widget,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
static void gtk_container_adjust_size_allocation (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size,
|
||||
gint *allocated_pos,
|
||||
gint *allocated_size);
|
||||
static void gtk_container_adjust_baseline_allocation (GtkWidget *widget,
|
||||
gint *baseline);
|
||||
static GtkSizeRequestMode gtk_container_get_request_mode (GtkWidget *widget);
|
||||
|
||||
static gchar* gtk_container_child_default_composite_name (GtkContainer *container,
|
||||
@@ -444,7 +449,9 @@ gtk_container_class_init (GtkContainerClass *class)
|
||||
widget_class->focus = gtk_container_focus;
|
||||
|
||||
widget_class->adjust_size_request = gtk_container_adjust_size_request;
|
||||
widget_class->adjust_baseline_request = gtk_container_adjust_baseline_request;
|
||||
widget_class->adjust_size_allocation = gtk_container_adjust_size_allocation;
|
||||
widget_class->adjust_baseline_allocation = gtk_container_adjust_baseline_allocation;
|
||||
widget_class->get_request_mode = gtk_container_get_request_mode;
|
||||
|
||||
class->add = gtk_container_add_unimplemented;
|
||||
@@ -1917,6 +1924,28 @@ gtk_container_adjust_size_request (GtkWidget *widget,
|
||||
minimum_size, natural_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_adjust_baseline_request (GtkWidget *widget,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkContainer *container;
|
||||
|
||||
container = GTK_CONTAINER (widget);
|
||||
|
||||
if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width)
|
||||
{
|
||||
int border_width;
|
||||
|
||||
border_width = container->priv->border_width;
|
||||
|
||||
*minimum_baseline += border_width;
|
||||
*natural_baseline += border_width;
|
||||
}
|
||||
|
||||
parent_class->adjust_baseline_request (widget, minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_adjust_size_allocation (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
@@ -1952,6 +1981,27 @@ gtk_container_adjust_size_allocation (GtkWidget *widget,
|
||||
allocated_size);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_container_adjust_baseline_allocation (GtkWidget *widget,
|
||||
gint *baseline)
|
||||
{
|
||||
GtkContainer *container;
|
||||
int border_width;
|
||||
|
||||
container = GTK_CONTAINER (widget);
|
||||
|
||||
if (GTK_CONTAINER_GET_CLASS (widget)->_handle_border_width)
|
||||
{
|
||||
border_width = container->priv->border_width;
|
||||
|
||||
if (*baseline >= 0)
|
||||
*baseline -= border_width;
|
||||
}
|
||||
|
||||
parent_class->adjust_baseline_allocation (widget, baseline);
|
||||
}
|
||||
|
||||
|
||||
typedef struct {
|
||||
gint hfw;
|
||||
gint wfh;
|
||||
|
||||
+7
-17
@@ -140,8 +140,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list)
|
||||
GtkCssDependencies *dependencies)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssValue *value;
|
||||
@@ -161,20 +160,12 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
case COLOR_TYPE_NAME:
|
||||
{
|
||||
GtkCssValue *named;
|
||||
GSList cycle = { color, cycle_list };
|
||||
|
||||
/* If color exists in cycle_list, we're currently resolving it.
|
||||
* So we've detected a cycle. */
|
||||
if (g_slist_find (cycle_list, color))
|
||||
return NULL;
|
||||
|
||||
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, &cycle);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, current_deps, dependencies);
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -184,7 +175,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkHSLA hsla;
|
||||
GdkRGBA shade;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, current_deps, dependencies, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, current_deps, dependencies);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -206,7 +197,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkCssValue *val;
|
||||
GdkRGBA alpha;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, current_deps, dependencies, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, current_deps, dependencies);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
@@ -226,13 +217,13 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GdkRGBA color1, color2, res;
|
||||
GtkCssDependencies dep1, dep2;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, current_deps, &dep1, cycle_list);
|
||||
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, cycle_list);
|
||||
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);
|
||||
@@ -331,8 +322,7 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
provider,
|
||||
current,
|
||||
current_deps,
|
||||
dependencies,
|
||||
NULL);
|
||||
dependencies);
|
||||
|
||||
if (resolved == NULL)
|
||||
return gtk_css_value_color_get_fallback (property_id, provider, values, parent_values);
|
||||
|
||||
@@ -47,8 +47,7 @@ GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list);
|
||||
GtkCssDependencies *dependencies);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
@@ -533,15 +533,11 @@
|
||||
* the GTK+ theming engine.
|
||||
* </para>
|
||||
* <para>
|
||||
* To set a shadow on an icon, use the icon-shadow property instead,
|
||||
* with the same syntax.
|
||||
* </para>
|
||||
* <para>
|
||||
* To set multiple shadows on an element, you can specify a comma-separated list
|
||||
* of shadow elements in the text-shadow or icon-shadow property. Shadows are
|
||||
* always rendered front-back, i.e. the first shadow specified is on top of the
|
||||
* others. Shadows can thus overlay each other, but they can never overlay the
|
||||
* text or icon itself, which is always rendered on top of the shadow layer.
|
||||
* of shadow elements in the text-shadow property. Shadows are always rendered
|
||||
* front-back, i.e. the first shadow specified is on top of the others. Shadows
|
||||
* can thus overlay each other, but they can never overlay the text itself,
|
||||
* which is always rendered on top of the shadow layer.
|
||||
* </para>
|
||||
* </refsect2>
|
||||
* <refsect2>
|
||||
|
||||
@@ -234,8 +234,7 @@ rgba_value_compute (GtkStyleProviderPrivate *provider,
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies,
|
||||
NULL);
|
||||
dependencies);
|
||||
if (val != NULL)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
@@ -324,8 +323,7 @@ color_value_compute (GtkStyleProviderPrivate *provider,
|
||||
provider,
|
||||
_gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies,
|
||||
NULL);
|
||||
dependencies);
|
||||
if (val != NULL)
|
||||
{
|
||||
const GdkRGBA *rgba = _gtk_css_rgba_value_get_rgba (val);
|
||||
|
||||
@@ -476,7 +476,7 @@ bindings_value_parse_one (GtkCssParser *parser)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (g_ascii_strcasecmp (name, "none") == 0)
|
||||
if (g_ascii_strcasecmp (name, "none"))
|
||||
{
|
||||
name = NULL;
|
||||
}
|
||||
|
||||
+2
-1
@@ -47,7 +47,8 @@ typedef enum {
|
||||
GTK_DEBUG_PRINTING = 1 << 10,
|
||||
GTK_DEBUG_BUILDER = 1 << 11,
|
||||
GTK_DEBUG_SIZE_REQUEST = 1 << 12,
|
||||
GTK_DEBUG_NO_CSS_CACHE = 1 << 13
|
||||
GTK_DEBUG_NO_CSS_CACHE = 1 << 13,
|
||||
GTK_DEBUG_BASELINES = 1 << 14
|
||||
} GtkDebugFlag;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
|
||||
@@ -787,6 +787,7 @@ gtk_dialog_add_button (GtkDialog *dialog,
|
||||
button = gtk_button_new_from_stock (button_text);
|
||||
|
||||
gtk_widget_set_can_default (button, TRUE);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_BASELINE);
|
||||
|
||||
gtk_widget_show (button);
|
||||
|
||||
|
||||
+1
-1
@@ -144,7 +144,7 @@ struct _GtkDragFindData
|
||||
selection_data.selection = GDK_NONE;
|
||||
selection_data.data = NULL;
|
||||
selection_data.length = -1;
|
||||
selection_data.target = gdk_quartz_pasteboard_type_to_atom_libgtk_only (type);
|
||||
selection_data.target = _gtk_quartz_pasteboard_type_to_atom (type);
|
||||
selection_data.display = gdk_display_get_default ();
|
||||
|
||||
if (gtk_target_list_find (info->target_list,
|
||||
|
||||
+1
-32
@@ -185,8 +185,6 @@ typedef gboolean (* GtkDragDestCallback) (GtkWidget *widget,
|
||||
/* Enumeration for some targets we handle internally */
|
||||
|
||||
enum {
|
||||
TARGET_MOTIF_SUCCESS = 0x40000000,
|
||||
TARGET_MOTIF_FAILURE,
|
||||
TARGET_DELETE
|
||||
};
|
||||
|
||||
@@ -1200,12 +1198,6 @@ gtk_drag_finish (GdkDragContext *context,
|
||||
{
|
||||
target = gdk_atom_intern_static_string ("DELETE");
|
||||
}
|
||||
else if (gdk_drag_context_get_protocol (context) == GDK_DRAG_PROTO_MOTIF)
|
||||
{
|
||||
target = gdk_atom_intern_static_string (success ?
|
||||
"XmTRANSFER_SUCCESS" :
|
||||
"XmTRANSFER_FAILURE");
|
||||
}
|
||||
|
||||
if (target != GDK_NONE)
|
||||
{
|
||||
@@ -1781,8 +1773,6 @@ _gtk_drag_dest_handle_event (GtkWidget *toplevel,
|
||||
else if (event->type == GDK_DROP_START && !info->proxy_source)
|
||||
{
|
||||
gdk_drop_reply (context, found, event->dnd.time);
|
||||
if ((gdk_drag_context_get_protocol (context) == GDK_DRAG_PROTO_MOTIF) && !found)
|
||||
gtk_drag_finish (context, FALSE, FALSE, event->dnd.time);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3449,7 +3439,6 @@ gtk_drag_set_icon_surface (GdkDragContext *context,
|
||||
}
|
||||
|
||||
gdk_window_set_background_pattern (gtk_widget_get_window (window), pattern);
|
||||
cairo_pattern_destroy (pattern);
|
||||
|
||||
gtk_drag_set_icon_window (context, window, extents.x, extents.y, TRUE);
|
||||
}
|
||||
@@ -3576,7 +3565,7 @@ _gtk_drag_source_handle_event (GtkWidget *widget,
|
||||
{
|
||||
gboolean result = gdk_drag_context_get_selected_action (context) != 0;
|
||||
|
||||
/* Aha - we can finally pass the MOTIF DROP on... */
|
||||
/* Aha - we can finally pass the DROP on... */
|
||||
gdk_drop_reply (info->proxy_dest->context, result, info->proxy_dest->proxy_drop_time);
|
||||
if (result)
|
||||
gdk_drag_drop (info->context, info->proxy_dest->proxy_drop_time);
|
||||
@@ -3664,18 +3653,6 @@ gtk_drag_source_check_selection (GtkDragSourceInfo *info,
|
||||
pair->info);
|
||||
tmp_list = tmp_list->next;
|
||||
}
|
||||
|
||||
if (gdk_drag_context_get_protocol (info->context) == GDK_DRAG_PROTO_MOTIF)
|
||||
{
|
||||
gtk_selection_add_target (info->ipc_widget,
|
||||
selection,
|
||||
gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS"),
|
||||
TARGET_MOTIF_SUCCESS);
|
||||
gtk_selection_add_target (info->ipc_widget,
|
||||
selection,
|
||||
gdk_atom_intern_static_string ("XmTRANSFER_FAILURE"),
|
||||
TARGET_MOTIF_FAILURE);
|
||||
}
|
||||
|
||||
gtk_selection_add_target (info->ipc_widget,
|
||||
selection,
|
||||
@@ -3923,14 +3900,6 @@ gtk_drag_selection_get (GtkWidget *widget,
|
||||
info->context);
|
||||
gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
|
||||
break;
|
||||
case TARGET_MOTIF_SUCCESS:
|
||||
gtk_drag_drop_finished (info, GTK_DRAG_RESULT_SUCCESS, time);
|
||||
gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
|
||||
break;
|
||||
case TARGET_MOTIF_FAILURE:
|
||||
gtk_drag_drop_finished (info, GTK_DRAG_RESULT_NO_TARGET, time);
|
||||
gtk_selection_data_set (selection_data, null_atom, 8, NULL, 0);
|
||||
break;
|
||||
default:
|
||||
if (info->proxy_dest)
|
||||
{
|
||||
|
||||
+51
-9
@@ -367,6 +367,12 @@ static void gtk_entry_get_preferred_width (GtkWidget *widget,
|
||||
static void gtk_entry_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
static void gtk_entry_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static void gtk_entry_draw_frame (GtkWidget *widget,
|
||||
@@ -682,6 +688,7 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
widget_class->unrealize = gtk_entry_unrealize;
|
||||
widget_class->get_preferred_width = gtk_entry_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_entry_get_preferred_height;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_entry_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->size_allocate = gtk_entry_size_allocate;
|
||||
widget_class->draw = gtk_entry_draw;
|
||||
widget_class->enter_notify_event = gtk_entry_enter_notify;
|
||||
@@ -1425,10 +1432,9 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
PANGO_TYPE_ATTR_LIST,
|
||||
GTK_PARAM_READWRITE));
|
||||
|
||||
/**
|
||||
* GtkEntry:populate-all:
|
||||
/** GtkEntry:populate-all:
|
||||
*
|
||||
* If :populate-all is %TRUE, the #GtkEntry::populate-popup
|
||||
* If ::populate-all is %TRUE, the #GtkEntry::populate-popup
|
||||
* signal is also emitted for touch popups.
|
||||
*
|
||||
* Since: 3.8
|
||||
@@ -1508,7 +1514,7 @@ gtk_entry_class_init (GtkEntryClass *class)
|
||||
* to this signal and append your items to the @widget, which
|
||||
* will be a #GtkMenu in this case.
|
||||
*
|
||||
* If #GtkEntry:populate-all is %TRUE, this signal will
|
||||
* If #GtkEntry::populate-all is %TRUE, this signal will
|
||||
* also be emitted to populate touch popups. In this case,
|
||||
* @widget will be a different container, e.g. a #GtkToolbar.
|
||||
* The signal handler should not make assumptions about the
|
||||
@@ -3306,16 +3312,19 @@ gtk_entry_get_preferred_width (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
gtk_entry_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkEntry *entry = GTK_ENTRY (widget);
|
||||
GtkEntryPrivate *priv = entry->priv;
|
||||
PangoFontMetrics *metrics;
|
||||
GtkBorder borders;
|
||||
PangoContext *context;
|
||||
gint height;
|
||||
gint height, baseline;
|
||||
PangoLayout *layout;
|
||||
|
||||
layout = gtk_entry_ensure_layout (entry, TRUE);
|
||||
@@ -3334,8 +3343,27 @@ gtk_entry_get_preferred_height (GtkWidget *widget,
|
||||
|
||||
height += borders.top + borders.bottom;
|
||||
|
||||
baseline = pango_layout_get_baseline (layout) / PANGO_SCALE;
|
||||
baseline += borders.top;
|
||||
|
||||
*minimum = height;
|
||||
*natural = height;
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = baseline;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_entry_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
gtk_entry_get_preferred_height_and_baseline_for_width (widget,
|
||||
-1,
|
||||
minimum,
|
||||
natural,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3453,13 +3481,17 @@ gtk_entry_get_frame_size (GtkEntry *entry,
|
||||
GtkAllocation allocation;
|
||||
GtkRequisition requisition;
|
||||
GtkWidget *widget = GTK_WIDGET (entry);
|
||||
gint area_height, y_pos;
|
||||
gint baseline;
|
||||
gint req_height;
|
||||
GtkBorder borders;
|
||||
|
||||
gtk_widget_get_preferred_size (widget, &requisition, NULL);
|
||||
|
||||
req_height = requisition.height - gtk_widget_get_margin_top (widget) - gtk_widget_get_margin_bottom (widget);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
|
||||
if (x)
|
||||
*x = allocation.x;
|
||||
@@ -3469,7 +3501,17 @@ gtk_entry_get_frame_size (GtkEntry *entry,
|
||||
if (priv->is_cell_renderer)
|
||||
*y = 0;
|
||||
else
|
||||
*y = (allocation.height - req_height) / 2;
|
||||
{
|
||||
if (baseline == -1)
|
||||
*y = (allocation.height - req_height) / 2;
|
||||
else
|
||||
{
|
||||
_gtk_entry_get_borders (entry, &borders);
|
||||
area_height = req_height - borders.top - borders.bottom;
|
||||
y_pos = ((area_height * PANGO_SCALE - priv->ascent - priv->descent) / 2 + priv->ascent) / PANGO_SCALE;
|
||||
*y = baseline - y_pos - borders.top;
|
||||
}
|
||||
}
|
||||
|
||||
*y += allocation.y;
|
||||
}
|
||||
|
||||
+29
-1
@@ -51,6 +51,7 @@ G_BEGIN_DECLS
|
||||
* or top
|
||||
* @GTK_ALIGN_CENTER: center natural width of widget inside the
|
||||
* allocation
|
||||
* @GTK_ALIGN_BASELINE: align the widget according to the baseline. Since 3.10.
|
||||
*
|
||||
* Controls how a widget deals with extra space in a single (x or y)
|
||||
* dimension.
|
||||
@@ -64,13 +65,18 @@ G_BEGIN_DECLS
|
||||
*
|
||||
* Note that in horizontal context @GTK_ALIGN_START and @GTK_ALIGN_END
|
||||
* are interpreted relative to text direction.
|
||||
*
|
||||
* GTK_ALIGN_BASELINE support for it is optional for containers and widgets, and
|
||||
* it is only supported for vertical alignment. When its not supported by
|
||||
* a child or a container it is treated as @GTK_ALIGN_FILL.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GTK_ALIGN_FILL,
|
||||
GTK_ALIGN_START,
|
||||
GTK_ALIGN_END,
|
||||
GTK_ALIGN_CENTER
|
||||
GTK_ALIGN_CENTER,
|
||||
GTK_ALIGN_BASELINE
|
||||
} GtkAlign;
|
||||
|
||||
|
||||
@@ -125,6 +131,28 @@ typedef enum
|
||||
GTK_FILL = 1 << 2
|
||||
} GtkAttachOptions;
|
||||
|
||||
/**
|
||||
* GtkBaselinePosition:
|
||||
* @GTK_BASELINE_POSITION_TOP: Align the baseline at the top
|
||||
* @GTK_BASELINE_POSITION_CENTER: Center the baseline
|
||||
* @GTK_BASELINE_POSITION_BOTTOM: Align the baseline at the bottom
|
||||
*
|
||||
* Whenever a container has some form of natural row it may align
|
||||
* children in that row along a common typographical baseline. If
|
||||
* the amount of verical space in the row is taller than the total
|
||||
* requested height of the baseline-aligned children then it can use a
|
||||
* #GtkBaselinePosition to select where to put the baseline inside the
|
||||
* extra availible space.
|
||||
*
|
||||
* Since: 3.10
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GTK_BASELINE_POSITION_TOP,
|
||||
GTK_BASELINE_POSITION_CENTER,
|
||||
GTK_BASELINE_POSITION_BOTTOM
|
||||
} GtkBaselinePosition;
|
||||
|
||||
/**
|
||||
* GtkButtonBoxStyle:
|
||||
* @GTK_BUTTONBOX_DEFAULT_STYLE: Default packing.
|
||||
|
||||
+38
-5
@@ -65,6 +65,12 @@ static void gtk_event_box_get_preferred_width (GtkWidget *widget,
|
||||
static void gtk_event_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_event_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
static void gtk_event_box_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation);
|
||||
static gboolean gtk_event_box_draw (GtkWidget *widget,
|
||||
@@ -96,6 +102,7 @@ gtk_event_box_class_init (GtkEventBoxClass *class)
|
||||
widget_class->unmap = gtk_event_box_unmap;
|
||||
widget_class->get_preferred_width = gtk_event_box_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_event_box_get_preferred_height;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_event_box_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->size_allocate = gtk_event_box_size_allocate;
|
||||
widget_class->draw = gtk_event_box_draw;
|
||||
|
||||
@@ -515,9 +522,12 @@ gtk_event_box_get_preferred_width (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
gtk_event_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkBin *bin = GTK_BIN (widget);
|
||||
GtkWidget *child;
|
||||
@@ -528,9 +538,30 @@ gtk_event_box_get_preferred_height (GtkWidget *widget,
|
||||
if (natural)
|
||||
*natural = 0;
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
|
||||
child = gtk_bin_get_child (bin);
|
||||
if (child && gtk_widget_get_visible (child))
|
||||
gtk_widget_get_preferred_height (child, minimum, natural);
|
||||
gtk_widget_get_preferred_height_and_baseline_for_width (child,
|
||||
-1,
|
||||
minimum,
|
||||
natural,
|
||||
minimum_baseline,
|
||||
natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_event_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
gtk_event_box_get_preferred_height_and_baseline_for_width (widget, -1,
|
||||
minimum, natural,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -539,6 +570,7 @@ gtk_event_box_size_allocate (GtkWidget *widget,
|
||||
{
|
||||
GtkBin *bin;
|
||||
GtkAllocation child_allocation;
|
||||
gint baseline;
|
||||
GtkEventBoxPrivate *priv;
|
||||
GtkWidget *child;
|
||||
|
||||
@@ -578,9 +610,10 @@ gtk_event_box_size_allocate (GtkWidget *widget,
|
||||
child_allocation.height);
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
child = gtk_bin_get_child (bin);
|
||||
if (child)
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
gtk_widget_size_allocate_with_baseline (child, &child_allocation, baseline);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -4112,11 +4112,11 @@ file_list_drag_motion_cb (GtkWidget *widget,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Sensitizes the "Copy file’s location" and other context menu items if there is actually
|
||||
/* Sensitizes the "Copy file’s location" context menu item if there is actually
|
||||
* a selection active.
|
||||
*/
|
||||
static void
|
||||
check_file_list_menu_sensitivity (GtkFileChooserDefault *impl)
|
||||
check_copy_file_location_sensitivity (GtkFileChooserDefault *impl)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
gboolean active;
|
||||
@@ -4129,10 +4129,6 @@ check_file_list_menu_sensitivity (GtkFileChooserDefault *impl)
|
||||
|
||||
if (impl->browse_files_popup_menu_copy_file_location_item)
|
||||
gtk_widget_set_sensitive (impl->browse_files_popup_menu_copy_file_location_item, active);
|
||||
if (impl->browse_files_popup_menu_add_shortcut_item)
|
||||
gtk_widget_set_sensitive (impl->browse_files_popup_menu_add_shortcut_item, active);
|
||||
if (impl->browse_files_popup_menu_visit_file_item)
|
||||
gtk_widget_set_sensitive (impl->browse_files_popup_menu_visit_file_item, active);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
@@ -4202,7 +4198,7 @@ file_list_build_popup_menu (GtkFileChooserDefault *impl)
|
||||
G_CALLBACK (show_size_column_toggled_cb));
|
||||
|
||||
bookmarks_check_add_sensitivity (impl);
|
||||
check_file_list_menu_sensitivity (impl);
|
||||
check_copy_file_location_sensitivity (impl);
|
||||
}
|
||||
|
||||
/* Updates the popup menu for the file list, creating it if necessary */
|
||||
@@ -10070,7 +10066,7 @@ list_selection_changed (GtkTreeSelection *selection,
|
||||
|
||||
check_preview_change (impl);
|
||||
bookmarks_check_add_sensitivity (impl);
|
||||
check_file_list_menu_sensitivity (impl);
|
||||
check_copy_file_location_sensitivity (impl);
|
||||
|
||||
g_signal_emit_by_name (impl, "selection-changed", 0);
|
||||
}
|
||||
|
||||
+616
-107
File diff suppressed because it is too large
Load Diff
@@ -103,6 +103,18 @@ gboolean gtk_grid_get_column_homogeneous (GtkGrid *grid);
|
||||
void gtk_grid_set_column_spacing (GtkGrid *grid,
|
||||
guint spacing);
|
||||
guint gtk_grid_get_column_spacing (GtkGrid *grid);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_grid_set_row_baseline_position (GtkGrid *grid,
|
||||
gint row,
|
||||
GtkBaselinePosition pos);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GtkBaselinePosition gtk_grid_get_row_baseline_position (GtkGrid *grid,
|
||||
gint row);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_grid_set_baseline_row (GtkGrid *grid,
|
||||
gint row);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
gint gtk_grid_get_baseline_row (GtkGrid *grid);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
+1401
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright (c) 2013 Red Hat, Inc.
|
||||
*
|
||||
* This program 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 program 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 program; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef __GTK_HEADER_BAR_H__
|
||||
#define __GTK_HEADER_BAR_H__
|
||||
|
||||
#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
||||
#error "Only <gtk/gtk.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gtk/gtkcontainer.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_HEADER_BAR (gtk_header_bar_get_type ())
|
||||
#define GTK_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HEADER_BAR, GtkHeaderBar))
|
||||
#define GTK_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HEADER_BAR, GtkHeaderBarClass))
|
||||
#define GTK_IS_HEADER_BAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HEADER_BAR))
|
||||
#define GTK_IS_HEADER_BAR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HEADER_BAR))
|
||||
#define GTK_HEADER_BAR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HEADER_BAR, GtkHeaderBarClass))
|
||||
|
||||
typedef struct _GtkHeaderBar GtkHeaderBar;
|
||||
typedef struct _GtkHeaderBarPrivate GtkHeaderBarPrivate;
|
||||
typedef struct _GtkHeaderBarClass GtkHeaderBarClass;
|
||||
|
||||
struct _GtkHeaderBar
|
||||
{
|
||||
GtkContainer container;
|
||||
|
||||
/*< private >*/
|
||||
GtkHeaderBarPrivate *priv;
|
||||
};
|
||||
|
||||
struct _GtkHeaderBarClass
|
||||
{
|
||||
GtkContainerClass parent_class;
|
||||
|
||||
/* Padding for future expansion */
|
||||
void (*_gtk_reserved1) (void);
|
||||
void (*_gtk_reserved2) (void);
|
||||
void (*_gtk_reserved3) (void);
|
||||
void (*_gtk_reserved4) (void);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GType gtk_header_bar_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GtkWidget *gtk_header_bar_new (void);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_header_bar_set_title (GtkHeaderBar *bar,
|
||||
const gchar *title);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
const gchar *gtk_header_bar_get_title (GtkHeaderBar *bar);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_header_bar_set_subtitle (GtkHeaderBar *bar,
|
||||
const gchar *subtitle);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
const gchar *gtk_header_bar_get_subtitle (GtkHeaderBar *bar);
|
||||
|
||||
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_header_bar_set_custom_title (GtkHeaderBar *bar,
|
||||
GtkWidget *title_widget);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
GtkWidget *gtk_header_bar_get_custom_title (GtkHeaderBar *bar);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_header_bar_pack_start (GtkHeaderBar *bar,
|
||||
GtkWidget *child);
|
||||
GDK_AVAILABLE_IN_3_10
|
||||
void gtk_header_bar_pack_end (GtkHeaderBar *bar,
|
||||
GtkWidget *child);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_HEADER_BAR_H__ */
|
||||
+82
-7
@@ -140,6 +140,8 @@ struct _GtkImagePrivate
|
||||
|
||||
gchar *filename; /* Only used with GTK_IMAGE_ANIMATION, GTK_IMAGE_PIXBUF */
|
||||
gchar *resource_path; /* Only used with GTK_IMAGE_PIXBUF */
|
||||
|
||||
float baseline_align;
|
||||
};
|
||||
|
||||
|
||||
@@ -154,6 +156,12 @@ static void gtk_image_get_preferred_width (GtkWidget *widget,
|
||||
static void gtk_image_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural);
|
||||
static void gtk_image_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
static void gtk_image_style_updated (GtkWidget *widget);
|
||||
static void gtk_image_screen_changed (GtkWidget *widget,
|
||||
@@ -207,6 +215,7 @@ gtk_image_class_init (GtkImageClass *class)
|
||||
widget_class->draw = gtk_image_draw;
|
||||
widget_class->get_preferred_width = gtk_image_get_preferred_width;
|
||||
widget_class->get_preferred_height = gtk_image_get_preferred_height;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_image_get_preferred_height_and_baseline_for_width;
|
||||
widget_class->unmap = gtk_image_unmap;
|
||||
widget_class->unrealize = gtk_image_unrealize;
|
||||
widget_class->style_updated = gtk_image_style_updated;
|
||||
@@ -1393,6 +1402,26 @@ gtk_image_get_preferred_size (GtkImage *image,
|
||||
*height_out = height;
|
||||
}
|
||||
|
||||
static float
|
||||
gtk_image_get_baseline_align (GtkImage *image)
|
||||
{
|
||||
PangoContext *pango_context;
|
||||
PangoFontMetrics *metrics;
|
||||
|
||||
if (image->priv->baseline_align == 0.0)
|
||||
{
|
||||
pango_context = gtk_widget_get_pango_context (GTK_WIDGET (image));
|
||||
metrics = pango_context_get_metrics (pango_context,
|
||||
pango_context_get_font_description (pango_context),
|
||||
pango_context_get_language (pango_context));
|
||||
image->priv->baseline_align =
|
||||
(float)pango_font_metrics_get_ascent (metrics) /
|
||||
(pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
|
||||
}
|
||||
|
||||
return image->priv->baseline_align;
|
||||
}
|
||||
|
||||
static gint
|
||||
gtk_image_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
@@ -1401,7 +1430,7 @@ gtk_image_draw (GtkWidget *widget,
|
||||
GtkImagePrivate *priv;
|
||||
GtkMisc *misc;
|
||||
GtkStyleContext *context;
|
||||
gint x, y, width, height;
|
||||
gint x, y, width, height, baseline;
|
||||
gfloat xalign, yalign;
|
||||
GtkBorder border;
|
||||
|
||||
@@ -1427,8 +1456,28 @@ gtk_image_draw (GtkWidget *widget,
|
||||
if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
|
||||
xalign = 1.0 - xalign;
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
|
||||
x = floor ((gtk_widget_get_allocated_width (widget) - width) * xalign) + border.left;
|
||||
y = floor ((gtk_widget_get_allocated_height (widget) - height) * yalign) + border.top;
|
||||
if (baseline == -1)
|
||||
y = floor ((gtk_widget_get_allocated_height (widget) - height) * yalign) + border.top;
|
||||
else
|
||||
{
|
||||
PangoContext *pango_context;
|
||||
PangoFontMetrics *metrics;
|
||||
float baseline_align;
|
||||
|
||||
pango_context = gtk_widget_get_pango_context (widget);
|
||||
metrics = pango_context_get_metrics (pango_context,
|
||||
pango_context_get_font_description (pango_context),
|
||||
pango_context_get_language (pango_context));
|
||||
baseline_align =
|
||||
(double)pango_font_metrics_get_ascent (metrics) /
|
||||
(pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
|
||||
|
||||
y = CLAMP (baseline - height * baseline_align,
|
||||
border.top, gtk_widget_get_allocated_height (widget) - height);
|
||||
}
|
||||
|
||||
if (gtk_image_get_storage_type (image) == GTK_IMAGE_ANIMATION)
|
||||
{
|
||||
@@ -1535,15 +1584,37 @@ gtk_image_get_preferred_width (GtkWidget *widget,
|
||||
*minimum = *natural = width;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_image_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
gint height;
|
||||
float baseline_align;
|
||||
|
||||
gtk_image_get_preferred_size (GTK_IMAGE (widget), NULL, &height);
|
||||
*minimum = *natural = height;
|
||||
|
||||
if (minimum_baseline || natural_baseline)
|
||||
{
|
||||
baseline_align = gtk_image_get_baseline_align (GTK_IMAGE (widget));
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = height * baseline_align;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = height * baseline_align;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_image_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum,
|
||||
gint *natural)
|
||||
{
|
||||
gint height;
|
||||
|
||||
gtk_image_get_preferred_size (GTK_IMAGE (widget), NULL, &height);
|
||||
*minimum = *natural = height;
|
||||
gtk_image_get_preferred_height_and_baseline_for_width (widget, -1, minimum, natural,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1558,9 +1629,13 @@ icon_theme_changed (GtkImage *image)
|
||||
static void
|
||||
gtk_image_style_updated (GtkWidget *widget)
|
||||
{
|
||||
GtkImage *image = GTK_IMAGE (widget);
|
||||
GtkImagePrivate *priv = image->priv;
|
||||
|
||||
GTK_WIDGET_CLASS (gtk_image_parent_class)->style_updated (widget);
|
||||
|
||||
icon_theme_changed (GTK_IMAGE (widget));
|
||||
icon_theme_changed (image);
|
||||
priv->baseline_align = 0.0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+92
-18
@@ -519,6 +519,12 @@ static void gtk_label_get_preferred_height_for_width (GtkWidget
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height);
|
||||
static void gtk_label_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline);
|
||||
|
||||
static GtkBuildableIface *buildable_parent_iface = NULL;
|
||||
|
||||
@@ -585,6 +591,7 @@ gtk_label_class_init (GtkLabelClass *class)
|
||||
widget_class->get_preferred_height = gtk_label_get_preferred_height;
|
||||
widget_class->get_preferred_width_for_height = gtk_label_get_preferred_width_for_height;
|
||||
widget_class->get_preferred_height_for_width = gtk_label_get_preferred_height_for_width;
|
||||
widget_class->get_preferred_height_and_baseline_for_width = gtk_label_get_preferred_height_and_baseline_for_width;
|
||||
|
||||
class->move_cursor = gtk_label_move_cursor;
|
||||
class->copy_clipboard = gtk_label_copy_clipboard;
|
||||
@@ -2570,7 +2577,7 @@ gtk_label_set_markup_internal (GtkLabel *label,
|
||||
/* Extract the text to display */
|
||||
if (!pango_parse_markup (str_for_display,
|
||||
-1,
|
||||
with_uline ? '_' : 0,
|
||||
0,
|
||||
&attrs,
|
||||
&text,
|
||||
NULL,
|
||||
@@ -3462,15 +3469,18 @@ gtk_label_get_request_mode (GtkWidget *widget)
|
||||
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
get_size_for_allocation (GtkLabel *label,
|
||||
GtkOrientation orientation,
|
||||
gint allocation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
PangoLayout *layout;
|
||||
gint text_height;
|
||||
gint text_height, baseline;
|
||||
|
||||
layout = gtk_label_get_measuring_layout (label, NULL, allocation * PANGO_SCALE);
|
||||
|
||||
@@ -3482,6 +3492,16 @@ get_size_for_allocation (GtkLabel *label,
|
||||
if (natural_size)
|
||||
*natural_size = text_height;
|
||||
|
||||
if (minimum_baseline || natural_baseline)
|
||||
{
|
||||
baseline = pango_layout_get_baseline (layout) / PANGO_SCALE;
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = baseline;
|
||||
|
||||
if (natural_baseline)
|
||||
*natural_baseline = baseline;
|
||||
}
|
||||
|
||||
g_object_unref (layout);
|
||||
}
|
||||
|
||||
@@ -3578,7 +3598,9 @@ static void
|
||||
gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
gint *natural_size,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (widget);
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
@@ -3586,6 +3608,12 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
PangoRectangle smallest_rect;
|
||||
GtkBorder border;
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
|
||||
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 */
|
||||
@@ -3640,7 +3668,8 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
get_size_for_allocation (label,
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
smallest_rect.height,
|
||||
minimum_size, natural_size);
|
||||
minimum_size, natural_size,
|
||||
NULL, NULL);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -3667,7 +3696,16 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
get_size_for_allocation (label,
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
widest_rect.width,
|
||||
minimum_size, natural_size);
|
||||
minimum_size, natural_size,
|
||||
minimum_baseline, natural_baseline);
|
||||
|
||||
if (priv->angle == 180)
|
||||
{
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = *minimum_size - *minimum_baseline;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = *natural_size - *natural_baseline;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3680,6 +3718,12 @@ gtk_label_get_preferred_size (GtkWidget *widget,
|
||||
|
||||
*minimum_size += border.top + border.bottom;
|
||||
*natural_size += border.top + border.bottom;
|
||||
|
||||
if (minimum_baseline && *minimum_baseline != -1)
|
||||
*minimum_baseline += border.top;
|
||||
|
||||
if (natural_baseline && *natural_baseline != -1)
|
||||
*natural_baseline += border.top;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3688,7 +3732,7 @@ gtk_label_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_label_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size);
|
||||
gtk_label_get_preferred_size (widget, GTK_ORIENTATION_HORIZONTAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3696,7 +3740,7 @@ gtk_label_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_label_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size);
|
||||
gtk_label_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_size, natural_size, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3719,7 +3763,8 @@ gtk_label_get_preferred_width_for_height (GtkWidget *widget,
|
||||
|
||||
get_size_for_allocation (label, GTK_ORIENTATION_VERTICAL,
|
||||
MAX (1, height - border.top - border.bottom),
|
||||
minimum_width, natural_width);
|
||||
minimum_width, natural_width,
|
||||
NULL, NULL);
|
||||
|
||||
if (minimum_width)
|
||||
*minimum_width += border.right + border.left;
|
||||
@@ -3732,15 +3777,17 @@ gtk_label_get_preferred_width_for_height (GtkWidget *widget,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
gtk_label_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline)
|
||||
{
|
||||
GtkLabel *label = GTK_LABEL (widget);
|
||||
GtkLabelPrivate *priv = label->priv;
|
||||
|
||||
if (priv->wrap && (priv->angle == 0 || priv->angle == 180 || priv->angle == 360))
|
||||
if (width != -1 && priv->wrap && (priv->angle == 0 || priv->angle == 180 || priv->angle == 360))
|
||||
{
|
||||
GtkBorder border;
|
||||
|
||||
@@ -3751,7 +3798,13 @@ gtk_label_get_preferred_height_for_width (GtkWidget *widget,
|
||||
|
||||
get_size_for_allocation (label, GTK_ORIENTATION_HORIZONTAL,
|
||||
MAX (1, width - border.left - border.right),
|
||||
minimum_height, natural_height);
|
||||
minimum_height, natural_height,
|
||||
minimum_baseline, natural_baseline);
|
||||
|
||||
if (minimum_baseline && *minimum_baseline >= 0)
|
||||
*minimum_baseline += border.top;
|
||||
if (natural_baseline && *natural_baseline >= 0)
|
||||
*natural_baseline += border.top;
|
||||
|
||||
if (minimum_height)
|
||||
*minimum_height += border.top + border.bottom;
|
||||
@@ -3760,7 +3813,18 @@ gtk_label_get_preferred_height_for_width (GtkWidget *widget,
|
||||
*natural_height += border.top + border.bottom;
|
||||
}
|
||||
else
|
||||
GTK_WIDGET_GET_CLASS (widget)->get_preferred_height (widget, minimum_height, natural_height);
|
||||
gtk_label_get_preferred_size (widget, GTK_ORIENTATION_VERTICAL, minimum_height, natural_height, minimum_baseline, natural_baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_label_get_preferred_height_for_width (GtkWidget *widget,
|
||||
gint width,
|
||||
gint *minimum_height,
|
||||
gint *natural_height)
|
||||
{
|
||||
return gtk_label_get_preferred_height_and_baseline_for_width (widget, width,
|
||||
minimum_height, natural_height,
|
||||
NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3855,6 +3919,7 @@ get_layout_location (GtkLabel *label,
|
||||
gint req_height;
|
||||
gfloat xalign, yalign;
|
||||
PangoRectangle logical;
|
||||
gint baseline, layout_baseline, baseline_offset;
|
||||
|
||||
misc = GTK_MISC (label);
|
||||
widget = GTK_WIDGET (label);
|
||||
@@ -3887,6 +3952,15 @@ get_layout_location (GtkLabel *label,
|
||||
|
||||
x = floor (allocation.x + border.left + xalign * (allocation.width - req_width) - logical.x);
|
||||
|
||||
baseline_offset = 0;
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline >= 0 && !priv->have_transform)
|
||||
{
|
||||
layout_baseline = pango_layout_get_baseline (priv->layout) / PANGO_SCALE;
|
||||
baseline_offset = baseline - layout_baseline;
|
||||
yalign = 0.0; /* Can't support yalign while baseline aligning */
|
||||
}
|
||||
|
||||
/* bgo#315462 - For single-line labels, *do* align the requisition with
|
||||
* respect to the allocation, even if we are under-allocated. For multi-line
|
||||
* labels, always show the top of the text when they are under-allocated. The
|
||||
@@ -3901,9 +3975,9 @@ get_layout_location (GtkLabel *label,
|
||||
* middle". You want to read the first line, at least, to get some context.
|
||||
*/
|
||||
if (pango_layout_get_line_count (priv->layout) == 1)
|
||||
y = floor (allocation.y + border.top + (allocation.height - req_height) * yalign) - logical.y;
|
||||
y = floor (allocation.y + border.top + (allocation.height - req_height) * yalign) - logical.y + baseline_offset;
|
||||
else
|
||||
y = floor (allocation.y + border.top + MAX ((allocation.height - req_height) * yalign, 0)) - logical.y;
|
||||
y = floor (allocation.y + border.top + MAX ((allocation.height - req_height) * yalign, 0)) - logical.y + baseline_offset;
|
||||
|
||||
if (xp)
|
||||
*xp = x;
|
||||
|
||||
+2
-3
@@ -39,9 +39,8 @@
|
||||
* widget. It implements the #GtkTreeModel interface, and consequentialy,
|
||||
* can use all of the methods available there. It also implements the
|
||||
* #GtkTreeSortable interface so it can be sorted by the view.
|
||||
* Finally, it also implements the tree
|
||||
* <link linkend="gtk3-GtkTreeView-drag-and-drop">drag and drop</link>
|
||||
* interfaces.
|
||||
* Finally, it also implements the tree <link linkend="gtktreednd">drag and
|
||||
* drop</link> interfaces.
|
||||
*
|
||||
* The #GtkListStore can accept most GObject types as a column type, though
|
||||
* it can't accept all custom types. Internally, it will keep a copy of
|
||||
|
||||
+3
-2
@@ -172,7 +172,8 @@ static const GDebugKey gtk_debug_keys[] = {
|
||||
{"printing", GTK_DEBUG_PRINTING},
|
||||
{"builder", GTK_DEBUG_BUILDER},
|
||||
{"size-request", GTK_DEBUG_SIZE_REQUEST},
|
||||
{"no-css-cache", GTK_DEBUG_NO_CSS_CACHE}
|
||||
{"no-css-cache", GTK_DEBUG_NO_CSS_CACHE},
|
||||
{"baselines", GTK_DEBUG_BASELINES}
|
||||
};
|
||||
#endif /* G_ENABLE_DEBUG */
|
||||
|
||||
@@ -1698,7 +1699,7 @@ gtk_main_do_event (GdkEvent *event)
|
||||
if (GTK_IS_WINDOW (window))
|
||||
{
|
||||
if (mnemonics_visible)
|
||||
_gtk_window_schedule_mnemonics_visible (GTK_WINDOW (window));
|
||||
_gtk_window_set_auto_mnemonics_visible (GTK_WINDOW (window));
|
||||
else
|
||||
gtk_window_set_mnemonics_visible (GTK_WINDOW (window), FALSE);
|
||||
}
|
||||
|
||||
+24
-1
@@ -1683,6 +1683,29 @@ gtk_menu_popup_for_device (GtkMenu *menu,
|
||||
*/
|
||||
gtk_menu_position (menu, TRUE);
|
||||
|
||||
/* Compute the size of the toplevel and realize it so we
|
||||
* can scroll correctly.
|
||||
*/
|
||||
if (!gtk_widget_get_realized (GTK_WIDGET (menu)))
|
||||
{
|
||||
GtkRequisition tmp_request;
|
||||
GtkAllocation tmp_allocation = { 0, };
|
||||
|
||||
/* Instead of trusting the menu position function to queue a
|
||||
* resize when the menu goes out of bounds, invalidate the cached
|
||||
* size here.
|
||||
*/
|
||||
gtk_widget_queue_resize (GTK_WIDGET (menu));
|
||||
gtk_widget_get_preferred_size (priv->toplevel, &tmp_request, NULL);
|
||||
|
||||
tmp_allocation.width = tmp_request.width;
|
||||
tmp_allocation.height = tmp_request.height;
|
||||
|
||||
gtk_widget_size_allocate (priv->toplevel, &tmp_allocation);
|
||||
|
||||
gtk_widget_realize (priv->toplevel);
|
||||
}
|
||||
|
||||
gtk_menu_scroll_to (menu, priv->scroll_offset);
|
||||
|
||||
/* if no item is selected, select the first one */
|
||||
@@ -2558,7 +2581,7 @@ gtk_menu_realize (GtkWidget *widget)
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
attributes.x = 0;
|
||||
attributes.y = - priv->scroll_offset;
|
||||
attributes.y = 0;
|
||||
attributes.width = allocation.width + (2 * border_width) +
|
||||
padding.left + padding.right;
|
||||
attributes.height = priv->requested_height - (2 * border_width) +
|
||||
|
||||
+50
-61
@@ -82,52 +82,9 @@ G_DEFINE_TYPE_WITH_CODE (GtkOverlay, gtk_overlay, GTK_TYPE_BIN,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_overlay_buildable_init))
|
||||
|
||||
static void
|
||||
gtk_overlay_compute_child_allocation (GtkOverlay *overlay,
|
||||
GtkOverlayChild *child,
|
||||
GtkAllocation *window_allocation,
|
||||
GtkAllocation *widget_allocation)
|
||||
{
|
||||
gint left, right, top, bottom;
|
||||
GtkAllocation allocation, overlay_allocation;
|
||||
gboolean result;
|
||||
|
||||
g_signal_emit (overlay, signals[GET_CHILD_POSITION],
|
||||
0, child->widget, &allocation, &result);
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET (overlay), &overlay_allocation);
|
||||
|
||||
allocation.x += overlay_allocation.x;
|
||||
allocation.y += overlay_allocation.y;
|
||||
|
||||
/* put the margins outside the window; also arrange things
|
||||
* so that the adjusted child allocation still ends up at 0, 0
|
||||
*/
|
||||
left = gtk_widget_get_margin_left (child->widget);
|
||||
right = gtk_widget_get_margin_right (child->widget);
|
||||
top = gtk_widget_get_margin_top (child->widget);
|
||||
bottom = gtk_widget_get_margin_bottom (child->widget);
|
||||
|
||||
if (widget_allocation)
|
||||
{
|
||||
widget_allocation->x = - left;
|
||||
widget_allocation->y = - top;
|
||||
widget_allocation->width = allocation.width;
|
||||
widget_allocation->height = allocation.height;
|
||||
}
|
||||
|
||||
if (window_allocation)
|
||||
{
|
||||
window_allocation->x = allocation.x + left;
|
||||
window_allocation->y = allocation.y + top;
|
||||
window_allocation->width = allocation.width - (left + right);
|
||||
window_allocation->height = allocation.height - (top + bottom);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkWindow *
|
||||
gtk_overlay_create_child_window (GtkOverlay *overlay,
|
||||
GtkOverlayChild *child)
|
||||
GtkWidget *child)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (overlay);
|
||||
GtkAllocation allocation;
|
||||
@@ -135,7 +92,7 @@ gtk_overlay_create_child_window (GtkOverlay *overlay,
|
||||
GdkWindowAttr attributes;
|
||||
gint attributes_mask;
|
||||
|
||||
gtk_overlay_compute_child_allocation (overlay, child, &allocation, NULL);
|
||||
gtk_widget_get_allocation (child, &allocation);
|
||||
|
||||
attributes.window_type = GDK_WINDOW_CHILD;
|
||||
attributes.wclass = GDK_INPUT_OUTPUT;
|
||||
@@ -151,8 +108,8 @@ gtk_overlay_create_child_window (GtkOverlay *overlay,
|
||||
gtk_widget_register_window (widget, window);
|
||||
gtk_style_context_set_background (gtk_widget_get_style_context (widget), window);
|
||||
|
||||
gtk_widget_set_parent_window (child->widget, window);
|
||||
|
||||
gtk_widget_set_parent_window (child, window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
@@ -283,7 +240,9 @@ static void
|
||||
gtk_overlay_child_allocate (GtkOverlay *overlay,
|
||||
GtkOverlayChild *child)
|
||||
{
|
||||
GtkAllocation window_allocation, child_allocation;
|
||||
gint left, right, top, bottom;
|
||||
GtkAllocation allocation, child_allocation, overlay_allocation;
|
||||
gboolean result;
|
||||
|
||||
if (gtk_widget_get_mapped (GTK_WIDGET (overlay)))
|
||||
{
|
||||
@@ -296,14 +255,38 @@ gtk_overlay_child_allocate (GtkOverlay *overlay,
|
||||
if (!gtk_widget_get_visible (child->widget))
|
||||
return;
|
||||
|
||||
gtk_overlay_compute_child_allocation (overlay, child, &window_allocation, &child_allocation);
|
||||
g_signal_emit (overlay, signals[GET_CHILD_POSITION],
|
||||
0, child->widget, &allocation, &result);
|
||||
|
||||
gtk_widget_get_allocation (GTK_WIDGET (overlay), &overlay_allocation);
|
||||
|
||||
allocation.x += overlay_allocation.x;
|
||||
allocation.y += overlay_allocation.y;
|
||||
|
||||
/* put the margins outside the window; also arrange things
|
||||
* so that the adjusted child allocation still ends up at 0, 0
|
||||
*/
|
||||
left = gtk_widget_get_margin_left (child->widget);
|
||||
right = gtk_widget_get_margin_right (child->widget);
|
||||
top = gtk_widget_get_margin_top (child->widget);
|
||||
bottom = gtk_widget_get_margin_bottom (child->widget);
|
||||
|
||||
child_allocation.x = - left;
|
||||
child_allocation.y = - top;
|
||||
child_allocation.width = allocation.width;
|
||||
child_allocation.height = allocation.height;
|
||||
|
||||
allocation.x += left;
|
||||
allocation.y += top;
|
||||
allocation.width -= left + right;
|
||||
allocation.height -= top + bottom;
|
||||
|
||||
if (child->window)
|
||||
gdk_window_move_resize (child->window,
|
||||
window_allocation.x, window_allocation.y,
|
||||
window_allocation.width, window_allocation.height);
|
||||
allocation.x, allocation.y,
|
||||
allocation.width, allocation.height);
|
||||
|
||||
gtk_overlay_child_update_style_classes (overlay, child->widget, &window_allocation);
|
||||
gtk_overlay_child_update_style_classes (overlay, child->widget, &allocation);
|
||||
gtk_widget_size_allocate (child->widget, &child_allocation);
|
||||
}
|
||||
|
||||
@@ -363,7 +346,9 @@ gtk_overlay_size_allocate (GtkWidget *widget,
|
||||
gtk_widget_size_allocate (main_widget, allocation);
|
||||
|
||||
for (children = priv->children; children; children = children->next)
|
||||
gtk_overlay_child_allocate (overlay, children->data);
|
||||
{
|
||||
gtk_overlay_child_allocate (overlay, children->data);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -372,15 +357,15 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
|
||||
GtkAllocation *alloc)
|
||||
{
|
||||
GtkAllocation main_alloc;
|
||||
GtkRequisition min, req;
|
||||
GtkRequisition req;
|
||||
GtkAlign halign;
|
||||
GtkTextDirection direction;
|
||||
|
||||
gtk_overlay_get_main_widget_allocation (overlay, &main_alloc);
|
||||
gtk_widget_get_preferred_size (widget, &min, &req);
|
||||
gtk_widget_get_preferred_size (widget, NULL, &req);
|
||||
|
||||
alloc->x = main_alloc.x;
|
||||
alloc->width = MAX (min.width, MIN (main_alloc.width, req.width));
|
||||
alloc->width = MIN (main_alloc.width, req.width);
|
||||
|
||||
direction = gtk_widget_get_direction (widget);
|
||||
|
||||
@@ -391,7 +376,7 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
|
||||
/* nothing to do */
|
||||
break;
|
||||
case GTK_ALIGN_FILL:
|
||||
alloc->width = MAX (alloc->width, main_alloc.width);
|
||||
alloc->width = main_alloc.width;
|
||||
break;
|
||||
case GTK_ALIGN_CENTER:
|
||||
alloc->x += main_alloc.width / 2 - req.width / 2;
|
||||
@@ -402,7 +387,7 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
|
||||
}
|
||||
|
||||
alloc->y = main_alloc.y;
|
||||
alloc->height = MAX (min.height, MIN (main_alloc.height, req.height));
|
||||
alloc->height = MIN (main_alloc.height, req.height);
|
||||
|
||||
switch (gtk_widget_get_valign (widget))
|
||||
{
|
||||
@@ -410,7 +395,7 @@ gtk_overlay_get_child_position (GtkOverlay *overlay,
|
||||
/* nothing to do */
|
||||
break;
|
||||
case GTK_ALIGN_FILL:
|
||||
alloc->height = MAX (alloc->height, main_alloc.height);
|
||||
alloc->height = main_alloc.height;
|
||||
break;
|
||||
case GTK_ALIGN_CENTER:
|
||||
alloc->y += main_alloc.height / 2 - req.height / 2;
|
||||
@@ -438,7 +423,10 @@ gtk_overlay_realize (GtkWidget *widget)
|
||||
child = children->data;
|
||||
|
||||
if (child->window == NULL)
|
||||
child->window = gtk_overlay_create_child_window (overlay, child);
|
||||
{
|
||||
child->window = gtk_overlay_create_child_window (overlay, child->widget);
|
||||
gtk_overlay_child_allocate (overlay, child);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -724,8 +712,9 @@ gtk_overlay_add_overlay (GtkOverlay *overlay,
|
||||
|
||||
if (gtk_widget_get_realized (GTK_WIDGET (overlay)))
|
||||
{
|
||||
child->window = gtk_overlay_create_child_window (overlay, child);
|
||||
child->window = gtk_overlay_create_child_window (overlay, widget);
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (overlay));
|
||||
gtk_overlay_child_allocate (overlay, child);
|
||||
}
|
||||
else
|
||||
gtk_widget_set_parent (widget, GTK_WIDGET (overlay));
|
||||
|
||||
@@ -677,6 +677,7 @@ gtk_plug_unrealize (GtkWidget *widget)
|
||||
|
||||
if (priv->socket_window != NULL)
|
||||
{
|
||||
gtk_widget_unregister_window (widget, priv->socket_window);
|
||||
g_object_unref (priv->socket_window);
|
||||
priv->socket_window = NULL;
|
||||
|
||||
@@ -878,6 +879,7 @@ gtk_plug_filter_func (GdkXEvent *gdk_xevent,
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (plug);
|
||||
|
||||
gtk_widget_unregister_window (widget, priv->socket_window);
|
||||
g_object_unref (priv->socket_window);
|
||||
priv->socket_window = NULL;
|
||||
|
||||
|
||||
@@ -152,8 +152,6 @@ gtk_printer_option_widget_finalize (GObject *object)
|
||||
|
||||
if (priv->source)
|
||||
{
|
||||
g_signal_handler_disconnect (priv->source,
|
||||
priv->source_changed_handler);
|
||||
g_object_unref (priv->source);
|
||||
priv->source = NULL;
|
||||
}
|
||||
|
||||
+6
-6
@@ -269,21 +269,21 @@ gtk_print_job_finalize (GObject *object)
|
||||
GtkPrintJob *job = GTK_PRINT_JOB (object);
|
||||
GtkPrintJobPrivate *priv = job->priv;
|
||||
|
||||
if (priv->surface)
|
||||
cairo_surface_destroy (priv->surface);
|
||||
|
||||
if (priv->backend)
|
||||
g_object_unref (priv->backend);
|
||||
|
||||
if (priv->spool_io != NULL)
|
||||
{
|
||||
g_io_channel_unref (priv->spool_io);
|
||||
priv->spool_io = NULL;
|
||||
}
|
||||
|
||||
if (priv->backend)
|
||||
g_object_unref (priv->backend);
|
||||
|
||||
if (priv->printer)
|
||||
g_object_unref (priv->printer);
|
||||
|
||||
if (priv->surface)
|
||||
cairo_surface_destroy (priv->surface);
|
||||
|
||||
if (priv->settings)
|
||||
g_object_unref (priv->settings);
|
||||
|
||||
|
||||
+39
-4
@@ -76,6 +76,21 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf)
|
||||
return nsimage;
|
||||
}
|
||||
|
||||
static NSString *
|
||||
target_to_pasteboard_type (const char *target)
|
||||
{
|
||||
if (strcmp (target, "UTF8_STRING") == 0)
|
||||
return NSStringPboardType;
|
||||
else if (strcmp (target, "image/tiff") == 0)
|
||||
return NSTIFFPboardType;
|
||||
else if (strcmp (target, "application/x-color") == 0)
|
||||
return NSColorPboardType;
|
||||
else if (strcmp (target, "text/uri-list") == 0)
|
||||
return NSURLPboardType;
|
||||
else
|
||||
return [NSString stringWithUTF8String:target];
|
||||
}
|
||||
|
||||
NSSet *
|
||||
_gtk_quartz_target_list_to_pasteboard_types (GtkTargetList *target_list)
|
||||
{
|
||||
@@ -85,8 +100,10 @@ _gtk_quartz_target_list_to_pasteboard_types (GtkTargetList *target_list)
|
||||
for (list = target_list->list; list; list = list->next)
|
||||
{
|
||||
GtkTargetPair *pair = list->data;
|
||||
gchar *target = gdk_atom_name (pair->target);
|
||||
g_return_val_if_fail (pair->flags < 16, NULL);
|
||||
[set addObject:gdk_quartz_atom_to_pasteboard_type_libgtk_only (pair->target)];
|
||||
[set addObject:target_to_pasteboard_type (target)];
|
||||
g_free (target);
|
||||
}
|
||||
|
||||
return set;
|
||||
@@ -101,12 +118,27 @@ _gtk_quartz_target_entries_to_pasteboard_types (const GtkTargetEntry *targets,
|
||||
|
||||
for (i = 0; i < n_targets; i++)
|
||||
{
|
||||
[set addObject:gdk_quartz_target_to_pasteboard_type_libgtk_only (targets[i].target)];
|
||||
[set addObject:target_to_pasteboard_type (targets[i].target)];
|
||||
}
|
||||
|
||||
return set;
|
||||
}
|
||||
|
||||
GdkAtom
|
||||
_gtk_quartz_pasteboard_type_to_atom (NSString *type)
|
||||
{
|
||||
if ([type isEqualToString:NSStringPboardType])
|
||||
return gdk_atom_intern_static_string ("UTF8_STRING");
|
||||
else if ([type isEqualToString:NSTIFFPboardType])
|
||||
return gdk_atom_intern_static_string ("image/tiff");
|
||||
else if ([type isEqualToString:NSColorPboardType])
|
||||
return gdk_atom_intern_static_string ("application/x-color");
|
||||
else if ([type isEqualToString:NSURLPboardType])
|
||||
return gdk_atom_intern_static_string ("text/uri-list");
|
||||
else
|
||||
return gdk_atom_intern ([type UTF8String], FALSE);
|
||||
}
|
||||
|
||||
GList *
|
||||
_gtk_quartz_pasteboard_types_to_atom_list (NSArray *array)
|
||||
{
|
||||
@@ -118,7 +150,7 @@ _gtk_quartz_pasteboard_types_to_atom_list (NSArray *array)
|
||||
|
||||
for (i = 0; i < count; i++)
|
||||
{
|
||||
GdkAtom atom = gdk_quartz_pasteboard_type_to_atom_libgtk_only ([array objectAtIndex:i]);
|
||||
GdkAtom atom = _gtk_quartz_pasteboard_type_to_atom ([array objectAtIndex:i]);
|
||||
|
||||
result = g_list_prepend (result, GDK_ATOM_TO_POINTER (atom));
|
||||
}
|
||||
@@ -234,17 +266,20 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
|
||||
GtkSelectionData *selection_data)
|
||||
{
|
||||
NSString *type;
|
||||
gchar *target;
|
||||
GdkDisplay *display;
|
||||
gint format;
|
||||
const guchar *data;
|
||||
NSUInteger length;
|
||||
|
||||
target = gdk_atom_name (gtk_selection_data_get_target (selection_data));
|
||||
display = gtk_selection_data_get_display (selection_data);
|
||||
format = gtk_selection_data_get_format (selection_data);
|
||||
data = gtk_selection_data_get_data (selection_data);
|
||||
length = gtk_selection_data_get_length (selection_data);
|
||||
|
||||
type = gdk_quartz_atom_to_pasteboard_type_libgtk_only (gtk_selection_data_get_target (selection_data));
|
||||
type = target_to_pasteboard_type (target);
|
||||
g_free (target);
|
||||
|
||||
if ([type isEqualTo:NSStringPboardType])
|
||||
[pasteboard setString:[NSString stringWithUTF8String:(const char *)data]
|
||||
|
||||
@@ -29,6 +29,7 @@ NSSet *_gtk_quartz_target_entries_to_pasteboard_types (const GtkTargetEntry *t
|
||||
guint n_targets);
|
||||
|
||||
GList *_gtk_quartz_pasteboard_types_to_atom_list (NSArray *array);
|
||||
GdkAtom _gtk_quartz_pasteboard_type_to_atom (NSString *type);
|
||||
|
||||
GtkSelectionData *_gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
|
||||
GdkAtom target,
|
||||
|
||||
@@ -903,6 +903,7 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
|
||||
gint indicator_size, indicator_spacing;
|
||||
gint focus_width;
|
||||
gint focus_pad;
|
||||
gint baseline;
|
||||
guint border_width;
|
||||
gboolean interior_focus;
|
||||
|
||||
@@ -923,9 +924,14 @@ gtk_radio_button_draw_indicator (GtkCheckButton *check_button,
|
||||
_gtk_check_button_get_props (check_button, &indicator_size, &indicator_spacing);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
|
||||
x = indicator_spacing + border_width;
|
||||
y = (allocation.height - indicator_size) / 2;
|
||||
if (baseline == -1)
|
||||
y = (allocation.height - indicator_size) / 2;
|
||||
else
|
||||
y = CLAMP (baseline - indicator_size * button->priv->baseline_align,
|
||||
0, allocation.height - indicator_size);
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (check_button));
|
||||
if (!interior_focus || !(child && gtk_widget_get_visible (child)))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user