Compare commits
273 Commits
3.15.10
...
wip/cssnode3
| Author | SHA1 | Date | |
|---|---|---|---|
| 1af58dc4ee | |||
| cb1cf06744 | |||
| c5d00ae119 | |||
| 15582ef9c1 | |||
| 0e57785af7 | |||
| 52f58f1637 | |||
| cd87252130 | |||
| 85d86d61de | |||
| 0d01ceb415 | |||
| aa005486de | |||
| cdd26d0d01 | |||
| f408c59869 | |||
| 4326e38b90 | |||
| 0f488064a2 | |||
| e6c7e038c8 | |||
| 18bd973014 | |||
| dae2d9ec27 | |||
| c0c79eee03 | |||
| 3f13349f27 | |||
| d6bfc2b9c9 | |||
| fa1bb8972a | |||
| 8e82d0fba2 | |||
| 7b1ff7c215 | |||
| 3211e82b59 | |||
| 6c8c37abbb | |||
| d5160bb950 | |||
| a59fd4a9ad | |||
| 4d0e1e0b88 | |||
| d48ba486ee | |||
| 7dac38f841 | |||
| ec57c6c10b | |||
| d55c261079 | |||
| 8640bc47b1 | |||
| d0d9f5a302 | |||
| 10d39171d9 | |||
| 6988f9b818 | |||
| c7fba52a36 | |||
| 7395dddd47 | |||
| d785820c53 | |||
| 759d8dafd9 | |||
| d9727290cf | |||
| 68b8f792d6 | |||
| 776d99ac51 | |||
| 092ff983f7 | |||
| df51bc836b | |||
| 3d1e2a0558 | |||
| 399df06d19 | |||
| 6dd19306eb | |||
| f43543165b | |||
| 2954417335 | |||
| 172f345d01 | |||
| fbe796f293 | |||
| 2ec26cd9b5 | |||
| 4b2cdb37fb | |||
| dbe5058b86 | |||
| 5833858abf | |||
| ceaa594fa4 | |||
| cadf6a9d3c | |||
| 16b8972bee | |||
| c0f6e746a0 | |||
| 13fd368781 | |||
| 75b633ae08 | |||
| da25771e58 | |||
| e95985da26 | |||
| 6f9969f4fe | |||
| b827725ace | |||
| 6c00eba7fb | |||
| d3471508a0 | |||
| 9b73b39f9a | |||
| 2670ae4436 | |||
| 2694545468 | |||
| ee91fb71ca | |||
| b92fe2fa85 | |||
| 507016cafc | |||
| 310f9f40da | |||
| ee6d081ed9 | |||
| 89115be3cb | |||
| 2a5194b635 | |||
| 2143abe5ee | |||
| 76ca9a9181 | |||
| 2bf7bdd651 | |||
| 630f0f199e | |||
| 5df01f9244 | |||
| 5edc6d94d1 | |||
| ffb410f11e | |||
| 28043f0a92 | |||
| efda30c495 | |||
| 020f3f11c8 | |||
| cdd964a3af | |||
| 5f19f09ac3 | |||
| caf2fc9a10 | |||
| 219e52f7e1 | |||
| 71813671ef | |||
| c550cf122a | |||
| 649edbe2fc | |||
| c4b88e05fd | |||
| 637a4bda5c | |||
| 03ac5f310b | |||
| 6dc6af674c | |||
| 4cc2af2db1 | |||
| 8e1017db35 | |||
| 55e68bc2ea | |||
| a589f98821 | |||
| 721dce73e0 | |||
| 8c73799ca8 | |||
| 7bafb63ec3 | |||
| d79a44c1af | |||
| 6f99a3cdb0 | |||
| 0e3da2f7cf | |||
| b9f1f8aa38 | |||
| 21c3b13596 | |||
| 40d94fcd38 | |||
| e2f6d4db43 | |||
| 726d8abb7d | |||
| cf6d9edc12 | |||
| be596f3967 | |||
| 99c4f2dd39 | |||
| 0529e15d61 | |||
| dcfa55ac7e | |||
| 28063ee2e4 | |||
| 416c370da1 | |||
| d823c39caf | |||
| 00544e9090 | |||
| 3d3591e873 | |||
| 49b6be4e06 | |||
| 557f5d5c7c | |||
| bcddf68858 | |||
| 75105f94f0 | |||
| f671cd6296 | |||
| 9b5fa0860f | |||
| 390dd37656 | |||
| 88a5959b22 | |||
| 27164484cd | |||
| 6f478db2fa | |||
| d5d28a5062 | |||
| 4e930ada32 | |||
| c7672699e9 | |||
| 855c4dc0ce | |||
| 70e7b4c848 | |||
| b4b23580a6 | |||
| b4e61b759b | |||
| f5f6ad9981 | |||
| 2e272106ef | |||
| 2d013a739a | |||
| a24aee6bb2 | |||
| 225c10bc5a | |||
| 7372ddd2a1 | |||
| 465647e964 | |||
| 7b2cdabc2e | |||
| c7be8fd398 | |||
| 6675b9639c | |||
| 49cd3c8232 | |||
| 25b610ef5e | |||
| de239ca31b | |||
| 5dfbeb978f | |||
| e98b096ca8 | |||
| 399d2c1389 | |||
| 59a901e285 | |||
| 8d58b64c28 | |||
| 0df9b59dfc | |||
| 17a221dba9 | |||
| e6f9c49c22 | |||
| 11096885ae | |||
| 838c9a0d98 | |||
| c5905b13b9 | |||
| d2881d901b | |||
| 7ef7873b23 | |||
| 10ea4d81e6 | |||
| 2026efb981 | |||
| e41cadd835 | |||
| 0ddb5d729c | |||
| bb3ae47477 | |||
| a744a67f42 | |||
| c93d66c8a7 | |||
| a7ef117b4a | |||
| f0609a5142 | |||
| d89bd0040c | |||
| fec8a1ee7f | |||
| 98730f71f9 | |||
| b756fd42a0 | |||
| 4d889ccc42 | |||
| 5f8e054a9d | |||
| fe13fb841b | |||
| 1349b0f72d | |||
| b974ced51b | |||
| c9faea04c5 | |||
| 171d4305f4 | |||
| d96cbb3b59 | |||
| e944525596 | |||
| 49881eebbb | |||
| 8615a52ca3 | |||
| 7ad203732f | |||
| 93f8966bd9 | |||
| 181e58e402 | |||
| 63f59dde3a | |||
| b2d40afdf5 | |||
| f82341d1d3 | |||
| 80013436d0 | |||
| 52858f709c | |||
| d65ccf96ee | |||
| 3b45be94e8 | |||
| b4344861a0 | |||
| a52ff2f66e | |||
| 073a9c9cd5 | |||
| 622a930c5a | |||
| 2f8938cf23 | |||
| 1cc35cdc6d | |||
| 9e2cdce58e | |||
| 94ec6b4418 | |||
| c352093bde | |||
| ac4da770e1 | |||
| 5ced234144 | |||
| 9ec2804775 | |||
| f8eac08a0a | |||
| af36220bca | |||
| 8e3b499699 | |||
| 968780d8da | |||
| 4fc6880d83 | |||
| 51971d56bc | |||
| c7f5f10853 | |||
| 61c46d911f | |||
| 19222a6364 | |||
| 7479133753 | |||
| 0282714d86 | |||
| 586240d2f8 | |||
| e99e282b5a | |||
| 52f5a78c6d | |||
| 01d76b7701 | |||
| 59d12be94f | |||
| 9b18deee1f | |||
| 7385784ded | |||
| 6950116678 | |||
| 247e62390b | |||
| ec567e5fad | |||
| 6b23c44056 | |||
| f6d0b9e9a9 | |||
| 70775e1985 | |||
| 8ecc51ad8a | |||
| 4938aa9c6b | |||
| 1f3328c096 | |||
| 6e7ad732fc | |||
| cbf5b49cb8 | |||
| b3725a455d | |||
| 9c545ac2e8 | |||
| b87715973f | |||
| 064f4db012 | |||
| 45da8bf045 | |||
| 91bc414360 | |||
| e2190d7a01 | |||
| 7fbbf850c3 | |||
| 1fb172011c | |||
| 4691049f9e | |||
| 40c8d8bcf4 | |||
| 08b5de7836 | |||
| 6ac3ec0b53 | |||
| 2b7eaaf86e | |||
| 08494f86a0 | |||
| 768e6a4579 | |||
| ce9a5a3fec | |||
| 17bc7aaefd | |||
| 71bd1c7e2c | |||
| b92573e42e | |||
| 76c66ef2ed | |||
| 5751d4f66e | |||
| b2f3b67494 | |||
| a994f4edfb | |||
| 79321c0d8a | |||
| 48c93fb347 | |||
| 163f7e75bf | |||
| bb78a39103 | |||
| 05ef31362d | |||
| a4f69408ac | |||
| e31a936e3e |
+2
-1
@@ -21,7 +21,8 @@ EXTRA_DIST += \
|
||||
gtk-zip.sh.in \
|
||||
sanitize-la.sh \
|
||||
po/README.translators \
|
||||
po/po2tbl.sed.in
|
||||
po/po2tbl.sed.in \
|
||||
make-pot
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
$(GITIGNORE_MAINTAINERCLEANFILES_TOPLEVEL) \
|
||||
|
||||
@@ -1,3 +1,82 @@
|
||||
Overview of Changes in GTK+ 3.15.12
|
||||
===================================
|
||||
|
||||
* GtkMenuButton:
|
||||
- Improve accessible names
|
||||
|
||||
* GtkCellRendererPixbuf:
|
||||
- Always follow state changes, the ::follow-state property
|
||||
is now ignored. This is necessary to make HighContrast
|
||||
and symbolic icons remain visible e.g. in selected rows.
|
||||
|
||||
* GtkEntry:
|
||||
- Rework the size allocation code to be less arcane. This
|
||||
changed the semantics of the get_frame_size() vfunc. GtkEntry
|
||||
subclasses that override this vfunc may need adjustment.
|
||||
|
||||
* Wayland:
|
||||
- Support hi-dpi cursors
|
||||
|
||||
* Bugs fixed:
|
||||
745829 crash when double-clicking close button while popover...
|
||||
746141 wayland: Support HiDPI pointer cursors
|
||||
746192 Insensitive backdrop ToolButtons are not drawn correctly
|
||||
746201 Sidebar icons are black on black in HighContrast theme
|
||||
746202 use insensitive color for unfocused selected items
|
||||
746205 gemfile: needs add source rubygems.org
|
||||
746282 pixman warnings after recent changes
|
||||
746301 Opening "Sound" panel generates pixman error
|
||||
|
||||
* Translation updates:
|
||||
Bosnian
|
||||
Bulgarian
|
||||
Catalan
|
||||
Danish
|
||||
Punjabi
|
||||
Slovenian
|
||||
Swedish
|
||||
Vietnamese
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.11
|
||||
===================================
|
||||
|
||||
* Go back to requiring GTK_FRAME_EXTENTS support for CSD,
|
||||
to fix shadow problems in KDE.
|
||||
|
||||
* Bug fixes:
|
||||
535929 Fix warnings from xReply test in configure.in
|
||||
577862 FileFilter name not set
|
||||
669008 Kerberos authentication popup
|
||||
712760 Clang static analysis fixes
|
||||
739070 Undefined reference to get_xkb() when building with --disable-xkb
|
||||
744288 gdk_gl_context_set_required_version() handles version requests...
|
||||
744589 nautilus bookmarks changing places randomly
|
||||
745065 GtkPrintOperation dialog creation fails when GTK is locally loaded
|
||||
745463 Search suggestions are not shown in Clocks / Weather
|
||||
745479 Tracker search in file chooser causes a crash
|
||||
745562 gedit titlebar is no longer draggable
|
||||
745578 sincos is not portable
|
||||
745622 Selected text not highlighted in GtkInfoBar
|
||||
745721 wayland: Add support for gtk_window_set_modal
|
||||
745918 add padding to textview in CSS section of GtkInspector
|
||||
745969 CSD windows cannot be moved immediately after being resized
|
||||
746013 Invalid write of size 8
|
||||
Print dialog: Fix icons in HighContrast
|
||||
Fix selected menu items in HighContrast
|
||||
App chooser: Fix icons in HighContrast
|
||||
|
||||
* Translation updates:
|
||||
French
|
||||
Galician
|
||||
Kazakh
|
||||
Korean
|
||||
Lithuanian
|
||||
Polish
|
||||
Slovak
|
||||
Swedish
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.15.10
|
||||
===================================
|
||||
|
||||
|
||||
@@ -99,6 +99,11 @@ Release notes for 3.16
|
||||
has non-scrolling parts similar to treeview headers, there is no need
|
||||
to implement this vfunc.
|
||||
|
||||
* The GtkSearchEntry widget has gained a number of new signal that
|
||||
are emitted when certain key sequences are seen. In particular, it
|
||||
now handles the Escape key and emits ::stop-search. Applications that
|
||||
expect to handle Escape themselves will need to be updated.
|
||||
|
||||
Release notes for 3.14
|
||||
======================
|
||||
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -113,6 +114,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -135,6 +137,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
@@ -158,6 +161,7 @@
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<ModuleDefinitionFile>..\..\..\libgail-util\gailutil.def</ModuleDefinitionFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -147,6 +147,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -169,6 +170,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -188,6 +190,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -209,6 +212,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -233,6 +237,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -255,6 +260,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -274,6 +280,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -295,6 +302,7 @@
|
||||
<AdditionalDependencies>imm32.lib;winmm.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
<AdditionalIncludeDirectories>..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ForcedIncludeFiles>msvc_recommended_pragmas.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<AdditionalOptions>/d2Zi+ %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<AdditionalDependencies>pangocairo-1.0.lib;cairo.lib;cairo-gobject.lib;pango-1.0.lib;gdk_pixbuf-2.0.lib;gio-2.0.lib;gmodule-2.0.lib;gobject-2.0.lib;glib-2.0.lib;intl.lib;epoxy.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
|
||||
@@ -11,26 +11,69 @@
|
||||
<GtkDoInstallBin>
|
||||
mkdir $(CopyDir)\bin
|
||||
mkdir $(CopyDir)\lib
|
||||
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_BIN
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\*.dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\*-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\*.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gailutil-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\gtk3-demo.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-demo-application.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk3-icon-browser.pdb" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.exe" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gtk-encode-symbolic-svg.pdb" $(CopyDir)\bin
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_BIN
|
||||
copy "$(BinDir)\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll" $(CopyDir)\bin
|
||||
copy "$(BinDir)\gdk-$(ApiVersion).lib" $(CopyDir)\lib
|
||||
copy "$(BinDir)\broadwayd.exe" $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Release_Broadway" copy .\Release\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
if "$(Configuration)" == "Debug_Broadway" copy .\Debug\$(Platform)\bin\*.exe $(CopyDir)\bin
|
||||
copy "$(BinDir)\broadwayd.pdb" $(CopyDir)\bin
|
||||
|
||||
if "$(Configuration)" == "Release_Broadway" goto DO_BROADWAY_RELEASE
|
||||
if "$(Configuration)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG
|
||||
:DO_BROADWAY_RELEASE
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Release\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
goto DONE_BIN
|
||||
|
||||
:DO_BROADWAY_DEBUG
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-demo-application.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin
|
||||
copy .\Debug\$(Platform)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin
|
||||
|
||||
:DONE_BIN
|
||||
</GtkDoInstallBin>
|
||||
<GtkDoInstall>
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX86</TargetMachine>
|
||||
@@ -108,6 +109,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
@@ -132,6 +134,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
|
||||
<TargetMachine>MachineX64</TargetMachine>
|
||||
@@ -151,6 +154,7 @@
|
||||
<AdditionalDependencies>atk-1.0.lib;pangowin32-1.0.lib;imm32.lib;winspool.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<OutputFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).dll</OutputFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(GtkDllPrefix)$(ProjectName)$(GtkDllSuffix).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
|
||||
@@ -161,6 +161,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c" />
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserapp.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconbrowserwin.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\iconstore.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\main.c"><Filter>Sources</Filter></ClCompile>
|
||||
<ClCompile Include="..\..\..\demos\icon-browser\resources.c"><Filter>Sources</Filter></ClCompile>
|
||||
</ItemGroup>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
AdditionalIncludeDirectories="..\..\..;$(GlibEtcInstallRoot)\lib\glib-2.0\include;$(GlibEtcInstallRoot)\include\glib-2.0;$(GlibEtcInstallRoot)\include;$(GlibEtcInstallRoot)\include\cairo;$(GlibEtcInstallRoot)\include\atk-1.0;$(GlibEtcInstallRoot)\include\pango-1.0;$(GlibEtcInstallRoot)\include\gdk-pixbuf-2.0"
|
||||
PreprocessorDefinitions="HAVE_CONFIG_H;G_DISABLE_SINGLE_INCLUDES;ATK_DISABLE_SINGLE_INCLUDES;GDK_PIXBUF_DISABLE_SINGLE_INCLUDES;GTK_DISABLE_SINGLE_INCLUDES"
|
||||
ForcedIncludeFiles="msvc_recommended_pragmas.h"
|
||||
AdditionalOptions="/MP"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
|
||||
@@ -10,26 +10,63 @@
|
||||
Value="
|
||||
mkdir $(CopyDir)\bin

|
||||
mkdir $(CopyDir)\lib

|
||||
|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_BIN

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_BIN

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\$(GtkDllPrefix)gdk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\gdk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Release_Broadway" copy .\Release\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" copy .\Debug\$(PlatformName)\bin\*.exe $(CopyDir)\bin

|
||||
copy $(ConfigurationName)\$(PlatformName)\bin\broadwayd.pdb $(CopyDir)\bin

|
||||
|
||||
if "$(ConfigurationName)" == "Release_Broadway" goto DO_BROADWAY_RELEASE

|
||||
if "$(ConfigurationName)" == "Debug_Broadway" goto DO_BROADWAY_DEBUG

|
||||
:DO_BROADWAY_RELEASE

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Release\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
goto DONE_BIN

|
||||
|
||||
:DO_BROADWAY_DEBUG

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gtk$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\$(GtkDllPrefix)gailutil$(GtkDllSuffix).dll $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gailutil-$(ApiVersion).lib $(CopyDir)\lib

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-demo-application.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk3-icon-browser.pdb $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.exe $(CopyDir)\bin

|
||||
copy .\Debug\$(PlatformName)\bin\gtk-encode-symbolic-svg.pdb $(CopyDir)\bin

|
||||
:DONE_BIN

