Compare commits
490 Commits
css-style-
...
kill-popup
Author | SHA1 | Date | |
---|---|---|---|
|
0492ba73e2 | ||
|
9e70c5d141 | ||
|
15544815ab | ||
|
922f9df86f | ||
|
980934f82d | ||
|
c45ed9d76e | ||
|
b6cb1a6eb3 | ||
|
22a6aaf4c5 | ||
|
d303b5b0eb | ||
|
97ec29d3f5 | ||
|
eb2e0137fa | ||
|
0969d06925 | ||
|
c4111dad31 | ||
|
33c6032a10 | ||
|
9a631f2942 | ||
|
9332abfd5b | ||
|
883980c48c | ||
|
2e0af29839 | ||
|
cdee2ac173 | ||
|
a66ed7c461 | ||
|
09abb43628 | ||
|
de1543d4fa | ||
|
5ed3f8d98b | ||
|
affc7b58fa | ||
|
2b1e273c53 | ||
|
1a4d1f8994 | ||
|
adc7bf9f25 | ||
|
f4a8edf441 | ||
|
3dc6a07f5d | ||
|
2a0dfa9670 | ||
|
40852ea952 | ||
|
32a2a629dd | ||
|
35ac7de140 | ||
|
0d354d1dc4 | ||
|
cdd7e4c5ec | ||
|
47f2a6cafd | ||
|
313c399122 | ||
|
052d0f6e60 | ||
|
8f6cab6560 | ||
|
6203cecf97 | ||
|
6f9f18009c | ||
|
67610b1242 | ||
|
f0993fc881 | ||
|
75b130ed6b | ||
|
77d7c713d4 | ||
|
b0369fc300 | ||
|
16e38701b6 | ||
|
9d8ceb0cb2 | ||
|
c313a71c3a | ||
|
fb84fe7065 | ||
|
9be8f8cf43 | ||
|
14ecc9ec7e | ||
|
073e8dd987 | ||
|
6c6b3d0d11 | ||
|
2ab9be54fb | ||
|
11ab39617e | ||
|
7404c393f3 | ||
|
1b95cd27bc | ||
|
88e2a060f8 | ||
|
4247bf0fb6 | ||
|
f2da5e5617 | ||
|
f51ceb142b | ||
|
e1d85aeeb0 | ||
|
cc8506ca15 | ||
|
52c46e5c24 | ||
|
b12a6be9d9 | ||
|
d702c159d5 | ||
|
6e3dd6dd62 | ||
|
d9c59a7c8c | ||
|
324202a56c | ||
|
e3a67385f4 | ||
|
b4b00e2887 | ||
|
e134eef505 | ||
|
2890cd849f | ||
|
01d5ad2056 | ||
|
cc643df88b | ||
|
13eedf1a9f | ||
|
685fd3c33d | ||
|
8a1c51db1c | ||
|
6de85c0a68 | ||
|
c2dcd1bf94 | ||
|
6e0cf02494 | ||
|
36808e0c81 | ||
|
9062607d5f | ||
|
042a5736fa | ||
|
720e48ec51 | ||
|
9d0393d8e6 | ||
|
7b0b3d9547 | ||
|
bb71cdd722 | ||
|
2b425fa88a | ||
|
b99a4da939 | ||
|
c69595a3a9 | ||
|
76aba1f046 | ||
|
59028d7d0f | ||
|
0df542e494 | ||
|
47c44644b1 | ||
|
1806af1e83 | ||
|
b5dc03d940 | ||
|
c4dfacc404 | ||
|
c00896a090 | ||
|
5ace9ef4e8 | ||
|
a7d295254f | ||
|
62352dd1fc | ||
|
74b5bb12fb | ||
|
02ac7ff0aa | ||
|
c06a08d63a | ||
|
9e38a70c6b | ||
|
56f9cdd99d | ||
|
153e8a0c92 | ||
|
6ec546be02 | ||
|
dc6fe091b9 | ||
|
1f0438e7fe | ||
|
8fdb710c0f | ||
|
af98c46d04 | ||
|
7ac2982617 | ||
|
8561860aa1 | ||
|
37a9d0620d | ||
|
5e746d35b2 | ||
|
d711ca3a67 | ||
|
564a43cd3a | ||
|
17a5e9b2aa | ||
|
c0dcaccf4b | ||
|
11cd955591 | ||
|
0677bfeb7f | ||
|
b38eb6eab4 | ||
|
7d23b6dad5 | ||
|
e5e7dbf2a5 | ||
|
23211bcae8 | ||
|
59b935af38 | ||
|
d0f5ce41aa | ||
|
1698369d52 | ||
|
96a4bb446c | ||
|
ad0e901061 | ||
|
ba781eca74 | ||
|
8f1253ad26 | ||
|
e123fff545 | ||
|
904eecd1ed | ||
|
344ad65031 | ||
|
14b3b684ef | ||
|
9309153abc | ||
|
643417dc32 | ||
|
4a978dc8c4 | ||
|
bc4637fff6 | ||
|
eec219e6c7 | ||
|
a8db322be6 | ||
|
4dd780a96b | ||
|
4c22939dea | ||
|
a6c5466900 | ||
|
c789711652 | ||
|
7eb889c7aa | ||
|
49a6ad3dd1 | ||
|
ebc720bfdb | ||
|
24917ac353 | ||
|
9eeeb631ca | ||
|
07988fc17f | ||
|
4f79676b0b | ||
|
900ff743f1 | ||
|
810f55c006 | ||
|
fce37b137d | ||
|
998384aa08 | ||
|
327441fa3e | ||
|
b927609e21 | ||
|
688f8bf085 | ||
|
057f41532b | ||
|
ebc24d75af | ||
|
c1970009ff | ||
|
8f0fc24516 | ||
|
ba825dce29 | ||
|
c4b16f7424 | ||
|
cffff36436 | ||
|
7de5b391ab | ||
|
0e15032635 | ||
|
be2ba89900 | ||
|
a824be2bb9 | ||
|
348dcaa4a3 | ||
|
f240bcbbc4 | ||
|
621a427627 | ||
|
645f49cf2b | ||
|
01ba11fc71 | ||
|
f6b0e0e1c2 | ||
|
2f17ab3ce7 | ||
|
55b60f6da9 | ||
|
1f74695758 | ||
|
1ab70e2dfa | ||
|
3cbb3dc0f4 | ||
|
e3afb2fec8 | ||
|
d3857f8bd3 | ||
|
655711fef2 | ||
|
69fa15981c | ||
|
2a46d5960d | ||
|
b9b5cae6d2 | ||
|
3249756648 | ||
|
8ef9009bde | ||
|
093eac9441 | ||
|
93c6f2256f | ||
|
1151da5cf3 | ||
|
a6f9052cf1 | ||
|
a437162f6d | ||
|
9ecd448682 | ||
|
74cb1ca2f5 | ||
|
e94e703685 | ||
|
4cceba06bc | ||
|
ab84b17c1a | ||
|
7fd06cacbd | ||
|
b471158e38 | ||
|
8388791f87 | ||
|
cbb05a3eab | ||
|
4cfac3b91c | ||
|
17ddae5bf9 | ||
|
75ef8d8a50 | ||
|
47b8facca4 | ||
|
bf8fb2c1a5 | ||
|
b7ee2cbc28 | ||
|
b1d64a6b3a | ||
|
60095ade9b | ||
|
3a727eed7a | ||
|
64c6229f54 | ||
|
60be37d63a | ||
|
e044656d99 | ||
|
c0fef36692 | ||
|
a67bd7a04e | ||
|
e152d25ac0 | ||
|
b561eb8299 | ||
|
6150344195 | ||
|
24fede0225 | ||
|
e27413a9ed | ||
|
03317ec2ec | ||
|
1a671cfd63 | ||
|
24e28309fb | ||
|
44e153d8a8 | ||
|
d72301b3c1 | ||
|
e00030dff2 | ||
|
9cccb944ef | ||
|
1363cacb3a | ||
|
68dbb3f31a | ||
|
8a60f5dc78 | ||
|
3d9e622fda | ||
|
645af0917c | ||
|
c247e7680b | ||
|
1da23b0c21 | ||
|
de299bb6bf | ||
|
65cc8305c9 | ||
|
bdbafe63f9 | ||
|
2be29f982d | ||
|
79699cc20d | ||
|
c7ab02d38c | ||
|
e67f0bfcfd | ||
|
56dc99a9fb | ||
|
cf69b7d4c2 | ||
|
e45b668e04 | ||
|
769dae2c71 | ||
|
048effdc5a | ||
|
b916723baf | ||
|
2dba92fd0c | ||
|
a11b1bd08e | ||
|
bc682bef74 | ||
|
580384e962 | ||
|
18965eec83 | ||
|
145ccfe1c4 | ||
|
d01070d472 | ||
|
b3f5243aeb | ||
|
20aec5a744 | ||
|
4a2d539251 | ||
|
a772bf7517 | ||
|
57ecb2829a | ||
|
d45d604df1 | ||
|
6317fd3529 | ||
|
8282698201 | ||
|
fcc3c12919 | ||
|
7c73f2fb02 | ||
|
6ff9f2198d | ||
|
1c253f5dfa | ||
|
a0533923fb | ||
|
5c594fc46a | ||
|
b6e2699409 | ||
|
8788c76bd9 | ||
|
6865744034 | ||
|
de02769a2f | ||
|
d69f7fd63e | ||
|
adccd1391e | ||
|
b529f77827 | ||
|
021aaef824 | ||
|
c691399a80 | ||
|
2f369b6d7a | ||
|
8703c7b7ac | ||
|
e41e8072b1 | ||
|
d1bd1270c9 | ||
|
34cc68003c | ||
|
ac7dd02f8f | ||
|
9746b728ca | ||
|
0ad791277a | ||
|
54f6515005 | ||
|
25c25ba5c1 | ||
|
fac435ba98 | ||
|
b996b85504 | ||
|
1cb575a138 | ||
|
9a446f2041 | ||
|
9e6ae7acd8 | ||
|
955305a034 | ||
|
b1d5de78e1 | ||
|
47c21a255f | ||
|
005ea7a09d | ||
|
ed6c0dc15c | ||
|
1e6171a4a7 | ||
|
85ad943832 | ||
|
b7b251019e | ||
|
ed742f1d6c | ||
|
fcb08a28bf | ||
|
b75d408d6d | ||
|
98b42f6740 | ||
|
416182a20d | ||
|
31713ab5ef | ||
|
b9c880f58d | ||
|
db9730b734 | ||
|
546a748cd8 | ||
|
8722837e67 | ||
|
3177ac4270 | ||
|
3f7e409428 | ||
|
903af75fa1 | ||
|
6640881711 | ||
|
3bb8b56ab3 | ||
|
a1635719fc | ||
|
3cb150abbe | ||
|
cc22987b1b | ||
|
410541f82b | ||
|
c91be540c3 | ||
|
138de60ab2 | ||
|
571021cbc1 | ||
|
f7a5dd7b8b | ||
|
544cd1acfc | ||
|
4b96ba592f | ||
|
7e8d8218b9 | ||
|
3bba52ed67 | ||
|
48b9791989 | ||
|
4c3363b8c2 | ||
|
10023b5d6d | ||
|
bbbe39fb44 | ||
|
b713b9f68d | ||
|
bfebc2b01a | ||
|
a1856c30d9 | ||
|
008eb04125 | ||
|
85e59220a5 | ||
|
b8ffe5b245 | ||
|
4685fe1716 | ||
|
046de4ccbf | ||
|
a3be0ec5f0 | ||
|
ef7172dc1e | ||
|
308d434b57 | ||
|
e4170661b9 | ||
|
0a8d7603ea | ||
|
f8d3845b1a | ||
|
4ab12ab755 | ||
|
69ed4c90e5 | ||
|
f2915180a6 | ||
|
e7f2833703 | ||
|
66af531ff3 | ||
|
621120d1d3 | ||
|
f84fdfc0c1 | ||
|
27223f7956 | ||
|
5faf977f66 | ||
|
7fbb37a09f | ||
|
7027fc9ab6 | ||
|
7479564972 | ||
|
09612a1b3c | ||
|
79c8a16b8d | ||
|
6104c12392 | ||
|
0c5ba00d59 | ||
|
9f55377b69 | ||
|
f140b151e1 | ||
|
c91c4b60e7 | ||
|
a46f9af1c0 | ||
|
4071e1e734 | ||
|
99c89d61e1 | ||
|
09ef67afbc | ||
|
d478ae1ef5 | ||
|
b67d582230 | ||
|
498ab6ac6c | ||
|
c69327caa8 | ||
|
d1cd578d59 | ||
|
5f8c2b52c6 | ||
|
27799ba4f5 | ||
|
2ec51b7010 | ||
|
f7cd2a782b | ||
|
ff0642bba6 | ||
|
b227a2f190 | ||
|
2b202129bb | ||
|
d1c6d78ebb | ||
|
6a8001fe7d | ||
|
ff3e022182 | ||
|
d2f26b2f27 | ||
|
55db9d07c5 | ||
|
1be932279c | ||
|
56ec748824 | ||
|
1e6a82513b | ||
|
b087f9ca51 | ||
|
e2f778602b | ||
|
6a15e9169d | ||
|
929d325560 | ||
|
cb60c1b83d | ||
|
ab69d43089 | ||
|
6af4b6a644 | ||
|
0d666f0cec | ||
|
317b395f0f | ||
|
71b3b54215 | ||
|
97b24b0732 | ||
|
6ffb54f47f | ||
|
afa6cc2369 | ||
|
dbe021239f | ||
|
884e06ad37 | ||
|
53c542765f | ||
|
c42977af04 | ||
|
aefd8443de | ||
|
b96ab7453b | ||
|
3ac7e30455 | ||
|
aef67bd53a | ||
|
bba5de7c6d | ||
|
556a8a8351 | ||
|
5e95e15a03 | ||
|
248883089c | ||
|
aabb250741 | ||
|
83cccfc984 | ||
|
b97054fc38 | ||
|
b859407620 | ||
|
75c73ac3cd | ||
|
10e4c04e61 | ||
|
b378f566d7 | ||
|
5776d0dd99 | ||
|
59994bdd22 | ||
|
db8276f470 | ||
|
c3421cea25 | ||
|
6830845fda | ||
|
db5d9ccdfb | ||
|
51e155bffa | ||
|
98e6e0cf77 | ||
|
058f82d03d | ||
|
a7b34df6af | ||
|
b3f454ed98 | ||
|
fd021e794c | ||
|
5e3cbff8d2 | ||
|
f0fe2e0743 | ||
|
c6158f1684 | ||
|
65050a1c81 | ||
|
12ec090a7b | ||
|
17ca95a161 | ||
|
5be14577d6 | ||
|
1a9ab1a32f | ||
|
c7dca199ae | ||
|
50a3d9be6a | ||
|
5e4b102273 | ||
|
632fab0ca7 | ||
|
43339f1c1c | ||
|
afbff574f5 | ||
|
aff25212df | ||
|
18cb15a05a | ||
|
6c8b65baf9 | ||
|
495eaf31d4 | ||
|
ccdc3ee406 | ||
|
93cf76b068 | ||
|
170130f1d9 | ||
|
6aac56e144 | ||
|
2d5a8974b3 | ||
|
146b921246 | ||
|
8b93ea9238 | ||
|
aa7c5e96a6 | ||
|
1953bc92bc | ||
|
98eeee5bce | ||
|
49b47c9133 | ||
|
af6128b3ab | ||
|
496f3c17bd | ||
|
c2d69643a8 | ||
|
9c6669be48 | ||
|
d0aa79b5a1 | ||
|
4b63523b1f | ||
|
997186f640 | ||
|
3940482820 | ||
|
616a83fb53 | ||
|
baeadea342 | ||
|
04beedfef0 | ||
|
da73394abd | ||
|
d0f69794a5 | ||
|
185ef214fa | ||
|
5040d81e03 | ||
|
f15a34c7e4 | ||
|
b36258f204 | ||
|
e75bc172ef | ||
|
4b2e4f6628 | ||
|
26febcc3a8 | ||
|
5dd7f20dab | ||
|
fc15a409cc | ||
|
4b96e7fc78 |
11
.clang-format
Normal file
11
.clang-format
Normal file
@@ -0,0 +1,11 @@
|
||||
# See https://wiki.apertis.org/Guidelines/Coding_conventions#Code_formatting
|
||||
BasedOnStyle: GNU
|
||||
AlwaysBreakAfterDefinitionReturnType: All
|
||||
BreakBeforeBinaryOperators: None
|
||||
BinPackParameters: false
|
||||
SpaceAfterCStyleCast: true
|
||||
# Our column limit is actually 80, but setting that results in clang-format
|
||||
# making a lot of dubious hanging-indent choices; disable it and assume the
|
||||
# developer will line wrap appropriately. clang-format will still check
|
||||
# existing hanging indents.
|
||||
ColumnLimit: 0
|
108
.gitlab-ci.yml
108
.gitlab-ci.yml
@@ -1,7 +1,8 @@
|
||||
stages:
|
||||
- style-check
|
||||
- build
|
||||
- deploy
|
||||
- flatpak
|
||||
# - deploy
|
||||
|
||||
.cache-paths: &cache-paths
|
||||
paths:
|
||||
@@ -12,16 +13,45 @@ stages:
|
||||
- subprojects/libepoxy/
|
||||
- subprojects/pango/
|
||||
|
||||
fedora-x86_64: &fedora-x86_64-defaults
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/master:v9
|
||||
stage: build
|
||||
# Common variables
|
||||
variables:
|
||||
COMMON_MESON_FLAGS: "--fatal-meson-warnings --werror"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 2
|
||||
|
||||
.only-default:
|
||||
only:
|
||||
- branches
|
||||
except:
|
||||
- tags
|
||||
|
||||
style-check-diff:
|
||||
extends: .only-default
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13
|
||||
stage: style-check
|
||||
allow_failure: true
|
||||
script:
|
||||
- bash -x ./.gitlab-ci/test-docker.sh
|
||||
- .gitlab-ci/run-style-check-diff.sh
|
||||
|
||||
fedora-x86_64:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=true
|
||||
-Dwayland-backend=true
|
||||
-Dbroadway-backend=true
|
||||
-Dvulkan=yes
|
||||
-Dprofiler=true
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
@@ -34,10 +64,36 @@ fedora-x86_64: &fedora-x86_64-defaults
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
|
||||
fedora-x86_64-staticlibs:
|
||||
release-build:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "-Ddefault_library=both"
|
||||
<<: *fedora-x86_64-defaults
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} ${EXTRA_MESON_FLAGS}
|
||||
-Dx11-backend=true
|
||||
-Dwayland-backend=true
|
||||
-Dbroadway-backend=true
|
||||
-Dvulkan=yes
|
||||
_build
|
||||
- ninja -C _build
|
||||
- .gitlab-ci/run-tests.sh _build
|
||||
artifacts:
|
||||
when: always
|
||||
reports:
|
||||
junit:
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
name: "gtk-${CI_COMMIT_REF_NAME}"
|
||||
paths:
|
||||
- "${CI_PROJECT_DIR}/_build/meson-logs"
|
||||
- "${CI_PROJECT_DIR}/_build/report.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report.html"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*.syscap"
|
||||
cache:
|
||||
key: "$CI_JOB_NAME"
|
||||
<<: *cache-paths
|
||||
|
||||
.mingw-defaults: &mingw-defaults
|
||||
stage: build
|
||||
@@ -59,6 +115,7 @@ msys2-mingw32:
|
||||
.flatpak-defaults: &flatpak-defaults
|
||||
image: registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master
|
||||
stage: flatpak
|
||||
allow_failure: true
|
||||
artifacts:
|
||||
paths:
|
||||
- "${APPID}-dev.flatpak"
|
||||
@@ -107,19 +164,20 @@ flatpak-master:icon-browser:
|
||||
APPID: org.gtk.IconBrowser4
|
||||
<<: *flatpak-master
|
||||
|
||||
#pages:
|
||||
# image: registry.gitlab.gnome.org/gnome/gtk/master:v6
|
||||
# stage: deploy
|
||||
# script:
|
||||
# - meson -Dgtk_doc=true _build .
|
||||
# - ninja -C _build
|
||||
# - ninja -C _build gdk4-doc gsk4-doc gtk4-doc
|
||||
# - mkdir -p public/
|
||||
# - mv _build/docs/reference/gtk/html/ public/gtk/
|
||||
# - mv _build/docs/reference/gdk/html/ public/gdk/
|
||||
# - mv _build/docs/reference/gsk/html/ public/gsk/
|
||||
# artifacts:
|
||||
# paths:
|
||||
# - public
|
||||
# only:
|
||||
# - master
|
||||
pages:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v13
|
||||
stage: deploy
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
script:
|
||||
- meson ${COMMON_MESON_FLAGS} -Dgtk_doc=true _build
|
||||
- ninja -C _build gdk4-doc gsk4-doc gtk4-doc
|
||||
- mkdir -p public/
|
||||
- mv _build/docs/reference/gdk/html/ public/gdk/
|
||||
- mv _build/docs/reference/gsk/html/ public/gsk/
|
||||
- mv _build/docs/reference/gtk/html/ public/gtk/
|
||||
artifacts:
|
||||
paths:
|
||||
- public
|
||||
only:
|
||||
- master
|
||||
|
38
.gitlab-ci/README.md
Normal file
38
.gitlab-ci/README.md
Normal file
@@ -0,0 +1,38 @@
|
||||
## GTK CI infrastructure
|
||||
|
||||
GTK uses different CI images depending on platform and jobs.
|
||||
|
||||
The CI images are Docker containers, generated either using `docker` or
|
||||
`podman`, and pushed to the GitLab [container registry][registry].
|
||||
|
||||
Each Docker image has a tag composed of two parts:
|
||||
|
||||
- `${image}`: the base image for a given platform, like "fedora" or
|
||||
"debian-stable"
|
||||
- `${number}`: an incremental version number, or `latest`
|
||||
|
||||
See the [container registry][registry] for the available images for each
|
||||
branch, as well as their available versions.
|
||||
|
||||
### Checklist for Updating a CI image
|
||||
|
||||
- [ ] Update the `${image}.Dockerfile` file with the dependencies
|
||||
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
|
||||
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
|
||||
once the Docker image is built; you may need to log in by using
|
||||
`docker login` or `podman login`
|
||||
- [ ] Update the `image` keys in the `.gitlab-ci.yml` file with the new
|
||||
image tag
|
||||
- [ ] Open a merge request with your changes and let it run
|
||||
|
||||
### Checklist for Adding a new CI image
|
||||
|
||||
- [ ] Write a new `${image}.Dockerfile` with the instructions to set up
|
||||
a build environment
|
||||
- [ ] Add the `pip3 install meson` incantation
|
||||
- [ ] Run `./run-docker.sh build --base ${image} --base-version ${number}`
|
||||
- [ ] Run `./run-docker.sh push --base ${image} --base-version ${number}`
|
||||
- [ ] Add the new job to `.gitlab-ci.yml` referencing the image
|
||||
- [ ] Open a merge request with your changes and let it run
|
||||
|
||||
[registry]: https://gitlab.gnome.org/GNOME/gtk/container_registry
|
133
.gitlab-ci/clang-format-diff.py
Executable file
133
.gitlab-ci/clang-format-diff.py
Executable file
@@ -0,0 +1,133 @@
|
||||
#!/usr/bin/env python3
|
||||
#
|
||||
# === clang-format-diff.py - ClangFormat Diff Reformatter ---*- python -*-=== #
|
||||
#
|
||||
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
# See https://llvm.org/LICENSE.txt for license information.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
#
|
||||
# ===---------------------------------------------------------------------=== #
|
||||
|
||||
"""
|
||||
This script reads input from a unified diff and reformats all the changed
|
||||
lines. This is useful to reformat all the lines touched by a specific patch.
|
||||
Example usage for git/svn users:
|
||||
|
||||
git diff -U0 --no-color HEAD^ | clang-format-diff.py -p1 -i
|
||||
svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
|
||||
|
||||
"""
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
import argparse
|
||||
import difflib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
if sys.version_info.major >= 3:
|
||||
from io import StringIO
|
||||
else:
|
||||
from io import BytesIO as StringIO
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(
|
||||
description=__doc__,
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter)
|
||||
parser.add_argument('-i', action='store_true', default=False,
|
||||
help='apply edits to files instead of displaying a '
|
||||
'diff')
|
||||
parser.add_argument('-p', metavar='NUM', default=0,
|
||||
help='strip the smallest prefix containing P slashes')
|
||||
parser.add_argument('-regex', metavar='PATTERN', default=None,
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case sensitive, overrides -iregex)')
|
||||
parser.add_argument('-iregex', metavar='PATTERN',
|
||||
default=r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hh|hpp|m|mm|inc'
|
||||
r'|js|ts|proto|protodevel|java|cs)',
|
||||
help='custom pattern selecting file paths to reformat '
|
||||
'(case insensitive, overridden by -regex)')
|
||||
parser.add_argument('-sort-includes', action='store_true', default=False,
|
||||
help='let clang-format sort include blocks')
|
||||
parser.add_argument('-v', '--verbose', action='store_true',
|
||||
help='be more verbose, ineffective without -i')
|
||||
parser.add_argument('-style',
|
||||
help='formatting style to apply (LLVM, Google, '
|
||||
'Chromium, Mozilla, WebKit)')
|
||||
parser.add_argument('-binary', default='clang-format',
|
||||
help='location of binary to use for clang-format')
|
||||
args = parser.parse_args()
|
||||
|
||||
# Extract changed lines for each file.
|
||||
filename = None
|
||||
lines_by_file = {}
|
||||
for line in sys.stdin:
|
||||
match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
|
||||
if match:
|
||||
filename = match.group(2)
|
||||
if filename is None:
|
||||
continue
|
||||
|
||||
if args.regex is not None:
|
||||
if not re.match('^%s$' % args.regex, filename):
|
||||
continue
|
||||
else:
|
||||
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
|
||||
continue
|
||||
|
||||
match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line)
|
||||
if match:
|
||||
start_line = int(match.group(1))
|
||||
line_count = 1
|
||||
if match.group(3):
|
||||
line_count = int(match.group(3))
|
||||
if line_count == 0:
|
||||
continue
|
||||
end_line = start_line + line_count - 1
|
||||
lines_by_file.setdefault(filename, []).extend(
|
||||
['-lines', str(start_line) + ':' + str(end_line)])
|
||||
|
||||
# Reformat files containing changes in place.
|
||||
# We need to count amount of bytes generated in the output of
|
||||
# clang-format-diff. If clang-format-diff doesn't generate any bytes it
|
||||
# means there is nothing to format.
|
||||
format_line_counter = 0
|
||||
for filename, lines in lines_by_file.items():
|
||||
if args.i and args.verbose:
|
||||
print('Formatting {}'.format(filename))
|
||||
command = [args.binary, filename]
|
||||
if args.i:
|
||||
command.append('-i')
|
||||
if args.sort_includes:
|
||||
command.append('-sort-includes')
|
||||
command.extend(lines)
|
||||
if args.style:
|
||||
command.extend(['-style', args.style])
|
||||
p = subprocess.Popen(command,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=None,
|
||||
stdin=subprocess.PIPE,
|
||||
universal_newlines=True)
|
||||
stdout, _ = p.communicate()
|
||||
if p.returncode != 0:
|
||||
sys.exit(p.returncode)
|
||||
|
||||
if not args.i:
|
||||
with open(filename) as f:
|
||||
code = f.readlines()
|
||||
formatted_code = StringIO(stdout).readlines()
|
||||
diff = difflib.unified_diff(code, formatted_code,
|
||||
filename, filename,
|
||||
'(before formatting)',
|
||||
'(after formatting)')
|
||||
diff_string = ''.join(diff)
|
||||
if diff_string:
|
||||
format_line_counter += sys.stdout.write(diff_string)
|
||||
|
||||
if format_line_counter > 0:
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
@@ -8,6 +8,7 @@ RUN dnf -y install \
|
||||
cairo-devel \
|
||||
cairo-gobject-devel \
|
||||
ccache \
|
||||
clang \
|
||||
colord-devel \
|
||||
cups-devel \
|
||||
dbus-daemon \
|
||||
@@ -23,6 +24,7 @@ RUN dnf -y install \
|
||||
gettext \
|
||||
git \
|
||||
glib2-devel \
|
||||
glib2-static \
|
||||
glibc-devel \
|
||||
glibc-headers \
|
||||
gobject-introspection-devel \
|
||||
@@ -61,9 +63,11 @@ RUN dnf -y install \
|
||||
ninja-build \
|
||||
pango-devel \
|
||||
pcre-devel \
|
||||
pcre-static \
|
||||
python3 \
|
||||
python3-jinja2 \
|
||||
python3-pip \
|
||||
python3-pygments \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
@@ -76,7 +80,7 @@ RUN dnf -y install \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson==0.50.1
|
||||
RUN pip3 install meson==0.52.1
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
@@ -4,7 +4,7 @@ set -e
|
||||
|
||||
appid=$1
|
||||
|
||||
builddir=app
|
||||
builddir=flatpak_app
|
||||
repodir=repo
|
||||
|
||||
flatpak-builder \
|
||||
@@ -12,12 +12,10 @@ flatpak-builder \
|
||||
${builddir} \
|
||||
build-aux/flatpak/${appid}.json
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
meson \
|
||||
--prefix /app \
|
||||
--libdir /app/lib \
|
||||
--buildtype debug \
|
||||
flatpak build ${builddir} meson \
|
||||
--prefix=/app \
|
||||
--libdir=/app/lib \
|
||||
--buildtype=release \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dprint-backends=file \
|
||||
@@ -27,9 +25,7 @@ flatpak-builder \
|
||||
-Ddemos=true \
|
||||
_build .
|
||||
|
||||
flatpak-builder \
|
||||
--run ${builddir} build-aux/flatpak/${appid}.json \
|
||||
ninja -C _build install
|
||||
flatpak build ${builddir} ninja -C _build install
|
||||
|
||||
flatpak-builder \
|
||||
--finish-only \
|
||||
@@ -40,5 +36,5 @@ flatpak-builder \
|
||||
flatpak build-bundle \
|
||||
${repodir} \
|
||||
${appid}-dev.flatpak \
|
||||
--runtime-repo=https://flathub.org/repo/flathub.flatpakrepo \
|
||||
--runtime-repo=https://nightly.gnome.org/gnome-nightly.flatpakrepo \
|
||||
${appid}
|
||||
|
@@ -138,22 +138,25 @@ ul.images li {
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<h1>{{ report.project_name }} :: Test Reports</h1>
|
||||
<div class="report-meta">
|
||||
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
|
||||
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
|
||||
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
|
||||
</div>
|
||||
<h1>{{ report.project_name }}/{{ report.branch_name }} :: Test Reports</h1>
|
||||
</header>
|
||||
|
||||
<article>
|
||||
<section>
|
||||
<div class="report-meta">
|
||||
<p><strong>Branch:</strong> {{ report.branch_name }}</p>
|
||||
<p><strong>Date:</strong> <time datetime="{{ report.date.isoformat() }}">{{ report.locale_date }}</time></p>
|
||||
{% if report.job_id %}<p><strong>Job ID:</strong> {{ report.job_id }}</p>{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<div class="summary">
|
||||
<h3><a name="summary">Summary</a></h3>
|
||||
<ul>
|
||||
<li><strong>Total units:</strong> {{ report.total_units }}</li>
|
||||
<li><strong>Passed:</strong> <a href="#passed">{{ report.total_successes }}</a></li>
|
||||
<li><strong>Failed:</strong> <a href="#failures">{{ report.total_failures }}</a></li>
|
||||
<li><strong>Failed:</strong> {{ report.total_failures }}</li>
|
||||
<li><strong>Passed:</strong> {{ report.total_successes }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
@@ -164,54 +167,14 @@ ul.images li {
|
||||
<h3><a name="results">Suite: {{ suite_result.suite_name }}</a></h3>
|
||||
<ul>
|
||||
<li><strong>Units:</strong> {{ suite_result.n_units }}</li>
|
||||
<li><strong>Passed:</strong> {{ suite_result.n_successes }}</li>
|
||||
<li><strong>Failed:</strong> {{ suite_result.n_failures }}</li>
|
||||
<li><strong>Failed:</strong> <a href="#{{ suite_result.suite_name }}-failed">{{ suite_result.n_failures }}</a></li>
|
||||
<li><strong>Passed:</strong> <a href="#{{ suite_result.suite_name }}-passed">{{ suite_result.n_successes }}</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="successes">
|
||||
<h4><a name="passed">Passed</a></h4>
|
||||
<ul class="passed">
|
||||
{% for success in suite_result.successes if success.result == 'OK' %}
|
||||
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="skipped">Skipped</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'SKIP' %}
|
||||
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="expected-fail">Expected failures</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'EXPECTEDFAIL' %}
|
||||
<li><a name="{{ success.name }}">{{ success.name }}</a> - result: <span class="result xfail">{{ success.result }}</span><br/>
|
||||
{% if success.stdout %}
|
||||
Output: <pre>{{ success.stdout }}</pre>
|
||||
{% endif %}
|
||||
{% if success.image_data is defined %}
|
||||
<ul class="images">
|
||||
<li><img alt="ref" src="{{ success.image_data.ref }}" /></li>
|
||||
<li><img alt="out" src="{{ success.image_data.out }}" /></li>
|
||||
<li><img alt="diff" src="{{ success.image_data.diff }}" /></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="failures">
|
||||
<h4><a name="failed">Failed</a></h4>
|
||||
<h4><a name="{{ suite_result.suite_name }}-failed">Failures</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result == 'FAIL' %}
|
||||
{% for failure in suite_result.failures if failure.result in [ 'FAIL', 'UNEXPECTEDPASS' ] %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
{% if failure.stdout %}
|
||||
Output: <pre>{{ failure.stdout }}</pre>
|
||||
@@ -229,7 +192,7 @@ ul.images li {
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="timed-out">Timed out</a></h4>
|
||||
<h4><a name="{{ suite_result.suite_name }}-timed-out">Timed out</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result == 'TIMEOUT' %}
|
||||
<li><a name="{{ failure.name }}">{{ failure.name }}</a> - result: <span class="result fail">{{ failure.result }}</span><br/>
|
||||
@@ -243,6 +206,46 @@ ul.images li {
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="successes">
|
||||
<h4><a name="{{ suite_result.suite_name }}-skipped">Skipped</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'SKIP' %}
|
||||
<li>{{ success.name }} - result: <span class="result skip">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="{{ suite_result.suite_name }}-passed">Passed</a></h4>
|
||||
<ul class="passed">
|
||||
{% for success in suite_result.successes if success.result == 'OK' %}
|
||||
<li>{{ success.name }} - result: <span class="result pass">{{ success.result }}</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<h4><a name="{{ suite_result.suite_name }}-expected-fail">Expected failures</a></h4>
|
||||
<ul>
|
||||
{% for success in suite_result.successes if success.result == 'EXPECTEDFAIL' %}
|
||||
<li><a name="{{ success.name }}">{{ success.name }}</a> - result: <span class="result xfail">{{ success.result }}</span><br/>
|
||||
{% if success.stdout %}
|
||||
Output: <pre>{{ success.stdout }}</pre>
|
||||
{% endif %}
|
||||
{% if success.image_data is defined %}
|
||||
<ul class="images">
|
||||
<li><img alt="ref" src="{{ success.image_data.ref }}" /></li>
|
||||
<li><img alt="out" src="{{ success.image_data.out }}" /></li>
|
||||
<li><img alt="diff" src="{{ success.image_data.diff }}" /></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% else %}
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</section>
|
||||
{% endfor %}
|
||||
@@ -328,7 +331,7 @@ for name, units in suites.items():
|
||||
print('Processing {} suite {}:'.format(project_name, suite_name))
|
||||
|
||||
def if_failed(unit):
|
||||
if unit['result'] in ['FAIL', 'TIMEOUT']:
|
||||
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@@ -51,6 +51,7 @@ for line in args.infile:
|
||||
|
||||
duration = data['duration']
|
||||
return_code = data['returncode']
|
||||
result = data['result']
|
||||
log = data['stdout']
|
||||
|
||||
unit = {
|
||||
@@ -58,6 +59,7 @@ for line in args.infile:
|
||||
'name': unit_name,
|
||||
'duration': duration,
|
||||
'returncode': return_code,
|
||||
'result': result,
|
||||
'stdout': log,
|
||||
}
|
||||
|
||||
@@ -68,12 +70,12 @@ for name, units in suites.items():
|
||||
print('Processing suite {} (units: {})'.format(name, len(units)))
|
||||
|
||||
def if_failed(unit):
|
||||
if unit['returncode'] != 0:
|
||||
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
return True
|
||||
return False
|
||||
|
||||
def if_succeded(unit):
|
||||
if unit['returncode'] == 0:
|
||||
if unit['result'] in ['OK', 'EXPECTEDFAIL', 'SKIP']:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
@@ -1,11 +1,130 @@
|
||||
#!/bin/bash
|
||||
|
||||
read_arg() {
|
||||
# $1 = arg name
|
||||
# $2 = arg value
|
||||
# $3 = arg parameter
|
||||
local rematch='^[^=]*=(.*)$'
|
||||
if [[ $2 =~ $rematch ]]; then
|
||||
read "$1" <<< "${BASH_REMATCH[1]}"
|
||||
else
|
||||
read "$1" <<< "$3"
|
||||
# There is no way to shift our callers args, so
|
||||
# return 1 to indicate they should do it instead.
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
set -e
|
||||
|
||||
TAG="registry.gitlab.gnome.org/gnome/gtk/master:v7"
|
||||
build=0
|
||||
run=0
|
||||
push=0
|
||||
list=0
|
||||
print_help=0
|
||||
no_login=0
|
||||
|
||||
sudo docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
|
||||
--file "Dockerfile" .
|
||||
sudo docker run --rm --security-opt label=disable \
|
||||
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
|
||||
--tty --interactive "${TAG}" bash
|
||||
while (($# > 0)); do
|
||||
case "${1%%=*}" in
|
||||
build) build=1;;
|
||||
run) run=1;;
|
||||
push) push=1;;
|
||||
list) list=1;;
|
||||
help) print_help=1;;
|
||||
--base|-b) read_arg base "$@" || shift;;
|
||||
--base-version) read_arg base_version "$@" || shift;;
|
||||
--no-login) no_login=1;;
|
||||
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
if [ $print_help == 1 ]; then
|
||||
echo "$0 - Build and run Docker images"
|
||||
echo ""
|
||||
echo "Usage: $0 <command> [options] [basename]"
|
||||
echo ""
|
||||
echo "Available commands"
|
||||
echo ""
|
||||
echo " build --base=<BASENAME> - Build Docker image <BASENAME>.Dockerfile"
|
||||
echo " run --base=<BASENAME> - Run Docker image <BASENAME>"
|
||||
echo " push --base=<BASENAME> - Push Docker image <BASENAME> to the registry"
|
||||
echo " list - List available images"
|
||||
echo " help - This help message"
|
||||
echo ""
|
||||
exit 0
|
||||
fi
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
if [ $list == 1 ]; then
|
||||
echo "Available Docker images:"
|
||||
for f in *.Dockerfile; do
|
||||
filename=$( basename -- "$f" )
|
||||
basename="${filename%.*}"
|
||||
|
||||
echo -e " \e[1;39m$basename\e[0m"
|
||||
done
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# All commands after this require --base to be set
|
||||
if [ -z $base ]; then
|
||||
echo "Usage: $0 <command>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ ! -f "$base.Dockerfile" ]; then
|
||||
echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z $base_version ]; then
|
||||
base_version="latest"
|
||||
else
|
||||
base_version="v$base_version"
|
||||
fi
|
||||
|
||||
TAG="registry.gitlab.gnome.org/gnome/gtk/${base}:${base_version}"
|
||||
|
||||
if [ $build == 1 ]; then
|
||||
if docker --help |& grep -q podman; then
|
||||
# Docker is actually implemented by podman, and its OCI output
|
||||
# is incompatible with some of the dockerd instances on GitLab
|
||||
# CI runners.
|
||||
format="--format docker"
|
||||
else
|
||||
format=""
|
||||
fi
|
||||
|
||||
echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}"
|
||||
sudo docker build \
|
||||
${format} \
|
||||
--build-arg HOST_USER_ID="$UID" \
|
||||
--tag "${TAG}" \
|
||||
--file "${base}.Dockerfile" .
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $push == 1 ]; then
|
||||
echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}"
|
||||
|
||||
if [ $no_login == 0 ]; then
|
||||
sudo docker login registry.gitlab.gnome.org
|
||||
fi
|
||||
|
||||
sudo docker push $TAG
|
||||
exit $?
|
||||
fi
|
||||
|
||||
if [ $run == 1 ]; then
|
||||
echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}"
|
||||
sudo docker run \
|
||||
--rm \
|
||||
--volume "$(pwd)/..:/home/user/app" \
|
||||
--workdir "/home/user/app" \
|
||||
--tty \
|
||||
--interactive "${TAG}" \
|
||||
bash
|
||||
exit $?
|
||||
fi
|
||||
|
34
.gitlab-ci/run-style-check-diff.sh
Executable file
34
.gitlab-ci/run-style-check-diff.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +e
|
||||
|
||||
# We need to add a new remote for the upstream master, since this script could
|
||||
# be running in a personal fork of the repository which has out of date branches.
|
||||
git remote add upstream https://gitlab.gnome.org/GNOME/gtk.git
|
||||
git fetch upstream
|
||||
|
||||
# Work out the newest common ancestor between the detached HEAD that this CI job
|
||||
# has checked out, and the upstream target branch (which will typically be
|
||||
# `upstream/master` or `upstream/gtk-3-24`).
|
||||
#
|
||||
# `${CI_MERGE_REQUEST_TARGET_BRANCH_NAME}` is only defined if we’re running in
|
||||
# a merge request pipeline; fall back to `${CI_DEFAULT_BRANCH}` otherwise.
|
||||
newest_common_ancestor_sha=$(diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent upstream/${CI_MERGE_REQUEST_TARGET_BRANCH_NAME:-${CI_DEFAULT_BRANCH}}) <(git rev-list --first-parent HEAD) | head -1)
|
||||
git diff -U0 --no-color "${newest_common_ancestor_sha}" | .gitlab-ci/clang-format-diff.py -binary "clang-format" -p1
|
||||
|
||||
# The style check is not infallible. The clang-format configuration cannot
|
||||
# perfectly describe GTK’s coding style: in particular, it cannot align
|
||||
# function arguments. The documented coding style for GTK takes priority over
|
||||
# clang-format suggestions. Hopefully we can eventually improve clang-format to
|
||||
# be configurable enough for our coding style. That’s why this CI check is OK
|
||||
# to fail: the idea is that people can look through the output and ignore it if
|
||||
# it’s wrong. (That situation can also happen if someone touches pre-existing
|
||||
# badly formatted code and it doesn’t make sense to tidy up the wider coding
|
||||
# style with the changes they’re making.)
|
||||
echo ""
|
||||
echo "Note that clang-format output is advisory and cannot always match the"
|
||||
echo "GTK coding style, documented at:"
|
||||
echo " https://gitlab.gnome.org/GNOME/gtk/blob/master/docs/CODING-STYLE"
|
||||
echo "Warnings from this tool can be ignored in favour of the documented "
|
||||
echo "coding style, or in favour of matching the style of existing"
|
||||
echo "surrounding code."
|
34
.gitlab-ci/run-tests.sh
Executable file
34
.gitlab-ci/run-tests.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
|
||||
set +x
|
||||
set +e
|
||||
|
||||
srcdir=$( pwd )
|
||||
builddir=$1
|
||||
|
||||
export GDK_BACKEND=x11
|
||||
xvfb-run -a -s "-screen 0 1024x768x24" \
|
||||
meson test -C ${builddir} \
|
||||
--print-errorlogs \
|
||||
--suite=gtk \
|
||||
--no-suite=gtk:a11y
|
||||
|
||||
# Store the exit code for the CI run, but always
|
||||
# generate the reports
|
||||
exit_code=$?
|
||||
|
||||
cd ${builddir}
|
||||
|
||||
$srcdir/.gitlab-ci/meson-junit-report.py \
|
||||
--project-name=gtk \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--output=report.xml \
|
||||
meson-logs/testlog.json
|
||||
$srcdir/.gitlab-ci/meson-html-report.py \
|
||||
--project-name=gtk \
|
||||
--job-id="${CI_JOB_NAME}" \
|
||||
--reftest-output-dir="testsuite/reftests/output" \
|
||||
--output=report.html \
|
||||
meson-logs/testlog.json
|
||||
|
||||
exit $exit_code
|
80
NEWS
80
NEWS
@@ -1,3 +1,81 @@
|
||||
Overview of Changes in GTK 3.98.0
|
||||
=================================
|
||||
|
||||
While this release gets significantly closer to what we aim for in GTK 4,
|
||||
there are still a few big items outstanding that we are currently working
|
||||
on:
|
||||
|
||||
- Event controllers for keyboard shortcuts
|
||||
- Movable popovers
|
||||
- Row-recycling list and grid views
|
||||
- Revamped accessibility infrastructure
|
||||
- Animation API
|
||||
|
||||
We will do further 3.98.x snapshots as these land.
|
||||
|
||||
*****************
|
||||
|
||||
* The DND refactoring has been completed. The GTK API for DND has been turned
|
||||
into event controllers: GtkDragSource and GtkDropTarget. Support for file
|
||||
transfers via file transfer portal has been added for both DND and the clipboard.
|
||||
|
||||
* Child surfaces have been removed. GDK only supports toplevel and popup surfaces
|
||||
now. The client-side window implementation has been removed too. On the GTK side,
|
||||
the GtkNative interface has been introduced for widgets that have their own
|
||||
surface. This cleanup is not 100% complete yet.
|
||||
|
||||
* Global positions and related apis such as gdk_surface_move are no longer available.
|
||||
|
||||
* A constraint-based layout manager has been added.
|
||||
|
||||
* Many classes have been made explicitly non-subclassable, and the widget hierarchy
|
||||
has been simplified, by making widgets derive directly from GtkWidget instead of
|
||||
a container.
|
||||
|
||||
* Menu-related changes:
|
||||
- GtkMenu, GtkMenuBar and related classes have been removed. They are being replaced
|
||||
by GMenu and popover-based variants. Popover menus can now do traditional, nested
|
||||
menus, and model buttons show accelerators.
|
||||
- Context menus are no longer created with ::populate-popup signals, but use menu
|
||||
models and actions.
|
||||
- Widget actions can be created in class_init, with gtk_widget_class_install_action.
|
||||
- GtkToolbar has been removed as well.
|
||||
|
||||
* Text-related changed:
|
||||
- Text cursor blinking has been made smooth.
|
||||
- GtkTextView is caching rendernodes for the visible text range now, improving the
|
||||
scrolling performance of text.
|
||||
- Add a simple undo stack for text edits has been added.
|
||||
|
||||
* The native Win32 filechooser backend supports choices.
|
||||
|
||||
* GtkTreeView renders tree and grid lines with textures.
|
||||
|
||||
* GtkEmojiChooser has been made public.
|
||||
|
||||
* GtkGestureMultiPress has been renamed to GtkGestureClick.
|
||||
|
||||
* GtkWidget has api to handle style classes: gtk_widget_add_style_class.
|
||||
This is the first step towards moving away from GtkStyleContext.
|
||||
|
||||
* X11-specific changes:
|
||||
- XI2 is now mandatory
|
||||
- The xim input method has been removed
|
||||
|
||||
* Wayland-specific changes:
|
||||
- The loading of cursor themes has been improved to load cursors on demand,
|
||||
and no longer relies on libwayland-cursor.
|
||||
|
||||
* The GL renderer is now sharing icon and glyph caches for all surfaces,
|
||||
and has better support for blurring and shadow rendering.
|
||||
|
||||
* Performance-related changes:
|
||||
- GTK provides profiling information for Sysprof when launched with GTK_TRACE=1.
|
||||
- Css computation has been optimized
|
||||
- Css lookups are using a Bloom filter
|
||||
- Icon loading IO has been moved to a thread
|
||||
|
||||
|
||||
Overview of Changes in GTK+ 3.96.0
|
||||
==================================
|
||||
|
||||
@@ -360,7 +438,7 @@ Overview of Changes in GTK+ 3.92.1, 重庆市
|
||||
The bulk of the preparation for this release was done during
|
||||
and after the fantastic GNOME.Asia Summit 2017 in Chongqing, China.
|
||||
|
||||
* Drop autotools support. Meson 0.42.1 is now required
|
||||
* Drop autotools support. Meson 0.42.1 is now required
|
||||
|
||||
* Implement most of CSS3 font-variant
|
||||
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -54,6 +54,36 @@
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "libsass",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/libsass.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "sassc",
|
||||
"buildsystem" : "meson",
|
||||
"builddir" : true,
|
||||
"config-opts": [
|
||||
"--libdir=/app/lib"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
"type" : "git",
|
||||
"url" : "https://github.com/lazka/sassc.git",
|
||||
"branch" : "meson"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "gtk",
|
||||
"buildsystem": "meson",
|
||||
|
@@ -400,7 +400,7 @@ edit_constraint (ConstraintEditorWindow *win,
|
||||
ConstraintEditor *editor;
|
||||
GListModel *model;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
if (constraint)
|
||||
@@ -440,7 +440,7 @@ edit_guide (ConstraintEditorWindow *win,
|
||||
GtkWidget *window;
|
||||
GuideEditor *editor;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (win));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Edit Guide");
|
||||
|
@@ -14,7 +14,7 @@ typedef struct {
|
||||
GtkWidget *message;
|
||||
GtkWidget *infobar;
|
||||
GtkWidget *status;
|
||||
GtkWidget *menutool;
|
||||
GtkWidget *menubutton;
|
||||
GMenuModel *toolmenu;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
@@ -428,8 +428,8 @@ demo_application_window_init (DemoApplicationWindow *window)
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (window));
|
||||
|
||||
popover = gtk_popover_menu_new_from_model (window->menutool, window->toolmenu);
|
||||
gtk_menu_tool_button_set_popover (GTK_MENU_TOOL_BUTTON (window->menutool), popover);
|
||||
popover = gtk_popover_menu_new_from_model (window->menubutton, window->toolmenu);
|
||||
gtk_menu_button_set_popover (GTK_MENU_BUTTON (window->menubutton), popover);
|
||||
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (window),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
@@ -528,7 +528,7 @@ demo_application_window_class_init (DemoApplicationWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, infobar);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, status);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, buffer);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, menutool);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, menubutton);
|
||||
gtk_widget_class_bind_template_child (widget_class, DemoApplicationWindow, toolmenu);
|
||||
gtk_widget_class_bind_template_callback (widget_class, clicked_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, update_statusbar);
|
||||
|
@@ -8,27 +8,24 @@
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkMenuToolButton" id="menutool">
|
||||
<object class="GtkMenuButton" id="menubutton">
|
||||
<property name="icon-name">document-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">application-exit</property>
|
||||
<property name="action-name">app.quit</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem"/>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">applications-other</property>
|
||||
<property name="action-name">win.logo</property>
|
||||
</object>
|
||||
|
@@ -63,7 +63,6 @@ GtkWidget *
|
||||
do_builder (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *toolbar;
|
||||
GActionGroup *actions;
|
||||
|
||||
if (!window)
|
||||
@@ -77,9 +76,6 @@ do_builder (GtkWidget *do_widget)
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
toolbar = GTK_WIDGET (gtk_builder_get_object (builder, "toolbar1"));
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (toolbar),
|
||||
"primary-toolbar");
|
||||
actions = (GActionGroup*)g_simple_action_group_new ();
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions),
|
||||
win_entries, G_N_ELEMENTS (win_entries),
|
||||
|
@@ -98,7 +98,7 @@ get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
GtkIconPaintable *icon;
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
@@ -107,10 +107,15 @@ get_image_paintable (GtkImage *image)
|
||||
case GTK_IMAGE_ICON_NAME:
|
||||
icon_name = gtk_image_get_icon_name (image);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, 48, GTK_ICON_LOOKUP_GENERIC_FALLBACK);
|
||||
if (icon_info == NULL)
|
||||
icon = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
icon_name,
|
||||
NULL,
|
||||
48, 1,
|
||||
gtk_widget_get_direction (GTK_WIDGET (image)),
|
||||
0);
|
||||
if (icon == NULL)
|
||||
return NULL;
|
||||
return gtk_icon_info_load_icon (icon_info, NULL);
|
||||
return GDK_PAINTABLE (icon);
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
@@ -149,7 +154,7 @@ prepare_drag (GtkDragSource *source,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
return gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
|
||||
return gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -275,7 +280,7 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GtkDropTarget *dest;
|
||||
GdkContentFormats *formats;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Clipboard");
|
||||
|
@@ -69,7 +69,7 @@ do_colorsel (GtkWidget *do_widget)
|
||||
color.green = 0;
|
||||
color.alpha = 1;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Color Chooser");
|
||||
|
@@ -310,7 +310,7 @@ do_combobox (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Combo Boxes");
|
||||
|
@@ -255,7 +255,7 @@ do_constraints (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -211,7 +211,7 @@ do_constraints2 (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -131,7 +131,7 @@ do_constraints3 (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *header, *box, *grid, *button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -24,7 +24,7 @@ do_css_accordion (GtkWidget *do_widget)
|
||||
GtkWidget *container, *child;
|
||||
GtkStyleProvider *provider;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Accordion");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
|
||||
|
@@ -72,7 +72,7 @@ do_css_basics (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "CSS Basics");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
|
@@ -86,7 +86,7 @@ do_css_multiplebgs (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Multiple Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
|
@@ -72,7 +72,7 @@ do_css_pixbufs (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Animated Backgrounds");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
|
@@ -62,22 +62,19 @@ GtkWidget *
|
||||
create_toolbar (void)
|
||||
{
|
||||
GtkWidget *toolbar;
|
||||
GtkToolItem *item;
|
||||
GtkWidget *item;
|
||||
|
||||
toolbar = gtk_toolbar_new ();
|
||||
toolbar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
|
||||
gtk_widget_set_valign (toolbar, GTK_ALIGN_CENTER);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-next");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_from_icon_name ("go-next");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
item = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (item), "go-previous");
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_from_icon_name ("go-previous");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
item = gtk_tool_button_new (NULL, "Hello World");
|
||||
gtk_tool_item_set_is_important (item, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
|
||||
item = gtk_button_new_with_label ("Hello World");
|
||||
gtk_container_add (GTK_CONTAINER (toolbar), item);
|
||||
|
||||
return toolbar;
|
||||
}
|
||||
@@ -94,7 +91,7 @@ do_css_shadows (GtkWidget *do_widget)
|
||||
GtkTextBuffer *text;
|
||||
GBytes *bytes;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Shadows");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 300);
|
||||
|
@@ -173,7 +173,6 @@
|
||||
<file>fishbowl.c</file>
|
||||
<file>fixed.c</file>
|
||||
<file>flowbox.c</file>
|
||||
<file>foreigndrawing.c</file>
|
||||
<file>font_features.c</file>
|
||||
<file>fontplane.c</file>
|
||||
<file>fontrendering.c</file>
|
||||
|
@@ -111,53 +111,52 @@
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar" id="toolbar1">
|
||||
<object class="GtkBox" id="toolbar1">
|
||||
<child internal-child="accessible">
|
||||
<object class="AtkObject" id="a11y-toolbar">
|
||||
<property name="AtkObject::accessible-name">The toolbar</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">New</property>
|
||||
<property name="tooltip-text" translatable="yes">Create a new file</property>
|
||||
<property name="icon-name">document-new</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Open</property>
|
||||
<property name="tooltip-text" translatable="yes">Open a file</property>
|
||||
<property name="icon-name">document-open</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
<property name="tooltip-text" translatable="yes">Save a file</property>
|
||||
<property name="icon-name">document-save</property>
|
||||
<property name="is-important">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem"/>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Copy</property>
|
||||
<property name="tooltip-text" translatable="yes">Copy selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-copy</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Cut</property>
|
||||
<property name="tooltip-text" translatable="yes">Cut selected object into the clipboard</property>
|
||||
<property name="icon-name">edit-cut</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Paste</property>
|
||||
<property name="tooltip-text" translatable="yes">Paste object from the clipboard</property>
|
||||
<property name="icon-name">edit-paste</property>
|
||||
|
@@ -105,7 +105,7 @@ do_dialog (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Dialogs and Message Boxes");
|
||||
|
@@ -356,7 +356,7 @@ do_dnd (GtkWidget *do_widget)
|
||||
GtkGesture *multipress;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drag-and-drop");
|
||||
|
@@ -189,7 +189,7 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drawing Area");
|
||||
|
@@ -345,7 +345,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
GtkTreeModel *items_model;
|
||||
GtkTreeModel *numbers_model;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Editable Cells");
|
||||
|
@@ -45,7 +45,7 @@ do_entry_completion (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Completion");
|
||||
|
@@ -20,7 +20,7 @@ do_entry_undo (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Entry Undo");
|
||||
|
@@ -28,7 +28,7 @@ init_icon_names (GtkIconTheme *theme)
|
||||
if (icon_names)
|
||||
return;
|
||||
|
||||
icon_list = gtk_icon_theme_list_icons (theme, NULL);
|
||||
icon_list = gtk_icon_theme_list_icons (theme);
|
||||
icons = g_ptr_array_new ();
|
||||
|
||||
for (l = icon_list; l; l = l->next)
|
||||
@@ -60,8 +60,10 @@ create_icon (void)
|
||||
{
|
||||
GtkWidget *image;
|
||||
|
||||
image = gtk_image_new_from_icon_name (get_random_icon_name (gtk_icon_theme_get_default ()));
|
||||
image = gtk_image_new ();
|
||||
gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (image),
|
||||
get_random_icon_name (gtk_icon_theme_get_for_display (gtk_widget_get_display (image))));
|
||||
|
||||
return image;
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ create_demo_window (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *window, *sw, *fixed, *cube;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Fixed layout");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
|
@@ -719,7 +719,7 @@ do_flowbox (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Flow Box");
|
||||
|
@@ -1,984 +0,0 @@
|
||||
/* Foreign drawing
|
||||
*
|
||||
* Many applications can't use GTK widgets, for a variety of reasons,
|
||||
* but still want their user interface to appear integrated with the
|
||||
* rest of the desktop, and follow GTK themes. This demo shows how to
|
||||
* use GtkStyleContext and the gtk_render_ APIs to achieve this.
|
||||
*
|
||||
* Note that this is a very simple, non-interactive example.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
static void
|
||||
append_element (GtkWidgetPath *path,
|
||||
const char *selector)
|
||||
{
|
||||
static const struct {
|
||||
const char *name;
|
||||
GtkStateFlags state_flag;
|
||||
} pseudo_classes[] = {
|
||||
{ "active", GTK_STATE_FLAG_ACTIVE },
|
||||
{ "hover", GTK_STATE_FLAG_PRELIGHT },
|
||||
{ "selected", GTK_STATE_FLAG_SELECTED },
|
||||
{ "disabled", GTK_STATE_FLAG_INSENSITIVE },
|
||||
{ "indeterminate", GTK_STATE_FLAG_INCONSISTENT },
|
||||
{ "focus", GTK_STATE_FLAG_FOCUSED },
|
||||
{ "backdrop", GTK_STATE_FLAG_BACKDROP },
|
||||
{ "dir(ltr)", GTK_STATE_FLAG_DIR_LTR },
|
||||
{ "dir(rtl)", GTK_STATE_FLAG_DIR_RTL },
|
||||
{ "link", GTK_STATE_FLAG_LINK },
|
||||
{ "visited", GTK_STATE_FLAG_VISITED },
|
||||
{ "checked", GTK_STATE_FLAG_CHECKED },
|
||||
{ "drop(active)", GTK_STATE_FLAG_DROP_ACTIVE }
|
||||
};
|
||||
const char *next;
|
||||
char *name;
|
||||
char type;
|
||||
guint i;
|
||||
|
||||
next = strpbrk (selector, "#.:");
|
||||
if (next == NULL)
|
||||
next = selector + strlen (selector);
|
||||
|
||||
name = g_strndup (selector, next - selector);
|
||||
if (g_ascii_isupper (selector[0]))
|
||||
{
|
||||
GType gtype;
|
||||
gtype = g_type_from_name (name);
|
||||
if (gtype == G_TYPE_INVALID)
|
||||
{
|
||||
g_critical ("Unknown type name `%s'", name);
|
||||
g_free (name);
|
||||
return;
|
||||
}
|
||||
gtk_widget_path_append_type (path, gtype);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Omit type, we're using name */
|
||||
gtk_widget_path_append_type (path, G_TYPE_NONE);
|
||||
gtk_widget_path_iter_set_object_name (path, -1, name);
|
||||
}
|
||||
g_free (name);
|
||||
|
||||
while (*next != '\0')
|
||||
{
|
||||
type = *next;
|
||||
selector = next + 1;
|
||||
next = strpbrk (selector, "#.:");
|
||||
if (next == NULL)
|
||||
next = selector + strlen (selector);
|
||||
name = g_strndup (selector, next - selector);
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case '#':
|
||||
gtk_widget_path_iter_set_name (path, -1, name);
|
||||
break;
|
||||
|
||||
case '.':
|
||||
gtk_widget_path_iter_add_class (path, -1, name);
|
||||
break;
|
||||
|
||||
case ':':
|
||||
for (i = 0; i < G_N_ELEMENTS (pseudo_classes); i++)
|
||||
{
|
||||
if (g_str_equal (pseudo_classes[i].name, name))
|
||||
{
|
||||
gtk_widget_path_iter_set_state (path,
|
||||
-1,
|
||||
gtk_widget_path_iter_get_state (path, -1)
|
||||
| pseudo_classes[i].state_flag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (i == G_N_ELEMENTS (pseudo_classes))
|
||||
g_critical ("Unknown pseudo-class :%s", name);
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_free (name);
|
||||
}
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
create_context_for_path (GtkWidgetPath *path,
|
||||
GtkStyleContext *parent)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_style_context_new ();
|
||||
gtk_style_context_set_path (context, path);
|
||||
gtk_style_context_set_parent (context, parent);
|
||||
/* Unfortunately, we have to explicitly set the state again here
|
||||
* for it to take effect
|
||||
*/
|
||||
gtk_style_context_set_state (context, gtk_widget_path_iter_get_state (path, -1));
|
||||
gtk_widget_path_unref (path);
|
||||
|
||||
return context;
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
get_style (GtkStyleContext *parent,
|
||||
const char *selector)
|
||||
{
|
||||
GtkWidgetPath *path;
|
||||
|
||||
if (parent)
|
||||
path = gtk_widget_path_copy (gtk_style_context_get_path (parent));
|
||||
else
|
||||
path = gtk_widget_path_new ();
|
||||
|
||||
append_element (path, selector);
|
||||
|
||||
return create_context_for_path (path, parent);
|
||||
}
|
||||
|
||||
static GtkStyleContext *
|
||||
get_style_with_siblings (GtkStyleContext *parent,
|
||||
const char *selector,
|
||||
const char **siblings,
|
||||
gint position)
|
||||
{
|
||||
GtkWidgetPath *path, *siblings_path;
|
||||
guint i;
|
||||
|
||||
if (parent)
|
||||
path = gtk_widget_path_copy (gtk_style_context_get_path (parent));
|
||||
else
|
||||
path = gtk_widget_path_new ();
|
||||
|
||||
siblings_path = gtk_widget_path_new ();
|
||||
for (i = 0; siblings[i]; i++)
|
||||
append_element (siblings_path, siblings[i]);
|
||||
|
||||
gtk_widget_path_append_with_siblings (path, siblings_path, position);
|
||||
gtk_widget_path_unref (siblings_path);
|
||||
|
||||
return create_context_for_path (path, parent);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_style_common (GtkStyleContext *context,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *contents_x,
|
||||
gint *contents_y,
|
||||
gint *contents_width,
|
||||
gint *contents_height)
|
||||
{
|
||||
GtkBorder margin, border, padding;
|
||||
int min_width, min_height;
|
||||
|
||||
gtk_style_context_get_margin (context, &margin);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
|
||||
gtk_style_context_get (context,
|
||||
"min-width", &min_width,
|
||||
"min-height", &min_height,
|
||||
NULL);
|
||||
x += margin.left;
|
||||
y += margin.top;
|
||||
width -= margin.left + margin.right;
|
||||
height -= margin.top + margin.bottom;
|
||||
|
||||
width = MAX (width, min_width);
|
||||
height = MAX (height, min_height);
|
||||
|
||||
gtk_render_background (context, cr, x, y, width, height);
|
||||
gtk_render_frame (context, cr, x, y, width, height);
|
||||
|
||||
if (contents_x)
|
||||
*contents_x = x + border.left + padding.left;
|
||||
if (contents_y)
|
||||
*contents_y = y + border.top + padding.top;
|
||||
if (contents_width)
|
||||
*contents_width = width - border.left - border.right - padding.left - padding.right;
|
||||
if (contents_height)
|
||||
*contents_height = height - border.top - border.bottom - padding.top - padding.bottom;
|
||||
}
|
||||
|
||||
static void
|
||||
query_size (GtkStyleContext *context,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkBorder margin, border, padding;
|
||||
int min_width, min_height;
|
||||
|
||||
gtk_style_context_get_margin (context, &margin);
|
||||
gtk_style_context_get_border (context, &border);
|
||||
gtk_style_context_get_padding (context, &padding);
|
||||
|
||||
gtk_style_context_get (context,
|
||||
"min-width", &min_width,
|
||||
"min-height", &min_height,
|
||||
NULL);
|
||||
|
||||
min_width += margin.left + margin.right + border.left + border.right + padding.left + padding.right;
|
||||
min_height += margin.top + margin.bottom + border.top + border.bottom + padding.top + padding.bottom;
|
||||
|
||||
if (width)
|
||||
*width = MAX (*width, min_width);
|
||||
if (height)
|
||||
*height = MAX (*height, min_height);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_menu (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *menu_context;
|
||||
GtkStyleContext *menuitem_context;
|
||||
GtkStyleContext *hovermenuitem_context;
|
||||
GtkStyleContext *hoveredarrowmenuitem_context;
|
||||
GtkStyleContext *arrowmenuitem_context;
|
||||
GtkStyleContext *checkmenuitem_context;
|
||||
GtkStyleContext *disabledarrowmenuitem_context;
|
||||
GtkStyleContext *disabledcheckmenuitem_context;
|
||||
GtkStyleContext *radiomenuitem_context;
|
||||
GtkStyleContext *disablemenuitem_context;
|
||||
GtkStyleContext *disabledradiomenuitem_context;
|
||||
GtkStyleContext *separatormenuitem_context;
|
||||
gint menuitem1_height, menuitem2_height, menuitem3_height, menuitem4_height, menuitem5_height;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint menu_x, menu_y, menu_width, menu_height;
|
||||
gint arrow_width, arrow_height, arrow_size;
|
||||
gint toggle_x, toggle_y, toggle_width, toggle_height;
|
||||
|
||||
/* This information is taken from the GtkMenu docs, see "CSS nodes" */
|
||||
menu_context = get_style (NULL, "menu");
|
||||
hovermenuitem_context = get_style (menu_context, "menuitem:hover");
|
||||
hoveredarrowmenuitem_context = get_style (hovermenuitem_context, "arrow.right:dir(ltr)");
|
||||
menuitem_context = get_style (menu_context, "menuitem");
|
||||
arrowmenuitem_context = get_style (menuitem_context, "arrow:dir(rtl)");
|
||||
disablemenuitem_context = get_style (menu_context, "menuitem:disabled");
|
||||
disabledarrowmenuitem_context = get_style (disablemenuitem_context, "arrow:dir(rtl)");
|
||||
checkmenuitem_context = get_style (menuitem_context, "check:checked");
|
||||
disabledcheckmenuitem_context = get_style (disablemenuitem_context, "check");
|
||||
separatormenuitem_context = get_style (menu_context, "separator:disabled");
|
||||
radiomenuitem_context = get_style (menuitem_context, "radio:checked");
|
||||
disabledradiomenuitem_context = get_style (disablemenuitem_context, "radio");
|
||||
|
||||
*height = 0;
|
||||
query_size (menu_context, NULL, height);
|
||||
menuitem1_height = 0;
|
||||
query_size (hovermenuitem_context, NULL, &menuitem1_height);
|
||||
query_size (hoveredarrowmenuitem_context, NULL, &menuitem1_height);
|
||||
*height += menuitem1_height;
|
||||
menuitem2_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem2_height);
|
||||
query_size (arrowmenuitem_context, NULL, &menuitem2_height);
|
||||
query_size (disabledarrowmenuitem_context, NULL, &menuitem2_height);
|
||||
*height += menuitem2_height;
|
||||
menuitem3_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem3_height);
|
||||
query_size (checkmenuitem_context, NULL, &menuitem3_height);
|
||||
query_size (disabledcheckmenuitem_context, NULL, &menuitem3_height);
|
||||
*height += menuitem3_height;
|
||||
menuitem4_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (separatormenuitem_context, NULL, &menuitem4_height);
|
||||
*height += menuitem4_height;
|
||||
menuitem5_height = 0;
|
||||
query_size (menu_context, NULL, &menuitem5_height);
|
||||
query_size (menuitem_context, NULL, &menuitem5_height);
|
||||
query_size (radiomenuitem_context, NULL, &menuitem5_height);
|
||||
query_size (disabledradiomenuitem_context, NULL, &menuitem5_height);
|
||||
*height += menuitem5_height;
|
||||
|
||||
draw_style_common (menu_context, cr, x, y, width, *height,
|
||||
&menu_x, &menu_y, &menu_width, &menu_height);
|
||||
|
||||
/* Hovered with right arrow */
|
||||
gtk_style_context_get (hoveredarrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
draw_style_common (hovermenuitem_context, cr, menu_x, menu_y, menu_width, menuitem1_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_arrow (hoveredarrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
/* Left arrow sensitive, and right arrow insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height, menu_width, menuitem2_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (arrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
gtk_render_arrow (arrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
gtk_style_context_get (disabledarrowmenuitem_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
gtk_render_arrow (disabledarrowmenuitem_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
|
||||
/* Left check enabled, sensitive, and right check unchecked, insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height, menu_width, menuitem3_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (checkmenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (checkmenuitem_context, cr,
|
||||
contents_x,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (checkmenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
gtk_style_context_get (disabledcheckmenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (disabledcheckmenuitem_context, cr,
|
||||
contents_x + contents_width - toggle_width,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (disabledcheckmenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
|
||||
/* Separator */
|
||||
draw_style_common (separatormenuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height + menuitem3_height,
|
||||
menu_width, menuitem4_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
/* Left check enabled, sensitive, and right check unchecked, insensitive */
|
||||
draw_style_common (menuitem_context, cr, menu_x, menu_y + menuitem1_height + menuitem2_height + menuitem3_height + menuitem4_height,
|
||||
menu_width, menuitem5_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_style_context_get (radiomenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (radiomenuitem_context, cr,
|
||||
contents_x,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (radiomenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
gtk_style_context_get (disabledradiomenuitem_context,
|
||||
"min-width", &toggle_width, "min-height", &toggle_height, NULL);
|
||||
draw_style_common (disabledradiomenuitem_context, cr,
|
||||
contents_x + contents_width - toggle_width,
|
||||
contents_y,
|
||||
toggle_width, toggle_height,
|
||||
&toggle_x, &toggle_y, &toggle_width, &toggle_height);
|
||||
gtk_render_check (disabledradiomenuitem_context, cr, toggle_x, toggle_y, toggle_width, toggle_height);
|
||||
|
||||
g_object_unref (menu_context);
|
||||
g_object_unref (menuitem_context);
|
||||
g_object_unref (hovermenuitem_context);
|
||||
g_object_unref (hoveredarrowmenuitem_context);
|
||||
g_object_unref (arrowmenuitem_context);
|
||||
g_object_unref (checkmenuitem_context);
|
||||
g_object_unref (disabledarrowmenuitem_context);
|
||||
g_object_unref (disabledcheckmenuitem_context);
|
||||
g_object_unref (radiomenuitem_context);
|
||||
g_object_unref (disablemenuitem_context);
|
||||
g_object_unref (disabledradiomenuitem_context);
|
||||
g_object_unref (separatormenuitem_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_menubar (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *frame_context;
|
||||
GtkStyleContext *border_context;
|
||||
GtkStyleContext *menubar_context;
|
||||
GtkStyleContext *hovered_menuitem_context;
|
||||
GtkStyleContext *menuitem_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint item_width;
|
||||
|
||||
/* Menubar background is the same color as our base background, so use a frame */
|
||||
frame_context = get_style (NULL, "frame");
|
||||
border_context = get_style (frame_context, "border");
|
||||
|
||||
/* This information is taken from the GtkPopoverMenuBar docs, see "CSS nodes" */
|
||||
menubar_context = get_style (NULL, "menubar");
|
||||
hovered_menuitem_context = get_style (menubar_context, "menuitem:hover");
|
||||
menuitem_context = get_style (menubar_context, "menuitem");
|
||||
|
||||
*height = 0;
|
||||
query_size (frame_context, NULL, height);
|
||||
query_size (border_context, NULL, height);
|
||||
query_size (menubar_context, NULL, height);
|
||||
query_size (hovered_menuitem_context, NULL, height);
|
||||
query_size (menuitem_context, NULL, height);
|
||||
|
||||
draw_style_common (frame_context, cr, x, y, width, *height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (border_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (menubar_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
item_width = contents_width / 3;
|
||||
draw_style_common (hovered_menuitem_context, cr, contents_x, contents_y, item_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (menuitem_context, cr, contents_x + item_width * 2, contents_y, item_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (menuitem_context);
|
||||
g_object_unref (hovered_menuitem_context);
|
||||
g_object_unref (menubar_context);
|
||||
g_object_unref (border_context);
|
||||
g_object_unref (frame_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_notebook (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height)
|
||||
{
|
||||
GtkStyleContext *notebook_context;
|
||||
GtkStyleContext *header_context;
|
||||
GtkStyleContext *tabs_context;
|
||||
GtkStyleContext *tab1_context, *tab2_context;
|
||||
GtkStyleContext *stack_context;
|
||||
gint header_height;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkNotebook docs, see "CSS nodes" */
|
||||
notebook_context = get_style (NULL, "notebook.frame");
|
||||
header_context = get_style (notebook_context, "header.top");
|
||||
tabs_context = get_style (header_context, "tabs");
|
||||
tab1_context = get_style (tabs_context, "tab:checked");
|
||||
tab2_context = get_style (tabs_context, "tab:hover");
|
||||
stack_context = get_style (notebook_context, "stack");
|
||||
|
||||
header_height = 0;
|
||||
query_size (notebook_context, NULL, &header_height);
|
||||
query_size (header_context, NULL, &header_height);
|
||||
query_size (tabs_context, NULL, &header_height);
|
||||
query_size (tab1_context, NULL, &header_height);
|
||||
query_size (tab2_context, NULL, &header_height);
|
||||
|
||||
draw_style_common (notebook_context, cr, x, y, width, height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (header_context, cr, x, y, width, header_height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (tabs_context, cr, x, y, width, header_height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (tab1_context, cr, x, y, width / 2, header_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (tab2_context, cr, x + width / 2, y, width / 2, header_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (stack_context, cr, x, y + header_height, width,height - header_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (stack_context);
|
||||
g_object_unref (tabs_context);
|
||||
g_object_unref (tab1_context);
|
||||
g_object_unref (tab2_context);
|
||||
g_object_unref (header_context);
|
||||
g_object_unref (notebook_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_horizontal_scrollbar (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
GtkStateFlags state,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *scrollbar_context;
|
||||
GtkStyleContext *contents_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *slider_context;
|
||||
gint slider_width;
|
||||
|
||||
/* This information is taken from the GtkScrollbar docs, see "CSS nodes" */
|
||||
scrollbar_context = get_style (NULL, "scrollbar.horizontal.bottom");
|
||||
contents_context = get_style (scrollbar_context, "contents");
|
||||
trough_context = get_style (contents_context, "trough");
|
||||
slider_context = get_style (trough_context, "slider");
|
||||
|
||||
gtk_style_context_set_state (scrollbar_context, state);
|
||||
gtk_style_context_set_state (contents_context, state);
|
||||
gtk_style_context_set_state (trough_context, state);
|
||||
gtk_style_context_set_state (slider_context, state);
|
||||
|
||||
*height = 0;
|
||||
query_size (scrollbar_context, NULL, height);
|
||||
query_size (contents_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (slider_context, NULL, height);
|
||||
|
||||
gtk_style_context_get (slider_context,
|
||||
"min-width", &slider_width, NULL);
|
||||
|
||||
draw_style_common (scrollbar_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (contents_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (trough_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (slider_context, cr, x + position, y, slider_width, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (slider_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (contents_context);
|
||||
g_object_unref (scrollbar_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_text (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint height,
|
||||
const gchar *text,
|
||||
GtkStateFlags state)
|
||||
{
|
||||
GtkStyleContext *label_context;
|
||||
GtkStyleContext *selection_context;
|
||||
GtkStyleContext *context;
|
||||
PangoLayout *layout;
|
||||
|
||||
/* This information is taken from the GtkLabel docs, see "CSS nodes" */
|
||||
label_context = get_style (NULL, "label.view");
|
||||
selection_context = get_style (label_context, "selection");
|
||||
|
||||
gtk_style_context_set_state (label_context, state);
|
||||
|
||||
if (state & GTK_STATE_FLAG_SELECTED)
|
||||
context = selection_context;
|
||||
else
|
||||
context = label_context;
|
||||
|
||||
layout = gtk_widget_create_pango_layout (widget, text);
|
||||
|
||||
gtk_render_background (context, cr, x, y, width, height);
|
||||
gtk_render_frame (context, cr, x, y, width, height);
|
||||
gtk_render_layout (context, cr, x, y, layout);
|
||||
|
||||
g_object_unref (layout);
|
||||
|
||||
g_object_unref (selection_context);
|
||||
g_object_unref (label_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_check (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkStateFlags state,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *check_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkCheckButton docs, see "CSS nodes" */
|
||||
button_context = get_style (NULL, "checkbutton");
|
||||
check_context = get_style (button_context, "check");
|
||||
|
||||
gtk_style_context_set_state (check_context, state);
|
||||
|
||||
*width = *height = 0;
|
||||
query_size (button_context, width, height);
|
||||
query_size (check_context, width, height);
|
||||
|
||||
draw_style_common (button_context, cr, x, y, *width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (check_context, cr, x, y, *width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_check (check_context, cr, contents_x, contents_y, contents_width, contents_height);
|
||||
|
||||
g_object_unref (check_context);
|
||||
g_object_unref (button_context);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
draw_radio (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
GtkStateFlags state,
|
||||
gint *width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *check_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkRadioButton docs, see "CSS nodes" */
|
||||
button_context = get_style (NULL, "radiobutton");
|
||||
check_context = get_style (button_context, "radio");
|
||||
|
||||
gtk_style_context_set_state (check_context, state);
|
||||
|
||||
*width = *height = 0;
|
||||
query_size (button_context, width, height);
|
||||
query_size (check_context, width, height);
|
||||
|
||||
draw_style_common (button_context, cr, x, y, *width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (check_context, cr, x, y, *width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_check (check_context, cr, contents_x, contents_y, contents_width, contents_height);
|
||||
|
||||
g_object_unref (check_context);
|
||||
g_object_unref (button_context);
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
draw_progress (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *bar_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *progress_context;
|
||||
|
||||
/* This information is taken from the GtkProgressBar docs, see "CSS nodes" */
|
||||
bar_context = get_style (NULL, "progressbar.horizontal");
|
||||
trough_context = get_style (bar_context, "trough");
|
||||
progress_context = get_style (trough_context, "progress.left");
|
||||
|
||||
*height = 0;
|
||||
query_size (bar_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (progress_context, NULL, height);
|
||||
|
||||
draw_style_common (bar_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (trough_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (progress_context, cr, x, y, position, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (progress_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (bar_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_scale (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint position,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *scale_context;
|
||||
GtkStyleContext *contents_context;
|
||||
GtkStyleContext *trough_context;
|
||||
GtkStyleContext *slider_context;
|
||||
GtkStyleContext *highlight_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint trough_height, slider_height;
|
||||
|
||||
scale_context = get_style (NULL, "scale.horizontal");
|
||||
contents_context = get_style (scale_context, "contents");
|
||||
trough_context = get_style (contents_context, "trough");
|
||||
slider_context = get_style (trough_context, "slider");
|
||||
highlight_context = get_style (trough_context, "highlight.top");
|
||||
|
||||
*height = 0;
|
||||
query_size (scale_context, NULL, height);
|
||||
query_size (contents_context, NULL, height);
|
||||
query_size (trough_context, NULL, height);
|
||||
query_size (slider_context, NULL, height);
|
||||
query_size (highlight_context, NULL, height);
|
||||
|
||||
draw_style_common (scale_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (contents_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
/* Scale trough defines its size querying slider and highlight */
|
||||
trough_height = 0;
|
||||
query_size (trough_context, NULL, &trough_height);
|
||||
slider_height = 0;
|
||||
query_size (slider_context, NULL, &slider_height);
|
||||
query_size (highlight_context, NULL, &slider_height);
|
||||
trough_height += slider_height;
|
||||
draw_style_common (trough_context, cr, contents_x, contents_y, contents_width, trough_height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
draw_style_common (highlight_context, cr, contents_x, contents_y,
|
||||
contents_width / 2, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (slider_context, cr, contents_x + position, contents_y, contents_height, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
|
||||
g_object_unref (scale_context);
|
||||
g_object_unref (contents_context);
|
||||
g_object_unref (trough_context);
|
||||
g_object_unref (slider_context);
|
||||
g_object_unref (highlight_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_combobox (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gboolean has_entry,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *combo_context;
|
||||
GtkStyleContext *box_context;
|
||||
GtkStyleContext *button_context;
|
||||
GtkStyleContext *button_box_context;
|
||||
GtkStyleContext *entry_context;
|
||||
GtkStyleContext *arrow_context;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
gint button_width;
|
||||
gint arrow_width, arrow_height, arrow_size;
|
||||
|
||||
/* This information is taken from the GtkComboBox docs, see "CSS nodes" */
|
||||
combo_context = get_style (NULL, "combobox:focus");
|
||||
box_context = get_style (combo_context, "box.horizontal.linked");
|
||||
if (has_entry)
|
||||
{
|
||||
const char *siblings[3] = { "entry.combo:focus", "button.combo" , NULL };
|
||||
|
||||
entry_context = get_style_with_siblings (box_context, "entry.combo:focus", siblings, 0);
|
||||
button_context = get_style_with_siblings (box_context, "button.combo", siblings, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
const char *siblings[2] = { "button.combo" , NULL };
|
||||
|
||||
button_context = get_style_with_siblings (box_context, "button.combo", siblings, 0);
|
||||
}
|
||||
button_box_context = get_style (button_context, "box.horizontal");
|
||||
arrow_context = get_style (button_box_context, "arrow");
|
||||
|
||||
*height = 0;
|
||||
query_size (combo_context, NULL, height);
|
||||
query_size (box_context, NULL, height);
|
||||
if (has_entry)
|
||||
query_size (entry_context, NULL, height);
|
||||
query_size (button_context, NULL, height);
|
||||
query_size (button_box_context, NULL, height);
|
||||
query_size (arrow_context, NULL, height);
|
||||
|
||||
gtk_style_context_get (arrow_context,
|
||||
"min-width", &arrow_width, "min-height", &arrow_height, NULL);
|
||||
arrow_size = MIN (arrow_width, arrow_height);
|
||||
|
||||
draw_style_common (combo_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (box_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
if (has_entry)
|
||||
{
|
||||
button_width = *height;
|
||||
draw_style_common (entry_context, cr, x, y, width - button_width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (button_context, cr, x + width - button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
}
|
||||
else
|
||||
{
|
||||
button_width = width;
|
||||
draw_style_common (button_context, cr, x, y, width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
}
|
||||
|
||||
draw_style_common (button_box_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
draw_style_common (arrow_context, cr, contents_x, contents_y, contents_width, contents_height,
|
||||
NULL, NULL, NULL, NULL);
|
||||
gtk_render_arrow (arrow_context, cr, G_PI / 2,
|
||||
contents_x + contents_width - arrow_size,
|
||||
contents_y + (contents_height - arrow_size) / 2, arrow_size);
|
||||
|
||||
g_object_unref (arrow_context);
|
||||
if (has_entry)
|
||||
g_object_unref (entry_context);
|
||||
g_object_unref (button_context);
|
||||
g_object_unref (combo_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_spinbutton (GtkWidget *widget,
|
||||
cairo_t *cr,
|
||||
gint x,
|
||||
gint y,
|
||||
gint width,
|
||||
gint *height)
|
||||
{
|
||||
GtkStyleContext *spin_context;
|
||||
GtkStyleContext *entry_context;
|
||||
GtkStyleContext *up_context;
|
||||
GtkStyleContext *down_context;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
GdkTexture *texture;
|
||||
gint icon_width, icon_height, icon_size;
|
||||
gint button_width;
|
||||
gint contents_x, contents_y, contents_width, contents_height;
|
||||
|
||||
/* This information is taken from the GtkSpinButton docs, see "CSS nodes" */
|
||||
spin_context = get_style (NULL, "spinbutton.horizontal:focus");
|
||||
entry_context = get_style (spin_context, "entry:focus");
|
||||
up_context = get_style (spin_context, "button.up:focus:active");
|
||||
down_context = get_style (spin_context, "button.down:focus");
|
||||
|
||||
*height = 0;
|
||||
query_size (spin_context, NULL, height);
|
||||
query_size (entry_context, NULL, height);
|
||||
query_size (up_context, NULL, height);
|
||||
query_size (down_context, NULL, height);
|
||||
button_width = *height;
|
||||
|
||||
draw_style_common (spin_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
draw_style_common (entry_context, cr, x, y, width, *height, NULL, NULL, NULL, NULL);
|
||||
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
|
||||
|
||||
gtk_style_context_get (up_context,
|
||||
"min-width", &icon_width, "min-height", &icon_height, NULL);
|
||||
icon_size = MIN (icon_width, icon_height);
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-add-symbolic", icon_size, 0);
|
||||
texture = GDK_TEXTURE (gtk_icon_info_load_symbolic_for_context (icon_info, up_context, NULL, NULL));
|
||||
g_object_unref (icon_info);
|
||||
draw_style_common (up_context, cr, x + width - button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_icon (up_context, cr, texture, contents_x, contents_y + (contents_height - icon_size) / 2);
|
||||
g_object_unref (texture);
|
||||
|
||||
gtk_style_context_get (down_context,
|
||||
"min-width", &icon_width, "min-height", &icon_height, NULL);
|
||||
icon_size = MIN (icon_width, icon_height);
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, "list-remove-symbolic", icon_size, 0);
|
||||
texture = GDK_TEXTURE (gtk_icon_info_load_symbolic_for_context (icon_info, down_context, NULL, NULL));
|
||||
g_object_unref (icon_info);
|
||||
draw_style_common (down_context, cr, x + width - 2 * button_width, y, button_width, *height,
|
||||
&contents_x, &contents_y, &contents_width, &contents_height);
|
||||
gtk_render_icon (down_context, cr, texture, contents_x, contents_y + (contents_height - icon_size) / 2);
|
||||
g_object_unref (texture);
|
||||
|
||||
g_object_unref (down_context);
|
||||
g_object_unref (up_context);
|
||||
g_object_unref (entry_context);
|
||||
g_object_unref (spin_context);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_func (GtkDrawingArea *da,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (da);
|
||||
gint panewidth;
|
||||
gint x, y;
|
||||
|
||||
panewidth = width / 2;
|
||||
|
||||
cairo_rectangle (cr, 0, 0, width, height);
|
||||
cairo_set_source_rgb (cr, 0.9, 0.9, 0.9);
|
||||
cairo_fill (cr);
|
||||
|
||||
x = y = 10;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 30, GTK_STATE_FLAG_NORMAL, &height);
|
||||
y += height + 8;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 40, GTK_STATE_FLAG_PRELIGHT, &height);
|
||||
y += height + 8;
|
||||
draw_horizontal_scrollbar (widget, cr, x, y, panewidth - 20, 50, GTK_STATE_FLAG_ACTIVE|GTK_STATE_FLAG_PRELIGHT, &height);
|
||||
|
||||
y += height + 8;
|
||||
draw_text (widget, cr, x, y, panewidth - 20, 20, "Not selected", GTK_STATE_FLAG_NORMAL);
|
||||
y += 20 + 10;
|
||||
draw_text (widget, cr, x, y, panewidth - 20, 20, "Selected", GTK_STATE_FLAG_SELECTED);
|
||||
|
||||
x = 10;
|
||||
y += 20 + 10;
|
||||
draw_check (widget, cr, x, y, GTK_STATE_FLAG_NORMAL, &width, &height);
|
||||
x += width + 10;
|
||||
draw_check (widget, cr, x, y, GTK_STATE_FLAG_CHECKED, &width, &height);
|
||||
x += width + 10;
|
||||
draw_radio (widget, cr, x, y, GTK_STATE_FLAG_NORMAL, &width, &height);
|
||||
x += width + 10;
|
||||
draw_radio (widget, cr, x, y, GTK_STATE_FLAG_CHECKED, &width, &height);
|
||||
x = 10;
|
||||
|
||||
y += height + 10;
|
||||
draw_progress (widget, cr, x, y, panewidth - 20, 50, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_scale (widget, cr, x, y, panewidth - 20, 75, &height);
|
||||
|
||||
y += height + 20;
|
||||
draw_notebook (widget, cr, x, y, panewidth - 20, 160);
|
||||
|
||||
/* Second column */
|
||||
x += panewidth;
|
||||
y = 10;
|
||||
draw_menu (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_menubar (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 20;
|
||||
draw_spinbutton (widget, cr, x, y, panewidth - 20, &height);
|
||||
|
||||
y += height + 30;
|
||||
draw_combobox (widget, cr, x, y, panewidth - 20, FALSE, &height);
|
||||
|
||||
y += height + 10;
|
||||
draw_combobox (widget, cr, 10 + panewidth, y, panewidth - 20, TRUE, &height);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_foreigndrawing (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *box;
|
||||
GtkWidget *da;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Foreign drawing");
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
da = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 400);
|
||||
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 400);
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_func, NULL, NULL);
|
||||
gtk_widget_set_hexpand (da, TRUE);
|
||||
gtk_widget_set_vexpand (da, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (box), da);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
@@ -146,7 +146,7 @@ do_gestures (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 400);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gestures");
|
||||
g_signal_connect (window, "destroy",
|
||||
|
@@ -389,7 +389,7 @@ create_glarea_window (GtkWidget *do_widget)
|
||||
GtkWidget *window, *box, *button, *controls;
|
||||
int i;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "OpenGL Area");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 400, 600);
|
||||
|
@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
@@ -232,7 +232,7 @@ do_hypertext (GtkWidget *do_widget)
|
||||
GtkTextBuffer *buffer;
|
||||
GtkEventController *controller;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Hypertext");
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -26,7 +26,7 @@ enum
|
||||
|
||||
static GdkPixbuf *file_pixbuf, *folder_pixbuf;
|
||||
gchar *parent;
|
||||
GtkToolItem *up_button;
|
||||
GtkWidget *up_button;
|
||||
|
||||
/* Loads the images for the demo and returns whether the operation succeeded */
|
||||
static void
|
||||
@@ -188,8 +188,8 @@ item_activated (GtkIconView *icon_view,
|
||||
}
|
||||
|
||||
static void
|
||||
up_clicked (GtkToolItem *item,
|
||||
gpointer user_data)
|
||||
up_clicked (GtkButton *item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
gchar *dir_name;
|
||||
@@ -209,8 +209,8 @@ up_clicked (GtkToolItem *item,
|
||||
}
|
||||
|
||||
static void
|
||||
home_clicked (GtkToolItem *item,
|
||||
gpointer user_data)
|
||||
home_clicked (GtkButton *item,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkListStore *store;
|
||||
|
||||
@@ -248,9 +248,9 @@ do_iconview (GtkWidget *do_widget)
|
||||
GtkListStore *store;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *tool_bar;
|
||||
GtkToolItem *home_button;
|
||||
GtkWidget *home_button;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 650, 400);
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
@@ -265,23 +265,15 @@ do_iconview (GtkWidget *do_widget)
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
tool_bar = gtk_toolbar_new ();
|
||||
tool_bar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), tool_bar);
|
||||
|
||||
up_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (up_button), _("_Up"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (up_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (up_button), "go-up");
|
||||
gtk_tool_item_set_is_important (up_button, TRUE);
|
||||
up_button = gtk_button_new_with_mnemonic ("_Up");
|
||||
gtk_widget_set_sensitive (GTK_WIDGET (up_button), FALSE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), up_button, -1);
|
||||
gtk_container_add (GTK_CONTAINER (tool_bar), up_button);
|
||||
|
||||
home_button = gtk_tool_button_new (NULL, NULL);
|
||||
gtk_tool_button_set_label (GTK_TOOL_BUTTON (home_button), _("_Home"));
|
||||
gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (home_button), TRUE);
|
||||
gtk_tool_button_set_icon_name (GTK_TOOL_BUTTON (home_button), "go-home");
|
||||
gtk_tool_item_set_is_important (home_button, TRUE);
|
||||
gtk_toolbar_insert (GTK_TOOLBAR (tool_bar), home_button, -1);
|
||||
home_button = gtk_button_new_with_mnemonic ("_Home");
|
||||
gtk_container_add (GTK_CONTAINER (tool_bar), home_button);
|
||||
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
|
@@ -106,7 +106,7 @@ do_iconview_edit (GtkWidget *do_widget)
|
||||
GtkListStore *store;
|
||||
GtkCellRenderer *renderer;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -331,7 +331,7 @@ do_images (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Images");
|
||||
|
@@ -53,7 +53,7 @@ do_infobar (GtkWidget *do_widget)
|
||||
{
|
||||
actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Info Bars");
|
||||
|
@@ -52,7 +52,7 @@ do_links (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Links");
|
||||
|
@@ -255,7 +255,7 @@ do_list_store (GtkWidget *do_widget)
|
||||
GtkWidget *treeview;
|
||||
|
||||
/* create window, etc */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Store");
|
||||
|
@@ -347,7 +347,7 @@ do_listbox (GtkWidget *do_widget)
|
||||
{
|
||||
avatar_pixbuf_other = gdk_pixbuf_new_from_resource_at_scale ("/listbox/apple-red.png", 32, 32, FALSE, NULL);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "List Box");
|
||||
|
@@ -28,7 +28,6 @@
|
||||
<property name="default-width">800</property>
|
||||
<property name="default-height">600</property>
|
||||
<property name="title">GTK Demo</property>
|
||||
<signal name="destroy" handler="gtk_main_quit" swapped="no"/>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="headerbar">
|
||||
<property name="show-title-buttons">1</property>
|
||||
|
@@ -54,7 +54,7 @@ do_markup (GtkWidget *do_widget)
|
||||
GtkWidget *header;
|
||||
GtkWidget *show_source;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
|
@@ -28,7 +28,6 @@ demos = files([
|
||||
'fishbowl.c',
|
||||
'fixed.c',
|
||||
'fontrendering.c',
|
||||
'foreigndrawing.c',
|
||||
'gestures.c',
|
||||
'glarea.c',
|
||||
'headerbar.c',
|
||||
|
@@ -31,7 +31,7 @@ do_overlay (GtkWidget *do_widget)
|
||||
int i, j;
|
||||
char *text;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 500, 510);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Interactive Overlay");
|
||||
|
||||
|
@@ -35,7 +35,7 @@ do_overlay2 (GtkWidget *do_widget)
|
||||
GtkTextIter start, end;
|
||||
GtkAdjustment *adjustment;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 500, 510);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Decorative Overlay");
|
||||
|
||||
|
@@ -384,7 +384,7 @@ do_paint (GtkWidget *toplevel)
|
||||
{
|
||||
GtkWidget *draw_area, *headerbar, *colorbutton;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
|
||||
draw_area = drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), draw_area);
|
||||
|
@@ -156,7 +156,7 @@ do_paintable (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear Icon");
|
||||
|
@@ -188,7 +188,7 @@ do_paintable_animated (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear Animation");
|
||||
|
@@ -288,7 +288,7 @@ do_paintable_mediastream (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Nuclear MediaStream");
|
||||
|
@@ -146,7 +146,7 @@ do_panes (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
||||
|
@@ -36,7 +36,7 @@ do_password_entry (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -14,7 +14,7 @@ do_pickers (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pickers");
|
||||
|
@@ -174,7 +174,7 @@ do_pixbufs (GtkWidget *do_widget)
|
||||
{
|
||||
GError *error;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Pixbufs");
|
||||
|
@@ -130,7 +130,7 @@ do_popover (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Popovers");
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 24);
|
||||
g_object_set (box, "margin", 24, NULL);
|
||||
|
@@ -178,7 +178,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
PangoLayout *layout;
|
||||
PangoAttrList *attrs;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Rotated Text");
|
||||
|
@@ -250,7 +250,7 @@ do_search_entry (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Search Entry");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
@@ -68,7 +68,7 @@ do_search_entry2 (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Delayed Search Entry");
|
||||
gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (do_widget));
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
|
@@ -76,7 +76,7 @@ do_shortcuts (GtkWidget *do_widget)
|
||||
if (!icons_added)
|
||||
{
|
||||
icons_added = TRUE;
|
||||
gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (), "/icons");
|
||||
gtk_icon_theme_add_resource_path (gtk_icon_theme_get_for_display (gtk_widget_get_display (do_widget)), "/icons");
|
||||
}
|
||||
|
||||
g_type_ensure (G_TYPE_FILE_ICON);
|
||||
|
@@ -35,7 +35,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 500, 350);
|
||||
|
||||
|
@@ -100,7 +100,7 @@ do_sizegroup (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Size Groups");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
@@ -462,7 +462,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
||||
gtk_header_bar_set_show_title_buttons (GTK_HEADER_BAR (header), TRUE);
|
||||
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), restart);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), tweak);
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Sliding Puzzle");
|
||||
|
@@ -18,7 +18,7 @@ do_tabs (GtkWidget *do_widget)
|
||||
GtkTextBuffer *buffer;
|
||||
PangoTabArray *tabs;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Tabs");
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
|
@@ -63,7 +63,7 @@ do_tagged_entry (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
header = gtk_header_bar_new ();
|
||||
|
@@ -59,7 +59,7 @@ do_textmask (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_widget_set_size_request (window, 400, 200);
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Text Mask");
|
||||
|
@@ -180,7 +180,7 @@ do_textscroll (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *hbox;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Automatic Scrolling");
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
@@ -23,7 +23,7 @@ do_textundo (GtkWidget *do_widget)
|
||||
GtkTextBuffer *buffer;
|
||||
GtkTextIter iter;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
|
@@ -9,6 +9,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
#include <stdlib.h> /* for exit() */
|
||||
#include "paintable.h"
|
||||
|
||||
static void easter_egg_callback (GtkWidget *button, gpointer data);
|
||||
|
||||
@@ -124,20 +125,24 @@ create_tags (GtkTextBuffer *buffer)
|
||||
}
|
||||
|
||||
static void
|
||||
insert_text (GtkTextBuffer *buffer)
|
||||
insert_text (GtkTextView *view)
|
||||
{
|
||||
GtkWidget *widget = GTK_WIDGET (view);
|
||||
GtkTextBuffer *buffer = gtk_text_view_get_buffer (view);
|
||||
GtkTextIter iter;
|
||||
GtkTextIter start, end;
|
||||
GdkTexture *texture;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconPaintable *icon;
|
||||
GdkPaintable *nuclear;
|
||||
|
||||
icon_theme = gtk_icon_theme_get_default ();
|
||||
texture = GDK_TEXTURE (gtk_icon_theme_load_icon (icon_theme,
|
||||
"gtk3-demo",
|
||||
32,
|
||||
GTK_ICON_LOOKUP_GENERIC_FALLBACK,
|
||||
NULL));
|
||||
g_assert (texture);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
|
||||
icon = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
"face-cool",
|
||||
NULL,
|
||||
32, 1,
|
||||
gtk_widget_get_direction (widget),
|
||||
0);
|
||||
nuclear = gtk_nuclear_animation_new ();
|
||||
|
||||
/* get start of buffer; each insertion will revalidate the
|
||||
* iterator to point to just after the inserted text.
|
||||
@@ -233,9 +238,11 @@ insert_text (GtkTextBuffer *buffer)
|
||||
"heading", NULL);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, "The buffer can have images in it: ", -1);
|
||||
gtk_text_buffer_insert_texture (buffer, &iter, texture);
|
||||
gtk_text_buffer_insert_texture (buffer, &iter, texture);
|
||||
gtk_text_buffer_insert_texture (buffer, &iter, texture);
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
|
||||
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, nuclear);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, " for example.\n\n", -1);
|
||||
|
||||
gtk_text_buffer_insert_with_tags_by_name (buffer, &iter, "Spacing. ", -1,
|
||||
@@ -380,7 +387,8 @@ insert_text (GtkTextBuffer *buffer)
|
||||
|
||||
gtk_text_buffer_end_irreversible_action (buffer);
|
||||
|
||||
g_object_unref (texture);
|
||||
g_object_unref (icon);
|
||||
g_object_unref (nuclear);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -466,7 +474,7 @@ do_textview (GtkWidget *do_widget)
|
||||
GtkWidget *sw;
|
||||
GtkTextBuffer *buffer;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window),
|
||||
@@ -506,7 +514,7 @@ do_textview (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (sw), view2);
|
||||
|
||||
create_tags (buffer);
|
||||
insert_text (buffer);
|
||||
insert_text (GTK_TEXT_VIEW (view1));
|
||||
|
||||
attach_widgets (GTK_TEXT_VIEW (view1));
|
||||
attach_widgets (GTK_TEXT_VIEW (view2));
|
||||
@@ -580,7 +588,7 @@ easter_egg_callback (GtkWidget *button,
|
||||
|
||||
g_object_unref (buffer);
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
|
@@ -15,104 +15,6 @@
|
||||
<property name="margin">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="width-chars">10</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="valign">center</property>
|
||||
@@ -143,68 +45,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
<class name="inline-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
|
@@ -4,103 +4,6 @@
|
||||
<property name="row-spacing">10</property>
|
||||
<property name="margin">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-arrow">0</property>
|
||||
<style>
|
||||
<class name="primary-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Raised Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="active">1</property>
|
||||
<style>
|
||||
<class name="raised"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="is-important">1</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkEntry" id="entry1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="invisible-char">•</property>
|
||||
<property name="placeholder-text" translatable="yes">Search...</property>
|
||||
<property name="secondary-icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkSwitch" id="switch1">
|
||||
<property name="can-focus">1</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="tooltip_text">Switch it</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="valign">center</property>
|
||||
@@ -131,68 +34,6 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<style>
|
||||
<class name="inline-toolbar"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Normal</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-add-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="label" translatable="yes">Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">list-remove-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">edit-find-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleToolButton">
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insensitive Active</property>
|
||||
<property name="use-underline">1</property>
|
||||
<property name="icon-name">go-up-symbolic</property>
|
||||
<property name="active">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
|
@@ -4,8 +4,8 @@
|
||||
* with widgets to inform the theme about intended rendering.
|
||||
*
|
||||
* This demo shows some common examples where theming features
|
||||
* of GTK are used for certain effects: primary toolbars,
|
||||
* inline toolbars and linked buttons.
|
||||
* of GTK are used for certain effects: primary toolbars
|
||||
* and linked buttons.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
@@ -20,7 +20,7 @@ do_theming_style_classes (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Style Classes");
|
||||
|
@@ -18,7 +18,7 @@ do_transparent (GtkWidget *do_widget)
|
||||
GtkWidget *label;
|
||||
GtkWidget *picture;
|
||||
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 450, 450);
|
||||
|
@@ -390,7 +390,7 @@ do_tree_store (GtkWidget *do_widget)
|
||||
GtkTreeModel *model;
|
||||
|
||||
/* create window, etc */
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Tree Store");
|
||||
|
@@ -63,7 +63,7 @@ do_video_player (GtkWidget *do_widget)
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Video Player");
|
||||
|
@@ -49,7 +49,9 @@ struct _IconBrowserWindow
|
||||
GtkWidget *image4;
|
||||
GtkWidget *image5;
|
||||
GtkWidget *image6;
|
||||
GtkWidget *label6;
|
||||
GtkWidget *image7;
|
||||
GtkWidget *image8;
|
||||
GtkWidget *label8;
|
||||
GtkWidget *description;
|
||||
};
|
||||
|
||||
@@ -60,6 +62,12 @@ struct _IconBrowserWindowClass
|
||||
|
||||
G_DEFINE_TYPE(IconBrowserWindow, icon_browser_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
static GtkIconTheme *
|
||||
icon_browser_window_get_icon_theme (IconBrowserWindow *win)
|
||||
{
|
||||
return gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (win)));
|
||||
}
|
||||
|
||||
static void
|
||||
search_text_changed (GtkEntry *entry, IconBrowserWindow *win)
|
||||
{
|
||||
@@ -83,6 +91,7 @@ set_image (GtkWidget *image, const gchar *name, gint size)
|
||||
static void
|
||||
item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *win)
|
||||
{
|
||||
GtkIconTheme *icon_theme = icon_browser_window_get_icon_theme (win);
|
||||
GtkTreeIter iter;
|
||||
gchar *name;
|
||||
gchar *description;
|
||||
@@ -99,28 +108,30 @@ item_activated (GtkIconView *icon_view, GtkTreePath *path, IconBrowserWindow *wi
|
||||
ICON_STORE_DESCRIPTION_COLUMN, &description,
|
||||
-1);
|
||||
|
||||
if (name == NULL || !gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), name))
|
||||
if (name == NULL || !gtk_icon_theme_has_icon (icon_theme, name))
|
||||
{
|
||||
g_free (description);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_window_set_title (GTK_WINDOW (win->details), name);
|
||||
set_image (win->image1, name, 16);
|
||||
set_image (win->image2, name, 24);
|
||||
set_image (win->image3, name, 32);
|
||||
set_image (win->image4, name, 48);
|
||||
set_image (win->image5, name, 64);
|
||||
set_image (win->image1, name, 8);
|
||||
set_image (win->image2, name, 16);
|
||||
set_image (win->image3, name, 18);
|
||||
set_image (win->image4, name, 24);
|
||||
set_image (win->image5, name, 32);
|
||||
set_image (win->image6, name, 48);
|
||||
set_image (win->image7, name, 64);
|
||||
if (win->symbolic)
|
||||
{
|
||||
gtk_widget_show (win->image6);
|
||||
gtk_widget_show (win->label6);
|
||||
set_image (win->image6, name, 64);
|
||||
gtk_widget_show (win->image8);
|
||||
gtk_widget_show (win->label8);
|
||||
set_image (win->image8, name, 64);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_widget_hide (win->image6);
|
||||
gtk_widget_hide (win->label6);
|
||||
gtk_widget_hide (win->image8);
|
||||
gtk_widget_hide (win->label8);
|
||||
}
|
||||
if (description && description[0])
|
||||
{
|
||||
@@ -144,18 +155,19 @@ add_icon (IconBrowserWindow *win,
|
||||
const gchar *description,
|
||||
const gchar *context)
|
||||
{
|
||||
GtkIconTheme *icon_theme = icon_browser_window_get_icon_theme (win);
|
||||
gchar *regular_name;
|
||||
gchar *symbolic_name;
|
||||
|
||||
regular_name = g_strdup (name);
|
||||
if (!gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), regular_name))
|
||||
if (!gtk_icon_theme_has_icon (icon_theme, regular_name))
|
||||
{
|
||||
g_free (regular_name);
|
||||
regular_name = NULL;
|
||||
}
|
||||
|
||||
symbolic_name = g_strconcat (name, "-symbolic", NULL);
|
||||
if (!gtk_icon_theme_has_icon (gtk_icon_theme_get_default (), symbolic_name))
|
||||
if (!gtk_icon_theme_has_icon (icon_theme, symbolic_name))
|
||||
{
|
||||
g_free (symbolic_name);
|
||||
symbolic_name = NULL;
|
||||
@@ -348,7 +360,7 @@ get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconInfo *icon_info;
|
||||
GtkIconPaintable *icon;
|
||||
int size;
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
@@ -359,11 +371,15 @@ get_image_paintable (GtkImage *image)
|
||||
icon_name = gtk_image_get_icon_name (image);
|
||||
size = gtk_image_get_pixel_size (image);
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (image)));
|
||||
icon_info = gtk_icon_theme_lookup_icon (icon_theme, icon_name, size,
|
||||
GTK_ICON_LOOKUP_FORCE_SIZE | GTK_ICON_LOOKUP_GENERIC_FALLBACK);
|
||||
if (icon_info == NULL)
|
||||
icon = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
icon_name,
|
||||
NULL,
|
||||
size, 1,
|
||||
gtk_widget_get_direction (GTK_WIDGET (image)),
|
||||
0);
|
||||
if (icon == NULL)
|
||||
return NULL;
|
||||
return gtk_icon_info_load_icon (icon_info, NULL);
|
||||
return GDK_PAINTABLE (icon);
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
@@ -404,16 +420,20 @@ static void
|
||||
get_file (GValue *value,
|
||||
gpointer data)
|
||||
{
|
||||
GtkIconTheme *icon_theme;
|
||||
const char *name;
|
||||
GtkIconInfo *info;
|
||||
GFile *file;
|
||||
GtkIconPaintable *info;
|
||||
|
||||
name = gtk_image_get_icon_name (GTK_IMAGE (data));
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (GTK_WIDGET (data)));
|
||||
|
||||
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0);
|
||||
file = g_file_new_for_path (gtk_icon_info_get_filename (info));
|
||||
g_value_set_object (value, file);
|
||||
g_object_unref (file);
|
||||
info = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
name,
|
||||
NULL,
|
||||
32, 1,
|
||||
gtk_widget_get_direction (GTK_WIDGET (data)),
|
||||
0);
|
||||
g_value_take_object (value, gtk_icon_paintable_get_file (info));
|
||||
g_object_unref (info);
|
||||
}
|
||||
|
||||
@@ -424,7 +444,7 @@ setup_image_dnd (GtkWidget *image)
|
||||
GtkDragSource *source;
|
||||
|
||||
source = gtk_drag_source_new ();
|
||||
content = gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image);
|
||||
content = gdk_content_provider_new_with_callback (GDK_TYPE_TEXTURE, get_texture, image, NULL);
|
||||
gtk_drag_source_set_content (source, content);
|
||||
g_object_unref (content);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
@@ -438,7 +458,7 @@ setup_scalable_image_dnd (GtkWidget *image)
|
||||
GtkDragSource *source;
|
||||
|
||||
source = gtk_drag_source_new ();
|
||||
content = gdk_content_provider_new_with_callback (G_TYPE_FILE, get_file, image);
|
||||
content = gdk_content_provider_new_with_callback (G_TYPE_FILE, get_file, image, NULL);
|
||||
gtk_drag_source_set_content (source, content);
|
||||
g_object_unref (content);
|
||||
|
||||
@@ -465,7 +485,9 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
setup_image_dnd (win->image3);
|
||||
setup_image_dnd (win->image4);
|
||||
setup_image_dnd (win->image5);
|
||||
setup_scalable_image_dnd (win->image6);
|
||||
setup_image_dnd (win->image6);
|
||||
setup_image_dnd (win->image7);
|
||||
setup_scalable_image_dnd (win->image8);
|
||||
|
||||
win->contexts = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, context_free);
|
||||
|
||||
@@ -522,7 +544,9 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image4);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image5);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image6);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, label6);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image7);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, image8);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, label8);
|
||||
gtk_widget_class_bind_template_child (GTK_WIDGET_CLASS (class), IconBrowserWindow, description);
|
||||
|
||||
gtk_widget_class_bind_template_callback (GTK_WIDGET_CLASS (class), search_text_changed);
|
||||
|
@@ -198,7 +198,7 @@
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label6"/>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">5</property>
|
||||
@@ -206,11 +206,37 @@
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image7">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label5"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">6</property>
|
||||
<property name="top-attach">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImage" id="image8">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">end</property>
|
||||
<accessibility>
|
||||
<relation type="labelled-by" target="label6"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">7</property>
|
||||
<property name="top-attach">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">16×16</property>
|
||||
<property name="label">8×8</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -227,7 +253,7 @@
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">24×24</property>
|
||||
<property name="label">16×16</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -244,7 +270,7 @@
|
||||
<object class="GtkLabel" id="label3">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">32×32</property>
|
||||
<property name="label">18×18</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -261,7 +287,7 @@
|
||||
<object class="GtkLabel" id="label4">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">48×48</property>
|
||||
<property name="label">24×24</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -278,7 +304,7 @@
|
||||
<object class="GtkLabel" id="label5">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">64×64</property>
|
||||
<property name="label">32×32</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -295,7 +321,7 @@
|
||||
<object class="GtkLabel" id="label6">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">scalable</property>
|
||||
<property name="label">48×48</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
@@ -308,6 +334,40 @@
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label7">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">64×64</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image7"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">6</property>
|
||||
<property name="top-attach">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="label8">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="label">scalable</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
<accessibility>
|
||||
<relation type="label-for" target="image8"/>
|
||||
</accessibility>
|
||||
<layout>
|
||||
<property name="left-attach">7</property>
|
||||
<property name="top-attach">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
|
@@ -1815,26 +1815,26 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar" id="toolbar">
|
||||
<object class="GtkBox" id="toolbar">
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">New</property>
|
||||
<property name="icon-name">document-new</property>
|
||||
<property name="tooltip-text" translatable="yes">Create a new document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Save</property>
|
||||
<property name="icon-name">document-save</property>
|
||||
<property name="tooltip-text" translatable="yes">Save the current document</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorToolItem"/>
|
||||
<object class="GtkSeparator"/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Search</property>
|
||||
<property name="icon-name">edit-find</property>
|
||||
<property name="action-name">win.search</property>
|
||||
@@ -1842,7 +1842,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton">
|
||||
<object class="GtkButton">
|
||||
<property name="sensitive">0</property>
|
||||
<property name="label" translatable="yes">Insert</property>
|
||||
<property name="icon-name">insert-image</property>
|
||||
@@ -2007,27 +2007,26 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<property name="toolbar-style">icons</property>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="inline-toolbar"/>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="decrease_button">
|
||||
<object class="GtkButton" id="decrease_button">
|
||||
<property name="icon-name">zoom-out-symbolic</property>
|
||||
<property name="tooltip-text">Normal icons</property>
|
||||
<signal name="clicked" handler="decrease_icon_size" object="iconview1" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="increase_button">
|
||||
<object class="GtkButton" id="increase_button">
|
||||
<property name="icon-name">zoom-in-symbolic</property>
|
||||
<property name="tooltip-text">Large icons</property>
|
||||
<signal name="clicked" handler="increase_icon_size" object="iconview1" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="reset_button">
|
||||
<object class="GtkButton" id="reset_button">
|
||||
<property name="icon-name">zoom-original-symbolic</property>
|
||||
<property name="tooltip-text">Inherited icon size</property>
|
||||
<signal name="clicked" handler="reset_icon_size" object="iconview1" swapped="yes"/>
|
||||
@@ -2478,26 +2477,25 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkToolbar">
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="toolbar-style">icons</property>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton1">
|
||||
<object class="GtkButton" id="toolbutton1">
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton2">
|
||||
<object class="GtkButton" id="toolbutton2">
|
||||
<property name="icon-name">send-to-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton3">
|
||||
<object class="GtkButton" id="toolbutton3">
|
||||
<property name="icon-name">view-fullscreen-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolButton" id="toolbutton4">
|
||||
<object class="GtkButton" id="toolbutton4">
|
||||
<property name="icon-name">star-new-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -2557,7 +2555,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<child type="overlay">
|
||||
<object class="GtkToolbar" id="totem_like_osd">
|
||||
<object class="GtkBox" id="totem_like_osd">
|
||||
<property name="visible">0</property>
|
||||
<property name="opacity">0.9</property>
|
||||
<property name="margin">20</property>
|
||||
@@ -2566,48 +2564,36 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<class name="osd"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-start-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">pan-end-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<property name="expand-item">1</property>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkScale">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="draw-value">0</property>
|
||||
<property name="adjustment">adjustment1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToolItem">
|
||||
<child>
|
||||
<object class="GtkVolumeButton">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="value">.5</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<object class="GtkVolumeButton">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="value">.5</property>
|
||||
<style>
|
||||
<class name="image-button"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
|
@@ -94,7 +94,6 @@ gdk_display_get_default_seat
|
||||
gdk_display_list_seats
|
||||
gdk_display_get_n_monitors
|
||||
gdk_display_get_monitor
|
||||
gdk_display_get_primary_monitor
|
||||
gdk_display_get_monitor_at_surface
|
||||
gdk_display_get_clipboard
|
||||
gdk_display_get_primary_clipboard
|
||||
@@ -178,7 +177,6 @@ GdkSurfaceEdge
|
||||
GdkSurfaceTypeHint
|
||||
GdkSurfaceState
|
||||
gdk_surface_new_toplevel
|
||||
gdk_surface_new_temp
|
||||
gdk_surface_new_popup
|
||||
gdk_surface_get_parent
|
||||
gdk_surface_destroy
|
||||
@@ -186,7 +184,6 @@ gdk_surface_get_surface_type
|
||||
gdk_surface_get_display
|
||||
gdk_surface_show
|
||||
gdk_surface_show_unraised
|
||||
gdk_surface_show_with_auto_dismissal
|
||||
gdk_surface_hide
|
||||
gdk_surface_is_destroyed
|
||||
gdk_surface_is_visible
|
||||
@@ -368,7 +365,6 @@ gdk_pango_layout_line_get_clip_region
|
||||
<TITLE>Cairo Interaction</TITLE>
|
||||
<FILE>cairo_interaction</FILE>
|
||||
gdk_surface_create_similar_surface
|
||||
gdk_cairo_get_clip_rectangle
|
||||
gdk_cairo_set_source_rgba
|
||||
gdk_cairo_set_source_pixbuf
|
||||
gdk_cairo_rectangle
|
||||
@@ -1127,7 +1123,6 @@ gdk_monitor_get_scale_factor
|
||||
gdk_monitor_get_refresh_rate
|
||||
GdkSubpixelLayout
|
||||
gdk_monitor_get_subpixel_layout
|
||||
gdk_monitor_is_primary
|
||||
gdk_monitor_is_valid
|
||||
|
||||
<SUBSECTION Standard>
|
||||
|
@@ -109,9 +109,8 @@ gsk_text_node_new
|
||||
gsk_text_node_peek_font
|
||||
gsk_text_node_peek_glyphs
|
||||
gsk_text_node_peek_color
|
||||
gsk_text_node_get_x
|
||||
gsk_text_node_get_y
|
||||
gsk_text_node_get_num_glyphs
|
||||
gsk_text_node_get_offset
|
||||
gsk_blur_node_new
|
||||
gsk_blur_node_get_child
|
||||
gsk_blur_node_get_radius
|
||||
|
@@ -1092,42 +1092,6 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
<entry><ulink url="https://www.w3.org/TR/css3-ui/#outline-offset">CSS3</ulink></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">-gtk-outline-top-left-radius</phrase></entry>
|
||||
<entry><code>〈corner radius〉</code></entry>
|
||||
<entry><code>0</code></entry>
|
||||
<entry></entry>
|
||||
<entry>✓</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">-gtk-outline-top-right-radius</phrase></entry>
|
||||
<entry><code>〈corner radius〉</code></entry>
|
||||
<entry><code>0</code></entry>
|
||||
<entry></entry>
|
||||
<entry>✓</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">-gtk-outline-bottom-right-radius</phrase></entry>
|
||||
<entry><code>〈corner radius〉</code></entry>
|
||||
<entry><code>0</code></entry>
|
||||
<entry></entry>
|
||||
<entry>✓</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">-gtk-outline-bottom-left-radius</phrase></entry>
|
||||
<entry><code>〈corner radius〉</code></entry>
|
||||
<entry><code>0</code></entry>
|
||||
<entry></entry>
|
||||
<entry>✓</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
<tgroup cols="5">
|
||||
@@ -1143,13 +1107,6 @@ We use <literallayout> for syntax productions, and each line is put in a <code>
|
||||
<ulink url="https://www.w3.org/TR/css3-ui/#propdef-outline">CSS3</ulink></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><phrase role="nowrap">-gtk-outline-radius</phrase></entry>
|
||||
<entry><code>[ 〈length〉 | 〈percentage〉 ]{1,4} [ / [ 〈length〉 | 〈percentage〉 ]{1,4} ]?</code></entry>
|
||||
<entry>see individual properties</entry>
|
||||
<entry></entry>
|
||||
<entry></entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
|
@@ -214,17 +214,9 @@
|
||||
</chapter>
|
||||
|
||||
<chapter id="MenusAndCombos">
|
||||
<title>Menus, Combo Box, Toolbar</title>
|
||||
<title>Menus, Combo Box</title>
|
||||
<xi:include href="xml/gtkcombobox.xml" />
|
||||
<xi:include href="xml/gtkcomboboxtext.xml" />
|
||||
<xi:include href="xml/gtktoolshell.xml" />
|
||||
<xi:include href="xml/gtktoolbar.xml" />
|
||||
<xi:include href="xml/gtktoolitem.xml" />
|
||||
<xi:include href="xml/gtkseparatortoolitem.xml" />
|
||||
<xi:include href="xml/gtktoolbutton.xml" />
|
||||
<xi:include href="xml/gtkmenutoolbutton.xml" />
|
||||
<xi:include href="xml/gtktoggletoolbutton.xml" />
|
||||
<xi:include href="xml/gtkradiotoolbutton.xml" />
|
||||
<xi:include href="xml/gtkpopover.xml" />
|
||||
<xi:include href="xml/gtkpopovermenu.xml" />
|
||||
<xi:include href="xml/gtkpopovermenubar.xml" />
|
||||
@@ -246,6 +238,7 @@
|
||||
<xi:include href="xml/gtkfontbutton.xml" />
|
||||
<xi:include href="xml/gtkfontchooserwidget.xml" />
|
||||
<xi:include href="xml/gtkfontchooserdialog.xml" />
|
||||
<xi:include href="xml/gtkemojichooser.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="DrawingWidgets">
|
||||
@@ -374,7 +367,6 @@
|
||||
<xi:include href="xml/gtkstylecontext.xml" />
|
||||
<xi:include href="xml/gtkcssprovider.xml" />
|
||||
<xi:include href="xml/gtkstyleprovider.xml" />
|
||||
<xi:include href="xml/gtkwidgetpath.xml" />
|
||||
<xi:include href="xml/gtkicontheme.xml" />
|
||||
</part>
|
||||
|
||||
|
@@ -616,7 +616,6 @@ gtk_button_get_type
|
||||
<FILE>gtkcalendar</FILE>
|
||||
<TITLE>GtkCalendar</TITLE>
|
||||
GtkCalendar
|
||||
GtkCalendarDetailFunc
|
||||
GtkCalendarDisplayOptions
|
||||
|
||||
<SUBSECTION>
|
||||
@@ -633,13 +632,6 @@ gtk_calendar_get_display_options
|
||||
gtk_calendar_set_display_options
|
||||
gtk_calendar_get_date
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_calendar_set_detail_func
|
||||
gtk_calendar_get_detail_width_chars
|
||||
gtk_calendar_set_detail_width_chars
|
||||
gtk_calendar_get_detail_height_rows
|
||||
gtk_calendar_set_detail_height_rows
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_CALENDAR
|
||||
GTK_IS_CALENDAR
|
||||
@@ -3003,218 +2995,6 @@ gtk_toggle_button_get_type
|
||||
GtkToggleButtonPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolshell</FILE>
|
||||
<TITLE>GtkToolShell</TITLE>
|
||||
GtkToolShell
|
||||
GtkToolShellIface
|
||||
gtk_tool_shell_get_ellipsize_mode
|
||||
gtk_tool_shell_get_orientation
|
||||
gtk_tool_shell_get_style
|
||||
gtk_tool_shell_get_text_alignment
|
||||
gtk_tool_shell_get_text_orientation
|
||||
gtk_tool_shell_rebuild_menu
|
||||
gtk_tool_shell_get_text_size_group
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_IS_TOOL_SHELL
|
||||
GTK_TOOL_SHELL
|
||||
GTK_TOOL_SHELL_GET_IFACE
|
||||
GTK_TYPE_TOOL_SHELL
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_tool_shell_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolbar</FILE>
|
||||
<TITLE>GtkToolbar</TITLE>
|
||||
GtkToolbar
|
||||
gtk_toolbar_new
|
||||
gtk_toolbar_insert
|
||||
gtk_toolbar_get_item_index
|
||||
gtk_toolbar_get_n_items
|
||||
gtk_toolbar_get_nth_item
|
||||
gtk_toolbar_get_drop_index
|
||||
gtk_toolbar_set_drop_highlight_item
|
||||
gtk_toolbar_set_show_arrow
|
||||
gtk_toolbar_get_show_arrow
|
||||
gtk_toolbar_get_style
|
||||
|
||||
gtk_toolbar_set_style
|
||||
gtk_toolbar_unset_style
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TOOLBAR
|
||||
GTK_IS_TOOLBAR
|
||||
GTK_TYPE_TOOLBAR
|
||||
GTK_TOOLBAR_CLASS
|
||||
GTK_IS_TOOLBAR_CLASS
|
||||
GTK_TOOLBAR_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_toolbar_get_type
|
||||
GtkToolbarPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolitem</FILE>
|
||||
<TITLE>GtkToolItem</TITLE>
|
||||
GtkToolItem
|
||||
GtkToolItemClass
|
||||
gtk_tool_item_new
|
||||
gtk_tool_item_set_homogeneous
|
||||
gtk_tool_item_get_homogeneous
|
||||
gtk_tool_item_set_expand
|
||||
gtk_tool_item_get_expand
|
||||
gtk_tool_item_set_tooltip_text
|
||||
gtk_tool_item_set_tooltip_markup
|
||||
gtk_tool_item_set_visible_horizontal
|
||||
gtk_tool_item_get_visible_horizontal
|
||||
gtk_tool_item_set_visible_vertical
|
||||
gtk_tool_item_get_visible_vertical
|
||||
gtk_tool_item_set_is_important
|
||||
gtk_tool_item_get_is_important
|
||||
gtk_tool_item_get_ellipsize_mode
|
||||
gtk_tool_item_get_orientation
|
||||
gtk_tool_item_get_toolbar_style
|
||||
gtk_tool_item_get_text_alignment
|
||||
gtk_tool_item_get_text_orientation
|
||||
gtk_tool_item_set_overflow_text
|
||||
gtk_tool_item_get_overflow_text
|
||||
gtk_tool_item_rebuild_menu
|
||||
gtk_tool_item_toolbar_reconfigured
|
||||
gtk_tool_item_get_text_size_group
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_TOOL_ITEM
|
||||
GTK_TOOL_ITEM
|
||||
GTK_TOOL_ITEM_CLASS
|
||||
GTK_IS_TOOL_ITEM
|
||||
GTK_IS_TOOL_ITEM_CLASS
|
||||
GTK_TOOL_ITEM_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_tool_item_get_type
|
||||
GtkToolItemPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkseparatortoolitem</FILE>
|
||||
<TITLE>GtkSeparatorToolItem</TITLE>
|
||||
GtkSeparatorToolItem
|
||||
gtk_separator_tool_item_new
|
||||
gtk_separator_tool_item_set_draw
|
||||
gtk_separator_tool_item_get_draw
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_SEPARATOR_TOOL_ITEM
|
||||
GTK_SEPARATOR_TOOL_ITEM
|
||||
GTK_SEPARATOR_TOOL_ITEM_CLASS
|
||||
GTK_IS_SEPARATOR_TOOL_ITEM
|
||||
GTK_IS_SEPARATOR_TOOL_ITEM_CLASS
|
||||
GTK_SEPARATOR_TOOL_ITEM_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_separator_tool_item_get_type
|
||||
GtkSeparatorToolItemPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoolbutton</FILE>
|
||||
<TITLE>GtkToolButton</TITLE>
|
||||
GtkToolButton
|
||||
GtkToolButtonClass
|
||||
gtk_tool_button_new
|
||||
gtk_tool_button_set_label
|
||||
gtk_tool_button_get_label
|
||||
gtk_tool_button_set_use_underline
|
||||
gtk_tool_button_get_use_underline
|
||||
gtk_tool_button_set_icon_name
|
||||
gtk_tool_button_get_icon_name
|
||||
gtk_tool_button_set_icon_widget
|
||||
gtk_tool_button_get_icon_widget
|
||||
gtk_tool_button_set_label_widget
|
||||
gtk_tool_button_get_label_widget
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_TOOL_BUTTON
|
||||
GTK_TOOL_BUTTON
|
||||
GTK_TOOL_BUTTON_CLASS
|
||||
GTK_IS_TOOL_BUTTON
|
||||
GTK_IS_TOOL_BUTTON_CLASS
|
||||
GTK_TOOL_BUTTON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_tool_button_get_type
|
||||
GtkToolButtonPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmenutoolbutton</FILE>
|
||||
<TITLE>GtkMenuToolButton</TITLE>
|
||||
GtkMenuToolButton
|
||||
gtk_menu_tool_button_new
|
||||
gtk_menu_tool_button_set_popover
|
||||
gtk_menu_tool_button_get_popover
|
||||
gtk_menu_tool_button_set_arrow_tooltip_text
|
||||
gtk_menu_tool_button_set_arrow_tooltip_markup
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_MENU_TOOL_BUTTON
|
||||
GTK_MENU_TOOL_BUTTON
|
||||
GTK_MENU_TOOL_BUTTON_CLASS
|
||||
GTK_IS_MENU_TOOL_BUTTON
|
||||
GTK_IS_MENU_TOOL_BUTTON_CLASS
|
||||
GTK_MENU_TOOL_BUTTON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_menu_tool_button_get_type
|
||||
GtkMenuToolButtonPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkradiotoolbutton</FILE>
|
||||
<TITLE>GtkRadioToolButton</TITLE>
|
||||
GtkRadioToolButton
|
||||
gtk_radio_tool_button_new
|
||||
gtk_radio_tool_button_new_from_widget
|
||||
gtk_radio_tool_button_get_group
|
||||
gtk_radio_tool_button_set_group
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_RADIO_TOOL_BUTTON
|
||||
GTK_RADIO_TOOL_BUTTON
|
||||
GTK_RADIO_TOOL_BUTTON_CLASS
|
||||
GTK_IS_RADIO_TOOL_BUTTON
|
||||
GTK_IS_RADIO_TOOL_BUTTON_CLASS
|
||||
GTK_RADIO_TOOL_BUTTON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_radio_tool_button_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktoggletoolbutton</FILE>
|
||||
<TITLE>GtkToggleToolButton</TITLE>
|
||||
GtkToggleToolButton
|
||||
GtkToggleToolButtonClass
|
||||
gtk_toggle_tool_button_new
|
||||
gtk_toggle_tool_button_set_active
|
||||
gtk_toggle_tool_button_get_active
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_TOGGLE_TOOL_BUTTON
|
||||
GTK_TOGGLE_TOOL_BUTTON
|
||||
GTK_TOGGLE_TOOL_BUTTON_CLASS
|
||||
GTK_IS_TOGGLE_TOOL_BUTTON
|
||||
GTK_IS_TOGGLE_TOOL_BUTTON_CLASS
|
||||
GTK_TOGGLE_TOOL_BUTTON_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_toggle_tool_button_get_type
|
||||
GtkToggleToolButtonPrivate
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtktooltip</FILE>
|
||||
<TITLE>GtkTooltip</TITLE>
|
||||
@@ -4409,6 +4189,9 @@ gtk_widget_insert_after
|
||||
gtk_widget_set_layout_manager
|
||||
gtk_widget_get_layout_manager
|
||||
gtk_widget_should_layout
|
||||
gtk_widget_add_css_class
|
||||
gtk_widget_remove_css_class
|
||||
gtk_widget_has_css_class
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_widget_get_style_context
|
||||
@@ -4503,7 +4286,6 @@ gtk_requisition_get_type
|
||||
<TITLE>GtkWindow</TITLE>
|
||||
GtkWindow
|
||||
GtkWindowClass
|
||||
GtkWindowType
|
||||
gtk_window_new
|
||||
gtk_window_set_title
|
||||
gtk_window_set_resizable
|
||||
@@ -4635,13 +4417,6 @@ gtk_get_default_language
|
||||
gtk_get_locale_direction
|
||||
gtk_init
|
||||
gtk_init_check
|
||||
gtk_events_pending
|
||||
gtk_main
|
||||
gtk_main_level
|
||||
gtk_main_quit
|
||||
gtk_main_iteration
|
||||
gtk_main_iteration_do
|
||||
gtk_main_do_event
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_grab_add
|
||||
@@ -4661,7 +4436,6 @@ gtk_get_current_event_device
|
||||
gtk_get_event_widget
|
||||
gtk_get_event_target
|
||||
gtk_get_event_target_with_type
|
||||
gtk_propagate_event
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_init_abi_check
|
||||
@@ -4689,50 +4463,6 @@ GTK_INTERFACE_AGE
|
||||
GTK_CHECK_VERSION
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkwidgetpath</FILE>
|
||||
<TITLE>GtkWidgetPath</TITLE>
|
||||
GtkWidgetPath
|
||||
gtk_widget_path_append_type
|
||||
gtk_widget_path_append_with_siblings
|
||||
gtk_widget_path_append_for_widget
|
||||
gtk_widget_path_copy
|
||||
gtk_widget_path_ref
|
||||
gtk_widget_path_unref
|
||||
gtk_widget_path_free
|
||||
gtk_widget_path_get_object_type
|
||||
gtk_widget_path_has_parent
|
||||
gtk_widget_path_is_type
|
||||
gtk_widget_path_iter_add_class
|
||||
gtk_widget_path_iter_clear_classes
|
||||
gtk_widget_path_iter_get_name
|
||||
gtk_widget_path_iter_get_object_name
|
||||
gtk_widget_path_iter_get_object_type
|
||||
gtk_widget_path_iter_get_siblings
|
||||
gtk_widget_path_iter_get_sibling_index
|
||||
gtk_widget_path_iter_get_state
|
||||
gtk_widget_path_iter_has_class
|
||||
gtk_widget_path_iter_has_name
|
||||
gtk_widget_path_iter_has_qclass
|
||||
gtk_widget_path_iter_has_qname
|
||||
gtk_widget_path_iter_list_classes
|
||||
gtk_widget_path_iter_remove_class
|
||||
gtk_widget_path_iter_set_name
|
||||
gtk_widget_path_iter_set_object_name
|
||||
gtk_widget_path_iter_set_object_type
|
||||
gtk_widget_path_iter_set_state
|
||||
gtk_widget_path_length
|
||||
gtk_widget_path_new
|
||||
gtk_widget_path_prepend_type
|
||||
gtk_widget_path_to_string
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_WIDGET_PATH
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_widget_path_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkstyleprovider</FILE>
|
||||
<TITLE>GtkStyleProvider</TITLE>
|
||||
@@ -4755,16 +4485,6 @@ gtk_style_provider_get_type
|
||||
<FILE>gtkstylecontext</FILE>
|
||||
<TITLE>GtkStyleContext</TITLE>
|
||||
<SUBSECTION>
|
||||
GTK_STYLE_PROPERTY_BACKGROUND_COLOR
|
||||
GTK_STYLE_PROPERTY_COLOR
|
||||
GTK_STYLE_PROPERTY_FONT
|
||||
GTK_STYLE_PROPERTY_MARGIN
|
||||
GTK_STYLE_PROPERTY_PADDING
|
||||
GTK_STYLE_PROPERTY_BORDER_WIDTH
|
||||
GTK_STYLE_PROPERTY_BORDER_RADIUS
|
||||
GTK_STYLE_PROPERTY_BORDER_STYLE
|
||||
GTK_STYLE_PROPERTY_BORDER_COLOR
|
||||
GTK_STYLE_PROPERTY_BACKGROUND_IMAGE
|
||||
GtkBorderStyle
|
||||
<SUBSECTION>
|
||||
GTK_STYLE_CLASS_ACCELERATOR
|
||||
@@ -4794,7 +4514,6 @@ GTK_STYLE_CLASS_HIGHLIGHT
|
||||
GTK_STYLE_CLASS_HORIZONTAL
|
||||
GTK_STYLE_CLASS_IMAGE
|
||||
GTK_STYLE_CLASS_INFO
|
||||
GTK_STYLE_CLASS_INLINE_TOOLBAR
|
||||
GTK_STYLE_CLASS_INSERTION_CURSOR
|
||||
GTK_STYLE_CLASS_LABEL
|
||||
GTK_STYLE_CLASS_LEFT
|
||||
@@ -4816,7 +4535,6 @@ GTK_STYLE_CLASS_PANE_SEPARATOR
|
||||
GTK_STYLE_CLASS_PAPER
|
||||
GTK_STYLE_CLASS_POPUP
|
||||
GTK_STYLE_CLASS_POPOVER
|
||||
GTK_STYLE_CLASS_PRIMARY_TOOLBAR
|
||||
GTK_STYLE_CLASS_PROGRESSBAR
|
||||
GTK_STYLE_CLASS_PULSE
|
||||
GTK_STYLE_CLASS_QUESTION
|
||||
@@ -4852,17 +4570,10 @@ GTK_STYLE_CLASS_WARNING
|
||||
GTK_STYLE_CLASS_WIDE
|
||||
<SUBSECTION>
|
||||
GtkStyleContext
|
||||
gtk_style_context_new
|
||||
gtk_style_context_add_provider
|
||||
gtk_style_context_add_provider_for_display
|
||||
gtk_style_context_get
|
||||
gtk_style_context_get_parent
|
||||
gtk_style_context_get_path
|
||||
gtk_style_context_get_property
|
||||
gtk_style_context_get_display
|
||||
gtk_style_context_get_state
|
||||
gtk_style_context_get_valist
|
||||
gtk_style_context_get_section
|
||||
gtk_style_context_get_color
|
||||
gtk_style_context_get_border
|
||||
gtk_style_context_get_padding
|
||||
@@ -4874,7 +4585,6 @@ gtk_style_context_reset_widgets
|
||||
gtk_style_context_restore
|
||||
gtk_style_context_save
|
||||
gtk_style_context_set_parent
|
||||
gtk_style_context_set_path
|
||||
gtk_style_context_add_class
|
||||
gtk_style_context_remove_class
|
||||
gtk_style_context_has_class
|
||||
@@ -5035,7 +4745,6 @@ GtkScrollType
|
||||
GtkSelectionMode
|
||||
GtkShadowType
|
||||
GtkStateFlags
|
||||
GtkToolbarStyle
|
||||
GtkSortType
|
||||
GtkIconSize
|
||||
|
||||
@@ -5044,13 +4753,14 @@ GtkIconSize
|
||||
<SECTION>
|
||||
<FILE>gtkicontheme</FILE>
|
||||
<TITLE>GtkIconTheme</TITLE>
|
||||
GtkIconInfo
|
||||
GtkIconPaintable
|
||||
GtkIconTheme
|
||||
GtkIconLookupFlags
|
||||
GTK_ICON_THEME_ERROR
|
||||
GTK_TYPE_ICON_THEME_ERROR
|
||||
GTK_TYPE_ICON_LOOKUP_FLAGS
|
||||
GtkIconThemeError
|
||||
gtk_icon_theme_new
|
||||
gtk_icon_theme_get_default
|
||||
gtk_icon_theme_get_for_display
|
||||
gtk_icon_theme_set_display
|
||||
gtk_icon_theme_set_search_path
|
||||
@@ -5061,31 +4771,17 @@ gtk_icon_theme_add_resource_path
|
||||
gtk_icon_theme_set_custom_theme
|
||||
gtk_icon_theme_has_icon
|
||||
gtk_icon_theme_lookup_icon
|
||||
gtk_icon_theme_lookup_icon_for_scale
|
||||
gtk_icon_theme_choose_icon
|
||||
gtk_icon_theme_choose_icon_for_scale
|
||||
gtk_icon_theme_choose_icon_async
|
||||
gtk_icon_theme_choose_icon_finish
|
||||
gtk_icon_theme_lookup_by_gicon
|
||||
gtk_icon_theme_lookup_by_gicon_for_scale
|
||||
gtk_icon_theme_load_icon
|
||||
gtk_icon_theme_load_icon_for_scale
|
||||
gtk_icon_theme_list_icons
|
||||
gtk_icon_theme_get_icon_sizes
|
||||
gtk_icon_theme_rescan_if_needed
|
||||
gtk_icon_info_get_base_size
|
||||
gtk_icon_info_get_base_scale
|
||||
gtk_icon_info_get_filename
|
||||
gtk_icon_info_load_icon
|
||||
gtk_icon_info_load_icon_async
|
||||
gtk_icon_info_load_icon_finish
|
||||
gtk_icon_info_load_symbolic
|
||||
gtk_icon_info_load_symbolic_async
|
||||
gtk_icon_info_load_symbolic_finish
|
||||
gtk_icon_info_load_symbolic_for_context
|
||||
gtk_icon_info_load_symbolic_for_context_async
|
||||
gtk_icon_info_load_symbolic_for_context_finish
|
||||
gtk_icon_info_is_symbolic
|
||||
gtk_icon_paintable_new_for_file
|
||||
gtk_icon_paintable_get_file
|
||||
gtk_icon_paintable_get_icon_name
|
||||
gtk_icon_paintable_is_symbolic
|
||||
<SUBSECTION Standard>
|
||||
GtkIconInfoClass
|
||||
GtkIconClass
|
||||
GTK_ICON_THEME
|
||||
GTK_IS_ICON_THEME
|
||||
GTK_TYPE_ICON_THEME
|
||||
@@ -5093,13 +4789,13 @@ gtk_icon_theme_get_type
|
||||
GTK_ICON_THEME_CLASS
|
||||
GTK_IS_ICON_THEME_CLASS
|
||||
GTK_ICON_THEME_GET_CLASS
|
||||
gtk_icon_info_get_type
|
||||
GTK_TYPE_ICON_INFO
|
||||
GTK_ICON_INFO
|
||||
GTK_ICON_INFO_CLASS
|
||||
GTK_ICON_INFO_GET_CLASS
|
||||
GTK_IS_ICON_INFO
|
||||
GTK_IS_ICON_INFO_CLASS
|
||||
gtk_icon_paintable_get_type
|
||||
GTK_ICON_PAINTABLE
|
||||
GTK_IS_ICON
|
||||
GTK_TYPE_ICON
|
||||
GTK_ICON_PAINTABLE_CLASS
|
||||
GTK_ICON_PAINTABLE_GET_CLASS
|
||||
GTK_IS_ICON_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkIconThemePrivate
|
||||
gtk_icon_theme_error_quark
|
||||
@@ -7211,3 +6907,20 @@ GTK_DRAG_ICON_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_drag_icon_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkemojichooser</FILE>
|
||||
GtkEmojiChooser
|
||||
gtk_emoji_chooser_new
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EMOJI_CHOOSER
|
||||
GTK_EMOJI_CHOOSER
|
||||
GTK_EMOJI_CHOOSER_CLASS
|
||||
GTK_IS_EMOJI_CHOOSER
|
||||
GTK_IS_EMOJI_CHOOSER_CLASS
|
||||
GTK_EMOJI_CHOOSER_GET_CLASS
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_emoji_chooser_get_type
|
||||
</SECTION>
|
||||
|
@@ -62,6 +62,7 @@ gtk_drag_source_get_type
|
||||
gtk_drawing_area_get_type
|
||||
gtk_drop_target_get_type
|
||||
gtk_editable_get_type
|
||||
gtk_emoji_chooser_get_type
|
||||
gtk_entry_buffer_get_type
|
||||
gtk_entry_completion_get_type
|
||||
gtk_entry_get_type
|
||||
@@ -122,7 +123,6 @@ gtk_media_controls_get_type
|
||||
gtk_media_file_get_type
|
||||
gtk_media_stream_get_type
|
||||
gtk_menu_button_get_type
|
||||
gtk_menu_tool_button_get_type
|
||||
gtk_message_dialog_get_type
|
||||
gtk_mount_operation_get_type
|
||||
gtk_native_get_type
|
||||
@@ -150,7 +150,6 @@ gtk_print_settings_get_type
|
||||
@DISABLE_ON_W32@gtk_print_unix_dialog_get_type
|
||||
gtk_progress_bar_get_type
|
||||
gtk_radio_button_get_type
|
||||
gtk_radio_tool_button_get_type
|
||||
gtk_range_get_type
|
||||
gtk_recent_manager_get_type
|
||||
gtk_revealer_get_type
|
||||
@@ -164,7 +163,6 @@ gtk_search_bar_get_type
|
||||
gtk_search_entry_get_type
|
||||
gtk_selection_model_get_type
|
||||
gtk_separator_get_type
|
||||
gtk_separator_tool_item_get_type
|
||||
gtk_settings_get_type
|
||||
gtk_shortcut_label_get_type
|
||||
gtk_shortcuts_window_get_type
|
||||
@@ -196,10 +194,6 @@ gtk_text_tag_get_type
|
||||
gtk_text_tag_table_get_type
|
||||
gtk_text_view_get_type
|
||||
gtk_toggle_button_get_type
|
||||
gtk_toggle_tool_button_get_type
|
||||
gtk_toolbar_get_type
|
||||
gtk_tool_button_get_type
|
||||
gtk_tool_item_get_type
|
||||
gtk_tree_drag_dest_get_type
|
||||
gtk_tree_drag_source_get_type
|
||||
gtk_tree_list_model_get_type
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.2 KiB |
@@ -92,12 +92,50 @@
|
||||
|
||||
<para>
|
||||
The function which initially receives input events on the GTK
|
||||
side is gtk_main_do_event(). See its documentation
|
||||
for details of what it does: compression of enter/leave events,
|
||||
identification of the widget receiving the event, pushing the event onto a
|
||||
stack for gtk_get_current_event(), and propagating the event to the
|
||||
widget.
|
||||
side is responsible for a number of tasks.
|
||||
</para>
|
||||
<orderedlist>
|
||||
<listitem><para>
|
||||
Compress enter/leave notify events. If the event passed build an
|
||||
enter/leave pair together with the next event (peeked from GDK), both
|
||||
events are thrown away. This is to avoid a backlog of (de-)highlighting
|
||||
widgets crossed by the pointer.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Find the widget which got the event. If the widget can’t be determined
|
||||
the event is thrown away unless it belongs to a INCR transaction.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Then the event is pushed onto a stack so you can query the currently
|
||||
handled event with gtk_get_current_event().
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
The event is sent to a widget. If a grab is active all events for widgets
|
||||
that are not in the contained in the grab widget are sent to the latter
|
||||
with a few exceptions:
|
||||
<itemizedlist>
|
||||
<listitem><para>
|
||||
Deletion and destruction events are still sent to the event widget for
|
||||
obvious reasons.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Events which directly relate to the visual representation of the event
|
||||
widget.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Leave events are delivered to the event widget if there was an enter
|
||||
event delivered to it before without the paired leave event.
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
Drag events are not redirected because it is unclear what the semantics
|
||||
of that would be.
|
||||
</para></listitem>
|
||||
</itemizedlist>
|
||||
</para></listitem>
|
||||
<listitem><para>
|
||||
After finishing the delivery the event is popped from the event stack.
|
||||
</para></listitem>
|
||||
</orderedlist>
|
||||
|
||||
<para>
|
||||
When a GDK backend produces an input event, it is tied to a #GdkDevice and
|
||||
@@ -118,8 +156,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
An event is propagated to a widget using gtk_propagate_event().
|
||||
Propagation goes down and up the widget hierarchy in three phases
|
||||
An event is propagated down and up the widget hierarchy in three phases
|
||||
(see #GtkPropagationPhase) towards a target widget.
|
||||
</para>
|
||||
|
||||
|
@@ -199,6 +199,19 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using gtk_main() and related APIs</title>
|
||||
|
||||
<para>
|
||||
GTK4 removes the gtk_main_ family of APIs. The recommended replacement
|
||||
is GtkApplication, but you can also iterate the GLib mainloop directly,
|
||||
using GMainContext APIs.
|
||||
</para>
|
||||
<para>
|
||||
The replacement for gtk_events_pending() is g_main_context_pending(),
|
||||
the replacement for gtk_main_iteration() is g_main_context_iteration().
|
||||
</para>
|
||||
</section>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -374,7 +387,7 @@
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to GtkButton API changes</title>
|
||||
<title>Adapt to GtkBox API changes</title>
|
||||
<para>
|
||||
GtkBox no longer has pack-start and -end. Pack your widgets in the
|
||||
correct order, or reorder them as necessary.
|
||||
@@ -877,20 +890,19 @@
|
||||
switching to menu models and actions.
|
||||
</para>
|
||||
<para>
|
||||
Since menus are gone, GtkMenuButton and GtkMenuToolButton also lost their
|
||||
ability to show menus, and need to be used with popovers in GTK 4.
|
||||
Since menus are gone, GtkMenuButton also lost its ability to show menus,
|
||||
and needs to be used with popovers in GTK 4.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkToolbar overflow handling has changed</title>
|
||||
<title>GtkToolbar has been removed</title>
|
||||
<para>
|
||||
The handling of overflow in toolbars has been simplified.
|
||||
Instead of creating a proxy menuitem and setting it with
|
||||
gtk_tool_item_set_proxy_menu_item(), you simply provide
|
||||
a label for the overflow menu with gtk_tool_item_set_overflow_text().
|
||||
GTK will figure out itself whether to create a check- or
|
||||
radioitem as proxy.
|
||||
Toolbars were using outdated concepts such as requiring special toolitem
|
||||
widgets.
|
||||
</para>
|
||||
<para>
|
||||
Toolbars should be replaced by using a GtkBox with regular widgets instead.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
|
@@ -95,10 +95,6 @@ additional environment variables.
|
||||
<term>touchscreen</term>
|
||||
<listitem><para>Pretend the pointer is a touchscreen device</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>baselines</term>
|
||||
<listitem><para>Show baselines</para></listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>updates</term>
|
||||
<listitem><para>Visual feedback about window updates</para></listitem>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user