Compare commits
466 Commits
drop-defin
...
dropdown-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9dfa663990 | ||
|
|
831b1e1cde | ||
|
|
801a261250 | ||
|
|
93f9b2d519 | ||
|
|
6f3613a06f | ||
|
|
3723778f42 | ||
|
|
3fc3f8d2ff | ||
|
|
2868f1b509 | ||
|
|
f44570e71a | ||
|
|
15d39dddc5 | ||
|
|
1028449bcc | ||
|
|
01cca279f9 | ||
|
|
a7cae4bffa | ||
|
|
3e2e29a1dc | ||
|
|
de069e15c2 | ||
|
|
f8edefd7c0 | ||
|
|
24a15b51fe | ||
|
|
1f7aba345d | ||
|
|
230212c59c | ||
|
|
86f7c19b91 | ||
|
|
e5cea4e39d | ||
|
|
22aca8952f | ||
|
|
c0e437d163 | ||
|
|
ffe97a453f | ||
|
|
c09ba28b06 | ||
|
|
81de43eba5 | ||
|
|
788be8b945 | ||
|
|
0370979225 | ||
|
|
943014074c | ||
|
|
c0e8523a01 | ||
|
|
8374ebe4c4 | ||
|
|
611d14108d | ||
|
|
25cf702345 | ||
|
|
1d9c61cada | ||
|
|
71adb26a0d | ||
|
|
e27fa33690 | ||
|
|
f7dfead861 | ||
|
|
aac04a0995 | ||
|
|
8af191e52d | ||
|
|
06382ff836 | ||
|
|
cd469788c3 | ||
|
|
44b5076cf2 | ||
|
|
e5be9e1035 | ||
|
|
b831d01f0d | ||
|
|
278bcf2680 | ||
|
|
c19d0dc9ea | ||
|
|
edd5ed169e | ||
|
|
8ec9c3fdc6 | ||
|
|
e95022040f | ||
|
|
3a2ce620e2 | ||
|
|
df49bf9eec | ||
|
|
53327f3aea | ||
|
|
c0c3d75062 | ||
|
|
d0d0409f9d | ||
|
|
3a7d094542 | ||
|
|
280adcbb8c | ||
|
|
83431a999c | ||
|
|
eeeee99aa8 | ||
|
|
0f503e0ba2 | ||
|
|
3e4ae62b44 | ||
|
|
ec4f814bd4 | ||
|
|
0141ba4e00 | ||
|
|
52ef16c21b | ||
|
|
6ca7104015 | ||
|
|
07d6166ab8 | ||
|
|
dc651c3dc3 | ||
|
|
f520801626 | ||
|
|
4e3fbd0b0f | ||
|
|
8a24fdea38 | ||
|
|
b26222b6ba | ||
|
|
c8d291ab86 | ||
|
|
0a87438432 | ||
|
|
ddf1cd6678 | ||
|
|
9c6d5e2ca5 | ||
|
|
1f2561b08e | ||
|
|
d5b31a30fd | ||
|
|
39c678988d | ||
|
|
9052c191cb | ||
|
|
766f442636 | ||
|
|
27a3d2d09e | ||
|
|
3a3482e41e | ||
|
|
44c37fa34a | ||
|
|
5c41dbfaa5 | ||
|
|
c9d2ff7a0f | ||
|
|
174af596c5 | ||
|
|
de2624faa7 | ||
|
|
cda784a5f4 | ||
|
|
cc33dbef03 | ||
|
|
ce36611c4e | ||
|
|
038cb31d27 | ||
|
|
3b53a6b0a9 | ||
|
|
619ff2338e | ||
|
|
2bcd6949df | ||
|
|
abd78ce5f5 | ||
|
|
7899fc03c4 | ||
|
|
9984f00781 | ||
|
|
a0d3bdc911 | ||
|
|
b96317b872 | ||
|
|
6c84958b9f | ||
|
|
f2559b1dbb | ||
|
|
ed2ade4801 | ||
|
|
4549172825 | ||
|
|
b877804eb6 | ||
|
|
5310abbcf7 | ||
|
|
490d4b0b9e | ||
|
|
375432f0b6 | ||
|
|
c00a23ebbc | ||
|
|
4cd2e2a11f | ||
|
|
ae7bf4dcf7 | ||
|
|
9ed1505073 | ||
|
|
e040d3663e | ||
|
|
6af69a7b7d | ||
|
|
a116e0dd26 | ||
|
|
3e2b962a36 | ||
|
|
abb60ec579 | ||
|
|
b738d4a6ac | ||
|
|
0149bd49ca | ||
|
|
e05157437f | ||
|
|
e045e798a2 | ||
|
|
7908a72fa9 | ||
|
|
593bf2bc6d | ||
|
|
cf701d5db4 | ||
|
|
bf8d4c5418 | ||
|
|
912145c81b | ||
|
|
913127b553 | ||
|
|
62f85e2f49 | ||
|
|
4b1212eb4a | ||
|
|
94a096ec4c | ||
|
|
404ee55ec4 | ||
|
|
5fbd52da49 | ||
|
|
7bf094c117 | ||
|
|
4bb79decf3 | ||
|
|
60fb93e063 | ||
|
|
1894a8960e | ||
|
|
4ba5c90bc9 | ||
|
|
1d16bd7d30 | ||
|
|
17819ad4f6 | ||
|
|
ac1ea6faca | ||
|
|
8a3f1a1fa1 | ||
|
|
46c7c0c4e6 | ||
|
|
dd60a9abd6 | ||
|
|
50835ffbf6 | ||
|
|
637713fe72 | ||
|
|
7e71c868ab | ||
|
|
aaf5c43e78 | ||
|
|
5fb6f0e410 | ||
|
|
cd031de680 | ||
|
|
eeda25ab04 | ||
|
|
acaf04a24e | ||
|
|
bcabe77799 | ||
|
|
64cf31f348 | ||
|
|
e037155a94 | ||
|
|
55cbb8a8d6 | ||
|
|
db599f2ae6 | ||
|
|
741567868e | ||
|
|
1e5e0480fd | ||
|
|
917aa7928d | ||
|
|
cd4dbd67a2 | ||
|
|
5a6eab05e9 | ||
|
|
55ccaf9df9 | ||
|
|
af0e056eec | ||
|
|
77d1f0d982 | ||
|
|
d4d7d5eafd | ||
|
|
f658027c51 | ||
|
|
7be993b728 | ||
|
|
e1d78821f6 | ||
|
|
94ac1af293 | ||
|
|
b4db48935d | ||
|
|
f5063c1435 | ||
|
|
8092a6858e | ||
|
|
0fbaeaabd0 | ||
|
|
995f00d23f | ||
|
|
100605ef0c | ||
|
|
1246cd5e73 | ||
|
|
f30e59fed9 | ||
|
|
5e8b294faf | ||
|
|
c84c469b78 | ||
|
|
1a5a65acd0 | ||
|
|
6f5d18a9f5 | ||
|
|
004f22a51c | ||
|
|
d775caff7f | ||
|
|
baf3a3eecd | ||
|
|
ca2e14788d | ||
|
|
c57d8fc6be | ||
|
|
294e5bb79f | ||
|
|
bde19f9b2a | ||
|
|
1d2071b892 | ||
|
|
b46eb5c20a | ||
|
|
3d605615ce | ||
|
|
c502d7fca6 | ||
|
|
9f8abc5d74 | ||
|
|
c8cbb3fbba | ||
|
|
fa3c8ed5f9 | ||
|
|
8ac5f1983e | ||
|
|
eccc02d084 | ||
|
|
0c94db7147 | ||
|
|
ed87473bf9 | ||
|
|
812a879ec2 | ||
|
|
5627542d7c | ||
|
|
f42fe500c9 | ||
|
|
ac3177ce95 | ||
|
|
ccaaff406f | ||
|
|
b1ec43ae33 | ||
|
|
ee8c2a235f | ||
|
|
299fbfd722 | ||
|
|
5f54ecdf2c | ||
|
|
e09138ce45 | ||
|
|
a71893f88b | ||
|
|
01324ffaff | ||
|
|
c354465ed8 | ||
|
|
50ab2386ec | ||
|
|
bf9f362597 | ||
|
|
d03ee57cc5 | ||
|
|
6f24bd9ff4 | ||
|
|
616e0a0d32 | ||
|
|
ee76105119 | ||
|
|
381f863a18 | ||
|
|
57c63d9ce7 | ||
|
|
0522dade9f | ||
|
|
484cff2182 | ||
|
|
dd3c371c08 | ||
|
|
3145bce6a1 | ||
|
|
73f991a7fd | ||
|
|
0205caa371 | ||
|
|
c2c46a7036 | ||
|
|
2b00b64e8c | ||
|
|
4e2522a080 | ||
|
|
473065dfeb | ||
|
|
60dafebd91 | ||
|
|
35370752d5 | ||
|
|
808d00906c | ||
|
|
da5d5bd71f | ||
|
|
0c99e69423 | ||
|
|
410813eb6b | ||
|
|
6cc44eb0fe | ||
|
|
11ee930b9d | ||
|
|
69e4c9b01e | ||
|
|
c32fed9238 | ||
|
|
4941ef659f | ||
|
|
6efb18330f | ||
|
|
5e256590db | ||
|
|
79303d7cd3 | ||
|
|
681a818af2 | ||
|
|
933b1eb4df | ||
|
|
c419b57754 | ||
|
|
05323869d7 | ||
|
|
2520148ebb | ||
|
|
a06a4ad59a | ||
|
|
141aac1a60 | ||
|
|
8a1578ede8 | ||
|
|
8ba7840528 | ||
|
|
3168a3e086 | ||
|
|
3cf9149129 | ||
|
|
7c8a098852 | ||
|
|
ecbdb3104a | ||
|
|
c8a332b3af | ||
|
|
b5f7d57124 | ||
|
|
0db5c7f421 | ||
|
|
ed83272f35 | ||
|
|
20b49e7c34 | ||
|
|
6a6ef0f437 | ||
|
|
32ef462f1d | ||
|
|
b895360f49 | ||
|
|
c2c094e8a1 | ||
|
|
d4d0192405 | ||
|
|
15ea36e7fd | ||
|
|
692279586a | ||
|
|
9eec475dcc | ||
|
|
661130d429 | ||
|
|
68b73ebf91 | ||
|
|
08c0020ac3 | ||
|
|
ac87c72797 | ||
|
|
5be8710774 | ||
|
|
5fa027ab8a | ||
|
|
dbe04adb1a | ||
|
|
6815f3af6d | ||
|
|
f8357512d0 | ||
|
|
8bfc19e7f7 | ||
|
|
d6f7449636 | ||
|
|
f4286e8f1a | ||
|
|
14e6fd1f12 | ||
|
|
2e57621fc5 | ||
|
|
4a8ae3a20c | ||
|
|
61393fdcce | ||
|
|
6ed6cebcf4 | ||
|
|
2f764f6c18 | ||
|
|
a646e50019 | ||
|
|
e967dfed2d | ||
|
|
2dc33a9de1 | ||
|
|
7c5e1c6195 | ||
|
|
8607312fef | ||
|
|
abac891bd2 | ||
|
|
2e25a13fc0 | ||
|
|
7a2c4e8a38 | ||
|
|
90e0ace325 | ||
|
|
9a2a5d9c8b | ||
|
|
d4dd0dcd79 | ||
|
|
d454586927 | ||
|
|
1917b6a0a3 | ||
|
|
a924b820c2 | ||
|
|
9e82d2b843 | ||
|
|
ab7a04d89f | ||
|
|
a377f95aac | ||
|
|
4356e0c3ce | ||
|
|
5d5de9f759 | ||
|
|
e1f69ea278 | ||
|
|
6a76fe41c6 | ||
|
|
aae82d7992 | ||
|
|
ca576e877f | ||
|
|
bc23038848 | ||
|
|
43e8730acd | ||
|
|
c43def5fce | ||
|
|
e68b365fa1 | ||
|
|
3867f9b8ea | ||
|
|
0b20c57867 | ||
|
|
7e9ca5b41d | ||
|
|
a527a4d82e | ||
|
|
adfc29968a | ||
|
|
e17e94d2da | ||
|
|
9af3bb8dc1 | ||
|
|
998dd11cbd | ||
|
|
9cb8d21cb5 | ||
|
|
4fc4298920 | ||
|
|
230188fb30 | ||
|
|
a96c75ff02 | ||
|
|
1b4ed00509 | ||
|
|
a54284b629 | ||
|
|
ee9e9bb3e1 | ||
|
|
cae9689281 | ||
|
|
1f6e2cf291 | ||
|
|
69a76054e8 | ||
|
|
31fea11255 | ||
|
|
5dd7e24806 | ||
|
|
848dc78112 | ||
|
|
e9d7cd3a48 | ||
|
|
b3a3a6ceb1 | ||
|
|
148c133674 | ||
|
|
d2c9cbba4f | ||
|
|
8b33900e1d | ||
|
|
0c3572312a | ||
|
|
7e683ed89b | ||
|
|
7fb892460a | ||
|
|
d517804acd | ||
|
|
ce761122b2 | ||
|
|
76a5354ad7 | ||
|
|
006b473c0c | ||
|
|
5e1af6d7d5 | ||
|
|
ec0cd4a994 | ||
|
|
86864d7bc0 | ||
|
|
485ffcde38 | ||
|
|
0304eaec94 | ||
|
|
a7814a0963 | ||
|
|
160a83023a | ||
|
|
911abe2d2c | ||
|
|
0c02573c47 | ||
|
|
4257e1ce4f | ||
|
|
39bc13c8a7 | ||
|
|
dd7cd6ffdd | ||
|
|
349cda3d36 | ||
|
|
48cc56081d | ||
|
|
aa9a7a931d | ||
|
|
3aee45de28 | ||
|
|
5f469d8903 | ||
|
|
2ce2e90205 | ||
|
|
8b76cc841d | ||
|
|
75b1d75751 | ||
|
|
2d19a1f1ec | ||
|
|
e57d005076 | ||
|
|
31d483dfbc | ||
|
|
fc2cb9d063 | ||
|
|
91cc03a81a | ||
|
|
67049c3261 | ||
|
|
c98cea3dbb | ||
|
|
0a67ac6d47 | ||
|
|
f8c0d86d6c | ||
|
|
872e04f94e | ||
|
|
d5c60438d1 | ||
|
|
60788913da | ||
|
|
f01118f2fc | ||
|
|
9db812ea7f | ||
|
|
d538e78d8a | ||
|
|
ba0499a803 | ||
|
|
1318fdc52c | ||
|
|
d3c50fad6c | ||
|
|
e2219858ae | ||
|
|
85043a2d1b | ||
|
|
cac813bbc4 | ||
|
|
94a4c2cb40 | ||
|
|
11829fe7d0 | ||
|
|
455eefa854 | ||
|
|
0f4f90d722 | ||
|
|
cefb0a3eb8 | ||
|
|
bc661a8ed5 | ||
|
|
9ff549799d | ||
|
|
e499a09759 | ||
|
|
fb280e47d6 | ||
|
|
4aabc45685 | ||
|
|
a8af7caae1 | ||
|
|
7d2c296357 | ||
|
|
c24a69549d | ||
|
|
f141da6b55 | ||
|
|
3688ece655 | ||
|
|
61a51dea7b | ||
|
|
bccb4f87be | ||
|
|
52b6dbf2b4 | ||
|
|
f33f55bcbb | ||
|
|
f4d3f45c16 | ||
|
|
1e65d6640f | ||
|
|
8a4fd30797 | ||
|
|
9818ec4ad9 | ||
|
|
4d08eb264d | ||
|
|
bc159207bd | ||
|
|
1f166ae071 | ||
|
|
ce4c2154f4 | ||
|
|
71fedee85d | ||
|
|
90c2b548e5 | ||
|
|
1d48f96fc5 | ||
|
|
10255eee72 | ||
|
|
5b2568e9e4 | ||
|
|
be6413b0e7 | ||
|
|
15d1c86b2c | ||
|
|
dd47e3bcab | ||
|
|
872534e763 | ||
|
|
d351cbbcea | ||
|
|
6c95547c3f | ||
|
|
c7a7e550dc | ||
|
|
ee1a634c25 | ||
|
|
55ab99cb98 | ||
|
|
f50b0a0bcb | ||
|
|
01054c9c79 | ||
|
|
8bd3ec2ba1 | ||
|
|
e08a9ea9ad | ||
|
|
1987398ec5 | ||
|
|
fa0fc9acb8 | ||
|
|
fa1c461c13 | ||
|
|
a99b05525d | ||
|
|
a337b21a4f | ||
|
|
1b96828667 | ||
|
|
7785c18c56 | ||
|
|
183709c522 | ||
|
|
458bf674ad | ||
|
|
3016edbe72 | ||
|
|
fa554a8e85 | ||
|
|
5b03f5c531 | ||
|
|
2acd10d7b0 | ||
|
|
a012f5bddb | ||
|
|
98796d4513 | ||
|
|
2bbf7d267a | ||
|
|
266d72a82f | ||
|
|
873c437235 | ||
|
|
15e0f3e8c6 | ||
|
|
af2a4d4a91 | ||
|
|
d4e2f23287 | ||
|
|
332bd868f5 | ||
|
|
60a83a51c3 | ||
|
|
79285bd63e | ||
|
|
3a941eff4a | ||
|
|
65adcec82f | ||
|
|
ffb6f39715 | ||
|
|
9a16269747 | ||
|
|
32f55a74b0 | ||
|
|
5320acf589 | ||
|
|
5faa300c5e | ||
|
|
4ab9592924 | ||
|
|
6f01d458d5 | ||
|
|
6f9013297a |
@@ -192,6 +192,7 @@ macos:
|
|||||||
only:
|
only:
|
||||||
- branches@GNOME/gtk
|
- branches@GNOME/gtk
|
||||||
stage: build
|
stage: build
|
||||||
|
allow_failure: true
|
||||||
tags:
|
tags:
|
||||||
- macos
|
- macos
|
||||||
needs: []
|
needs: []
|
||||||
|
|||||||
79
NEWS
79
NEWS
@@ -1,3 +1,82 @@
|
|||||||
|
Overview of Changes in 4.9.1, dd-mm-yyyy
|
||||||
|
========================================
|
||||||
|
|
||||||
|
Note that deprecations are an early outlook
|
||||||
|
at changes that will appear in an eventual
|
||||||
|
GTK 5 release, which is still far away.
|
||||||
|
|
||||||
|
* GtkTreeView, GtkIconView, GtkComboBox and
|
||||||
|
auxiliary classes have been deprecated
|
||||||
|
|
||||||
|
* GtkEntryCompletion has been deprecated
|
||||||
|
|
||||||
|
* GtkStyleContext has been deprecated
|
||||||
|
|
||||||
|
* gtk_render_ and gtk_snapshot_render_ APIs
|
||||||
|
have been deprecated
|
||||||
|
|
||||||
|
* GtkAppChooser widgets hae been deprecated
|
||||||
|
|
||||||
|
* GtkMountOperation:
|
||||||
|
- Fix the dialog to look reasonable
|
||||||
|
- Make it work under non-X11
|
||||||
|
|
||||||
|
* GtkStringSorter:
|
||||||
|
- Support different collation methods
|
||||||
|
|
||||||
|
* Accessibility:
|
||||||
|
- Introduce GtkAccessibleRange and implement it
|
||||||
|
|
||||||
|
* Debugging:
|
||||||
|
- Unify formatting for debug output
|
||||||
|
- Make make debug options available in
|
||||||
|
non-debug builds
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Abkhazian
|
||||||
|
Basque
|
||||||
|
Bulgarian
|
||||||
|
Croatian
|
||||||
|
Friulian
|
||||||
|
Georgian
|
||||||
|
German
|
||||||
|
Hungarian
|
||||||
|
Russian
|
||||||
|
Turkish
|
||||||
|
|
||||||
|
|
||||||
|
Overview of Changes in 4.8.1, 16-09-2022
|
||||||
|
========================================
|
||||||
|
|
||||||
|
* Input:
|
||||||
|
- Fix problems with input method interactions that caused
|
||||||
|
dead keys not to work
|
||||||
|
- Accept single-key compose sequences (these are used with
|
||||||
|
some keyboard layouts)
|
||||||
|
|
||||||
|
* GtkColumnView:
|
||||||
|
- Flip column order in right-to-left context
|
||||||
|
|
||||||
|
* GtkGridView:
|
||||||
|
- Fix problems with rubberbanding
|
||||||
|
|
||||||
|
* GtkFileChooser:
|
||||||
|
- Fix positioning of popovers in the places view
|
||||||
|
- Make ~ and . keyboard shortcuts work again
|
||||||
|
|
||||||
|
* gsk:
|
||||||
|
- Make glyph upload more similar to icons
|
||||||
|
|
||||||
|
* Make file transfer via portals work, this fixes file
|
||||||
|
copy/paste and dnd in flatpaks
|
||||||
|
|
||||||
|
* Translation updates:
|
||||||
|
Catalan
|
||||||
|
Chinese (China)
|
||||||
|
Chinese (Taiwan)
|
||||||
|
Latvian
|
||||||
|
|
||||||
|
|
||||||
Overview of Changes in 4.8.0, 06-09-2022
|
Overview of Changes in 4.8.0, 06-09-2022
|
||||||
========================================
|
========================================
|
||||||
|
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
#!/usr/bin/env python3
|
|
||||||
|
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import subprocess
|
|
||||||
|
|
||||||
if 'DESTDIR' not in os.environ:
|
|
||||||
gtk_api_version = sys.argv[1]
|
|
||||||
gtk_abi_version = sys.argv[2]
|
|
||||||
gtk_libdir = sys.argv[3]
|
|
||||||
gtk_datadir = sys.argv[4]
|
|
||||||
gtk_bindir = sys.argv[5]
|
|
||||||
|
|
||||||
gtk_moduledir = os.path.join(gtk_libdir, 'gtk-' + gtk_api_version, gtk_abi_version)
|
|
||||||
gtk_printmodule_dir = os.path.join(gtk_moduledir, 'printbackends')
|
|
||||||
gtk_mediamodule_dir = os.path.join(gtk_moduledir, 'media')
|
|
||||||
|
|
||||||
print('Compiling GSettings schemas...')
|
|
||||||
glib_compile_schemas = subprocess.check_output(['pkg-config',
|
|
||||||
'--variable=glib_compile_schemas',
|
|
||||||
'gio-2.0']).strip()
|
|
||||||
if not os.path.exists(glib_compile_schemas):
|
|
||||||
# pkg-config variables only available since GLib 2.62.0.
|
|
||||||
glib_compile_schemas = 'glib-compile-schemas'
|
|
||||||
subprocess.call([glib_compile_schemas,
|
|
||||||
os.path.join(gtk_datadir, 'glib-2.0', 'schemas')])
|
|
||||||
|
|
||||||
print('Updating icon cache...')
|
|
||||||
update_icon_cache = os.path.join(gtk_bindir, 'gtk4-update-icon-cache')
|
|
||||||
subprocess.call([update_icon_cache, '-q', '-t' ,'-f',
|
|
||||||
os.path.join(gtk_datadir, 'icons', 'hicolor')])
|
|
||||||
|
|
||||||
print('Updating module cache for print backends...')
|
|
||||||
os.makedirs(gtk_printmodule_dir, exist_ok=True)
|
|
||||||
gio_querymodules = subprocess.check_output(['pkg-config',
|
|
||||||
'--variable=gio_querymodules',
|
|
||||||
'gio-2.0']).strip()
|
|
||||||
if not os.path.exists(gio_querymodules):
|
|
||||||
# pkg-config variables only available since GLib 2.62.0.
|
|
||||||
gio_querymodules = 'gio-querymodules'
|
|
||||||
subprocess.call([gio_querymodules, gtk_printmodule_dir])
|
|
||||||
|
|
||||||
print('Updating module cache for media backends...')
|
|
||||||
os.makedirs(gtk_mediamodule_dir, exist_ok=True)
|
|
||||||
subprocess.call([gio_querymodules, gtk_mediamodule_dir])
|
|
||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "constraint-editor.h"
|
#include "constraint-editor.h"
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
struct _ConstraintEditor
|
struct _ConstraintEditor
|
||||||
{
|
{
|
||||||
GtkWidget parent_instance;
|
GtkWidget parent_instance;
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
#include "guide-editor.h"
|
#include "guide-editor.h"
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
struct _GuideEditor
|
struct _GuideEditor
|
||||||
{
|
{
|
||||||
GtkWidget parent_instance;
|
GtkWidget parent_instance;
|
||||||
|
|||||||
@@ -11,6 +11,8 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
ICON_NAME_COL,
|
ICON_NAME_COL,
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
/* Theming/CSS Accordion
|
/* Theming/CSS Accordion
|
||||||
*
|
*
|
||||||
* A simple accordion demo written using CSS transitions and multiple backgrounds
|
* A simple accordion demo written using CSS transitions and multiple backgrounds
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
static void
|
static void
|
||||||
apply_css (GtkWidget *widget, GtkStyleProvider *provider)
|
destroy_provider (GtkWidget *window,
|
||||||
|
GtkStyleProvider *provider)
|
||||||
{
|
{
|
||||||
GtkWidget *child;
|
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (window), provider);
|
||||||
|
|
||||||
gtk_style_context_add_provider (gtk_widget_get_style_context (widget), provider, G_MAXUINT);
|
|
||||||
for (child = gtk_widget_get_first_child (widget);
|
|
||||||
child != NULL;
|
|
||||||
child = gtk_widget_get_next_sibling (child))
|
|
||||||
apply_css (child, provider);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
@@ -24,8 +20,8 @@ do_css_accordion (GtkWidget *do_widget)
|
|||||||
|
|
||||||
if (!window)
|
if (!window)
|
||||||
{
|
{
|
||||||
GtkWidget *container, *child;
|
GtkWidget *container, *styled_box, *child;
|
||||||
GtkStyleProvider *provider;
|
GtkCssProvider *provider;
|
||||||
|
|
||||||
window = gtk_window_new ();
|
window = gtk_window_new ();
|
||||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
||||||
@@ -33,10 +29,13 @@ do_css_accordion (GtkWidget *do_widget)
|
|||||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
||||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||||
|
|
||||||
|
styled_box = gtk_frame_new (NULL);
|
||||||
|
gtk_window_set_child (GTK_WINDOW (window), styled_box);
|
||||||
|
gtk_widget_add_css_class (styled_box, "accordion");
|
||||||
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
container = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||||
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
|
gtk_widget_set_halign (container, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (container, GTK_ALIGN_CENTER);
|
||||||
gtk_window_set_child (GTK_WINDOW (window), container);
|
gtk_frame_set_child (GTK_FRAME (styled_box), container);
|
||||||
|
|
||||||
child = gtk_button_new_with_label ("This");
|
child = gtk_button_new_with_label ("This");
|
||||||
gtk_box_append (GTK_BOX (container), child);
|
gtk_box_append (GTK_BOX (container), child);
|
||||||
@@ -56,10 +55,16 @@ do_css_accordion (GtkWidget *do_widget)
|
|||||||
child = gtk_button_new_with_label (":-)");
|
child = gtk_button_new_with_label (":-)");
|
||||||
gtk_box_append (GTK_BOX (container), child);
|
gtk_box_append (GTK_BOX (container), child);
|
||||||
|
|
||||||
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
|
provider = gtk_css_provider_new ();
|
||||||
gtk_css_provider_load_from_resource (GTK_CSS_PROVIDER (provider), "/css_accordion/css_accordion.css");
|
gtk_css_provider_load_from_resource (provider, "/css_accordion/css_accordion.css");
|
||||||
|
|
||||||
apply_css (window, provider);
|
gtk_style_context_add_provider_for_display (gtk_widget_get_display (window),
|
||||||
|
GTK_STYLE_PROVIDER (provider),
|
||||||
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
|
|
||||||
|
g_signal_connect (window, "destroy",
|
||||||
|
G_CALLBACK (destroy_provider), provider);
|
||||||
|
g_object_unref (provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
@import url("resource://css_accordion/reset.css");
|
.accordion, .accordion * {
|
||||||
|
all: unset;
|
||||||
|
|
||||||
* {
|
|
||||||
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
transition-property: color, background-color, border-color, background-image, padding, border-width;
|
||||||
transition-duration: 1s;
|
transition-duration: 1s;
|
||||||
|
|
||||||
font: 20px Cantarell;
|
font: 20px Cantarell;
|
||||||
}
|
}
|
||||||
|
|
||||||
window {
|
.accordion {
|
||||||
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
|
background: linear-gradient(153deg, #151515, #151515 5px, transparent 5px) 0 0,
|
||||||
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
|
linear-gradient(333deg, #151515, #151515 5px, transparent 5px) 10px 5px,
|
||||||
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
|
linear-gradient(153deg, #222, #222 5px, transparent 5px) 0 5px,
|
||||||
@@ -18,7 +18,7 @@ window {
|
|||||||
background-size: 20px 20px;
|
background-size: 20px 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
.accordion button {
|
||||||
color: black;
|
color: black;
|
||||||
background-color: #bbb;
|
background-color: #bbb;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
@@ -28,25 +28,25 @@ button {
|
|||||||
padding: 12px 4px;
|
padding: 12px 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:first-child {
|
.accordion button:first-child {
|
||||||
border-radius: 5px 0 0 5px;
|
border-radius: 5px 0 0 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:last-child {
|
.accordion button:last-child {
|
||||||
border-radius: 0 5px 5px 0;
|
border-radius: 0 5px 5px 0;
|
||||||
border-width: 2px;
|
border-width: 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover {
|
.accordion button:hover {
|
||||||
padding: 12px 48px;
|
padding: 12px 48px;
|
||||||
background-color: #4870bc;
|
background-color: #4870bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
button *:hover {
|
.accordion button *:hover {
|
||||||
color: white;
|
color: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
button:hover:active,
|
.accordion button:hover:active,
|
||||||
button:active {
|
.accordion button:active {
|
||||||
background-color: #993401;
|
background-color: #993401;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_parsing_error (GtkCssProvider *provider,
|
show_parsing_error (GtkCssProvider *provider,
|
||||||
GtkCssSection *section,
|
GtkCssSection *section,
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_parsing_error (GtkCssProvider *provider,
|
show_parsing_error (GtkCssProvider *provider,
|
||||||
GtkCssSection *section,
|
GtkCssSection *section,
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_parsing_error (GtkCssProvider *provider,
|
show_parsing_error (GtkCssProvider *provider,
|
||||||
GtkCssSection *section,
|
GtkCssSection *section,
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_parsing_error (GtkCssProvider *provider,
|
show_parsing_error (GtkCssProvider *provider,
|
||||||
GtkCssSection *section,
|
GtkCssSection *section,
|
||||||
|
|||||||
@@ -24,7 +24,6 @@
|
|||||||
</gresource>
|
</gresource>
|
||||||
<gresource prefix="/css_accordion">
|
<gresource prefix="/css_accordion">
|
||||||
<file>css_accordion.css</file>
|
<file>css_accordion.css</file>
|
||||||
<file>reset.css</file>
|
|
||||||
</gresource>
|
</gresource>
|
||||||
<gresource prefix="/css_basics">
|
<gresource prefix="/css_basics">
|
||||||
<file>css_basics.css</file>
|
<file>css_basics.css</file>
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
|
||||||
G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget)
|
G_DECLARE_FINAL_TYPE (CanvasItem, canvas_item, CANVAS, ITEM, GtkWidget)
|
||||||
|
|
||||||
struct _CanvasItem {
|
struct _CanvasItem {
|
||||||
@@ -24,6 +25,9 @@ struct _CanvasItem {
|
|||||||
double delta;
|
double delta;
|
||||||
|
|
||||||
GtkWidget *editor;
|
GtkWidget *editor;
|
||||||
|
|
||||||
|
GtkStyleProvider *provider;
|
||||||
|
char *css_class;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _CanvasItemClass {
|
struct _CanvasItemClass {
|
||||||
@@ -34,32 +38,41 @@ G_DEFINE_TYPE (CanvasItem, canvas_item, GTK_TYPE_WIDGET)
|
|||||||
|
|
||||||
static int n_items = 0;
|
static int n_items = 0;
|
||||||
|
|
||||||
|
static void
|
||||||
|
unstyle_item (CanvasItem *item)
|
||||||
|
{
|
||||||
|
if (item->provider)
|
||||||
|
{
|
||||||
|
gtk_style_context_remove_provider_for_display (gtk_widget_get_display (item->label), item->provider);
|
||||||
|
g_clear_object (&item->provider);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item->css_class)
|
||||||
|
{
|
||||||
|
gtk_widget_remove_css_class (item->label, item->css_class);
|
||||||
|
g_clear_pointer (&item->css_class, g_free);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
set_color (CanvasItem *item,
|
set_color (CanvasItem *item,
|
||||||
GdkRGBA *color)
|
GdkRGBA *color)
|
||||||
{
|
{
|
||||||
char *css;
|
char *css;
|
||||||
char *str;
|
char *str;
|
||||||
GtkStyleContext *context;
|
|
||||||
GtkCssProvider *provider;
|
GtkCssProvider *provider;
|
||||||
const char *old_class;
|
const char *name;
|
||||||
|
|
||||||
|
unstyle_item (item);
|
||||||
|
|
||||||
str = gdk_rgba_to_string (color);
|
str = gdk_rgba_to_string (color);
|
||||||
css = g_strdup_printf ("* { background: %s; }", str);
|
name = gtk_widget_get_name (item->label);
|
||||||
|
css = g_strdup_printf ("#%s { background: %s; }", name, str);
|
||||||
context = gtk_widget_get_style_context (item->label);
|
|
||||||
provider = g_object_get_data (G_OBJECT (context), "style-provider");
|
|
||||||
if (provider)
|
|
||||||
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
|
|
||||||
|
|
||||||
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
|
|
||||||
if (old_class)
|
|
||||||
gtk_widget_remove_css_class (item->label, old_class);
|
|
||||||
|
|
||||||
provider = gtk_css_provider_new ();
|
provider = gtk_css_provider_new ();
|
||||||
gtk_css_provider_load_from_data (provider, css, -1);
|
gtk_css_provider_load_from_data (provider, css, -1);
|
||||||
gtk_style_context_add_provider (gtk_widget_get_style_context (item->label), GTK_STYLE_PROVIDER (provider), 800);
|
gtk_style_context_add_provider_for_display (gtk_widget_get_display (item->label), GTK_STYLE_PROVIDER (provider), 700);
|
||||||
g_object_set_data_full (G_OBJECT (context), "style-provider", provider, g_object_unref);
|
item->provider = GTK_STYLE_PROVIDER (provider);
|
||||||
|
|
||||||
g_free (str);
|
g_free (str);
|
||||||
g_free (css);
|
g_free (css);
|
||||||
@@ -69,21 +82,10 @@ static void
|
|||||||
set_css (CanvasItem *item,
|
set_css (CanvasItem *item,
|
||||||
const char *class)
|
const char *class)
|
||||||
{
|
{
|
||||||
GtkStyleContext *context;
|
unstyle_item (item);
|
||||||
GtkCssProvider *provider;
|
|
||||||
const char *old_class;
|
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (item->label);
|
|
||||||
provider = g_object_get_data (G_OBJECT (context), "style-provider");
|
|
||||||
if (provider)
|
|
||||||
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
|
|
||||||
|
|
||||||
old_class = (const char *)g_object_get_data (G_OBJECT (item->label), "css-class");
|
|
||||||
if (old_class)
|
|
||||||
gtk_widget_remove_css_class (item->label, old_class);
|
|
||||||
|
|
||||||
g_object_set_data_full (G_OBJECT (item->label), "css-class", g_strdup (class), g_free);
|
|
||||||
gtk_widget_add_css_class (item->label, class);
|
gtk_widget_add_css_class (item->label, class);
|
||||||
|
item->css_class = g_strdup (class);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -722,6 +724,7 @@ do_dnd (GtkWidget *do_widget)
|
|||||||
int i;
|
int i;
|
||||||
int x, y;
|
int x, y;
|
||||||
GtkCssProvider *provider;
|
GtkCssProvider *provider;
|
||||||
|
GString *css;
|
||||||
|
|
||||||
button = gtk_color_button_new ();
|
button = gtk_color_button_new ();
|
||||||
g_object_unref (g_object_ref_sink (button));
|
g_object_unref (g_object_ref_sink (button));
|
||||||
@@ -733,6 +736,18 @@ do_dnd (GtkWidget *do_widget)
|
|||||||
800);
|
800);
|
||||||
g_object_unref (provider);
|
g_object_unref (provider);
|
||||||
|
|
||||||
|
css = g_string_new ("");
|
||||||
|
for (i = 0; colors[i]; i++)
|
||||||
|
g_string_append_printf (css, ".canvasitem.%s { background: %s; }\n", colors[i], colors[i]);
|
||||||
|
|
||||||
|
provider = gtk_css_provider_new ();
|
||||||
|
gtk_css_provider_load_from_data (provider, css->str, css->len);
|
||||||
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||||
|
GTK_STYLE_PROVIDER (provider),
|
||||||
|
800);
|
||||||
|
g_object_unref (provider);
|
||||||
|
g_string_free (css, TRUE);
|
||||||
|
|
||||||
window = gtk_window_new ();
|
window = gtk_window_new ();
|
||||||
gtk_window_set_display (GTK_WINDOW (window),
|
gtk_window_set_display (GTK_WINDOW (window),
|
||||||
gtk_widget_get_display (do_widget));
|
gtk_widget_get_display (do_widget));
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
int number;
|
int number;
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
/* Creates a tree model containing the completions */
|
/* Creates a tree model containing the completions */
|
||||||
static GtkTreeModel *
|
static GtkTreeModel *
|
||||||
create_completion_model (void)
|
create_completion_model (void)
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
WIDTH_COLUMN,
|
WIDTH_COLUMN,
|
||||||
HEIGHT_COLUMN,
|
HEIGHT_COLUMN,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "script-names.h"
|
#include "script-names.h"
|
||||||
#include "language-names.h"
|
#include "language-names.h"
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
#define MAKE_TAG(a,b,c,d) (unsigned int)(((a) << 24) | ((b) << 16) | ((c) << 8) | (d))
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ update_image (void)
|
|||||||
cairo_t *cr;
|
cairo_t *cr;
|
||||||
GdkPixbuf *pixbuf;
|
GdkPixbuf *pixbuf;
|
||||||
GdkPixbuf *pixbuf2;
|
GdkPixbuf *pixbuf2;
|
||||||
const char *hint;
|
|
||||||
cairo_font_options_t *fopt;
|
cairo_font_options_t *fopt;
|
||||||
cairo_hint_style_t hintstyle;
|
cairo_hint_style_t hintstyle;
|
||||||
cairo_hint_metrics_t hintmetrics;
|
cairo_hint_metrics_t hintmetrics;
|
||||||
@@ -58,18 +57,23 @@ update_image (void)
|
|||||||
|
|
||||||
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
|
fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
|
||||||
|
|
||||||
hint = gtk_combo_box_get_active_id (GTK_COMBO_BOX (hinting));
|
switch (gtk_drop_down_get_selected (GTK_DROP_DOWN (hinting)))
|
||||||
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
|
|
||||||
if (hint)
|
|
||||||
{
|
{
|
||||||
if (strcmp (hint, "none") == 0)
|
case 0:
|
||||||
hintstyle = CAIRO_HINT_STYLE_NONE;
|
hintstyle = CAIRO_HINT_STYLE_NONE;
|
||||||
else if (strcmp (hint, "slight") == 0)
|
break;
|
||||||
|
case 1:
|
||||||
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
|
hintstyle = CAIRO_HINT_STYLE_SLIGHT;
|
||||||
else if (strcmp (hint, "medium") == 0)
|
break;
|
||||||
|
case 2:
|
||||||
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
|
hintstyle = CAIRO_HINT_STYLE_MEDIUM;
|
||||||
else if (strcmp (hint, "full") == 0)
|
break;
|
||||||
|
case 3:
|
||||||
hintstyle = CAIRO_HINT_STYLE_FULL;
|
hintstyle = CAIRO_HINT_STYLE_FULL;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
cairo_font_options_set_hint_style (fopt, hintstyle);
|
cairo_font_options_set_hint_style (fopt, hintstyle);
|
||||||
|
|
||||||
@@ -418,7 +422,7 @@ do_fontrendering (GtkWidget *do_widget)
|
|||||||
g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL);
|
g_signal_connect (down_button, "clicked", G_CALLBACK (scale_down), NULL);
|
||||||
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
|
g_signal_connect (entry, "notify::text", G_CALLBACK (update_image), NULL);
|
||||||
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
|
g_signal_connect (font_button, "notify::font-desc", G_CALLBACK (update_image), NULL);
|
||||||
g_signal_connect (hinting, "notify::active", G_CALLBACK (update_image), NULL);
|
g_signal_connect (hinting, "notify::selected", G_CALLBACK (update_image), NULL);
|
||||||
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
|
g_signal_connect (anti_alias, "notify::active", G_CALLBACK (update_image), NULL);
|
||||||
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
|
g_signal_connect (hint_metrics, "notify::active", G_CALLBACK (update_image), NULL);
|
||||||
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);
|
g_signal_connect (text_radio, "notify::active", G_CALLBACK (update_image), NULL);
|
||||||
|
|||||||
@@ -116,16 +116,19 @@
|
|||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkComboBoxText" id="hinting">
|
<object class="GtkDropDown" id="hinting">
|
||||||
<property name="active">0</property>
|
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
|
<property name="model">
|
||||||
|
<object class="GtkStringList">
|
||||||
<items>
|
<items>
|
||||||
<item translatable="yes" id="none">None</item>
|
<item translatable="yes">None</item>
|
||||||
<item translatable="yes" id="slight">Slight</item>
|
<item translatable="yes">Slight</item>
|
||||||
<item translatable="yes" id="medium">Medium</item>
|
<item translatable="yes">Medium</item>
|
||||||
<item translatable="yes" id="full">Full</item>
|
<item translatable="yes">Full</item>
|
||||||
</items>
|
</items>
|
||||||
</object>
|
</object>
|
||||||
|
</property>
|
||||||
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<layout>
|
<layout>
|
||||||
<property name="column">4</property>
|
<property name="column">4</property>
|
||||||
|
|||||||
@@ -144,7 +144,6 @@ make_shader_stack (const char *name,
|
|||||||
GtkTextBuffer *buffer;
|
GtkTextBuffer *buffer;
|
||||||
GBytes *bytes;
|
GBytes *bytes;
|
||||||
GtkEventController *controller;
|
GtkEventController *controller;
|
||||||
GtkCssProvider *provider;
|
|
||||||
GdkPaintable *paintable;
|
GdkPaintable *paintable;
|
||||||
|
|
||||||
stack = gtk_shader_stack_new ();
|
stack = gtk_shader_stack_new ();
|
||||||
@@ -235,12 +234,6 @@ make_shader_stack (const char *name,
|
|||||||
g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button);
|
g_signal_connect (buffer, "changed", G_CALLBACK (text_changed), button);
|
||||||
g_object_set_data (G_OBJECT (button), "the-stack", stack);
|
g_object_set_data (G_OBJECT (button), "the-stack", stack);
|
||||||
g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer);
|
g_signal_connect (button, "clicked", G_CALLBACK (apply_text), buffer);
|
||||||
provider = gtk_css_provider_new ();
|
|
||||||
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
|
|
||||||
gtk_style_context_add_provider (gtk_widget_get_style_context (button),
|
|
||||||
GTK_STYLE_PROVIDER (provider),
|
|
||||||
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
|
||||||
g_object_unref (provider);
|
|
||||||
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
gtk_widget_set_halign (button, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_add_css_class (button, "small");
|
gtk_widget_add_css_class (button, "small");
|
||||||
@@ -274,11 +267,21 @@ make_shader_stack (const char *name,
|
|||||||
return vbox;
|
return vbox;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
remove_provider (gpointer data)
|
||||||
|
{
|
||||||
|
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||||
|
|
||||||
|
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||||
|
g_object_unref (provider);
|
||||||
|
}
|
||||||
|
|
||||||
static GtkWidget *
|
static GtkWidget *
|
||||||
create_gltransition_window (GtkWidget *do_widget)
|
create_gltransition_window (GtkWidget *do_widget)
|
||||||
{
|
{
|
||||||
GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background;
|
GtkWidget *window, *headerbar, *scale, *outer_grid, *grid, *background;
|
||||||
GdkPaintable *paintable;
|
GdkPaintable *paintable;
|
||||||
|
GtkCssProvider *provider;
|
||||||
|
|
||||||
window = gtk_window_new ();
|
window = gtk_window_new ();
|
||||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||||
@@ -333,6 +336,14 @@ create_gltransition_window (GtkWidget *do_widget)
|
|||||||
make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale),
|
make_shader_stack ("Kaleidoscope", "/gltransition/kaleidoscope.glsl", 3, scale),
|
||||||
1, 1, 1, 1);
|
1, 1, 1, 1);
|
||||||
|
|
||||||
|
provider = gtk_css_provider_new ();
|
||||||
|
gtk_css_provider_load_from_data (provider, "button.small { padding: 0; }", -1);
|
||||||
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||||
|
GTK_STYLE_PROVIDER (provider),
|
||||||
|
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
|
||||||
|
|
||||||
|
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||||
|
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static GtkWidget *window = NULL;
|
static GtkWidget *window = NULL;
|
||||||
|
|
||||||
#define FOLDER_NAME "/iconview/gnome-fs-directory.png"
|
#define FOLDER_NAME "/iconview/gnome-fs-directory.png"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
COL_TEXT,
|
COL_TEXT,
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static GtkWidget *window = NULL;
|
static GtkWidget *window = NULL;
|
||||||
static GtkTreeModel *model = NULL;
|
static GtkTreeModel *model = NULL;
|
||||||
static guint timeout = 0;
|
static guint timeout = 0;
|
||||||
|
|||||||
@@ -422,6 +422,10 @@ do_listview_settings (GtkWidget *do_widget)
|
|||||||
gtk_column_view_column_set_sorter (name_column, sorter);
|
gtk_column_view_column_set_sorter (name_column, sorter);
|
||||||
g_object_unref (sorter);
|
g_object_unref (sorter);
|
||||||
|
|
||||||
|
sorter = GTK_SORTER (gtk_string_sorter_new (gtk_property_expression_new (SETTINGS_TYPE_KEY, NULL, "type")));
|
||||||
|
gtk_column_view_column_set_sorter (type_column, sorter);
|
||||||
|
g_object_unref (sorter);
|
||||||
|
|
||||||
g_object_unref (builder);
|
g_object_unref (builder);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
#include "script-names.h"
|
#include "script-names.h"
|
||||||
#include "unicode-names.h"
|
#include "unicode-names.h"
|
||||||
|
|
||||||
|
|
||||||
#define UCD_TYPE_ITEM (ucd_item_get_type ())
|
#define UCD_TYPE_ITEM (ucd_item_get_type ())
|
||||||
G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject)
|
G_DECLARE_FINAL_TYPE (UcdItem, ucd_item, UCD, ITEM, GObject)
|
||||||
|
|
||||||
@@ -338,6 +337,15 @@ create_ucd_view (GtkWidget *label)
|
|||||||
|
|
||||||
static GtkWidget *window;
|
static GtkWidget *window;
|
||||||
|
|
||||||
|
static void
|
||||||
|
remove_provider (gpointer data)
|
||||||
|
{
|
||||||
|
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||||
|
|
||||||
|
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||||
|
g_object_unref (provider);
|
||||||
|
}
|
||||||
|
|
||||||
GtkWidget *
|
GtkWidget *
|
||||||
do_listview_ucd (GtkWidget *do_widget)
|
do_listview_ucd (GtkWidget *do_widget)
|
||||||
{
|
{
|
||||||
@@ -360,7 +368,7 @@ do_listview_ucd (GtkWidget *do_widget)
|
|||||||
gtk_widget_add_css_class (label, "enormous");
|
gtk_widget_add_css_class (label, "enormous");
|
||||||
provider = gtk_css_provider_new ();
|
provider = gtk_css_provider_new ();
|
||||||
gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1);
|
gtk_css_provider_load_from_data (provider, "label.enormous { font-size: 80px; }", -1);
|
||||||
gtk_style_context_add_provider (gtk_widget_get_style_context (label), GTK_STYLE_PROVIDER (provider), 800);
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (), GTK_STYLE_PROVIDER (provider), 800);
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
gtk_box_append (GTK_BOX (box), label);
|
gtk_box_append (GTK_BOX (box), label);
|
||||||
|
|
||||||
@@ -370,6 +378,8 @@ do_listview_ucd (GtkWidget *do_widget)
|
|||||||
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
|
gtk_scrolled_window_set_child (GTK_SCROLLED_WINDOW (sw), listview);
|
||||||
gtk_box_prepend (GTK_BOX (box), sw);
|
gtk_box_prepend (GTK_BOX (box), sw);
|
||||||
gtk_window_set_child (GTK_WINDOW (window), box);
|
gtk_window_set_child (GTK_WINDOW (window), box);
|
||||||
|
|
||||||
|
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!gtk_widget_get_visible (window))
|
if (!gtk_widget_get_visible (window))
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
|
||||||
/* Create an object for the pegs that get moved around in the game.
|
/* Create an object for the pegs that get moved around in the game.
|
||||||
*
|
*
|
||||||
* We implement the GdkPaintable interface for them, so we can use GtkPicture
|
* We implement the GdkPaintable interface for them, so we can use GtkPicture
|
||||||
@@ -359,6 +360,15 @@ drop_drop (GtkDropTarget *target,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
remove_provider (gpointer data)
|
||||||
|
{
|
||||||
|
GtkStyleProvider *provider = GTK_STYLE_PROVIDER (data);
|
||||||
|
|
||||||
|
gtk_style_context_remove_provider_for_display (gdk_display_get_default (), provider);
|
||||||
|
g_object_unref (provider);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
create_board (GtkWidget *window)
|
create_board (GtkWidget *window)
|
||||||
{
|
{
|
||||||
@@ -375,6 +385,9 @@ create_board (GtkWidget *window)
|
|||||||
|
|
||||||
provider = gtk_css_provider_new ();
|
provider = gtk_css_provider_new ();
|
||||||
gtk_css_provider_load_from_data (provider, css, -1);
|
gtk_css_provider_load_from_data (provider, css, -1);
|
||||||
|
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||||
|
GTK_STYLE_PROVIDER (provider),
|
||||||
|
800);
|
||||||
|
|
||||||
grid = gtk_grid_new ();
|
grid = gtk_grid_new ();
|
||||||
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
gtk_widget_set_halign (grid, GTK_ALIGN_CENTER);
|
||||||
@@ -393,9 +406,6 @@ create_board (GtkWidget *window)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
image = gtk_image_new ();
|
image = gtk_image_new ();
|
||||||
gtk_style_context_add_provider (gtk_widget_get_style_context (image),
|
|
||||||
GTK_STYLE_PROVIDER (provider),
|
|
||||||
800);
|
|
||||||
gtk_widget_add_css_class (image, "solitaire-field");
|
gtk_widget_add_css_class (image, "solitaire-field");
|
||||||
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
|
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
|
||||||
if (x != 3 || y != 3)
|
if (x != 3 || y != 3)
|
||||||
@@ -439,7 +449,7 @@ create_board (GtkWidget *window)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref (provider);
|
g_object_set_data_full (G_OBJECT (window), "provider", provider, remove_provider);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -123,8 +123,14 @@ do_pickers (GtkWidget *do_widget)
|
|||||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
|
picker = gtk_app_chooser_button_new ("x-scheme-handler/mailto");
|
||||||
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
|
gtk_app_chooser_button_set_show_dialog_item (GTK_APP_CHOOSER_BUTTON (picker), TRUE);
|
||||||
|
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), label, 0, 3, 1, 1);
|
||||||
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
|
gtk_grid_attach (GTK_GRID (table), picker, 1, 3, 1, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ enum {
|
|||||||
NUM_PROPERTIES
|
NUM_PROPERTIES
|
||||||
};
|
};
|
||||||
|
|
||||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
|
|
||||||
static void
|
static void
|
||||||
pixbuf_paintable_snapshot (GdkPaintable *paintable,
|
pixbuf_paintable_snapshot (GdkPaintable *paintable,
|
||||||
GdkSnapshot *snapshot,
|
GdkSnapshot *snapshot,
|
||||||
@@ -37,7 +36,6 @@ pixbuf_paintable_snapshot (GdkPaintable *paintable,
|
|||||||
|
|
||||||
g_object_unref (texture);
|
g_object_unref (texture);
|
||||||
}
|
}
|
||||||
G_GNUC_END_IGNORE_DEPRECATIONS;
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
pixbuf_paintable_get_intrinsic_width (GdkPaintable *paintable)
|
||||||
|
|||||||
@@ -16,24 +16,6 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
/* Convenience function to create a combo box holding a number of strings
|
|
||||||
*/
|
|
||||||
GtkWidget *
|
|
||||||
create_combo_box (const char **strings)
|
|
||||||
{
|
|
||||||
GtkWidget *combo_box;
|
|
||||||
const char **str;
|
|
||||||
|
|
||||||
combo_box = gtk_combo_box_text_new ();
|
|
||||||
|
|
||||||
for (str = strings; *str; str++)
|
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), *str);
|
|
||||||
|
|
||||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0);
|
|
||||||
|
|
||||||
return combo_box;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
add_row (GtkGrid *table,
|
add_row (GtkGrid *table,
|
||||||
int row,
|
int row,
|
||||||
@@ -41,7 +23,7 @@ add_row (GtkGrid *table,
|
|||||||
const char *label_text,
|
const char *label_text,
|
||||||
const char **options)
|
const char **options)
|
||||||
{
|
{
|
||||||
GtkWidget *combo_box;
|
GtkWidget *dropdown;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
|
|
||||||
label = gtk_label_new_with_mnemonic (label_text);
|
label = gtk_label_new_with_mnemonic (label_text);
|
||||||
@@ -50,12 +32,12 @@ add_row (GtkGrid *table,
|
|||||||
gtk_widget_set_hexpand (label, TRUE);
|
gtk_widget_set_hexpand (label, TRUE);
|
||||||
gtk_grid_attach (table, label, 0, row, 1, 1);
|
gtk_grid_attach (table, label, 0, row, 1, 1);
|
||||||
|
|
||||||
combo_box = create_combo_box (options);
|
dropdown = gtk_drop_down_new_from_strings (options);
|
||||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), combo_box);
|
gtk_label_set_mnemonic_widget (GTK_LABEL (label), dropdown);
|
||||||
gtk_widget_set_halign (combo_box, GTK_ALIGN_END);
|
gtk_widget_set_halign (dropdown, GTK_ALIGN_END);
|
||||||
gtk_widget_set_valign (combo_box, GTK_ALIGN_BASELINE);
|
gtk_widget_set_valign (dropdown, GTK_ALIGN_BASELINE);
|
||||||
gtk_size_group_add_widget (size_group, combo_box);
|
gtk_size_group_add_widget (size_group, dropdown);
|
||||||
gtk_grid_attach (table, combo_box, 1, row, 1, 1);
|
gtk_grid_attach (table, dropdown, 1, row, 1, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include <stdlib.h> /* for exit() */
|
#include <stdlib.h> /* for exit() */
|
||||||
#include "paintable.h"
|
#include "paintable.h"
|
||||||
|
|
||||||
|
|
||||||
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -429,11 +430,11 @@ attach_widgets (GtkTextView *text_view)
|
|||||||
}
|
}
|
||||||
else if (i == 1)
|
else if (i == 1)
|
||||||
{
|
{
|
||||||
widget = gtk_combo_box_text_new ();
|
const char *options[] = {
|
||||||
|
"Option 1", "Option 2", "Option 3", NULL
|
||||||
|
};
|
||||||
|
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 1");
|
widget = gtk_drop_down_new_from_strings (options);
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 2");
|
|
||||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (widget), "Option 3");
|
|
||||||
}
|
}
|
||||||
else if (i == 2)
|
else if (i == 2)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
/* TreeItem structure */
|
/* TreeItem structure */
|
||||||
typedef struct _TreeItem TreeItem;
|
typedef struct _TreeItem TreeItem;
|
||||||
struct _TreeItem
|
struct _TreeItem
|
||||||
|
|||||||
@@ -664,6 +664,7 @@ on_record_button_toggled (GtkToggleButton *button,
|
|||||||
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
|
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
static void
|
static void
|
||||||
on_page_combo_changed (GtkComboBox *combo,
|
on_page_combo_changed (GtkComboBox *combo,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
@@ -705,6 +706,7 @@ on_page_combo_changed (GtkComboBox *combo,
|
|||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_range_from_changed (GtkSpinButton *from)
|
on_range_from_changed (GtkSpinButton *from)
|
||||||
@@ -843,6 +845,7 @@ page_changed_cb (GtkWidget *stack, GParamSpec *pspec, gpointer data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
static void
|
static void
|
||||||
populate_model (GtkTreeStore *store)
|
populate_model (GtkTreeStore *store)
|
||||||
{
|
{
|
||||||
@@ -960,6 +963,7 @@ row_separator_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data)
|
|||||||
|
|
||||||
return is_sep;
|
return is_sep;
|
||||||
}
|
}
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
update_title_header (GtkListBoxRow *row,
|
update_title_header (GtkListBoxRow *row,
|
||||||
@@ -1578,6 +1582,7 @@ osd_frame_pressed (GtkGestureClick *gesture,
|
|||||||
return GDK_EVENT_STOP;
|
return GDK_EVENT_STOP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
static gboolean
|
static gboolean
|
||||||
page_combo_separator_func (GtkTreeModel *model,
|
page_combo_separator_func (GtkTreeModel *model,
|
||||||
GtkTreeIter *iter,
|
GtkTreeIter *iter,
|
||||||
@@ -1592,6 +1597,7 @@ page_combo_separator_func (GtkTreeModel *model,
|
|||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static void
|
static void
|
||||||
toggle_format (GSimpleAction *action,
|
toggle_format (GSimpleAction *action,
|
||||||
@@ -1844,6 +1850,7 @@ update_buttons (GtkWidget *iv, GtkIconSize size)
|
|||||||
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
|
gtk_widget_set_sensitive (button, size != GTK_ICON_SIZE_INHERIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
static void
|
static void
|
||||||
increase_icon_size (GtkWidget *iv)
|
increase_icon_size (GtkWidget *iv)
|
||||||
{
|
{
|
||||||
@@ -1894,6 +1901,7 @@ reset_icon_size (GtkWidget *iv)
|
|||||||
|
|
||||||
gtk_widget_queue_resize (iv);
|
gtk_widget_queue_resize (iv);
|
||||||
}
|
}
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
|
scale_format_value_blank (GtkScale *scale, double value, gpointer user_data)
|
||||||
@@ -2270,10 +2278,12 @@ activate (GApplication *app)
|
|||||||
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
|
g_object_set_data (G_OBJECT (window), "selection_flowbox", widget2);
|
||||||
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);
|
g_signal_connect_swapped (widget, "clicked", G_CALLBACK (populate_flowbox), widget2);
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
|
widget = (GtkWidget *)gtk_builder_get_object (builder, "charletree");
|
||||||
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
|
populate_model ((GtkTreeStore *)gtk_tree_view_get_model (GTK_TREE_VIEW (widget)));
|
||||||
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
|
gtk_tree_view_set_row_separator_func (GTK_TREE_VIEW (widget), row_separator_func, NULL, NULL);
|
||||||
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
|
gtk_tree_view_expand_all (GTK_TREE_VIEW (widget));
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
|
widget = GTK_WIDGET (gtk_builder_get_object (builder, "munsell"));
|
||||||
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));
|
widget2 = GTK_WIDGET (gtk_builder_get_object (builder, "cchooser"));
|
||||||
@@ -2281,6 +2291,7 @@ activate (GApplication *app)
|
|||||||
populate_colors (widget, widget2);
|
populate_colors (widget, widget2);
|
||||||
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);
|
g_signal_connect (widget2, "notify::rgba", G_CALLBACK (rgba_changed), widget);
|
||||||
|
|
||||||
|
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||||
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
widget = (GtkWidget *)gtk_builder_get_object (builder, "page_combo");
|
||||||
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
|
gtk_combo_box_set_row_separator_func (GTK_COMBO_BOX (widget), page_combo_separator_func, NULL, NULL);
|
||||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "range_from_spin");
|
||||||
@@ -2291,6 +2302,7 @@ activate (GApplication *app)
|
|||||||
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
g_object_set_data (G_OBJECT (widget), "range_to_spin", widget3);
|
||||||
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
g_object_set_data (G_OBJECT (widget2), "range_to_spin", widget3);
|
||||||
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
|
g_object_set_data (G_OBJECT (widget), "print_button", widget4);
|
||||||
|
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||||
|
|
||||||
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
widget2 = (GtkWidget *)gtk_builder_get_object (builder, "tooltextview");
|
||||||
|
|
||||||
|
|||||||
@@ -3345,10 +3345,12 @@ bad things might happen.</property>
|
|||||||
<attribute name="display-hint">circular-buttons</attribute>
|
<attribute name="display-hint">circular-buttons</attribute>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="verb-icon">printer-symbolic</attribute>
|
<attribute name="verb-icon">printer-symbolic</attribute>
|
||||||
|
<attribute name="label" translatable="yes">Print all the things!</attribute>
|
||||||
<attribute name="action">win.print</attribute>
|
<attribute name="action">win.print</attribute>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
|
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
|
||||||
|
<attribute name="label" translatable="yes">Share all the things!</attribute>
|
||||||
<attribute name="action">app.share</attribute>
|
<attribute name="action">app.share</attribute>
|
||||||
</item>
|
</item>
|
||||||
</section>
|
</section>
|
||||||
@@ -3363,14 +3365,17 @@ bad things might happen.</property>
|
|||||||
<attribute name="label" translatable="yes">Edit</attribute>
|
<attribute name="label" translatable="yes">Edit</attribute>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="verb-icon">edit-cut-symbolic</attribute>
|
<attribute name="verb-icon">edit-cut-symbolic</attribute>
|
||||||
|
<attribute name="label" translatable="yes">Cut</attribute>
|
||||||
<attribute name="action">app.cut</attribute>
|
<attribute name="action">app.cut</attribute>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="verb-icon">edit-copy-symbolic</attribute>
|
<attribute name="verb-icon">edit-copy-symbolic</attribute>
|
||||||
|
<attribute name="label" translatable="yes">Copy</attribute>
|
||||||
<attribute name="action">app.copy</attribute>
|
<attribute name="action">app.copy</attribute>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<attribute name="verb-icon">edit-paste-symbolic</attribute>
|
<attribute name="verb-icon">edit-paste-symbolic</attribute>
|
||||||
|
<attribute name="label" translatable="yes">Paste</attribute>
|
||||||
<attribute name="action">app.paste</attribute>
|
<attribute name="action">app.paste</attribute>
|
||||||
</item>
|
</item>
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ SYNOPSIS
|
|||||||
--------
|
--------
|
||||||
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** <COMMAND> [OPTIONS...] <FILE>
|
||||||
|
|
|
|
||||||
| **gtk4-builder-tool** validate <FILE>
|
| **gtk4-builder-tool** validate [OPTIONS...] <FILE>
|
||||||
| **gtk4-builder-tool** enumerate <FILE>
|
| **gtk4-builder-tool** enumerate [OPTIONS...] <FILE>
|
||||||
| **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** simplify [OPTIONS...] <FILE>
|
||||||
| **gtk4-builder-tool** preview [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** preview [OPTIONS...] <FILE>
|
||||||
| **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
|
| **gtk4-builder-tool** screenshot [OPTIONS...] <FILE>
|
||||||
@@ -33,12 +33,20 @@ Validation
|
|||||||
The ``validate`` command validates the given UI definition file and reports
|
The ``validate`` command validates the given UI definition file and reports
|
||||||
errors to ``stderr``.
|
errors to ``stderr``.
|
||||||
|
|
||||||
|
``--deprecations``
|
||||||
|
|
||||||
|
Warn about uses of deprecated types in the UI definition file.
|
||||||
|
|
||||||
Enumeration
|
Enumeration
|
||||||
^^^^^^^^^^^
|
^^^^^^^^^^^
|
||||||
|
|
||||||
The ``enumerate`` command lists all the named objects that are present in the UI
|
The ``enumerate`` command prints all the named objects that are present in the UI
|
||||||
definition file.
|
definition file.
|
||||||
|
|
||||||
|
``--callbacks``
|
||||||
|
|
||||||
|
Print the names of callbacks as well.
|
||||||
|
|
||||||
Preview
|
Preview
|
||||||
^^^^^^^
|
^^^^^^^
|
||||||
|
|
||||||
|
|||||||
74
docs/reference/gtk/migrating-4to5.md
Normal file
74
docs/reference/gtk/migrating-4to5.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
Title: Preparing for GTK 5
|
||||||
|
Slug: gtk-migrating-4-to-5
|
||||||
|
|
||||||
|
GTK 5 will be a major new version of GTK that breaks both API and
|
||||||
|
ABI compared to GTK 4.x. GTK 5 does not exist yet, so we cannot
|
||||||
|
be entirely sure what will be involved in a migration from GTK 4
|
||||||
|
to GTK 5. But we can already give some preliminary hints about
|
||||||
|
the likely changes, and how to prepare for them in code that is
|
||||||
|
using GTK 4.
|
||||||
|
|
||||||
|
### Do not use deprecated symbols
|
||||||
|
|
||||||
|
As always, functions and types that are known to go away in the
|
||||||
|
next major version of GTK are being marked as deprecated in GTK 4.
|
||||||
|
|
||||||
|
Removing the use of deprecated APIs is the most important step
|
||||||
|
to prepare your code for the next major version of GTK. Often,
|
||||||
|
deprecation notes will include hints about replacement APIs to
|
||||||
|
help you with this.
|
||||||
|
|
||||||
|
Sometimes, it is helpful to have some background information about
|
||||||
|
the motivation and goals of larger API changes.
|
||||||
|
|
||||||
|
## Cell renderers are going away
|
||||||
|
|
||||||
|
Cell renderers were introduced in GTK 2 to support rendering of
|
||||||
|
"big data" UIs, in particular treeviews. Over the years, more
|
||||||
|
"data-like" widgets have started to use them, and cell renderers
|
||||||
|
have grown into a shadowy, alternative rendering infrastructure
|
||||||
|
that duplicates much of what widgets do, while duplicating the
|
||||||
|
code and adding their own dose of bugs.
|
||||||
|
|
||||||
|
In GTK 4, replacement widgets for GtkTreeView, GtkIconView and
|
||||||
|
GtkComboBox have appeared: GtkListView, GtkColumnView, GtkGridView
|
||||||
|
and GtkDropDown. For GTK 5, we will take the next step and remove
|
||||||
|
all cell renderer-based widgets.
|
||||||
|
|
||||||
|
## Themed rendering APIs are going away
|
||||||
|
|
||||||
|
The old GTK 2 era rendering APIs for theme components like
|
||||||
|
gtk_render_frame() or gtk_render_check() have not been used by
|
||||||
|
GTK itself even in later GTK 3, but they have been kepy around
|
||||||
|
for the benefit of "external drawing" users - applications that
|
||||||
|
want their controls to look like GTK without using widgets.
|
||||||
|
|
||||||
|
Supporting this is increasingly getting in the way of making
|
||||||
|
the GTK CSS machinery fast and correct. One notable problem is
|
||||||
|
that temporary style changes (using gtk_style_context_save())
|
||||||
|
is breaking animations. Therefore, these APIs will be going away
|
||||||
|
in GTK 5, together with their more modern GtkSnapshot variants
|
||||||
|
like gtk_snapshot_render_background() or gtk_snapshot_render_focus().
|
||||||
|
|
||||||
|
The best way to render parts of your widget using CSS styling
|
||||||
|
is to use subwidgets. For example, to show a piece of text with
|
||||||
|
fonts, effects and shadows according to the current CSS style,
|
||||||
|
use a GtkLabel.
|
||||||
|
|
||||||
|
If you have a need for custom drawing that fits into the current
|
||||||
|
(dark or light) theme, e.g. for rendering a graph, you can still
|
||||||
|
get the current style foreground color, using
|
||||||
|
[method@Gtk.Widget.get_style_color].
|
||||||
|
|
||||||
|
## Local stylesheets are going away
|
||||||
|
|
||||||
|
The cascading part of GTK's CSS implementation is complicated by
|
||||||
|
the existence of local stylesheets (i.e. those added with
|
||||||
|
gtk_style_context_add_provider()). And local stylesheets are
|
||||||
|
unintuitive in that they do not apply to the whole subtree of
|
||||||
|
widgets, but just to the one widget where the stylesheet was
|
||||||
|
added.
|
||||||
|
|
||||||
|
GTK 5 will no longer provide this functionality. The recommendations
|
||||||
|
is to use a global stylesheet (i.e. gtk_style_context_add_provider_for_display())
|
||||||
|
and rely on style classes to make your CSS apply only where desired.
|
||||||
@@ -10,6 +10,10 @@ to determine paths to look for certain files. The [X11](#x11-envar),
|
|||||||
[Broadway](#broadway-envar) GDK backends use some additional
|
[Broadway](#broadway-envar) GDK backends use some additional
|
||||||
environment variables.
|
environment variables.
|
||||||
|
|
||||||
|
Note that environment variables are generally used for debugging
|
||||||
|
purposes. They are not guaranteed to be API stable, and should not
|
||||||
|
be used for end-user configuration and customization.
|
||||||
|
|
||||||
### `GTK_DEBUG`
|
### `GTK_DEBUG`
|
||||||
|
|
||||||
This variable can be set to a list of debug options, which cause GTK to
|
This variable can be set to a list of debug options, which cause GTK to
|
||||||
@@ -75,6 +79,9 @@ A number of keys are influencing behavior instead of just logging:
|
|||||||
`snapshot`
|
`snapshot`
|
||||||
: Include debug render nodes in the generated snapshots
|
: Include debug render nodes in the generated snapshots
|
||||||
|
|
||||||
|
`invert-text-dir`
|
||||||
|
: Invert the text direction, compared to the locale
|
||||||
|
|
||||||
The special value `all` can be used to turn on all debug options.
|
The special value `all` can be used to turn on all debug options.
|
||||||
The special value `help` can be used to obtain a list of all
|
The special value `help` can be used to obtain a list of all
|
||||||
supported debug options.
|
supported debug options.
|
||||||
@@ -85,8 +92,7 @@ Specifies a list of directories to search when GTK is looking for
|
|||||||
dynamically loaded objects such as input method modules and print
|
dynamically loaded objects such as input method modules and print
|
||||||
backends. If the path to the dynamically loaded object is given as
|
backends. If the path to the dynamically loaded object is given as
|
||||||
an absolute path name, then GTK loads it directly. Otherwise, GTK
|
an absolute path name, then GTK loads it directly. Otherwise, GTK
|
||||||
goes in turn through the directories in `GTK_PATH`, followed by
|
goes in turn through the directories in `GTK_PATH`, followed
|
||||||
the directory `.gtk-4.0` in the user's home directory, followed
|
|
||||||
by the system default directory, which is `libdir/gtk-4.0/modules`.
|
by the system default directory, which is `libdir/gtk-4.0/modules`.
|
||||||
(If `GTK_EXE_PREFIX` is defined, `libdir` is `$GTK_EXE_PREFIX/lib`.
|
(If `GTK_EXE_PREFIX` is defined, `libdir` is `$GTK_EXE_PREFIX/lib`.
|
||||||
Otherwise it is the libdir specified when GTK was configured, usually
|
Otherwise it is the libdir specified when GTK was configured, usually
|
||||||
@@ -205,24 +211,33 @@ A number of options affect behavior instead of logging:
|
|||||||
`gl-disable`
|
`gl-disable`
|
||||||
: Disable OpenGL support
|
: Disable OpenGL support
|
||||||
|
|
||||||
`gl-software`
|
|
||||||
: Force OpenGL software rendering
|
|
||||||
|
|
||||||
`gl-texture-rect`
|
|
||||||
: Use the OpenGL texture rectangle extension, if available
|
|
||||||
|
|
||||||
`gl-legacy`
|
`gl-legacy`
|
||||||
: Use a legacy OpenGL context
|
: Use a legacy OpenGL context
|
||||||
|
|
||||||
`gl-gles`
|
`gl-gles`
|
||||||
: Use a GLES OpenGL context
|
: Use a GLES OpenGL context
|
||||||
|
|
||||||
|
`gl-egl`
|
||||||
|
: Use an EGL context on X11 or Windows
|
||||||
|
|
||||||
|
`gl-glx`
|
||||||
|
: Use GLX on X11
|
||||||
|
|
||||||
|
`gl-wgl`
|
||||||
|
: Use WGL on Windows
|
||||||
|
|
||||||
`vulkan-disable`
|
`vulkan-disable`
|
||||||
: Disable Vulkan support
|
: Disable Vulkan support
|
||||||
|
|
||||||
`vulkan-validate`
|
`vulkan-validate`
|
||||||
: Load the Vulkan validation layer, if available
|
: Load the Vulkan validation layer, if available
|
||||||
|
|
||||||
|
`default-settings`
|
||||||
|
: Force default values for xsettings
|
||||||
|
|
||||||
|
`high-depth`
|
||||||
|
: Use high bit depth rendering if possible
|
||||||
|
|
||||||
The special value `all` can be used to turn on all debug options. The special
|
The special value `all` can be used to turn on all debug options. The special
|
||||||
value `help` can be used to obtain a list of all supported debug options.
|
value `help` can be used to obtain a list of all supported debug options.
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
Title: Tree and List Widget Overview
|
Title: Tree and List Widget Overview
|
||||||
Slug: gtk-treeview
|
Slug: gtk-treeview
|
||||||
|
|
||||||
|
This document describes the `GtkTreeView` widget and auxiliary
|
||||||
|
classes, like tree models and cell renderers. All of these have
|
||||||
|
been deprecated and will be removed in GTK 5. Their replacements
|
||||||
|
are described in the [List Widget Overview](section-list-widget.html).
|
||||||
|
|
||||||
|
## Introduction
|
||||||
|
|
||||||
To create a tree or list in GTK, use the `GtkTreeModel` interface in
|
To create a tree or list in GTK, use the `GtkTreeModel` interface in
|
||||||
conjunction with the `GtkTreeView` widget. This widget is designed around
|
conjunction with the `GtkTreeView` widget. This widget is designed around
|
||||||
a _Model/View/Controller_ design and consists of four major parts:
|
a _Model/View/Controller_ design and consists of four major parts:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ the default.
|
|||||||
|
|
||||||
More information about GTK on Windows, including detailed build
|
More information about GTK on Windows, including detailed build
|
||||||
instructions, binary downloads, etc, can be found
|
instructions, binary downloads, etc, can be found
|
||||||
[online](https://wiki.gnome.org/Projects/GTK/Win32).
|
[online](https://www.gtk.org/docs/installations/windows/).
|
||||||
|
|
||||||
## Windows-specific environment variables
|
## Windows-specific environment variables
|
||||||
|
|
||||||
|
|||||||
@@ -350,7 +350,8 @@ quit_activated (GSimpleAction *action,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
combo_changed (GtkComboBox *combo,
|
combo_changed (GtkDropDown *combo,
|
||||||
|
GParamSpec *pspec,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkDialog *dialog = user_data;
|
GtkDialog *dialog = user_data;
|
||||||
@@ -359,7 +360,7 @@ combo_changed (GtkComboBox *combo,
|
|||||||
char **accels;
|
char **accels;
|
||||||
char *str;
|
char *str;
|
||||||
|
|
||||||
action = gtk_combo_box_get_active_id (combo);
|
action = gtk_drop_down_get_selected_string (combo);
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
@@ -388,7 +389,7 @@ response (GtkDialog *dialog,
|
|||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
GtkEntry *entry = g_object_get_data (user_data, "entry");
|
GtkEntry *entry = g_object_get_data (user_data, "entry");
|
||||||
GtkComboBox *combo = g_object_get_data (user_data, "combo");
|
GtkDropDown *combo = g_object_get_data (user_data, "combo");
|
||||||
const char *action;
|
const char *action;
|
||||||
const char *str;
|
const char *str;
|
||||||
char **accels;
|
char **accels;
|
||||||
@@ -399,7 +400,7 @@ response (GtkDialog *dialog,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
action = gtk_combo_box_get_active_id (combo);
|
action = gtk_drop_down_get_selected_string (combo);
|
||||||
|
|
||||||
if (!action)
|
if (!action)
|
||||||
return;
|
return;
|
||||||
@@ -424,6 +425,7 @@ edit_accels (GSimpleAction *action,
|
|||||||
char **actions;
|
char **actions;
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
int i;
|
int i;
|
||||||
|
GtkStringList *strings;
|
||||||
|
|
||||||
dialog = gtk_dialog_new_with_buttons ("Accelerators",
|
dialog = gtk_dialog_new_with_buttons ("Accelerators",
|
||||||
NULL,
|
NULL,
|
||||||
@@ -435,7 +437,8 @@ edit_accels (GSimpleAction *action,
|
|||||||
gtk_window_set_application (GTK_WINDOW (dialog), app);
|
gtk_window_set_application (GTK_WINDOW (dialog), app);
|
||||||
actions = gtk_application_list_action_descriptions (app);
|
actions = gtk_application_list_action_descriptions (app);
|
||||||
|
|
||||||
combo = gtk_combo_box_text_new ();
|
strings = gtk_string_list_new (NULL);
|
||||||
|
combo = gtk_drop_down_new (G_LIST_MODEL (strings), NULL);
|
||||||
g_object_set (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
|
g_object_set (gtk_dialog_get_content_area (GTK_DIALOG (dialog)),
|
||||||
"margin-top", 10,
|
"margin-top", 10,
|
||||||
"margin-bottom", 10,
|
"margin-bottom", 10,
|
||||||
@@ -446,8 +449,8 @@ edit_accels (GSimpleAction *action,
|
|||||||
|
|
||||||
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), combo);
|
gtk_box_append (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), combo);
|
||||||
for (i = 0; actions[i]; i++)
|
for (i = 0; actions[i]; i++)
|
||||||
gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo), actions[i], actions[i]);
|
gtk_string_list_append (strings, actions[i]);
|
||||||
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), dialog);
|
g_signal_connect (combo, "notify::selected", G_CALLBACK (combo_changed), dialog);
|
||||||
|
|
||||||
entry = gtk_entry_new ();
|
entry = gtk_entry_new ();
|
||||||
gtk_widget_set_hexpand (entry, TRUE);
|
gtk_widget_set_hexpand (entry, TRUE);
|
||||||
@@ -458,7 +461,7 @@ edit_accels (GSimpleAction *action,
|
|||||||
g_object_set_data (G_OBJECT (dialog), "combo", combo);
|
g_object_set_data (G_OBJECT (dialog), "combo", combo);
|
||||||
g_object_set_data (G_OBJECT (dialog), "entry", entry);
|
g_object_set_data (G_OBJECT (dialog), "entry", entry);
|
||||||
|
|
||||||
gtk_combo_box_set_active (GTK_COMBO_BOX (combo), 0);
|
gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), 0);
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
#include "gdkbroadway-server.h"
|
#include "gdkbroadway-server.h"
|
||||||
|
|
||||||
#include "gdkprivate-broadway.h"
|
#include "gdkprivate-broadway.h"
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include <gdk/gdktextureprivate.h>
|
#include <gdk/gdktextureprivate.h>
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
typedef struct BroadwayInput BroadwayInput;
|
typedef struct BroadwayInput BroadwayInput;
|
||||||
|
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
|||||||
gint32 device_root_x, device_root_y;
|
gint32 device_root_x, device_root_y;
|
||||||
guint32 mouse_toplevel_id;
|
guint32 mouse_toplevel_id;
|
||||||
guint32 mask32;
|
guint32 mask32;
|
||||||
|
int origin_x, origin_y;
|
||||||
|
|
||||||
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
|
if (gdk_device_get_source (device) != GDK_SOURCE_MOUSE)
|
||||||
return;
|
return;
|
||||||
@@ -97,10 +98,12 @@ gdk_broadway_device_query_state (GdkDevice *device,
|
|||||||
&device_root_y,
|
&device_root_y,
|
||||||
&mask32);
|
&mask32);
|
||||||
|
|
||||||
|
gdk_surface_get_origin (surface, &origin_x, &origin_y);
|
||||||
|
|
||||||
if (win_x)
|
if (win_x)
|
||||||
*win_x = device_root_x;
|
*win_x = device_root_x - origin_x;
|
||||||
if (win_y)
|
if (win_y)
|
||||||
*win_y = device_root_y;
|
*win_y = device_root_y - origin_y;
|
||||||
if (mask)
|
if (mask)
|
||||||
*mask = mask32;
|
*mask = mask32;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "gdkdevice-broadway.h"
|
#include "gdkdevice-broadway.h"
|
||||||
#include "gdkdeviceprivate.h"
|
#include "gdkdeviceprivate.h"
|
||||||
#include <gdk/gdktextureprivate.h>
|
#include <gdk/gdktextureprivate.h>
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gprintf.h>
|
#include <glib/gprintf.h>
|
||||||
@@ -213,7 +213,7 @@ _gdk_broadway_display_open (const char *display_name)
|
|||||||
broadway_display->server = _gdk_broadway_server_new (display, display_name, &error);
|
broadway_display->server = _gdk_broadway_server_new (display, display_name, &error);
|
||||||
if (broadway_display->server == NULL)
|
if (broadway_display->server == NULL)
|
||||||
{
|
{
|
||||||
GDK_NOTE (MISC, g_message ("Unable to init Broadway server: %s\n", error->message));
|
GDK_DEBUG (MISC, "Unable to init Broadway server: %s", error->message);
|
||||||
g_error_free (error);
|
g_error_free (error);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -262,7 +262,8 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
|||||||
message->key.state,
|
message->key.state,
|
||||||
FALSE,
|
FALSE,
|
||||||
&translated,
|
&translated,
|
||||||
&translated);
|
&translated,
|
||||||
|
NULL);
|
||||||
|
|
||||||
node = _gdk_event_queue_append (display, event);
|
node = _gdk_event_queue_append (display, event);
|
||||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||||
|
|||||||
@@ -483,6 +483,34 @@ connection_closed (GDBusConnection *connection,
|
|||||||
static void
|
static void
|
||||||
finish_registration (void)
|
finish_registration (void)
|
||||||
{
|
{
|
||||||
|
gdk_content_register_serializer (G_TYPE_FILE,
|
||||||
|
"application/vnd.portal.filetransfer",
|
||||||
|
portal_file_serializer,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gdk_content_register_serializer (GDK_TYPE_FILE_LIST,
|
||||||
|
"application/vnd.portal.filetransfer",
|
||||||
|
portal_file_serializer,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
|
||||||
|
GDK_TYPE_FILE_LIST,
|
||||||
|
portal_file_deserializer,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
gdk_content_register_deserializer ("application/vnd.portal.filetransfer",
|
||||||
|
G_TYPE_FILE,
|
||||||
|
portal_file_deserializer,
|
||||||
|
NULL,
|
||||||
|
NULL);
|
||||||
|
|
||||||
|
/* FIXME: I missed up and used the wrong mime type here when
|
||||||
|
* I implemented my own protocol. Keep these around for a while
|
||||||
|
* so we can interoperate with existing flatpaks using GTK 4.6
|
||||||
|
*/
|
||||||
gdk_content_register_serializer (G_TYPE_FILE,
|
gdk_content_register_serializer (G_TYPE_FILE,
|
||||||
"application/vnd.portal.files",
|
"application/vnd.portal.files",
|
||||||
portal_file_serializer,
|
portal_file_serializer,
|
||||||
|
|||||||
@@ -1,45 +0,0 @@
|
|||||||
/* GTK - The GIMP Toolkit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gdk/gdk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef __GI_SCANNER__
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkSeat, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkVulkanContext, g_object_unref)
|
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, g_object_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
49
gdk/gdk.c
49
gdk/gdk.c
@@ -28,12 +28,13 @@
|
|||||||
|
|
||||||
#include "gdkresources.h"
|
#include "gdkresources.h"
|
||||||
|
|
||||||
#include "gdkconstructor.h"
|
#include "gdkconstructorprivate.h"
|
||||||
#include "gdkdebug.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkglcontextprivate.h"
|
#include "gdkglcontextprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
#include <glib/gprintf.h>
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@@ -116,19 +117,17 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
|||||||
{ "vulkan", GDK_DEBUG_VULKAN, "Information about Vulkan" },
|
{ "vulkan", GDK_DEBUG_VULKAN, "Information about Vulkan" },
|
||||||
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
|
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
|
||||||
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
|
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
|
||||||
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)" },
|
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
|
||||||
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals" },
|
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
|
||||||
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
|
||||||
{ "gl-software", GDK_DEBUG_GL_SOFTWARE, "Force OpenGL software rendering" },
|
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL", TRUE },
|
||||||
{ "gl-texture-rect", GDK_DEBUG_GL_TEXTURE_RECT, "Use OpenGL texture rectangle extension" },
|
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
|
||||||
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context" },
|
{ "gl-gles", GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API", TRUE },
|
||||||
{ "gl-gles", GDK_DEBUG_GL_GLES, "Only allow OpenGL GLES API" },
|
{ "gl-egl", GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows", TRUE },
|
||||||
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL" },
|
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11", TRUE },
|
||||||
{ "gl-egl", GDK_DEBUG_GL_EGL, "Use EGL on X11 or Windows" },
|
{ "gl-wgl", GDK_DEBUG_GL_WGL, "Use WGL on Windows", TRUE },
|
||||||
{ "gl-glx", GDK_DEBUG_GL_GLX, "Use GLX on X11" },
|
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support", TRUE },
|
||||||
{ "gl-wgl", GDK_DEBUG_GL_WGL, "Use WGL on Windows" },
|
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer", TRUE },
|
||||||
{ "vulkan-disable", GDK_DEBUG_VULKAN_DISABLE, "Disable Vulkan support" },
|
|
||||||
{ "vulkan-validate", GDK_DEBUG_VULKAN_VALIDATE, "Load the Vulkan validation layer" },
|
|
||||||
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings", TRUE },
|
{ "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings", TRUE },
|
||||||
{ "high-depth", GDK_DEBUG_HIGH_DEPTH, "Use high bit depth rendering if possible", TRUE },
|
{ "high-depth", GDK_DEBUG_HIGH_DEPTH, "Use high bit depth rendering if possible", TRUE },
|
||||||
};
|
};
|
||||||
@@ -258,16 +257,12 @@ gdk_parse_debug_var (const char *variable,
|
|||||||
|
|
||||||
fprintf (stderr, "Supported %s values:\n", variable);
|
fprintf (stderr, "Supported %s values:\n", variable);
|
||||||
for (i = 0; i < nkeys; i++) {
|
for (i = 0; i < nkeys; i++) {
|
||||||
fprintf (stderr, " %s%*s%s", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
|
if (debug_enabled || keys[i].always_enabled)
|
||||||
if (!debug_enabled && !keys[i].always_enabled)
|
fprintf (stderr, " %s%*s%s\n", keys[i].key, (int)(max_width - strlen (keys[i].key)), " ", keys[i].help);
|
||||||
fprintf (stderr, " [unavailable]");
|
|
||||||
fprintf (stderr, "\n");
|
|
||||||
}
|
}
|
||||||
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
|
fprintf (stderr, " %s%*s%s\n", "all", max_width - 3, " ", "Enable all values");
|
||||||
fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
|
fprintf (stderr, " %s%*s%s\n", "help", max_width - 4, " ", "Print this help");
|
||||||
fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
|
fprintf (stderr, "\nMultiple values can be given, separated by : or space.\n");
|
||||||
if (!debug_enabled)
|
|
||||||
fprintf (stderr, "Values marked as [unavailable] are only accessible if GTK is built with G_ENABLE_DEBUG.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (invert)
|
if (invert)
|
||||||
@@ -298,11 +293,11 @@ gdk_pre_parse (void)
|
|||||||
G_N_ELEMENTS (gdk_debug_keys));
|
G_N_ELEMENTS (gdk_debug_keys));
|
||||||
|
|
||||||
/* These are global */
|
/* These are global */
|
||||||
if (GDK_DEBUG_CHECK (GL_EGL))
|
if (_gdk_debug_flags & GDK_DEBUG_GL_EGL)
|
||||||
gdk_gl_backend_use (GDK_GL_EGL);
|
gdk_gl_backend_use (GDK_GL_EGL);
|
||||||
else if (GDK_DEBUG_CHECK (GL_GLX))
|
else if (_gdk_debug_flags & GDK_DEBUG_GL_GLX)
|
||||||
gdk_gl_backend_use (GDK_GL_GLX);
|
gdk_gl_backend_use (GDK_GL_GLX);
|
||||||
else if (GDK_DEBUG_CHECK (GL_WGL))
|
else if (_gdk_debug_flags & GDK_DEBUG_GL_WGL)
|
||||||
gdk_gl_backend_use (GDK_GL_WGL);
|
gdk_gl_backend_use (GDK_GL_WGL);
|
||||||
|
|
||||||
#ifndef G_HAS_CONSTRUCTORS
|
#ifndef G_HAS_CONSTRUCTORS
|
||||||
@@ -361,7 +356,7 @@ gdk_running_in_sandbox (void)
|
|||||||
gboolean
|
gboolean
|
||||||
gdk_should_use_portal (void)
|
gdk_should_use_portal (void)
|
||||||
{
|
{
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (NULL, PORTALS))
|
if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_PORTALS)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (gdk_running_in_sandbox ())
|
if (gdk_running_in_sandbox ())
|
||||||
|
|||||||
@@ -76,8 +76,6 @@
|
|||||||
#include <gdk/gdkversionmacros.h>
|
#include <gdk/gdkversionmacros.h>
|
||||||
#include <gdk/gdkvulkancontext.h>
|
#include <gdk/gdkvulkancontext.h>
|
||||||
|
|
||||||
#include <gdk/gdk-autocleanup.h>
|
|
||||||
|
|
||||||
#undef __GDK_H_INSIDE__
|
#undef __GDK_H_INSIDE__
|
||||||
|
|
||||||
#endif /* __GDK_H__ */
|
#endif /* __GDK_H__ */
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include "gdkapplaunchcontextprivate.h"
|
#include "gdkapplaunchcontextprivate.h"
|
||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
|
void gdk_app_launch_context_set_icon_name (GdkAppLaunchContext *context,
|
||||||
const char *icon_name);
|
const char *icon_name);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkAppLaunchContext, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -26,10 +26,10 @@
|
|||||||
#include "gdkcontentproviderprivate.h"
|
#include "gdkcontentproviderprivate.h"
|
||||||
#include "gdkcontentserializer.h"
|
#include "gdkcontentserializer.h"
|
||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkpipeiostreamprivate.h"
|
#include "gdkpipeiostreamprivate.h"
|
||||||
#include "gdktexture.h"
|
#include "gdktexture.h"
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include <gobject/gvaluecollector.h>
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
void gdk_clipboard_set_texture (GdkClipboard *clipboard,
|
void gdk_clipboard_set_texture (GdkClipboard *clipboard,
|
||||||
GdkTexture *texture);
|
GdkTexture *texture);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkClipboard, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_CLIPBOARD_H__ */
|
#endif /* __GDK_CLIPBOARD_H__ */
|
||||||
|
|||||||
@@ -16,6 +16,8 @@ G_BEGIN_DECLS
|
|||||||
#mesondefine GDK_WINDOWING_WAYLAND
|
#mesondefine GDK_WINDOWING_WAYLAND
|
||||||
#mesondefine GDK_WINDOWING_WIN32
|
#mesondefine GDK_WINDOWING_WIN32
|
||||||
|
|
||||||
|
#mesondefine GDK_RENDERING_CAIRO
|
||||||
|
#mesondefine GDK_RENDERING_GL
|
||||||
#mesondefine GDK_RENDERING_VULKAN
|
#mesondefine GDK_RENDERING_VULKAN
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include "filetransferportalprivate.h"
|
#include "filetransferportalprivate.h"
|
||||||
#include "gdktexture.h"
|
#include "gdktexture.h"
|
||||||
#include "gdkrgbaprivate.h"
|
#include "gdkrgbaprivate.h"
|
||||||
|
#include "gdkprivate.h"
|
||||||
#include "loaders/gdkpngprivate.h"
|
#include "loaders/gdkpngprivate.h"
|
||||||
#include "loaders/gdktiffprivate.h"
|
#include "loaders/gdktiffprivate.h"
|
||||||
|
|
||||||
@@ -354,12 +355,14 @@ gdk_content_deserializer_return_success (GdkContentDeserializer *deserializer)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_CONTENT_DESERIALIZER (deserializer));
|
g_return_if_fail (GDK_IS_CONTENT_DESERIALIZER (deserializer));
|
||||||
g_return_if_fail (!deserializer->returned);
|
g_return_if_fail (!deserializer->returned);
|
||||||
|
guint source_id;
|
||||||
|
|
||||||
deserializer->returned = TRUE;
|
deserializer->returned = TRUE;
|
||||||
g_idle_add_full (deserializer->priority,
|
source_id = g_idle_add_full (deserializer->priority,
|
||||||
gdk_content_deserializer_emit_callback,
|
gdk_content_deserializer_emit_callback,
|
||||||
deserializer,
|
deserializer,
|
||||||
g_object_unref);
|
g_object_unref);
|
||||||
|
gdk_source_set_static_name_by_id (source_id, "[gtk] gdk_content_deserializer_emit_callback");
|
||||||
/* NB: the idle will destroy our reference */
|
/* NB: the idle will destroy our reference */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
void gdk_content_formats_builder_add_gtype (GdkContentFormatsBuilder *builder,
|
void gdk_content_formats_builder_add_gtype (GdkContentFormatsBuilder *builder,
|
||||||
GType type);
|
GType type);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentFormats, gdk_content_formats_unref)
|
||||||
|
|
||||||
/* dunno where else to put this */
|
/* dunno where else to put this */
|
||||||
#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
|
#define GDK_TYPE_FILE_LIST (gdk_file_list_get_type ())
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
#include "gdkclipboard.h"
|
#include "gdkclipboard.h"
|
||||||
#include "gdkcontentformats.h"
|
#include "gdkcontentformats.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkContentProvider:
|
* GdkContentProvider:
|
||||||
|
|||||||
@@ -111,6 +111,9 @@ GDK_AVAILABLE_IN_ALL
|
|||||||
gboolean gdk_content_provider_get_value (GdkContentProvider *provider,
|
gboolean gdk_content_provider_get_value (GdkContentProvider *provider,
|
||||||
GValue *value,
|
GValue *value,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkContentProvider, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_CONTENT_PROVIDER_H__ */
|
#endif /* __GDK_CONTENT_PROVIDER_H__ */
|
||||||
|
|||||||
@@ -24,10 +24,10 @@
|
|||||||
|
|
||||||
#include "gdkcontentformats.h"
|
#include "gdkcontentformats.h"
|
||||||
#include "gdkcontentserializer.h"
|
#include "gdkcontentserializer.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkcontentproviderimpl.h"
|
#include "gdkcontentproviderimpl.h"
|
||||||
|
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#define GDK_TYPE_CONTENT_PROVIDER_VALUE (gdk_content_provider_value_get_type ())
|
#define GDK_TYPE_CONTENT_PROVIDER_VALUE (gdk_content_provider_value_get_type ())
|
||||||
#define GDK_CONTENT_PROVIDER_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CONTENT_PROVIDER_VALUE, GdkContentProviderValue))
|
#define GDK_CONTENT_PROVIDER_VALUE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_CONTENT_PROVIDER_VALUE, GdkContentProviderValue))
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
#include "loaders/gdktiffprivate.h"
|
#include "loaders/gdktiffprivate.h"
|
||||||
#include "loaders/gdkjpegprivate.h"
|
#include "loaders/gdkjpegprivate.h"
|
||||||
#include "gdkmemorytextureprivate.h"
|
#include "gdkmemorytextureprivate.h"
|
||||||
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include <gdk-pixbuf/gdk-pixbuf.h>
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@@ -360,12 +361,14 @@ gdk_content_serializer_return_success (GdkContentSerializer *serializer)
|
|||||||
{
|
{
|
||||||
g_return_if_fail (GDK_IS_CONTENT_SERIALIZER (serializer));
|
g_return_if_fail (GDK_IS_CONTENT_SERIALIZER (serializer));
|
||||||
g_return_if_fail (!serializer->returned);
|
g_return_if_fail (!serializer->returned);
|
||||||
|
guint source_id;
|
||||||
|
|
||||||
serializer->returned = TRUE;
|
serializer->returned = TRUE;
|
||||||
g_idle_add_full (serializer->priority,
|
source_id = g_idle_add_full (serializer->priority,
|
||||||
gdk_content_serializer_emit_callback,
|
gdk_content_serializer_emit_callback,
|
||||||
serializer,
|
serializer,
|
||||||
g_object_unref);
|
g_object_unref);
|
||||||
|
gdk_source_set_static_name_by_id (source_id, "[gtk] gdk_content_serializer_emit_callback");
|
||||||
/* NB: the idle will destroy our reference */
|
/* NB: the idle will destroy our reference */
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -876,7 +879,7 @@ file_text_serializer (GdkContentSerializer *serializer)
|
|||||||
g_string_append (str, path);
|
g_string_append (str, path);
|
||||||
g_free (path);
|
g_free (path);
|
||||||
if (l->next)
|
if (l->next)
|
||||||
g_string_append (str, " ");
|
g_string_append (str, "\n");
|
||||||
}
|
}
|
||||||
path = g_string_free (str, FALSE);
|
path = g_string_free (str, FALSE);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include "gdkcursor.h"
|
#include "gdkcursor.h"
|
||||||
#include "gdkcursorprivate.h"
|
#include "gdkcursorprivate.h"
|
||||||
#include "gdktexture.h"
|
#include "gdktexture.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|||||||
@@ -64,6 +64,7 @@ int gdk_cursor_get_hotspot_x (GdkCursor *cursor);
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
int gdk_cursor_get_hotspot_y (GdkCursor *cursor);
|
int gdk_cursor_get_hotspot_y (GdkCursor *cursor);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkCursor, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
|
|
||||||
#include "gdktypes.h"
|
#include "gdktypes.h"
|
||||||
|
#include <glib/gstdio.h>
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
@@ -40,8 +41,6 @@ typedef enum {
|
|||||||
GDK_DEBUG_NOGRABS = 1 << 11,
|
GDK_DEBUG_NOGRABS = 1 << 11,
|
||||||
GDK_DEBUG_PORTALS = 1 << 12,
|
GDK_DEBUG_PORTALS = 1 << 12,
|
||||||
GDK_DEBUG_GL_DISABLE = 1 << 13,
|
GDK_DEBUG_GL_DISABLE = 1 << 13,
|
||||||
GDK_DEBUG_GL_SOFTWARE = 1 << 14,
|
|
||||||
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 15,
|
|
||||||
GDK_DEBUG_GL_LEGACY = 1 << 16,
|
GDK_DEBUG_GL_LEGACY = 1 << 16,
|
||||||
GDK_DEBUG_GL_GLES = 1 << 17,
|
GDK_DEBUG_GL_GLES = 1 << 17,
|
||||||
GDK_DEBUG_GL_DEBUG = 1 << 18,
|
GDK_DEBUG_GL_DEBUG = 1 << 18,
|
||||||
@@ -60,22 +59,27 @@ GdkDebugFlags gdk_display_get_debug_flags (GdkDisplay *display);
|
|||||||
void gdk_display_set_debug_flags (GdkDisplay *display,
|
void gdk_display_set_debug_flags (GdkDisplay *display,
|
||||||
GdkDebugFlags flags);
|
GdkDebugFlags flags);
|
||||||
|
|
||||||
|
#define gdk_debug_message(format, ...) g_fprintf (stderr, format "\n", ##__VA_ARGS__)
|
||||||
|
|
||||||
#ifdef G_ENABLE_DEBUG
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
|
||||||
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
|
#define GDK_DISPLAY_DEBUG_CHECK(display,type) \
|
||||||
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
|
G_UNLIKELY (gdk_display_get_debug_flags (display) & GDK_DEBUG_##type)
|
||||||
#define GDK_DISPLAY_NOTE(display,type,action) G_STMT_START { \
|
|
||||||
|
#define GDK_DISPLAY_DEBUG(display,type,...) \
|
||||||
|
G_STMT_START { \
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
|
if (GDK_DISPLAY_DEBUG_CHECK (display,type)) \
|
||||||
{ action; }; } G_STMT_END
|
gdk_debug_message (__VA_ARGS__); \
|
||||||
|
} G_STMT_END
|
||||||
|
|
||||||
#else /* !G_ENABLE_DEBUG */
|
#else /* !G_ENABLE_DEBUG */
|
||||||
|
|
||||||
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
|
#define GDK_DISPLAY_DEBUG_CHECK(display,type) 0
|
||||||
#define GDK_DISPLAY_NOTE(display,type,action)
|
#define GDK_DISPLAY_DEBUG(display,type,...)
|
||||||
|
|
||||||
#endif /* G_ENABLE_DEBUG */
|
#endif /* G_ENABLE_DEBUG */
|
||||||
|
|
||||||
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
|
#define GDK_DEBUG_CHECK(type) GDK_DISPLAY_DEBUG_CHECK (NULL,type)
|
||||||
#define GDK_NOTE(type,action) GDK_DISPLAY_NOTE (NULL,type,action)
|
#define GDK_DEBUG(type,...) GDK_DISPLAY_DEBUG (NULL,type,__VA_ARGS__)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "gdkdeviceprivate.h"
|
#include "gdkdeviceprivate.h"
|
||||||
#include "gdkdevicetool.h"
|
#include "gdkdevicetool.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkkeysprivate.h"
|
#include "gdkkeysprivate.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -126,6 +126,9 @@ GdkSurface * gdk_device_get_surface_at_position (GdkDevice *device,
|
|||||||
|
|
||||||
GDK_AVAILABLE_IN_4_2
|
GDK_AVAILABLE_IN_4_2
|
||||||
guint32 gdk_device_get_timestamp (GdkDevice *device);
|
guint32 gdk_device_get_timestamp (GdkDevice *device);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDevice, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_DEVICE_H__ */
|
#endif /* __GDK_DEVICE_H__ */
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include "gdkdevicetoolprivate.h"
|
#include "gdkdevicetoolprivate.h"
|
||||||
#include "gdkenumtypes.h"
|
#include "gdkenumtypes.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkDeviceTool:
|
* GdkDeviceTool:
|
||||||
|
|||||||
@@ -24,8 +24,8 @@
|
|||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
|
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include "gdkapplaunchcontext.h"
|
#include "gdkapplaunchcontext.h"
|
||||||
#include "gdkclipboardprivate.h"
|
#include "gdkclipboardprivate.h"
|
||||||
@@ -1233,7 +1233,7 @@ gdk_display_init_gl (GdkDisplay *self)
|
|||||||
|
|
||||||
before = GDK_PROFILER_CURRENT_TIME;
|
before = GDK_PROFILER_CURRENT_TIME;
|
||||||
|
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (self, GL_DISABLE))
|
if (gdk_display_get_debug_flags (self) & GDK_DEBUG_GL_DISABLE)
|
||||||
{
|
{
|
||||||
g_set_error_literal (&priv->gl_error, GDK_GL_ERROR,
|
g_set_error_literal (&priv->gl_error, GDK_GL_ERROR,
|
||||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||||
@@ -1729,11 +1729,13 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
if (priv->egl_config_high_depth == NULL)
|
if (priv->egl_config_high_depth == NULL)
|
||||||
priv->egl_config_high_depth = priv->egl_config;
|
priv->egl_config_high_depth = priv->egl_config;
|
||||||
|
|
||||||
GDK_DISPLAY_NOTE (self, OPENGL, {
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
if (GDK_DISPLAY_DEBUG_CHECK (self, OPENGL))
|
||||||
|
{
|
||||||
char *ext = describe_extensions (priv->egl_display);
|
char *ext = describe_extensions (priv->egl_display);
|
||||||
char *std_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
|
char *std_cfg = describe_egl_config (priv->egl_display, priv->egl_config);
|
||||||
char *hd_cfg = describe_egl_config (priv->egl_display, priv->egl_config_high_depth);
|
char *hd_cfg = describe_egl_config (priv->egl_display, priv->egl_config_high_depth);
|
||||||
g_message ("EGL API version %d.%d found\n"
|
gdk_debug_message ("EGL API version %d.%d found\n"
|
||||||
" - Vendor: %s\n"
|
" - Vendor: %s\n"
|
||||||
" - Version: %s\n"
|
" - Version: %s\n"
|
||||||
" - Client APIs: %s\n"
|
" - Client APIs: %s\n"
|
||||||
@@ -1750,7 +1752,8 @@ gdk_display_init_egl (GdkDisplay *self,
|
|||||||
g_free (hd_cfg);
|
g_free (hd_cfg);
|
||||||
g_free (std_cfg);
|
g_free (std_cfg);
|
||||||
g_free (ext);
|
g_free (ext);
|
||||||
});
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
gdk_profiler_end_mark (start_time, "init EGL", NULL);
|
gdk_profiler_end_mark (start_time, "init EGL", NULL);
|
||||||
|
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ gboolean gdk_display_get_setting (GdkDisplay *display,
|
|||||||
const char *name,
|
const char *name,
|
||||||
GValue *value);
|
GValue *value);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplay, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include "gdkdisplaymanagerprivate.h"
|
#include "gdkdisplaymanagerprivate.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
#include "gdkkeysprivate.h"
|
#include "gdkkeysprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_X11
|
#ifdef GDK_WINDOWING_X11
|
||||||
#include "x11/gdkx.h"
|
#include "x11/gdkx.h"
|
||||||
@@ -420,7 +420,7 @@ gdk_display_manager_open_display (GdkDisplayManager *manager,
|
|||||||
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
|
(any && strstr (allowed_backends, gdk_backends[j].name)) ||
|
||||||
g_str_equal (backend, gdk_backends[j].name))
|
g_str_equal (backend, gdk_backends[j].name))
|
||||||
{
|
{
|
||||||
GDK_NOTE (MISC, g_message ("Trying %s backend", gdk_backends[j].name));
|
GDK_DEBUG (MISC, "Trying %s backend", gdk_backends[j].name);
|
||||||
display = gdk_backends[j].open_display (name);
|
display = gdk_backends[j].open_display (name);
|
||||||
if (display)
|
if (display)
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|
||||||
#define GDK_TYPE_DISPLAY_MANAGER (gdk_display_manager_get_type ())
|
#define GDK_TYPE_DISPLAY_MANAGER (gdk_display_manager_get_type ())
|
||||||
#define GDK_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManager))
|
#define GDK_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DISPLAY_MANAGER, GdkDisplayManager))
|
||||||
#define GDK_IS_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
|
#define GDK_IS_DISPLAY_MANAGER(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DISPLAY_MANAGER))
|
||||||
@@ -58,6 +57,7 @@ GdkDisplay * gdk_display_manager_open_display (GdkDisplayManager *m
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gdk_set_allowed_backends (const char *backends);
|
void gdk_set_allowed_backends (const char *backends);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDisplayManager, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "gdksurface.h"
|
#include "gdksurface.h"
|
||||||
#include "gdkcursor.h"
|
#include "gdkcursor.h"
|
||||||
#include "gdkmonitor.h"
|
#include "gdkmonitor.h"
|
||||||
#include "gdkdebug.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdksurfaceprivate.h"
|
#include "gdksurfaceprivate.h"
|
||||||
#include "gdkkeysprivate.h"
|
#include "gdkkeysprivate.h"
|
||||||
#include "gdkdeviceprivate.h"
|
#include "gdkdeviceprivate.h"
|
||||||
|
|||||||
@@ -42,7 +42,7 @@
|
|||||||
#include "gdkdragprivate.h"
|
#include "gdkdragprivate.h"
|
||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdksurface.h"
|
#include "gdksurface.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkcontentformats.h"
|
#include "gdkcontentformats.h"
|
||||||
#include "gdkcontentprovider.h"
|
#include "gdkcontentprovider.h"
|
||||||
#include "gdkcontentserializer.h"
|
#include "gdkcontentserializer.h"
|
||||||
|
|||||||
@@ -99,6 +99,8 @@ GdkContentProvider *
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GdkSurface * gdk_drag_get_surface (GdkDrag *drag);
|
GdkSurface * gdk_drag_get_surface (GdkDrag *drag);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrag, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_DND_H__ */
|
#endif /* __GDK_DND_H__ */
|
||||||
|
|||||||
@@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkdragsurfaceprivate.h"
|
#include "gdkdragsurfaceprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkDragSurface:
|
* GdkDragSurface:
|
||||||
|
|||||||
@@ -22,8 +22,8 @@
|
|||||||
|
|
||||||
#include "gdkdrawcontextprivate.h"
|
#include "gdkdrawcontextprivate.h"
|
||||||
|
|
||||||
#include "gdkdebug.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkprofilerprivate.h"
|
#include "gdkprofilerprivate.h"
|
||||||
#include "gdksurfaceprivate.h"
|
#include "gdksurfaceprivate.h"
|
||||||
|
|
||||||
@@ -364,7 +364,7 @@ gdk_draw_context_begin_frame_full (GdkDrawContext *context,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (priv->display, HIGH_DEPTH))
|
if (gdk_display_get_debug_flags (priv->display) & GDK_DEBUG_HIGH_DEPTH)
|
||||||
prefers_high_depth = TRUE;
|
prefers_high_depth = TRUE;
|
||||||
|
|
||||||
priv->frame_region = cairo_region_copy (region);
|
priv->frame_region = cairo_region_copy (region);
|
||||||
|
|||||||
@@ -52,6 +52,8 @@ gboolean gdk_draw_context_is_in_frame (GdkDrawContext
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
const cairo_region_t * gdk_draw_context_get_frame_region (GdkDrawContext *context);
|
const cairo_region_t * gdk_draw_context_get_frame_region (GdkDrawContext *context);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrawContext, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_DRAW_CONTEXT__ */
|
#endif /* __GDK_DRAW_CONTEXT__ */
|
||||||
|
|||||||
@@ -49,7 +49,7 @@
|
|||||||
#include "gdkdragprivate.h"
|
#include "gdkdragprivate.h"
|
||||||
#include "gdkenumtypes.h"
|
#include "gdkenumtypes.h"
|
||||||
#include "gdkeventsprivate.h"
|
#include "gdkeventsprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkpipeiostreamprivate.h"
|
#include "gdkpipeiostreamprivate.h"
|
||||||
#include "gdksurface.h"
|
#include "gdksurface.h"
|
||||||
|
|
||||||
|
|||||||
@@ -31,8 +31,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
|
|
||||||
|
|
||||||
#define GDK_TYPE_DROP (gdk_drop_get_type ())
|
#define GDK_TYPE_DROP (gdk_drop_get_type ())
|
||||||
#define GDK_DROP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DROP, GdkDrop))
|
#define GDK_DROP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_DROP, GdkDrop))
|
||||||
#define GDK_IS_DROP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DROP))
|
#define GDK_IS_DROP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_DROP))
|
||||||
@@ -85,6 +83,8 @@ const GValue * gdk_drop_read_value_finish (GdkDrop
|
|||||||
GAsyncResult *result,
|
GAsyncResult *result,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkDrop, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_DROP_H__ */
|
#endif /* __GDK_DROP_H__ */
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
/*** BEGIN file-header ***/
|
|
||||||
#include "config.h"
|
|
||||||
#include "gdk.h"
|
|
||||||
|
|
||||||
/*** END file-header ***/
|
|
||||||
|
|
||||||
/*** BEGIN file-production ***/
|
|
||||||
/* enumerations from "@basename@" */
|
|
||||||
/*** END file-production ***/
|
|
||||||
|
|
||||||
/*** BEGIN value-header ***/
|
|
||||||
GType
|
|
||||||
@enum_name@_get_type (void)
|
|
||||||
{
|
|
||||||
static gsize g_define_type_id__volatile = 0;
|
|
||||||
|
|
||||||
if (g_once_init_enter (&g_define_type_id__volatile))
|
|
||||||
{
|
|
||||||
static const G@Type@Value values[] = {
|
|
||||||
/*** END value-header ***/
|
|
||||||
|
|
||||||
/*** BEGIN value-production ***/
|
|
||||||
{ @VALUENAME@, "@VALUENAME@", "@valuenick@" },
|
|
||||||
/*** END value-production ***/
|
|
||||||
|
|
||||||
/*** BEGIN value-tail ***/
|
|
||||||
{ 0, NULL, NULL }
|
|
||||||
};
|
|
||||||
GType g_define_type_id =
|
|
||||||
g_@type@_register_static (g_intern_static_string ("@EnumName@"), values);
|
|
||||||
g_once_init_leave (&g_define_type_id__volatile, g_define_type_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
return g_define_type_id__volatile;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*** END value-tail ***/
|
|
||||||
|
|
||||||
/*** BEGIN file-tail ***/
|
|
||||||
/**/
|
|
||||||
/*** END file-tail ***/
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
/*** BEGIN file-header ***/
|
|
||||||
#ifndef __GDK_ENUM_TYPES_H__
|
|
||||||
#define __GDK_ENUM_TYPES_H__
|
|
||||||
|
|
||||||
#if !defined (__GDK_H_INSIDE__) && !defined (GTK_COMPILATION)
|
|
||||||
#error "Only <gdk/gdk.h> can be included directly."
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <glib-object.h>
|
|
||||||
#include <gdk/gdkversionmacros.h>
|
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
|
||||||
/*** END file-header ***/
|
|
||||||
|
|
||||||
/*** BEGIN file-production ***/
|
|
||||||
|
|
||||||
/* enumerations from "@basename@" */
|
|
||||||
/*** END file-production ***/
|
|
||||||
|
|
||||||
/*** BEGIN value-header ***/
|
|
||||||
GDK_AVAILABLE_IN_ALL GType @enum_name@_get_type (void) G_GNUC_CONST;
|
|
||||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
|
||||||
/*** END value-header ***/
|
|
||||||
|
|
||||||
/*** BEGIN file-tail ***/
|
|
||||||
G_END_DECLS
|
|
||||||
|
|
||||||
#endif /* __GDK_ENUM_TYPES_H__ */
|
|
||||||
/*** END file-tail ***/
|
|
||||||
@@ -28,10 +28,10 @@
|
|||||||
#include "gdkdragprivate.h"
|
#include "gdkdragprivate.h"
|
||||||
#include "gdkdropprivate.h"
|
#include "gdkdropprivate.h"
|
||||||
#include "gdkeventsprivate.h"
|
#include "gdkeventsprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkkeysprivate.h"
|
#include "gdkkeysprivate.h"
|
||||||
#include "gdkkeysyms.h"
|
#include "gdkkeysyms.h"
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#include <gobject/gvaluecollector.h>
|
#include <gobject/gvaluecollector.h>
|
||||||
|
|
||||||
@@ -402,12 +402,15 @@ gdk_event_alloc (GdkEventType event_type,
|
|||||||
|
|
||||||
GdkEvent *event = (GdkEvent *) g_type_create_instance (gdk_event_types[event_type]);
|
GdkEvent *event = (GdkEvent *) g_type_create_instance (gdk_event_types[event_type]);
|
||||||
|
|
||||||
GDK_NOTE (EVENTS, {
|
#ifdef G_ENABLE_DEBUG
|
||||||
|
if (GDK_DEBUG_CHECK (EVENTS))
|
||||||
|
{
|
||||||
char *str = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event_type);
|
char *str = g_enum_to_string (GDK_TYPE_EVENT_TYPE, event_type);
|
||||||
g_message ("Allocating a new %s for event type %s",
|
gdk_debug_message ("Allocating a new %s for event type %s",
|
||||||
g_type_name (gdk_event_types[event_type]), str);
|
g_type_name (gdk_event_types[event_type]), str);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
});
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
event->event_type = event_type;
|
event->event_type = event_type;
|
||||||
event->surface = surface != NULL ? g_object_ref (surface) : NULL;
|
event->surface = surface != NULL ? g_object_ref (surface) : NULL;
|
||||||
@@ -1514,6 +1517,16 @@ gdk_button_event_get_button (GdkEvent *event)
|
|||||||
* An event related to a key-based device.
|
* An event related to a key-based device.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
static void
|
||||||
|
gdk_key_event_finalize (GdkEvent *event)
|
||||||
|
{
|
||||||
|
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||||
|
|
||||||
|
g_free (self->compose_sequence);
|
||||||
|
|
||||||
|
GDK_EVENT_SUPER (event)->finalize (event);
|
||||||
|
}
|
||||||
|
|
||||||
static GdkModifierType
|
static GdkModifierType
|
||||||
gdk_key_event_get_state (GdkEvent *event)
|
gdk_key_event_get_state (GdkEvent *event)
|
||||||
{
|
{
|
||||||
@@ -1525,7 +1538,7 @@ gdk_key_event_get_state (GdkEvent *event)
|
|||||||
static const GdkEventTypeInfo gdk_key_event_info = {
|
static const GdkEventTypeInfo gdk_key_event_info = {
|
||||||
sizeof (GdkKeyEvent),
|
sizeof (GdkKeyEvent),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
gdk_key_event_finalize,
|
||||||
gdk_key_event_get_state,
|
gdk_key_event_get_state,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
@@ -1549,6 +1562,10 @@ GDK_DEFINE_EVENT_TYPE (GdkKeyEvent, gdk_key_event,
|
|||||||
* @is_modifier: whether the event is a modifiers only event
|
* @is_modifier: whether the event is a modifiers only event
|
||||||
* @translated: the translated key data for the given @state
|
* @translated: the translated key data for the given @state
|
||||||
* @no_lock: the translated key data without the given @state
|
* @no_lock: the translated key data without the given @state
|
||||||
|
* @compose_sequence: (transfer none) (nullable):
|
||||||
|
* The compose sequence string, either partial or only the
|
||||||
|
* final composed string, if that can be determined at event
|
||||||
|
* creation time. Used by selected IM modules.
|
||||||
*
|
*
|
||||||
* Creates a new `GdkKeyEvent`.
|
* Creates a new `GdkKeyEvent`.
|
||||||
*
|
*
|
||||||
@@ -1563,7 +1580,8 @@ gdk_key_event_new (GdkEventType type,
|
|||||||
GdkModifierType state,
|
GdkModifierType state,
|
||||||
gboolean is_modifier,
|
gboolean is_modifier,
|
||||||
GdkTranslatedKey *translated,
|
GdkTranslatedKey *translated,
|
||||||
GdkTranslatedKey *no_lock)
|
GdkTranslatedKey *no_lock,
|
||||||
|
char *compose_sequence)
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (type == GDK_KEY_PRESS ||
|
g_return_val_if_fail (type == GDK_KEY_PRESS ||
|
||||||
type == GDK_KEY_RELEASE, NULL);
|
type == GDK_KEY_RELEASE, NULL);
|
||||||
@@ -1576,6 +1594,7 @@ gdk_key_event_new (GdkEventType type,
|
|||||||
self->key_is_modifier = is_modifier;
|
self->key_is_modifier = is_modifier;
|
||||||
self->translated[0] = *translated;
|
self->translated[0] = *translated;
|
||||||
self->translated[1] = *no_lock;
|
self->translated[1] = *no_lock;
|
||||||
|
self->compose_sequence = g_strdup (compose_sequence);
|
||||||
|
|
||||||
return event;
|
return event;
|
||||||
}
|
}
|
||||||
@@ -1606,6 +1625,26 @@ gdk_key_event_get_translated_key (GdkEvent *event,
|
|||||||
return &(self->translated[0]);
|
return &(self->translated[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*< private >
|
||||||
|
* gdk_key_event_get_compose_sequence:
|
||||||
|
* @event: (type GdkKeyEvent): a key event
|
||||||
|
*
|
||||||
|
* Extracts the compose sequence string from a key event.
|
||||||
|
*
|
||||||
|
* Returns: (transfer none): the compose sequence string
|
||||||
|
*/
|
||||||
|
char *
|
||||||
|
gdk_key_event_get_compose_sequence (GdkEvent *event)
|
||||||
|
{
|
||||||
|
GdkKeyEvent *self = (GdkKeyEvent *) event;
|
||||||
|
|
||||||
|
g_return_val_if_fail (GDK_IS_EVENT (event), 0);
|
||||||
|
g_return_val_if_fail (GDK_IS_EVENT_TYPE (event, GDK_KEY_PRESS) ||
|
||||||
|
GDK_IS_EVENT_TYPE (event, GDK_KEY_RELEASE), FALSE);
|
||||||
|
|
||||||
|
return self->compose_sequence;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_key_event_get_keyval:
|
* gdk_key_event_get_keyval:
|
||||||
* @event: (type GdkKeyEvent): a key event
|
* @event: (type GdkKeyEvent): a key event
|
||||||
@@ -1773,7 +1812,7 @@ gdk_key_event_matches (GdkEvent *event,
|
|||||||
guint ev_keyval;
|
guint ev_keyval;
|
||||||
int layout;
|
int layout;
|
||||||
int level;
|
int level;
|
||||||
GdkModifierType consumed_modifiers;
|
GdkModifierType ignored_modifiers;
|
||||||
GdkModifierType shift_group_mask;
|
GdkModifierType shift_group_mask;
|
||||||
gboolean group_mod_is_accel_mod = FALSE;
|
gboolean group_mod_is_accel_mod = FALSE;
|
||||||
const GdkModifierType mask = GDK_CONTROL_MASK |
|
const GdkModifierType mask = GDK_CONTROL_MASK |
|
||||||
@@ -1792,7 +1831,23 @@ gdk_key_event_matches (GdkEvent *event,
|
|||||||
ev_keyval = self->translated[1].keyval;
|
ev_keyval = self->translated[1].keyval;
|
||||||
layout = self->translated[1].layout;
|
layout = self->translated[1].layout;
|
||||||
level = self->translated[1].level;
|
level = self->translated[1].level;
|
||||||
consumed_modifiers = self->translated[1].consumed;
|
|
||||||
|
/*
|
||||||
|
* If a modifier is currently active (e.g. Shift is pressed) and was marked
|
||||||
|
* as consumed, we ignore it for the purposes of matching shortcuts.
|
||||||
|
* For example, when Ctrl+Shift+[plus/equals key] is translated into
|
||||||
|
* Ctrl+plus on a keyboard where Shift+equals is the plus sign, we want
|
||||||
|
* shortcuts for either <Control><Shift>plus or <Control>plus to match.
|
||||||
|
* (See https://bugzilla.gnome.org/show_bug.cgi?id=100439)
|
||||||
|
*
|
||||||
|
* If a modifier is *not* currently active, the X11 backend can sometimes
|
||||||
|
* mark it as consumed where the Wayland and Windows backends do not.
|
||||||
|
* In this case, we still want to pay attention to its state.
|
||||||
|
* For example, when Ctrl+x is translated into Ctrl+x, we only want to
|
||||||
|
* trigger shortcuts for <Control>x, not for <Control><Shift>x.
|
||||||
|
* (See https://gitlab.gnome.org/GNOME/gtk/-/issues/5095)
|
||||||
|
*/
|
||||||
|
ignored_modifiers = (self->translated[1].consumed & state);
|
||||||
|
|
||||||
/* if the group-toggling modifier is part of the default accel mod
|
/* if the group-toggling modifier is part of the default accel mod
|
||||||
* mask, and it is active, disable it for matching
|
* mask, and it is active, disable it for matching
|
||||||
@@ -1804,7 +1859,7 @@ gdk_key_event_matches (GdkEvent *event,
|
|||||||
if (mask & shift_group_mask)
|
if (mask & shift_group_mask)
|
||||||
group_mod_is_accel_mod = TRUE;
|
group_mod_is_accel_mod = TRUE;
|
||||||
|
|
||||||
if ((modifiers & ~consumed_modifiers & mask) == (state & ~consumed_modifiers & mask))
|
if ((modifiers & ~ignored_modifiers & mask) == (state & ~ignored_modifiers & mask))
|
||||||
{
|
{
|
||||||
/* modifier match */
|
/* modifier match */
|
||||||
GdkKeymapKey *keys;
|
GdkKeymapKey *keys;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
|
||||||
#define GDK_TYPE_EVENT (gdk_event_get_type ())
|
#define GDK_TYPE_EVENT (gdk_event_get_type ())
|
||||||
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
|
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
|
||||||
|
|
||||||
@@ -551,6 +550,9 @@ gboolean gdk_key_event_get_match (GdkEvent *event,
|
|||||||
guint *keyval,
|
guint *keyval,
|
||||||
GdkModifierType *modifiers);
|
GdkModifierType *modifiers);
|
||||||
|
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkEvent, gdk_event_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_EVENTS_H__ */
|
#endif /* __GDK_EVENTS_H__ */
|
||||||
|
|||||||
@@ -259,6 +259,9 @@ typedef struct {
|
|||||||
* @keycode: the raw code of the key that was pressed or released.
|
* @keycode: the raw code of the key that was pressed or released.
|
||||||
* @translated: the result of translating @keycode. First with the full
|
* @translated: the result of translating @keycode. First with the full
|
||||||
* @state, then while ignoring Caps Lock.
|
* @state, then while ignoring Caps Lock.
|
||||||
|
* @compose_sequence: optional string for use by selected IM modules.
|
||||||
|
* Contains either partial compose sequences or the final composed
|
||||||
|
* string of the keystroke sequence.
|
||||||
*
|
*
|
||||||
* Describes a key press or key release event.
|
* Describes a key press or key release event.
|
||||||
*/
|
*/
|
||||||
@@ -270,6 +273,7 @@ struct _GdkKeyEvent
|
|||||||
guint32 keycode;
|
guint32 keycode;
|
||||||
gboolean key_is_modifier;
|
gboolean key_is_modifier;
|
||||||
GdkTranslatedKey translated[2];
|
GdkTranslatedKey translated[2];
|
||||||
|
char *compose_sequence;
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -470,7 +474,8 @@ GdkEvent * gdk_key_event_new (GdkEventType type,
|
|||||||
GdkModifierType modifiers,
|
GdkModifierType modifiers,
|
||||||
gboolean is_modifier,
|
gboolean is_modifier,
|
||||||
GdkTranslatedKey *translated,
|
GdkTranslatedKey *translated,
|
||||||
GdkTranslatedKey *no_lock);
|
GdkTranslatedKey *no_lock,
|
||||||
|
char *compose_sequence);
|
||||||
|
|
||||||
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
|
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
|
||||||
GdkDevice *device,
|
GdkDevice *device,
|
||||||
@@ -597,6 +602,8 @@ GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
|
|||||||
GdkTranslatedKey * gdk_key_event_get_translated_key (GdkEvent *event,
|
GdkTranslatedKey * gdk_key_event_get_translated_key (GdkEvent *event,
|
||||||
gboolean no_lock);
|
gboolean no_lock);
|
||||||
|
|
||||||
|
char * gdk_key_event_get_compose_sequence (GdkEvent *event);
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
/* Following flag is set for events on the event queue during
|
/* Following flag is set for events on the event queue during
|
||||||
@@ -626,7 +633,6 @@ void _gdk_event_queue_flush (GdkDisplay *display);
|
|||||||
|
|
||||||
double * gdk_event_dup_axes (GdkEvent *event);
|
double * gdk_event_dup_axes (GdkEvent *event);
|
||||||
|
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_EVENTS_PRIVATE_H__ */
|
#endif /* __GDK_EVENTS_PRIVATE_H__ */
|
||||||
|
|||||||
@@ -106,6 +106,8 @@ void gdk_frame_clock_get_refresh_info (GdkFrameClock *frame_clock,
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
double gdk_frame_clock_get_fps (GdkFrameClock *frame_clock);
|
double gdk_frame_clock_get_fps (GdkFrameClock *frame_clock);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameClock, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_FRAME_CLOCK_H__ */
|
#endif /* __GDK_FRAME_CLOCK_H__ */
|
||||||
|
|||||||
@@ -26,9 +26,9 @@
|
|||||||
|
|
||||||
#include "gdkframeclockidleprivate.h"
|
#include "gdkframeclockidleprivate.h"
|
||||||
|
|
||||||
#include "gdkdebug.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdkframeclockprivate.h"
|
#include "gdkframeclockprivate.h"
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkprofilerprivate.h"
|
#include "gdkprofilerprivate.h"
|
||||||
|
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
@@ -123,6 +123,7 @@ get_sleep_serial (void)
|
|||||||
{
|
{
|
||||||
sleep_source = g_source_new (&sleep_source_funcs, sizeof (GSource));
|
sleep_source = g_source_new (&sleep_source_funcs, sizeof (GSource));
|
||||||
|
|
||||||
|
g_source_set_static_name (sleep_source, "[gtk] sleep serial");
|
||||||
g_source_set_priority (sleep_source, G_PRIORITY_HIGH);
|
g_source_set_priority (sleep_source, G_PRIORITY_HIGH);
|
||||||
g_source_attach (sleep_source, NULL);
|
g_source_attach (sleep_source, NULL);
|
||||||
g_source_unref (sleep_source);
|
g_source_unref (sleep_source);
|
||||||
|
|||||||
@@ -51,6 +51,8 @@ gint64 gdk_frame_timings_get_refresh_interval (GdkFrameTimings *timin
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
gint64 gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings);
|
gint64 gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkFrameTimings, gdk_frame_timings_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_FRAME_TIMINGS_H__ */
|
#endif /* __GDK_FRAME_TIMINGS_H__ */
|
||||||
|
|||||||
@@ -76,14 +76,14 @@
|
|||||||
|
|
||||||
#include "gdkglcontextprivate.h"
|
#include "gdkglcontextprivate.h"
|
||||||
|
|
||||||
#include "gdkdebug.h"
|
#include "gdkdebugprivate.h"
|
||||||
#include "gdkdisplayprivate.h"
|
#include "gdkdisplayprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkmemoryformatprivate.h"
|
#include "gdkmemoryformatprivate.h"
|
||||||
#include "gdkmemorytextureprivate.h"
|
#include "gdkmemorytextureprivate.h"
|
||||||
#include "gdkprofilerprivate.h"
|
#include "gdkprofilerprivate.h"
|
||||||
|
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
#ifdef GDK_WINDOWING_WIN32
|
#ifdef GDK_WINDOWING_WIN32
|
||||||
# include "gdk/win32/gdkwin32.h"
|
# include "gdk/win32/gdkwin32.h"
|
||||||
@@ -193,7 +193,7 @@ gdk_gl_context_dispose (GObject *gobject)
|
|||||||
if (eglGetCurrentContext () == priv->egl_context)
|
if (eglGetCurrentContext () == priv->egl_context)
|
||||||
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
eglMakeCurrent(egl_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
|
||||||
|
|
||||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Destroying EGL context"));
|
GDK_DISPLAY_DEBUG (display, OPENGL, "Destroying EGL context");
|
||||||
|
|
||||||
eglDestroyContext (egl_display, priv->egl_context);
|
eglDestroyContext (egl_display, priv->egl_context);
|
||||||
priv->egl_context = NULL;
|
priv->egl_context = NULL;
|
||||||
@@ -339,13 +339,13 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
|
|||||||
context_attribs[i++] = EGL_NONE;
|
context_attribs[i++] = EGL_NONE;
|
||||||
g_assert (i < N_EGL_ATTRS);
|
g_assert (i < N_EGL_ATTRS);
|
||||||
|
|
||||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
GDK_DISPLAY_DEBUG (display, OPENGL,
|
||||||
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
|
"Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
|
||||||
major, minor,
|
major, minor,
|
||||||
debug_bit ? "yes" : "no",
|
debug_bit ? "yes" : "no",
|
||||||
forward_bit ? "yes" : "no",
|
forward_bit ? "yes" : "no",
|
||||||
legacy ? "yes" : "no",
|
legacy ? "yes" : "no",
|
||||||
api == GDK_GL_API_GLES ? "yes" : "no"));
|
api == GDK_GL_API_GLES ? "yes" : "no");
|
||||||
|
|
||||||
ctx = eglCreateContext (egl_display,
|
ctx = eglCreateContext (egl_display,
|
||||||
egl_config,
|
egl_config,
|
||||||
@@ -355,7 +355,7 @@ gdk_gl_context_create_egl_context (GdkGLContext *context,
|
|||||||
if (ctx == NULL)
|
if (ctx == NULL)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
|
GDK_DISPLAY_DEBUG (display, OPENGL, "Created EGL context[%p]", ctx);
|
||||||
|
|
||||||
priv->egl_context = ctx;
|
priv->egl_context = ctx;
|
||||||
gdk_gl_context_set_is_legacy (context, legacy);
|
gdk_gl_context_set_is_legacy (context, legacy);
|
||||||
@@ -395,8 +395,8 @@ gdk_gl_context_realize_egl (GdkGLContext *context,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
|
prefer_legacy = (gdk_display_get_debug_flags(display) & GDK_DEBUG_GL_LEGACY) ||
|
||||||
(share != NULL && gdk_gl_context_is_legacy (share)));
|
(share != NULL && gdk_gl_context_is_legacy (share));
|
||||||
|
|
||||||
if (preferred_api == GDK_GL_API_GL)
|
if (preferred_api == GDK_GL_API_GL)
|
||||||
{
|
{
|
||||||
@@ -1265,7 +1265,7 @@ gdk_gl_context_is_api_allowed (GdkGLContext *self,
|
|||||||
{
|
{
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (self);
|
||||||
|
|
||||||
if (GDK_DISPLAY_DEBUG_CHECK (gdk_gl_context_get_display (self), GL_GLES))
|
if (gdk_display_get_debug_flags (gdk_gl_context_get_display (self)) & GDK_DEBUG_GL_GLES)
|
||||||
{
|
{
|
||||||
if (!(api & GDK_GL_API_GLES))
|
if (!(api & GDK_GL_API_GLES))
|
||||||
{
|
{
|
||||||
@@ -1485,9 +1485,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
{
|
{
|
||||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||||
gboolean gl_debug = FALSE;
|
gboolean gl_debug = FALSE;
|
||||||
#ifdef G_ENABLE_DEBUG
|
|
||||||
GdkDisplay *display;
|
GdkDisplay *display;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!gdk_gl_context_is_realized (context))
|
if (!gdk_gl_context_is_realized (context))
|
||||||
return;
|
return;
|
||||||
@@ -1500,16 +1498,10 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
priv->has_debug_output = epoxy_has_gl_extension ("GL_ARB_debug_output") ||
|
priv->has_debug_output = epoxy_has_gl_extension ("GL_ARB_debug_output") ||
|
||||||
epoxy_has_gl_extension ("GL_KHR_debug");
|
epoxy_has_gl_extension ("GL_KHR_debug");
|
||||||
|
|
||||||
#ifdef G_ENABLE_DEBUG
|
|
||||||
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
|
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
|
||||||
gl_debug = GDK_DISPLAY_DEBUG_CHECK (display, GL_DEBUG);
|
gl_debug = (gdk_display_get_debug_flags (display) & GDK_DEBUG_GL_DEBUG) != 0;
|
||||||
#endif
|
|
||||||
|
|
||||||
if (priv->has_debug_output
|
if (priv->has_debug_output && gl_debug)
|
||||||
#ifndef G_ENABLE_CONSISTENCY_CHECKS
|
|
||||||
&& gl_debug
|
|
||||||
#endif
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
gdk_gl_context_make_current (context);
|
gdk_gl_context_make_current (context);
|
||||||
glEnable (GL_DEBUG_OUTPUT);
|
glEnable (GL_DEBUG_OUTPUT);
|
||||||
@@ -1541,8 +1533,8 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
priv->has_half_float = gdk_gl_context_check_version (context, 3, 0, 3, 0) ||
|
priv->has_half_float = gdk_gl_context_check_version (context, 3, 0, 3, 0) ||
|
||||||
epoxy_has_gl_extension ("OES_vertex_half_float");
|
epoxy_has_gl_extension ("OES_vertex_half_float");
|
||||||
|
|
||||||
GDK_DISPLAY_NOTE (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
|
GDK_DISPLAY_DEBUG (gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context)), OPENGL,
|
||||||
g_message ("%s version: %d.%d (%s)\n"
|
"%s version: %d.%d (%s)\n"
|
||||||
"* GLSL version: %s\n"
|
"* GLSL version: %s\n"
|
||||||
"* Extensions checked:\n"
|
"* Extensions checked:\n"
|
||||||
" - GL_KHR_debug: %s\n"
|
" - GL_KHR_debug: %s\n"
|
||||||
@@ -1554,7 +1546,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
|
|||||||
glGetString (GL_SHADING_LANGUAGE_VERSION),
|
glGetString (GL_SHADING_LANGUAGE_VERSION),
|
||||||
priv->has_khr_debug ? "yes" : "no",
|
priv->has_khr_debug ? "yes" : "no",
|
||||||
priv->has_unpack_subimage ? "yes" : "no",
|
priv->has_unpack_subimage ? "yes" : "no",
|
||||||
priv->has_half_float ? "yes" : "no"));
|
priv->has_half_float ? "yes" : "no");
|
||||||
|
|
||||||
priv->extensions_checked = TRUE;
|
priv->extensions_checked = TRUE;
|
||||||
}
|
}
|
||||||
@@ -1844,8 +1836,8 @@ gdk_gl_backend_use (GdkGLBackend backend_type)
|
|||||||
the_gl_backend_type = backend_type;
|
the_gl_backend_type = backend_type;
|
||||||
/* This is important!!!11eleven
|
/* This is important!!!11eleven
|
||||||
* (But really: How do I print a message in 2 categories?) */
|
* (But really: How do I print a message in 2 categories?) */
|
||||||
GDK_NOTE (OPENGL, g_print ("Using OpenGL backend %s\n", gl_backend_names[the_gl_backend_type]));
|
GDK_DEBUG (OPENGL, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
|
||||||
GDK_NOTE (MISC, g_message ("Using Opengl backend %s", gl_backend_names[the_gl_backend_type]));
|
GDK_DEBUG (MISC, "Using OpenGL backend %s", gl_backend_names[the_gl_backend_type]);
|
||||||
}
|
}
|
||||||
|
|
||||||
g_assert (the_gl_backend_type == backend_type);
|
g_assert (the_gl_backend_type == backend_type);
|
||||||
|
|||||||
@@ -114,6 +114,8 @@ GdkGLContext * gdk_gl_context_get_current (void);
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gdk_gl_context_clear_current (void);
|
void gdk_gl_context_clear_current (void);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLContext, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_GL_CONTEXT_H__ */
|
#endif /* __GDK_GL_CONTEXT_H__ */
|
||||||
|
|||||||
@@ -36,8 +36,6 @@ G_BEGIN_DECLS
|
|||||||
typedef struct _GdkGLTexture GdkGLTexture;
|
typedef struct _GdkGLTexture GdkGLTexture;
|
||||||
typedef struct _GdkGLTextureClass GdkGLTextureClass;
|
typedef struct _GdkGLTextureClass GdkGLTextureClass;
|
||||||
|
|
||||||
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
|
|
||||||
|
|
||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
GType gdk_gl_texture_get_type (void) G_GNUC_CONST;
|
GType gdk_gl_texture_get_type (void) G_GNUC_CONST;
|
||||||
|
|
||||||
@@ -52,6 +50,7 @@ GdkTexture * gdk_gl_texture_new (GdkGLContext
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
void gdk_gl_texture_release (GdkGLTexture *self);
|
void gdk_gl_texture_release (GdkGLTexture *self);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkGLTexture, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
/* GDK - The GIMP Drawing Kit
|
|
||||||
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
||||||
*
|
|
||||||
* 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/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
|
||||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
||||||
* files for a list of changes. These files are distributed with
|
|
||||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gdkkeysyms.h"
|
|
||||||
|
|
||||||
/* Key handling not part of the keymap */
|
|
||||||
|
|
||||||
#include "keyname-table.h"
|
|
||||||
|
|
||||||
#include <glib/gprintf.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#define GDK_NUM_KEYS G_N_ELEMENTS (gdk_keys_by_keyval)
|
|
||||||
|
|
||||||
static int
|
|
||||||
gdk_keys_keyval_compare (const void *pkey, const void *pbase)
|
|
||||||
{
|
|
||||||
return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
|
|
||||||
}
|
|
||||||
|
|
||||||
static char *
|
|
||||||
_gdk_keyval_name (guint keyval)
|
|
||||||
{
|
|
||||||
static char buf[100];
|
|
||||||
gdk_key *found;
|
|
||||||
|
|
||||||
/* Check for directly encoded 24-bit UCS characters: */
|
|
||||||
if ((keyval & 0xff000000) == 0x01000000)
|
|
||||||
{
|
|
||||||
g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
found = bsearch (&keyval, gdk_keys_by_keyval,
|
|
||||||
GDK_NUM_KEYS, sizeof (gdk_key),
|
|
||||||
gdk_keys_keyval_compare);
|
|
||||||
|
|
||||||
if (found != NULL)
|
|
||||||
{
|
|
||||||
while ((found > gdk_keys_by_keyval) &&
|
|
||||||
((found - 1)->keyval == keyval))
|
|
||||||
found--;
|
|
||||||
|
|
||||||
return (char *) (keynames + found->offset);
|
|
||||||
}
|
|
||||||
else if (keyval != 0)
|
|
||||||
{
|
|
||||||
g_sprintf (buf, "%#x", keyval);
|
|
||||||
return buf;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
|
||||||
gdk_keys_name_compare (const void *pkey, const void *pbase)
|
|
||||||
{
|
|
||||||
return strcmp ((const char *) pkey,
|
|
||||||
(const char *) (keynames + ((const gdk_key *) pbase)->offset));
|
|
||||||
}
|
|
||||||
|
|
||||||
static guint
|
|
||||||
_gdk_keyval_from_name (const char *keyval_name)
|
|
||||||
{
|
|
||||||
gdk_key *found;
|
|
||||||
|
|
||||||
g_return_val_if_fail (keyval_name != NULL, 0);
|
|
||||||
|
|
||||||
if (strncmp (keyval_name,"XF86", 4) == 0)
|
|
||||||
keyval_name += 4;
|
|
||||||
|
|
||||||
found = bsearch (keyval_name, gdk_keys_by_name,
|
|
||||||
GDK_NUM_KEYS, sizeof (gdk_key),
|
|
||||||
gdk_keys_name_compare);
|
|
||||||
if (found != NULL)
|
|
||||||
return found->keyval;
|
|
||||||
else
|
|
||||||
return GDK_KEY_VoidSymbol;
|
|
||||||
}
|
|
||||||
@@ -29,6 +29,11 @@
|
|||||||
#include "gdkdisplay.h"
|
#include "gdkdisplay.h"
|
||||||
#include "gdkdisplaymanagerprivate.h"
|
#include "gdkdisplaymanagerprivate.h"
|
||||||
|
|
||||||
|
#include "keynamesprivate.h"
|
||||||
|
#include <glib/gprintf.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
PROP_0,
|
PROP_0,
|
||||||
PROP_DISPLAY,
|
PROP_DISPLAY,
|
||||||
@@ -614,7 +619,73 @@ gdk_keymap_translate_keyboard_state (GdkKeymap *keymap,
|
|||||||
consumed_modifiers);
|
consumed_modifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "gdkkeynames.c"
|
static int
|
||||||
|
gdk_keys_keyval_compare (const void *pkey, const void *pbase)
|
||||||
|
{
|
||||||
|
return (*(int *) pkey) - ((gdk_key *) pbase)->keyval;
|
||||||
|
}
|
||||||
|
|
||||||
|
static char *
|
||||||
|
_gdk_keyval_name (guint keyval)
|
||||||
|
{
|
||||||
|
static char buf[100];
|
||||||
|
gdk_key *found;
|
||||||
|
|
||||||
|
/* Check for directly encoded 24-bit UCS characters: */
|
||||||
|
if ((keyval & 0xff000000) == 0x01000000)
|
||||||
|
{
|
||||||
|
g_sprintf (buf, "U+%.04X", (keyval & 0x00ffffff));
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
found = bsearch (&keyval,
|
||||||
|
gdk_keys_by_keyval, G_N_ELEMENTS (gdk_keys_by_keyval),
|
||||||
|
sizeof (gdk_key),
|
||||||
|
gdk_keys_keyval_compare);
|
||||||
|
|
||||||
|
if (found != NULL)
|
||||||
|
{
|
||||||
|
while ((found > gdk_keys_by_keyval) &&
|
||||||
|
((found - 1)->keyval == keyval))
|
||||||
|
found--;
|
||||||
|
|
||||||
|
return (char *) (keynames + found->offset);
|
||||||
|
}
|
||||||
|
else if (keyval != 0)
|
||||||
|
{
|
||||||
|
g_sprintf (buf, "%#x", keyval);
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
gdk_keys_name_compare (const void *pkey, const void *pbase)
|
||||||
|
{
|
||||||
|
return strcmp ((const char *) pkey,
|
||||||
|
(const char *) (keynames + ((const gdk_key *) pbase)->offset));
|
||||||
|
}
|
||||||
|
|
||||||
|
static guint
|
||||||
|
_gdk_keyval_from_name (const char *keyval_name)
|
||||||
|
{
|
||||||
|
gdk_key *found;
|
||||||
|
|
||||||
|
g_return_val_if_fail (keyval_name != NULL, 0);
|
||||||
|
|
||||||
|
if (strncmp (keyval_name,"XF86", 4) == 0)
|
||||||
|
keyval_name += 4;
|
||||||
|
|
||||||
|
found = bsearch (keyval_name,
|
||||||
|
gdk_keys_by_name, G_N_ELEMENTS (gdk_keys_by_name),
|
||||||
|
sizeof (gdk_key),
|
||||||
|
gdk_keys_name_compare);
|
||||||
|
if (found != NULL)
|
||||||
|
return found->keyval;
|
||||||
|
else
|
||||||
|
return GDK_KEY_VoidSymbol;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gdk_keyval_name:
|
* gdk_keyval_name:
|
||||||
|
|||||||
@@ -87,6 +87,8 @@ GdkSubpixelLayout gdk_monitor_get_subpixel_layout (GdkMonitor *monitor);
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
gboolean gdk_monitor_is_valid (GdkMonitor *monitor);
|
gboolean gdk_monitor_is_valid (GdkMonitor *monitor);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkMonitor, g_object_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __GDK_MONITOR_H__ */
|
#endif /* __GDK_MONITOR_H__ */
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "gdkpaintable.h"
|
#include "gdkpaintable.h"
|
||||||
|
|
||||||
#include "gdksnapshotprivate.h"
|
#include "gdksnapshotprivate.h"
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
|
|
||||||
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
|
/* HACK: So we don't need to include any (not-yet-created) GSK or GTK headers */
|
||||||
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
|
void gtk_snapshot_push_debug (GdkSnapshot *snapshot,
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include "gdkpango.h"
|
#include "gdkpango.h"
|
||||||
|
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <pango/pangocairo.h>
|
#include <pango/pangocairo.h>
|
||||||
|
|||||||
@@ -19,8 +19,8 @@
|
|||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include "gdk-private.h"
|
#include "gdkprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
#include "gdkpopupprivate.h"
|
#include "gdkpopupprivate.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -146,6 +146,7 @@ void gdk_popup_layout_get_shadow_width (GdkPopupLayout
|
|||||||
int *top,
|
int *top,
|
||||||
int *bottom);
|
int *bottom);
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkPopupLayout, gdk_popup_layout_unref)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -69,6 +69,7 @@ gboolean gdk_rgba_parse (GdkRGBA *rgba,
|
|||||||
GDK_AVAILABLE_IN_ALL
|
GDK_AVAILABLE_IN_ALL
|
||||||
char * gdk_rgba_to_string (const GdkRGBA *rgba) G_GNUC_MALLOC;
|
char * gdk_rgba_to_string (const GdkRGBA *rgba) G_GNUC_MALLOC;
|
||||||
|
|
||||||
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkRGBA, gdk_rgba_free)
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include "gdkdevicetoolprivate.h"
|
#include "gdkdevicetoolprivate.h"
|
||||||
#include "gdkseatprivate.h"
|
#include "gdkseatprivate.h"
|
||||||
#include "gdkdeviceprivate.h"
|
#include "gdkdeviceprivate.h"
|
||||||
#include "gdkintl.h"
|
#include <glib/gi18n-lib.h>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GdkSeat:
|
* GdkSeat:
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user