|
||||
"
|
||||
/>
|
||||
|
||||
@@ -158,6 +158,7 @@
|
||||
>
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserapp.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconbrowserwin.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\iconstore.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\main.c" />
|
||||
<File RelativePath="..\..\..\demos\icon-browser\resources.c" />
|
||||
</Filter>
|
||||
|
||||
@@ -141,6 +141,9 @@
|
||||
#define HAVE_ROUND 1
|
||||
#endif
|
||||
|
||||
/* Define to 1 if sincos() is available */
|
||||
/* #undef HAVE_SINCOS */
|
||||
|
||||
/* Have the sockaddr_un.sun_len member */
|
||||
/* #undef HAVE_SOCKADDR_UN_SUN_LEN */
|
||||
|
||||
|
||||
+11
-17
@@ -10,7 +10,7 @@
|
||||
|
||||
m4_define([gtk_major_version], [3])
|
||||
m4_define([gtk_minor_version], [15])
|
||||
m4_define([gtk_micro_version], [10])
|
||||
m4_define([gtk_micro_version], [12])
|
||||
m4_define([gtk_interface_age], [0])
|
||||
m4_define([gtk_binary_age],
|
||||
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
|
||||
@@ -826,7 +826,7 @@ AC_TYPE_UID_T
|
||||
|
||||
# Check for round(), rint(), isnan(), isinf() and nearbyint()
|
||||
AC_CHECK_LIB(m,round,,)
|
||||
AC_CHECK_FUNCS(round rint nearbyint)
|
||||
AC_CHECK_FUNCS(round rint nearbyint sincos)
|
||||
AC_CHECK_DECLS([isnan, isinf], [], [], [[#include <math.h>]])
|
||||
|
||||
# Checks for gdkspawn
|
||||
@@ -1031,22 +1031,16 @@ if test "x$enable_x11_backend" = xyes; then
|
||||
AC_CHECK_FUNC(XextFindDisplay, :,
|
||||
AC_MSG_ERROR([*** libX11 and libXext not found. Check 'config.log' for more details.]))
|
||||
|
||||
# Check for xReply
|
||||
# Check if <X11/extensions/XIproto.h> is needed for xReply.
|
||||
|
||||
AC_MSG_CHECKING([if <X11/extensions/XIproto.h> is needed for xReply])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([no])],
|
||||
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]],
|
||||
[[xReply *rep = NULL;
|
||||
rep = rep;]])],
|
||||
[AC_MSG_RESULT([yes])
|
||||
AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], [1],
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_RESULT([unknown])
|
||||
AC_MSG_ERROR([xReply type unavailable. X11 is too old])])])
|
||||
AC_CHECK_TYPE([xReply], ,
|
||||
[AC_CHECK_TYPE([xReply],
|
||||
[AC_DEFINE([NEED_XIPROTO_H_FOR_XREPLY], 1,
|
||||
[Define if <X11/extensions/XIproto.h> needed for xReply])],
|
||||
[AC_MSG_ERROR([xReply type unavailable. X11 is too old])],
|
||||
[[#include <X11/extensions/XIproto.h>
|
||||
#include <X11/Xlibint.h>]])],
|
||||
[[#include <X11/Xlibint.h>]])
|
||||
|
||||
# Check for XKB support.
|
||||
|
||||
|
||||
@@ -218,7 +218,6 @@ add_columns (GtkTreeView *treeview)
|
||||
|
||||
/* column for symbolic icon */
|
||||
renderer = gtk_cell_renderer_pixbuf_new ();
|
||||
g_object_set (G_OBJECT (renderer), "follow-state", TRUE, NULL);
|
||||
column = gtk_tree_view_column_new_with_attributes ("Symbolic icon",
|
||||
renderer,
|
||||
"icon-name",
|
||||
|
||||
@@ -543,7 +543,7 @@ add_data_tab (const gchar *demoname)
|
||||
* not an image. Let's try something else then.
|
||||
*/
|
||||
g_object_ref_sink (widget);
|
||||
gtk_widget_destroy (widget);
|
||||
g_object_unref (widget);
|
||||
|
||||
bytes = g_resources_lookup_data (resource_name, 0, NULL);
|
||||
g_assert (bytes);
|
||||
|
||||
@@ -62,6 +62,7 @@ uninstall-update-icon-cache:
|
||||
|
||||
EXTRA_DIST += \
|
||||
widget-factory.ui \
|
||||
widget-factory.css \
|
||||
menus.ui \
|
||||
widget-factory.gresource.xml \
|
||||
data/source.svg \
|
||||
|
||||
@@ -1157,7 +1157,7 @@ activate (GApplication *app)
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, ".circular-button { border-radius: 20px; outline-radius: 20px; }", -1, NULL);
|
||||
gtk_css_provider_load_from_resource (provider, "/org/gtk/WidgetFactory/widget-factory.css");
|
||||
gtk_style_context_add_provider_for_screen (gdk_screen_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
GTK_STYLE_PROVIDER_PRIORITY_USER);
|
||||
@@ -1336,6 +1336,7 @@ int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkApplication *app;
|
||||
GAction *action;
|
||||
static GActionEntry app_entries[] = {
|
||||
{ "about", activate_about, NULL, NULL, NULL },
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
@@ -1353,6 +1354,8 @@ main (int argc, char *argv[])
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (app),
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
action = g_action_map_lookup_action (G_ACTION_MAP (app), "wine");
|
||||
g_simple_action_set_enabled (G_SIMPLE_ACTION (action), FALSE);
|
||||
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
.circular-button {
|
||||
border-radius: 20px;
|
||||
outline-radius: 20px;
|
||||
}
|
||||
|
||||
.small-button {
|
||||
padding: 0;
|
||||
outline-width: 0;
|
||||
}
|
||||
@@ -3,6 +3,9 @@
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file preprocess="xml-stripblanks">widget-factory.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory">
|
||||
<file>widget-factory.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory/gtk">
|
||||
<file preprocess="xml-stripblanks">menus.ui</file>
|
||||
</gresource>
|
||||
|
||||
@@ -1571,9 +1571,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="title" translatable="yes">Icon</property>
|
||||
<property name="reorderable">True</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1">
|
||||
<property name="follow_state">true</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="cellrendererpixbuf1"/>
|
||||
<attributes>
|
||||
<attribute name="icon_name">1</attribute>
|
||||
</attributes>
|
||||
@@ -2896,6 +2894,15 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Search for it</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="sensitive">False</property>
|
||||
<property name="label" translatable="yes">Insert</property>
|
||||
<property name="icon-name">insert-image</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert something</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3074,9 +3081,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="selection_mode">multiple</property>
|
||||
<property name="model">iconsmodel</property>
|
||||
<child>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell">
|
||||
<property name="follow-state">True</property>
|
||||
</object>
|
||||
<object class="GtkCellRendererPixbuf" id="iconviewcell"/>
|
||||
<attributes>
|
||||
<attribute name="icon-name">0</attribute>
|
||||
</attributes>
|
||||
@@ -3622,6 +3627,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkToolbar">
|
||||
<property name="visible">True</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<property name="icon-size">1</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
@@ -3861,11 +3867,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="height-request">120</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
@@ -3873,11 +3909,41 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="tab-expand">True</property>
|
||||
<property name="tab-fill">True</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child type="tab">
|
||||
<object class="GtkLabel">
|
||||
<object class="GtkBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
<property name="orientation">horizontal</property>
|
||||
<child type="center">
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">True</property>
|
||||
<property name="label" translatable="yes">Page 2</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="visible">True</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="focus-on-click">False</property>
|
||||
<style>
|
||||
<class name="small-button"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkImage">
|
||||
<property name="visible">True</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<property name="icon-size">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="pack-type">end</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
||||
+154
-24
@@ -19,87 +19,217 @@ HFILE_GLOB=$(top_srcdir)/gtk/*.h
|
||||
CFILE_GLOB=$(top_srcdir)/gtk/*.c
|
||||
|
||||
# Header files to ignore when scanning
|
||||
IGNORE_HFILES= \
|
||||
IGNORE_HFILES = \
|
||||
inspector \
|
||||
a11y \
|
||||
gtkaccelgroupprivate.h \
|
||||
gtkaccelmapprivate.h \
|
||||
gtkadjustmentprivate.h \
|
||||
gtkallocatedbitmaskprivate.h \
|
||||
gtkappchooserprivate.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbindingsprivate.h \
|
||||
gtkbitmaskprivate.h \
|
||||
gtkboxprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkbuttonprivate.h \
|
||||
gtkcairoblurprivate.h \
|
||||
gtkcellareaboxcontextprivate.h \
|
||||
gtkclipboardprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkcomboboxprivate.h \
|
||||
gtkcontainerprivate.h \
|
||||
gtkcssanimatedstyleprivate.h \
|
||||
gtkcssanimationprivate.h \
|
||||
gtkcssarrayvalueprivate.h \
|
||||
gtkcssbgsizevalueprivate.h \
|
||||
gtkcssbordervalueprivate.h \
|
||||
gtkcsscolorvalueprivate.h \
|
||||
gtkcsscornervalueprivate.h \
|
||||
gtkcsscustompropertyprivate.h \
|
||||
gtkcsseasevalueprivate.h \
|
||||
gtkcssenginevalueprivate.h \
|
||||
gtkcssenumvalueprivate.h \
|
||||
gtkcssiconthemevalueprivate.h \
|
||||
gtkcssimagebuiltinprivate.h \
|
||||
gtkcssimagecrossfadeprivate.h \
|
||||
gtkcssimagegradientprivate.h \
|
||||
gtkcssimageiconthemeprivate.h \
|
||||
gtkcssimagelinearprivate.h \
|
||||
gtkcssimageprivate.h \
|
||||
gtkcssimagescaledprivate.h \
|
||||
gtkcssimagesurfaceprivate.h \
|
||||
gtkcssimageurlprivate.h \
|
||||
gtkcssimagevalueprivate.h \
|
||||
gtkcssimagewin32private.h \
|
||||
gtkcssinheritvalueprivate.h \
|
||||
gtkcssinitialvalueprivate.h \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
gtkcssrgbavalueprivate.h \
|
||||
gtkcsssectionprivate.h \
|
||||
gtkcssselectorprivate.h \
|
||||
gtkcssshadowsvalueprivate.h \
|
||||
gtkcssshadowvalueprivate.h \
|
||||
gtkcssshorthandpropertyprivate.h\
|
||||
gtkcssstaticstyleprivate.h \
|
||||
gtkcssstringvalueprivate.h \
|
||||
gtkcssstylefuncsprivate.h \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcsstypesprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
gtkeventcontrollerprivate.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfontchooserprivate.h \
|
||||
gtkgesturedragprivate.h \
|
||||
gtkgesturelongpressprivate.h \
|
||||
gtkgesturemultipressprivate.h \
|
||||
gtkgesturepanprivate.h \
|
||||
gtkgestureprivate.h \
|
||||
gtkgesturerotateprivate.h \
|
||||
gtkgesturesingleprivate.h \
|
||||
gtkgestureswipeprivate.h \
|
||||
gtkgesturezoomprivate.h \
|
||||
gtkheaderbarprivate.h \
|
||||
gtkhslaprivate.h \
|
||||
gtkiconhelperprivate.h \
|
||||
gtkiconviewprivate.h \
|
||||
gtkimageprivate.h \
|
||||
gtkimmoduleprivate.h \
|
||||
gtklabelprivate.h \
|
||||
gtklockbuttonprivate.h \
|
||||
gtkmagnifierprivate.h \
|
||||
gtkmenubuttonprivate.h \
|
||||
gtkmenuitemprivate.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmenushellprivate.h \
|
||||
gtkmodulesprivate.h \
|
||||
gtkmountoperationprivate.h \
|
||||
gtkorientableprivate.h \
|
||||
gtkpixelcacheprivate.h \
|
||||
gtkpopoverprivate.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkrangeprivate.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtkrenderbackgroundprivate.h \
|
||||
gtkrenderborderprivate.h \
|
||||
gtkrendericonprivate.h \
|
||||
gtkrenderprivate.h \
|
||||
gtkroundedboxprivate.h \
|
||||
gtkscaleprivate.h \
|
||||
gtksearchentryprivate.h \
|
||||
gtkselectionprivate.h \
|
||||
gtksettingsprivate.h \
|
||||
gtksizegroup-private.h \
|
||||
gtksizerequestcacheprivate.h \
|
||||
gtksocketprivate.h \
|
||||
gtkstyleanimationprivate.h \
|
||||
gtkstylecascadeprivate.h \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktogglebuttonprivate.h \
|
||||
gtktoolbarprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktooltipprivate.h \
|
||||
gtktreeprivate.h \
|
||||
gtkwidgetprivate.h \
|
||||
gtkwin32themeprivate.h \
|
||||
gtkwindowprivate.h \
|
||||
fnmatch.h \
|
||||
gtkactionmuxer.h \
|
||||
gtkactionobserver.h \
|
||||
gtkactionobservable.h \
|
||||
gtk9slice.h \
|
||||
gtkanimationdescription.h \
|
||||
gtkbitmaskprivateimpl.h \
|
||||
gtkbookmarksmanager.h \
|
||||
gtkdbusgenerated.c \
|
||||
gtkdbusgenerated.h \
|
||||
gtkdebug.h \
|
||||
gtkactionhelper.h \
|
||||
gtkapplicationprivate.h \
|
||||
gtkbuilderprivate.h \
|
||||
gtkcolorchooserprivate.h \
|
||||
gtkcoloreditorprivate.h \
|
||||
gtkcolorplaneprivate.h \
|
||||
gtkcolorscaleprivate.h \
|
||||
gtkcolorswatchprivate.h \
|
||||
gtkdndcursors.h \
|
||||
gtkentryprivate.h \
|
||||
gtkfilechooserdefault.h \
|
||||
gtkfilechooserembed.h \
|
||||
gtkfilechooserentry.h \
|
||||
gtkfilechooserprivate.h \
|
||||
gtkfilechoosersettings.h \
|
||||
gtkfilechooserutils.h \
|
||||
gtkfilesystem.h \
|
||||
gtkfilesystemmodel.h \
|
||||
gtkfilesystemunix.h \
|
||||
gtkfilesystemwin32.h \
|
||||
gtkfontchooserutils.h \
|
||||
gtkiconcache.h \
|
||||
gtkiconcachevalidator.h \
|
||||
gtkiconthemeparser.h \
|
||||
gtkintl.h \
|
||||
gtkkeyhash.h \
|
||||
gtkkineticscrolling.h \
|
||||
gtkmarshal.h \
|
||||
gtkmenuprivate.h \
|
||||
gtkmnemonichash.h \
|
||||
gtkmenutracker.h \
|
||||
gtkmenutrackeritem.h \
|
||||
gtkmenusectionbox.h \
|
||||
gtkmodelmenu.h \
|
||||
gtkmodelmenuitem.h \
|
||||
gtkmodifierstyle.h \
|
||||
gtkpathbar.h \
|
||||
gtkplugprivate.h \
|
||||
gtkprintbackend.h \
|
||||
gtkprinteroption.h \
|
||||
gtkprinteroptionset.h \
|
||||
gtkprinteroptionwidget.h \
|
||||
gtkprinter-private.h \
|
||||
gtkprint-win32.h \
|
||||
gtkprintutils.h \
|
||||
gtkprintoperation-private.h \
|
||||
gtkprivate.h \
|
||||
gtkprivatetypebuiltins.h \
|
||||
gtkquery.h \
|
||||
gtkrbtree.h \
|
||||
gtkrecentchooserdefault.h \
|
||||
gtkrecentchooserutils.h \
|
||||
gtkrecentchooserprivate.h \
|
||||
gtksearchengine.h \
|
||||
gtksearchenginebeagle.h \
|
||||
gtksearchenginetracker.h \
|
||||
gtksearchenginesimple.h \
|
||||
gtksearchenginequartz.h \
|
||||
gtksequence.h \
|
||||
gtksocketprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserializ.h \
|
||||
gtktextchildprivate.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextdisplay.h \
|
||||
gtktexthandleprivate.h \
|
||||
gtktextiterprivate.h \
|
||||
gtktextlayout.h \
|
||||
gtktextmarkprivate.h \
|
||||
gtktextsegment.h \
|
||||
gtktexttagprivate.h \
|
||||
gtktexttypes.h \
|
||||
gtktextutil.h \
|
||||
gtktimeline.h \
|
||||
gtkthemes.h \
|
||||
gtktrashmonitor.h \
|
||||
gtktrayicon.h \
|
||||
gtktreedatalist.h \
|
||||
gtktreeprivate.h \
|
||||
gtktoolpaletteprivate.h \
|
||||
gtktreemenu.h \
|
||||
gtktypebuiltins.h \
|
||||
gtkxembed.h \
|
||||
gtkwin32embed.h \
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
application. Inside the activate() function we want to construct
|
||||
our GTK window, so that a window is shown when the application
|
||||
is launched. The call to gtk_application_window_new() will
|
||||
createa a new #GtkWindow and store it inside the
|
||||
create a new #GtkWindow and store it inside the
|
||||
<varname>window</varname> pointer. The window will have a frame,
|
||||
a title bar, and window controls depending on the platform.</para>
|
||||
|
||||
@@ -165,6 +165,47 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<para>As seen above, example-1.c builds further upon example-0.c by adding a
|
||||
button to our window, with the label "Hello World". Two new GtkWidget pointers
|
||||
are declared to accomplish this, <varname>button</varname> and
|
||||
<varname>button_box</varname>. The button_box variable is created to store a
|
||||
#GtkButtonBox which is GTK+'s way of controlling the size and layout of buttons.
|
||||
The #GtkButtonBox is created and assigned to gtk_button_box_new() which takes a
|
||||
#GtkOrientation enum as parameter. The buttons which this box will contain can
|
||||
either be stored horizontally or vertically but this does not matter in this
|
||||
particular case as we are dealing with only one button. After initializing
|
||||
button_box with horizontal orientation, the code adds the button_box widget to the
|
||||
window widget using gtk_container_add().</para>
|
||||
|
||||
<para>Next the <varname>button</varname> variable is initialized in similar manner.
|
||||
gtk_button_new_with_label() is called which returns a GtkButton to be stored inside
|
||||
<varname>button</varname>. Afterwards <varname>button</varname> is added to
|
||||
our <varname>button_box</varname>.
|
||||
Using g_signal_connect the button is connected to a function in our app called
|
||||
print_hello(), so that when the button is clicked, GTK will call this function.
|
||||
As the print_hello() function does not use any data as input, NULL is passed
|
||||
to it. print_hello() calls g_print() with the string "Hello World"
|
||||
which will print Hello World in a terminal if the GTK application was started
|
||||
from one.</para>
|
||||
|
||||
<para>After connecting print_hello(), another signal is connected to the "clicked" state
|
||||
of the button using g_signal_connect_swapped(). This functions is similar to
|
||||
a g_signal_connect() with the difference lying in how the callback function is
|
||||
treated. g_signal_connect_swapped() allow you to specify what the callback
|
||||
function should take as parameter by letting you pass it as data. In this case
|
||||
the function being called back is gtk_widget_destroy() and the <varname>window</varname>
|
||||
pointer is passed to it. This has the effect that when the button is clicked,
|
||||
the whole GTK window is destroyed. In contrast if a normal g_signal_connect() were used
|
||||
to connect the "clicked" signal with gtk_widget_destroy(), then the <varname>button</varname>
|
||||
itself would have been destroyed, not the window.
|
||||
More information about creating buttons can be found
|
||||
<ulink url="https://wiki.gnome.org/HowDoI/Buttons">here</ulink>.
|
||||
</para>
|
||||
|
||||
<para>The rest of the code in example-1.c is identical to example-0.c. Next
|
||||
section will elaborate further on how to add several GtkWidgets to your GTK
|
||||
application.</para>
|
||||
|
||||
<section>
|
||||
<title>Packing</title>
|
||||
|
||||
|
||||
@@ -329,6 +329,7 @@ GTK_ADJUSTMENT_CLASS
|
||||
GTK_IS_ADJUSTMENT_CLASS
|
||||
GTK_ADJUSTMENT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAdjustmentPrivate
|
||||
gtk_adjustment_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -565,6 +566,12 @@ gtk_list_box_row_set_selectable
|
||||
gtk_list_box_row_get_selectable
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_LIST_BOX
|
||||
GTK_LIST_BOX_CLASS
|
||||
GTK_LIST_BOX_GET_CLASS
|
||||
GTK_LIST_BOX_ROW
|
||||
GTK_LIST_BOX_ROW_CLASS
|
||||
GTK_LIST_BOX_ROW_GET_CLASS
|
||||
GTK_IS_LIST_BOX
|
||||
GTK_IS_LIST_BOX_CLASS
|
||||
GTK_IS_LIST_BOX_ROW
|
||||
@@ -1119,6 +1126,7 @@ gtk_editable_get_type
|
||||
<FILE>gtkentry</FILE>
|
||||
<TITLE>GtkEntry</TITLE>
|
||||
GtkEntry
|
||||
GtkEntryClass
|
||||
gtk_entry_new
|
||||
gtk_entry_new_with_buffer
|
||||
gtk_entry_get_buffer
|
||||
@@ -1207,6 +1215,8 @@ GTK_ENTRY_CLASS
|
||||
GTK_IS_ENTRY_CLASS
|
||||
GTK_ENTRY_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_TEXT_HANDLE_POSITION
|
||||
GTK_TYPE_TEXT_HANDLE_MODE
|
||||
GtkEntryPrivate
|
||||
gtk_entry_get_type
|
||||
</SECTION>
|
||||
@@ -1303,6 +1313,7 @@ GTK_EVENT_BOX_CLASS
|
||||
GTK_IS_EVENT_BOX_CLASS
|
||||
GTK_EVENT_BOX_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkEventBoxPrivate
|
||||
gtk_event_box_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -1634,6 +1645,7 @@ GTK_IS_FONT_CHOOSER_IFACE
|
||||
GTK_FONT_CHOOSER_GET_IFACE
|
||||
|
||||
<SUBSECTION Private>
|
||||
GTK_FONT_CHOOSER_DELEGATE_QUARK
|
||||
gtk_font_chooser_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2236,6 +2248,7 @@ GTK_MENU_CLASS
|
||||
GTK_IS_MENU_CLASS
|
||||
GTK_MENU_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuPrivate
|
||||
gtk_menu_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2288,7 +2301,7 @@ GTK_IS_MENU_BUTTON
|
||||
GTK_IS_MENU_BUTTON_CLASS
|
||||
GTK_MENU_BUTTON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuButtonrPrivate
|
||||
GtkMenuButtonPrivate
|
||||
gtk_menu_button_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2325,6 +2338,7 @@ GTK_MENU_ITEM_CLASS
|
||||
GTK_IS_MENU_ITEM_CLASS
|
||||
GTK_MENU_ITEM_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuItemPrivate
|
||||
gtk_menu_item_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2391,6 +2405,7 @@ GTK_MENU_SHELL_CLASS
|
||||
GTK_IS_MENU_SHELL_CLASS
|
||||
GTK_MENU_SHELL_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkMenuShellPrivate
|
||||
gtk_menu_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -2559,6 +2574,7 @@ GTK_IS_NUMERABLE_ICON_CLASS
|
||||
GTK_NUMERABLE_ICON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkNumerableIconPrivate
|
||||
gtk_numerable_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -3275,6 +3291,7 @@ GTK_SETTINGS_CLASS
|
||||
GTK_SETTINGS_GET_CLASS
|
||||
GTK_TYPE_SETTINGS
|
||||
<SUBSECTION Private>
|
||||
GtkSettingsPrivate
|
||||
gtk_settings_get_type
|
||||
GtkSettingsPropertyValue
|
||||
</SECTION>
|
||||
@@ -3320,6 +3337,7 @@ GTK_SOCKET_CLASS
|
||||
GTK_IS_SOCKET_CLASS
|
||||
GTK_SOCKET_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkSocketPrivate
|
||||
gtk_socket_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4374,6 +4392,7 @@ gtk_tree_model_row_inserted
|
||||
gtk_tree_model_row_has_child_toggled
|
||||
gtk_tree_model_row_deleted
|
||||
gtk_tree_model_rows_reordered
|
||||
gtk_tree_model_rows_reordered_with_length
|
||||
<SUBSECTION Standard>
|
||||
GTK_TREE_MODEL
|
||||
GTK_IS_TREE_MODEL
|
||||
@@ -4410,6 +4429,7 @@ GTK_TREE_MODEL_SORT_CLASS
|
||||
GTK_IS_TREE_MODEL_SORT_CLASS
|
||||
GTK_TREE_MODEL_SORT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeModelSortPrivate
|
||||
gtk_tree_model_sort_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4477,6 +4497,7 @@ GTK_TREE_SELECTION_CLASS
|
||||
GTK_TREE_SELECTION_GET_CLASS
|
||||
GTK_IS_TREE_SELECTION_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeSelectionPrivate
|
||||
gtk_tree_selection_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4567,6 +4588,7 @@ GTK_TREE_STORE_CLASS
|
||||
GTK_IS_TREE_STORE_CLASS
|
||||
GTK_TREE_STORE_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeStorePrivate
|
||||
gtk_tree_store_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4637,6 +4659,7 @@ GTK_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_IS_TREE_VIEW_COLUMN_CLASS
|
||||
GTK_TREE_VIEW_COLUMN_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkTreeViewColumnPrivate
|
||||
gtk_tree_view_column_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -4852,6 +4875,7 @@ gtk_cell_area_get_current_path_string
|
||||
gtk_cell_area_apply_attributes
|
||||
gtk_cell_area_attribute_connect
|
||||
gtk_cell_area_attribute_disconnect
|
||||
gtk_cell_area_attribute_get_column
|
||||
gtk_cell_area_class_install_cell_property
|
||||
gtk_cell_area_class_find_cell_property
|
||||
gtk_cell_area_class_list_cell_properties
|
||||
@@ -4989,6 +5013,7 @@ GTK_IS_CELL_RENDERER_CLASS
|
||||
GTK_CELL_RENDERER_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkCellRendererPrivate
|
||||
GtkCellRendererClassPrivate
|
||||
gtk_cell_renderer_get_type
|
||||
gtk_cell_renderer_mode_get_type
|
||||
gtk_cell_renderer_state_get_type
|
||||
@@ -5627,6 +5652,7 @@ GTK_IS_WIDGET_CLASS
|
||||
GTK_WIDGET_GET_CLASS
|
||||
GTK_TYPE_REQUISITION
|
||||
<SUBSECTION Private>
|
||||
GtkWidgetClassPrivate
|
||||
GtkWidgetPrivate
|
||||
gtk_widget_get_type
|
||||
gtk_requisition_get_type
|
||||
@@ -5794,6 +5820,7 @@ GTK_WINDOW_GROUP
|
||||
GTK_WINDOW_GROUP_CLASS
|
||||
GTK_WINDOW_GROUP_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkWindowGroupPrivate
|
||||
gtk_window_group_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5862,6 +5889,11 @@ gtk_get_micro_version
|
||||
gtk_get_binary_age
|
||||
gtk_get_interface_age
|
||||
gtk_check_version
|
||||
gtk_major_version
|
||||
gtk_minor_version
|
||||
gtk_micro_version
|
||||
gtk_binary_age
|
||||
gtk_interface_age
|
||||
|
||||
<SUBSECTION>
|
||||
GTK_MAJOR_VERSION
|
||||
@@ -5969,6 +6001,7 @@ GTK_STYLE_PROPERTIES
|
||||
GTK_STYLE_PROPERTIES_CLASS
|
||||
GTK_STYLE_PROPERTIES_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkStylePropertiesPrivate
|
||||
gtk_style_properties_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -5996,6 +6029,7 @@ GTK_STYLE_CLASS_BUTTON
|
||||
GTK_STYLE_CLASS_CALENDAR
|
||||
GTK_STYLE_CLASS_CELL
|
||||
GTK_STYLE_CLASS_COMBOBOX_ENTRY
|
||||
GTK_STYLE_CLASS_CONTEXT_MENU
|
||||
GTK_STYLE_CLASS_CHECK
|
||||
GTK_STYLE_CLASS_CSD
|
||||
GTK_STYLE_CLASS_CURSOR_HANDLE
|
||||
@@ -6036,12 +6070,14 @@ GTK_STYLE_CLASS_OVERSHOOT
|
||||
GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_POPOVER
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_PULSE
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
GTK_STYLE_CLASS_RADIO
|
||||
GTK_STYLE_CLASS_RAISED
|
||||
GTK_STYLE_CLASS_READ_ONLY
|
||||
GTK_STYLE_CLASS_RIGHT
|
||||
GTK_STYLE_CLASS_RUBBERBAND
|
||||
GTK_STYLE_CLASS_SCALE
|
||||
@@ -6061,6 +6097,7 @@ GTK_STYLE_CLASS_TITLE
|
||||
GTK_STYLE_CLASS_TITLEBAR
|
||||
GTK_STYLE_CLASS_TOOLBAR
|
||||
GTK_STYLE_CLASS_TOOLTIP
|
||||
GTK_STYLE_CLASS_TOUCH_SELECTION
|
||||
GTK_STYLE_CLASS_TOP
|
||||
GTK_STYLE_CLASS_TROUGH
|
||||
GTK_STYLE_CLASS_UNDERSHOOT
|
||||
@@ -6169,6 +6206,7 @@ GTK_IS_STYLE_CONTEXT_CLASS
|
||||
GTK_TYPE_BORDER
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkStyleContextPrivate
|
||||
gtk_style_context_get_type
|
||||
gtk_border_get_type
|
||||
</SECTION>
|
||||
@@ -6207,6 +6245,8 @@ GTK_CSS_PROVIDER_GET_CLASS
|
||||
GTK_IS_CSS_PROVIDER
|
||||
GTK_IS_CSS_PROVIDER_CLASS
|
||||
<SUBSECTION Private>
|
||||
GTK_TYPE_CSS_SECTION
|
||||
GtkCssProviderPrivate
|
||||
gtk_css_provider_get_type
|
||||
gtk_css_provider_error_quark
|
||||
gtk_css_section_get_type
|
||||
@@ -6720,6 +6760,8 @@ GTK_STOCK_ZOOM_100
|
||||
GTK_STOCK_ZOOM_FIT
|
||||
GTK_STOCK_ZOOM_IN
|
||||
GTK_STOCK_ZOOM_OUT
|
||||
<SUBSECTION Private>
|
||||
GtkStock
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -6781,6 +6823,7 @@ gtk_icon_info_get_attach_points
|
||||
gtk_icon_info_get_display_name
|
||||
gtk_icon_info_is_symbolic
|
||||
<SUBSECTION Standard>
|
||||
GtkIconInfoClass
|
||||
GTK_ICON_THEME
|
||||
GTK_IS_ICON_THEME
|
||||
GTK_TYPE_ICON_THEME
|
||||
@@ -6790,6 +6833,11 @@ GTK_IS_ICON_THEME_CLASS
|
||||
GTK_ICON_THEME_GET_CLASS
|
||||
gtk_icon_info_get_type
|
||||
GTK_TYPE_ICON_INFO
|
||||
GTK_ICON_INFO
|
||||
GTK_ICON_INFO_CLASS
|
||||
GTK_ICON_INFO_GET_CLASS
|
||||
GTK_IS_ICON_INFO
|
||||
GTK_IS_ICON_INFO_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkIconThemePrivate
|
||||
gtk_icon_theme_error_quark
|
||||
@@ -7154,6 +7202,7 @@ gtk_print_settings_get_type
|
||||
<TITLE>GtkPaperSize</TITLE>
|
||||
GtkPaperSize
|
||||
GtkUnit
|
||||
GTK_UNIT_PIXEL
|
||||
GTK_PAPER_NAME_A3
|
||||
GTK_PAPER_NAME_A4
|
||||
GTK_PAPER_NAME_A5
|
||||
@@ -7808,6 +7857,7 @@ GTK_IS_ACTION_BAR_CLASS
|
||||
GTK_ACTION_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkActionBarPrivate
|
||||
gtk_action_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7840,6 +7890,7 @@ GTK_IS_HEADER_BAR_CLASS
|
||||
GTK_HEADER_BAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkHeaderBarPrivate
|
||||
gtk_header_bar_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7868,6 +7919,14 @@ GtkStackTransitionType
|
||||
gtk_stack_set_transition_type
|
||||
gtk_stack_get_transition_type
|
||||
gtk_stack_get_transition_running
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK
|
||||
GTK_IS_STACK
|
||||
GTK_IS_STACK_CLASS
|
||||
GTK_STACK
|
||||
GTK_STACK_CLASS
|
||||
GTK_STACK_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_get_type
|
||||
</SECTION>
|
||||
@@ -7879,6 +7938,14 @@ GtkStackSwitcher
|
||||
gtk_stack_switcher_new
|
||||
gtk_stack_switcher_set_stack
|
||||
gtk_stack_switcher_get_stack
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER
|
||||
GTK_IS_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER
|
||||
GTK_STACK_SWITCHER_CLASS
|
||||
GTK_STACK_SWITCHER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_stack_switcher_get_type
|
||||
</SECTION>
|
||||
@@ -7897,6 +7964,15 @@ gtk_revealer_set_transition_duration
|
||||
GtkRevealerTransitionType
|
||||
gtk_revealer_get_transition_type
|
||||
gtk_revealer_set_transition_type
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_REVEALER
|
||||
GTK_IS_REVEALER
|
||||
GTK_IS_REVEALER_CLASS
|
||||
GTK_REVEALER
|
||||
GTK_REVEALER_CLASS
|
||||
GTK_REVEALER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_revealer_get_type
|
||||
</SECTION>
|
||||
@@ -7948,6 +8024,24 @@ gtk_flow_box_child_new
|
||||
gtk_flow_box_child_get_index
|
||||
gtk_flow_box_child_is_selected
|
||||
gtk_flow_box_child_changed
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GtkFlowBoxChildClass
|
||||
GTK_TYPE_FLOW_BOX
|
||||
GTK_TYPE_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX
|
||||
GTK_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_GET_CLASS
|
||||
GTK_IS_FLOW_BOX
|
||||
GTK_IS_FLOW_BOX_CLASS
|
||||
GTK_FLOW_BOX_CHILD
|
||||
GTK_FLOW_BOX_CHILD_CLASS
|
||||
GTK_FLOW_BOX_CHILD_GET_CLASS
|
||||
GTK_IS_FLOW_BOX_CHILD
|
||||
GTK_IS_FLOW_BOX_CHILD_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_flow_box_get_type
|
||||
gtk_flow_box_child_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -7967,7 +8061,18 @@ gtk_popover_set_modal
|
||||
gtk_popover_get_modal
|
||||
gtk_popover_set_transitions_enabled
|
||||
gtk_popover_get_transitions_enabled
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER
|
||||
GTK_IS_POPOVER
|
||||
GTK_IS_POPOVER_CLASS
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER
|
||||
GTK_POPOVER_CLASS
|
||||
GTK_POPOVER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkPopoverPrivate
|
||||
gtk_popover_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -7977,6 +8082,15 @@ gtk_popover_get_type
|
||||
GtkPopoverMenu
|
||||
gtk_popover_menu_new
|
||||
gtk_popover_menu_open_submenu
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU
|
||||
GTK_IS_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU
|
||||
GTK_POPOVER_MENU_CLASS
|
||||
GTK_POPOVER_MENU_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_popover_menu_get_type
|
||||
</SECTION>
|
||||
@@ -7987,6 +8101,12 @@ gtk_popover_menu_get_type
|
||||
GtkModelButton
|
||||
GtkButtonRole
|
||||
gtk_model_button_new
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MODEL_BUTTON
|
||||
GTK_MODEL_BUTTON
|
||||
GTK_IS_MODEL_BUTTON
|
||||
<SUBSECTION Private>
|
||||
gtk_model_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -8006,6 +8126,7 @@ GTK_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER
|
||||
GTK_EVENT_CONTROLLER_GET_CLASS
|
||||
GTK_IS_EVENT_CONTROLLER_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
GtkEventControllerPriv
|
||||
@@ -8223,11 +8344,11 @@ gtk_stack_sidebar_set_stack
|
||||
gtk_stack_sidebar_get_stack
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SIDEBAR
|
||||
GTK_TYPE_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR
|
||||
GTK_STACK_SIDEBAR_CLASS
|
||||
GTK_IS_SIDEBAR
|
||||
GTK_IS_SIDEBAR_CLASS
|
||||
GTK_IS_STACK_SIDEBAR
|
||||
GTK_IS_STACK_SIDEBAR_CLASS
|
||||
GTK_STACK_SIDEBAR_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
@@ -8243,6 +8364,7 @@ gtk_gl_area_new
|
||||
gtk_gl_area_get_context
|
||||
gtk_gl_area_make_current
|
||||
gtk_gl_area_queue_render
|
||||
gtk_gl_area_attach_buffers
|
||||
gtk_gl_area_set_error
|
||||
gtk_gl_area_get_error
|
||||
<SUBSECTION>
|
||||
@@ -8254,10 +8376,13 @@ gtk_gl_area_set_has_stencil_buffer
|
||||
gtk_gl_area_get_has_stencil_buffer
|
||||
gtk_gl_area_set_auto_render
|
||||
gtk_gl_area_get_auto_render
|
||||
gtk_gl_area_get_required_version
|
||||
gtk_gl_area_set_required_version
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_GL_AREA
|
||||
GTK_GL_AREA
|
||||
GTK_GL_AREA_CLASS
|
||||
GTK_GL_AREA_GET_CLASS
|
||||
GTK_IS_GL_AREA
|
||||
GTK_IS_GL_AREA_CLASS
|
||||
<SUBSECTION Private>
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
widgets have been deprecated. These deprecations are clearly spelled
|
||||
out in the API reference, with hints about the recommended replacements.
|
||||
The API reference for GTK+ 2 also includes an
|
||||
<ulink url="http://developer.gnome.org/gtk/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
<ulink url="https://developer.gnome.org/gtk2/2.24/api-index-deprecated.html">index</ulink> of all deprecated symbols.
|
||||
</para>
|
||||
<para>
|
||||
To verify that your program does not use any deprecated symbols,
|
||||
|
||||
+27
-85
@@ -1,8 +1,5 @@
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
/* This is a callback function. The data arguments are ignored
|
||||
* in this example. More on callbacks below.
|
||||
*/
|
||||
static void
|
||||
print_hello (GtkWidget *widget,
|
||||
gpointer data)
|
||||
@@ -10,95 +7,40 @@ print_hello (GtkWidget *widget,
|
||||
g_print ("Hello World\n");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
on_delete_event (GtkWidget *widget,
|
||||
GdkEvent *event,
|
||||
gpointer data)
|
||||
static void
|
||||
activate (GtkApplication *app,
|
||||
gpointer user_data)
|
||||
{
|
||||
/* If you return FALSE in the "delete_event" signal handler,
|
||||
* GTK will emit the "destroy" signal. Returning TRUE means
|
||||
* you don't want the window to be destroyed.
|
||||
*
|
||||
* This is useful for popping up 'are you sure you want to quit?'
|
||||
* type dialogs.
|
||||
*/
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkWidget *button_box;
|
||||
|
||||
g_print ("delete event occurred\n");
|
||||
window = gtk_application_window_new (app);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Window");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
|
||||
|
||||
return TRUE;
|
||||
button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (window), button_box);
|
||||
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_container_add (GTK_CONTAINER (button_box), button);
|
||||
|
||||
gtk_widget_show_all (window);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
main (int argc,
|
||||
char **argv)
|
||||
{
|
||||
/* GtkWidget is the storage type for widgets */
|
||||
GtkWidget *window;
|
||||
GtkWidget *button;
|
||||
GtkApplication *app;
|
||||
int status;
|
||||
|
||||
/* This is called in all GTK applications. Arguments are parsed
|
||||
* from the command line and are returned to the application.
|
||||
*/
|
||||
gtk_init (&argc, &argv);
|
||||
app = gtk_application_new ("org.gtk.example", G_APPLICATION_FLAGS_NONE);
|
||||
g_signal_connect (app, "activate", G_CALLBACK (activate), NULL);
|
||||
status = g_application_run (G_APPLICATION (app), argc, argv);
|
||||
g_object_unref (app);
|
||||
|
||||
/* create a new window, and set its title */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hello");
|
||||
|
||||
/* When the window emits the "delete-event" signal (which is emitted
|
||||
* by GTK+ in response to an event coming from the window manager,
|
||||
* usually as a result of clicking the "close" window control), we
|
||||
* ask it to call the on_delete_event() function as defined above.
|
||||
*
|
||||
* The data passed to the callback function is NULL and is ignored
|
||||
* in the callback function.
|
||||
*/
|
||||
g_signal_connect (window, "delete-event", G_CALLBACK (on_delete_event), NULL);
|
||||
|
||||
/* Here we connect the "destroy" event to the gtk_main_quit() function.
|
||||
*
|
||||
* This signal is emitted when we call gtk_widget_destroy() on the window,
|
||||
* or if we return FALSE in the "delete_event" callback.
|
||||
*/
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
|
||||
|
||||
/* Sets the border width of the window. */
|
||||
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
|
||||
|
||||
/* Creates a new button with the label "Hello World". */
|
||||
button = gtk_button_new_with_label ("Hello World");
|
||||
|
||||
/* When the button receives the "clicked" signal, it will call the
|
||||
* function print_hello() passing it NULL as its argument.
|
||||
*
|
||||
* The print_hello() function is defined above.
|
||||
*/
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
|
||||
|
||||
/* The g_signal_connect_swapped() function will connect the "clicked" signal
|
||||
* of the button to the gtk_widget_destroy() function; instead of calling it
|
||||
* using the button as its argument, it will swap it with the user data
|
||||
* argument. This will cause the window to be destroyed by calling
|
||||
* gtk_widget_destroy() on the window.
|
||||
*/
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
|
||||
/* This packs the button into the window. A GtkWindow inherits from GtkBin,
|
||||
* which is a special container that can only have one child
|
||||
*/
|
||||
gtk_container_add (GTK_CONTAINER (window), button);
|
||||
|
||||
/* The final step is to display this newly created widget... */
|
||||
gtk_widget_show (button);
|
||||
|
||||
/* ... and the window */
|
||||
gtk_widget_show (window);
|
||||
|
||||
/* All GTK applications must have a gtk_main(). Control ends here
|
||||
* and waits for an event to occur (like a key press or a mouse event),
|
||||
* until gtk_main_quit() is called.
|
||||
*/
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
return status;
|
||||
}
|
||||
|
||||
+10
-7
@@ -492,6 +492,7 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int major,
|
||||
int minor)
|
||||
{
|
||||
int version;
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
@@ -505,13 +506,15 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
return;
|
||||
}
|
||||
|
||||
priv->major = MAX (major, 3);
|
||||
|
||||
/* we only support versions ≥ 3.2 */
|
||||
if (priv->major == 3)
|
||||
priv->minor = MAX (minor, 2);
|
||||
else
|
||||
priv->minor = minor;
|
||||
/* Enforce a minimum context version number of 3.2 */
|
||||
version = (major * 100) + minor;
|
||||
if (version < 302)
|
||||
{
|
||||
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
|
||||
version = 302;
|
||||
}
|
||||
priv->major = version / 100;
|
||||
priv->minor = version % 100;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1110,6 +1110,9 @@ find_native_sibling_above (GdkWindow *parent,
|
||||
{
|
||||
GdkWindow *w;
|
||||
|
||||
if (!parent)
|
||||
return NULL;
|
||||
|
||||
w = find_native_sibling_above_helper (parent, child);
|
||||
if (w)
|
||||
return w;
|
||||
|
||||
@@ -59,6 +59,7 @@ struct _GdkWaylandCursor
|
||||
} surface;
|
||||
|
||||
struct wl_cursor *wl_cursor;
|
||||
int scale;
|
||||
};
|
||||
|
||||
struct _GdkWaylandCursorClass
|
||||
@@ -83,11 +84,18 @@ _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
set_cursor_from_theme (GdkWaylandCursor *cursor,
|
||||
struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_cursor_update (GdkWaylandDisplay *wayland_display,
|
||||
GdkWaylandCursor *cursor)
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
/* Do nothing if this is not a wl_cursor cursor. */
|
||||
if (cursor->name == NULL)
|
||||
return FALSE;
|
||||
|
||||
theme = _gdk_wayland_display_get_scaled_cursor_theme (wayland_display,
|
||||
cursor->scale);
|
||||
c = wl_cursor_theme_get_cursor (theme, cursor->name);
|
||||
if (!c)
|
||||
{
|
||||
@@ -106,8 +114,7 @@ set_cursor_from_theme (GdkWaylandCursor *cursor,
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme)
|
||||
_gdk_wayland_display_update_cursors (GdkWaylandDisplay *display)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
const char *name;
|
||||
@@ -116,7 +123,7 @@ _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
g_hash_table_iter_init (&iter, display->cursor_cache);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, (gpointer *) &name, (gpointer *) &cursor))
|
||||
set_cursor_from_theme (cursor, theme);
|
||||
_gdk_wayland_cursor_update (display, cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -169,11 +176,11 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
*w = image->width;
|
||||
*h = image->height;
|
||||
*scale = 1;
|
||||
*scale = wayland_cursor->scale;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
else /* From surface */
|
||||
else if (wayland_cursor->name == NULL) /* From surface */
|
||||
{
|
||||
*hotspot_x = wayland_cursor->surface.hotspot_x;
|
||||
*hotspot_y = wayland_cursor->surface.hotspot_y;
|
||||
@@ -186,9 +193,9 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
|
||||
|
||||
if (wayland_cursor->surface.cairo_surface)
|
||||
return _gdk_wayland_shm_surface_get_wl_buffer (wayland_cursor->surface.cairo_surface);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
guint
|
||||
@@ -217,6 +224,28 @@ _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
return current_image_index;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display =
|
||||
GDK_WAYLAND_DISPLAY (gdk_cursor_get_display (cursor));
|
||||
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
|
||||
|
||||
if (scale > GDK_WAYLAND_MAX_THEME_SCALE)
|
||||
{
|
||||
g_warning (G_STRLOC ": cursor theme size %u too large", scale);
|
||||
scale = GDK_WAYLAND_MAX_THEME_SCALE;
|
||||
}
|
||||
|
||||
if (wayland_cursor->scale == scale)
|
||||
return;
|
||||
|
||||
wayland_cursor->scale = scale;
|
||||
|
||||
_gdk_wayland_cursor_update (wayland_display, wayland_cursor);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_wayland_cursor_class_init (GdkWaylandCursorClass *wayland_cursor_class)
|
||||
{
|
||||
@@ -233,9 +262,15 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
|
||||
{
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale)
|
||||
{
|
||||
GEnumClass *enum_class;
|
||||
GEnumValue *enum_value;
|
||||
@@ -248,7 +283,9 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
g_strdelimit (cursor_name, "-", '_');
|
||||
g_type_class_unref (enum_class);
|
||||
|
||||
result = _gdk_wayland_display_get_cursor_for_name (display, cursor_name);
|
||||
result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
|
||||
cursor_name,
|
||||
scale);
|
||||
|
||||
g_free (cursor_name);
|
||||
|
||||
@@ -256,8 +293,18 @@ _gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_type_with_scale (display,
|
||||
cursor_type,
|
||||
1);
|
||||
}
|
||||
|
||||
static GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
|
||||
const gchar *name,
|
||||
guint scale)
|
||||
{
|
||||
GdkWaylandCursor *private;
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (display);
|
||||
@@ -273,13 +320,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
"display", display,
|
||||
NULL);
|
||||
private->name = g_strdup (name);
|
||||
private->surface.scale = 1;
|
||||
private->scale = scale;
|
||||
|
||||
/* Blank cursor case */
|
||||
if (!name || g_str_equal (name, "blank_cursor"))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
if (!set_cursor_from_theme (private, wayland_display->cursor_theme))
|
||||
if (!_gdk_wayland_cursor_update (wayland_display, private))
|
||||
return GDK_CURSOR (private);
|
||||
|
||||
/* Insert into cache. */
|
||||
@@ -287,6 +334,13 @@ _gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
return GDK_CURSOR (private);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name)
|
||||
{
|
||||
return _gdk_wayland_display_get_cursor_for_name_with_scale (display, name, 1);
|
||||
}
|
||||
|
||||
GdkCursor *
|
||||
_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
cairo_surface_t *surface,
|
||||
|
||||
@@ -93,6 +93,8 @@ struct _GdkWaylandDeviceData
|
||||
GdkDragContext *drop_context;
|
||||
|
||||
struct wl_surface *pointer_surface;
|
||||
guint current_output_scale;
|
||||
GSList *pointer_surface_outputs;
|
||||
};
|
||||
|
||||
struct _GdkWaylandDevice
|
||||
@@ -253,7 +255,15 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
|
||||
* the default cursor
|
||||
*/
|
||||
if (!cursor)
|
||||
cursor = _gdk_wayland_display_get_cursor_for_type (device->display, GDK_LEFT_PTR);
|
||||
{
|
||||
guint scale = wd->current_output_scale;
|
||||
cursor =
|
||||
_gdk_wayland_display_get_cursor_for_type_with_scale (wd->display,
|
||||
GDK_LEFT_PTR,
|
||||
scale);
|
||||
}
|
||||
else
|
||||
_gdk_wayland_cursor_set_scale (cursor, wd->current_output_scale);
|
||||
|
||||
if (cursor == wd->cursor)
|
||||
return;
|
||||
@@ -1756,6 +1766,78 @@ init_devices (GdkWaylandDeviceData *device)
|
||||
_gdk_device_set_associated_device (device->master_keyboard, device->master_pointer);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_update_scale (GdkWaylandDeviceData *device)
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY (device->display);
|
||||
guint32 scale;
|
||||
GSList *l;
|
||||
|
||||
if (wayland_display->compositor_version < WL_SURFACE_HAS_BUFFER_SCALE)
|
||||
{
|
||||
/* We can't set the scale on this surface */
|
||||
return;
|
||||
}
|
||||
|
||||
scale = 1;
|
||||
for (l = device->pointer_surface_outputs; l != NULL; l = l->next)
|
||||
{
|
||||
guint32 output_scale =
|
||||
_gdk_wayland_screen_get_output_scale (wayland_display->screen,
|
||||
l->data);
|
||||
scale = MAX (scale, output_scale);
|
||||
}
|
||||
|
||||
device->current_output_scale = scale;
|
||||
|
||||
if (device->grab_cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->grab_cursor, scale);
|
||||
if (device->cursor)
|
||||
_gdk_wayland_cursor_set_scale (device->cursor, scale);
|
||||
|
||||
gdk_wayland_device_update_window_cursor (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_enter (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p entered output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_append (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static void
|
||||
pointer_surface_leave (void *data,
|
||||
struct wl_surface *wl_surface,
|
||||
struct wl_output *output)
|
||||
{
|
||||
GdkWaylandDeviceData *device = data;
|
||||
|
||||
GDK_NOTE (EVENTS,
|
||||
g_message ("pointer surface of device %p left output %p",
|
||||
device, output));
|
||||
|
||||
device->pointer_surface_outputs =
|
||||
g_slist_remove (device->pointer_surface_outputs, output);
|
||||
|
||||
pointer_surface_update_scale (device);
|
||||
}
|
||||
|
||||
static const struct wl_surface_listener pointer_surface_listener = {
|
||||
pointer_surface_enter,
|
||||
pointer_surface_leave
|
||||
};
|
||||
|
||||
void
|
||||
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
guint32 id,
|
||||
@@ -1786,8 +1868,12 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
|
||||
wl_data_device_add_listener (device->data_device,
|
||||
&data_device_listener, device);
|
||||
|
||||
device->current_output_scale = 1;
|
||||
device->pointer_surface =
|
||||
wl_compositor_create_surface (display_wayland->compositor);
|
||||
wl_surface_add_listener (device->pointer_surface,
|
||||
&pointer_surface_listener,
|
||||
device);
|
||||
|
||||
init_devices (device);
|
||||
}
|
||||
|
||||
@@ -180,9 +180,13 @@ gdk_registry_handle_global (void *data,
|
||||
}
|
||||
else if (strcmp (interface, "gtk_shell") == 0)
|
||||
{
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind (display_wayland->wl_registry, id, >k_shell_interface, 1);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
if (version == SUPPORTED_GTK_SHELL_VERSION)
|
||||
{
|
||||
display_wayland->gtk_shell =
|
||||
wl_registry_bind(display_wayland->wl_registry, id,
|
||||
>k_shell_interface, SUPPORTED_GTK_SHELL_VERSION);
|
||||
_gdk_wayland_screen_set_has_gtk_shell (display_wayland->screen);
|
||||
}
|
||||
}
|
||||
else if (strcmp (interface, "wl_output") == 0)
|
||||
{
|
||||
@@ -575,10 +579,15 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
{
|
||||
GdkWaylandDisplay *wayland_display = GDK_WAYLAND_DISPLAY(display);
|
||||
struct wl_cursor_theme *theme;
|
||||
int i;
|
||||
|
||||
g_assert (wayland_display);
|
||||
g_assert (wayland_display->shm);
|
||||
|
||||
if (g_strcmp0 (name, wayland_display->cursor_theme_name) == 0 &&
|
||||
wayland_display->cursor_theme_size == size)
|
||||
return;
|
||||
|
||||
theme = wl_cursor_theme_load (name, size, wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
@@ -586,11 +595,49 @@ gdk_wayland_display_set_cursor_theme (GdkDisplay *display,
|
||||
return;
|
||||
}
|
||||
|
||||
_gdk_wayland_display_update_cursors (wayland_display, theme);
|
||||
for (i = 0; i < GDK_WAYLAND_THEME_SCALES_COUNT; i++)
|
||||
{
|
||||
if (wayland_display->scaled_cursor_themes[i])
|
||||
{
|
||||
wl_cursor_theme_destroy (wayland_display->scaled_cursor_themes[i]);
|
||||
wayland_display->scaled_cursor_themes[i] = NULL;
|
||||
}
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[0] = theme;
|
||||
if (wayland_display->cursor_theme_name != NULL)
|
||||
free (wayland_display->cursor_theme_name);
|
||||
wayland_display->cursor_theme_name = g_strdup (name);
|
||||
wayland_display->cursor_theme_size = size;
|
||||
|
||||
if (wayland_display->cursor_theme != NULL)
|
||||
wl_cursor_theme_destroy (wayland_display->cursor_theme);
|
||||
wayland_display->cursor_theme = theme;
|
||||
_gdk_wayland_display_update_cursors (wayland_display);
|
||||
}
|
||||
|
||||
struct wl_cursor_theme *
|
||||
_gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
guint scale)
|
||||
{
|
||||
struct wl_cursor_theme *theme;
|
||||
|
||||
g_assert (wayland_display->cursor_theme_name);
|
||||
g_assert (scale <= GDK_WAYLAND_MAX_THEME_SCALE);
|
||||
g_assert (scale >= 1);
|
||||
|
||||
theme = wayland_display->scaled_cursor_themes[scale - 1];
|
||||
if (!theme)
|
||||
{
|
||||
theme = wl_cursor_theme_load (wayland_display->cursor_theme_name,
|
||||
wayland_display->cursor_theme_size * scale,
|
||||
wayland_display->shm);
|
||||
if (theme == NULL)
|
||||
{
|
||||
g_warning ("Failed to load cursor theme %s with scale %u\n",
|
||||
wayland_display->cursor_theme_name, scale);
|
||||
return NULL;
|
||||
}
|
||||
wayland_display->scaled_cursor_themes[scale - 1] = theme;
|
||||
}
|
||||
|
||||
return theme;
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -42,6 +42,9 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GDK_WAYLAND_MAX_THEME_SCALE 2
|
||||
#define GDK_WAYLAND_THEME_SCALES_COUNT GDK_WAYLAND_MAX_THEME_SCALE
|
||||
|
||||
typedef struct _GdkWaylandSelection GdkWaylandSelection;
|
||||
|
||||
struct _GdkWaylandDisplay
|
||||
@@ -69,7 +72,9 @@ struct _GdkWaylandDisplay
|
||||
struct wl_data_device_manager *data_device_manager;
|
||||
struct wl_subcompositor *subcompositor;
|
||||
|
||||
struct wl_cursor_theme *cursor_theme;
|
||||
struct wl_cursor_theme *scaled_cursor_themes[GDK_WAYLAND_THEME_SCALES_COUNT];
|
||||
gchar *cursor_theme_name;
|
||||
int cursor_theme_size;
|
||||
GHashTable *cursor_cache;
|
||||
|
||||
GSource *event_source;
|
||||
|
||||
@@ -40,6 +40,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#define WL_SURFACE_HAS_BUFFER_SCALE 3
|
||||
|
||||
#define SUPPORTED_GTK_SHELL_VERSION 1
|
||||
|
||||
#define GDK_WINDOW_IS_WAYLAND(win) (GDK_IS_WINDOW_IMPL_WAYLAND (((GdkWindow *)win)->impl))
|
||||
|
||||
GdkKeymap *_gdk_wayland_keymap_new (void);
|
||||
@@ -54,11 +58,16 @@ gboolean _gdk_wayland_keymap_key_is_modifier (GdkKeymap *keymap,
|
||||
|
||||
void _gdk_wayland_display_init_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_finalize_cursors (GdkWaylandDisplay *display);
|
||||
void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display,
|
||||
struct wl_cursor_theme *theme);
|
||||
void _gdk_wayland_display_update_cursors (GdkWaylandDisplay *display);
|
||||
|
||||
struct wl_cursor_theme * _gdk_wayland_display_get_scaled_cursor_theme (GdkWaylandDisplay *wayland_display,
|
||||
guint scale);
|
||||
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_type (GdkDisplay *display,
|
||||
GdkCursorType cursor_type);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
|
||||
GdkCursorType cursor_type,
|
||||
guint scale);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
|
||||
const gchar *name);
|
||||
GdkCursor *_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
|
||||
@@ -85,6 +94,9 @@ guint _gdk_wayland_cursor_get_next_image_index (GdkCursor *cursor,
|
||||
guint current_image_index,
|
||||
guint *next_image_delay);
|
||||
|
||||
void _gdk_wayland_cursor_set_scale (GdkCursor *cursor,
|
||||
guint scale);
|
||||
|
||||
GdkDragProtocol _gdk_wayland_window_get_drag_protocol (GdkWindow *window,
|
||||
GdkWindow **target);
|
||||
|
||||
|
||||
@@ -416,9 +416,11 @@ async_write_data_cb (GObject *object,
|
||||
res, &error);
|
||||
if (error)
|
||||
{
|
||||
g_warning ("Error writing selection data: %s", error->message);
|
||||
g_error_free (error);
|
||||
if (error->domain != G_IO_ERROR ||
|
||||
error->code != G_IO_ERROR_CANCELLED)
|
||||
g_warning ("Error writing selection data: %s", error->message);
|
||||
|
||||
g_error_free (error);
|
||||
async_write_data_free (write_data);
|
||||
return;
|
||||
}
|
||||
@@ -558,12 +560,12 @@ gdk_wayland_selection_request_target (GdkWaylandSelection *wayland_selection,
|
||||
else
|
||||
return FALSE;
|
||||
|
||||
if (fd >= 0)
|
||||
wayland_selection->stored_selection.fd = fd;
|
||||
|
||||
if (wayland_selection->source_requested_target == target)
|
||||
if (wayland_selection->stored_selection.fd == fd &&
|
||||
wayland_selection->source_requested_target == target)
|
||||
return FALSE;
|
||||
|
||||
wayland_selection->stored_selection.fd = fd;
|
||||
|
||||
wayland_selection->source_requested_target = target;
|
||||
|
||||
if (window && target != GDK_NONE)
|
||||
@@ -668,16 +670,19 @@ data_source_cancelled (void *data,
|
||||
g_debug (G_STRLOC ": %s source = %p",
|
||||
G_STRFUNC, source);
|
||||
|
||||
context = gdk_wayland_drag_context_lookup_by_data_source (source);
|
||||
display = gdk_window_get_display (context->source_window);
|
||||
display = gdk_display_get_default ();
|
||||
|
||||
if (source == wayland_selection->dnd_source)
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_DND]);
|
||||
{
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_DND]);
|
||||
|
||||
context = gdk_wayland_drag_context_lookup_by_data_source (source);
|
||||
|
||||
if (context)
|
||||
gdk_wayland_drag_context_undo_grab (context);
|
||||
}
|
||||
else if (source == wayland_selection->clipboard_source)
|
||||
gdk_wayland_selection_unset_data_source (display, atoms[ATOM_CLIPBOARD]);
|
||||
|
||||
if (context)
|
||||
gdk_wayland_drag_context_undo_grab (context);
|
||||
}
|
||||
|
||||
static const struct wl_data_source_listener data_source_listener = {
|
||||
@@ -893,9 +898,10 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
|
||||
return;
|
||||
}
|
||||
|
||||
wl_data_offer_accept (wayland_selection->offer,
|
||||
_gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
|
||||
gdk_atom_name (target));
|
||||
if (target != gdk_atom_intern_static_string ("TARGETS"))
|
||||
wl_data_offer_accept (wayland_selection->offer,
|
||||
_gdk_wayland_display_get_serial (GDK_WAYLAND_DISPLAY (display)),
|
||||
gdk_atom_name (target));
|
||||
|
||||
buffer_data = g_hash_table_lookup (wayland_selection->selection_buffers,
|
||||
target);
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#define WL_SURFACE_HAS_BUFFER_SCALE 3
|
||||
|
||||
#define WINDOW_IS_TOPLEVEL_OR_FOREIGN(window) \
|
||||
(GDK_WINDOW_TYPE (window) != GDK_WINDOW_CHILD && \
|
||||
GDK_WINDOW_TYPE (window) != GDK_WINDOW_OFFSCREEN)
|
||||
@@ -872,7 +870,6 @@ gdk_wayland_window_create_surface (GdkWindow *window)
|
||||
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
|
||||
|
||||
impl->surface = wl_compositor_create_surface (display_wayland->compositor);
|
||||
wl_surface_set_user_data (impl->surface, window);
|
||||
wl_surface_add_listener (impl->surface, &surface_listener, window);
|
||||
|
||||
gdk_wayland_window_sync_opaque_region (window);
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
<protocol name="gtk">
|
||||
|
||||
<interface name="gtk_shell" version="1">
|
||||
<description summary="gtk specific extensions">
|
||||
gtk_shell is a protocol extension providing additional features for
|
||||
clients implementing it. It is not backward compatible, and a client must
|
||||
always only bind to the specific version it implements. If a client binds
|
||||
to a version different from the version the server provides, an error will
|
||||
be raised.
|
||||
</description>
|
||||
|
||||
<enum name="capability">
|
||||
<entry name="global_app_menu" value="1"/>
|
||||
<entry name="global_menu_bar" value="2"/>
|
||||
<entry name="desktop_icons" value="3"/>
|
||||
</enum>
|
||||
|
||||
|
||||
<event name="capabilities">
|
||||
<arg name="capabilities" type="uint"/>
|
||||
</event>
|
||||
|
||||
@@ -1499,8 +1499,10 @@ gdk_x11_keymap_map_virtual_modifiers (GdkKeymap *keymap,
|
||||
int i, j;
|
||||
gboolean retval;
|
||||
|
||||
#ifdef HAVE_XKB
|
||||
if (KEYMAP_USE_XKB (keymap))
|
||||
get_xkb (keymap_x11);
|
||||
#endif
|
||||
|
||||
retval = TRUE;
|
||||
|
||||
|
||||
+14
-3
@@ -397,9 +397,12 @@ gtk_private_h_sources = \
|
||||
gtkcsskeyframesprivate.h \
|
||||
gtkcsslookupprivate.h \
|
||||
gtkcssmatcherprivate.h \
|
||||
gtkcssnodeprivate.h \
|
||||
gtkcssnodedeclarationprivate.h \
|
||||
gtkcssnodeutilsprivate.h \
|
||||
gtkcssnumbervalueprivate.h \
|
||||
gtkcssparserprivate.h \
|
||||
gtkcsspathnodeprivate.h \
|
||||
gtkcsspositionvalueprivate.h \
|
||||
gtkcssproviderprivate.h \
|
||||
gtkcssrepeatvalueprivate.h \
|
||||
@@ -415,10 +418,12 @@ gtk_private_h_sources = \
|
||||
gtkcssstyleprivate.h \
|
||||
gtkcssstylepropertyprivate.h \
|
||||
gtkcsstransformvalueprivate.h \
|
||||
gtkcsstransientnodeprivate.h \
|
||||
gtkcsstransitionprivate.h \
|
||||
gtkcsstypedvalueprivate.h \
|
||||
gtkcssunsetvalueprivate.h \
|
||||
gtkcssvalueprivate.h \
|
||||
gtkcsswidgetnodeprivate.h \
|
||||
gtkcustompaperunixdialog.h \
|
||||
gtkdialogprivate.h \
|
||||
gtkentryprivate.h \
|
||||
@@ -500,6 +505,7 @@ gtk_private_h_sources = \
|
||||
gtkstylecontextprivate.h \
|
||||
gtkstylepropertyprivate.h \
|
||||
gtkstyleproviderprivate.h \
|
||||
gtktextattributesprivate.h \
|
||||
gtktextbtree.h \
|
||||
gtktextbufferserialize.h \
|
||||
gtktextchildprivate.h \
|
||||
@@ -626,9 +632,12 @@ gtk_base_c_sources = \
|
||||
gtkcsskeyframes.c \
|
||||
gtkcsslookup.c \
|
||||
gtkcssmatcher.c \
|
||||
gtkcssnode.c \
|
||||
gtkcssnodedeclaration.c \
|
||||
gtkcssnodeutils.c \
|
||||
gtkcssnumbervalue.c \
|
||||
gtkcssparser.c \
|
||||
gtkcsspathnode.c \
|
||||
gtkcsspositionvalue.c \
|
||||
gtkcssprovider.c \
|
||||
gtkcssrepeatvalue.c \
|
||||
@@ -646,11 +655,13 @@ gtk_base_c_sources = \
|
||||
gtkcssstyleproperty.c \
|
||||
gtkcssstylepropertyimpl.c \
|
||||
gtkcsstransformvalue.c \
|
||||
gtkcsstransientnode.c \
|
||||
gtkcsstransition.c \
|
||||
gtkcsstypedvalue.c \
|
||||
gtkcssunsetvalue.c \
|
||||
gtkcssvalue.c \
|
||||
gtkcsstypes.c \
|
||||
gtkcssvalue.c \
|
||||
gtkcsswidgetnode.c \
|
||||
gtkdialog.c \
|
||||
gtkdrawingarea.c \
|
||||
gtkeditable.c \
|
||||
@@ -1121,7 +1132,7 @@ gtktypebuiltins.c: $(gtk_public_h_sources) $(a11y_h_sources) $(deprecated_h_sour
|
||||
&& cp xgen-gtbc gtktypebuiltins.c \
|
||||
&& rm -f xgen-gtbc
|
||||
|
||||
gtk.gresource.xml: Makefile.am
|
||||
gtk.gresource.xml: Makefile.am inspector/Makefile.inc
|
||||
$(AM_V_GEN) echo "<?xml version='1.0' encoding='UTF-8'?>" > $@; \
|
||||
echo "<gresources>" >> $@; \
|
||||
echo " <gresource prefix='/org/gtk/libgtk'>" >> $@; \
|
||||
@@ -1330,7 +1341,7 @@ distclean-local:
|
||||
if HAVE_INTROSPECTION
|
||||
introspection_files = \
|
||||
$(filter-out %private.h gtktextdisplay.h gtktextlayout.h gtkx.h, $(gtkinclude_HEADERS) $(a11yinclude_HEADERS) $(deprecatedinclude_HEADERS)) \
|
||||
$(gtk_base_c_sources) \
|
||||
$(filter-out %win32.c %quartz.c, $(gtk_base_c_sources)) \
|
||||
gtkprintoperation-unix.c \
|
||||
gtktypebuiltins.h \
|
||||
gtktypebuiltins.c
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <glib/gi18n-lib.h>
|
||||
#include "gtkmenubuttonaccessible.h"
|
||||
|
||||
|
||||
@@ -84,11 +85,29 @@ gtk_menu_button_accessible_ref_child (AtkObject *obj,
|
||||
return accessible;
|
||||
}
|
||||
|
||||
static const gchar *
|
||||
gtk_menu_button_accessible_get_name (AtkObject *obj)
|
||||
{
|
||||
const gchar *name = NULL;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
name = ATK_OBJECT_CLASS (gtk_menu_button_accessible_parent_class)->get_name (obj);
|
||||
if (name != NULL)
|
||||
return name;
|
||||
|
||||
return _("Menu");
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_menu_button_accessible_class_init (GtkMenuButtonAccessibleClass *klass)
|
||||
{
|
||||
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
|
||||
|
||||
class->get_name = gtk_menu_button_accessible_get_name;
|
||||
class->initialize = gtk_menu_button_accessible_initialize;
|
||||
class->get_n_children = gtk_menu_button_accessible_get_n_children;
|
||||
class->ref_child = gtk_menu_button_accessible_ref_child;
|
||||
|
||||
@@ -305,18 +305,16 @@ gtk_gradient_resolve (GtkGradient *gradient,
|
||||
cairo_pattern_t *
|
||||
_gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
cairo_pattern_t *pattern;
|
||||
guint i;
|
||||
|
||||
g_return_val_if_fail (gradient != NULL, NULL);
|
||||
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (values), NULL);
|
||||
g_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_STYLE (parent_values), NULL);
|
||||
g_return_val_if_fail (*dependencies == 0, NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
|
||||
if (gradient->radius0 == 0 && gradient->radius1 == 0)
|
||||
pattern = cairo_pattern_create_linear (gradient->x0, gradient->y0,
|
||||
@@ -332,21 +330,17 @@ _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
ColorStop *stop;
|
||||
GtkCssValue *val;
|
||||
GdkRGBA rgba;
|
||||
GtkCssDependencies stop_deps;
|
||||
|
||||
stop = &g_array_index (gradient->stops, ColorStop, i);
|
||||
|
||||
/* if color resolving fails, assume transparency */
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (stop->color),
|
||||
provider,
|
||||
gtk_css_style_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
&stop_deps,
|
||||
gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR),
|
||||
NULL);
|
||||
if (val)
|
||||
{
|
||||
rgba = *_gtk_css_rgba_value_get_rgba (val);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, stop_deps);
|
||||
_gtk_css_value_unref (val);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -25,9 +25,8 @@ G_BEGIN_DECLS
|
||||
|
||||
cairo_pattern_t * _gtk_gradient_resolve_full (GtkGradient *gradient,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style);
|
||||
|
||||
GtkGradient * _gtk_gradient_transition (GtkGradient *start,
|
||||
GtkGradient *end,
|
||||
|
||||
@@ -250,7 +250,7 @@ typedef char * GtkStock;
|
||||
*
|
||||
* The “Delete” item and icon.
|
||||
*
|
||||
* Deprecated: 3.10: Use the named icon "edit-cut" or the label "_Delete".
|
||||
* Deprecated: 3.10: Use the named icon "edit-delete" or the label "_Delete".
|
||||
*/
|
||||
#define GTK_STOCK_DELETE ((GtkStock)"gtk-delete")
|
||||
|
||||
@@ -824,7 +824,7 @@ typedef char * GtkStock;
|
||||
*
|
||||
* The “Paste” item and icon.
|
||||
*
|
||||
* Deprecated: 3.10: Do not use an icon. Use label "_Paste".
|
||||
* Deprecated: 3.10: Use named icon "edit-paste" or the label "_Paste".
|
||||
*/
|
||||
#define GTK_STOCK_PASTE ((GtkStock)"gtk-paste")
|
||||
|
||||
|
||||
@@ -306,8 +306,6 @@ gtk_symbolic_color_resolve (GtkSymbolicColor *color,
|
||||
v = _gtk_css_color_value_resolve (color->value,
|
||||
GTK_STYLE_PROVIDER_PRIVATE (props),
|
||||
current,
|
||||
0,
|
||||
NULL,
|
||||
NULL);
|
||||
_gtk_css_value_unref (current);
|
||||
if (v == NULL)
|
||||
|
||||
+127
-77
@@ -77,6 +77,8 @@
|
||||
|
||||
#include "gtkbox.h"
|
||||
#include "gtkboxprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkcssnodeutilsprivate.h"
|
||||
#include "gtkintl.h"
|
||||
#include "gtkorientable.h"
|
||||
#include "gtkorientableprivate.h"
|
||||
@@ -435,14 +437,12 @@ static gboolean
|
||||
gtk_box_draw (GtkWidget *widget,
|
||||
cairo_t *cr)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
GtkAllocation alloc;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_widget_get_allocation (widget, &alloc);
|
||||
|
||||
gtk_render_background (context, cr, 0, 0, alloc.width, alloc.height);
|
||||
gtk_render_frame (context, cr, 0, 0, alloc.width, alloc.height);
|
||||
gtk_css_node_draw (gtk_widget_get_css_node (widget),
|
||||
cr,
|
||||
gtk_widget_get_allocated_width (widget),
|
||||
gtk_widget_get_allocated_height (widget),
|
||||
NULL,
|
||||
widget);
|
||||
|
||||
return GTK_WIDGET_CLASS (gtk_box_parent_class)->draw (widget, cr);
|
||||
}
|
||||
@@ -472,9 +472,13 @@ count_expand_children (GtkBox *box,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
gtk_box_size_allocate_no_center (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
GtkBoxChild *child;
|
||||
@@ -484,12 +488,12 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
|
||||
GtkTextDirection direction;
|
||||
GtkAllocation child_allocation;
|
||||
GtkAllocation child_clip;
|
||||
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;
|
||||
|
||||
@@ -499,8 +503,7 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
gint x = 0, y = 0, i;
|
||||
gint child_size;
|
||||
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
*out_clip = *allocation;
|
||||
|
||||
count_expand_children (box, &nvis_children, &nexpand_children);
|
||||
|
||||
@@ -679,7 +682,6 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline == -1 && have_baseline)
|
||||
{
|
||||
gint height = MAX (1, allocation->height);
|
||||
@@ -798,18 +800,21 @@ gtk_box_size_allocate_no_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
|
||||
|
||||
gtk_widget_get_clip (child->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
gtk_box_size_allocate_with_center (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (data);
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *priv = box->priv;
|
||||
GtkBoxChild *child;
|
||||
@@ -817,14 +822,13 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
gint nvis[2];
|
||||
gint nexp[2];
|
||||
GtkTextDirection direction;
|
||||
GtkAllocation child_allocation;
|
||||
GtkAllocation child_allocation, child_clip;
|
||||
GtkRequestedSize *sizes[2];
|
||||
GtkRequestedSize center_req;
|
||||
gint child_minimum_baseline, child_natural_baseline;
|
||||
gint minimum_above, natural_above;
|
||||
gint minimum_below, natural_below;
|
||||
gboolean have_baseline;
|
||||
gint baseline;
|
||||
gint idx[2];
|
||||
gint center_pos;
|
||||
gint center_size;
|
||||
@@ -838,8 +842,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
gint x = 0, y = 0, i;
|
||||
gint child_size;
|
||||
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
nvis[0] = nvis[1] = 0;
|
||||
nexp[0] = nexp[1] = 0;
|
||||
for (children = priv->children; children; children = children->next)
|
||||
@@ -871,6 +873,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
min_size[0] = nat_size[0] = nvis[0] * priv->spacing;
|
||||
min_size[1] = nat_size[1] = nvis[1] * priv->spacing;
|
||||
|
||||
*out_clip = *allocation;
|
||||
|
||||
/* Retrieve desired size for visible children. */
|
||||
idx[0] = idx[1] = 0;
|
||||
for (children = priv->children; children; children = children->next)
|
||||
@@ -1025,7 +1029,6 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
baseline = gtk_widget_get_allocated_baseline (widget);
|
||||
if (baseline == -1 && have_baseline)
|
||||
{
|
||||
gint height = MAX (1, allocation->height);
|
||||
@@ -1139,6 +1142,8 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (child->widget, &child_allocation, baseline);
|
||||
gtk_widget_get_clip (child->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
|
||||
i++;
|
||||
}
|
||||
@@ -1170,9 +1175,10 @@ gtk_box_size_allocate_with_center (GtkWidget *widget,
|
||||
child_allocation.y = center_pos;
|
||||
child_allocation.height = center_size;
|
||||
}
|
||||
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
|
||||
|
||||
_gtk_widget_set_simple_clip (widget, NULL);
|
||||
gtk_widget_size_allocate_with_baseline (priv->center->widget, &child_allocation, baseline);
|
||||
gtk_widget_get_clip (priv->center->widget, &child_clip);
|
||||
gdk_rectangle_union (out_clip, out_clip, &child_clip);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1180,12 +1186,20 @@ gtk_box_size_allocate (GtkWidget *widget,
|
||||
GtkAllocation *allocation)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkAllocation clip;
|
||||
|
||||
if (box->priv->center &&
|
||||
gtk_widget_get_visible (box->priv->center->widget))
|
||||
gtk_box_size_allocate_with_center (widget, allocation);
|
||||
else
|
||||
gtk_box_size_allocate_no_center (widget, allocation);
|
||||
gtk_widget_set_allocation (widget, allocation);
|
||||
|
||||
gtk_css_node_allocate (gtk_widget_get_css_node (widget),
|
||||
allocation,
|
||||
gtk_widget_get_allocated_baseline (widget),
|
||||
&clip,
|
||||
box->priv->center && gtk_widget_get_visible (box->priv->center->widget)
|
||||
? gtk_box_size_allocate_with_center
|
||||
: gtk_box_size_allocate_no_center,
|
||||
box);
|
||||
|
||||
gtk_widget_set_clip (widget, &clip);
|
||||
}
|
||||
|
||||
static GType
|
||||
@@ -1434,17 +1448,25 @@ gtk_box_buildable_init (GtkBuildableIface *iface)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order_foreach (GtkWidget *widget)
|
||||
gtk_box_invalidate_order_foreach (GtkWidget *widget,
|
||||
gpointer prev)
|
||||
{
|
||||
_gtk_widget_invalidate_style_context (widget, GTK_CSS_CHANGE_POSITION | GTK_CSS_CHANGE_SIBLING_POSITION);
|
||||
GtkCssNode **previous = prev;
|
||||
GtkCssNode *cur = gtk_widget_get_css_node (widget);
|
||||
|
||||
if (*previous)
|
||||
gtk_css_node_set_after (cur, *previous);
|
||||
|
||||
*previous = cur;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_invalidate_order (GtkBox *box)
|
||||
{
|
||||
GtkCssNode *previous = NULL;
|
||||
gtk_container_foreach (GTK_CONTAINER (box),
|
||||
(GtkCallback) gtk_box_invalidate_order_foreach,
|
||||
NULL);
|
||||
gtk_box_invalidate_order_foreach,
|
||||
&previous);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1490,8 +1512,8 @@ gtk_box_pack (GtkBox *box,
|
||||
|
||||
gtk_widget_freeze_child_notify (child);
|
||||
|
||||
gtk_box_invalidate_order (box);
|
||||
gtk_widget_set_parent (child, GTK_WIDGET (box));
|
||||
gtk_box_invalidate_order (box);
|
||||
|
||||
g_signal_connect (child, "notify::visible",
|
||||
G_CALLBACK (box_child_visibility_notify_cb), box);
|
||||
@@ -1657,22 +1679,6 @@ gtk_box_get_size (GtkWidget *widget,
|
||||
*natural_baseline = nat_baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
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, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
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, NULL, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_compute_size_for_opposing_orientation (GtkBox *box,
|
||||
gint avail_size,
|
||||
@@ -1956,19 +1962,74 @@ gtk_box_compute_size_for_orientation (GtkBox *box,
|
||||
*natural_size = required_natural;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_size (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = data;
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *priv = box->priv;
|
||||
|
||||
if (for_size < 0)
|
||||
{
|
||||
gtk_box_get_size (widget, orientation, minimum, natural, minimum_baseline, natural_baseline);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (priv->orientation == orientation)
|
||||
gtk_box_compute_size_for_orientation (box, for_size, minimum, natural);
|
||||
else
|
||||
gtk_box_compute_size_for_opposing_orientation (box, for_size, minimum, natural, minimum_baseline, natural_baseline);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_width (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
-1,
|
||||
minimum_size, natural_size,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_height (GtkWidget *widget,
|
||||
gint *minimum_size,
|
||||
gint *natural_size)
|
||||
{
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
-1,
|
||||
minimum_size, natural_size,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_box_get_preferred_width_for_height (GtkWidget *widget,
|
||||
gint height,
|
||||
gint *minimum_width,
|
||||
gint *natural_width)
|
||||
{
|
||||
GtkBox *box = GTK_BOX (widget);
|
||||
GtkBoxPrivate *private = box->priv;
|
||||
|
||||
if (private->orientation == GTK_ORIENTATION_VERTICAL)
|
||||
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);
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_HORIZONTAL,
|
||||
height,
|
||||
minimum_width, natural_width,
|
||||
NULL, NULL,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1979,24 +2040,13 @@ gtk_box_get_preferred_height_and_baseline_for_width (GtkWidget *widget,
|
||||
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);
|
||||
}
|
||||
}
|
||||
gtk_css_node_get_preferred_size (gtk_widget_get_css_node (widget),
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
width,
|
||||
minimum_height, natural_height,
|
||||
minimum_baseline, natural_baseline,
|
||||
gtk_box_get_preferred_size,
|
||||
widget);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -111,6 +111,7 @@ gtk_cell_renderer_pixbuf_init (GtkCellRendererPixbuf *cellpixbuf)
|
||||
priv->icon_helper = _gtk_icon_helper_new ();
|
||||
_gtk_icon_helper_set_force_scale_pixbuf (priv->icon_helper, TRUE);
|
||||
priv->icon_size = GTK_ICON_SIZE_MENU;
|
||||
priv->follow_state = TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -237,6 +238,8 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
|
||||
* according to the #GtkCellRendererState.
|
||||
*
|
||||
* Since: 2.8
|
||||
*
|
||||
* Deprecated: 3.16: Cell renderers always follow state.
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FOLLOW_STATE,
|
||||
@@ -244,8 +247,8 @@ gtk_cell_renderer_pixbuf_class_init (GtkCellRendererPixbufClass *class)
|
||||
P_("Follow State"),
|
||||
P_("Whether the rendered pixbuf should be "
|
||||
"colorized according to the state"),
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE));
|
||||
TRUE,
|
||||
GTK_PARAM_READWRITE | G_PARAM_DEPRECATED));
|
||||
|
||||
/**
|
||||
* GtkCellRendererPixbuf:gicon:
|
||||
@@ -516,7 +519,6 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
GdkRectangle draw_rect;
|
||||
gboolean is_expander;
|
||||
gint xpad, ypad;
|
||||
GtkStateFlags state;
|
||||
GtkIconHelper *icon_helper = NULL;
|
||||
|
||||
gtk_cell_renderer_pixbuf_get_size (cell, widget, (GdkRectangle *) cell_area,
|
||||
@@ -537,12 +539,6 @@ gtk_cell_renderer_pixbuf_render (GtkCellRenderer *cell,
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
gtk_style_context_save (context);
|
||||
|
||||
state = gtk_cell_renderer_get_state (cell, widget, flags);
|
||||
|
||||
if (!priv->follow_state)
|
||||
state &= ~(GTK_STATE_FLAG_FOCUSED | GTK_STATE_FLAG_PRELIGHT | GTK_STATE_FLAG_SELECTED);
|
||||
|
||||
gtk_style_context_set_state (context, state);
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_IMAGE);
|
||||
|
||||
g_object_get (cell, "is-expander", &is_expander, NULL);
|
||||
|
||||
+1
-1
@@ -286,7 +286,7 @@ gtk_clipboard_finalize (GObject *object)
|
||||
if (clipboard->store_timeout != 0)
|
||||
g_source_remove (clipboard->store_timeout);
|
||||
|
||||
if (clipboard->notify_signal_id != 0)
|
||||
if (clipboard_widget != NULL && clipboard->notify_signal_id != 0)
|
||||
g_signal_handler_disconnect (clipboard_widget, clipboard->notify_signal_id);
|
||||
|
||||
g_free (clipboard->storable_targets);
|
||||
|
||||
+1
-12
@@ -1846,19 +1846,8 @@ gtk_container_idle_sizer (GdkFrameClock *clock,
|
||||
*/
|
||||
if (container->priv->restyle_pending)
|
||||
{
|
||||
GtkBitmask *empty;
|
||||
gint64 current_time;
|
||||
|
||||
empty = _gtk_bitmask_new ();
|
||||
current_time = g_get_monotonic_time ();
|
||||
|
||||
container->priv->restyle_pending = FALSE;
|
||||
_gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (container)),
|
||||
current_time,
|
||||
0,
|
||||
empty);
|
||||
|
||||
_gtk_bitmask_free (empty);
|
||||
gtk_css_node_validate (gtk_widget_get_css_node (GTK_WIDGET (container)));
|
||||
}
|
||||
|
||||
/* we may be invoked with a container_resize_queue of NULL, because
|
||||
|
||||
+22
-16
@@ -63,6 +63,21 @@ gtk_css_animated_style_get_section (GtkCssStyle *style,
|
||||
return gtk_css_style_get_section (animated->style, id);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_animated_style_is_static (GtkCssStyle *style)
|
||||
{
|
||||
GtkCssAnimatedStyle *animated = GTK_CSS_ANIMATED_STYLE (style);
|
||||
GSList *list;
|
||||
|
||||
for (list = animated->animations; list; list = list->next)
|
||||
{
|
||||
if (!_gtk_style_animation_is_static (list->data, animated->current_time))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_animated_style_dispose (GObject *object)
|
||||
{
|
||||
@@ -101,6 +116,7 @@ gtk_css_animated_style_class_init (GtkCssAnimatedStyleClass *klass)
|
||||
|
||||
style_class->get_value = gtk_css_animated_style_get_value;
|
||||
style_class->get_section = gtk_css_animated_style_get_section;
|
||||
style_class->is_static = gtk_css_animated_style_is_static;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -410,6 +426,9 @@ gtk_css_animated_style_new (GtkCssStyle *base_style,
|
||||
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
|
||||
gtk_internal_return_val_if_fail (previous_style == NULL || GTK_IS_CSS_STYLE (previous_style), NULL);
|
||||
|
||||
if (timestamp == 0)
|
||||
return g_object_ref (base_style);
|
||||
|
||||
animations = NULL;
|
||||
|
||||
if (previous_style != NULL)
|
||||
@@ -441,6 +460,9 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (source), NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (base), NULL);
|
||||
|
||||
if (timestamp == 0)
|
||||
return g_object_ref (source->style);
|
||||
|
||||
animations = NULL;
|
||||
for (l = source->animations; l; l = l->next)
|
||||
{
|
||||
@@ -466,19 +488,3 @@ gtk_css_animated_style_new_advance (GtkCssAnimatedStyle *source,
|
||||
|
||||
return GTK_CSS_STYLE (result);
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_animated_style_is_static (GtkCssAnimatedStyle *style)
|
||||
{
|
||||
GSList *list;
|
||||
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_ANIMATED_STYLE (style), TRUE);
|
||||
|
||||
for (list = style->animations; list; list = list->next)
|
||||
{
|
||||
if (!_gtk_style_animation_is_static (list->data, style->current_time))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -68,8 +68,6 @@ void gtk_css_animated_style_set_animated_value(GtkCssAnimated
|
||||
GtkCssValue * gtk_css_animated_style_get_intrinsic_value (GtkCssAnimatedStyle *style,
|
||||
guint id);
|
||||
|
||||
gboolean gtk_css_animated_style_is_static (GtkCssAnimatedStyle *style);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_ANIMATED_STYLE_PRIVATE_H__ */
|
||||
|
||||
@@ -47,20 +47,16 @@ gtk_css_value_array_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkCssValue *i_value;
|
||||
guint i, j;
|
||||
GtkCssDependencies child_deps;
|
||||
|
||||
result = NULL;
|
||||
for (i = 0; i < value->n_values; i++)
|
||||
{
|
||||
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
|
||||
if (result == NULL &&
|
||||
i_value != value->values[i])
|
||||
|
||||
@@ -45,25 +45,20 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
if (value->x == NULL && value->y == NULL)
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
x_deps = y_deps = 0;
|
||||
x = y = NULL;
|
||||
|
||||
if (value->x)
|
||||
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style, &x_deps);
|
||||
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style);
|
||||
|
||||
if (value->y)
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style, &y_deps);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
|
||||
|
||||
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
|
||||
value->y ? y : NULL);
|
||||
|
||||
@@ -46,11 +46,9 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *computed;
|
||||
GtkCssDependencies child_deps;
|
||||
gboolean changed = FALSE;
|
||||
guint i;
|
||||
|
||||
@@ -61,8 +59,7 @@ gtk_css_value_border_compute (GtkCssValue *value,
|
||||
{
|
||||
if (value->values[i])
|
||||
{
|
||||
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
changed |= (computed->values[i] != value->values[i]);
|
||||
}
|
||||
}
|
||||
|
||||
+9
-36
@@ -124,8 +124,7 @@ gtk_css_value_color_get_fallback (guint property_id,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
NULL);
|
||||
parent_style);
|
||||
default:
|
||||
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
|
||||
g_warning ("No fallback color defined for property '%s'",
|
||||
@@ -138,20 +137,13 @@ GtkCssValue *
|
||||
_gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssValue *value;
|
||||
|
||||
g_return_val_if_fail (color != NULL, NULL);
|
||||
g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
*dependencies = 0;
|
||||
|
||||
switch (color->type)
|
||||
{
|
||||
case COLOR_TYPE_LITERAL:
|
||||
@@ -170,7 +162,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
if (named == NULL)
|
||||
return NULL;
|
||||
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, current_deps, dependencies, &cycle);
|
||||
value = _gtk_css_color_value_resolve (named, provider, current, &cycle);
|
||||
if (value == NULL)
|
||||
return NULL;
|
||||
}
|
||||
@@ -182,12 +174,10 @@ _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, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
|
||||
_gtk_hsla_init_from_rgba (&hsla, _gtk_css_rgba_value_get_rgba (val));
|
||||
_gtk_hsla_shade (&hsla, &hsla, color->sym_col.shade.factor);
|
||||
|
||||
@@ -204,11 +194,10 @@ _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, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
|
||||
alpha = *_gtk_css_rgba_value_get_rgba (val);
|
||||
alpha.alpha = CLAMP (alpha.alpha * color->sym_col.alpha.factor, 0, 1);
|
||||
|
||||
@@ -222,21 +211,19 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
{
|
||||
GtkCssValue *val;
|
||||
GdkRGBA color1, color2, res;
|
||||
GtkCssDependencies dep1, dep2;
|
||||
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, current_deps, &dep1, cycle_list);
|
||||
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, cycle_list);
|
||||
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, cycle_list);
|
||||
if (val == NULL)
|
||||
return NULL;
|
||||
color2 = *_gtk_css_rgba_value_get_rgba (val);
|
||||
_gtk_css_value_unref (val);
|
||||
|
||||
*dependencies = _gtk_css_dependencies_union (dep1, dep2);
|
||||
res.red = CLAMP (color1.red + ((color2.red - color1.red) * color->sym_col.mix.factor), 0, 1);
|
||||
res.green = CLAMP (color1.green + ((color2.green - color1.green) * color->sym_col.mix.factor), 0, 1);
|
||||
res.blue = CLAMP (color1.blue + ((color2.blue - color1.blue) * color->sym_col.mix.factor), 0, 1);
|
||||
@@ -262,7 +249,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
case COLOR_TYPE_CURRENT_COLOR:
|
||||
if (current)
|
||||
{
|
||||
*dependencies = current_deps;
|
||||
return _gtk_css_value_ref (current);
|
||||
}
|
||||
else
|
||||
@@ -270,8 +256,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
return _gtk_css_color_value_resolve (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)),
|
||||
provider,
|
||||
NULL,
|
||||
0,
|
||||
dependencies,
|
||||
cycle_list);
|
||||
}
|
||||
break;
|
||||
@@ -301,11 +285,9 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *resolved, *current;
|
||||
GtkCssDependencies current_deps;
|
||||
|
||||
/* The computed value of the ‘currentColor’ keyword is the computed
|
||||
* value of the ‘color’ property. If the ‘currentColor’ keyword is
|
||||
@@ -314,27 +296,18 @@ gtk_css_value_color_compute (GtkCssValue *value,
|
||||
if (property_id == GTK_CSS_PROPERTY_COLOR)
|
||||
{
|
||||
if (parent_style)
|
||||
{
|
||||
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_EQUALS_PARENT;
|
||||
}
|
||||
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
|
||||
else
|
||||
{
|
||||
current = NULL;
|
||||
current_deps = 0;
|
||||
}
|
||||
current = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
current = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR);
|
||||
current_deps = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
}
|
||||
|
||||
resolved = _gtk_css_color_value_resolve (value,
|
||||
provider,
|
||||
current,
|
||||
current_deps,
|
||||
dependencies,
|
||||
NULL);
|
||||
|
||||
if (resolved == NULL)
|
||||
|
||||
@@ -46,8 +46,6 @@ GtkCssValue * _gtk_css_color_value_parse (GtkCssParser *parser)
|
||||
GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue *color,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssValue *current,
|
||||
GtkCssDependencies current_deps,
|
||||
GtkCssDependencies *dependencies,
|
||||
GSList *cycle_list);
|
||||
|
||||
|
||||
|
||||
@@ -41,15 +41,12 @@ gtk_css_value_corner_compute (GtkCssValue *corner,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style, &x_deps);
|
||||
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style);
|
||||
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style);
|
||||
if (x == corner->x && y == corner->y)
|
||||
{
|
||||
_gtk_css_value_unref (x);
|
||||
|
||||
@@ -54,8 +54,7 @@ gtk_css_value_ease_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,7 @@ gtk_css_value_engine_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
+3
-10
@@ -42,8 +42,7 @@ gtk_css_value_enum_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
@@ -165,8 +164,7 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
double font_size;
|
||||
|
||||
@@ -197,7 +195,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
font_size = _gtk_css_font_size_get_default (provider) * 2;
|
||||
break;
|
||||
case GTK_CSS_FONT_SIZE_SMALLER:
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
if (parent_style)
|
||||
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
else
|
||||
@@ -206,7 +203,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
|
||||
font_size /= 1.2;
|
||||
break;
|
||||
case GTK_CSS_FONT_SIZE_LARGER:
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
if (parent_style)
|
||||
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
else
|
||||
@@ -376,8 +372,7 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
PangoWeight new_weight;
|
||||
int parent_value;
|
||||
@@ -385,8 +380,6 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
|
||||
if (value->value >= 0)
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
|
||||
if (parent_style)
|
||||
parent_value = gtk_css_style_get_value (parent_style, property_id)->value;
|
||||
else
|
||||
|
||||
@@ -74,8 +74,7 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkIconTheme *icontheme;
|
||||
|
||||
+3
-10
@@ -65,8 +65,7 @@ gtk_css_image_real_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return g_object_ref (image);
|
||||
}
|
||||
@@ -149,23 +148,17 @@ _gtk_css_image_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssDependencies unused;
|
||||
GtkCssImageClass *klass;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
|
||||
if (dependencies == NULL)
|
||||
dependencies = &unused;
|
||||
*dependencies = 0;
|
||||
|
||||
klass = GTK_CSS_IMAGE_GET_CLASS (image);
|
||||
|
||||
return klass->compute (image, property_id, provider, style, parent_style, dependencies);
|
||||
return klass->compute (image, property_id, provider, style, parent_style);
|
||||
}
|
||||
|
||||
GtkCssImage *
|
||||
|
||||
@@ -806,8 +806,7 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageBuiltin *result;
|
||||
GtkBorderStyle border_style;
|
||||
@@ -832,9 +831,6 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
|
||||
result->bg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
|
||||
result->border_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
|
||||
|
||||
/* XXX: We also depend on other values, but I guess we cannot express that */
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
|
||||
return GTK_CSS_IMAGE (result);
|
||||
}
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
|
||||
GtkCssImageGradient *copy;
|
||||
@@ -46,7 +45,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
|
||||
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
|
||||
copy->gradient = gtk_gradient_ref (gradient->gradient);
|
||||
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style, dependencies);
|
||||
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style);
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
@@ -129,8 +129,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
|
||||
GtkCssImageIconTheme *copy;
|
||||
@@ -149,8 +148,6 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
|
||||
copy->scale = _gtk_style_provider_private_get_scale (provider);
|
||||
copy->color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
|
||||
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
|
||||
|
||||
return GTK_CSS_IMAGE (copy);
|
||||
}
|
||||
|
||||
|
||||
@@ -432,8 +432,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
|
||||
GtkCssImageLinear *copy;
|
||||
@@ -442,24 +441,21 @@ gtk_css_image_linear_compute (GtkCssImage *image,
|
||||
copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
|
||||
copy->repeating = linear->repeating;
|
||||
|
||||
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style, dependencies);
|
||||
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style);
|
||||
|
||||
g_array_set_size (copy->stops, linear->stops->len);
|
||||
for (i = 0; i < linear->stops->len; i++)
|
||||
{
|
||||
GtkCssImageLinearColorStop *stop, *scopy;
|
||||
GtkCssDependencies child_deps;
|
||||
|
||||
stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
|
||||
scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
|
||||
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style);
|
||||
|
||||
if (stop->offset)
|
||||
{
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -59,8 +59,7 @@ struct _GtkCssImageClass
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *parent_style);
|
||||
/* compare two images for equality */
|
||||
gboolean (* equal) (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
@@ -96,8 +95,7 @@ GtkCssImage * _gtk_css_image_compute (GtkCssImage *
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssStyle *parent_style);
|
||||
gboolean _gtk_css_image_equal (GtkCssImage *image1,
|
||||
GtkCssImage *image2);
|
||||
GtkCssImage * _gtk_css_image_transition (GtkCssImage *start,
|
||||
|
||||
@@ -97,8 +97,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageScaled *scaled = GTK_CSS_IMAGE_SCALED (image);
|
||||
GtkCssImageScaled *copy;
|
||||
@@ -122,8 +121,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
dependencies);
|
||||
parent_style);
|
||||
else
|
||||
copy->images[i] = g_object_ref (scaled->images[i]);
|
||||
}
|
||||
|
||||
@@ -124,8 +124,7 @@ gtk_css_image_url_compute (GtkCssImage *image,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);
|
||||
|
||||
|
||||
@@ -38,8 +38,7 @@ gtk_css_value_image_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssImage *image, *computed;
|
||||
|
||||
@@ -48,7 +47,7 @@ gtk_css_value_image_compute (GtkCssValue *value,
|
||||
if (image == NULL)
|
||||
return _gtk_css_value_ref (value);
|
||||
|
||||
computed = _gtk_css_image_compute (image, property_id, provider, style, parent_style, dependencies);
|
||||
computed = _gtk_css_image_compute (image, property_id, provider, style, parent_style);
|
||||
|
||||
if (computed == image)
|
||||
{
|
||||
|
||||
@@ -38,12 +38,10 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
if (parent_style)
|
||||
{
|
||||
*dependencies = GTK_CSS_EQUALS_PARENT;
|
||||
return _gtk_css_value_ref (gtk_css_style_get_value (parent_style, property_id));
|
||||
}
|
||||
else
|
||||
@@ -52,8 +50,7 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
dependencies);
|
||||
parent_style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkSettings *settings;
|
||||
|
||||
@@ -94,8 +93,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
dependencies);
|
||||
parent_style);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -466,8 +466,7 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
|
||||
resolved->property_ids[p],
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
NULL);
|
||||
parent_style);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+233
-3
@@ -19,6 +19,8 @@
|
||||
|
||||
#include "gtkcssmatcherprivate.h"
|
||||
|
||||
#include "gtkcssnodedeclarationprivate.h"
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
|
||||
/* GTK_CSS_MATCHER_WIDGET_PATH */
|
||||
@@ -31,6 +33,7 @@ gtk_css_matcher_widget_path_get_parent (GtkCssMatcher *matcher,
|
||||
return FALSE;
|
||||
|
||||
matcher->path.klass = child->path.klass;
|
||||
matcher->path.decl = NULL;
|
||||
matcher->path.path = child->path.path;
|
||||
matcher->path.index = child->path.index - 1;
|
||||
matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index);
|
||||
@@ -46,6 +49,7 @@ gtk_css_matcher_widget_path_get_previous (GtkCssMatcher *matcher,
|
||||
return FALSE;
|
||||
|
||||
matcher->path.klass = next->path.klass;
|
||||
matcher->path.decl = NULL;
|
||||
matcher->path.path = next->path.path;
|
||||
matcher->path.index = next->path.index;
|
||||
matcher->path.sibling_index = next->path.sibling_index - 1;
|
||||
@@ -58,6 +62,9 @@ gtk_css_matcher_widget_path_get_state (const GtkCssMatcher *matcher)
|
||||
{
|
||||
const GtkWidgetPath *siblings;
|
||||
|
||||
if (matcher->path.decl)
|
||||
return gtk_css_node_declaration_get_state (matcher->path.decl);
|
||||
|
||||
siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
|
||||
if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
|
||||
return gtk_widget_path_iter_get_state (siblings, matcher->path.sibling_index);
|
||||
@@ -84,6 +91,10 @@ gtk_css_matcher_widget_path_has_class (const GtkCssMatcher *matcher,
|
||||
{
|
||||
const GtkWidgetPath *siblings;
|
||||
|
||||
if (matcher->path.decl &&
|
||||
gtk_css_node_declaration_has_class (matcher->path.decl, class_name))
|
||||
return TRUE;
|
||||
|
||||
siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
|
||||
if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
|
||||
return gtk_widget_path_iter_has_qclass (siblings, matcher->path.sibling_index, class_name);
|
||||
@@ -111,6 +122,16 @@ gtk_css_matcher_widget_path_has_regions (const GtkCssMatcher *matcher)
|
||||
GSList *regions;
|
||||
gboolean result;
|
||||
|
||||
if (matcher->path.decl)
|
||||
{
|
||||
GList *list = gtk_css_node_declaration_list_regions (matcher->path.decl);
|
||||
if (list)
|
||||
{
|
||||
g_list_free (list);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
|
||||
if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
|
||||
@@ -132,6 +153,14 @@ gtk_css_matcher_widget_path_has_region (const GtkCssMatcher *matcher,
|
||||
const GtkWidgetPath *siblings;
|
||||
GtkRegionFlags region_flags;
|
||||
|
||||
if (matcher->path.decl)
|
||||
{
|
||||
GQuark q = g_quark_try_string (region);
|
||||
|
||||
if (q && gtk_css_node_declaration_has_region (matcher->path.decl, q, ®ion_flags))
|
||||
goto found;
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
siblings = gtk_widget_path_iter_get_siblings (matcher->path.path, matcher->path.index);
|
||||
if (siblings && matcher->path.sibling_index != gtk_widget_path_iter_get_sibling_index (matcher->path.path, matcher->path.index))
|
||||
@@ -144,12 +173,13 @@ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (!gtk_widget_path_iter_has_region (matcher->path.path, matcher->path.index, region, ®ion_flags))
|
||||
return FALSE;
|
||||
}
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
found:
|
||||
if ((flags & region_flags) != flags)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -195,13 +225,15 @@ static const GtkCssMatcherClass GTK_CSS_MATCHER_WIDGET_PATH = {
|
||||
};
|
||||
|
||||
gboolean
|
||||
_gtk_css_matcher_init (GtkCssMatcher *matcher,
|
||||
const GtkWidgetPath *path)
|
||||
_gtk_css_matcher_init (GtkCssMatcher *matcher,
|
||||
const GtkWidgetPath *path,
|
||||
const GtkCssNodeDeclaration *decl)
|
||||
{
|
||||
if (gtk_widget_path_length (path) == 0)
|
||||
return FALSE;
|
||||
|
||||
matcher->path.klass = >K_CSS_MATCHER_WIDGET_PATH;
|
||||
matcher->path.decl = decl;
|
||||
matcher->path.path = path;
|
||||
matcher->path.index = gtk_widget_path_length (path) - 1;
|
||||
matcher->path.sibling_index = gtk_widget_path_iter_get_sibling_index (path, matcher->path.index);
|
||||
@@ -209,6 +241,204 @@ _gtk_css_matcher_init (GtkCssMatcher *matcher,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* GTK_CSS_MATCHER_NODE */
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_get_parent (GtkCssMatcher *matcher,
|
||||
const GtkCssMatcher *child)
|
||||
{
|
||||
GtkCssNode *node;
|
||||
|
||||
node = gtk_css_node_get_parent (child->node.node);
|
||||
if (node == NULL)
|
||||
return FALSE;
|
||||
|
||||
return gtk_css_node_init_matcher (node, matcher);
|
||||
}
|
||||
|
||||
static GtkCssNode *
|
||||
get_previous_visible_sibling (GtkCssNode *node)
|
||||
{
|
||||
do {
|
||||
node = gtk_css_node_get_previous_sibling (node);
|
||||
} while (node && !gtk_css_node_get_visible (node));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
static GtkCssNode *
|
||||
get_next_visible_sibling (GtkCssNode *node)
|
||||
{
|
||||
do {
|
||||
node = gtk_css_node_get_next_sibling (node);
|
||||
} while (node && !gtk_css_node_get_visible (node));
|
||||
|
||||
return node;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_get_previous (GtkCssMatcher *matcher,
|
||||
const GtkCssMatcher *next)
|
||||
{
|
||||
GtkCssNode *node;
|
||||
|
||||
node = get_previous_visible_sibling (next->node.node);
|
||||
if (node == NULL)
|
||||
return FALSE;
|
||||
|
||||
return gtk_css_node_init_matcher (node, matcher);
|
||||
}
|
||||
|
||||
static GtkStateFlags
|
||||
gtk_css_matcher_node_get_state (const GtkCssMatcher *matcher)
|
||||
{
|
||||
return gtk_css_node_get_state (matcher->node.node);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_type (const GtkCssMatcher *matcher,
|
||||
GType type)
|
||||
{
|
||||
return g_type_is_a (gtk_css_node_get_widget_type (matcher->node.node), type);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_class (const GtkCssMatcher *matcher,
|
||||
GQuark class_name)
|
||||
{
|
||||
return gtk_css_node_has_qclass (matcher->node.node, class_name);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_id (const GtkCssMatcher *matcher,
|
||||
const char *id)
|
||||
{
|
||||
return gtk_css_node_get_id (matcher->node.node) == g_intern_string (id);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_regions (const GtkCssMatcher *matcher)
|
||||
{
|
||||
GList *regions;
|
||||
gboolean result;
|
||||
|
||||
regions = gtk_css_node_list_regions (matcher->node.node);
|
||||
result = regions != NULL;
|
||||
g_list_free (regions);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_region (const GtkCssMatcher *matcher,
|
||||
const char *region,
|
||||
GtkRegionFlags flags)
|
||||
{
|
||||
GtkRegionFlags region_flags;
|
||||
GQuark region_quark;
|
||||
|
||||
region_quark = g_quark_try_string (region);
|
||||
if (!region_quark)
|
||||
return FALSE;
|
||||
|
||||
if (!gtk_css_node_has_region (matcher->node.node, region_quark, ®ion_flags))
|
||||
return FALSE;
|
||||
|
||||
if ((flags & region_flags) != flags)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_nth_child (GtkCssNode *node,
|
||||
int a,
|
||||
int b)
|
||||
{
|
||||
while (b-- > 0)
|
||||
{
|
||||
if (node == NULL)
|
||||
return FALSE;
|
||||
|
||||
node = get_previous_visible_sibling (node);
|
||||
}
|
||||
|
||||
if (a == 0)
|
||||
return node == NULL;
|
||||
else if (a == 1)
|
||||
return TRUE;
|
||||
|
||||
b = 0;
|
||||
while (node)
|
||||
{
|
||||
b++;
|
||||
node = get_previous_visible_sibling (node);
|
||||
}
|
||||
|
||||
return b % a == 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_nth_last_child (GtkCssNode *node,
|
||||
int a,
|
||||
int b)
|
||||
{
|
||||
while (b-- > 0)
|
||||
{
|
||||
if (node == NULL)
|
||||
return FALSE;
|
||||
|
||||
node = get_next_visible_sibling (node);
|
||||
}
|
||||
|
||||
if (a == 0)
|
||||
return node == NULL;
|
||||
else if (a == 1)
|
||||
return TRUE;
|
||||
|
||||
b = 0;
|
||||
while (node)
|
||||
{
|
||||
b++;
|
||||
node = get_next_visible_sibling (node);
|
||||
}
|
||||
|
||||
return b % a == 0;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_matcher_node_has_position (const GtkCssMatcher *matcher,
|
||||
gboolean forward,
|
||||
int a,
|
||||
int b)
|
||||
{
|
||||
if (forward)
|
||||
return gtk_css_matcher_node_nth_child (matcher->node.node, a, b);
|
||||
else
|
||||
return gtk_css_matcher_node_nth_last_child (matcher->node.node, a, b);
|
||||
}
|
||||
|
||||
static const GtkCssMatcherClass GTK_CSS_MATCHER_NODE = {
|
||||
gtk_css_matcher_node_get_parent,
|
||||
gtk_css_matcher_node_get_previous,
|
||||
gtk_css_matcher_node_get_state,
|
||||
gtk_css_matcher_node_has_type,
|
||||
gtk_css_matcher_node_has_class,
|
||||
gtk_css_matcher_node_has_id,
|
||||
gtk_css_matcher_node_has_regions,
|
||||
gtk_css_matcher_node_has_region,
|
||||
gtk_css_matcher_node_has_position,
|
||||
FALSE
|
||||
};
|
||||
|
||||
void
|
||||
_gtk_css_matcher_node_init (GtkCssMatcher *matcher,
|
||||
GtkCssNode *node)
|
||||
{
|
||||
matcher->node.klass = >K_CSS_MATCHER_NODE;
|
||||
matcher->node.node = node;
|
||||
}
|
||||
|
||||
/* GTK_CSS_MATCHER_WIDGET_ANY */
|
||||
|
||||
static gboolean
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef union _GtkCssMatcher GtkCssMatcher;
|
||||
typedef struct _GtkCssMatcherNode GtkCssMatcherNode;
|
||||
typedef struct _GtkCssMatcherSuperset GtkCssMatcherSuperset;
|
||||
typedef struct _GtkCssMatcherWidgetPath GtkCssMatcherWidgetPath;
|
||||
typedef struct _GtkCssMatcherClass GtkCssMatcherClass;
|
||||
@@ -55,11 +55,17 @@ struct _GtkCssMatcherClass {
|
||||
|
||||
struct _GtkCssMatcherWidgetPath {
|
||||
const GtkCssMatcherClass *klass;
|
||||
const GtkCssNodeDeclaration *decl;
|
||||
const GtkWidgetPath *path;
|
||||
guint index;
|
||||
guint sibling_index;
|
||||
};
|
||||
|
||||
struct _GtkCssMatcherNode {
|
||||
const GtkCssMatcherClass *klass;
|
||||
GtkCssNode *node;
|
||||
};
|
||||
|
||||
struct _GtkCssMatcherSuperset {
|
||||
const GtkCssMatcherClass *klass;
|
||||
const GtkCssMatcher *subset;
|
||||
@@ -69,11 +75,15 @@ struct _GtkCssMatcherSuperset {
|
||||
union _GtkCssMatcher {
|
||||
const GtkCssMatcherClass *klass;
|
||||
GtkCssMatcherWidgetPath path;
|
||||
GtkCssMatcherNode node;
|
||||
GtkCssMatcherSuperset superset;
|
||||
};
|
||||
|
||||
gboolean _gtk_css_matcher_init (GtkCssMatcher *matcher,
|
||||
const GtkWidgetPath *path) G_GNUC_WARN_UNUSED_RESULT;
|
||||
const GtkWidgetPath *path,
|
||||
const GtkCssNodeDeclaration *decl) G_GNUC_WARN_UNUSED_RESULT;
|
||||
void _gtk_css_matcher_node_init (GtkCssMatcher *matcher,
|
||||
GtkCssNode *node);
|
||||
void _gtk_css_matcher_any_init (GtkCssMatcher *matcher);
|
||||
void _gtk_css_matcher_superset_init (GtkCssMatcher *matcher,
|
||||
const GtkCssMatcher *subset,
|
||||
|
||||
+1300
File diff suppressed because it is too large
Load Diff
@@ -18,14 +18,12 @@
|
||||
#ifndef __GTK_CSS_NODE_DECLARATION_PRIVATE_H__
|
||||
#define __GTK_CSS_NODE_DECLARATION_PRIVATE_H__
|
||||
|
||||
#include "gtkcsstypesprivate.h"
|
||||
#include "gtkenums.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GtkCssNodeDeclaration GtkCssNodeDeclaration;
|
||||
|
||||
|
||||
GtkCssNodeDeclaration * gtk_css_node_declaration_new (void);
|
||||
GtkCssNodeDeclaration * gtk_css_node_declaration_ref (GtkCssNodeDeclaration *decl);
|
||||
void gtk_css_node_declaration_unref (GtkCssNodeDeclaration *decl);
|
||||
|
||||
@@ -0,0 +1,176 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_CSS_NODE_PRIVATE_H__
|
||||
#define __GTK_CSS_NODE_PRIVATE_H__
|
||||
|
||||
#include "gtkcssnodedeclarationprivate.h"
|
||||
#include "gtkbitmaskprivate.h"
|
||||
#include "gtkcsstypesprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CSS_NODE (gtk_css_node_get_type ())
|
||||
#define GTK_CSS_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_CSS_NODE, GtkCssNode))
|
||||
#define GTK_CSS_NODE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_CSS_NODE, GtkCssNodeClass))
|
||||
#define GTK_IS_CSS_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_CSS_NODE))
|
||||
#define GTK_IS_CSS_NODE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_CSS_NODE))
|
||||
#define GTK_CSS_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CSS_NODE, GtkCssNodeClass))
|
||||
|
||||
typedef struct _GtkCssNode GtkCssNode;
|
||||
typedef struct _GtkCssNodeClass GtkCssNodeClass;
|
||||
|
||||
struct _GtkCssNode
|
||||
{
|
||||
GObject object;
|
||||
|
||||
GtkCssNode *parent;
|
||||
GtkCssNode *previous_sibling;
|
||||
GtkCssNode *next_sibling;
|
||||
GtkCssNode *first_child;
|
||||
GtkCssNode *last_child;
|
||||
|
||||
GtkCssNodeDeclaration *decl;
|
||||
GtkCssStyle *style;
|
||||
|
||||
GtkCssChange pending_changes; /* changes that accumulated since the style was last computed */
|
||||
|
||||
guint visible :1; /* node will be skipped when validating or computing styles */
|
||||
guint invalid :1; /* node or a child needs to be validated (even if just for animation) */
|
||||
guint children_changed :1; /* the children changed since last validation */
|
||||
guint needs_propagation :1; /* children have state changes that need to be propagated to their siblings */
|
||||
/* Two invariants hold for this variable:
|
||||
* style_is_invalid == TRUE => next_sibling->style_is_invalid == TRUE
|
||||
* style_is_invalid == FALSE => first_child->style_is_invalid == TRUE
|
||||
* So if a valid style is computed, one has to previously ensure that the parent's and the previous sibling's style
|
||||
* are valid. This allows both validation and invalidation to run in O(nodes-in-tree) */
|
||||
guint style_is_invalid :1; /* the style needs to be recomputed */
|
||||
};
|
||||
|
||||
struct _GtkCssNodeClass
|
||||
{
|
||||
GObjectClass object_class;
|
||||
|
||||
void (* node_added) (GtkCssNode *cssnode,
|
||||
GtkCssNode *child,
|
||||
GtkCssNode *previous);
|
||||
void (* node_removed) (GtkCssNode *cssnode,
|
||||
GtkCssNode *child,
|
||||
GtkCssNode *previous);
|
||||
void (* style_changed) (GtkCssNode *cssnode,
|
||||
GtkCssStyle *old_style,
|
||||
GtkCssStyle *new_style);
|
||||
|
||||
gboolean (* init_matcher) (GtkCssNode *cssnode,
|
||||
GtkCssMatcher *matcher);
|
||||
GtkWidgetPath * (* create_widget_path) (GtkCssNode *cssnode);
|
||||
const GtkWidgetPath * (* get_widget_path) (GtkCssNode *cssnode);
|
||||
/* get style provider to use or NULL to use parent's */
|
||||
GtkStyleProviderPrivate *(* get_style_provider) (GtkCssNode *cssnode);
|
||||
/* get frame clock or NULL (only relevant for root node) */
|
||||
GdkFrameClock * (* get_frame_clock) (GtkCssNode *cssnode);
|
||||
GtkCssStyle * (* update_style) (GtkCssNode *cssnode,
|
||||
GtkCssChange pending_changes,
|
||||
gint64 timestamp,
|
||||
GtkCssStyle *old_style);
|
||||
void (* invalidate) (GtkCssNode *node);
|
||||
void (* queue_validate) (GtkCssNode *node);
|
||||
void (* dequeue_validate) (GtkCssNode *node);
|
||||
void (* validate) (GtkCssNode *node);
|
||||
};
|
||||
|
||||
GType gtk_css_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkCssNode * gtk_css_node_new (void);
|
||||
|
||||
void gtk_css_node_set_parent (GtkCssNode *cssnode,
|
||||
GtkCssNode *parent);
|
||||
void gtk_css_node_set_after (GtkCssNode *cssnode,
|
||||
GtkCssNode *previous_sibling);
|
||||
void gtk_css_node_set_before (GtkCssNode *cssnode,
|
||||
GtkCssNode *next_sibling);
|
||||
GtkCssNode * gtk_css_node_get_parent (GtkCssNode *cssnode);
|
||||
GtkCssNode * gtk_css_node_get_first_child (GtkCssNode *cssnode);
|
||||
GtkCssNode * gtk_css_node_get_last_child (GtkCssNode *cssnode);
|
||||
GtkCssNode * gtk_css_node_get_previous_sibling(GtkCssNode *cssnode);
|
||||
GtkCssNode * gtk_css_node_get_next_sibling (GtkCssNode *cssnode);
|
||||
|
||||
void gtk_css_node_set_visible (GtkCssNode *cssnode,
|
||||
gboolean visible);
|
||||
gboolean gtk_css_node_get_visible (GtkCssNode *cssnode);
|
||||
|
||||
void gtk_css_node_set_widget_type (GtkCssNode *cssnode,
|
||||
GType widget_type);
|
||||
GType gtk_css_node_get_widget_type (GtkCssNode *cssnode);
|
||||
void gtk_css_node_set_id (GtkCssNode *cssnode,
|
||||
const char *id);
|
||||
const char * gtk_css_node_get_id (GtkCssNode *cssnode);
|
||||
void gtk_css_node_set_state (GtkCssNode *cssnode,
|
||||
GtkStateFlags state_flags);
|
||||
GtkStateFlags gtk_css_node_get_state (GtkCssNode *cssnode);
|
||||
void gtk_css_node_add_state (GtkCssNode *cssnode,
|
||||
GtkStateFlags state_flags);
|
||||
void gtk_css_node_remove_state (GtkCssNode *cssnode,
|
||||
GtkStateFlags state_flags);
|
||||
void gtk_css_node_set_junction_sides (GtkCssNode *cssnode,
|
||||
GtkJunctionSides junction_sides);
|
||||
GtkJunctionSides gtk_css_node_get_junction_sides (GtkCssNode *cssnode);
|
||||
void gtk_css_node_set_classes (GtkCssNode *cssnode,
|
||||
const char **classes);
|
||||
char ** gtk_css_node_get_classes (GtkCssNode *cssnode);
|
||||
void gtk_css_node_add_class (GtkCssNode *cssnode,
|
||||
const char *style_class);
|
||||
void gtk_css_node_remove_class (GtkCssNode *cssnode,
|
||||
const char *style_class);
|
||||
gboolean gtk_css_node_has_class (GtkCssNode *cssnode,
|
||||
const char *style_class);
|
||||
gboolean gtk_css_node_has_qclass (GtkCssNode *cssnode,
|
||||
GQuark style_class);
|
||||
GList * gtk_css_node_list_classes (GtkCssNode *cssnode);
|
||||
void gtk_css_node_add_region (GtkCssNode *cssnode,
|
||||
GQuark region,
|
||||
GtkRegionFlags flags);
|
||||
void gtk_css_node_remove_region (GtkCssNode *cssnode,
|
||||
GQuark region);
|
||||
gboolean gtk_css_node_has_region (GtkCssNode *cssnode,
|
||||
GQuark region,
|
||||
GtkRegionFlags *out_flags);
|
||||
GList * gtk_css_node_list_regions (GtkCssNode *cssnode);
|
||||
|
||||
const GtkCssNodeDeclaration *
|
||||
gtk_css_node_get_declaration (GtkCssNode *cssnode);
|
||||
GtkCssStyle * gtk_css_node_get_style (GtkCssNode *cssnode);
|
||||
|
||||
|
||||
void gtk_css_node_invalidate_style_provider
|
||||
(GtkCssNode *cssnode);
|
||||
void gtk_css_node_invalidate_frame_clock
|
||||
(GtkCssNode *cssnode,
|
||||
gboolean just_timestamp);
|
||||
void gtk_css_node_invalidate (GtkCssNode *cssnode,
|
||||
GtkCssChange change);
|
||||
void gtk_css_node_validate (GtkCssNode *cssnode);
|
||||
|
||||
gboolean gtk_css_node_init_matcher (GtkCssNode *cssnode,
|
||||
GtkCssMatcher *matcher);
|
||||
GtkWidgetPath * gtk_css_node_create_widget_path (GtkCssNode *cssnode);
|
||||
const GtkWidgetPath * gtk_css_node_get_widget_path (GtkCssNode *cssnode);
|
||||
GtkStyleProviderPrivate *gtk_css_node_get_style_provider(GtkCssNode *cssnode);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_NODE_PRIVATE_H__ */
|
||||
@@ -0,0 +1,300 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcssnodeutilsprivate.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "gtkcssnumbervalueprivate.h"
|
||||
#include "gtkcssshadowsvalueprivate.h"
|
||||
#include "gtkcssstyleprivate.h"
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkrenderbackgroundprivate.h"
|
||||
#include "gtkrenderborderprivate.h"
|
||||
|
||||
void
|
||||
gtk_css_node_style_changed_for_widget (GtkCssNode *node,
|
||||
GtkCssStyle *old_style,
|
||||
GtkCssStyle *new_style,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
static GtkBitmask *affects_size = NULL;
|
||||
GtkBitmask *changes;
|
||||
|
||||
changes = gtk_css_style_get_difference (old_style, new_style);
|
||||
|
||||
if (G_UNLIKELY (affects_size == NULL))
|
||||
affects_size = _gtk_css_style_property_get_mask_affecting (GTK_CSS_AFFECTS_SIZE | GTK_CSS_AFFECTS_CLIP);
|
||||
|
||||
if (_gtk_bitmask_intersects (changes, affects_size))
|
||||
gtk_widget_queue_resize (widget);
|
||||
else
|
||||
gtk_widget_queue_draw (widget);
|
||||
|
||||
_gtk_bitmask_free (changes);
|
||||
}
|
||||
|
||||
static gint
|
||||
get_number (GtkCssStyle *style,
|
||||
guint property)
|
||||
{
|
||||
double d = _gtk_css_number_value_get (gtk_css_style_get_value (style, property), 100);
|
||||
|
||||
if (d < 1)
|
||||
return ceil (d);
|
||||
else
|
||||
return floor (d);
|
||||
}
|
||||
|
||||
static void
|
||||
get_box_margin (GtkCssStyle *style,
|
||||
GtkBorder *margin)
|
||||
{
|
||||
margin->top = get_number (style, GTK_CSS_PROPERTY_MARGIN_TOP);
|
||||
margin->left = get_number (style, GTK_CSS_PROPERTY_MARGIN_LEFT);
|
||||
margin->bottom = get_number (style, GTK_CSS_PROPERTY_MARGIN_BOTTOM);
|
||||
margin->right = get_number (style, GTK_CSS_PROPERTY_MARGIN_RIGHT);
|
||||
}
|
||||
|
||||
static void
|
||||
get_box_border (GtkCssStyle *style,
|
||||
GtkBorder *border)
|
||||
{
|
||||
border->top = get_number (style, GTK_CSS_PROPERTY_BORDER_TOP_WIDTH);
|
||||
border->left = get_number (style, GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH);
|
||||
border->bottom = get_number (style, GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH);
|
||||
border->right = get_number (style, GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH);
|
||||
}
|
||||
|
||||
static void
|
||||
get_box_padding (GtkCssStyle *style,
|
||||
GtkBorder *border)
|
||||
{
|
||||
border->top = get_number (style, GTK_CSS_PROPERTY_PADDING_TOP);
|
||||
border->left = get_number (style, GTK_CSS_PROPERTY_PADDING_LEFT);
|
||||
border->bottom = get_number (style, GTK_CSS_PROPERTY_PADDING_BOTTOM);
|
||||
border->right = get_number (style, GTK_CSS_PROPERTY_PADDING_RIGHT);
|
||||
}
|
||||
|
||||
static void
|
||||
get_content_size_func_default (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
gpointer unused)
|
||||
{
|
||||
*minimum = 0;
|
||||
*natural = 0;
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = 0;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = 0;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_node_get_preferred_size (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
GtkCssNodeSizeFunc get_content_size_func,
|
||||
gpointer get_content_size_data)
|
||||
{
|
||||
GtkCssStyle *style;
|
||||
GtkBorder margin, border, padding;
|
||||
int min_size, extra_size, extra_opposite, extra_baseline;
|
||||
|
||||
if (!get_content_size_func)
|
||||
get_content_size_func = get_content_size_func_default;
|
||||
style = gtk_css_node_get_style (cssnode);
|
||||
get_box_margin (style, &margin);
|
||||
get_box_border (style, &border);
|
||||
get_box_padding (style, &padding);
|
||||
if (orientation == GTK_ORIENTATION_HORIZONTAL)
|
||||
{
|
||||
extra_size = margin.left + margin.right + border.left + border.right + padding.left + padding.right;
|
||||
extra_opposite = margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
|
||||
extra_baseline = margin.left + border.left + padding.left;
|
||||
min_size = get_number (style, GTK_CSS_PROPERTY_MIN_WIDTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
extra_size = margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
|
||||
extra_opposite = margin.left + margin.right + border.left + border.right + padding.left + padding.right;
|
||||
extra_baseline = margin.top + border.top + padding.top;
|
||||
min_size = get_number (style, GTK_CSS_PROPERTY_MIN_HEIGHT);
|
||||
}
|
||||
|
||||
if (for_size > -1)
|
||||
for_size -= extra_opposite;
|
||||
|
||||
if (minimum_baseline)
|
||||
*minimum_baseline = -1;
|
||||
if (natural_baseline)
|
||||
*natural_baseline = -1;
|
||||
|
||||
get_content_size_func (cssnode,
|
||||
orientation,
|
||||
for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline,
|
||||
get_content_size_data);
|
||||
|
||||
g_warn_if_fail (*minimum <= *natural);
|
||||
|
||||
*minimum = MAX (min_size, *minimum);
|
||||
*natural = MAX (min_size, *natural);
|
||||
|
||||
*minimum += extra_size;
|
||||
*natural += extra_size;
|
||||
|
||||
if (minimum_baseline && *minimum_baseline > -1)
|
||||
*minimum_baseline += extra_baseline;
|
||||
if (natural_baseline && *natural_baseline > -1)
|
||||
*natural_baseline += extra_baseline;
|
||||
}
|
||||
|
||||
static void
|
||||
allocate_func_default (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer unused)
|
||||
{
|
||||
*out_clip = *allocation;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_node_allocate (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
GtkCssNodeAllocateFunc allocate_func,
|
||||
gpointer allocate_data)
|
||||
{
|
||||
GtkAllocation content_allocation, clip;
|
||||
GtkBorder margin, border, padding, shadow, extents;
|
||||
GtkCssStyle *style;
|
||||
|
||||
if (out_clip == NULL)
|
||||
out_clip = &clip;
|
||||
if (!allocate_func)
|
||||
allocate_func = allocate_func_default;
|
||||
style = gtk_css_node_get_style (cssnode);
|
||||
get_box_margin (style, &margin);
|
||||
get_box_border (style, &border);
|
||||
get_box_padding (style, &padding);
|
||||
extents.top = margin.top + border.top + padding.top;
|
||||
extents.right = margin.right + border.right + padding.right;
|
||||
extents.bottom = margin.bottom + border.bottom + padding.bottom;
|
||||
extents.left = margin.left + border.left + padding.left;
|
||||
|
||||
content_allocation.x = allocation->x + extents.left;
|
||||
content_allocation.y = allocation->y + extents.top;
|
||||
content_allocation.width = allocation->width - extents.left - extents.right;
|
||||
content_allocation.height = allocation->height - extents.top - extents.bottom;
|
||||
if (baseline >= 0)
|
||||
baseline += extents.top;
|
||||
|
||||
g_assert (content_allocation.width >= 0);
|
||||
g_assert (content_allocation.height >= 0);
|
||||
|
||||
allocate_func (cssnode, &content_allocation, baseline, out_clip, allocate_data);
|
||||
|
||||
_gtk_css_shadows_value_get_extents (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BOX_SHADOW), &shadow);
|
||||
out_clip->x -= extents.left + shadow.left - margin.left;
|
||||
out_clip->y -= extents.top + shadow.top - margin.top;
|
||||
out_clip->width += extents.left + extents.right + shadow.left + shadow.right - margin.left - margin.right;
|
||||
out_clip->height += extents.top + extents.bottom + shadow.top + shadow.bottom - margin.top - margin.bottom;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
draw_contents_func_default (GtkCssNode *cssnode,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer unused)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_node_draw (GtkCssNode *cssnode,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
GtkCssNodeDrawFunc draw_contents_func,
|
||||
gpointer draw_contents_data)
|
||||
{
|
||||
GtkBorder margin, border, padding;
|
||||
gboolean draw_focus;
|
||||
GtkCssStyle *style;
|
||||
int contents_width, contents_height;
|
||||
|
||||
if (draw_contents_func == NULL)
|
||||
draw_contents_func = draw_contents_func_default;
|
||||
style = gtk_css_node_get_style (cssnode);
|
||||
get_box_margin (style, &margin);
|
||||
get_box_border (style, &border);
|
||||
get_box_padding (style, &padding);
|
||||
|
||||
gtk_css_style_render_background (style,
|
||||
cr,
|
||||
margin.left,
|
||||
margin.top,
|
||||
width - margin.left - margin.right,
|
||||
height - margin.top - margin.bottom,
|
||||
gtk_css_node_get_junction_sides (cssnode));
|
||||
gtk_css_style_render_border (style,
|
||||
cr,
|
||||
margin.left,
|
||||
margin.top,
|
||||
width - margin.left - margin.right,
|
||||
height - margin.top - margin.bottom,
|
||||
0,
|
||||
gtk_css_node_get_junction_sides (cssnode));
|
||||
|
||||
cairo_translate (cr,
|
||||
margin.left + border.left + padding.left,
|
||||
margin.top + border.top + padding.top);
|
||||
contents_width = width - margin.left - margin.right - border.left - border.right - padding.left - padding.right;
|
||||
contents_height = height - margin.top - margin.bottom - border.top - border.bottom - padding.top - padding.bottom;
|
||||
|
||||
draw_focus = draw_contents_func (cssnode, cr, contents_width, contents_height, draw_contents_data);
|
||||
|
||||
cairo_translate (cr,
|
||||
- (margin.left + border.left + padding.left),
|
||||
- (margin.top + border.top + padding.top));
|
||||
|
||||
if (draw_focus)
|
||||
gtk_css_style_render_outline (style,
|
||||
cr,
|
||||
margin.left,
|
||||
margin.top,
|
||||
width - margin.left - margin.right,
|
||||
height - margin.top - margin.bottom);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_CSS_NODE_UTILS_PRIVATE_H__
|
||||
#define __GTK_CSS_NODE_UTILS_PRIVATE_H__
|
||||
|
||||
#include <gtk/gtkwidget.h>
|
||||
#include "gtk/gtkcssnodeprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void gtk_css_node_style_changed_for_widget (GtkCssNode *node,
|
||||
GtkCssStyle *old_style,
|
||||
GtkCssStyle *new_style,
|
||||
GtkWidget *widget);
|
||||
|
||||
typedef void (* GtkCssNodeSizeFunc) (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
gpointer get_content_size_data);
|
||||
void gtk_css_node_get_preferred_size (GtkCssNode *cssnode,
|
||||
GtkOrientation orientation,
|
||||
gint for_size,
|
||||
gint *minimum,
|
||||
gint *natural,
|
||||
gint *minimum_baseline,
|
||||
gint *natural_baseline,
|
||||
GtkCssNodeSizeFunc get_content_size_func,
|
||||
gpointer get_content_size_data);
|
||||
|
||||
typedef void (* GtkCssNodeAllocateFunc) (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
gpointer allocate_data);
|
||||
void gtk_css_node_allocate (GtkCssNode *cssnode,
|
||||
const GtkAllocation *allocation,
|
||||
int baseline,
|
||||
GtkAllocation *out_clip,
|
||||
GtkCssNodeAllocateFunc allocate_func,
|
||||
gpointer allocate_data);
|
||||
|
||||
typedef gboolean (* GtkCssNodeDrawFunc) (GtkCssNode *cssnode,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer data);
|
||||
void gtk_css_node_draw (GtkCssNode *cssnode,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
GtkCssNodeDrawFunc draw_contents_func,
|
||||
gpointer draw_contents_data);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_NODE_UTILS_PRIVATE_H__ */
|
||||
@@ -39,19 +39,16 @@ static double
|
||||
get_base_font_size (guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
|
||||
{
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
|
||||
if (parent_style)
|
||||
return _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
else
|
||||
return _gtk_css_font_size_get_default (provider);
|
||||
}
|
||||
|
||||
*dependencies = GTK_CSS_DEPENDS_ON_FONT_SIZE;
|
||||
return _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
|
||||
}
|
||||
|
||||
@@ -60,8 +57,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkBorderStyle border_style;
|
||||
|
||||
@@ -106,7 +102,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
/* percentages for font sizes are computed, other percentages aren't */
|
||||
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
|
||||
return _gtk_css_number_value_new (number->value / 100.0 *
|
||||
get_base_font_size (property_id, provider, style, parent_style, dependencies),
|
||||
get_base_font_size (property_id, provider, style, parent_style),
|
||||
GTK_CSS_PX);
|
||||
case GTK_CSS_NUMBER:
|
||||
case GTK_CSS_PX:
|
||||
@@ -134,13 +130,13 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
break;
|
||||
case GTK_CSS_EM:
|
||||
return _gtk_css_number_value_new (number->value *
|
||||
get_base_font_size (property_id, provider, style, parent_style, dependencies),
|
||||
get_base_font_size (property_id, provider, style, parent_style),
|
||||
GTK_CSS_PX);
|
||||
break;
|
||||
case GTK_CSS_EX:
|
||||
/* for now we pretend ex is half of em */
|
||||
return _gtk_css_number_value_new (number->value * 0.5 *
|
||||
get_base_font_size (property_id, provider, style, parent_style, dependencies),
|
||||
get_base_font_size (property_id, provider, style, parent_style),
|
||||
GTK_CSS_PX);
|
||||
case GTK_CSS_RAD:
|
||||
return _gtk_css_number_value_new (number->value * 360.0 / (2 * G_PI),
|
||||
|
||||
@@ -0,0 +1,197 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcsspathnodeprivate.h"
|
||||
#include "gtkcssstylepropertyprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
#include "gtkstylecontextprivate.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkCssPathNode, gtk_css_path_node, GTK_TYPE_CSS_NODE)
|
||||
|
||||
static void
|
||||
gtk_css_path_node_finalize (GObject *object)
|
||||
{
|
||||
GtkCssPathNode *node = GTK_CSS_PATH_NODE (object);
|
||||
|
||||
if (node->path)
|
||||
gtk_widget_path_unref (node->path);
|
||||
|
||||
G_OBJECT_CLASS (gtk_css_path_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_path_node_invalidate (GtkCssNode *node)
|
||||
{
|
||||
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
|
||||
|
||||
if (path_node->context)
|
||||
{
|
||||
GtkBitmask *changes;
|
||||
|
||||
changes = _gtk_bitmask_new ();
|
||||
changes = _gtk_bitmask_invert_range (changes,
|
||||
0,
|
||||
_gtk_css_style_property_get_n_properties ());
|
||||
|
||||
gtk_style_context_validate (path_node->context, changes);
|
||||
|
||||
_gtk_bitmask_free (changes);
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_path_node_real_init_matcher (GtkCssNode *node,
|
||||
GtkCssMatcher *matcher)
|
||||
{
|
||||
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
|
||||
|
||||
if (path_node->path == NULL ||
|
||||
gtk_widget_path_length (path_node->path) == 0)
|
||||
return FALSE;
|
||||
|
||||
return _gtk_css_matcher_init (matcher,
|
||||
path_node->path,
|
||||
gtk_css_node_get_declaration (node));
|
||||
}
|
||||
|
||||
static GtkWidgetPath *
|
||||
gtk_css_path_node_real_create_widget_path (GtkCssNode *node)
|
||||
{
|
||||
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
|
||||
GtkWidgetPath *path;
|
||||
guint length;
|
||||
|
||||
if (path_node->path == NULL)
|
||||
path = gtk_widget_path_new ();
|
||||
else
|
||||
path = gtk_widget_path_copy (path_node->path);
|
||||
|
||||
length = gtk_widget_path_length (path);
|
||||
if (length > 0)
|
||||
{
|
||||
gtk_css_node_declaration_add_to_widget_path (gtk_css_node_get_declaration (node),
|
||||
path,
|
||||
length - 1);
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
static const GtkWidgetPath *
|
||||
gtk_css_path_node_real_get_widget_path (GtkCssNode *node)
|
||||
{
|
||||
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
|
||||
|
||||
return path_node->path;
|
||||
}
|
||||
|
||||
static GtkCssStyle *
|
||||
gtk_css_path_node_update_style (GtkCssNode *cssnode,
|
||||
GtkCssChange change,
|
||||
gint64 timestamp,
|
||||
GtkCssStyle *style)
|
||||
{
|
||||
/* This should get rid of animations */
|
||||
return GTK_CSS_NODE_CLASS (gtk_css_path_node_parent_class)->update_style (cssnode, change, 0, style);
|
||||
}
|
||||
|
||||
static GtkStyleProviderPrivate *
|
||||
gtk_css_path_node_get_style_provider (GtkCssNode *node)
|
||||
{
|
||||
GtkCssPathNode *path_node = GTK_CSS_PATH_NODE (node);
|
||||
|
||||
if (path_node->context == NULL)
|
||||
return NULL;
|
||||
|
||||
return gtk_style_context_get_style_provider (path_node->context);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_path_node_class_init (GtkCssPathNodeClass *klass)
|
||||
{
|
||||
GtkCssNodeClass *node_class = GTK_CSS_NODE_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->finalize = gtk_css_path_node_finalize;
|
||||
|
||||
node_class->invalidate = gtk_css_path_node_invalidate;
|
||||
node_class->update_style = gtk_css_path_node_update_style;
|
||||
node_class->init_matcher = gtk_css_path_node_real_init_matcher;
|
||||
node_class->create_widget_path = gtk_css_path_node_real_create_widget_path;
|
||||
node_class->get_widget_path = gtk_css_path_node_real_get_widget_path;
|
||||
node_class->get_style_provider = gtk_css_path_node_get_style_provider;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_path_node_init (GtkCssPathNode *cssnode)
|
||||
{
|
||||
}
|
||||
|
||||
GtkCssNode *
|
||||
gtk_css_path_node_new (GtkStyleContext *context)
|
||||
{
|
||||
GtkCssPathNode *node;
|
||||
|
||||
g_return_val_if_fail (context == NULL || GTK_IS_STYLE_CONTEXT (context), NULL);
|
||||
|
||||
node = g_object_new (GTK_TYPE_CSS_PATH_NODE, NULL);
|
||||
node->context = context;
|
||||
|
||||
return GTK_CSS_NODE (node);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_path_node_unset_context (GtkCssPathNode *node)
|
||||
{
|
||||
gtk_internal_return_if_fail (GTK_IS_CSS_PATH_NODE (node));
|
||||
gtk_internal_return_if_fail (node->context != NULL);
|
||||
|
||||
node->context = NULL;
|
||||
|
||||
gtk_css_node_invalidate_style_provider (GTK_CSS_NODE (node));
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_path_node_set_widget_path (GtkCssPathNode *node,
|
||||
GtkWidgetPath *path)
|
||||
{
|
||||
gtk_internal_return_if_fail (GTK_IS_CSS_PATH_NODE (node));
|
||||
|
||||
if (node->path == path)
|
||||
return;
|
||||
|
||||
if (node->path)
|
||||
gtk_widget_path_unref (node->path);
|
||||
|
||||
if (path)
|
||||
gtk_widget_path_ref (path);
|
||||
|
||||
node->path = path;
|
||||
|
||||
gtk_css_node_invalidate (GTK_CSS_NODE (node), GTK_CSS_CHANGE_ANY);
|
||||
}
|
||||
|
||||
GtkWidgetPath *
|
||||
gtk_css_path_node_get_widget_path (GtkCssPathNode *node)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_PATH_NODE (node), NULL);
|
||||
|
||||
return node->path;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_CSS_PATH_NODE_PRIVATE_H__
|
||||
#define __GTK_CSS_PATH_NODE_PRIVATE_H__
|
||||
|
||||
#include "gtkcssnodeprivate.h"
|
||||
#include "gtkwidgetpath.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CSS_PATH_NODE (gtk_css_path_node_get_type ())
|
||||
#define GTK_CSS_PATH_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_CSS_PATH_NODE, GtkCssPathNode))
|
||||
#define GTK_CSS_PATH_NODE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_CSS_PATH_NODE, GtkCssPathNodeClass))
|
||||
#define GTK_IS_CSS_PATH_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_CSS_PATH_NODE))
|
||||
#define GTK_IS_CSS_PATH_NODE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_CSS_PATH_NODE))
|
||||
#define GTK_CSS_PATH_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CSS_PATH_NODE, GtkCssPathNodeClass))
|
||||
|
||||
typedef struct _GtkCssPathNode GtkCssPathNode;
|
||||
typedef struct _GtkCssPathNodeClass GtkCssPathNodeClass;
|
||||
|
||||
struct _GtkCssPathNode
|
||||
{
|
||||
GtkCssNode node;
|
||||
|
||||
GtkStyleContext *context;
|
||||
GtkWidgetPath *path;
|
||||
};
|
||||
|
||||
struct _GtkCssPathNodeClass
|
||||
{
|
||||
GtkCssNodeClass node_class;
|
||||
};
|
||||
|
||||
GType gtk_css_path_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkCssNode * gtk_css_path_node_new (GtkStyleContext *context);
|
||||
|
||||
void gtk_css_path_node_unset_context (GtkCssPathNode *node);
|
||||
|
||||
void gtk_css_path_node_set_widget_path (GtkCssPathNode *node,
|
||||
GtkWidgetPath *path);
|
||||
GtkWidgetPath * gtk_css_path_node_get_widget_path (GtkCssPathNode *node);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_PATH_NODE_PRIVATE_H__ */
|
||||
@@ -41,15 +41,12 @@ gtk_css_value_position_compute (GtkCssValue *position,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *x, *y;
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
x = _gtk_css_value_compute (position->x, property_id, provider, style, parent_style, &x_deps);
|
||||
y = _gtk_css_value_compute (position->y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
x = _gtk_css_value_compute (position->x, property_id, provider, style, parent_style);
|
||||
y = _gtk_css_value_compute (position->y, property_id, provider, style, parent_style);
|
||||
if (x == position->x && y == position->y)
|
||||
{
|
||||
_gtk_css_value_unref (x);
|
||||
|
||||
@@ -1695,7 +1695,7 @@ gtk_css_provider_get_style_property (GtkStyleProvider *provider,
|
||||
gtk_widget_path_iter_set_state (path, -1, state);
|
||||
}
|
||||
|
||||
if (!_gtk_css_matcher_init (&matcher, path))
|
||||
if (!_gtk_css_matcher_init (&matcher, path, NULL))
|
||||
{
|
||||
gtk_widget_path_unref (path);
|
||||
return FALSE;
|
||||
|
||||
@@ -38,8 +38,7 @@ gtk_css_value_repeat_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,7 @@ gtk_css_value_rgba_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
@@ -55,11 +55,9 @@ gtk_css_value_shadows_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *result;
|
||||
GtkCssDependencies child_deps;
|
||||
guint i;
|
||||
|
||||
if (value->len == 0)
|
||||
@@ -68,8 +66,7 @@ gtk_css_value_shadows_compute (GtkCssValue *value,
|
||||
result = gtk_css_shadows_value_new (value->values, value->len);
|
||||
for (i = 0; i < value->len; i++)
|
||||
{
|
||||
result->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
result->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
+6
-22
@@ -67,31 +67,15 @@ gtk_css_value_shadow_compute (GtkCssValue *shadow,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssValue *hoffset, *voffset, *radius, *spread, *color;
|
||||
GtkCssDependencies child_deps;
|
||||
|
||||
child_deps = 0;
|
||||
hoffset = _gtk_css_value_compute (shadow->hoffset, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
|
||||
child_deps = 0;
|
||||
voffset = _gtk_css_value_compute (shadow->voffset, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
|
||||
child_deps = 0;
|
||||
radius = _gtk_css_value_compute (shadow->radius, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
|
||||
child_deps = 0;
|
||||
spread = _gtk_css_value_compute (shadow->spread, property_id, provider, style, parent_style, &child_deps),
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
|
||||
child_deps = 0;
|
||||
color = _gtk_css_value_compute (shadow->color, property_id, provider, style, parent_style, &child_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
|
||||
hoffset = _gtk_css_value_compute (shadow->hoffset, property_id, provider, style, parent_style);
|
||||
voffset = _gtk_css_value_compute (shadow->voffset, property_id, provider, style, parent_style);
|
||||
radius = _gtk_css_value_compute (shadow->radius, property_id, provider, style, parent_style);
|
||||
spread = _gtk_css_value_compute (shadow->spread, property_id, provider, style, parent_style),
|
||||
color = _gtk_css_value_compute (shadow->color, property_id, provider, style, parent_style);
|
||||
|
||||
return gtk_css_shadow_value_new (hoffset, voffset, radius, spread, shadow->inset, color);
|
||||
}
|
||||
|
||||
+1
-116
@@ -66,28 +66,6 @@ gtk_css_static_style_get_section (GtkCssStyle *style,
|
||||
return g_ptr_array_index (sstyle->sections, id);
|
||||
}
|
||||
|
||||
/* Compute the bitmask of potentially changed properties if the parent has changed
|
||||
* the passed in ones.
|
||||
* This is for example needed when changes in the "color" property will affect
|
||||
* all properties using "currentColor" as a color.
|
||||
*/
|
||||
static GtkBitmask *
|
||||
gtk_css_static_style_compute_dependencies (GtkCssStaticStyle *style,
|
||||
const GtkBitmask *parent_changes)
|
||||
{
|
||||
GtkCssStaticStyle *sstyle = GTK_CSS_STATIC_STYLE (style);
|
||||
GtkBitmask *changes;
|
||||
|
||||
changes = _gtk_bitmask_copy (parent_changes);
|
||||
changes = _gtk_bitmask_intersect (changes, sstyle->depends_on_parent);
|
||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_COLOR))
|
||||
changes = _gtk_bitmask_union (changes, sstyle->depends_on_color);
|
||||
if (_gtk_bitmask_get (changes, GTK_CSS_PROPERTY_FONT_SIZE))
|
||||
changes = _gtk_bitmask_union (changes, sstyle->depends_on_font_size);
|
||||
|
||||
return changes;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_static_style_dispose (GObject *object)
|
||||
{
|
||||
@@ -107,19 +85,6 @@ gtk_css_static_style_dispose (GObject *object)
|
||||
G_OBJECT_CLASS (gtk_css_static_style_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_static_style_finalize (GObject *object)
|
||||
{
|
||||
GtkCssStaticStyle *style = GTK_CSS_STATIC_STYLE (object);
|
||||
|
||||
_gtk_bitmask_free (style->depends_on_parent);
|
||||
_gtk_bitmask_free (style->equals_parent);
|
||||
_gtk_bitmask_free (style->depends_on_color);
|
||||
_gtk_bitmask_free (style->depends_on_font_size);
|
||||
|
||||
G_OBJECT_CLASS (gtk_css_static_style_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_static_style_class_init (GtkCssStaticStyleClass *klass)
|
||||
{
|
||||
@@ -127,7 +92,6 @@ gtk_css_static_style_class_init (GtkCssStaticStyleClass *klass)
|
||||
GtkCssStyleClass *style_class = GTK_CSS_STYLE_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_css_static_style_dispose;
|
||||
object_class->finalize = gtk_css_static_style_finalize;
|
||||
|
||||
style_class->get_value = gtk_css_static_style_get_value;
|
||||
style_class->get_section = gtk_css_static_style_get_section;
|
||||
@@ -136,10 +100,6 @@ gtk_css_static_style_class_init (GtkCssStaticStyleClass *klass)
|
||||
static void
|
||||
gtk_css_static_style_init (GtkCssStaticStyle *style)
|
||||
{
|
||||
style->depends_on_parent = _gtk_bitmask_new ();
|
||||
style->equals_parent = _gtk_bitmask_new ();
|
||||
style->depends_on_color = _gtk_bitmask_new ();
|
||||
style->depends_on_font_size = _gtk_bitmask_new ();
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -235,71 +195,6 @@ gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
|
||||
return GTK_CSS_STYLE (result);
|
||||
}
|
||||
|
||||
GtkCssStyle *
|
||||
gtk_css_static_style_new_update (GtkCssStaticStyle *style,
|
||||
const GtkBitmask *parent_changes,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
const GtkCssMatcher *matcher,
|
||||
GtkCssStyle *parent)
|
||||
{
|
||||
GtkCssStaticStyle *result;
|
||||
GtkCssLookup *lookup;
|
||||
GtkBitmask *changes;
|
||||
guint i;
|
||||
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STATIC_STYLE (style), NULL);
|
||||
gtk_internal_return_val_if_fail (parent_changes != NULL, NULL);
|
||||
gtk_internal_return_val_if_fail (GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
|
||||
gtk_internal_return_val_if_fail (matcher != NULL, NULL);
|
||||
|
||||
changes = gtk_css_static_style_compute_dependencies (style, parent_changes);
|
||||
if (_gtk_bitmask_is_empty (changes))
|
||||
{
|
||||
_gtk_bitmask_free (changes);
|
||||
return g_object_ref (style);
|
||||
}
|
||||
|
||||
result = g_object_new (GTK_TYPE_CSS_STATIC_STYLE, NULL);
|
||||
|
||||
result->change = style->change;
|
||||
result->depends_on_parent = _gtk_bitmask_subtract (_gtk_bitmask_union (result->depends_on_parent, style->depends_on_parent),
|
||||
changes);
|
||||
result->equals_parent = _gtk_bitmask_subtract (_gtk_bitmask_union (result->equals_parent, style->equals_parent),
|
||||
changes);
|
||||
result->depends_on_color = _gtk_bitmask_subtract (_gtk_bitmask_union (result->depends_on_color, style->depends_on_color),
|
||||
changes);
|
||||
result->depends_on_font_size = _gtk_bitmask_subtract (_gtk_bitmask_union (result->depends_on_font_size, style->depends_on_font_size),
|
||||
changes);
|
||||
|
||||
for (i = 0; i < style->values->len; i++)
|
||||
{
|
||||
if (_gtk_bitmask_get (changes, i))
|
||||
continue;
|
||||
|
||||
gtk_css_static_style_set_value (result,
|
||||
i,
|
||||
gtk_css_static_style_get_value (GTK_CSS_STYLE (style), i),
|
||||
gtk_css_static_style_get_section (GTK_CSS_STYLE (style), i));
|
||||
}
|
||||
|
||||
lookup = _gtk_css_lookup_new (changes);
|
||||
|
||||
_gtk_style_provider_private_lookup (provider,
|
||||
matcher,
|
||||
lookup,
|
||||
NULL);
|
||||
|
||||
_gtk_css_lookup_resolve (lookup,
|
||||
provider,
|
||||
result,
|
||||
parent);
|
||||
|
||||
_gtk_css_lookup_free (lookup);
|
||||
_gtk_bitmask_free (changes);
|
||||
|
||||
return GTK_CSS_STYLE (result);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
@@ -308,7 +203,6 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
GtkCssValue *specified,
|
||||
GtkCssSection *section)
|
||||
{
|
||||
GtkCssDependencies dependencies;
|
||||
GtkCssValue *value;
|
||||
|
||||
gtk_internal_return_if_fail (GTK_IS_CSS_STATIC_STYLE (style));
|
||||
@@ -332,19 +226,10 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
else
|
||||
_gtk_css_value_ref (specified);
|
||||
|
||||
value = _gtk_css_value_compute (specified, id, provider, GTK_CSS_STYLE (style), parent_style, &dependencies);
|
||||
value = _gtk_css_value_compute (specified, id, provider, GTK_CSS_STYLE (style), parent_style);
|
||||
|
||||
gtk_css_static_style_set_value (style, id, value, section);
|
||||
|
||||
if (dependencies & (GTK_CSS_DEPENDS_ON_PARENT | GTK_CSS_EQUALS_PARENT))
|
||||
style->depends_on_parent = _gtk_bitmask_set (style->depends_on_parent, id, TRUE);
|
||||
if (dependencies & (GTK_CSS_EQUALS_PARENT))
|
||||
style->equals_parent = _gtk_bitmask_set (style->equals_parent, id, TRUE);
|
||||
if (dependencies & (GTK_CSS_DEPENDS_ON_COLOR))
|
||||
style->depends_on_color = _gtk_bitmask_set (style->depends_on_color, id, TRUE);
|
||||
if (dependencies & (GTK_CSS_DEPENDS_ON_FONT_SIZE))
|
||||
style->depends_on_font_size = _gtk_bitmask_set (style->depends_on_font_size, id, TRUE);
|
||||
|
||||
_gtk_css_value_unref (value);
|
||||
_gtk_css_value_unref (specified);
|
||||
}
|
||||
|
||||
@@ -42,11 +42,6 @@ struct _GtkCssStaticStyle
|
||||
GPtrArray *values; /* the values */
|
||||
GPtrArray *sections; /* sections the values are defined in */
|
||||
|
||||
GtkBitmask *depends_on_parent; /* values that depend on parent values */
|
||||
GtkBitmask *equals_parent; /* values that equal their parent values */
|
||||
GtkBitmask *depends_on_color; /* values that depend on the color property */
|
||||
GtkBitmask *depends_on_font_size; /* values that depend on the font-size property */
|
||||
|
||||
GtkCssChange change; /* change as returned by value lookup */
|
||||
};
|
||||
|
||||
@@ -61,11 +56,6 @@ GtkCssStyle * gtk_css_static_style_get_default (void);
|
||||
GtkCssStyle * gtk_css_static_style_new_compute (GtkStyleProviderPrivate *provider,
|
||||
const GtkCssMatcher *matcher,
|
||||
GtkCssStyle *parent);
|
||||
GtkCssStyle * gtk_css_static_style_new_update (GtkCssStaticStyle *style,
|
||||
const GtkBitmask *parent_changes,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
const GtkCssMatcher *matcher,
|
||||
GtkCssStyle *parent);
|
||||
|
||||
void gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
|
||||
GtkStyleProviderPrivate*provider,
|
||||
|
||||
@@ -38,8 +38,7 @@ gtk_css_value_string_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
return _gtk_css_value_ref (value);
|
||||
}
|
||||
|
||||
@@ -46,10 +46,17 @@ gtk_css_style_real_get_section (GtkCssStyle *style,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_css_style_real_is_static (GtkCssStyle *style)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_style_class_init (GtkCssStyleClass *klass)
|
||||
{
|
||||
klass->get_section = gtk_css_style_real_get_section;
|
||||
klass->is_static = gtk_css_style_real_is_static;
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -82,6 +89,9 @@ gtk_css_style_get_difference (GtkCssStyle *style,
|
||||
GtkBitmask *result;
|
||||
guint i, len;
|
||||
|
||||
if (style == other)
|
||||
return _gtk_bitmask_new ();
|
||||
|
||||
result = _gtk_bitmask_new ();
|
||||
len = _gtk_css_style_property_get_n_properties ();
|
||||
for (i = 0; i < len; i++)
|
||||
@@ -94,6 +104,15 @@ gtk_css_style_get_difference (GtkCssStyle *style,
|
||||
return result;
|
||||
}
|
||||
|
||||
gboolean
|
||||
gtk_css_style_is_static (GtkCssStyle *style)
|
||||
{
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_STYLE (style), TRUE);
|
||||
|
||||
return GTK_CSS_STYLE_GET_CLASS (style)->is_static (style);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
gtk_css_style_print (GtkCssStyle *style,
|
||||
GString *string)
|
||||
|
||||
+7
-19
@@ -58,8 +58,7 @@ typedef void (* GtkStylePrintFunc) (const GValue
|
||||
typedef GtkCssValue * (* GtkStyleComputeFunc) (GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssValue *specified);
|
||||
|
||||
static void
|
||||
register_conversion_function (GType type,
|
||||
@@ -185,8 +184,7 @@ static GtkCssValue *
|
||||
rgba_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
GdkRGBA white = { 1, 1, 1, 1 };
|
||||
const GValue *value;
|
||||
@@ -205,8 +203,6 @@ rgba_value_compute (GtkStyleProviderPrivate *provider,
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (symbolic),
|
||||
provider,
|
||||
gtk_css_style_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies,
|
||||
NULL);
|
||||
if (val != NULL)
|
||||
{
|
||||
@@ -284,8 +280,7 @@ static GtkCssValue *
|
||||
color_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
GdkColor color = { 0, 65535, 65535, 65535 };
|
||||
const GValue *value;
|
||||
@@ -302,8 +297,6 @@ color_value_compute (GtkStyleProviderPrivate *provider,
|
||||
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (g_value_get_boxed (value)),
|
||||
provider,
|
||||
gtk_css_style_get_value (values, GTK_CSS_PROPERTY_COLOR),
|
||||
GTK_CSS_DEPENDS_ON_COLOR,
|
||||
dependencies,
|
||||
NULL);
|
||||
if (val != NULL)
|
||||
{
|
||||
@@ -849,8 +842,7 @@ static GtkCssValue *
|
||||
pattern_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *values,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
const GValue *value = _gtk_css_typed_value_get (specified);
|
||||
|
||||
@@ -861,7 +853,7 @@ pattern_value_compute (GtkStyleProviderPrivate *provider,
|
||||
GValue new_value = G_VALUE_INIT;
|
||||
cairo_pattern_t *gradient;
|
||||
|
||||
gradient = _gtk_gradient_resolve_full (g_value_get_boxed (value), provider, values, parent_values, dependencies);
|
||||
gradient = _gtk_gradient_resolve_full (g_value_get_boxed (value), provider, values, parent_values);
|
||||
|
||||
g_value_init (&new_value, CAIRO_GOBJECT_TYPE_PATTERN);
|
||||
g_value_take_boxed (&new_value, gradient);
|
||||
@@ -1142,8 +1134,6 @@ _gtk_css_style_funcs_print_value (const GValue *value,
|
||||
* @parent_values: Values to look up inherited values from
|
||||
* @target_type: Type the resulting value should have
|
||||
* @specified: the value to use for the computation
|
||||
* @dependencies: (out): Value initialized with 0 to take the dependencies
|
||||
* of the returned value
|
||||
*
|
||||
* Converts the @specified value into the @computed value using the
|
||||
* information in @context. The values must have matching types, ie
|
||||
@@ -1157,15 +1147,13 @@ _gtk_css_style_funcs_compute_value (GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GType target_type,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssValue *specified)
|
||||
{
|
||||
GtkStyleComputeFunc func;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
|
||||
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
|
||||
g_return_val_if_fail (*dependencies == 0, NULL);
|
||||
|
||||
gtk_css_style_funcs_init ();
|
||||
|
||||
@@ -1176,7 +1164,7 @@ _gtk_css_style_funcs_compute_value (GtkStyleProviderPrivate *provider,
|
||||
GSIZE_TO_POINTER (g_type_fundamental (target_type)));
|
||||
|
||||
if (func)
|
||||
return func (provider, style, parent_style, specified, dependencies);
|
||||
return func (provider, style, parent_style, specified);
|
||||
else
|
||||
return _gtk_css_value_ref (specified);
|
||||
}
|
||||
|
||||
@@ -32,8 +32,7 @@ GtkCssValue * _gtk_css_style_funcs_compute_value (GtkStyleProviderPriv
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GType target_type,
|
||||
GtkCssValue *specified,
|
||||
GtkCssDependencies *dependencies);
|
||||
GtkCssValue *specified);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -54,6 +54,8 @@ struct _GtkCssStyleClass
|
||||
* Optional: default impl will just return NULL */
|
||||
GtkCssSection * (* get_section) (GtkCssStyle *style,
|
||||
guint id);
|
||||
/* TRUE if this style will require changes based on timestamp */
|
||||
gboolean (* is_static) (GtkCssStyle *style);
|
||||
};
|
||||
|
||||
GType gtk_css_style_get_type (void) G_GNUC_CONST;
|
||||
@@ -64,6 +66,7 @@ GtkCssSection * gtk_css_style_get_section (GtkCssStyle
|
||||
guint id);
|
||||
GtkBitmask * gtk_css_style_get_difference (GtkCssStyle *style,
|
||||
GtkCssStyle *other);
|
||||
gboolean gtk_css_style_is_static (GtkCssStyle *style);
|
||||
|
||||
char * gtk_css_style_to_string (GtkCssStyle *style);
|
||||
void gtk_css_style_print (GtkCssStyle *style,
|
||||
|
||||
@@ -804,6 +804,15 @@ border_image_width_parse (GtkCssStyleProperty *property,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
minmax_parse (GtkCssStyleProperty *property,
|
||||
GtkCssParser *parser)
|
||||
{
|
||||
return _gtk_css_number_value_parse (parser,
|
||||
GTK_CSS_PARSE_LENGTH
|
||||
| GTK_CSS_POSITIVE_ONLY);
|
||||
}
|
||||
|
||||
static GtkCssValue *
|
||||
transition_property_parse_one (GtkCssParser *parser)
|
||||
{
|
||||
@@ -1529,6 +1538,25 @@ _gtk_css_style_property_init_properties (void)
|
||||
NULL,
|
||||
_gtk_css_transform_value_new_none ());
|
||||
|
||||
gtk_css_style_property_register ("min-width",
|
||||
GTK_CSS_PROPERTY_MIN_WIDTH,
|
||||
G_TYPE_NONE,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_SIZE,
|
||||
minmax_parse,
|
||||
NULL,
|
||||
NULL,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
gtk_css_style_property_register ("min-height",
|
||||
GTK_CSS_PROPERTY_MIN_HEIGHT,
|
||||
G_TYPE_NONE,
|
||||
GTK_STYLE_PROPERTY_ANIMATED,
|
||||
GTK_CSS_AFFECTS_SIZE,
|
||||
minmax_parse,
|
||||
NULL,
|
||||
NULL,
|
||||
_gtk_css_number_value_new (0, GTK_CSS_PX));
|
||||
|
||||
gtk_css_style_property_register ("transition-property",
|
||||
GTK_CSS_PROPERTY_TRANSITION_PROPERTY,
|
||||
G_TYPE_NONE,
|
||||
|
||||
+13
-26
@@ -231,12 +231,9 @@ gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
GtkCssTransform *src,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssDependencies x_deps, y_deps;
|
||||
|
||||
dest->type = src->type;
|
||||
|
||||
switch (src->type)
|
||||
@@ -244,34 +241,28 @@ gtk_css_transform_compute (GtkCssTransform *dest,
|
||||
case GTK_CSS_TRANSFORM_MATRIX:
|
||||
return TRUE;
|
||||
case GTK_CSS_TRANSFORM_TRANSLATE:
|
||||
x_deps = y_deps = 0;
|
||||
dest->translate.x = _gtk_css_value_compute (src->translate.x, property_id, provider, style, parent_style, &x_deps);
|
||||
dest->translate.y = _gtk_css_value_compute (src->translate.y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
dest->translate.x = _gtk_css_value_compute (src->translate.x, property_id, provider, style, parent_style);
|
||||
dest->translate.y = _gtk_css_value_compute (src->translate.y, property_id, provider, style, parent_style);
|
||||
return dest->translate.x == src->translate.x
|
||||
&& dest->translate.y == src->translate.y;
|
||||
case GTK_CSS_TRANSFORM_ROTATE:
|
||||
dest->rotate.rotate = _gtk_css_value_compute (src->rotate.rotate, property_id, provider, style, parent_style, dependencies);
|
||||
dest->rotate.rotate = _gtk_css_value_compute (src->rotate.rotate, property_id, provider, style, parent_style);
|
||||
return dest->rotate.rotate == src->rotate.rotate;
|
||||
case GTK_CSS_TRANSFORM_SCALE:
|
||||
x_deps = y_deps = 0;
|
||||
dest->scale.x = _gtk_css_value_compute (src->scale.x, property_id, provider, style, parent_style, &x_deps);
|
||||
dest->scale.y = _gtk_css_value_compute (src->scale.y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
dest->scale.x = _gtk_css_value_compute (src->scale.x, property_id, provider, style, parent_style);
|
||||
dest->scale.y = _gtk_css_value_compute (src->scale.y, property_id, provider, style, parent_style);
|
||||
return dest->scale.x == src->scale.x
|
||||
&& dest->scale.y == src->scale.y;
|
||||
case GTK_CSS_TRANSFORM_SKEW:
|
||||
x_deps = y_deps = 0;
|
||||
dest->skew.x = _gtk_css_value_compute (src->skew.x, property_id, provider, style, parent_style, &x_deps);
|
||||
dest->skew.y = _gtk_css_value_compute (src->skew.y, property_id, provider, style, parent_style, &y_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
|
||||
dest->skew.x = _gtk_css_value_compute (src->skew.x, property_id, provider, style, parent_style);
|
||||
dest->skew.y = _gtk_css_value_compute (src->skew.y, property_id, provider, style, parent_style);
|
||||
return dest->skew.x == src->skew.x
|
||||
&& dest->skew.y == src->skew.y;
|
||||
case GTK_CSS_TRANSFORM_SKEW_X:
|
||||
dest->skew_x.skew = _gtk_css_value_compute (src->skew_x.skew, property_id, provider, style, parent_style, dependencies);
|
||||
dest->skew_x.skew = _gtk_css_value_compute (src->skew_x.skew, property_id, provider, style, parent_style);
|
||||
return dest->skew_x.skew == src->skew_x.skew;
|
||||
case GTK_CSS_TRANSFORM_SKEW_Y:
|
||||
dest->skew_y.skew = _gtk_css_value_compute (src->skew_y.skew, property_id, provider, style, parent_style, dependencies);
|
||||
dest->skew_y.skew = _gtk_css_value_compute (src->skew_y.skew, property_id, provider, style, parent_style);
|
||||
return dest->skew_y.skew == src->skew_y.skew;
|
||||
case GTK_CSS_TRANSFORM_NONE:
|
||||
default:
|
||||
@@ -285,10 +276,8 @@ gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssDependencies transform_deps;
|
||||
GtkCssValue *result;
|
||||
gboolean changes;
|
||||
guint i;
|
||||
@@ -307,9 +296,7 @@ gtk_css_value_transform_compute (GtkCssValue *value,
|
||||
property_id,
|
||||
provider,
|
||||
style,
|
||||
parent_style,
|
||||
&transform_deps);
|
||||
*dependencies = _gtk_css_dependencies_union (*dependencies, transform_deps);
|
||||
parent_style);
|
||||
}
|
||||
|
||||
if (!changes)
|
||||
|
||||
@@ -0,0 +1,94 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkcsstransientnodeprivate.h"
|
||||
#include "gtkprivate.h"
|
||||
|
||||
G_DEFINE_TYPE (GtkCssTransientNode, gtk_css_transient_node, GTK_TYPE_CSS_NODE)
|
||||
|
||||
static GtkWidgetPath *
|
||||
gtk_css_transient_node_create_widget_path (GtkCssNode *node)
|
||||
{
|
||||
GtkWidgetPath *result;
|
||||
GtkCssNode *parent;
|
||||
|
||||
parent = gtk_css_node_get_parent (node);
|
||||
if (parent == NULL)
|
||||
result = gtk_widget_path_new ();
|
||||
else
|
||||
result = gtk_css_node_create_widget_path (parent);
|
||||
|
||||
gtk_widget_path_append_type (result, gtk_css_node_get_widget_type (node));
|
||||
gtk_css_node_declaration_add_to_widget_path (gtk_css_node_get_declaration (node), result, -1);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
static const GtkWidgetPath *
|
||||
gtk_css_transient_node_get_widget_path (GtkCssNode *node)
|
||||
{
|
||||
GtkCssNode *parent;
|
||||
|
||||
parent = gtk_css_node_get_parent (node);
|
||||
if (parent == NULL)
|
||||
return NULL;
|
||||
|
||||
return gtk_css_node_get_widget_path (parent);
|
||||
}
|
||||
|
||||
static GtkCssStyle *
|
||||
gtk_css_transient_node_update_style (GtkCssNode *cssnode,
|
||||
GtkCssChange change,
|
||||
gint64 timestamp,
|
||||
GtkCssStyle *style)
|
||||
{
|
||||
/* This should get rid of animations */
|
||||
return GTK_CSS_NODE_CLASS (gtk_css_transient_node_parent_class)->update_style (cssnode, change, 0, style);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_transient_node_class_init (GtkCssTransientNodeClass *klass)
|
||||
{
|
||||
GtkCssNodeClass *node_class = GTK_CSS_NODE_CLASS (klass);
|
||||
|
||||
node_class->create_widget_path = gtk_css_transient_node_create_widget_path;
|
||||
node_class->get_widget_path = gtk_css_transient_node_get_widget_path;
|
||||
node_class->update_style = gtk_css_transient_node_update_style;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_css_transient_node_init (GtkCssTransientNode *cssnode)
|
||||
{
|
||||
gtk_css_node_set_visible (GTK_CSS_NODE (cssnode), FALSE);
|
||||
}
|
||||
|
||||
GtkCssNode *
|
||||
gtk_css_transient_node_new (GtkCssNode *parent)
|
||||
{
|
||||
GtkCssNode *result;
|
||||
|
||||
gtk_internal_return_val_if_fail (GTK_IS_CSS_NODE (parent), NULL);
|
||||
|
||||
result = g_object_new (GTK_TYPE_CSS_TRANSIENT_NODE, NULL);
|
||||
gtk_css_node_declaration_unref (result->decl);
|
||||
result->decl = gtk_css_node_declaration_ref (parent->decl);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
/* GTK - The GIMP Toolkit
|
||||
* Copyright (C) 2014 Benjamin Otte <otte@gnome.org>
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef __GTK_CSS_TRANSIENT_NODE_PRIVATE_H__
|
||||
#define __GTK_CSS_TRANSIENT_NODE_PRIVATE_H__
|
||||
|
||||
#include "gtkcssnodeprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_CSS_TRANSIENT_NODE (gtk_css_transient_node_get_type ())
|
||||
#define GTK_CSS_TRANSIENT_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST (obj, GTK_TYPE_CSS_TRANSIENT_NODE, GtkCssTransientNode))
|
||||
#define GTK_CSS_TRANSIENT_NODE_CLASS(cls) (G_TYPE_CHECK_CLASS_CAST (cls, GTK_TYPE_CSS_TRANSIENT_NODE, GtkCssTransientNodeClass))
|
||||
#define GTK_IS_CSS_TRANSIENT_NODE(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GTK_TYPE_CSS_TRANSIENT_NODE))
|
||||
#define GTK_IS_CSS_TRANSIENT_NODE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE (obj, GTK_TYPE_CSS_TRANSIENT_NODE))
|
||||
#define GTK_CSS_TRANSIENT_NODE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_CSS_TRANSIENT_NODE, GtkCssTransientNodeClass))
|
||||
|
||||
typedef struct _GtkCssTransientNode GtkCssTransientNode;
|
||||
typedef struct _GtkCssTransientNodeClass GtkCssTransientNodeClass;
|
||||
|
||||
struct _GtkCssTransientNode
|
||||
{
|
||||
GtkCssNode node;
|
||||
};
|
||||
|
||||
struct _GtkCssTransientNodeClass
|
||||
{
|
||||
GtkCssNodeClass node_class;
|
||||
};
|
||||
|
||||
GType gtk_css_transient_node_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GtkCssNode * gtk_css_transient_node_new (GtkCssNode *parent);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GTK_CSS_TRANSIENT_NODE_PRIVATE_H__ */
|
||||
@@ -39,12 +39,11 @@ gtk_css_value_typed_compute (GtkCssValue *value,
|
||||
guint property_id,
|
||||
GtkStyleProviderPrivate *provider,
|
||||
GtkCssStyle *style,
|
||||
GtkCssStyle *parent_style,
|
||||
GtkCssDependencies *dependencies)
|
||||
GtkCssStyle *parent_style)
|
||||
{
|
||||
GtkCssCustomProperty *custom = GTK_CSS_CUSTOM_PROPERTY (_gtk_css_style_property_lookup_by_id (property_id));
|
||||
|
||||
return _gtk_css_style_funcs_compute_value (provider, style, parent_style, custom->pspec->value_type, value, dependencies);
|
||||
return _gtk_css_style_funcs_compute_value (provider, style, parent_style, custom->pspec->value_type, value);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user