Compare commits
471 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 70997c51bc | |||
| c31727d0dc | |||
| 789586c385 | |||
| bedf3a2db9 | |||
| 422c78badf | |||
| b3710279bc | |||
| 5a25c7fd64 | |||
| 429e0bfaec | |||
| fc450e313b | |||
| f18eef7e6f | |||
| bf1a9b2b0d | |||
| a3368ab7e9 | |||
| 1ae898bf0b | |||
| 91c7b24815 | |||
| af2903d263 | |||
| 9ca2a09427 | |||
| 50b930fb1c | |||
| 3ed285ab71 | |||
| 34862dbbb6 | |||
| 1bdaa99347 | |||
| ad22c463b8 | |||
| 62d98ac60c | |||
| b9155dcb1a | |||
| d85f02a994 | |||
| 01ebd00f97 | |||
| 7da995da1d | |||
| dc99a7aa61 | |||
| 508ed21786 | |||
| 2356c9b503 | |||
| bf77694557 | |||
| 5bd2b49064 | |||
| a78e0f1188 | |||
| 7ede3b919c | |||
| 2ea7f47089 | |||
| 9156be6bf1 | |||
| 0b6cd34b1d | |||
| e1b25eaf5a | |||
| 7eeeb3f229 | |||
| 7ca8efa0f5 | |||
| 9f579edfdb | |||
| 2dfd1404ff | |||
| f6af2d63b0 | |||
| 764e43b871 | |||
| 7874b29ec2 | |||
| 8de774dde1 | |||
| a8e04ee81d | |||
| 8410e6f129 | |||
| ecf8e6f692 | |||
| dde32b5098 | |||
| 2571a2af18 | |||
| fa2a8ac1bb | |||
| ccc38746d5 | |||
| 56565b12d8 | |||
| 7f1e82d1bc | |||
| b5d61eb2c8 | |||
| 5321f8f195 | |||
| 4aa8f6f73c | |||
| 6f7bd37aeb | |||
| f645c063fb | |||
| 44e31855ca | |||
| c6fc7d88c2 | |||
| f6c8af6609 | |||
| 796bc9bde1 | |||
| f8f391ceb9 | |||
| 637890517b | |||
| ae7fd6f129 | |||
| 99d7130da3 | |||
| b64f889cd9 | |||
| ba1633ce75 | |||
| ac3e604bb6 | |||
| fdc4335eba | |||
| 4936e7f859 | |||
| 8b64e29ba6 | |||
| 95424d3f44 | |||
| 9cc5eb6161 | |||
| 79e1c66657 | |||
| 02fa948914 | |||
| b54178e6a4 | |||
| bb50b2cec9 | |||
| 1d86a89ccf | |||
| c192038027 | |||
| 2c23546ba9 | |||
| 9ed579505d | |||
| 41b7f03d55 | |||
| 67e1acd4d7 | |||
| d104efe06e | |||
| 2a877a9be5 | |||
| cb14fcca4c | |||
| 777fd92eba | |||
| ccfffb2578 | |||
| 894e1d0885 | |||
| c8d4a48c03 | |||
| 7ce964a455 | |||
| 2791c522d8 | |||
| 18114bafe0 | |||
| 197fe80857 | |||
| 8871327b08 | |||
| b2deab6adf | |||
| 389575ee18 | |||
| fd47e86689 | |||
| 7c4694ca3c | |||
| 610d5794ac | |||
| b0f2cd02ad | |||
| 7fe51a876c | |||
| 424a86a6a6 | |||
| 861bff44a8 | |||
| f4b1762072 | |||
| ba45d7a991 | |||
| 8b1e857a67 | |||
| 94906d076a | |||
| a199060728 | |||
| 7b4378bc46 | |||
| 679863af4f | |||
| a59cb5dfa6 | |||
| 4b13d99cfe | |||
| 129b8bb7f1 | |||
| 723d57eeb5 | |||
| 58ca3b05c9 | |||
| 21fcef7306 | |||
| fe6ef5256b | |||
| c0d18ebff2 | |||
| 451c3279ee | |||
| 016eac0645 | |||
| cead405831 | |||
| 2ddff872cd | |||
| 7aeef71a49 | |||
| 98611735ec | |||
| 2240eb5c99 | |||
| e75bc2833d | |||
| bca608c531 | |||
| 9fe6bc0792 | |||
| e026a04e03 | |||
| 30c386dde9 | |||
| 0ff67fa854 | |||
| 55dd737ea0 | |||
| c09b5ea7b4 | |||
| 1edfd80528 | |||
| 654af88529 | |||
| 8e2ffb3b46 | |||
| e818bf8514 | |||
| 0af16a77fc | |||
| 0ebcf8c02e | |||
| 76b16720fc | |||
| 89ebe9e456 | |||
| af7537ac79 | |||
| 6185cf95fb | |||
| fbcd0212ea | |||
| b55195fa2e | |||
| 841c4a8cfe | |||
| d756c6e282 | |||
| eeb41c82d1 | |||
| ecf313097c | |||
| b20f21df24 | |||
| 2869f80bc0 | |||
| b4c79bad34 | |||
| 013cc09651 | |||
| cd077d1aa6 | |||
| 66e802596a | |||
| e91907d427 | |||
| dbf12d87a1 | |||
| 0b6af3bf23 | |||
| bc7da45902 | |||
| a3de542274 | |||
| 7f3125fc69 | |||
| 70fed08e8f | |||
| 3c987f073e | |||
| ef832fd770 | |||
| 2afd10b537 | |||
| f1da4cfae1 | |||
| 47bfa49118 | |||
| 2cd152c2ed | |||
| a7cad79092 | |||
| 661b8c3d1a | |||
| 853de6c511 | |||
| 45bcffd637 | |||
| 1e7c56db19 | |||
| ab59459f7a | |||
| 0a79eb02ac | |||
| aa72318581 | |||
| 0bc6a5c791 | |||
| ef8e8ba14d | |||
| b55b1773c0 | |||
| 1c472cca00 | |||
| 8c0fbb2294 | |||
| ee4a7798c9 | |||
| b339bde6a5 | |||
| 13b6b9f2b4 | |||
| b315dce757 | |||
| 66347fa3bf | |||
| 2c7d54791c | |||
| af858d51a8 | |||
| 84fd7cf704 | |||
| 250036259a | |||
| 8e45e15a11 | |||
| 323394e8b5 | |||
| d53f3a54b1 | |||
| e880abfaf3 | |||
| 16906eb0a9 | |||
| 6a4f788976 | |||
| 6b79f691ef | |||
| 49f2012d24 | |||
| 18c11ac94f | |||
| 25237095c9 | |||
| 19dbbf6fa5 | |||
| dd23a37ca1 | |||
| d46e1288a4 | |||
| b5d17d2f9b | |||
| 5a362c6759 | |||
| 3e19b9502d | |||
| 39793e8043 | |||
| 79267674ff | |||
| c920796967 | |||
| 908590e032 | |||
| 416d82c81e | |||
| d4e53b14cb | |||
| 96f9f9585f | |||
| ad7118ef9a | |||
| 909120ec78 | |||
| 12d5fdd457 | |||
| df1816a29c | |||
| fdbbef863d | |||
| 47ac0db66c | |||
| edae2a8dc5 | |||
| ffbc58d328 | |||
| 285aa226e5 | |||
| f297d0684d | |||
| c7d871570f | |||
| 7caed3a462 | |||
| f4acde371e | |||
| aad67743b9 | |||
| 1886648652 | |||
| 67c2665028 | |||
| dda7a850da | |||
| b8ef164c2b | |||
| 5d61abd748 | |||
| 9f6ec5b7d4 | |||
| 78e6475f9f | |||
| 6289f7eecd | |||
| 9ad0dbb145 | |||
| db9fbb3918 | |||
| afaa352142 | |||
| 3b7cb31157 | |||
| f0b33cdc53 | |||
| 203b0c9c9d | |||
| 1ea24e98c1 | |||
| 36248c609d | |||
| f6bedd0d5e | |||
| 8f96b38539 | |||
| 813be8a921 | |||
| 21ac2330af | |||
| 584a71ae96 | |||
| 2e14ea84f3 | |||
| 4737495e3c | |||
| 57f913b753 | |||
| 4851081a77 | |||
| 13fde6f4cd | |||
| 1db53e6676 | |||
| 74b5eaa700 | |||
| b16157bc0d | |||
| 7a98e79d90 | |||
| c588d8f858 | |||
| 23cffdfe42 | |||
| 99998d25f8 | |||
| ca47e96d35 | |||
| e583349956 | |||
| 7bc4daae2f | |||
| 3469a63453 | |||
| 17cb92889a | |||
| 4a20a3fdb2 | |||
| 726a7ac705 | |||
| 60329c3cda | |||
| f28aa1ba02 | |||
| 96cfb12946 | |||
| 5abb6f2a61 | |||
| 0d065bca6d | |||
| b3b194532d | |||
| 1d1e1c5e83 | |||
| d36e41c6b8 | |||
| 4516bfbc88 | |||
| 5095e87bb7 | |||
| 54b99d281b | |||
| 3cb023d0df | |||
| 86f295f929 | |||
| e83d87c20a | |||
| 03080f29b9 | |||
| 3d988d5fe9 | |||
| dbd578eaef | |||
| 45d7051dff | |||
| ec848dc83f | |||
| d7bdfae8bb | |||
| 8e9406a082 | |||
| 031b248c20 | |||
| a2a194f71e | |||
| bb8c2016a8 | |||
| b6353a6369 | |||
| 6882121341 | |||
| 97ceb03008 | |||
| a5234f2d09 | |||
| faaf80dd46 | |||
| b072ad9993 | |||
| 90fb58e923 | |||
| e6fcac29b5 | |||
| 71f8649f7f | |||
| 3f9ee61a36 | |||
| 097b585bbc | |||
| ed2a4e2d93 | |||
| fb2502fa5f | |||
| c4e66ec485 | |||
| 4e6b62e564 | |||
| 8f75df1cb3 | |||
| 037b0259d8 | |||
| 8c769ea3f3 | |||
| 7179e8d5f3 | |||
| 325a485315 | |||
| 54300e1cc3 | |||
| db2e07758f | |||
| eb5b3083ff | |||
| cd42227c29 | |||
| 6870159c1d | |||
| a072e16297 | |||
| 78ac2f2d5b | |||
| 9f5955e1b1 | |||
| fa759272b0 | |||
| d802b35578 | |||
| fdf812b7d7 | |||
| 1205f74106 | |||
| 906c3c570a | |||
| 57a56538eb | |||
| 6fbc9e8c3e | |||
| d27adb10a0 | |||
| f97180beee | |||
| 209398d736 | |||
| 3ee18b88b9 | |||
| 64b0c63190 | |||
| 8ff540eb4c | |||
| 9194b7388f | |||
| 6831d3e28e | |||
| 800f1c03d5 | |||
| 7a0355fcb1 | |||
| 15d58a868a | |||
| 61f21fc9e9 | |||
| 9e068d3a46 | |||
| 2aa136a19c | |||
| 1dfd514f7f | |||
| 08fbd012ec | |||
| 638508fa20 | |||
| ce6c7bae51 | |||
| 19f7b7ed40 | |||
| e3dba28666 | |||
| 88aa548965 | |||
| 17a9b13af2 | |||
| 1efa781a19 | |||
| 0a19d7ef08 | |||
| 926fb208ba | |||
| e76dee07c5 | |||
| 11a43cf554 | |||
| a7218da202 | |||
| ed362fcc5b | |||
| 17ec74da35 | |||
| 754d6d1a04 | |||
| ff53d5ba11 | |||
| 7233a70d47 | |||
| 12990b3520 | |||
| 95d807ab61 | |||
| 8a1a96a47e | |||
| c31916081f | |||
| 0a1e19f4e3 | |||
| 7d3f3b7ab8 | |||
| 432b741ab7 | |||
| 703f18ce66 | |||
| 4da82bde7b | |||
| feee281cf8 | |||
| 443fd4d63d | |||
| 4b346538e2 | |||
| 0ee58e9ef4 | |||
| bd56bc9055 | |||
| 3e7e862415 | |||
| 4eeb413047 | |||
| 661f3466c2 | |||
| e735554ced | |||
| 520ea7c39d | |||
| ffa345e4ab | |||
| e072d9b28b | |||
| 9f5b04e65c | |||
| d08310096c | |||
| 20d0d6fae2 | |||
| 6b9ac1043b | |||
| c5b4066714 | |||
| b09b2dd2cd | |||
| 72a0828101 | |||
| 7379c34a39 | |||
| 6cd1b9955b | |||
| a6a31827bc | |||
| 84939a612c | |||
| 394ea32e93 | |||
| 2bd36d490b | |||
| ad1bc75dd2 | |||
| 7505c1fd7c | |||
| 8780906b93 | |||
| 0ed2e970be | |||
| 58253d567f | |||
| c09c61769c | |||
| 9b5dc35650 | |||
| 3c9ada14fe | |||
| 6b4d6c3771 | |||
| b15f16e8db | |||
| e3b9dfef1c | |||
| 822c2aba36 | |||
| a11f9fea76 | |||
| f16c829190 | |||
| 16c820c2f0 | |||
| 72ae6daa1e | |||
| 35ba24d2e8 | |||
| 508cb6160c | |||
| b9a76ddd75 | |||
| 038190c5a8 | |||
| 2ae08e632c | |||
| 99eed078bd | |||
| 6720552afd | |||
| 6f01508aa8 | |||
| 632524f679 | |||
| 22e1827f84 | |||
| 3c39613d9c | |||
| 46ff9f891a | |||
| 97ff1b83dc | |||
| 9416856420 | |||
| c1459cc45b | |||
| 4fe8c037c7 | |||
| b1afe5ff23 | |||
| bbd4fb8798 | |||
| b3b29e37fd | |||
| f996ba6585 | |||
| 7ca36cd2d4 | |||
| 2a18f2150d | |||
| a65fd81106 | |||
| ff8217db40 | |||
| a3861bf9a0 | |||
| b86c1446a4 | |||
| 9ce58bdb0c | |||
| 9f252f0ceb | |||
| 7008a531bb | |||
| 458b8a6554 | |||
| 307cc69adb | |||
| ab6b5ae568 | |||
| 0e601c0a70 | |||
| 5425edff82 | |||
| 213c471bb7 | |||
| 9ae0fe7f3a | |||
| abe6876f7c | |||
| 53d74fd2dc | |||
| 3f0a830f3c | |||
| e0323fcdc2 | |||
| cd5cded430 | |||
| 54e4e6cd23 | |||
| 59852d3425 | |||
| d701a89281 | |||
| 5e095cd208 | |||
| d2bdf3d5a1 | |||
| e692385baa | |||
| 1e8df851e9 | |||
| 904db0a8f7 | |||
| 6b7cc8baa6 | |||
| 71fe843d99 | |||
| 552a681816 | |||
| 2f0016eb08 | |||
| f87291cac2 | |||
| 37c3ba2645 | |||
| ba05787a06 | |||
| 12b97ffd24 | |||
| 1ae60cb713 | |||
| 3371e3aa49 |
+5
-5
@@ -27,14 +27,14 @@ variables:
|
||||
|
||||
style-check-diff:
|
||||
extends: .only-default
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v15
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: .pre
|
||||
allow_failure: true
|
||||
script:
|
||||
- .gitlab-ci/run-style-check-diff.sh
|
||||
|
||||
fedora-x86_64:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v15
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug --default-library=both"
|
||||
@@ -66,7 +66,7 @@ fedora-x86_64:
|
||||
<<: *cache-paths
|
||||
|
||||
release-build:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v15
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: build
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
@@ -168,7 +168,7 @@ flatpak-master:icon-browser:
|
||||
<<: *flatpak-master
|
||||
|
||||
static-scan:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v15
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: analysis
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=debug"
|
||||
@@ -181,7 +181,7 @@ static-scan:
|
||||
allow_failure: true
|
||||
|
||||
reference:
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v15
|
||||
image: registry.gitlab.gnome.org/gnome/gtk/fedora:v16
|
||||
stage: docs
|
||||
variables:
|
||||
EXTRA_MESON_FLAGS: "--buildtype=release"
|
||||
|
||||
@@ -82,7 +82,7 @@ RUN dnf -y install \
|
||||
xorg-x11-server-Xvfb \
|
||||
&& dnf clean all
|
||||
|
||||
RUN pip3 install meson==0.52.1
|
||||
RUN pip3 install meson==0.53.1
|
||||
|
||||
ARG HOST_USER_ID=5555
|
||||
ENV HOST_USER_ID ${HOST_USER_ID}
|
||||
|
||||
@@ -174,7 +174,7 @@ ul.images li {
|
||||
<div class="failures">
|
||||
<h4><a name="{{ suite_result.suite_name }}-failed">Failures</a></h4>
|
||||
<ul class="failed">
|
||||
{% for failure in suite_result.failures if failure.result in [ 'FAIL', 'UNEXPECTEDPASS' ] %}
|
||||
{% for failure in suite_result.failures if failure.result in [ 'ERROR', '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>
|
||||
@@ -207,24 +207,6 @@ ul.images li {
|
||||
</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' %}
|
||||
@@ -244,6 +226,24 @@ ul.images li {
|
||||
<li>None</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -331,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', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT', 'ERROR',]:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -70,7 +70,7 @@ for name, units in suites.items():
|
||||
print('Processing suite {} (units: {})'.format(name, len(units)))
|
||||
|
||||
def if_failed(unit):
|
||||
if unit['result'] in ['FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
if unit['result'] in ['ERROR', 'FAIL', 'UNEXPECTEDPASS', 'TIMEOUT']:
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@@ -1,3 +1,79 @@
|
||||
Overview of Changes in GTK 3.98.3
|
||||
=================================
|
||||
|
||||
* GtkEntry:
|
||||
- Support setting attributes in ui files
|
||||
|
||||
* GtkScaleButton:
|
||||
- Don't derive from GtkButton
|
||||
|
||||
* GtkAboutDialog:
|
||||
- Support more common licenses
|
||||
|
||||
* GtkEmojiChooser:
|
||||
- Improve keyboard navigation
|
||||
|
||||
* GtkLabel:
|
||||
- Remove pattern API
|
||||
|
||||
* GtkAspectFrame:
|
||||
- Modernize and simplify
|
||||
|
||||
* Chooser buttons:
|
||||
- Make dialogs modal by default
|
||||
|
||||
* Various widgets:
|
||||
- Replace shadow-type and relief properties by
|
||||
a simpler has-frame
|
||||
|
||||
* CSS:
|
||||
- Use :focus-visible instead of :focus(visible)
|
||||
- Add support for :focus-within
|
||||
|
||||
* Focus handling
|
||||
- Fix crossing event generation
|
||||
- Fix focus handling in various widgets
|
||||
- Change :can-focus to be recursive
|
||||
- Fix GtkWindow:is-active setting
|
||||
|
||||
* Scrolling
|
||||
- gtk_container_set_focus_[hv]adjustment has been removed
|
||||
- gtk_viewport_set_scroll_to_focus has been added
|
||||
|
||||
* Accessibility:
|
||||
- Add a cursor-aspect-ratio setting
|
||||
- Set focus-related states properly
|
||||
|
||||
* Themes:
|
||||
- Use blue focus outlines more
|
||||
- Numerous minor improvements
|
||||
|
||||
* Wayland:
|
||||
- Fix .Compose file loading
|
||||
- Support popup repositioning
|
||||
- Fix problems with autohide popovers
|
||||
|
||||
* GDK:
|
||||
- Remove GdkKeymap from public API, replaced by
|
||||
GdkDevice properties
|
||||
- Add full keyboard translation state to key events
|
||||
- Simplify modifier support, drop GdkModifierIntent
|
||||
- Move key event matching to GDK
|
||||
- Add GdkSurface::enter/leave-monitor signals
|
||||
- Turn GskEvent into a derivable type, and make
|
||||
it introspectable
|
||||
|
||||
* GSK:
|
||||
- Turn GskRenderNode into a derivable type, and make
|
||||
it introspectable
|
||||
- Fall back to cairo if compiling shaders fails
|
||||
|
||||
* Translation updates:
|
||||
- Japanese
|
||||
- Lithuanian
|
||||
- Turkish
|
||||
|
||||
|
||||
Overview of Changes in GTK 3.98.2
|
||||
=================================
|
||||
|
||||
|
||||
@@ -613,19 +613,19 @@ create_widget_func (gpointer item,
|
||||
if (GTK_IS_CONSTRAINT (item) || GTK_IS_CONSTRAINT_GUIDE (item))
|
||||
{
|
||||
button = gtk_button_new_from_icon_name ("document-edit-symbolic");
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (button), FALSE);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (row_edit), win);
|
||||
g_object_set_data (G_OBJECT (row), "edit", button);
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
button = gtk_button_new_from_icon_name ("edit-delete-symbolic");
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (button), FALSE);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (row_delete), win);
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
}
|
||||
else if (GTK_IS_WIDGET (item))
|
||||
{
|
||||
button = gtk_button_new_from_icon_name ("edit-delete-symbolic");
|
||||
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (button), FALSE);
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (row_delete), win);
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ constraint_view_add_child (ConstraintView *view,
|
||||
|
||||
label = gtk_label_new (name);
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "child");
|
||||
gtk_widget_add_css_class (frame, "child");
|
||||
gtk_widget_set_name (frame, name);
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
gtk_widget_set_parent (frame, GTK_WIDGET (view));
|
||||
@@ -257,7 +257,7 @@ constraint_view_add_guide (ConstraintView *view,
|
||||
G_BINDING_DEFAULT);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (frame), "guide");
|
||||
gtk_widget_add_css_class (frame, "guide");
|
||||
g_object_set_data (G_OBJECT (frame), "internal", (char *)"yes");
|
||||
gtk_container_add (GTK_CONTAINER (frame), label);
|
||||
gtk_widget_insert_after (frame, GTK_WIDGET (view), NULL);
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView">
|
||||
<property name="hexpand">1</property>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<property name="vexpand">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="min-content-width">150</property>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
|
||||
@@ -131,13 +131,11 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
|
||||
GtkAlign valign, halign;
|
||||
gboolean is_left, is_right, is_top, is_bottom;
|
||||
gboolean has_left, has_right, has_top, has_bottom;
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (child);
|
||||
has_left = gtk_style_context_has_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
has_right = gtk_style_context_has_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
has_top = gtk_style_context_has_class (context, GTK_STYLE_CLASS_TOP);
|
||||
has_bottom = gtk_style_context_has_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
has_left = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
has_right = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
has_top = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
has_bottom = gtk_widget_has_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
|
||||
is_left = is_right = is_top = is_bottom = FALSE;
|
||||
|
||||
@@ -160,24 +158,24 @@ blur_overlay_child_update_style_classes (BlurOverlay *overlay,
|
||||
is_bottom = (child_allocation->y + child_allocation->height == height);
|
||||
|
||||
if (has_left && !is_left)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
else if (!has_left && is_left)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_LEFT);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_LEFT);
|
||||
|
||||
if (has_right && !is_right)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
else if (!has_right && is_right)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_RIGHT);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_RIGHT);
|
||||
|
||||
if (has_top && !is_top)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_TOP);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
else if (!has_top && is_top)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_TOP);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_TOP);
|
||||
|
||||
if (has_bottom && !is_bottom)
|
||||
gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
gtk_widget_remove_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
else if (!has_bottom && is_bottom)
|
||||
gtk_style_context_add_class (context, GTK_STYLE_CLASS_BOTTOM);
|
||||
gtk_widget_add_css_class (child, GTK_STYLE_CLASS_BOTTOM);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
+6
-200
@@ -12,6 +12,7 @@
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
#include "demoimage.h"
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
@@ -93,147 +94,6 @@ paste_button_clicked (GtkWidget *button,
|
||||
gdk_clipboard_read_text_async (clipboard, NULL, paste_received, entry);
|
||||
}
|
||||
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconPaintable *icon;
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
case GTK_IMAGE_PAINTABLE:
|
||||
return g_object_ref (gtk_image_get_paintable (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 = 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 GDK_PAINTABLE (icon);
|
||||
|
||||
case GTK_IMAGE_EMPTY:
|
||||
case GTK_IMAGE_GICON:
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
GtkWidget *widget)
|
||||
{
|
||||
GdkPaintable *paintable;
|
||||
|
||||
paintable = get_image_paintable (GTK_IMAGE (widget));
|
||||
if (paintable)
|
||||
{
|
||||
gtk_drag_source_set_icon (source, paintable, -2, -2);
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkContentProvider *
|
||||
prepare_drag (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (image));
|
||||
|
||||
if (!GDK_IS_TEXTURE (paintable))
|
||||
return NULL;
|
||||
|
||||
return gdk_content_provider_new_typed (GDK_TYPE_TEXTURE, paintable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_drop (GtkDropTarget *dest,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y,
|
||||
GtkImage *image)
|
||||
{
|
||||
GdkTexture *texture = g_value_get_object (value);
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (image), GDK_PAINTABLE (texture));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
copy_image (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (data));
|
||||
|
||||
if (GDK_IS_TEXTURE (paintable))
|
||||
gdk_clipboard_set_texture (clipboard, GDK_TEXTURE (paintable));
|
||||
|
||||
if (paintable)
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
|
||||
static void
|
||||
paste_image_received (GObject *source,
|
||||
GAsyncResult *result,
|
||||
gpointer data)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
|
||||
texture = gdk_clipboard_read_texture_finish (GDK_CLIPBOARD (source), result, NULL);
|
||||
if (texture == NULL)
|
||||
return;
|
||||
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (data), GDK_PAINTABLE (texture));
|
||||
g_object_unref (texture);
|
||||
}
|
||||
|
||||
static void
|
||||
paste_image (GSimpleAction *action,
|
||||
GVariant *value,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (GTK_WIDGET (data));
|
||||
gdk_clipboard_read_texture_async (clipboard, NULL, paste_image_received, data);
|
||||
}
|
||||
|
||||
static void
|
||||
pressed_cb (GtkGesture *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
GtkWidget *image)
|
||||
{
|
||||
GtkWidget *popover;
|
||||
GMenu *menu;
|
||||
GMenuItem *item;
|
||||
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("_Copy"), "clipboard.copy");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
item = g_menu_item_new (_("_Paste"), "clipboard.paste");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
popover = gtk_popover_menu_new_from_model (G_MENU_MODEL (menu));
|
||||
gtk_widget_set_parent (popover, image);
|
||||
|
||||
gtk_popover_set_pointing_to (GTK_POPOVER (popover), &(GdkRectangle) { x, y, 1, 1});
|
||||
gtk_popover_popup (GTK_POPOVER (popover));
|
||||
|
||||
g_object_unref (menu);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_clipboard (GtkWidget *do_widget)
|
||||
{
|
||||
@@ -243,14 +103,6 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GtkWidget *label;
|
||||
GtkWidget *entry, *button;
|
||||
GtkWidget *image;
|
||||
GtkGesture *gesture;
|
||||
GActionEntry entries[] = {
|
||||
{ "copy", copy_image, NULL, NULL, NULL },
|
||||
{ "paste", paste_image, NULL, NULL, NULL },
|
||||
};
|
||||
GActionGroup *actions;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *dest;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
@@ -320,62 +172,16 @@ do_clipboard (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), hbox);
|
||||
|
||||
/* Create the first image */
|
||||
image = gtk_image_new_from_icon_name ("dialog-warning");
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
|
||||
image = demo_image_new ("dialog-warning");
|
||||
gtk_container_add (GTK_CONTAINER (hbox), image);
|
||||
|
||||
/* make image a drag source */
|
||||
source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
dest = gtk_drop_target_new (GDK_TYPE_TEXTURE, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
actions = G_ACTION_GROUP (g_simple_action_group_new ());
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
|
||||
|
||||
gtk_widget_insert_action_group (image, "clipboard", actions);
|
||||
|
||||
g_object_unref (actions);
|
||||
|
||||
/* Create the second image */
|
||||
image = gtk_image_new_from_icon_name ("process-stop");
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (image), 48);
|
||||
image = demo_image_new ("process-stop");
|
||||
gtk_container_add (GTK_CONTAINER (hbox), image);
|
||||
|
||||
/* make image a drag source */
|
||||
source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
/* accept drops on image */
|
||||
dest = gtk_drop_target_new (GDK_TYPE_TEXTURE, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
/* context menu on image */
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), image);
|
||||
gtk_widget_add_controller (image, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
actions = G_ACTION_GROUP (g_simple_action_group_new ());
|
||||
g_action_map_add_action_entries (G_ACTION_MAP (actions), entries, G_N_ELEMENTS (entries), image);
|
||||
|
||||
gtk_widget_insert_action_group (image, "clipboard", actions);
|
||||
|
||||
g_object_unref (actions);
|
||||
/* Create the third image */
|
||||
image = demo_image_new ("weather-clear");
|
||||
gtk_container_add (GTK_CONTAINER (hbox), image);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -1,119 +0,0 @@
|
||||
/* Color Chooser
|
||||
*
|
||||
* A GtkColorChooser lets the user choose a color. There are several
|
||||
* implementations of the GtkColorChooser interface in GTK. The
|
||||
* GtkColorChooserDialog is a prebuilt dialog containing a
|
||||
* GtkColorChooserWidget.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
static GtkWidget *da;
|
||||
static GdkRGBA color;
|
||||
static GtkWidget *frame;
|
||||
|
||||
/* draw callback for the drawing area
|
||||
*/
|
||||
static void
|
||||
draw_function (GtkDrawingArea *drawing_area,
|
||||
cairo_t *cr,
|
||||
int width,
|
||||
int height,
|
||||
gpointer data)
|
||||
{
|
||||
gdk_cairo_set_source_rgba (cr, &color);
|
||||
cairo_paint (cr);
|
||||
}
|
||||
|
||||
static void
|
||||
response_cb (GtkDialog *dialog,
|
||||
gint response_id,
|
||||
gpointer user_data)
|
||||
{
|
||||
if (response_id == GTK_RESPONSE_OK)
|
||||
{
|
||||
gtk_color_chooser_get_rgba (GTK_COLOR_CHOOSER (dialog), &color);
|
||||
gtk_widget_queue_draw (da);
|
||||
}
|
||||
|
||||
gtk_widget_destroy (GTK_WIDGET (dialog));
|
||||
}
|
||||
|
||||
static void
|
||||
change_color_callback (GtkWidget *button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *dialog;
|
||||
|
||||
dialog = gtk_color_chooser_dialog_new ("Changing color", GTK_WINDOW (window));
|
||||
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
|
||||
gtk_color_chooser_set_rgba (GTK_COLOR_CHOOSER (dialog), &color);
|
||||
|
||||
g_signal_connect (dialog, "response",
|
||||
G_CALLBACK (response_cb), NULL);
|
||||
|
||||
gtk_widget_show (dialog);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_colorsel (GtkWidget *do_widget)
|
||||
{
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *button;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
color.red = 0;
|
||||
color.blue = 1;
|
||||
color.green = 0;
|
||||
color.alpha = 1;
|
||||
|
||||
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");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_widget_set_margin_start (vbox, 12);
|
||||
gtk_widget_set_margin_end (vbox, 12);
|
||||
gtk_widget_set_margin_top (vbox, 12);
|
||||
gtk_widget_set_margin_bottom (vbox, 12);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
|
||||
/*
|
||||
* Create the color swatch area
|
||||
*/
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
gtk_drawing_area_set_content_width (GTK_DRAWING_AREA (da), 200);
|
||||
gtk_drawing_area_set_content_height (GTK_DRAWING_AREA (da), 200);
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (da), draw_function, NULL, NULL);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (frame), da);
|
||||
|
||||
button = gtk_button_new_with_mnemonic ("_Change the above color");
|
||||
gtk_widget_set_halign (button, GTK_ALIGN_END);
|
||||
gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (vbox), button);
|
||||
|
||||
g_signal_connect (button, "clicked",
|
||||
G_CALLBACK (change_color_callback), NULL);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -12,6 +12,10 @@
|
||||
<gresource prefix="/builder">
|
||||
<file>demo.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/clipboard">
|
||||
<file>demoimage.c</file>
|
||||
<file>demoimage.h</file>
|
||||
</gresource>
|
||||
<gresource prefix="/css_accordion">
|
||||
<file>css_accordion.css</file>
|
||||
<file>reset.css</file>
|
||||
@@ -104,6 +108,10 @@
|
||||
<file>gtkfishbowl.c</file>
|
||||
<file>gtkfishbowl.h</file>
|
||||
</gresource>
|
||||
<gresource prefix="/gears">
|
||||
<file>gtkgears.c</file>
|
||||
<file>gtkgears.h</file>
|
||||
</gresource>
|
||||
<gresource prefix="/iconscroll">
|
||||
<file>iconscroll.ui</file>
|
||||
</gresource>
|
||||
@@ -150,7 +158,6 @@
|
||||
<file>assistant.c</file>
|
||||
<file>builder.c</file>
|
||||
<file>clipboard.c</file>
|
||||
<file>colorsel.c</file>
|
||||
<file>combobox.c</file>
|
||||
<file>constraints.c</file>
|
||||
<file>constraints2.c</file>
|
||||
@@ -176,6 +183,7 @@
|
||||
<file>font_features.c</file>
|
||||
<file>fontplane.c</file>
|
||||
<file>fontrendering.c</file>
|
||||
<file>gears.c</file>
|
||||
<file>gestures.c</file>
|
||||
<file>glarea.c</file>
|
||||
<file>headerbar.c</file>
|
||||
@@ -272,9 +280,6 @@
|
||||
<gresource prefix="/modelbutton">
|
||||
<file>modelbutton.ui</file>
|
||||
</gresource>
|
||||
<gresource prefix="/dnd">
|
||||
<file>dnd.css</file>
|
||||
</gresource>
|
||||
<gresource prefix="/tagged_entry">
|
||||
<file>demotaggedentry.c</file>
|
||||
<file>demotaggedentry.h</file>
|
||||
@@ -304,4 +309,7 @@
|
||||
<file>icons/16x16/status/battery-caution-charging-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/categories/applications-other.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/Demo4/gtk">
|
||||
<file preprocess="xml-stripblanks">help-overlay.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
|
||||
@@ -0,0 +1,259 @@
|
||||
#include "demoimage.h"
|
||||
#include <glib/gi18n.h>
|
||||
|
||||
struct _DemoImage {
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkWidget *image;
|
||||
GtkWidget *popover;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_ICON_NAME = 1
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(DemoImage, demo_image, GTK_TYPE_WIDGET)
|
||||
|
||||
static GdkPaintable *
|
||||
get_image_paintable (GtkImage *image)
|
||||
{
|
||||
const gchar *icon_name;
|
||||
GtkIconTheme *icon_theme;
|
||||
GtkIconPaintable *icon;
|
||||
|
||||
switch (gtk_image_get_storage_type (image))
|
||||
{
|
||||
case GTK_IMAGE_PAINTABLE:
|
||||
return g_object_ref (gtk_image_get_paintable (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 = 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 GDK_PAINTABLE (icon);
|
||||
|
||||
case GTK_IMAGE_EMPTY:
|
||||
case GTK_IMAGE_GICON:
|
||||
default:
|
||||
g_warning ("Image storage type %d not handled",
|
||||
gtk_image_get_storage_type (image));
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
DemoImage *demo = DEMO_IMAGE (widget);
|
||||
GdkPaintable *paintable;
|
||||
|
||||
paintable = get_image_paintable (GTK_IMAGE (demo->image));
|
||||
if (paintable)
|
||||
{
|
||||
gtk_drag_icon_set_from_paintable (drag, paintable, -2, -2);
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
}
|
||||
|
||||
static GdkContentProvider *
|
||||
prepare_drag (GtkDragSource *source,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
DemoImage *demo = DEMO_IMAGE (widget);
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (demo->image));
|
||||
|
||||
return gdk_content_provider_new_typed (GDK_TYPE_PAINTABLE, paintable);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_drop (GtkDropTarget *dest,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
{
|
||||
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
|
||||
DemoImage *demo = DEMO_IMAGE (widget);
|
||||
GdkPaintable *paintable = g_value_get_object (value);
|
||||
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (demo->image), paintable);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
copy_image (GtkWidget *widget,
|
||||
const char *action_name,
|
||||
GVariant *parameter)
|
||||
{
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (widget);
|
||||
DemoImage *demo = DEMO_IMAGE (widget);
|
||||
GdkPaintable *paintable = get_image_paintable (GTK_IMAGE (demo->image));
|
||||
GValue value = G_VALUE_INIT;
|
||||
|
||||
g_value_init (&value, GDK_TYPE_PAINTABLE);
|
||||
g_value_set_object (&value, paintable);
|
||||
gdk_clipboard_set_value (clipboard, &value);
|
||||
g_value_unset (&value);
|
||||
|
||||
if (paintable)
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
|
||||
static void
|
||||
paste_image (GtkWidget *widget,
|
||||
const char *action_name,
|
||||
GVariant *parameter)
|
||||
{
|
||||
GdkClipboard *clipboard = gtk_widget_get_clipboard (widget);
|
||||
DemoImage *demo = DEMO_IMAGE (widget);
|
||||
GdkContentProvider *content = gdk_clipboard_get_content (clipboard);
|
||||
GValue value = G_VALUE_INIT;
|
||||
GdkPaintable *paintable;
|
||||
|
||||
g_value_init (&value, GDK_TYPE_PAINTABLE);
|
||||
if (!gdk_content_provider_get_value (content, &value, NULL))
|
||||
return;
|
||||
|
||||
paintable = GDK_PAINTABLE (g_value_get_object (&value));
|
||||
gtk_image_set_from_paintable (GTK_IMAGE (demo->image), paintable);
|
||||
g_value_unset (&value);
|
||||
}
|
||||
|
||||
static void
|
||||
pressed_cb (GtkGesture *gesture,
|
||||
int n_press,
|
||||
double x,
|
||||
double y,
|
||||
gpointer data)
|
||||
{
|
||||
DemoImage *demo = DEMO_IMAGE (gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture)));
|
||||
|
||||
gtk_popover_popup (GTK_POPOVER (demo->popover));
|
||||
}
|
||||
|
||||
static void
|
||||
demo_image_init (DemoImage *demo)
|
||||
{
|
||||
GMenu *menu;
|
||||
GMenuItem *item;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *dest;
|
||||
GtkGesture *gesture;
|
||||
|
||||
demo->image = gtk_image_new ();
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (demo->image), 48);
|
||||
gtk_widget_set_parent (demo->image, GTK_WIDGET (demo));
|
||||
|
||||
menu = g_menu_new ();
|
||||
item = g_menu_item_new (_("_Copy"), "clipboard.copy");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
item = g_menu_item_new (_("_Paste"), "clipboard.paste");
|
||||
g_menu_append_item (menu, item);
|
||||
|
||||
demo->popover = gtk_popover_menu_new_from_model (G_MENU_MODEL (menu));
|
||||
gtk_widget_set_parent (demo->popover, GTK_WIDGET (demo));
|
||||
|
||||
source = gtk_drag_source_new ();
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare_drag), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), NULL);
|
||||
gtk_widget_add_controller (GTK_WIDGET (demo), GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
dest = gtk_drop_target_new (GDK_TYPE_PAINTABLE, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), NULL);
|
||||
gtk_widget_add_controller (GTK_WIDGET (demo), GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), GDK_BUTTON_SECONDARY);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), NULL);
|
||||
gtk_widget_add_controller (GTK_WIDGET (demo), GTK_EVENT_CONTROLLER (gesture));
|
||||
}
|
||||
|
||||
static void
|
||||
demo_image_dispose (GObject *object)
|
||||
{
|
||||
DemoImage *demo = DEMO_IMAGE (object);
|
||||
|
||||
g_clear_pointer (&demo->image, gtk_widget_unparent);
|
||||
g_clear_pointer (&demo->popover, gtk_widget_unparent);
|
||||
|
||||
G_OBJECT_CLASS (demo_image_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
demo_image_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
DemoImage *demo = DEMO_IMAGE (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ICON_NAME:
|
||||
g_value_set_string (value, gtk_image_get_icon_name (GTK_IMAGE (demo->image)));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
demo_image_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
DemoImage *demo = DEMO_IMAGE (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_ICON_NAME:
|
||||
gtk_image_set_from_icon_name (GTK_IMAGE (demo->image),
|
||||
g_value_get_string (value));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
demo_image_class_init (DemoImageClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->dispose = demo_image_dispose;
|
||||
object_class->get_property = demo_image_get_property;
|
||||
object_class->set_property = demo_image_set_property;
|
||||
|
||||
g_object_class_install_property (object_class, PROP_ICON_NAME,
|
||||
g_param_spec_string ("icon-name", "Icon name", "Icon name",
|
||||
NULL, G_PARAM_READWRITE));
|
||||
|
||||
gtk_widget_class_set_layout_manager_type (widget_class, GTK_TYPE_BIN_LAYOUT);
|
||||
|
||||
gtk_widget_class_install_action (widget_class, "clipboard.copy", NULL, copy_image);
|
||||
gtk_widget_class_install_action (widget_class, "clipboard.paste", NULL, paste_image);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
demo_image_new (const char *icon_name)
|
||||
{
|
||||
return g_object_new (DEMO_TYPE_IMAGE, "icon-name", icon_name, NULL);
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define DEMO_TYPE_IMAGE (demo_image_get_type ())
|
||||
|
||||
G_DECLARE_FINAL_TYPE(DemoImage, demo_image, DEMO, IMAGE, GtkWidget)
|
||||
|
||||
GtkWidget * demo_image_new (const char *icon_name);
|
||||
|
||||
G_END_DECLS
|
||||
@@ -472,7 +472,7 @@ demo_tagged_entry_tag_set_has_close_button (DemoTaggedEntryTag *tag,
|
||||
gtk_container_add (GTK_CONTAINER (tag->button), image);
|
||||
gtk_widget_set_halign (tag->button, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (tag->button, GTK_ALIGN_CENTER);
|
||||
gtk_button_set_relief (GTK_BUTTON (tag->button), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (tag->button), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (tag->box), tag->button);
|
||||
g_signal_connect (tag->button, "clicked", G_CALLBACK (on_button_clicked), tag);
|
||||
}
|
||||
|
||||
+329
-224
@@ -1,202 +1,126 @@
|
||||
/* Drag-and-Drop
|
||||
*
|
||||
* I can't believe its not glade!
|
||||
*
|
||||
* Try right-clicking in the window.
|
||||
* This demo shows dragging colors and widgets.
|
||||
* The items in this demo can be moved, recolored
|
||||
* and rotated.
|
||||
*/
|
||||
|
||||
#include <glib/gi18n.h>
|
||||
#include <gtk/gtk.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct _GtkDemoWidget GtkDemoWidget;
|
||||
struct _GtkDemoWidget
|
||||
static GdkContentProvider *
|
||||
prepare (GtkDragSource *source,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
GType type;
|
||||
union {
|
||||
char *text;
|
||||
gboolean active;
|
||||
};
|
||||
};
|
||||
GtkWidget *canvas;
|
||||
GtkWidget *item;
|
||||
|
||||
static gpointer
|
||||
copy_demo_widget (gpointer data)
|
||||
{
|
||||
GtkDemoWidget *demo = g_memdup (data, sizeof (GtkDemoWidget));
|
||||
canvas = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
item = gtk_widget_pick (canvas, x, y, GTK_PICK_DEFAULT);
|
||||
|
||||
if (demo->type == GTK_TYPE_LABEL)
|
||||
demo->text = g_strdup (demo->text);
|
||||
if (!GTK_IS_LABEL (item))
|
||||
return NULL;
|
||||
|
||||
return demo;
|
||||
g_object_set_data (G_OBJECT (canvas), "dragged-item", item);
|
||||
|
||||
return gdk_content_provider_new_typed (GTK_TYPE_WIDGET, item);
|
||||
}
|
||||
|
||||
static void
|
||||
free_demo_widget (gpointer data)
|
||||
drag_begin (GtkDragSource *source,
|
||||
GdkDrag *drag)
|
||||
{
|
||||
GtkDemoWidget *demo = data;
|
||||
GtkWidget *canvas;
|
||||
GtkWidget *item;
|
||||
|
||||
if (demo->type == GTK_TYPE_LABEL)
|
||||
g_free (demo->text);
|
||||
canvas = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
item = g_object_get_data (G_OBJECT (canvas), "dragged-item");
|
||||
|
||||
g_free (demo);
|
||||
gtk_widget_set_opacity (item, 0.5);
|
||||
}
|
||||
|
||||
#define GTK_TYPE_DEMO_WIDGET (gtk_demo_widget_get_type ())
|
||||
static GType gtk_demo_widget_get_type (void);
|
||||
G_DEFINE_BOXED_TYPE (GtkDemoWidget, gtk_demo_widget, copy_demo_widget, free_demo_widget)
|
||||
|
||||
static GtkDemoWidget *
|
||||
serialize_widget (GtkWidget *widget)
|
||||
static void
|
||||
drag_end (GtkDragSource *source,
|
||||
GdkDrag *drag)
|
||||
{
|
||||
GtkDemoWidget *demo;
|
||||
GtkWidget *canvas;
|
||||
GtkWidget *item;
|
||||
|
||||
demo = g_new0 (GtkDemoWidget, 1);
|
||||
demo->type = G_OBJECT_TYPE (widget);
|
||||
canvas = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (source));
|
||||
item = g_object_get_data (G_OBJECT (canvas), "dragged-item");
|
||||
g_object_set_data (G_OBJECT (canvas), "dragged-item", NULL);
|
||||
|
||||
if (GTK_IS_LABEL (widget))
|
||||
{
|
||||
demo->text = g_strdup (gtk_label_get_text (GTK_LABEL (widget)));
|
||||
}
|
||||
else if (GTK_IS_SPINNER (widget))
|
||||
{
|
||||
g_object_get (widget, "spinning", &demo->active, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Type %s not supported\n", g_type_name (demo->type));
|
||||
}
|
||||
|
||||
return demo;
|
||||
gtk_widget_set_opacity (item, 1.0);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
deserialize_widget (GtkDemoWidget *demo)
|
||||
static void
|
||||
drag_cancel (GtkDragSource *source,
|
||||
GdkDrag *drag,
|
||||
GdkDragCancelReason reason)
|
||||
{
|
||||
GtkWidget *widget = NULL;
|
||||
drag_end (source, drag);
|
||||
}
|
||||
|
||||
if (demo->type == GTK_TYPE_LABEL)
|
||||
{
|
||||
widget = gtk_label_new (demo->text);
|
||||
}
|
||||
else if (demo->type == GTK_TYPE_SPINNER)
|
||||
{
|
||||
widget = g_object_new (demo->type, "spinning", demo->active, NULL);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "demo");
|
||||
}
|
||||
else
|
||||
{
|
||||
g_print ("Type %s not supported\n", g_type_name (demo->type));
|
||||
}
|
||||
typedef struct {
|
||||
double x, y;
|
||||
double angle;
|
||||
double delta;
|
||||
} TransformData;
|
||||
|
||||
return widget;
|
||||
static void
|
||||
apply_transform (GtkWidget *item)
|
||||
{
|
||||
GtkWidget *canvas = gtk_widget_get_parent (item);
|
||||
TransformData *data;
|
||||
GskTransform *transform;
|
||||
|
||||
data = g_object_get_data (G_OBJECT (item), "transform-data");
|
||||
transform = gsk_transform_rotate (gsk_transform_translate (NULL, &(graphene_point_t){data->x, data->y}),
|
||||
data->angle + data->delta);
|
||||
gtk_fixed_set_child_transform (GTK_FIXED (canvas), item, transform);
|
||||
gsk_transform_unref (transform);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
drag_drop (GtkDropTarget *target,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
GtkWidget *item;
|
||||
TransformData *transform_data;
|
||||
GtkWidget *canvas;
|
||||
GtkWidget *last_child;
|
||||
|
||||
item = g_value_get_object (value);
|
||||
transform_data = g_object_get_data (G_OBJECT (item), "transform-data");
|
||||
|
||||
transform_data->x = x;
|
||||
transform_data->y = y;
|
||||
|
||||
canvas = gtk_widget_get_parent (item);
|
||||
last_child = gtk_widget_get_last_child (canvas);
|
||||
if (item != last_child)
|
||||
gtk_widget_insert_after (item, canvas, last_child);
|
||||
|
||||
apply_transform (item);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static double pos_x, pos_y;
|
||||
|
||||
static void
|
||||
new_label_cb (GtkWidget *button,
|
||||
gpointer data)
|
||||
{
|
||||
GtkFixed *fixed = data;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = gtk_label_new ("Label");
|
||||
gtk_fixed_put (fixed, widget, pos_x, pos_y);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
static GtkWidget * canvas_item_new (double x, double y);
|
||||
|
||||
static void
|
||||
new_spinner_cb (GtkWidget *button,
|
||||
gpointer data)
|
||||
new_item_cb (GtkWidget *button, gpointer data)
|
||||
{
|
||||
GtkFixed *fixed = data;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *canvas = data;
|
||||
GtkWidget *item;
|
||||
|
||||
widget = gtk_spinner_new ();
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "demo");
|
||||
gtk_spinner_start (GTK_SPINNER (widget));
|
||||
gtk_fixed_put (fixed, widget, pos_x, pos_y);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
copy_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
GtkDemoWidget *demo;
|
||||
|
||||
demo = serialize_widget (child);
|
||||
|
||||
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
|
||||
gdk_clipboard_set (clipboard, GTK_TYPE_DEMO_WIDGET, demo);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
delete_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
gtk_widget_destroy (child);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
cut_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
copy_cb (button, child);
|
||||
delete_cb (button, child);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
value_read (GObject *source,
|
||||
GAsyncResult *res,
|
||||
gpointer data)
|
||||
{
|
||||
GdkClipboard *clipboard = GDK_CLIPBOARD (source);
|
||||
GError *error = NULL;
|
||||
const GValue *value;
|
||||
GtkDemoWidget *demo;
|
||||
GtkWidget *widget = NULL;
|
||||
|
||||
value = gdk_clipboard_read_value_finish (clipboard, res, &error);
|
||||
|
||||
if (value == NULL)
|
||||
{
|
||||
g_print ("error: %s\n", error->message);
|
||||
g_error_free (error);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!G_VALUE_HOLDS (value, GTK_TYPE_DEMO_WIDGET))
|
||||
{
|
||||
g_print ("can't handle clipboard contents\n");
|
||||
return;
|
||||
}
|
||||
|
||||
demo = g_value_get_boxed (value);
|
||||
widget = deserialize_widget (demo);
|
||||
|
||||
gtk_fixed_put (GTK_FIXED (data), widget, pos_x, pos_y);
|
||||
}
|
||||
|
||||
static void
|
||||
paste_cb (GtkWidget *button, GtkWidget *fixed)
|
||||
{
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
|
||||
if (gdk_content_formats_contain_gtype (gdk_clipboard_get_formats (clipboard), GTK_TYPE_DEMO_WIDGET))
|
||||
{
|
||||
g_print ("Paste %s\n", g_type_name (GTK_TYPE_DEMO_WIDGET));
|
||||
gdk_clipboard_read_value_async (clipboard, GTK_TYPE_DEMO_WIDGET, 0, NULL, value_read, fixed);
|
||||
}
|
||||
else
|
||||
g_print ("Don't know how to handle clipboard contents\n");
|
||||
item = canvas_item_new (pos_x, pos_y);
|
||||
gtk_container_add (GTK_CONTAINER (canvas), item);
|
||||
apply_transform (item);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
@@ -204,14 +128,15 @@ paste_cb (GtkWidget *button, GtkWidget *fixed)
|
||||
static void
|
||||
edit_label_done (GtkWidget *entry, gpointer data)
|
||||
{
|
||||
GtkWidget *fixed = gtk_widget_get_parent (entry);
|
||||
GtkWidget *canvas = gtk_widget_get_parent (entry);
|
||||
GtkWidget *label;
|
||||
int x, y;
|
||||
|
||||
gtk_fixed_get_child_position (GTK_FIXED (fixed), entry, &x, &y);
|
||||
gtk_fixed_get_child_position (GTK_FIXED (canvas), entry, &x, &y);
|
||||
|
||||
label = GTK_WIDGET (g_object_get_data (G_OBJECT (entry), "label"));
|
||||
gtk_label_set_text (GTK_LABEL (label), gtk_editable_get_text (GTK_EDITABLE (entry)));
|
||||
gtk_widget_show (label);
|
||||
|
||||
gtk_widget_destroy (entry);
|
||||
}
|
||||
@@ -219,10 +144,10 @@ edit_label_done (GtkWidget *entry, gpointer data)
|
||||
static void
|
||||
edit_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
GtkWidget *fixed = gtk_widget_get_parent (child);
|
||||
GtkWidget *canvas = gtk_widget_get_parent (child);
|
||||
int x, y;
|
||||
|
||||
gtk_fixed_get_child_position (GTK_FIXED (fixed), child, &x, &y);
|
||||
gtk_fixed_get_child_position (GTK_FIXED (canvas), child, &x, &y);
|
||||
|
||||
if (GTK_IS_LABEL (child))
|
||||
{
|
||||
@@ -233,21 +158,23 @@ edit_cb (GtkWidget *button, GtkWidget *child)
|
||||
gtk_editable_set_text (GTK_EDITABLE (entry), gtk_label_get_text (GTK_LABEL (child)));
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (entry), 12);
|
||||
g_signal_connect (entry, "activate", G_CALLBACK (edit_label_done), NULL);
|
||||
gtk_fixed_put (GTK_FIXED (fixed), entry, x, y);
|
||||
gtk_fixed_put (GTK_FIXED (canvas), entry, x, y);
|
||||
gtk_widget_grab_focus (entry);
|
||||
}
|
||||
else if (GTK_IS_SPINNER (child))
|
||||
{
|
||||
gboolean active;
|
||||
|
||||
g_object_get (child, "spinning", &active, NULL);
|
||||
g_object_set (child, "spinning", !active, NULL);
|
||||
gtk_widget_hide (child);
|
||||
}
|
||||
|
||||
if (button)
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
delete_cb (GtkWidget *button, GtkWidget *child)
|
||||
{
|
||||
gtk_widget_destroy (child);
|
||||
|
||||
gtk_popover_popdown (GTK_POPOVER (gtk_widget_get_ancestor (button, GTK_TYPE_POPOVER)));
|
||||
}
|
||||
|
||||
static void
|
||||
pressed_cb (GtkGesture *gesture,
|
||||
int n_press,
|
||||
@@ -266,7 +193,6 @@ pressed_cb (GtkGesture *gesture,
|
||||
GtkWidget *menu;
|
||||
GtkWidget *box;
|
||||
GtkWidget *item;
|
||||
GdkClipboard *clipboard;
|
||||
|
||||
pos_x = x;
|
||||
pos_y = y;
|
||||
@@ -278,20 +204,16 @@ pressed_cb (GtkGesture *gesture,
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (menu), box);
|
||||
|
||||
item = gtk_button_new_with_label ("New Label");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (new_label_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("New Spinner");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (new_spinner_cb), widget);
|
||||
item = gtk_button_new_with_label ("New");
|
||||
gtk_button_set_has_frame (GTK_BUTTON (item), FALSE);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (new_item_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_button_new_with_label ("Edit");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (item), FALSE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (edit_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
@@ -299,25 +221,8 @@ pressed_cb (GtkGesture *gesture,
|
||||
item = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
|
||||
item = gtk_button_new_with_label ("Cut");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (cut_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Copy");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (copy_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Paste");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
|
||||
gtk_widget_set_sensitive (item,
|
||||
gdk_content_formats_contain_gtype (gdk_clipboard_get_formats (clipboard), GTK_TYPE_DEMO_WIDGET));
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (paste_cb), widget);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
item = gtk_button_new_with_label ("Delete");
|
||||
gtk_button_set_relief (GTK_BUTTON (item), GTK_RELIEF_NONE);
|
||||
gtk_button_set_has_frame (GTK_BUTTON (item), FALSE);
|
||||
gtk_widget_set_sensitive (item, child != NULL && child != widget);
|
||||
g_signal_connect (item, "clicked", G_CALLBACK (delete_cb), child);
|
||||
gtk_container_add (GTK_CONTAINER (box), item);
|
||||
@@ -346,6 +251,165 @@ released_cb (GtkGesture *gesture,
|
||||
}
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
canvas_new (void)
|
||||
{
|
||||
GtkWidget *canvas;
|
||||
GtkDragSource *source;
|
||||
GtkDropTarget *dest;
|
||||
GtkGesture *gesture;
|
||||
|
||||
canvas = gtk_fixed_new ();
|
||||
gtk_widget_set_hexpand (canvas, TRUE);
|
||||
gtk_widget_set_vexpand (canvas, TRUE);
|
||||
gtk_widget_add_css_class (canvas, "frame");
|
||||
|
||||
source = gtk_drag_source_new ();
|
||||
gtk_drag_source_set_actions (source, GDK_ACTION_MOVE);
|
||||
g_signal_connect (source, "prepare", G_CALLBACK (prepare), NULL);
|
||||
g_signal_connect (source, "drag-begin", G_CALLBACK (drag_begin), NULL);
|
||||
g_signal_connect (source, "drag-end", G_CALLBACK (drag_end), NULL);
|
||||
g_signal_connect (source, "drag-cancel", G_CALLBACK (drag_cancel), NULL);
|
||||
gtk_widget_add_controller (canvas, GTK_EVENT_CONTROLLER (source));
|
||||
|
||||
dest = gtk_drop_target_new (GTK_TYPE_WIDGET, GDK_ACTION_MOVE);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (drag_drop), NULL);
|
||||
gtk_widget_add_controller (canvas, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
gesture = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (gesture), 0);
|
||||
g_signal_connect (gesture, "pressed", G_CALLBACK (pressed_cb), NULL);
|
||||
g_signal_connect (gesture, "released", G_CALLBACK (released_cb), NULL);
|
||||
gtk_widget_add_controller (canvas, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
return canvas;
|
||||
}
|
||||
|
||||
static void
|
||||
set_color (GtkWidget *item,
|
||||
GdkRGBA *color)
|
||||
{
|
||||
char *css;
|
||||
char *str;
|
||||
GtkStyleContext *context;
|
||||
GtkCssProvider *provider;
|
||||
|
||||
str = gdk_rgba_to_string (color);
|
||||
css = g_strdup_printf ("* { background: %s; padding: 10px; }", str);
|
||||
|
||||
context = gtk_widget_get_style_context (item);
|
||||
provider = g_object_get_data (G_OBJECT (context), "style-provider");
|
||||
if (provider)
|
||||
gtk_style_context_remove_provider (context, GTK_STYLE_PROVIDER (provider));
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_data (provider, css, -1);
|
||||
gtk_style_context_add_provider (gtk_widget_get_style_context (item), GTK_STYLE_PROVIDER (provider), 800);
|
||||
g_object_set_data_full (G_OBJECT (context), "style-provider", provider, g_object_unref);
|
||||
|
||||
g_free (str);
|
||||
g_free (css);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
item_drag_drop (GtkDropTarget *dest,
|
||||
const GValue *value,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
GtkWidget *item = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
set_color (item, g_value_get_boxed (value));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
angle_changed (GtkGestureRotate *gesture,
|
||||
double angle,
|
||||
double delta)
|
||||
{
|
||||
GtkWidget *item = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
|
||||
TransformData *data = g_object_get_data (G_OBJECT (item), "transform-data");
|
||||
|
||||
data->delta = angle / M_PI * 180.0;
|
||||
|
||||
apply_transform (item);
|
||||
}
|
||||
|
||||
static void
|
||||
rotate_done (GtkGesture *gesture)
|
||||
{
|
||||
GtkWidget *item = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
|
||||
TransformData *data = g_object_get_data (G_OBJECT (item), "transform-data");
|
||||
|
||||
data->angle = data->angle + data->delta;
|
||||
data->delta = 0;
|
||||
}
|
||||
|
||||
static void
|
||||
click_done (GtkGesture *gesture)
|
||||
{
|
||||
GtkWidget *item = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (gesture));
|
||||
GtkWidget *canvas = gtk_widget_get_parent (item);
|
||||
GtkWidget *last_child;
|
||||
|
||||
last_child = gtk_widget_get_last_child (canvas);
|
||||
if (item != last_child)
|
||||
gtk_widget_insert_after (item, canvas, last_child);
|
||||
}
|
||||
|
||||
static int n_items = 0;
|
||||
|
||||
static GtkWidget *
|
||||
canvas_item_new (double x,
|
||||
double y)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
char *label;
|
||||
char *id;
|
||||
TransformData *transform_data;
|
||||
GdkRGBA rgba;
|
||||
GtkDropTarget *dest;
|
||||
GtkGesture *gesture;
|
||||
|
||||
n_items++;
|
||||
|
||||
label = g_strdup_printf ("Item %d", n_items);
|
||||
id = g_strdup_printf ("item%d", n_items);
|
||||
|
||||
gdk_rgba_parse (&rgba, "yellow");
|
||||
|
||||
widget = gtk_label_new (label);
|
||||
gtk_widget_add_css_class (widget, "frame");
|
||||
gtk_widget_set_name (widget, id);
|
||||
|
||||
set_color (widget, &rgba);
|
||||
transform_data = g_new0 (TransformData, 1);
|
||||
transform_data->x = x;
|
||||
transform_data->y = y;
|
||||
transform_data->angle = 0.0;
|
||||
g_object_set_data_full (G_OBJECT (widget), "transform-data", transform_data, g_free);
|
||||
|
||||
g_free (label);
|
||||
g_free (id);
|
||||
|
||||
dest = gtk_drop_target_new (GDK_TYPE_RGBA, GDK_ACTION_COPY);
|
||||
g_signal_connect (dest, "drop", G_CALLBACK (item_drag_drop), NULL);
|
||||
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (dest));
|
||||
|
||||
gesture = gtk_gesture_rotate_new ();
|
||||
g_signal_connect (gesture, "angle-changed", G_CALLBACK (angle_changed), NULL);
|
||||
g_signal_connect (gesture, "end", G_CALLBACK (rotate_done), NULL);
|
||||
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
gesture = gtk_gesture_click_new ();
|
||||
g_signal_connect (gesture, "released", G_CALLBACK (click_done), NULL);
|
||||
gtk_widget_add_controller (widget, GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
return widget;
|
||||
}
|
||||
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
GtkWidget *
|
||||
@@ -353,37 +417,78 @@ do_dnd (GtkWidget *do_widget)
|
||||
{
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *vbox, *fixed;
|
||||
GtkGesture *multipress;
|
||||
GtkCssProvider *provider;
|
||||
GtkWidget *sw;
|
||||
GtkWidget *canvas;
|
||||
GtkWidget *widget;
|
||||
GtkWidget *box, *box2, *box3;
|
||||
const char *colors[] = {
|
||||
"red", "green", "blue", "magenta", "orange", "gray", "black", "yellow",
|
||||
"white", "gray", "brown", "pink", "cyan", "bisque", "gold", "maroon",
|
||||
"navy", "orchid", "olive", "peru", "salmon", "silver", "wheat",
|
||||
NULL
|
||||
};
|
||||
int i;
|
||||
int x, y;
|
||||
|
||||
widget = gtk_color_button_new ();
|
||||
gtk_widget_destroy (widget);
|
||||
|
||||
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");
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Drag-and-Drop");
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 480);
|
||||
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), vbox);
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
fixed = gtk_fixed_new ();
|
||||
gtk_container_add (GTK_CONTAINER (vbox), fixed);
|
||||
gtk_widget_set_hexpand (fixed, TRUE);
|
||||
gtk_widget_set_vexpand (fixed, TRUE);
|
||||
box2 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_container_add (GTK_CONTAINER (box), box2);
|
||||
|
||||
multipress = gtk_gesture_click_new ();
|
||||
gtk_gesture_single_set_button (GTK_GESTURE_SINGLE (multipress), 0);
|
||||
g_signal_connect (multipress, "pressed", G_CALLBACK (pressed_cb), NULL);
|
||||
g_signal_connect (multipress, "released", G_CALLBACK (released_cb), NULL);
|
||||
gtk_widget_add_controller (fixed, GTK_EVENT_CONTROLLER (multipress));
|
||||
canvas = canvas_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box2), canvas);
|
||||
|
||||
provider = gtk_css_provider_new ();
|
||||
gtk_css_provider_load_from_resource (provider, "/dnd/dnd.css");
|
||||
gtk_style_context_add_provider_for_display (gdk_display_get_default (),
|
||||
GTK_STYLE_PROVIDER (provider),
|
||||
800);
|
||||
n_items = 0;
|
||||
|
||||
x = y = 40;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
GtkWidget *item;
|
||||
|
||||
item = canvas_item_new (x, y);
|
||||
gtk_container_add (GTK_CONTAINER (canvas), item);
|
||||
apply_transform (item);
|
||||
|
||||
x += 150;
|
||||
y += 100;
|
||||
}
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_NEVER);
|
||||
gtk_container_add (GTK_CONTAINER (box), sw);
|
||||
|
||||
box3 = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_add_css_class (box3, "linked");
|
||||
gtk_container_add (GTK_CONTAINER (sw), box3);
|
||||
|
||||
for (i = 0; colors[i]; i++)
|
||||
{
|
||||
GdkRGBA rgba;
|
||||
GtkWidget *swatch;
|
||||
|
||||
gdk_rgba_parse (&rgba, colors[i]);
|
||||
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"selectable", FALSE,
|
||||
NULL);
|
||||
gtk_container_add (GTK_CONTAINER (box3), swatch);
|
||||
}
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
spinner.demo {
|
||||
opacity: 1;
|
||||
}
|
||||
@@ -214,7 +214,6 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_vexpand (frame, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
@@ -235,7 +234,6 @@ do_drawingarea (GtkWidget *do_widget)
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_widget_set_vexpand (frame, TRUE);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
da = gtk_drawing_area_new ();
|
||||
|
||||
@@ -366,8 +366,7 @@ do_editable_cells (GtkWidget *do_widget)
|
||||
gtk_label_new ("Shopping list (you can edit the cells!)"));
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@@ -59,7 +59,7 @@ do_expander (GtkWidget *do_widget)
|
||||
gtk_widget_set_vexpand (expander, TRUE);
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (sw), 100);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@@ -62,7 +62,7 @@ create_blurred_button (void)
|
||||
{
|
||||
GtkWidget *w = gtk_button_new ();
|
||||
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (w), "blurred-button");
|
||||
gtk_widget_add_css_class (w, "blurred-button");
|
||||
|
||||
return w;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="changes_allow">
|
||||
<property name="icon-name">changes-allow</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<signal name="notify::active" handler="fishbowl_changes_toggled_cb"/>
|
||||
</object>
|
||||
</child>
|
||||
|
||||
@@ -52,7 +52,7 @@ create_faces (void)
|
||||
/* Add a face */
|
||||
faces[i].face = gtk_frame_new (NULL);
|
||||
gtk_widget_set_size_request (faces[i].face, face_size, face_size);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (faces[i].face), faces[i].css_class);
|
||||
gtk_widget_add_css_class (faces[i].face, faces[i].css_class);
|
||||
gtk_container_add (GTK_CONTAINER (fixed), faces[i].face);
|
||||
|
||||
/* Set up the transformation for each face */
|
||||
|
||||
@@ -189,8 +189,6 @@ gtk_font_plane_init (GtkFontPlane *plane)
|
||||
{
|
||||
GtkGesture *gesture;
|
||||
|
||||
gtk_widget_set_can_focus (GTK_WIDGET (plane), TRUE);
|
||||
|
||||
gesture = gtk_gesture_drag_new ();
|
||||
g_signal_connect (gesture, "drag-begin",
|
||||
G_CALLBACK (plane_drag_gesture_begin), plane);
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="propagate-natural-height">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
|
||||
@@ -0,0 +1,137 @@
|
||||
/* OpenGL/Gears
|
||||
*
|
||||
* This is a classic OpenGL demo, running in a GtkGLArea.
|
||||
*/
|
||||
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "gtkgears.h"
|
||||
|
||||
/************************************************************************
|
||||
* DEMO CODE *
|
||||
************************************************************************/
|
||||
|
||||
static void
|
||||
on_axis_value_change (GtkAdjustment *adjustment,
|
||||
gpointer data)
|
||||
{
|
||||
GtkGears *gears = GTK_GEARS (data);
|
||||
int axis = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (adjustment), "axis"));
|
||||
|
||||
gtk_gears_set_axis (gears, axis, gtk_adjustment_get_value (adjustment));
|
||||
}
|
||||
|
||||
|
||||
static GtkWidget *
|
||||
create_axis_slider (GtkGears *gears,
|
||||
int axis)
|
||||
{
|
||||
GtkWidget *box, *label, *slider;
|
||||
GtkAdjustment *adj;
|
||||
const char *text;
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
case GTK_GEARS_X_AXIS:
|
||||
text = "X";
|
||||
break;
|
||||
|
||||
case GTK_GEARS_Y_AXIS:
|
||||
text = "Y";
|
||||
break;
|
||||
|
||||
case GTK_GEARS_Z_AXIS:
|
||||
text = "Z";
|
||||
break;
|
||||
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
label = gtk_label_new (text);
|
||||
gtk_container_add (GTK_CONTAINER (box), label);
|
||||
gtk_widget_show (label);
|
||||
|
||||
adj = gtk_adjustment_new (gtk_gears_get_axis (gears, axis), 0.0, 360.0, 1.0, 12.0, 0.0);
|
||||
g_object_set_data (G_OBJECT (adj), "axis", GINT_TO_POINTER (axis));
|
||||
g_signal_connect (adj, "value-changed",
|
||||
G_CALLBACK (on_axis_value_change),
|
||||
gears);
|
||||
slider = gtk_scale_new (GTK_ORIENTATION_VERTICAL, adj);
|
||||
gtk_scale_set_draw_value (GTK_SCALE (slider), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (box), slider);
|
||||
gtk_widget_set_vexpand (slider, TRUE);
|
||||
gtk_widget_show (slider);
|
||||
|
||||
gtk_widget_show (box);
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_gears (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
GtkWidget *box, *hbox, *fps_label, *gears, *overlay, *frame;
|
||||
int i;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Gears");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), TRUE);
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 640, 640);
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
overlay = gtk_overlay_new ();
|
||||
gtk_widget_set_margin_start (overlay, 12);
|
||||
gtk_widget_set_margin_end (overlay, 12);
|
||||
gtk_widget_set_margin_top (overlay, 12);
|
||||
gtk_widget_set_margin_bottom (overlay, 12);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (window), overlay);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_START);
|
||||
gtk_widget_add_css_class (frame, "app-notification");
|
||||
gtk_overlay_add_overlay (GTK_OVERLAY (overlay), frame);
|
||||
|
||||
fps_label = gtk_label_new ("");
|
||||
gtk_widget_set_halign (fps_label, GTK_ALIGN_START);
|
||||
gtk_container_add (GTK_CONTAINER (frame), fps_label);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (overlay), box);
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (box), 6);
|
||||
gtk_container_add (GTK_CONTAINER (box), hbox);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_widget_set_hexpand (gears, TRUE);
|
||||
gtk_widget_set_vexpand (gears, TRUE);
|
||||
gtk_container_add (GTK_CONTAINER (hbox), gears);
|
||||
|
||||
for (i = 0; i < GTK_GEARS_N_AXIS; i++)
|
||||
gtk_container_add (GTK_CONTAINER (hbox), create_axis_slider (GTK_GEARS (gears), i));
|
||||
|
||||
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE);
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 6);
|
||||
gtk_container_add (GTK_CONTAINER (box), hbox);
|
||||
|
||||
gtk_gears_set_fps_label (GTK_GEARS (gears), GTK_LABEL (fps_label));
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_widget_destroy (window);
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
/* OpenGL Area
|
||||
/* OpenGL/OpenGL Area
|
||||
*
|
||||
* GtkGLArea is a widget that allows custom drawing using OpenGL calls.
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ do_headerbar (GtkWidget *do_widget)
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (box), "linked");
|
||||
gtk_widget_add_css_class (box, "linked");
|
||||
button = gtk_button_new ();
|
||||
gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name ("pan-start-symbolic"));
|
||||
gtk_container_add (GTK_CONTAINER (box), button);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
<interface>
|
||||
<object class="GtkShortcutsWindow" id="help_overlay">
|
||||
<child>
|
||||
<object class="GtkShortcutsSection">
|
||||
<child>
|
||||
<object class="GtkShortcutsGroup">
|
||||
<property name="title">General</property>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="accelerator">F1</property>
|
||||
<property name="title">Show About Dialog</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkShortcutsShortcut">
|
||||
<property name="accelerator"><Control>q</property>
|
||||
<property name="title">Quit</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -277,8 +277,7 @@ do_iconview (GtkWidget *do_widget)
|
||||
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@@ -360,7 +360,6 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
@@ -379,7 +378,6 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
@@ -396,7 +394,6 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
@@ -418,7 +415,6 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
@@ -441,7 +437,6 @@ do_images (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_halign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_widget_set_valign (frame, GTK_ALIGN_CENTER);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
@@ -44,7 +44,6 @@ do_infobar (GtkWidget *do_widget)
|
||||
GtkWidget *frame;
|
||||
GtkWidget *bar;
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *vbox2;
|
||||
GtkWidget *label;
|
||||
GtkWidget *actions;
|
||||
GtkWidget *button;
|
||||
@@ -52,11 +51,13 @@ do_infobar (GtkWidget *do_widget)
|
||||
if (!window)
|
||||
{
|
||||
actions = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
gtk_widget_add_css_class (actions, "linked");
|
||||
|
||||
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");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
@@ -131,23 +132,18 @@ do_infobar (GtkWidget *do_widget)
|
||||
g_object_bind_property (bar, "revealed", button, "active", G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE);
|
||||
gtk_container_add (GTK_CONTAINER (actions), button);
|
||||
|
||||
frame = gtk_frame_new ("Info bars");
|
||||
frame = gtk_frame_new ("An example of different info bars");
|
||||
gtk_widget_set_margin_top (frame, 8);
|
||||
gtk_widget_set_margin_bottom (frame, 8);
|
||||
gtk_container_add (GTK_CONTAINER (vbox), frame);
|
||||
|
||||
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
|
||||
gtk_widget_set_margin_start (vbox2, 8);
|
||||
gtk_widget_set_margin_end (vbox2, 8);
|
||||
gtk_widget_set_margin_top (vbox2, 8);
|
||||
gtk_widget_set_margin_bottom (vbox2, 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), vbox2);
|
||||
gtk_widget_set_halign (actions, GTK_ALIGN_CENTER);
|
||||
|
||||
/* Standard message dialog */
|
||||
label = gtk_label_new ("An example of different info bars");
|
||||
gtk_container_add (GTK_CONTAINER (vbox2), label);
|
||||
|
||||
gtk_container_add (GTK_CONTAINER (vbox2), actions);
|
||||
gtk_widget_set_margin_start (actions, 8);
|
||||
gtk_widget_set_margin_end (actions, 8);
|
||||
gtk_widget_set_margin_top (actions, 8);
|
||||
gtk_widget_set_margin_bottom (actions, 8);
|
||||
gtk_container_add (GTK_CONTAINER (frame), actions);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
|
||||
+15
-5
@@ -1,7 +1,7 @@
|
||||
/* Links
|
||||
*
|
||||
* GtkLabel can show hyperlinks. The default action is to call
|
||||
* gtk_show_uri_on_window() on their URI, but it is possible to override
|
||||
* gtk_show_uri() on their URI, but it is possible to override
|
||||
* this with a custom handler.
|
||||
*/
|
||||
|
||||
@@ -30,6 +30,8 @@ activate_link (GtkWidget *label,
|
||||
GTK_DIALOG_DESTROY_WITH_PARENT,
|
||||
GTK_MESSAGE_INFO,
|
||||
GTK_BUTTONS_OK,
|
||||
"Keyboard navigation");
|
||||
gtk_message_dialog_format_secondary_markup (GTK_MESSAGE_DIALOG (dialog),
|
||||
"The term <i>keynav</i> is a shorthand for "
|
||||
"keyboard navigation and refers to the process of using "
|
||||
"a program (exclusively) via keyboard input.");
|
||||
@@ -56,21 +58,29 @@ do_links (GtkWidget *do_widget)
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Links");
|
||||
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\""
|
||||
"title=\"plain text\">text</a> may be marked up\n"
|
||||
"as hyperlinks, which can be clicked\n"
|
||||
"or activated via <a href=\"keynav\">keynav</a>\n"
|
||||
"and they work fine with other markup, like when\n"
|
||||
"title=\"plain text\">text</a> may be marked up "
|
||||
"as hyperlinks, which can be clicked "
|
||||
"or activated via <a href=\"keynav\">keynav</a> "
|
||||
"and they work fine with other markup, like when "
|
||||
"searching on <a href=\"http://www.google.com/\">"
|
||||
"<span color=\"#0266C8\">G</span><span color=\"#F90101\">o</span>"
|
||||
"<span color=\"#F2B50F\">o</span><span color=\"#0266C8\">g</span>"
|
||||
"<span color=\"#00933B\">l</span><span color=\"#F90101\">e</span>"
|
||||
"</a>.");
|
||||
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
|
||||
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
|
||||
gtk_label_set_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
|
||||
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
|
||||
gtk_widget_set_margin_start (label, 20);
|
||||
gtk_widget_set_margin_end (label, 20);
|
||||
gtk_widget_set_margin_top (label, 20);
|
||||
gtk_widget_set_margin_bottom (label, 20);
|
||||
gtk_container_add (GTK_CONTAINER (window), label);
|
||||
gtk_widget_show (label);
|
||||
}
|
||||
|
||||
@@ -272,8 +272,7 @@ do_list_store (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (vbox), label);
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_NEVER,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
<object class="GtkButton" id="button2">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="source_name">
|
||||
<property name="valign">baseline</property>
|
||||
@@ -109,7 +109,7 @@
|
||||
<object class="GtkLinkButton" id="resent_by_button">
|
||||
<property name="label" translatable="0">reshareer</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="uri">http://www.gtk.org</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -126,7 +126,7 @@
|
||||
<object class="GtkButton" id="expand_button">
|
||||
<property name="label" translatable="yes">Expand</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<signal name="clicked" handler="expand_clicked" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -138,14 +138,14 @@
|
||||
<object class="GtkButton" id="reply-button">
|
||||
<property name="label" translatable="yes">Reply</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="reshare-button">
|
||||
<property name="label" translatable="yes">Reshare</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<signal name="clicked" handler="reshare_clicked" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -153,7 +153,7 @@
|
||||
<object class="GtkButton" id="favorite-buttton">
|
||||
<property name="label" translatable="yes">Favorite</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<signal name="clicked" handler="favorite_clicked" swapped="yes"/>
|
||||
</object>
|
||||
</child>
|
||||
@@ -161,7 +161,7 @@
|
||||
<object class="GtkMenuButton" id="more-button">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="menu-model">menu1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="label" translatable="yes">More...</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -185,7 +185,6 @@
|
||||
<property name="spacing">8</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_reshares_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
@@ -198,7 +197,6 @@ Reshares</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<property name="shadow-type">none</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="n_favorites_label">
|
||||
<property name="label" translatable="0"><b>2</b>
|
||||
@@ -225,7 +223,7 @@ FAVORITES</property>
|
||||
<object class="GtkButton" id="button5">
|
||||
<property name="label" translatable="yes">Details</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<style>
|
||||
<class name="dim-label"/>
|
||||
</style>
|
||||
|
||||
+14
-3
@@ -55,6 +55,8 @@ activate_about (GSimpleAction *action,
|
||||
glib_major_version,
|
||||
glib_minor_version,
|
||||
glib_micro_version);
|
||||
g_string_append_printf (s, "\tPango\t%s\n",
|
||||
pango_version_string ());
|
||||
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
|
||||
gtk_get_major_version (),
|
||||
gtk_get_minor_version (),
|
||||
@@ -70,7 +72,7 @@ activate_about (GSimpleAction *action,
|
||||
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
|
||||
"program-name", "GTK Demo",
|
||||
"version", version,
|
||||
"copyright", "© 1997—2019 The GTK Team",
|
||||
"copyright", "© 1997—2020 The GTK Team",
|
||||
"license-type", GTK_LICENSE_LGPL_2_1,
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to demonstrate GTK widgets",
|
||||
@@ -612,8 +614,6 @@ display_text (const char *resource)
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_container_add (GTK_CONTAINER (sw), textview);
|
||||
|
||||
return sw;
|
||||
@@ -1186,6 +1186,14 @@ main (int argc, char **argv)
|
||||
{ "quit", activate_quit, NULL, NULL, NULL },
|
||||
{ "inspector", activate_inspector, NULL, NULL, NULL },
|
||||
};
|
||||
struct {
|
||||
const gchar *action_and_target;
|
||||
const gchar *accelerators[2];
|
||||
} accels[] = {
|
||||
{ "app.about", { "F1", NULL } },
|
||||
{ "app.quit", { "<Control>q", NULL } },
|
||||
};
|
||||
int i;
|
||||
|
||||
/* Most code in gtk-demo is intended to be exemplary, but not
|
||||
* these few lines, which are just a hack so gtk-demo will work
|
||||
@@ -1203,6 +1211,9 @@ main (int argc, char **argv)
|
||||
app_entries, G_N_ELEMENTS (app_entries),
|
||||
app);
|
||||
|
||||
for (i = 0; i < G_N_ELEMENTS (accels); i++)
|
||||
gtk_application_set_accels_for_action (app, accels[i].action_and_target, accels[i].accelerators);
|
||||
|
||||
g_application_add_main_option (G_APPLICATION (app), "version", 0, 0, G_OPTION_ARG_NONE, "Show program version", NULL);
|
||||
g_application_add_main_option (G_APPLICATION (app), "run", 0, 0, G_OPTION_ARG_STRING, "Run an example", "EXAMPLE");
|
||||
g_application_add_main_option (G_APPLICATION (app), "list", 0, 0, G_OPTION_ARG_NONE, "List examples", NULL);
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
<attribute name="label" translatable="yes">_Inspector</attribute>
|
||||
<attribute name="action">app.inspector</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
|
||||
<attribute name="action">win.show-help-overlay</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About GTK Demo</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
|
||||
@@ -5,7 +5,6 @@ demos = files([
|
||||
'assistant.c',
|
||||
'builder.c',
|
||||
'clipboard.c',
|
||||
'colorsel.c',
|
||||
'combobox.c',
|
||||
'constraints.c',
|
||||
'constraints2.c',
|
||||
@@ -28,6 +27,7 @@ demos = files([
|
||||
'fishbowl.c',
|
||||
'fixed.c',
|
||||
'fontrendering.c',
|
||||
'gears.c',
|
||||
'gestures.c',
|
||||
'glarea.c',
|
||||
'headerbar.c',
|
||||
@@ -89,6 +89,7 @@ extra_demo_sources = files(['main.c',
|
||||
'gtkgears.c',
|
||||
'puzzlepiece.c',
|
||||
'bluroverlay.c',
|
||||
'demoimage.c',
|
||||
'demotaggedentry.c'])
|
||||
|
||||
if harfbuzz_dep.found() and pangoft_dep.found()
|
||||
|
||||
@@ -339,6 +339,7 @@ drawing_area_init (DrawingArea *area)
|
||||
gtk_widget_add_controller (GTK_WIDGET (area), GTK_EVENT_CONTROLLER (gesture));
|
||||
|
||||
area->draw_color = (GdkRGBA) { 0, 0, 0, 1 };
|
||||
area->brush_size = 1;
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
|
||||
@@ -172,7 +172,6 @@ do_panes (GtkWidget *do_widget)
|
||||
gtk_paned_add1 (GTK_PANED (vpaned), hpaned);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 60, 60);
|
||||
gtk_paned_add1 (GTK_PANED (hpaned), frame);
|
||||
|
||||
@@ -180,12 +179,10 @@ do_panes (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER(frame), button);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 80, 60);
|
||||
gtk_paned_add2 (GTK_PANED (hpaned), frame);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME(frame), GTK_SHADOW_IN);
|
||||
gtk_widget_set_size_request (frame, 60, 80);
|
||||
gtk_paned_add2 (GTK_PANED (vpaned), frame);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ do_password_entry (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (box), entry2);
|
||||
|
||||
button = gtk_button_new_with_mnemonic ("_Done");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
|
||||
gtk_widget_add_css_class (button, "suggested-action");
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_widget_set_sensitive (button, FALSE);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
@@ -190,8 +190,7 @@ do_rotated_text (GtkWidget *do_widget)
|
||||
/* Add a drawing area */
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
gtk_container_add (GTK_CONTAINER (box), drawing_area);
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (drawing_area),
|
||||
GTK_STYLE_CLASS_VIEW);
|
||||
gtk_widget_add_css_class (drawing_area, GTK_STYLE_CLASS_VIEW);
|
||||
|
||||
gtk_drawing_area_set_draw_func (GTK_DRAWING_AREA (drawing_area),
|
||||
rotated_text_draw,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Scale
|
||||
/* Scales
|
||||
*
|
||||
* GtkScale is a way to select a value from a range.
|
||||
* Scales can have marks to help pick special values,
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</object>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="title" translatable="yes">Scales</property>
|
||||
<property name="resizable">0</property>
|
||||
<child>
|
||||
<object class="GtkGrid" id="grid1">
|
||||
<property name="row-spacing">10</property>
|
||||
|
||||
@@ -63,7 +63,7 @@ do_sidebar (GtkWidget *do_widget)
|
||||
if (i == 0)
|
||||
{
|
||||
widget = gtk_image_new_from_icon_name ("org.gtk.Demo4");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (widget), "icon-dropshadow");
|
||||
gtk_widget_add_css_class (widget, "icon-dropshadow");
|
||||
gtk_image_set_pixel_size (GTK_IMAGE (widget), 256);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -279,7 +279,8 @@ start_puzzle (GdkPaintable *paintable)
|
||||
aspect_ratio = gdk_paintable_get_intrinsic_aspect_ratio (paintable);
|
||||
if (aspect_ratio == 0.0)
|
||||
aspect_ratio = 1.0;
|
||||
gtk_aspect_frame_set (GTK_ASPECT_FRAME (frame), 0.5, 0.5, aspect_ratio, FALSE);
|
||||
gtk_aspect_frame_set_ratio (GTK_ASPECT_FRAME (frame), aspect_ratio);
|
||||
gtk_aspect_frame_set_obey_child (GTK_ASPECT_FRAME (frame), FALSE);
|
||||
|
||||
/* Add shortcuts so people can use the arrow
|
||||
* keys to move the puzzle */
|
||||
@@ -419,7 +420,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
||||
gtk_widget_set_margin_bottom (tweaks, 10);
|
||||
|
||||
choices = gtk_flow_box_new ();
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (choices), GTK_STYLE_CLASS_VIEW);
|
||||
gtk_widget_add_css_class (choices, GTK_STYLE_CLASS_VIEW);
|
||||
add_choice (choices, puzzle);
|
||||
add_choice (choices, gtk_nuclear_animation_new ());
|
||||
media = gtk_media_file_new_for_resource ("/images/gtk-logo.webm");
|
||||
@@ -466,7 +467,7 @@ do_sliding_puzzle (GtkWidget *do_widget)
|
||||
g_signal_connect (window, "destroy",
|
||||
G_CALLBACK (gtk_widget_destroyed), &window);
|
||||
|
||||
frame = gtk_aspect_frame_new (NULL, 0.5, 0.5, (float) gdk_paintable_get_intrinsic_aspect_ratio (puzzle), FALSE);
|
||||
frame = gtk_aspect_frame_new (0.5, 0.5, (float) gdk_paintable_get_intrinsic_aspect_ratio (puzzle), FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
start_puzzle (puzzle);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Spin Button
|
||||
/* Spin Buttons
|
||||
*
|
||||
* GtkSpinButton provides convenient ways to input data
|
||||
* that can be seen as a value in a range. The examples
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window1">
|
||||
<property name="title" translatable="yes">Stack</property>
|
||||
<property name="resizable">0</property>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<child>
|
||||
@@ -25,6 +26,7 @@
|
||||
<object class="GtkImage">
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="pixel-size">100</property>
|
||||
<property name="icon-name">org.gtk.Demo4</property>
|
||||
</object>
|
||||
</property>
|
||||
|
||||
@@ -25,7 +25,7 @@ add_tag (GtkButton *button, DemoTaggedEntry *entry)
|
||||
DemoTaggedEntryTag *tag;
|
||||
|
||||
tag = demo_tagged_entry_tag_new ("Blue");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (GTK_WIDGET (tag)), "blue");
|
||||
gtk_widget_add_css_class (GTK_WIDGET (tag), "blue");
|
||||
demo_tagged_entry_tag_set_has_close_button (tag, TRUE);
|
||||
g_signal_connect (tag, "button-clicked", G_CALLBACK (closed_cb), entry);
|
||||
|
||||
@@ -98,7 +98,7 @@ do_tagged_entry (GtkWidget *do_widget)
|
||||
gtk_container_add (GTK_CONTAINER (box2), button);
|
||||
|
||||
button = gtk_button_new_with_mnemonic ("_Done");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (button), "suggested-action");
|
||||
gtk_widget_add_css_class (button, "suggested-action");
|
||||
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
|
||||
@@ -408,8 +408,7 @@ do_tree_store (GtkWidget *do_widget)
|
||||
gtk_label_new ("Jonathan's Holiday Card Planning Sheet"));
|
||||
|
||||
sw = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_SHADOW_ETCHED_IN);
|
||||
gtk_scrolled_window_set_has_frame (GTK_SCROLLED_WINDOW (sw), TRUE);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
|
||||
GTK_POLICY_AUTOMATIC,
|
||||
GTK_POLICY_AUTOMATIC);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "config.h"
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "iconbrowserapp.h"
|
||||
@@ -28,9 +29,75 @@ quit_activated (GSimpleAction *action,
|
||||
g_application_quit (G_APPLICATION (app));
|
||||
}
|
||||
|
||||
static void
|
||||
inspector_activated (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer app)
|
||||
{
|
||||
gtk_window_set_interactive_debugging (TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
about_activated (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkApplication *app = user_data;
|
||||
const gchar *authors[] = {
|
||||
"The GTK Team",
|
||||
NULL
|
||||
};
|
||||
char *icon_theme;
|
||||
char *version;
|
||||
GString *s;
|
||||
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-icon-theme-name", &icon_theme,
|
||||
NULL);
|
||||
|
||||
s = g_string_new ("");
|
||||
|
||||
g_string_append (s, "System libraries\n");
|
||||
g_string_append_printf (s, "\tGLib\t%d.%d.%d\n",
|
||||
glib_major_version,
|
||||
glib_minor_version,
|
||||
glib_micro_version);
|
||||
g_string_append_printf (s, "\tPango\t%s\n",
|
||||
pango_version_string ());
|
||||
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
|
||||
gtk_get_major_version (),
|
||||
gtk_get_minor_version (),
|
||||
gtk_get_micro_version ());
|
||||
g_string_append_printf (s, "\nIcon theme\n\t%s", icon_theme);
|
||||
version = g_strdup_printf ("%s\nRunning against GTK %d.%d.%d",
|
||||
PACKAGE_VERSION,
|
||||
gtk_get_major_version (),
|
||||
gtk_get_minor_version (),
|
||||
gtk_get_micro_version ());
|
||||
|
||||
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
|
||||
"program-name", "GTK Icon Browser",
|
||||
"version", version,
|
||||
"copyright", "© 1997—2020 The GTK Team",
|
||||
"license-type", GTK_LICENSE_LGPL_2_1,
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to browse themed icons",
|
||||
"authors", authors,
|
||||
"logo-icon-name", "org.gtk.Demo4",
|
||||
"title", "About GTK Icon Browser",
|
||||
"system-information", s->str,
|
||||
NULL);
|
||||
|
||||
g_string_free (s, TRUE);
|
||||
g_free (version);
|
||||
g_free (icon_theme);
|
||||
}
|
||||
|
||||
static GActionEntry app_entries[] =
|
||||
{
|
||||
{ "quit", quit_activated, NULL, NULL, NULL }
|
||||
{ "quit", quit_activated, NULL, NULL, NULL },
|
||||
{ "inspector", inspector_activated, NULL, NULL, NULL },
|
||||
{ "about", about_activated, NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<menu id="gear_menu">
|
||||
<section>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_Inspector</attribute>
|
||||
<attribute name="action">app.inspector</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">_About GTK Icon Browser</attribute>
|
||||
<attribute name="action">app.about</attribute>
|
||||
</item>
|
||||
</section>
|
||||
</menu>
|
||||
<object class="IconStore" id="store"/>
|
||||
<object class="GtkTreeModelFilter" id="filter_model">
|
||||
<property name="child-model">store</property>
|
||||
@@ -36,6 +48,13 @@
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkMenuButton" id="gear_menu_button">
|
||||
<property name="valign">center</property>
|
||||
<property name="menu-model">gear_menu</property>
|
||||
<property name="icon-name">open-menu-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkToggleButton" id="search">
|
||||
<style>
|
||||
|
||||
@@ -24,6 +24,13 @@
|
||||
#include "gtkrendererpaintableprivate.h"
|
||||
|
||||
#include "gsk/gskrendernodeparserprivate.h"
|
||||
#include "gsk/gl/gskglrenderer.h"
|
||||
#ifdef GDK_WINDOWING_BROADWAY
|
||||
#include "gsk/broadway/gskbroadwayrenderer.h"
|
||||
#endif
|
||||
#ifdef GDK_RENDERING_VULKAN
|
||||
#include "gsk/vulkan/gskvulkanrenderer.h"
|
||||
#endif
|
||||
|
||||
#ifndef NODE_EDITOR_SOURCE_DIR
|
||||
#define NODE_EDITOR_SOURCE_DIR "." /* Fallback */
|
||||
|
||||
@@ -83,6 +83,7 @@
|
||||
<property name="title" translatable="yes">GTK Node Editor</property>
|
||||
<property name="default-width">1024</property>
|
||||
<property name="default-height">768</property>
|
||||
<property name="focus-widget">text_view</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar" id="header">
|
||||
<property name="title" translatable="yes">GTK Node Editor</property>
|
||||
@@ -139,7 +140,6 @@
|
||||
<object class="GtkTextView" id="text_view">
|
||||
<property name="wrap-mode">word</property>
|
||||
<property name="monospace">1</property>
|
||||
<property name="has-focus">1</property>
|
||||
<property name="top-margin">6</property>
|
||||
<property name="left-margin">6</property>
|
||||
<property name="right-margin">6</property>
|
||||
|
||||
Binary file not shown.
@@ -40,9 +40,6 @@ change_dark_state (GSimpleAction *action,
|
||||
g_simple_action_set_state (action, state);
|
||||
}
|
||||
|
||||
static char *current_theme;
|
||||
static gboolean current_dark;
|
||||
|
||||
static void
|
||||
change_theme_state (GSimpleAction *action,
|
||||
GVariant *state,
|
||||
@@ -53,6 +50,8 @@ change_theme_state (GSimpleAction *action,
|
||||
const char *theme;
|
||||
gboolean prefer_dark = FALSE;
|
||||
|
||||
g_simple_action_set_state (action, state);
|
||||
|
||||
s = g_variant_get_string (state, NULL);
|
||||
|
||||
if (strcmp (s, "adwaita") == 0)
|
||||
@@ -77,8 +76,9 @@ change_theme_state (GSimpleAction *action,
|
||||
}
|
||||
else if (strcmp (s, "current") == 0)
|
||||
{
|
||||
theme = current_theme;
|
||||
prefer_dark = current_dark;
|
||||
gtk_settings_reset_property (settings, "gtk-theme-name");
|
||||
gtk_settings_reset_property (settings, "gtk-application-prefer-dark-theme");
|
||||
return;
|
||||
}
|
||||
else
|
||||
return;
|
||||
@@ -87,8 +87,6 @@ change_theme_state (GSimpleAction *action,
|
||||
"gtk-theme-name", theme,
|
||||
"gtk-application-prefer-dark-theme", prefer_dark,
|
||||
NULL);
|
||||
|
||||
g_simple_action_set_state (action, state);
|
||||
}
|
||||
|
||||
static GtkWidget *page_stack;
|
||||
@@ -101,7 +99,7 @@ change_transition_state (GSimpleAction *action,
|
||||
GtkStackTransitionType transition;
|
||||
|
||||
if (g_variant_get_boolean (state))
|
||||
transition = GTK_STACK_TRANSITION_TYPE_ROTATE_LEFT_RIGHT;
|
||||
transition = GTK_STACK_TRANSITION_TYPE_CROSSFADE;
|
||||
else
|
||||
transition = GTK_STACK_TRANSITION_TYPE_NONE;
|
||||
|
||||
@@ -267,6 +265,8 @@ activate_about (GSimpleAction *action,
|
||||
glib_major_version,
|
||||
glib_minor_version,
|
||||
glib_micro_version);
|
||||
g_string_append_printf (s, "\tPango\t%s\n",
|
||||
pango_version_string ());
|
||||
g_string_append_printf (s, "\tGTK\t%d.%d.%d\n",
|
||||
gtk_get_major_version (),
|
||||
gtk_get_minor_version (),
|
||||
@@ -282,7 +282,7 @@ activate_about (GSimpleAction *action,
|
||||
gtk_show_about_dialog (GTK_WINDOW (gtk_application_get_active_window (app)),
|
||||
"program-name", "GTK Widget Factory",
|
||||
"version", version,
|
||||
"copyright", "© 1997—2019 The GTK Team",
|
||||
"copyright", "© 1997—2020 The GTK Team",
|
||||
"license-type", GTK_LICENSE_LGPL_2_1,
|
||||
"website", "http://www.gtk.org",
|
||||
"comments", "Program to demonstrate GTK themes and widgets",
|
||||
@@ -325,6 +325,97 @@ activate_inspector (GSimpleAction *action,
|
||||
gtk_window_set_interactive_debugging (TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
print_operation_done (GtkPrintOperation *op,
|
||||
GtkPrintOperationResult res,
|
||||
gpointer data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
switch (res)
|
||||
{
|
||||
case GTK_PRINT_OPERATION_RESULT_ERROR:
|
||||
gtk_print_operation_get_error (op, &error);
|
||||
g_print ("Printing failed: %s\n", error->message);
|
||||
g_clear_error (&error);
|
||||
break;
|
||||
case GTK_PRINT_OPERATION_RESULT_APPLY:
|
||||
break;
|
||||
case GTK_PRINT_OPERATION_RESULT_CANCEL:
|
||||
g_print ("Printing was canceled\n");
|
||||
break;
|
||||
case GTK_PRINT_OPERATION_RESULT_IN_PROGRESS:
|
||||
return;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
g_object_unref (op);
|
||||
}
|
||||
|
||||
static void
|
||||
print_operation_begin (GtkPrintOperation *op,
|
||||
GtkPrintContext *context,
|
||||
gpointer data)
|
||||
{
|
||||
gtk_print_operation_set_n_pages (op, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
print_operation_page (GtkPrintOperation *op,
|
||||
GtkPrintContext *context,
|
||||
int page,
|
||||
gpointer data)
|
||||
{
|
||||
cairo_t *cr;
|
||||
double width;
|
||||
double aspect_ratio;
|
||||
GdkSnapshot *snapshot;
|
||||
GdkPaintable *paintable;
|
||||
GskRenderNode *node;
|
||||
|
||||
g_print ("Save the trees!\n");
|
||||
|
||||
cr = gtk_print_context_get_cairo_context (context);
|
||||
width = gtk_print_context_get_width (context);
|
||||
|
||||
snapshot = gtk_snapshot_new ();
|
||||
paintable = gtk_widget_paintable_new (GTK_WIDGET (data));
|
||||
aspect_ratio = gdk_paintable_get_intrinsic_aspect_ratio (paintable);
|
||||
gdk_paintable_snapshot (paintable, snapshot, width, width / aspect_ratio);
|
||||
node = gtk_snapshot_free_to_node (snapshot);
|
||||
|
||||
gsk_render_node_draw (node, cr);
|
||||
|
||||
gsk_render_node_unref (node);
|
||||
|
||||
g_object_unref (paintable);
|
||||
}
|
||||
|
||||
static void
|
||||
activate_print (GSimpleAction *action,
|
||||
GVariant *parameter,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWindow *window = GTK_WINDOW (user_data);
|
||||
GtkPrintOperation *op;
|
||||
GtkPrintOperationResult res;
|
||||
|
||||
op = gtk_print_operation_new ();
|
||||
gtk_print_operation_set_allow_async (op, TRUE);
|
||||
g_signal_connect (op, "begin-print", G_CALLBACK (print_operation_begin), NULL);
|
||||
g_signal_connect (op, "draw-page", G_CALLBACK (print_operation_page), window);
|
||||
g_signal_connect (op, "done", G_CALLBACK (print_operation_done), NULL);
|
||||
|
||||
res = gtk_print_operation_run (op, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG, window, NULL);
|
||||
|
||||
if (res == GTK_PRINT_OPERATION_RESULT_IN_PROGRESS)
|
||||
return;
|
||||
|
||||
print_operation_done (op, res, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
spin_value_changed (GtkAdjustment *adjustment, GtkWidget *label)
|
||||
{
|
||||
@@ -442,24 +533,17 @@ on_entry_icon_release (GtkEntry *entry,
|
||||
|
||||
#define EPSILON (1e-10)
|
||||
|
||||
static gboolean
|
||||
on_scale_button_query_tooltip (GtkWidget *button,
|
||||
gint x,
|
||||
gint y,
|
||||
gboolean keyboard_mode,
|
||||
GtkTooltip *tooltip,
|
||||
gpointer user_data)
|
||||
static void
|
||||
on_scale_button_value_changed (GtkScaleButton *button,
|
||||
gdouble value,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkScaleButton *scale_button = GTK_SCALE_BUTTON (button);
|
||||
GtkAdjustment *adjustment;
|
||||
gdouble val;
|
||||
gchar *str;
|
||||
AtkImage *image;
|
||||
|
||||
image = ATK_IMAGE (gtk_widget_get_accessible (button));
|
||||
|
||||
adjustment = gtk_scale_button_get_adjustment (scale_button);
|
||||
val = gtk_scale_button_get_value (scale_button);
|
||||
adjustment = gtk_scale_button_get_adjustment (button);
|
||||
val = gtk_scale_button_get_value (button);
|
||||
|
||||
if (val < (gtk_adjustment_get_lower (adjustment) + EPSILON))
|
||||
{
|
||||
@@ -478,32 +562,21 @@ on_scale_button_query_tooltip (GtkWidget *button,
|
||||
str = g_strdup_printf (C_("volume percentage", "%d %%"), percent);
|
||||
}
|
||||
|
||||
gtk_tooltip_set_text (tooltip, str);
|
||||
atk_image_set_image_description (image, str);
|
||||
gtk_widget_set_tooltip_text (GTK_WIDGET (button), str);
|
||||
atk_object_set_description (gtk_widget_get_accessible (GTK_WIDGET (button)), str);
|
||||
|
||||
g_free (str);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
on_scale_button_value_changed (GtkScaleButton *button,
|
||||
gdouble value,
|
||||
gpointer user_data)
|
||||
{
|
||||
gtk_widget_trigger_tooltip_query (GTK_WIDGET (button));
|
||||
}
|
||||
|
||||
static void
|
||||
on_record_button_toggled (GtkToggleButton *button,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (GTK_WIDGET (button));
|
||||
if (gtk_toggle_button_get_active (button))
|
||||
gtk_style_context_remove_class (context, "destructive-action");
|
||||
gtk_widget_remove_css_class (GTK_WIDGET (button), "destructive-action");
|
||||
else
|
||||
gtk_style_context_add_class (context, "destructive-action");
|
||||
gtk_widget_add_css_class (GTK_WIDGET (button), "destructive-action");
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -857,6 +930,7 @@ overshot (GtkScrolledWindow *sw, GtkPositionType pos, GtkWidget *widget)
|
||||
gdk_rgba_parse (&rgba, color);
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"can-focus", FALSE,
|
||||
"selectable", FALSE,
|
||||
"halign", GTK_ALIGN_END,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
@@ -975,6 +1049,7 @@ populate_colors (GtkWidget *widget, GtkWidget *chooser)
|
||||
swatch = g_object_new (g_type_from_name ("GtkColorSwatch"),
|
||||
"rgba", &rgba,
|
||||
"selectable", FALSE,
|
||||
"can-focus", FALSE,
|
||||
"halign", GTK_ALIGN_END,
|
||||
"valign", GTK_ALIGN_CENTER,
|
||||
"margin-start", 6,
|
||||
@@ -1732,6 +1807,7 @@ activate (GApplication *app)
|
||||
{ "open", activate_open, NULL, NULL, NULL },
|
||||
{ "record", activate_record, NULL, NULL, NULL },
|
||||
{ "lock", activate_lock, NULL, NULL, NULL },
|
||||
{ "print", activate_print, NULL, NULL, NULL },
|
||||
};
|
||||
struct {
|
||||
const gchar *action_and_target;
|
||||
@@ -1754,11 +1830,7 @@ activate (GApplication *app)
|
||||
gint i;
|
||||
GPermission *permission;
|
||||
GAction *action;
|
||||
|
||||
g_object_get (gtk_settings_get_default (),
|
||||
"gtk-theme-name", ¤t_theme,
|
||||
"gtk-application-prefer-dark-theme", ¤t_dark,
|
||||
NULL);
|
||||
GError *error = NULL;
|
||||
|
||||
g_type_ensure (my_text_view_get_type ());
|
||||
|
||||
@@ -1774,7 +1846,6 @@ activate (GApplication *app)
|
||||
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
|
||||
"on_entry_icon_release", (GCallback)on_entry_icon_release,
|
||||
"on_scale_button_value_changed", (GCallback)on_scale_button_value_changed,
|
||||
"on_scale_button_query_tooltip", (GCallback)on_scale_button_query_tooltip,
|
||||
"on_record_button_toggled", (GCallback)on_record_button_toggled,
|
||||
"on_page_combo_changed", (GCallback)on_page_combo_changed,
|
||||
"on_range_from_changed", (GCallback)on_range_from_changed,
|
||||
@@ -1787,7 +1858,11 @@ activate (GApplication *app)
|
||||
NULL);
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
g_object_unref (scope);
|
||||
gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", NULL);
|
||||
if (!gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", &error))
|
||||
{
|
||||
g_critical ("%s", error->message);
|
||||
g_clear_error (&error);
|
||||
}
|
||||
|
||||
window = (GtkWindow *)gtk_builder_get_object (builder, "window");
|
||||
gtk_application_add_window (GTK_APPLICATION (app), window);
|
||||
@@ -2096,7 +2171,6 @@ main (int argc, char *argv[])
|
||||
{ "water", NULL, NULL, "true", NULL },
|
||||
{ "dessert", NULL, "s", "'bars'", NULL },
|
||||
{ "pay", NULL, "s", NULL, NULL },
|
||||
{ "print", activate_action, NULL, NULL, NULL },
|
||||
{ "share", activate_action, NULL, NULL, NULL },
|
||||
{ "labels", activate_action, NULL, NULL, NULL },
|
||||
{ "new", activate_action, NULL, NULL, NULL },
|
||||
|
||||
@@ -35,4 +35,7 @@
|
||||
<file>icons/16x16/emotes/face-monkey-symbolic.symbolic.png</file>
|
||||
<file>icons/16x16/apps/preferences-desktop-locale-symbolic.symbolic.png</file>
|
||||
</gresource>
|
||||
<gresource prefix="/org/gtk/WidgetFactory4">
|
||||
<file>gtk-logo.webm</file>
|
||||
</gresource>
|
||||
</gresources>
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
</section>
|
||||
</submenu>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Slide Pages</attribute>
|
||||
<attribute name="label" translatable="yes">Transition Pages</attribute>
|
||||
<attribute name="action">win.transition</attribute>
|
||||
</item>
|
||||
</section>
|
||||
@@ -460,7 +460,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="toplevel_stack">
|
||||
<property name="transition-duration">1000</property>
|
||||
<property name="transition-duration">250</property>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">page1</property>
|
||||
@@ -539,6 +539,13 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkPasswordEntry">
|
||||
<property name="halign">fill</property>
|
||||
<property name="show-peek-icon">1</property>
|
||||
<property name="placeholder-text" translatable="yes">Password…</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="hexpand">0</property>
|
||||
@@ -864,7 +871,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<property name="label" translatable="yes">link button</property>
|
||||
<property name="receives-default">1</property>
|
||||
<property name="has-tooltip">1</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="uri">http://www.gtk.org</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -1042,57 +1049,95 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="box26">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="homogeneous">1</property>
|
||||
<property name="spacing">6</property>
|
||||
<property name="spacing">10</property>
|
||||
<property name="hexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame1">
|
||||
<style>
|
||||
<class name="border-inset"/>
|
||||
</style>
|
||||
<property name="valign">start</property>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label1">
|
||||
<property name="label" translatable="yes"><b>Inset</b></property>
|
||||
<property name="label" translatable="yes"><b>Video</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVideo">
|
||||
<property name="halign">center</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="autoplay">0</property>
|
||||
<property name="loop">1</property>
|
||||
<property name="file">resource:///org/gtk/WidgetFactory4/gtk-logo.webm</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame2">
|
||||
<style>
|
||||
<class name="border-outset"/>
|
||||
</style>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label2">
|
||||
<property name="label" translatable="yes"><b>Outset</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame3">
|
||||
<style>
|
||||
<class name="border-groove"/>
|
||||
</style>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label17">
|
||||
<property name="label" translatable="yes"><b>Groove</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame" id="frame4">
|
||||
<style>
|
||||
<class name="border-ridge"/>
|
||||
</style>
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="label18">
|
||||
<property name="label" translatable="yes"><b>Ridge</b></property>
|
||||
<property name="use-markup">1</property>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="vexpand">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Large Title</property>
|
||||
<style><class name="large-title"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 1</property>
|
||||
<style><class name="title-1"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 2</property>
|
||||
<style><class name="title-2"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 3</property>
|
||||
<style><class name="title-3"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Title 4</property>
|
||||
<style><class name="title-4"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Heading</property>
|
||||
<style><class name="heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Body</property>
|
||||
<style><class name="body"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption Heading</property>
|
||||
<style><class name="caption-heading"/></style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Caption</property>
|
||||
<style><class name="Caption"/></style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -1113,7 +1158,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow1">
|
||||
<property name="width-request">150</property>
|
||||
<property name="vscrollbar-policy">always</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="treeview1">
|
||||
@@ -1187,7 +1232,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow2">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="textview1">
|
||||
@@ -1449,7 +1494,7 @@ Suspendisse feugiat quam quis dolor accumsan cursus.</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="page2dismiss">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
</object>
|
||||
</child>
|
||||
@@ -1510,7 +1555,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="value">.5</property>
|
||||
<property name="halign">center</property>
|
||||
<signal name="query-tooltip" handler="on_scale_button_query_tooltip" swapped="no"/>
|
||||
<signal name="value-changed" handler="on_scale_button_value_changed" swapped="no"/>
|
||||
<layout>
|
||||
<property name="left-attach">0</property>
|
||||
@@ -1532,8 +1576,8 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<property name="transition-type">crossfade</property>
|
||||
<property name="transition-duration">1000</property>
|
||||
<property name="transition-type">rotate-left-right</property>
|
||||
<property name="transition-duration">250</property>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">page1</property>
|
||||
@@ -1598,10 +1642,11 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="min-content-height">200</property>
|
||||
<property name="hexpand">0</property>
|
||||
<property name="vexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="listbox">
|
||||
<property name="selection-mode">none</property>
|
||||
@@ -1801,6 +1846,46 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow" id="listboxrow7">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Row 7</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBoxRow" id="listboxrow8">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label" translatable="yes">Row 8</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<property name="hexpand">1</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2000,7 +2085,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow3">
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="height-request">226</property>
|
||||
<child>
|
||||
@@ -2106,7 +2191,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vscrollbar-policy">always</property>
|
||||
<property name="height-request">300</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<child>
|
||||
<object class="GtkTreeView" id="charletree">
|
||||
<property name="enable-grid-lines">vertical</property>
|
||||
@@ -2172,7 +2257,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="munsell">
|
||||
<property name="selection-mode">multiple</property>
|
||||
@@ -2272,7 +2357,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkMenuButton">
|
||||
<property name="icon-name">view-more-symbolic</property>
|
||||
<property name="popover">new_style_menu</property>
|
||||
<property name="menu-model">new_style_menu_model</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2483,6 +2568,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkButton" id="print_button">
|
||||
<property name="label">Print</property>
|
||||
<property name="action-name">win.print</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2495,37 +2581,47 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkFrame">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkButton" id="toolbutton1">
|
||||
<property name="icon-name">document-open-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert ⌘</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="toolbutton2">
|
||||
<property name="icon-name">send-to-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert ⚽</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="toolbutton3">
|
||||
<property name="icon-name">view-fullscreen-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert ⤢</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="toolbutton4">
|
||||
<property name="icon-name">star-new-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Insert ☆</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="has-frame">1</property>
|
||||
<property name="hexpand">1</property>
|
||||
<child>
|
||||
<object class="GtkTextView" id="tooltextview"/>
|
||||
@@ -2535,10 +2631,6 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="margin-start">6</property>
|
||||
<property name="margin-end">6</property>
|
||||
<property name="margin-top">6</property>
|
||||
<property name="margin-bottom">6</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
@@ -2549,18 +2641,24 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<object class="GtkButton" id="cutbutton">
|
||||
<property name="sensitive">0</property>
|
||||
<property name="icon-name">edit-cut-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Cut</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="copybutton">
|
||||
<property name="sensitive">0</property>
|
||||
<property name="icon-name">edit-copy-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Copy</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="pastebutton">
|
||||
<property name="sensitive">0</property>
|
||||
<property name="icon-name">edit-paste-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Paste</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
@@ -2570,14 +2668,14 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="sensitive">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="icon-name">edit-delete-symbolic</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="tooltip-text" translatable="yes">Delete</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkOverlay">
|
||||
<child type="overlay">
|
||||
@@ -2640,7 +2738,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="popover">notebook_info_popover2</property>
|
||||
<property name="icon-name">emblem-important-symbolic</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
@@ -2665,7 +2763,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<signal name="clicked" handler="tab_close_cb" object="closable_page_1"/>
|
||||
@@ -2697,7 +2795,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="icon-name">window-close-symbolic</property>
|
||||
<signal name="clicked" handler="tab_close_cb" object="closable_page_2"/>
|
||||
@@ -2755,15 +2853,17 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="halign">center</property>
|
||||
<property name="halign">fill</property>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="placeholder-text" translatable="yes">Name…</property>
|
||||
<property name="completion">name_completion</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="show-emoji-icon">1</property>
|
||||
<property name="placeholder-text" translatable="yes">Age…</property>
|
||||
</object>
|
||||
@@ -2784,7 +2884,7 @@ microphone-sensitivity-medium-symbolic</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="popover">notebook_info_popover</property>
|
||||
<property name="icon-name">emblem-important-symbolic</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
@@ -3142,7 +3242,7 @@ bad things might happen.</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="valign">start</property>
|
||||
<property name="shadow-type">in</property>
|
||||
<property name="has-frame">1</property>
|
||||
<property name="min-content-height">70</property>
|
||||
<property name="max-content-height">120</property>
|
||||
<property name="min-content-width">100</property>
|
||||
@@ -3231,6 +3331,8 @@ bad things might happen.</property>
|
||||
<widget name="listboxrow4"/>
|
||||
<widget name="listboxrow5"/>
|
||||
<widget name="listboxrow6"/>
|
||||
<widget name="listboxrow7"/>
|
||||
<widget name="listboxrow8"/>
|
||||
</widgets>
|
||||
</object>
|
||||
<object class="GtkSizeGroup">
|
||||
@@ -3276,7 +3378,7 @@ bad things might happen.</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="popover">notebook_info_popover3</property>
|
||||
<property name="icon-name">emblem-important-symbolic</property>
|
||||
<property name="relief">none</property>
|
||||
<property name="has-frame">0</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
@@ -3286,6 +3388,7 @@ bad things might happen.</property>
|
||||
</child>
|
||||
</object>
|
||||
<object class="GtkPopover" id="new_style_menu">
|
||||
<style><class name="menu"/></style>
|
||||
<child>
|
||||
<object class="GtkStack">
|
||||
<child>
|
||||
@@ -3307,7 +3410,7 @@ bad things might happen.</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="iconic">1</property>
|
||||
<property name="action-name">app.print</property>
|
||||
<property name="action-name">win.print</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="halign">center</property>
|
||||
<style>
|
||||
@@ -3530,7 +3633,7 @@ bad things might happen.</property>
|
||||
<attribute name="display-hint">circular-buttons</attribute>
|
||||
<item>
|
||||
<attribute name="verb-icon">printer-symbolic</attribute>
|
||||
<attribute name="action">app.print</attribute>
|
||||
<attribute name="action">win.print</attribute>
|
||||
</item>
|
||||
<item>
|
||||
<attribute name="verb-icon">emblem-shared-symbolic</attribute>
|
||||
@@ -3597,6 +3700,7 @@ bad things might happen.</property>
|
||||
</submenu>
|
||||
</section>
|
||||
<section>
|
||||
<attribute name="label" translatable="yes">Size</attribute>
|
||||
<item>
|
||||
<attribute name="label" translatable="yes">Large</attribute>
|
||||
<attribute name="action">app.size</attribute>
|
||||
|
||||
@@ -171,8 +171,6 @@ gdk_rgba_get_type
|
||||
<TITLE>GdkSurface</TITLE>
|
||||
<FILE>gdksurface</FILE>
|
||||
GdkSurface
|
||||
GdkSurfaceHints
|
||||
GdkGeometry
|
||||
GdkGravity
|
||||
GdkSurfaceEdge
|
||||
GdkSurfaceTypeHint
|
||||
@@ -190,7 +188,6 @@ gdk_surface_get_height
|
||||
gdk_surface_translate_coordinates
|
||||
gdk_surface_begin_resize_drag
|
||||
gdk_surface_begin_move_drag
|
||||
gdk_surface_constrain_size
|
||||
gdk_surface_beep
|
||||
gdk_surface_get_scale_factor
|
||||
gdk_surface_set_opaque_region
|
||||
@@ -515,6 +512,9 @@ gdk_key_event_get_consumed_modifiers
|
||||
gdk_key_event_get_layout
|
||||
gdk_key_event_get_level
|
||||
gdk_key_event_is_modifier
|
||||
GdkEventMatch
|
||||
gdk_key_event_matches
|
||||
gdk_key_event_get_match
|
||||
gdk_focus_event_get_in
|
||||
gdk_touch_event_get_emulating_pointer
|
||||
gdk_crossing_event_get_mode
|
||||
@@ -537,11 +537,6 @@ gdk_events_get_angle
|
||||
gdk_events_get_center
|
||||
gdk_events_get_distance
|
||||
|
||||
<SUBSECTION>
|
||||
GdkEventMatch
|
||||
gdk_event_matches
|
||||
gdk_event_get_match
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GDK_TYPE_EVENT
|
||||
GDK_TYPE_EVENT_MASK
|
||||
@@ -657,8 +652,6 @@ gdk_toplevel_set_transient_for
|
||||
gdk_toplevel_set_modal
|
||||
gdk_toplevel_set_icon_list
|
||||
gdk_toplevel_show_window_menu
|
||||
gdk_toplevel_set_accept_focus
|
||||
gdk_toplevel_set_focus_on_map
|
||||
gdk_toplevel_set_decorated
|
||||
gdk_toplevel_set_deletable
|
||||
gdk_toplevel_supports_edge_constraints
|
||||
|
||||
+1027
-744
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -203,12 +203,12 @@
|
||||
<title>Hierarchical drawing</title>
|
||||
|
||||
<para>
|
||||
During the Paint phase GTK receives a single ::render signal on the toplevel
|
||||
window. The signal handler will create a snapshot object (which is a
|
||||
helper for creating a scene graph) and emit a GtkWidget::snapshot() signal,
|
||||
which will propagate down the widget hierarchy. This lets each widget
|
||||
snapshot its content at the right place and time, correctly handling things
|
||||
like partial transparencies and overlapping widgets.
|
||||
During the Paint phase GTK receives a single #GdkSurface::render signal on
|
||||
the toplevel surface. The signal handler will create a snapshot object
|
||||
(which is a helper for creating a scene graph) and call the
|
||||
#GtkWidget::snapshot() vfunc, which will propagate down the widget hierarchy.
|
||||
This lets each widget snapshot its content at the right place and time,
|
||||
correctly handling things like partial transparencies and overlapping widgets.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
@@ -217,7 +217,7 @@
|
||||
the render nodes of children, and grandchildren, and so on), and will reuse
|
||||
that node during the Paint phase. Invalidating a widget (by calling
|
||||
gtk_widget_queue_draw()) discards the cached render node, forcing the widget
|
||||
to regenerate it the next time it needs to handle a ::snapshot.
|
||||
to regenerate it the next time it needs to produce a snapshot.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
|
||||
@@ -19,11 +19,15 @@
|
||||
</bookinfo>
|
||||
|
||||
<part id="gtk">
|
||||
<title>GTK Overview</title>
|
||||
<title>Introduction</title>
|
||||
<xi:include href="overview.xml"/>
|
||||
<xi:include href="xml/getting_started.xml"/>
|
||||
<xi:include href="resources.xml" />
|
||||
<xi:include href="xml/question_index.xml" />
|
||||
</part>
|
||||
|
||||
<part id="concepts">
|
||||
<title>GTK Concepts</title>
|
||||
<xi:include href="xml/drawing-model.xml" />
|
||||
<xi:include href="xml/input-handling.xml" />
|
||||
<xi:include href="xml/actions.xml" />
|
||||
@@ -113,9 +117,10 @@
|
||||
<xi:include href="xml/gtklayoutchild.xml" />
|
||||
<xi:include href="xml/gtkbinlayout.xml" />
|
||||
<xi:include href="xml/gtkboxlayout.xml" />
|
||||
<xi:include href="xml/gtkcustomlayout.xml" />
|
||||
<xi:include href="xml/gtkcenterlayout.xml" />
|
||||
<xi:include href="xml/gtkfixedlayout.xml" />
|
||||
<xi:include href="xml/gtkgridlayout.xml" />
|
||||
<xi:include href="xml/gtkcustomlayout.xml" />
|
||||
<xi:include href="xml/gtkconstraintlayout.xml" />
|
||||
<xi:include href="xml/gtkconstraint.xml" />
|
||||
<xi:include href="xml/gtkconstraintguide.xml" />
|
||||
@@ -280,6 +285,7 @@
|
||||
<xi:include href="xml/gtkshortcutssection.xml" />
|
||||
<xi:include href="xml/gtkshortcutsgroup.xml" />
|
||||
<xi:include href="xml/gtkshortcutsshortcut.xml" />
|
||||
<xi:include href="xml/gtkshortcutlabel.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="MiscObjects">
|
||||
@@ -291,6 +297,7 @@
|
||||
<xi:include href="xml/gtksnapshot.xml" />
|
||||
<xi:include href="xml/gtktooltip.xml" />
|
||||
<xi:include href="xml/gtkwidgetpaintable.xml" />
|
||||
<xi:include href="xml/gtkwindowcontrols.xml" />
|
||||
</chapter>
|
||||
|
||||
<chapter id="AbstractObjects">
|
||||
@@ -371,7 +378,6 @@
|
||||
<part id="theming">
|
||||
<title>Theming in GTK</title>
|
||||
<xi:include href="css-overview.xml" />
|
||||
<xi:include href="css-properties.xml" />
|
||||
<xi:include href="xml/gtkstylecontext.xml" />
|
||||
<xi:include href="xml/gtkcssprovider.xml" />
|
||||
<xi:include href="xml/gtkstyleprovider.xml" />
|
||||
|
||||
@@ -74,6 +74,8 @@ gtk_accel_label_get_accel
|
||||
gtk_accel_label_refetch
|
||||
gtk_accel_label_set_label
|
||||
gtk_accel_label_get_label
|
||||
gtk_accel_label_get_use_underline
|
||||
gtk_accel_label_set_use_underline
|
||||
<SUBSECTION Standard>
|
||||
GTK_ACCEL_LABEL
|
||||
GTK_IS_ACCEL_LABEL
|
||||
@@ -180,6 +182,7 @@ GTK_ASSISTANT_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAssistantPrivate
|
||||
gtk_assistant_get_type
|
||||
gtk_assistant_page_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
@@ -187,7 +190,14 @@ gtk_assistant_get_type
|
||||
<TITLE>GtkAspectFrame</TITLE>
|
||||
GtkAspectFrame
|
||||
gtk_aspect_frame_new
|
||||
gtk_aspect_frame_set
|
||||
gtk_aspect_frame_set_xalign
|
||||
gtk_aspect_frame_get_xalign
|
||||
gtk_aspect_frame_set_yalign
|
||||
gtk_aspect_frame_get_yalign
|
||||
gtk_aspect_frame_set_ratio
|
||||
gtk_aspect_frame_get_ratio
|
||||
gtk_aspect_frame_set_obey_child
|
||||
gtk_aspect_frame_get_obey_child
|
||||
<SUBSECTION Standard>
|
||||
GTK_ASPECT_FRAME
|
||||
GTK_IS_ASPECT_FRAME
|
||||
@@ -196,7 +206,6 @@ GTK_ASPECT_FRAME_CLASS
|
||||
GTK_IS_ASPECT_FRAME_CLASS
|
||||
GTK_ASPECT_FRAME_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
GtkAspectFramePrivate
|
||||
gtk_aspect_frame_get_type
|
||||
</SECTION>
|
||||
|
||||
@@ -520,8 +529,8 @@ gtk_button_new
|
||||
gtk_button_new_with_label
|
||||
gtk_button_new_with_mnemonic
|
||||
gtk_button_new_from_icon_name
|
||||
gtk_button_set_relief
|
||||
gtk_button_get_relief
|
||||
gtk_button_set_has_frame
|
||||
gtk_button_get_has_frame
|
||||
gtk_button_get_label
|
||||
gtk_button_set_label
|
||||
gtk_button_get_use_underline
|
||||
@@ -553,6 +562,12 @@ gtk_calendar_mark_day
|
||||
gtk_calendar_unmark_day
|
||||
gtk_calendar_get_day_is_marked
|
||||
gtk_calendar_clear_marks
|
||||
gtk_calendar_get_show_day_names
|
||||
gtk_calendar_set_show_day_names
|
||||
gtk_calendar_get_show_heading
|
||||
gtk_calendar_set_show_heading
|
||||
gtk_calendar_get_show_week_numbers
|
||||
gtk_calendar_set_show_week_numbers
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_calendar_get_date
|
||||
@@ -599,6 +614,8 @@ gtk_color_button_new
|
||||
gtk_color_button_new_with_rgba
|
||||
gtk_color_button_set_title
|
||||
gtk_color_button_get_title
|
||||
gtk_color_button_set_modal
|
||||
gtk_color_button_get_modal
|
||||
<SUBSECTION Standard>
|
||||
GTK_COLOR_BUTTON
|
||||
GTK_IS_COLOR_BUTTON
|
||||
@@ -692,10 +709,6 @@ gtk_container_add
|
||||
gtk_container_remove
|
||||
gtk_container_foreach
|
||||
gtk_container_get_children
|
||||
gtk_container_get_focus_vadjustment
|
||||
gtk_container_set_focus_vadjustment
|
||||
gtk_container_get_focus_hadjustment
|
||||
gtk_container_set_focus_hadjustment
|
||||
gtk_container_child_type
|
||||
gtk_container_forall
|
||||
|
||||
@@ -1155,6 +1168,8 @@ gtk_file_chooser_button_get_title
|
||||
gtk_file_chooser_button_set_title
|
||||
gtk_file_chooser_button_get_width_chars
|
||||
gtk_file_chooser_button_set_width_chars
|
||||
gtk_file_chooser_button_get_modal
|
||||
gtk_file_chooser_button_set_modal
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_FILE_CHOOSER_BUTTON
|
||||
@@ -1269,6 +1284,8 @@ gtk_font_button_set_use_size
|
||||
gtk_font_button_get_use_size
|
||||
gtk_font_button_set_title
|
||||
gtk_font_button_get_title
|
||||
gtk_font_button_set_modal
|
||||
gtk_font_button_get_modal
|
||||
<SUBSECTION Standard>
|
||||
GTK_FONT_BUTTON
|
||||
GTK_IS_FONT_BUTTON
|
||||
@@ -1366,13 +1383,11 @@ GtkFrame
|
||||
GtkFrameClass
|
||||
gtk_frame_new
|
||||
gtk_frame_set_label
|
||||
gtk_frame_set_label_widget
|
||||
gtk_frame_set_label_align
|
||||
gtk_frame_set_shadow_type
|
||||
gtk_frame_get_label
|
||||
gtk_frame_get_label_align
|
||||
gtk_frame_set_label_widget
|
||||
gtk_frame_get_label_widget
|
||||
gtk_frame_get_shadow_type
|
||||
gtk_frame_set_label_align
|
||||
gtk_frame_get_label_align
|
||||
<SUBSECTION Standard>
|
||||
GTK_FRAME
|
||||
GTK_IS_FRAME
|
||||
@@ -1585,7 +1600,6 @@ gtk_label_set_text
|
||||
gtk_label_set_attributes
|
||||
gtk_label_set_markup
|
||||
gtk_label_set_markup_with_mnemonic
|
||||
gtk_label_set_pattern
|
||||
gtk_label_set_justify
|
||||
gtk_label_set_xalign
|
||||
gtk_label_set_yalign
|
||||
@@ -1626,8 +1640,6 @@ gtk_label_set_use_markup
|
||||
gtk_label_set_use_underline
|
||||
gtk_label_set_single_line_mode
|
||||
gtk_label_get_current_uri
|
||||
gtk_label_set_track_visited_links
|
||||
gtk_label_get_track_visited_links
|
||||
gtk_label_set_extra_menu
|
||||
gtk_label_get_extra_menu
|
||||
|
||||
@@ -1706,8 +1718,10 @@ gtk_menu_button_set_icon_name
|
||||
gtk_menu_button_get_icon_name
|
||||
gtk_menu_button_set_label
|
||||
gtk_menu_button_get_label
|
||||
gtk_menu_button_set_relief
|
||||
gtk_menu_button_get_relief
|
||||
gtk_menu_button_set_has_frame
|
||||
gtk_menu_button_get_has_frame
|
||||
gtk_menu_button_get_use_underline
|
||||
gtk_menu_button_set_use_underline
|
||||
gtk_menu_button_popup
|
||||
gtk_menu_button_popdown
|
||||
GtkMenuButtonCreatePopupFunc
|
||||
@@ -2199,8 +2213,8 @@ GtkCornerType
|
||||
gtk_scrolled_window_get_placement
|
||||
gtk_scrolled_window_set_placement
|
||||
gtk_scrolled_window_unset_placement
|
||||
gtk_scrolled_window_get_shadow_type
|
||||
gtk_scrolled_window_set_shadow_type
|
||||
gtk_scrolled_window_get_has_frame
|
||||
gtk_scrolled_window_set_has_frame
|
||||
gtk_scrolled_window_get_kinetic_scrolling
|
||||
gtk_scrolled_window_set_kinetic_scrolling
|
||||
gtk_scrolled_window_get_capture_button_press
|
||||
@@ -2298,6 +2312,7 @@ GtkSettingsValue
|
||||
gtk_settings_get_default
|
||||
gtk_settings_get_for_display
|
||||
gtk_settings_reset_property
|
||||
GtkSystemSetting
|
||||
<SUBSECTION Standard>
|
||||
GtkSettingsClass
|
||||
GTK_IS_SETTINGS
|
||||
@@ -3837,8 +3852,8 @@ gtk_list_store_get_type
|
||||
<TITLE>GtkViewport</TITLE>
|
||||
GtkViewport
|
||||
gtk_viewport_new
|
||||
gtk_viewport_set_shadow_type
|
||||
gtk_viewport_get_shadow_type
|
||||
gtk_viewport_set_scroll_to_focus
|
||||
gtk_viewport_get_scroll_to_focus
|
||||
<SUBSECTION Standard>
|
||||
GTK_VIEWPORT
|
||||
GTK_IS_VIEWPORT
|
||||
@@ -3967,7 +3982,9 @@ gtk_widget_allocate
|
||||
gtk_widget_class_add_shortcut
|
||||
gtk_widget_class_add_binding
|
||||
gtk_widget_class_add_binding_signal
|
||||
gtk_widget_can_activate_accel
|
||||
gtk_widget_class_add_binding_action
|
||||
gtk_widget_class_set_layout_manager_type
|
||||
gtk_widget_class_get_layout_manager_type
|
||||
gtk_widget_activate
|
||||
gtk_widget_is_focus
|
||||
gtk_widget_grab_focus
|
||||
@@ -4053,7 +4070,6 @@ gtk_widget_get_state_flags
|
||||
gtk_widget_has_default
|
||||
gtk_widget_has_focus
|
||||
gtk_widget_has_visible_focus
|
||||
gtk_widget_has_grab
|
||||
gtk_widget_is_drawable
|
||||
gtk_widget_set_receives_default
|
||||
gtk_widget_get_receives_default
|
||||
@@ -4086,7 +4102,6 @@ gtk_widget_set_css_classes
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_widget_get_style_context
|
||||
gtk_widget_reset_style
|
||||
gtk_widget_class_get_css_name
|
||||
gtk_widget_class_set_css_name
|
||||
|
||||
@@ -4275,6 +4290,27 @@ GtkWindowGroupPrivate
|
||||
gtk_window_group_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkwindowcontrols</FILE>
|
||||
<TITLE>GtkWindowControls</TITLE>
|
||||
GtkWindowControls
|
||||
gtk_window_controls_new
|
||||
gtk_window_controls_get_side
|
||||
gtk_window_controls_set_side
|
||||
gtk_window_controls_get_decoration_layout
|
||||
gtk_window_controls_set_decoration_layout
|
||||
gtk_window_controls_get_empty
|
||||
<SUBSECTION Standard>
|
||||
GTK_WINDOW_CONTROLS
|
||||
GTK_IS_WINDOW_CONTROLS
|
||||
GTK_TYPE_WINDOW_CONTROLS
|
||||
GTK_WINDOW_CONTROLS_CLASS
|
||||
GTK_IS_WINDOW_CONTROLS_CLASS
|
||||
GTK_WINDOW_CONTROLS_GET_CLASS
|
||||
<SUBSECTION Private>
|
||||
gtk_window_controls_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkmain</FILE>
|
||||
<TITLE>General</TITLE>
|
||||
@@ -4287,12 +4323,6 @@ gtk_init_check
|
||||
<SUBSECTION>
|
||||
GTK_PRIORITY_RESIZE
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_get_current_event
|
||||
gtk_get_current_event_time
|
||||
gtk_get_current_event_state
|
||||
gtk_get_current_event_device
|
||||
|
||||
<SUBSECTION Private>
|
||||
gtk_init_abi_check
|
||||
gtk_init_check_abi_check
|
||||
@@ -4437,7 +4467,6 @@ gtk_style_context_get_margin
|
||||
gtk_style_context_lookup_color
|
||||
gtk_style_context_remove_provider
|
||||
gtk_style_context_remove_provider_for_display
|
||||
gtk_style_context_reset_widgets
|
||||
gtk_style_context_restore
|
||||
gtk_style_context_save
|
||||
gtk_style_context_add_class
|
||||
@@ -4539,11 +4568,9 @@ GtkMovementStep
|
||||
GtkOrientation
|
||||
GtkPackType
|
||||
GtkPositionType
|
||||
GtkReliefStyle
|
||||
GtkScrollStep
|
||||
GtkScrollType
|
||||
GtkSelectionMode
|
||||
GtkShadowType
|
||||
GtkStateFlags
|
||||
GtkSortType
|
||||
GtkIconSize
|
||||
@@ -5112,7 +5139,9 @@ gtk_mount_operation_set_parent
|
||||
gtk_mount_operation_get_parent
|
||||
gtk_mount_operation_set_display
|
||||
gtk_mount_operation_get_display
|
||||
gtk_show_uri_on_window
|
||||
gtk_show_uri_full
|
||||
gtk_show_uri_full_finish
|
||||
gtk_show_uri
|
||||
<SUBSECTION Standard>
|
||||
GTK_IS_MOUNT_OPERATION
|
||||
GTK_IS_MOUNT_OPERATION_CLASS
|
||||
@@ -5342,6 +5371,8 @@ gtk_app_chooser_button_get_show_dialog_item
|
||||
gtk_app_chooser_button_set_show_dialog_item
|
||||
gtk_app_chooser_button_get_heading
|
||||
gtk_app_chooser_button_set_heading
|
||||
gtk_app_chooser_button_get_modal
|
||||
gtk_app_chooser_button_set_modal
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_APP_CHOOSER_BUTTON
|
||||
@@ -5815,6 +5846,14 @@ gtk_event_controller_get_propagation_limit
|
||||
gtk_event_controller_set_propagation_limit
|
||||
gtk_event_controller_get_widget
|
||||
gtk_event_controller_reset
|
||||
gtk_event_controller_get_name
|
||||
gtk_event_controller_set_name
|
||||
|
||||
<SUBSECTION>
|
||||
gtk_event_controller_get_current_event
|
||||
gtk_event_controller_get_current_event_device
|
||||
gtk_event_controller_get_current_event_state
|
||||
gtk_event_controller_get_current_event_time
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_EVENT_CONTROLLER
|
||||
@@ -5983,6 +6022,7 @@ gtk_mnemonic_trigger_get_keyval
|
||||
GtkAlternativeTrigger
|
||||
gtk_alternative_trigger_new
|
||||
gtk_alternative_trigger_get_first
|
||||
gtk_alternative_trigger_get_second
|
||||
|
||||
<SUBSECTION>
|
||||
GtkNeverTrigger
|
||||
@@ -6068,7 +6108,7 @@ GtkShortcutManagerInterface
|
||||
<TITLE>GtkShortcutController</TITLE>
|
||||
GtkShortcutController
|
||||
gtk_shortcut_controller_new
|
||||
gtk_shortcut_controller_new_with_model
|
||||
gtk_shortcut_controller_new_for_model
|
||||
GtkShortcutScope
|
||||
GtkShortcutManager
|
||||
GtkShortcutManagerInterface
|
||||
@@ -6449,8 +6489,8 @@ GTK_SHORTCUTS_SHORTCUT_GET_CLASS
|
||||
GtkShortcutLabel
|
||||
gtk_shortcut_label_new
|
||||
gtk_shortcut_label_get_accelerator
|
||||
gtk_shortcut_label_get_disabled_text
|
||||
gtk_shortcut_label_set_accelerator
|
||||
gtk_shortcut_label_get_disabled_text
|
||||
gtk_shortcut_label_set_disabled_text
|
||||
|
||||
<SUBSECTION Private>
|
||||
@@ -6634,6 +6674,27 @@ GTK_TYPE_BOX_LAYOUT
|
||||
gtk_box_layout_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkcenterlayout</FILE>
|
||||
GtkCenterLayout
|
||||
|
||||
gtk_center_layout_new
|
||||
gtk_center_layout_set_orientation
|
||||
gtk_center_layout_get_orientation
|
||||
gtk_center_layout_set_baseline_position
|
||||
gtk_center_layout_get_baseline_position
|
||||
gtk_center_layout_set_start_widget
|
||||
gtk_center_layout_get_start_widget
|
||||
gtk_center_layout_set_center_widget
|
||||
gtk_center_layout_get_center_widget
|
||||
gtk_center_layout_set_end_widget
|
||||
gtk_center_layout_get_end_widget
|
||||
|
||||
<SUBSECTION Standard>
|
||||
GTK_TYPE_CENTER_LAYOUT
|
||||
gtk_center_layout_get_type
|
||||
</SECTION>
|
||||
|
||||
<SECTION>
|
||||
<FILE>gtkcustomlayout</FILE>
|
||||
GtkCustomLayout
|
||||
|
||||
@@ -41,6 +41,7 @@ gtk_cell_renderer_spinner_get_type
|
||||
gtk_cell_renderer_text_get_type
|
||||
gtk_cell_renderer_toggle_get_type
|
||||
gtk_cell_view_get_type
|
||||
gtk_center_layout_get_type
|
||||
gtk_check_button_get_type
|
||||
gtk_color_button_get_type
|
||||
gtk_color_chooser_get_type
|
||||
@@ -213,4 +214,5 @@ gtk_viewport_get_type
|
||||
gtk_volume_button_get_type
|
||||
gtk_widget_get_type
|
||||
gtk_window_get_type
|
||||
gtk_window_controls_get_type
|
||||
gtk_window_group_get_type
|
||||
|
||||
@@ -73,6 +73,12 @@
|
||||
between different events by looking at their type, using
|
||||
gdk_event_get_event_type().
|
||||
</para>
|
||||
<para>
|
||||
Some events, such as touch events or button press-release pairs,
|
||||
are connected in to each other in an “event sequence” that
|
||||
univocally identifies events that are related to the same
|
||||
interaction.
|
||||
</para>
|
||||
<para>
|
||||
When GTK creates a GdkSurface, it connects to the #GdkSurface::event
|
||||
signal on it, which receives all of these input events. Surfaces have
|
||||
@@ -181,17 +187,6 @@
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Touch events</title>
|
||||
|
||||
<para>
|
||||
Touch events are emitted as events of type %GDK_TOUCH_BEGIN,
|
||||
%GDK_TOUCH_UPDATE or %GDK_TOUCH_END, those events contain an
|
||||
“event sequence” that univocally identifies the physical touch
|
||||
until it is lifted from the device.
|
||||
</para>
|
||||
</refsect2>
|
||||
|
||||
<refsect2>
|
||||
<title>Keyboard input</title>
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ private_headers = [
|
||||
'gtkcolorscaleprivate.h',
|
||||
'gtkcolorswatchprivate.h',
|
||||
'gtkcomboboxprivate.h',
|
||||
'gtkcontainerprivate.h',
|
||||
'gtkconstraintexpressionprivate.h',
|
||||
'gtkconstraintguideprivate.h',
|
||||
'gtkconstraintlayoutprivate.h',
|
||||
@@ -343,7 +342,6 @@ content_files = [
|
||||
'building.xml',
|
||||
'compiling.xml',
|
||||
'css-overview.xml',
|
||||
'css-properties.xml',
|
||||
'drawing-model.xml',
|
||||
'glossary.xml',
|
||||
'gtk4-broadwayd.xml',
|
||||
|
||||
@@ -299,8 +299,9 @@
|
||||
in GTK 4.
|
||||
</para>
|
||||
<para>
|
||||
GdkEvent is now a strictly read-only boxed type, and you
|
||||
can no longer change any of its fields.
|
||||
GdkEvent is now a strictly read-only type, and you
|
||||
can no longer change any of its fields, or construct new
|
||||
events.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -308,7 +309,7 @@
|
||||
<title>Stop using gdk_surface_set_event_compression</title>
|
||||
<para>
|
||||
Event compression is now always enabled. If you need to see the uncoalesced
|
||||
motion history, use gdk_event_get_motion_history().
|
||||
motion history, use gdk_motion_event_get_history() on the latest motion event.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -318,8 +319,8 @@
|
||||
Warping the pointer is disorienting and unfriendly to users.
|
||||
GTK 4 does not support it. In special circumstances (such as when
|
||||
implementing remote connection UIs) it can be necessary to
|
||||
warp the pointer; in this case, use platform APIs such as XWarpPointer
|
||||
directly.
|
||||
warp the pointer; in this case, use platform APIs such as
|
||||
<function>XWarpPointer()</function> directly.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -339,6 +340,15 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using gtk_get_current_... APIs</title>
|
||||
<para>
|
||||
The function gtk_get_current_event() and its variants have been
|
||||
replaced by equivalent event controller APIs:
|
||||
gtk_event_controller_get_current_event(), etc.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to surface API changes</title>
|
||||
<para>
|
||||
@@ -389,7 +399,7 @@
|
||||
Any APIs that deal with global (or root) coordinates have been
|
||||
removed in GTK4, since not all backends support them. You should
|
||||
replace your use of such APIs with surface-relative equivalents.
|
||||
Examples of this are gdk_surfae_get_origin(), gdk_surface_move()
|
||||
Examples of this are gdk_surface_get_origin(), gdk_surface_move()
|
||||
or gdk_event_get_root_coords().
|
||||
</para>
|
||||
</section>
|
||||
@@ -418,8 +428,8 @@
|
||||
<para>
|
||||
If you need to do forward or backward mapping between key codes
|
||||
and key values, use gdk_display_map_keycode() and gdk_display_map_keyval(),
|
||||
which is the replacement for gdk_keymap_get_entries_for_keycode()
|
||||
and gdk_keymap_get_entries_for_keycode().
|
||||
which are the replacements for gdk_keymap_get_entries_for_keycode()
|
||||
and gdk_keymap_get_entries_for_keyval().
|
||||
</para>
|
||||
</section>
|
||||
|
||||
@@ -470,6 +480,28 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Focus handling changes</title>
|
||||
<para>
|
||||
The semantics of the #GtkWidget:can-focus property have changed.
|
||||
In GTK 3, this property only meant that the widget itself would not
|
||||
accept keyboard input, but its children still might (in the case of
|
||||
containers). In GTK 4, if :can-focus is %FALSE, the focus cannot enter
|
||||
the widget or any of its descendents, and the default value has changed
|
||||
from %FALSE to %TRUE.
|
||||
</para>
|
||||
<para>
|
||||
The recommended way to influence focus behavior of custom widgets
|
||||
in GTK 4 is to override the focus() and grab_focus() vfuncs.
|
||||
</para>
|
||||
<para>
|
||||
The feature to automatically keep the focus widget scrolled into view
|
||||
with gtk_container_set_focus_vadjustment() has been removed from
|
||||
GtkContainer, and is provided by scrollables instead. In the common case
|
||||
that the scrollable is a #GtkViewport, use #GtkViewport:scroll-to-focus.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using GtkEventBox</title>
|
||||
<para>
|
||||
@@ -537,6 +569,12 @@
|
||||
and always use the context's current state. Update all callers
|
||||
to omit the state argument.
|
||||
</para>
|
||||
<para>
|
||||
The most commonly used GtkStyleContext API, gtk_style_context_add_class(),
|
||||
has been moved to GtkWidget as gtk_widget_add_css_class(), as have the
|
||||
corresponding gtk_style_context_remove_class() and
|
||||
gtk_style_context_has_class() APIs.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -561,6 +599,17 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using GtkShadowType and GtkRelief properties</title>
|
||||
<para>
|
||||
The shadow-type properties in GtkScrolledWindow, GtkViewport,
|
||||
and GtkFrame, as well as the relief properties in GtkButton
|
||||
and its subclasses have been removed. GtkScrolledWindow, GtkButton
|
||||
and GtkMenuButton have instead gained a boolean has-frame
|
||||
property.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Adapt to GtkWidget's size request changes</title>
|
||||
<para>
|
||||
@@ -1011,6 +1060,15 @@
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>GtkAspectFrame is no longer a frame</title>
|
||||
<para>
|
||||
GtkAspectFrame is no longer derived from GtkFrame and does not
|
||||
place a label and frame around its child anymore. It still lets
|
||||
you control the aspect ratio of its child.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>Stop using custom tooltip windows</title>
|
||||
<para>
|
||||
|
||||
@@ -3,8 +3,9 @@ if get_option('gtk_doc')
|
||||
error('Building the GTK documentation requires Meson 0.52.0')
|
||||
endif
|
||||
|
||||
# Use gtk-doc as a sub-project if the version isn't new enough
|
||||
dependency('gtk-doc', version: '>=1.32',
|
||||
# Use gtk-doc as a sub-project from the gtk-doc-for-gtk4 branch
|
||||
# for the time being
|
||||
dependency('gtk-doc', version: '>=1.99',
|
||||
fallback: ['gtk-doc', 'dummy_dep'],
|
||||
default_options: ['tests=false'])
|
||||
|
||||
|
||||
+5
-19
@@ -455,7 +455,6 @@ create_text_view (void)
|
||||
GtkWidget *text_view;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
text_view = gtk_text_view_new ();
|
||||
gtk_container_add (GTK_CONTAINER (widget), text_view);
|
||||
/* Bad hack to add some size to the widget */
|
||||
@@ -476,7 +475,6 @@ create_tree_view (void)
|
||||
WidgetInfo *info;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
store = gtk_tree_store_new (3, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_STRING);
|
||||
gtk_tree_store_append (store, &iter, NULL);
|
||||
gtk_tree_store_set (store, &iter, 0, "Line One", 1, FALSE, 2, "A", -1);
|
||||
@@ -520,7 +518,6 @@ create_icon_view (void)
|
||||
WidgetInfo *info;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
list_store = gtk_list_store_new (2, G_TYPE_STRING, GDK_TYPE_PIXBUF);
|
||||
gtk_list_store_append (list_store, &iter);
|
||||
pixbuf = gdk_pixbuf_new_from_file ("folder.png", NULL);
|
||||
@@ -665,27 +662,19 @@ create_panes (void)
|
||||
gtk_box_set_homogeneous (GTK_BOX (hbox), TRUE);
|
||||
pane = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
gtk_paned_pack1 (GTK_PANED (pane),
|
||||
g_object_new (GTK_TYPE_FRAME,
|
||||
"shadow-type", GTK_SHADOW_IN,
|
||||
NULL),
|
||||
g_object_new (GTK_TYPE_FRAME, NULL),
|
||||
FALSE, FALSE);
|
||||
gtk_paned_pack2 (GTK_PANED (pane),
|
||||
g_object_new (GTK_TYPE_FRAME,
|
||||
"shadow-type", GTK_SHADOW_IN,
|
||||
NULL),
|
||||
g_object_new (GTK_TYPE_FRAME, NULL),
|
||||
FALSE, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (hbox),
|
||||
pane);
|
||||
pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
|
||||
gtk_paned_pack1 (GTK_PANED (pane),
|
||||
g_object_new (GTK_TYPE_FRAME,
|
||||
"shadow-type", GTK_SHADOW_IN,
|
||||
NULL),
|
||||
g_object_new (GTK_TYPE_FRAME, NULL),
|
||||
FALSE, FALSE);
|
||||
gtk_paned_pack2 (GTK_PANED (pane),
|
||||
g_object_new (GTK_TYPE_FRAME,
|
||||
"shadow-type", GTK_SHADOW_IN,
|
||||
NULL),
|
||||
g_object_new (GTK_TYPE_FRAME, NULL),
|
||||
FALSE, FALSE);
|
||||
gtk_container_add (GTK_CONTAINER (hbox),
|
||||
pane);
|
||||
@@ -1226,7 +1215,7 @@ create_sidebar (void)
|
||||
stack = gtk_stack_new ();
|
||||
gtk_widget_set_size_request (stack, 120, 120);
|
||||
view = gtk_label_new ("Sidebar");
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (view), "view");
|
||||
gtk_widget_add_css_class (view, "view");
|
||||
gtk_widget_set_halign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (view, GTK_ALIGN_FILL);
|
||||
gtk_widget_show (view);
|
||||
@@ -1259,7 +1248,6 @@ create_list_box (void)
|
||||
WidgetInfo *info;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
|
||||
list = gtk_list_box_new ();
|
||||
gtk_list_box_set_selection_mode (GTK_LIST_BOX (list), GTK_SELECTION_BROWSE);
|
||||
@@ -1312,7 +1300,6 @@ create_flow_box (void)
|
||||
WidgetInfo *info;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
|
||||
box = gtk_flow_box_new ();
|
||||
gtk_flow_box_set_min_children_per_line (GTK_FLOW_BOX (box), 2);
|
||||
@@ -1351,7 +1338,6 @@ create_gl_area (void)
|
||||
GtkWidget *gears;
|
||||
|
||||
widget = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN);
|
||||
|
||||
gears = gtk_gears_new ();
|
||||
gtk_container_add (GTK_CONTAINER (widget), gears);
|
||||
|
||||
@@ -143,7 +143,6 @@ activate (GtkApplication *app,
|
||||
g_signal_connect (window, "destroy", G_CALLBACK (close_window), NULL);
|
||||
|
||||
frame = gtk_frame_new (NULL);
|
||||
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
|
||||
gtk_container_add (GTK_CONTAINER (window), frame);
|
||||
|
||||
drawing_area = gtk_drawing_area_new ();
|
||||
|
||||
@@ -100,7 +100,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_crossing_new (GDK_ENTER_NOTIFY,
|
||||
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
|
||||
surface,
|
||||
gdk_seat_get_pointer (seat),
|
||||
gdk_seat_get_pointer (seat),
|
||||
@@ -119,7 +119,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_crossing_new (GDK_LEAVE_NOTIFY,
|
||||
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
|
||||
surface,
|
||||
gdk_seat_get_pointer (seat),
|
||||
gdk_seat_get_pointer (seat),
|
||||
@@ -141,7 +141,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_motion_new (surface,
|
||||
event = gdk_motion_event_new (surface,
|
||||
gdk_seat_get_pointer (seat),
|
||||
gdk_seat_get_pointer (seat),
|
||||
NULL,
|
||||
@@ -165,7 +165,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_button_new (message->base.type == BROADWAY_EVENT_BUTTON_PRESS
|
||||
event = gdk_button_event_new (message->base.type == BROADWAY_EVENT_BUTTON_PRESS
|
||||
? GDK_BUTTON_PRESS
|
||||
: GDK_BUTTON_RELEASE,
|
||||
surface,
|
||||
@@ -188,7 +188,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->pointer.event_surface_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_discrete_scroll_new (surface,
|
||||
event = gdk_scroll_event_new_discrete (surface,
|
||||
gdk_seat_get_pointer (seat),
|
||||
gdk_seat_get_pointer (seat),
|
||||
NULL,
|
||||
@@ -243,7 +243,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
if (event_type == GDK_TOUCH_BEGIN || event_type == GDK_TOUCH_UPDATE)
|
||||
state |= GDK_BUTTON1_MASK;
|
||||
|
||||
event = gdk_event_touch_new (event_type,
|
||||
event = gdk_touch_event_new (event_type,
|
||||
GUINT_TO_POINTER (message->touch.sequence_id),
|
||||
surface,
|
||||
gdk_seat_get_pointer (seat),
|
||||
@@ -271,7 +271,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
translated.consumed = 0;
|
||||
translated.layout = 0;
|
||||
translated.level = 0;
|
||||
event = gdk_event_key_new (message->base.type == BROADWAY_EVENT_KEY_PRESS
|
||||
event = gdk_key_event_new (message->base.type == BROADWAY_EVENT_KEY_PRESS
|
||||
? GDK_KEY_PRESS
|
||||
: GDK_KEY_RELEASE,
|
||||
surface,
|
||||
@@ -298,7 +298,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->configure_notify.id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_configure_new (surface,
|
||||
event = gdk_configure_event_new (surface,
|
||||
message->configure_notify.width,
|
||||
message->configure_notify.height);
|
||||
|
||||
@@ -329,7 +329,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.old_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_focus_new (surface,
|
||||
event = gdk_focus_event_new (surface,
|
||||
gdk_seat_get_keyboard (seat),
|
||||
gdk_seat_get_keyboard (seat),
|
||||
FALSE);
|
||||
@@ -340,7 +340,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
surface = g_hash_table_lookup (display_broadway->id_ht, GINT_TO_POINTER (message->focus.new_id));
|
||||
if (surface)
|
||||
{
|
||||
event = gdk_event_focus_new (surface,
|
||||
event = gdk_focus_event_new (surface,
|
||||
gdk_seat_get_keyboard (seat),
|
||||
gdk_seat_get_keyboard (seat),
|
||||
TRUE);
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <gdk/gdksurfaceprivate.h>
|
||||
#include "gdkbroadwaysurface.h"
|
||||
#include "gdkinternals.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ libgdk_broadway = static_library('gdk-broadway',
|
||||
broadwayd_syslib = os_win32 ? find_library('ws2_32') : shmlib
|
||||
|
||||
executable('gtk4-broadwayd',
|
||||
clienthtml_h, broadwayjs_h,
|
||||
clienthtml_h, broadwayjs_h, gdkconfig, gdkenum_h,
|
||||
'broadwayd.c', 'broadway-server.c', 'broadway-output.c',
|
||||
include_directories: [confinc, gdkinc, include_directories('.')],
|
||||
c_args: ['-DGTK_COMPILATION', '-DG_LOG_DOMAIN="Gdk"', ],
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
+1
-1
@@ -505,7 +505,7 @@ generate_grab_broken_event (GdkDisplay *display,
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_grab_broken_new (surface,
|
||||
event = gdk_grab_broken_event_new (surface,
|
||||
device,
|
||||
device,
|
||||
grab_surface,
|
||||
|
||||
+24
-24
@@ -915,12 +915,12 @@ gdk_drop_emit_enter_event (GdkDrop *self,
|
||||
|
||||
g_warn_if_fail (!priv->entered);
|
||||
|
||||
event = gdk_event_drag_new (GDK_DRAG_ENTER,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
0, 0);
|
||||
event = gdk_dnd_event_new (GDK_DRAG_ENTER,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
0, 0);
|
||||
|
||||
priv->entered = TRUE;
|
||||
|
||||
@@ -939,12 +939,12 @@ gdk_drop_emit_motion_event (GdkDrop *self,
|
||||
|
||||
g_warn_if_fail (priv->entered);
|
||||
|
||||
event = gdk_event_drag_new (GDK_DRAG_MOTION,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
x, y);
|
||||
event = gdk_dnd_event_new (GDK_DRAG_MOTION,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
x, y);
|
||||
|
||||
gdk_drop_do_emit_event (event, dont_queue);
|
||||
}
|
||||
@@ -959,12 +959,12 @@ gdk_drop_emit_leave_event (GdkDrop *self,
|
||||
|
||||
g_warn_if_fail (priv->entered);
|
||||
|
||||
event = gdk_event_drag_new (GDK_DRAG_LEAVE,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
0, 0);
|
||||
event = gdk_dnd_event_new (GDK_DRAG_LEAVE,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
0, 0);
|
||||
|
||||
priv->entered = FALSE;
|
||||
|
||||
@@ -984,12 +984,12 @@ gdk_drop_emit_drop_event (GdkDrop *self,
|
||||
g_warn_if_fail (priv->entered);
|
||||
g_warn_if_fail (priv->state == GDK_DROP_STATE_NONE);
|
||||
|
||||
event = gdk_event_drag_new (GDK_DROP_START,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
x, y);
|
||||
event = gdk_dnd_event_new (GDK_DROP_START,
|
||||
priv->surface,
|
||||
priv->device,
|
||||
self,
|
||||
time,
|
||||
x, y);
|
||||
|
||||
priv->state = GDK_DROP_STATE_DROPPING;
|
||||
|
||||
|
||||
+2095
-1294
File diff suppressed because it is too large
Load Diff
+79
-14
@@ -41,6 +41,10 @@ G_BEGIN_DECLS
|
||||
#define GDK_TYPE_EVENT (gdk_event_get_type ())
|
||||
#define GDK_TYPE_EVENT_SEQUENCE (gdk_event_sequence_get_type ())
|
||||
|
||||
#define GDK_IS_EVENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GDK_TYPE_EVENT))
|
||||
#define GDK_EVENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GDK_TYPE_EVENT, GdkEvent))
|
||||
|
||||
#define GDK_IS_EVENT_TYPE(event, type) (gdk_event_get_event_type ((event)) == (type))
|
||||
|
||||
/**
|
||||
* GDK_PRIORITY_EVENTS:
|
||||
@@ -98,9 +102,38 @@ G_BEGIN_DECLS
|
||||
*/
|
||||
#define GDK_BUTTON_SECONDARY (3)
|
||||
|
||||
typedef struct _GdkEventSequence GdkEventSequence;
|
||||
typedef struct _GdkEvent GdkEvent;
|
||||
|
||||
typedef struct _GdkEventSequence GdkEventSequence;
|
||||
typedef union _GdkEvent GdkEvent;
|
||||
#define GDK_TYPE_BUTTON_EVENT (gdk_button_event_get_type())
|
||||
#define GDK_TYPE_CONFIGURE_EVENT (gdk_configure_event_get_type())
|
||||
#define GDK_TYPE_CROSSING_EVENT (gdk_crossing_event_get_type())
|
||||
#define GDK_TYPE_DELETE_EVENT (gdk_delete_event_get_type())
|
||||
#define GDK_TYPE_DND_EVENT (gdk_dnd_event_get_type())
|
||||
#define GDK_TYPE_FOCUS_EVENT (gdk_focus_event_get_type())
|
||||
#define GDK_TYPE_GRAB_BROKEN_EVENT (gdk_grab_broken_event_get_type())
|
||||
#define GDK_TYPE_KEY_EVENT (gdk_key_event_get_type())
|
||||
#define GDK_TYPE_MOTION_EVENT (gdk_motion_event_get_type())
|
||||
#define GDK_TYPE_PAD_EVENT (gdk_pad_event_get_type())
|
||||
#define GDK_TYPE_PROXIMITY_EVENT (gdk_proximity_event_get_type())
|
||||
#define GDK_TYPE_SCROLL_EVENT (gdk_scroll_event_get_type())
|
||||
#define GDK_TYPE_TOUCH_EVENT (gdk_touch_event_get_type())
|
||||
#define GDK_TYPE_TOUCHPAD_EVENT (gdk_touchpad_event_get_type())
|
||||
|
||||
typedef struct _GdkButtonEvent GdkButtonEvent;
|
||||
typedef struct _GdkConfigureEvent GdkConfigureEvent;
|
||||
typedef struct _GdkCrossingEvent GdkCrossingEvent;
|
||||
typedef struct _GdkDeleteEvent GdkDeleteEvent;
|
||||
typedef struct _GdkDNDEvent GdkDNDEvent;
|
||||
typedef struct _GdkFocusEvent GdkFocusEvent;
|
||||
typedef struct _GdkGrabBrokenEvent GdkGrabBrokenEvent;
|
||||
typedef struct _GdkKeyEvent GdkKeyEvent;
|
||||
typedef struct _GdkMotionEvent GdkMotionEvent;
|
||||
typedef struct _GdkPadEvent GdkPadEvent;
|
||||
typedef struct _GdkProximityEvent GdkProximityEvent;
|
||||
typedef struct _GdkScrollEvent GdkScrollEvent;
|
||||
typedef struct _GdkTouchEvent GdkTouchEvent;
|
||||
typedef struct _GdkTouchpadEvent GdkTouchpadEvent;
|
||||
|
||||
/**
|
||||
* GdkEventType:
|
||||
@@ -297,7 +330,6 @@ typedef enum
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_event_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_event_sequence_get_type (void) G_GNUC_CONST;
|
||||
|
||||
@@ -348,9 +380,13 @@ gboolean gdk_event_get_axis (GdkEvent *event,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_event_get_pointer_emulated (GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_button_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
guint gdk_button_event_get_button (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_scroll_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkScrollDirection gdk_scroll_event_get_direction (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_scroll_event_get_deltas (GdkEvent *event,
|
||||
@@ -359,6 +395,8 @@ void gdk_scroll_event_get_deltas (GdkEvent *event,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_scroll_event_is_stop (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_key_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
guint gdk_key_event_get_keyval (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
guint gdk_key_event_get_keycode (GdkEvent *event);
|
||||
@@ -371,18 +409,30 @@ guint gdk_key_event_get_level (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_key_event_is_modifier (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_focus_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_focus_event_get_in (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_touch_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_touch_event_get_emulating_pointer (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_crossing_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkCrossingMode gdk_crossing_event_get_mode (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkNotifyType gdk_crossing_event_get_detail (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_crossing_event_get_focus (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_configure_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_configure_event_get_size (GdkEvent *event,
|
||||
int *width,
|
||||
int *height);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_touchpad_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkTouchpadGesturePhase
|
||||
gdk_touchpad_event_get_gesture_phase (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -392,26 +442,41 @@ void gdk_touchpad_event_get_deltas (GdkEvent *event,
|
||||
double *dx,
|
||||
double *dy);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
double gdk_touchpad_pinch_event_get_angle_delta (GdkEvent *event);
|
||||
double gdk_touchpad_event_get_pinch_angle_delta (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
double gdk_touchpad_pinch_event_get_scale (GdkEvent *event);
|
||||
double gdk_touchpad_event_get_pinch_scale (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
guint gdk_pad_button_event_get_button (GdkEvent *event);
|
||||
GType gdk_pad_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_pad_axis_event_get_value (GdkEvent *event,
|
||||
guint *index,
|
||||
double *value);
|
||||
guint gdk_pad_event_get_button (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_pad_event_get_group_mode (GdkEvent *event,
|
||||
guint *group,
|
||||
guint *mode);
|
||||
void gdk_pad_event_get_axis_value (GdkEvent *event,
|
||||
guint *index,
|
||||
double *value);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkDrop * gdk_drag_event_get_drop (GdkEvent *event);
|
||||
void gdk_pad_event_get_group_mode (GdkEvent *event,
|
||||
guint *group,
|
||||
guint *mode);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_dnd_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkDrop * gdk_dnd_event_get_drop (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_grab_broken_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GdkSurface * gdk_grab_broken_event_get_grab_surface (GdkEvent *event);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_grab_broken_event_get_implicit (GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GList * gdk_event_get_motion_history (GdkEvent *event);
|
||||
GType gdk_motion_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GList * gdk_motion_event_get_history (GdkEvent *event);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_delete_event_get_type (void) G_GNUC_CONST;
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GType gdk_proximity_event_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
gboolean gdk_event_triggers_context_menu (GdkEvent *event);
|
||||
|
||||
+191
-301
@@ -30,74 +30,98 @@
|
||||
#include <gdk/gdkdevice.h>
|
||||
#include <gdk/gdkdevicetool.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
typedef struct _GdkEventAny GdkEventAny;
|
||||
typedef struct _GdkEventMotion GdkEventMotion;
|
||||
typedef struct _GdkEventButton GdkEventButton;
|
||||
typedef struct _GdkEventTouch GdkEventTouch;
|
||||
typedef struct _GdkEventScroll GdkEventScroll;
|
||||
typedef struct _GdkEventKey GdkEventKey;
|
||||
typedef struct _GdkEventFocus GdkEventFocus;
|
||||
typedef struct _GdkEventCrossing GdkEventCrossing;
|
||||
typedef struct _GdkEventConfigure GdkEventConfigure;
|
||||
typedef struct _GdkEventProximity GdkEventProximity;
|
||||
typedef struct _GdkEventDND GdkEventDND;
|
||||
typedef struct _GdkEventSetting GdkEventSetting;
|
||||
typedef struct _GdkEventGrabBroken GdkEventGrabBroken;
|
||||
typedef struct _GdkEventTouchpadSwipe GdkEventTouchpadSwipe;
|
||||
typedef struct _GdkEventTouchpadPinch GdkEventTouchpadPinch;
|
||||
typedef struct _GdkEventPadButton GdkEventPadButton;
|
||||
typedef struct _GdkEventPadAxis GdkEventPadAxis;
|
||||
typedef struct _GdkEventPadGroupMode GdkEventPadGroupMode;
|
||||
#define GDK_EVENT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GDK_TYPE_EVENT, GdkEventClass))
|
||||
|
||||
/*
|
||||
* GdkEventAny:
|
||||
* @type: the type of the event.
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
typedef struct _GdkEventClass GdkEventClass;
|
||||
|
||||
/*< private >
|
||||
* GdkEvent:
|
||||
* @ref_count: the reference count of the event
|
||||
* @event_type: the specialized event type
|
||||
* @surface: the surface of the event
|
||||
* @device: the device of the event
|
||||
* @source_device: the source device
|
||||
* @time: a serial identifier of the event that can be used to order
|
||||
* two events
|
||||
* @flags: event flags
|
||||
*
|
||||
* Contains the fields which are common to all event structs.
|
||||
* Any event pointer can safely be cast to a pointer to a #GdkEventAny to
|
||||
* access these fields.
|
||||
* The abstract type for all windowing system events.
|
||||
*/
|
||||
struct _GdkEventAny
|
||||
struct _GdkEvent
|
||||
{
|
||||
int ref_count;
|
||||
GdkEventType type;
|
||||
GTypeInstance parent_instance;
|
||||
|
||||
grefcount ref_count;
|
||||
|
||||
/* Specialised event type */
|
||||
GdkEventType event_type;
|
||||
|
||||
/* The surface of the event */
|
||||
GdkSurface *surface;
|
||||
guint32 time;
|
||||
guint16 flags;
|
||||
guint pointer_emulated : 1;
|
||||
guint touch_emulating : 1;
|
||||
guint scroll_is_stop : 1;
|
||||
guint key_is_modifier : 1;
|
||||
guint focus_in : 1;
|
||||
|
||||
/* The devices associated to the event */
|
||||
GdkDevice *device;
|
||||
GdkDevice *source_device;
|
||||
|
||||
guint32 time;
|
||||
guint16 flags;
|
||||
};
|
||||
|
||||
/*< private >
|
||||
* GdkEventClass:
|
||||
* @finalize: a function called when the last reference held on an event is
|
||||
* released; implementations of GdkEvent must chain up to the parent class
|
||||
*
|
||||
* The base class for events.
|
||||
*/
|
||||
struct _GdkEventClass
|
||||
{
|
||||
GTypeClass parent_class;
|
||||
|
||||
void (* finalize) (GdkEvent *event);
|
||||
|
||||
GdkModifierType (* get_state) (GdkEvent *event);
|
||||
gboolean (* get_position) (GdkEvent *event,
|
||||
double *x,
|
||||
double *y);
|
||||
GdkEventSequence * (* get_sequence) (GdkEvent *event);
|
||||
GdkDeviceTool * (* get_tool) (GdkEvent *event);
|
||||
gboolean (* get_axes) (GdkEvent *event,
|
||||
double **axes,
|
||||
guint *n_axes);
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventMotion:
|
||||
* @type: the type of the event.
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* GdkDeleteEvent:
|
||||
*
|
||||
* Generated when a surface is deleted.
|
||||
*/
|
||||
struct _GdkDeleteEvent
|
||||
{
|
||||
GdkEvent parent_instance;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkMotionEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) set during the motion
|
||||
* event. See #GdkModifierType.
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @device: the master device that the event originated from. Use
|
||||
* gdk_event_get_source_device() to get the slave device.
|
||||
* screen.
|
||||
* @history: (element-type GdkTimeCoord): a list of time and coordinates
|
||||
* for other motion events that were compressed before delivering the
|
||||
* current event
|
||||
*
|
||||
* Generated when the pointer moves.
|
||||
*/
|
||||
struct _GdkEventMotion
|
||||
struct _GdkMotionEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
double x;
|
||||
double y;
|
||||
@@ -107,15 +131,7 @@ struct _GdkEventMotion
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventButton:
|
||||
* @type: the type of the event (%GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse.
|
||||
* GdkButtonEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
@@ -123,16 +139,19 @@ struct _GdkEventMotion
|
||||
* Normally button 1 is the left mouse button, 2 is the middle button,
|
||||
* and 3 is the right button. On 2-button mice, the middle button can
|
||||
* often be simulated by pressing both mouse buttons together.
|
||||
* @device: the master device that the event originated from. Use
|
||||
* gdk_event_get_source_device() to get the slave device.
|
||||
* screen.
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse.
|
||||
* @tool: a #GdkDeviceTool
|
||||
*
|
||||
* Used for button press and button release events. The
|
||||
* @type field will be one of %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE,
|
||||
*/
|
||||
struct _GdkEventButton
|
||||
struct _GdkButtonEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
guint button;
|
||||
double x;
|
||||
@@ -142,25 +161,16 @@ struct _GdkEventButton
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventTouch:
|
||||
* @type: the type of the event (%GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE,
|
||||
* %GDK_TOUCH_END, %GDK_TOUCH_CANCEL)
|
||||
* @surface: the surface which received the event
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @x: the x coordinate of the pointer relative to the surface
|
||||
* @y: the y coordinate of the pointer relative to the surface
|
||||
* @axes: @x, @y translated to the axes of @device, or %NULL if @device is
|
||||
* the mouse
|
||||
* GdkTouchEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType
|
||||
* @x: the x coordinate of the pointer relative to the surface
|
||||
* @y: the y coordinate of the pointer relative to the surface
|
||||
* @axes: @x, @y translated to the axes of the event's device, or %NULL
|
||||
* if @device is the mouse
|
||||
* @sequence: the event sequence that the event belongs to
|
||||
* @emulating_pointer: whether the event should be used for emulating
|
||||
* pointer event
|
||||
* @device: the master device that the event originated from. Use
|
||||
* gdk_event_get_source_device() to get the slave device.
|
||||
* screen
|
||||
* @emulated: whether the event is the result of a pointer emulation
|
||||
*
|
||||
* Used for touch events.
|
||||
* @type field will be one of %GDK_TOUCH_BEGIN, %GDK_TOUCH_UPDATE,
|
||||
@@ -173,22 +183,21 @@ struct _GdkEventButton
|
||||
* (or %GDK_TOUCH_CANCEL) event. With multitouch devices, there may be
|
||||
* several active sequences at the same time.
|
||||
*/
|
||||
struct _GdkEventTouch
|
||||
struct _GdkTouchEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
double x;
|
||||
double y;
|
||||
double *axes;
|
||||
GdkEventSequence *sequence;
|
||||
gboolean touch_emulating;
|
||||
gboolean pointer_emulated;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventScroll:
|
||||
* @type: the type of the event (%GDK_SCROLL).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* GdkScrollEvent:
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
@@ -197,10 +206,11 @@ struct _GdkEventTouch
|
||||
* @direction: the direction to scroll to (one of %GDK_SCROLL_UP,
|
||||
* %GDK_SCROLL_DOWN, %GDK_SCROLL_LEFT, %GDK_SCROLL_RIGHT or
|
||||
* %GDK_SCROLL_SMOOTH).
|
||||
* @device: the master device that the event originated from. Use
|
||||
* gdk_event_get_source_device() to get the slave device.
|
||||
* @delta_x: the x coordinate of the scroll delta
|
||||
* @delta_y: the y coordinate of the scroll delta
|
||||
* @pointer_emulated: whether the scroll event was the result of
|
||||
* a pointer emulation
|
||||
* @tool: a #GdkDeviceTool
|
||||
*
|
||||
* Generated from button presses for the buttons 4 to 7. Wheel mice are
|
||||
* usually configured to generate button press events for buttons 4 and 5
|
||||
@@ -211,18 +221,30 @@ struct _GdkEventTouch
|
||||
* these, the scroll deltas can be obtained with
|
||||
* gdk_event_get_scroll_deltas().
|
||||
*/
|
||||
struct _GdkEventScroll
|
||||
struct _GdkScrollEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
double x;
|
||||
double y;
|
||||
GdkModifierType state;
|
||||
GdkScrollDirection direction;
|
||||
double delta_x;
|
||||
double delta_y;
|
||||
gboolean pointer_emulated;
|
||||
gboolean is_stop;
|
||||
GdkDeviceTool *tool;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkTranslatedKey:
|
||||
* @keyval: the translated key symbol
|
||||
* @consumed: the consumed modifiers
|
||||
* @layout: the keyboard layout
|
||||
* @level: the layout level
|
||||
*
|
||||
* Describes a translated key code.
|
||||
*/
|
||||
typedef struct {
|
||||
guint keyval;
|
||||
GdkModifierType consumed;
|
||||
@@ -231,11 +253,7 @@ typedef struct {
|
||||
} GdkTranslatedKey;
|
||||
|
||||
/*
|
||||
* GdkEventKey:
|
||||
* @type: the type of the event (%GDK_KEY_PRESS or %GDK_KEY_RELEASE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* GdkKeyEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
@@ -245,41 +263,40 @@ typedef struct {
|
||||
*
|
||||
* Describes a key press or key release event.
|
||||
*/
|
||||
struct _GdkEventKey
|
||||
struct _GdkKeyEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
guint32 keycode;
|
||||
gboolean key_is_modifier;
|
||||
GdkTranslatedKey translated[2];
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventCrossing:
|
||||
* @type: the type of the event (%GDK_ENTER_NOTIFY or %GDK_LEAVE_NOTIFY).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @child_surface: the surface that was entered or left.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* GdkCrossingEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @mode: the crossing mode (%GDK_CROSSING_NORMAL, %GDK_CROSSING_GRAB,
|
||||
* %GDK_CROSSING_UNGRAB, %GDK_CROSSING_GTK_GRAB, %GDK_CROSSING_GTK_UNGRAB or
|
||||
* %GDK_CROSSING_STATE_CHANGED). %GDK_CROSSING_GTK_GRAB, %GDK_CROSSING_GTK_UNGRAB,
|
||||
* and %GDK_CROSSING_STATE_CHANGED were added in 2.14 and are always synthesized,
|
||||
* never native.
|
||||
* @x: the x coordinate of the pointer relative to the surface.
|
||||
* @y: the y coordinate of the pointer relative to the surface.
|
||||
* @detail: the kind of crossing that happened (%GDK_NOTIFY_INFERIOR,
|
||||
* %GDK_NOTIFY_ANCESTOR, %GDK_NOTIFY_VIRTUAL, %GDK_NOTIFY_NONLINEAR or
|
||||
* %GDK_NOTIFY_NONLINEAR_VIRTUAL).
|
||||
* @focus: %TRUE if @surface is the focus surface or an inferior.
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
* @child_surface: the surface that was entered or left.
|
||||
*
|
||||
* Generated when the pointer enters or leaves a surface.
|
||||
*/
|
||||
struct _GdkEventCrossing
|
||||
struct _GdkCrossingEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
GdkCrossingMode mode;
|
||||
double x;
|
||||
@@ -290,10 +307,7 @@ struct _GdkEventCrossing
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventFocus:
|
||||
* @type: the type of the event (%GDK_FOCUS_CHANGE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* GdkFocusEvent:
|
||||
* @in: %TRUE if the surface has gained the keyboard focus, %FALSE if
|
||||
* it has lost the focus.
|
||||
* @mode: the crossing mode
|
||||
@@ -301,19 +315,15 @@ struct _GdkEventCrossing
|
||||
*
|
||||
* Describes a change of keyboard focus.
|
||||
*/
|
||||
struct _GdkEventFocus
|
||||
struct _GdkFocusEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
gint16 in;
|
||||
GdkCrossingMode mode;
|
||||
GdkNotifyType detail;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
gboolean focus_in;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventConfigure:
|
||||
* @type: the type of the event (%GDK_CONFIGURE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* GdkConfigureEvent:
|
||||
* @x: the new x coordinate of the surface, relative to its parent.
|
||||
* @y: the new y coordinate of the surface, relative to its parent.
|
||||
* @width: the new width of the surface.
|
||||
@@ -321,9 +331,10 @@ struct _GdkEventFocus
|
||||
*
|
||||
* Generated when a surface size or position has changed.
|
||||
*/
|
||||
struct _GdkEventConfigure
|
||||
struct _GdkConfigureEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
int x;
|
||||
int y;
|
||||
int width;
|
||||
@@ -331,36 +342,23 @@ struct _GdkEventConfigure
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventProximity:
|
||||
* @type: the type of the event (%GDK_PROXIMITY_IN or %GDK_PROXIMITY_OUT).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @device: the master device that the event originated from. Use
|
||||
* gdk_event_get_source_device() to get the slave device.
|
||||
* GdkProximityEvent:
|
||||
* @tool: the #GdkDeviceTool associated to the event
|
||||
*
|
||||
* Proximity events are generated when using GDK’s wrapper for the
|
||||
* XInput extension. The XInput extension is an add-on for standard X
|
||||
* that allows you to use nonstandard devices such as graphics tablets.
|
||||
* A proximity event indicates that the stylus has moved in or out of
|
||||
* contact with the tablet, or perhaps that the user’s finger has moved
|
||||
* in or out of contact with a touch screen.
|
||||
*
|
||||
* This event type will be used pretty rarely. It only is important for
|
||||
* XInput aware programs that are drawing their own cursor.
|
||||
* A proximity event indicates that a tool of a graphic tablet, or similar
|
||||
* devices that report proximity, has moved in or out of contact with the
|
||||
* tablet, or perhaps that the user’s finger has moved in or out of contact
|
||||
* with a touch screen.
|
||||
*/
|
||||
struct _GdkEventProximity
|
||||
struct _GdkProximityEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkDeviceTool *tool;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventGrabBroken:
|
||||
* @type: the type of the event (%GDK_GRAB_BROKEN)
|
||||
* @surface: the surface which received the event, i.e. the surface
|
||||
* that previously owned the grab
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* GdkGrabBrokenEvent:
|
||||
* @keyboard: %TRUE if a keyboard grab was broken, %FALSE if a pointer
|
||||
* grab was broken
|
||||
* @implicit: %TRUE if the broken grab was implicit
|
||||
@@ -372,67 +370,39 @@ struct _GdkEventProximity
|
||||
* when the grab surface becomes unviewable (i.e. it or one of its ancestors
|
||||
* is unmapped), or if the same application grabs the pointer or keyboard
|
||||
* again. Note that implicit grabs (which are initiated by button presses)
|
||||
* can also cause #GdkEventGrabBroken events.
|
||||
* can also cause #GdkGrabBrokenEvent events.
|
||||
*/
|
||||
struct _GdkEventGrabBroken {
|
||||
GdkEventAny any;
|
||||
struct _GdkGrabBrokenEvent
|
||||
{
|
||||
GdkEvent parent_instance;
|
||||
|
||||
gboolean keyboard;
|
||||
gboolean implicit;
|
||||
GdkSurface *grab_surface;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventDND:
|
||||
* @type: the type of the event (%GDK_DRAG_ENTER, %GDK_DRAG_LEAVE,
|
||||
* %GDK_DRAG_MOTION or %GDK_DROP_START)
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* GdkDNDEvent:
|
||||
* @drop: the #GdkDrop for the current DND operation.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @x: the X coordinate of the pointer
|
||||
* @y: the Y coordinate of the pointer
|
||||
*
|
||||
* Generated during DND operations.
|
||||
*/
|
||||
struct _GdkEventDND {
|
||||
GdkEventAny any;
|
||||
struct _GdkDNDEvent
|
||||
{
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkDrop *drop;
|
||||
double x;
|
||||
double y;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventTouchpadSwipe:
|
||||
* @type: the type of the event (%GDK_TOUCHPAD_SWIPE)
|
||||
* @surface: the surface which received the event
|
||||
* @send_event: %TRUE if the event was sent explicitly
|
||||
* @phase: (type GdkTouchpadGesturePhase): the current phase of the gesture
|
||||
* @n_fingers: The number of fingers triggering the swipe
|
||||
* @time: the time of the event in milliseconds
|
||||
* @x: The X coordinate of the pointer
|
||||
* @y: The Y coordinate of the pointer
|
||||
* @dx: Movement delta in the X axis of the swipe focal point
|
||||
* @dy: Movement delta in the Y axis of the swipe focal point
|
||||
* GdkTouchpadEvent:
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
*
|
||||
* Generated during touchpad swipe gestures.
|
||||
*/
|
||||
struct _GdkEventTouchpadSwipe {
|
||||
GdkEventAny any;
|
||||
GdkModifierType state;
|
||||
gint8 phase;
|
||||
gint8 n_fingers;
|
||||
double x;
|
||||
double y;
|
||||
double dx;
|
||||
double dy;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventTouchpadPinch:
|
||||
* @type: the type of the event (%GDK_TOUCHPAD_PINCH)
|
||||
* @surface: the surface which received the event
|
||||
* @send_event: %TRUE if the event was sent explicitly
|
||||
* @phase: (type GdkTouchpadGesturePhase): the current phase of the gesture
|
||||
* @n_fingers: The number of fingers triggering the pinch
|
||||
* @time: the time of the event in milliseconds
|
||||
@@ -440,18 +410,17 @@ struct _GdkEventTouchpadSwipe {
|
||||
* @y: The Y coordinate of the pointer
|
||||
* @dx: Movement delta in the X axis of the swipe focal point
|
||||
* @dy: Movement delta in the Y axis of the swipe focal point
|
||||
* @angle_delta: The angle change in radians, negative angles
|
||||
* @angle_delta: For pinch events, the angle change in radians, negative angles
|
||||
* denote counter-clockwise movements
|
||||
* @scale: The current scale, relative to that at the time of
|
||||
* @scale: For pinch events, the current scale, relative to that at the time of
|
||||
* the corresponding %GDK_TOUCHPAD_GESTURE_PHASE_BEGIN event
|
||||
* @state: (type GdkModifierType): a bit-mask representing the state of
|
||||
* the modifier keys (e.g. Control, Shift and Alt) and the pointer
|
||||
* buttons. See #GdkModifierType.
|
||||
*
|
||||
* Generated during touchpad swipe gestures.
|
||||
* Generated during touchpad gestures.
|
||||
*/
|
||||
struct _GdkEventTouchpadPinch {
|
||||
GdkEventAny any;
|
||||
struct _GdkTouchpadEvent
|
||||
{
|
||||
GdkEvent parent_instance;
|
||||
|
||||
GdkModifierType state;
|
||||
gint8 phase;
|
||||
gint8 n_fingers;
|
||||
@@ -463,99 +432,20 @@ struct _GdkEventTouchpadPinch {
|
||||
double scale;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventPadButton:
|
||||
* @type: the type of the event (%GDK_PAD_BUTTON_PRESS or %GDK_PAD_BUTTON_RELEASE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @group: the pad group the button belongs to. A %GDK_SOURCE_TABLET_PAD device
|
||||
* may have one or more groups containing a set of buttons/rings/strips each.
|
||||
* @button: The pad button that was pressed.
|
||||
* @mode: The current mode of @group. Different groups in a %GDK_SOURCE_TABLET_PAD
|
||||
* device may have different current modes.
|
||||
*
|
||||
* Generated during %GDK_SOURCE_TABLET_PAD button presses and releases.
|
||||
*/
|
||||
struct _GdkEventPadButton {
|
||||
GdkEventAny any;
|
||||
guint group;
|
||||
guint button;
|
||||
guint mode;
|
||||
};
|
||||
struct _GdkPadEvent
|
||||
{
|
||||
GdkEvent parent_instance;
|
||||
|
||||
/*
|
||||
* GdkEventPadAxis:
|
||||
* @type: the type of the event (%GDK_PAD_RING or %GDK_PAD_STRIP).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @group: the pad group the ring/strip belongs to. A %GDK_SOURCE_TABLET_PAD
|
||||
* device may have one or more groups containing a set of buttons/rings/strips
|
||||
* each.
|
||||
* @index: number of strip/ring that was interacted. This number is 0-indexed.
|
||||
* @mode: The current mode of @group. Different groups in a %GDK_SOURCE_TABLET_PAD
|
||||
* device may have different current modes.
|
||||
* @value: The current value for the given axis.
|
||||
*
|
||||
* Generated during %GDK_SOURCE_TABLET_PAD interaction with tactile sensors.
|
||||
*/
|
||||
struct _GdkEventPadAxis {
|
||||
GdkEventAny any;
|
||||
guint group;
|
||||
guint index;
|
||||
guint mode;
|
||||
guint button;
|
||||
guint index;
|
||||
double value;
|
||||
};
|
||||
|
||||
/*
|
||||
* GdkEventPadGroupMode:
|
||||
* @type: the type of the event (%GDK_PAD_GROUP_MODE).
|
||||
* @surface: the surface which received the event.
|
||||
* @send_event: %TRUE if the event was sent explicitly.
|
||||
* @time: the time of the event in milliseconds.
|
||||
* @group: the pad group that is switching mode. A %GDK_SOURCE_TABLET_PAD
|
||||
* device may have one or more groups containing a set of buttons/rings/strips
|
||||
* each.
|
||||
* @mode: The new mode of @group. Different groups in a %GDK_SOURCE_TABLET_PAD
|
||||
* device may have different current modes.
|
||||
*
|
||||
* Generated during %GDK_SOURCE_TABLET_PAD mode switches in a group.
|
||||
*/
|
||||
struct _GdkEventPadGroupMode {
|
||||
GdkEventAny any;
|
||||
guint group;
|
||||
guint mode;
|
||||
};
|
||||
void gdk_event_init_types (void);
|
||||
|
||||
/*
|
||||
* GdkEvent:
|
||||
*
|
||||
* The GdkEvent struct is private and should only be accessed
|
||||
* using the accessor functions.
|
||||
*/
|
||||
union _GdkEvent
|
||||
{
|
||||
GdkEventAny any;
|
||||
GdkEventMotion motion;
|
||||
GdkEventButton button;
|
||||
GdkEventTouch touch;
|
||||
GdkEventScroll scroll;
|
||||
GdkEventKey key;
|
||||
GdkEventCrossing crossing;
|
||||
GdkEventFocus focus_change;
|
||||
GdkEventConfigure configure;
|
||||
GdkEventProximity proximity;
|
||||
GdkEventDND dnd;
|
||||
GdkEventGrabBroken grab_broken;
|
||||
GdkEventTouchpadSwipe touchpad_swipe;
|
||||
GdkEventTouchpadPinch touchpad_pinch;
|
||||
GdkEventPadButton pad_button;
|
||||
GdkEventPadAxis pad_axis;
|
||||
GdkEventPadGroupMode pad_group_mode;
|
||||
};
|
||||
|
||||
GdkEvent * gdk_event_button_new (GdkEventType type,
|
||||
GdkEvent * gdk_button_event_new (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
@@ -567,7 +457,7 @@ GdkEvent * gdk_event_button_new (GdkEventType type,
|
||||
double y,
|
||||
double *axes);
|
||||
|
||||
GdkEvent * gdk_event_motion_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_motion_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
GdkDeviceTool *tool,
|
||||
@@ -577,7 +467,7 @@ GdkEvent * gdk_event_motion_new (GdkSurface *surface,
|
||||
double y,
|
||||
double *axes);
|
||||
|
||||
GdkEvent * gdk_event_crossing_new (GdkEventType type,
|
||||
GdkEvent * gdk_crossing_event_new (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
@@ -588,14 +478,14 @@ GdkEvent * gdk_event_crossing_new (GdkEventType type,
|
||||
GdkCrossingMode mode,
|
||||
GdkNotifyType notify);
|
||||
|
||||
GdkEvent * gdk_event_proximity_new (GdkEventType type,
|
||||
GdkEvent * gdk_proximity_event_new (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time);
|
||||
|
||||
GdkEvent * gdk_event_key_new (GdkEventType type,
|
||||
GdkEvent * gdk_key_event_new (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
@@ -606,18 +496,18 @@ GdkEvent * gdk_event_key_new (GdkEventType type,
|
||||
GdkTranslatedKey *translated,
|
||||
GdkTranslatedKey *no_lock);
|
||||
|
||||
GdkEvent * gdk_event_focus_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_focus_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
gboolean focus_in);
|
||||
|
||||
GdkEvent * gdk_event_configure_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_configure_event_new (GdkSurface *surface,
|
||||
int width,
|
||||
int height);
|
||||
|
||||
GdkEvent * gdk_event_delete_new (GdkSurface *surface);
|
||||
GdkEvent * gdk_delete_event_new (GdkSurface *surface);
|
||||
|
||||
GdkEvent * gdk_event_scroll_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_scroll_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
GdkDeviceTool *tool,
|
||||
@@ -627,7 +517,7 @@ GdkEvent * gdk_event_scroll_new (GdkSurface *surface,
|
||||
double delta_y,
|
||||
gboolean is_stop);
|
||||
|
||||
GdkEvent * gdk_event_discrete_scroll_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
GdkDeviceTool *tool,
|
||||
@@ -636,7 +526,7 @@ GdkEvent * gdk_event_discrete_scroll_new (GdkSurface *surface,
|
||||
GdkScrollDirection direction,
|
||||
gboolean emulated);
|
||||
|
||||
GdkEvent * gdk_event_touch_new (GdkEventType type,
|
||||
GdkEvent * gdk_touch_event_new (GdkEventType type,
|
||||
GdkEventSequence *sequence,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
@@ -648,7 +538,7 @@ GdkEvent * gdk_event_touch_new (GdkEventType type,
|
||||
double *axes,
|
||||
gboolean emulating);
|
||||
|
||||
GdkEvent * gdk_event_touchpad_swipe_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_touchpad_event_new_swipe (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
guint32 time,
|
||||
@@ -660,7 +550,7 @@ GdkEvent * gdk_event_touchpad_swipe_new (GdkSurface *surface,
|
||||
double dx,
|
||||
double dy);
|
||||
|
||||
GdkEvent * gdk_event_touchpad_pinch_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_touchpad_event_new_pinch (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
guint32 time,
|
||||
@@ -674,7 +564,7 @@ GdkEvent * gdk_event_touchpad_pinch_new (GdkSurface *surface,
|
||||
double scale,
|
||||
double angle_delta);
|
||||
|
||||
GdkEvent * gdk_event_pad_ring_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_pad_event_new_ring (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
guint32 time,
|
||||
@@ -683,7 +573,7 @@ GdkEvent * gdk_event_pad_ring_new (GdkSurface *surface,
|
||||
guint mode,
|
||||
double value);
|
||||
|
||||
GdkEvent * gdk_event_pad_strip_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_pad_event_new_strip (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
guint32 time,
|
||||
@@ -692,7 +582,7 @@ GdkEvent * gdk_event_pad_strip_new (GdkSurface *surface,
|
||||
guint mode,
|
||||
double value);
|
||||
|
||||
GdkEvent * gdk_event_pad_button_new (GdkEventType type,
|
||||
GdkEvent * gdk_pad_event_new_button (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
@@ -701,14 +591,14 @@ GdkEvent * gdk_event_pad_button_new (GdkEventType type,
|
||||
guint button,
|
||||
guint mode);
|
||||
|
||||
GdkEvent * gdk_event_pad_group_mode_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_pad_event_new_group_mode (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
guint32 time,
|
||||
guint group,
|
||||
guint mode);
|
||||
|
||||
GdkEvent * gdk_event_drag_new (GdkEventType type,
|
||||
GdkEvent * gdk_dnd_event_new (GdkEventType type,
|
||||
GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDrop *drop,
|
||||
@@ -716,12 +606,12 @@ GdkEvent * gdk_event_drag_new (GdkEventType type,
|
||||
double x,
|
||||
double y);
|
||||
|
||||
GdkEvent * gdk_event_grab_broken_new (GdkSurface *surface,
|
||||
GdkEvent * gdk_grab_broken_event_new (GdkSurface *surface,
|
||||
GdkDevice *device,
|
||||
GdkDevice *source_device,
|
||||
GdkSurface *grab_surface,
|
||||
gboolean implicit);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GDK_EVENTS_PRIVATE_H__ */
|
||||
|
||||
|
||||
@@ -185,6 +185,11 @@ gboolean gdk_surface_handle_event (GdkEvent *event);
|
||||
GdkSeat * gdk_surface_get_seat_from_event (GdkSurface *surface,
|
||||
GdkEvent *event);
|
||||
|
||||
void gdk_surface_enter_monitor (GdkSurface *surface,
|
||||
GdkMonitor *monitor);
|
||||
void gdk_surface_leave_monitor (GdkSurface *surface,
|
||||
GdkMonitor *monitor);
|
||||
|
||||
/*****************************************
|
||||
* Interfaces provided by windowing code *
|
||||
*****************************************/
|
||||
@@ -296,6 +301,42 @@ void gdk_surface_get_geometry (GdkSurface *surface,
|
||||
|
||||
GdkGLContext *gdk_surface_get_shared_data_gl_context (GdkSurface *surface);
|
||||
|
||||
typedef enum
|
||||
{
|
||||
GDK_HINT_POS = 1 << 0,
|
||||
GDK_HINT_MIN_SIZE = 1 << 1,
|
||||
GDK_HINT_MAX_SIZE = 1 << 2,
|
||||
GDK_HINT_BASE_SIZE = 1 << 3,
|
||||
GDK_HINT_ASPECT = 1 << 4,
|
||||
GDK_HINT_RESIZE_INC = 1 << 5,
|
||||
GDK_HINT_WIN_GRAVITY = 1 << 6,
|
||||
GDK_HINT_USER_POS = 1 << 7,
|
||||
GDK_HINT_USER_SIZE = 1 << 8
|
||||
} GdkSurfaceHints;
|
||||
|
||||
struct _GdkGeometry
|
||||
{
|
||||
gint min_width;
|
||||
gint min_height;
|
||||
gint max_width;
|
||||
gint max_height;
|
||||
gint base_width;
|
||||
gint base_height;
|
||||
gint width_inc;
|
||||
gint height_inc;
|
||||
gdouble min_aspect;
|
||||
gdouble max_aspect;
|
||||
GdkGravity win_gravity;
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_constrain_size (GdkGeometry *geometry,
|
||||
GdkSurfaceHints flags,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *new_width,
|
||||
gint *new_height);
|
||||
|
||||
/*
|
||||
* GdkSeatGrabPrepareFunc:
|
||||
* @seat: the #GdkSeat being grabbed
|
||||
|
||||
+82
-67
@@ -76,6 +76,8 @@ enum {
|
||||
SIZE_CHANGED,
|
||||
RENDER,
|
||||
EVENT,
|
||||
ENTER_MONITOR,
|
||||
LEAVE_MONITOR,
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
@@ -471,6 +473,9 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* @height: the new height
|
||||
*
|
||||
* Emitted when the size of @surface is changed.
|
||||
*
|
||||
* Surface size is reported in ”application pixels”, not
|
||||
* ”device pixels” (see gdk_surface_get_scale_factor()).
|
||||
*/
|
||||
signals[SIZE_CHANGED] =
|
||||
g_signal_new (g_intern_static_string ("size-changed"),
|
||||
@@ -525,13 +530,51 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
0,
|
||||
g_signal_accumulator_true_handled,
|
||||
NULL,
|
||||
_gdk_marshal_BOOLEAN__BOXED,
|
||||
_gdk_marshal_BOOLEAN__POINTER,
|
||||
G_TYPE_BOOLEAN,
|
||||
1,
|
||||
GDK_TYPE_EVENT);
|
||||
g_signal_set_va_marshaller (signals[EVENT],
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
_gdk_marshal_BOOLEAN__BOXEDv);
|
||||
_gdk_marshal_BOOLEAN__POINTERv);
|
||||
|
||||
/**
|
||||
* GdkSurface::enter-montor:
|
||||
* @surface: the #GdkSurface
|
||||
* @monitor: the monitor
|
||||
*
|
||||
* Emitted when @surface starts being present on the monitor.
|
||||
*/
|
||||
signals[ENTER_MONITOR] =
|
||||
g_signal_new (g_intern_static_string ("enter-monitor"),
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
GDK_TYPE_MONITOR);
|
||||
|
||||
/**
|
||||
* GdkSurface::leave-montor:
|
||||
* @surface: the #GdkSurface
|
||||
* @monitor: the monitor
|
||||
*
|
||||
* Emitted when @surface stops being present on the monitor.
|
||||
*/
|
||||
signals[LEAVE_MONITOR] =
|
||||
g_signal_new (g_intern_static_string ("leave-monitor"),
|
||||
G_OBJECT_CLASS_TYPE (object_class),
|
||||
G_SIGNAL_RUN_FIRST,
|
||||
0,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
G_TYPE_NONE,
|
||||
1,
|
||||
GDK_TYPE_MONITOR);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1941,9 +1984,8 @@ gdk_surface_get_geometry (GdkSurface *surface,
|
||||
*
|
||||
* Returns the width of the given @surface.
|
||||
*
|
||||
* On the X11 platform the returned size is the size reported in the
|
||||
* most-recently-processed configure event, rather than the current
|
||||
* size on the X server.
|
||||
* Surface size is reported in ”application pixels”, not
|
||||
* ”device pixels” (see gdk_surface_get_scale_factor()).
|
||||
*
|
||||
* Returns: The width of @surface
|
||||
*/
|
||||
@@ -1961,9 +2003,8 @@ gdk_surface_get_width (GdkSurface *surface)
|
||||
*
|
||||
* Returns the height of the given @surface.
|
||||
*
|
||||
* On the X11 platform the returned size is the size reported in the
|
||||
* most-recently-processed configure event, rather than the current
|
||||
* size on the X server.
|
||||
* Surface size is reported in ”application pixels”, not
|
||||
* ”device pixels” (see gdk_surface_get_scale_factor()).
|
||||
*
|
||||
* Returns: The height of @surface
|
||||
*/
|
||||
@@ -2742,6 +2783,18 @@ gdk_synthesize_surface_state (GdkSurface *surface,
|
||||
gdk_surface_set_state (surface, (surface->state | set_flags) & ~unset_flags);
|
||||
}
|
||||
|
||||
static void
|
||||
hide_popup_chain (GdkSurface *surface)
|
||||
{
|
||||
GdkSurface *parent;
|
||||
|
||||
gdk_surface_hide (surface);
|
||||
|
||||
parent = surface->parent;
|
||||
if (parent->autohide)
|
||||
hide_popup_chain (parent);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_autohide (GdkEvent *event)
|
||||
{
|
||||
@@ -2771,7 +2824,7 @@ check_autohide (GdkEvent *event)
|
||||
if (grab_surface != gdk_event_get_surface (event) &&
|
||||
grab_surface->autohide)
|
||||
{
|
||||
gdk_surface_hide (grab_surface);
|
||||
hide_popup_chain (grab_surface);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -2782,53 +2835,6 @@ check_autohide (GdkEvent *event)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_keyboard_event (GdkEvent *event)
|
||||
{
|
||||
switch ((guint) gdk_event_get_event_type (event))
|
||||
{
|
||||
case GDK_KEY_PRESS:
|
||||
case GDK_KEY_RELEASE:
|
||||
case GDK_FOCUS_CHANGE:
|
||||
return TRUE;
|
||||
default:;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static GdkEvent *
|
||||
rewrite_event_for_toplevel (GdkEvent *event)
|
||||
{
|
||||
GdkSurface *surface;
|
||||
|
||||
surface = gdk_event_get_surface (event);
|
||||
if (!surface->parent)
|
||||
return gdk_event_ref (event);
|
||||
|
||||
while (surface->parent)
|
||||
surface = surface->parent;
|
||||
|
||||
if (gdk_event_get_event_type (event) == GDK_FOCUS_CHANGE)
|
||||
return gdk_event_focus_new (surface,
|
||||
gdk_event_get_device (event),
|
||||
gdk_event_get_source_device (event),
|
||||
gdk_focus_event_get_in (event));
|
||||
else
|
||||
{
|
||||
return gdk_event_key_new (gdk_event_get_event_type (event),
|
||||
surface,
|
||||
gdk_event_get_device (event),
|
||||
gdk_event_get_source_device (event),
|
||||
gdk_event_get_time (event),
|
||||
gdk_key_event_get_keycode (event),
|
||||
gdk_event_get_modifier_state (event),
|
||||
gdk_key_event_is_modifier (event),
|
||||
&event->key.translated[0],
|
||||
&event->key.translated[1]);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
add_event_mark (GdkEvent *event,
|
||||
gint64 time,
|
||||
@@ -2846,7 +2852,7 @@ add_event_mark (GdkEvent *event,
|
||||
g_type_class_unref (class);
|
||||
kind = value ? value->value_nick : "event";
|
||||
|
||||
switch (event_type)
|
||||
switch ((int) event_type)
|
||||
{
|
||||
case GDK_MOTION_NOTIFY:
|
||||
{
|
||||
@@ -2938,21 +2944,16 @@ gdk_surface_handle_event (GdkEvent *event)
|
||||
|
||||
if (gdk_event_get_event_type (event) == GDK_CONFIGURE)
|
||||
{
|
||||
int width, height;
|
||||
|
||||
gdk_configure_event_get_size (event, &width, &height);
|
||||
g_signal_emit (gdk_event_get_surface (event), signals[SIZE_CHANGED], 0,
|
||||
event->configure.width, event->configure.height);
|
||||
width, height);
|
||||
handled = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkEvent *emitted;
|
||||
|
||||
if (is_keyboard_event (event))
|
||||
emitted = rewrite_event_for_toplevel (event);
|
||||
else
|
||||
emitted = gdk_event_ref (event);
|
||||
|
||||
g_signal_emit (gdk_event_get_surface (emitted), signals[EVENT], 0, emitted, &handled);
|
||||
gdk_event_unref (emitted);
|
||||
g_signal_emit (gdk_event_get_surface (event), signals[EVENT], 0, event, &handled);
|
||||
}
|
||||
|
||||
if (GDK_PROFILER_IS_RUNNING)
|
||||
@@ -3035,3 +3036,17 @@ gdk_surface_get_seat_from_event (GdkSurface *surface,
|
||||
}
|
||||
return gdk_display_get_default_seat (surface->display);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_surface_enter_monitor (GdkSurface *surface,
|
||||
GdkMonitor *monitor)
|
||||
{
|
||||
g_signal_emit (surface, signals[ENTER_MONITOR], 0, monitor);
|
||||
}
|
||||
|
||||
void
|
||||
gdk_surface_leave_monitor (GdkSurface *surface,
|
||||
GdkMonitor *monitor)
|
||||
{
|
||||
g_signal_emit (surface, signals[LEAVE_MONITOR], 0, monitor);
|
||||
}
|
||||
|
||||
@@ -38,44 +38,6 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/* Size restriction enumeration.
|
||||
*/
|
||||
/**
|
||||
* GdkSurfaceHints:
|
||||
* @GDK_HINT_POS: indicates that the program has positioned the surface
|
||||
* @GDK_HINT_MIN_SIZE: min size fields are set
|
||||
* @GDK_HINT_MAX_SIZE: max size fields are set
|
||||
* @GDK_HINT_BASE_SIZE: base size fields are set
|
||||
* @GDK_HINT_ASPECT: aspect ratio fields are set
|
||||
* @GDK_HINT_RESIZE_INC: resize increment fields are set
|
||||
* @GDK_HINT_WIN_GRAVITY: surface gravity field is set
|
||||
* @GDK_HINT_USER_POS: indicates that the surface’s position was explicitly set
|
||||
* by the user
|
||||
* @GDK_HINT_USER_SIZE: indicates that the surface’s size was explicitly set by
|
||||
* the user
|
||||
*
|
||||
* Used to indicate which fields of a #GdkGeometry struct should be paid
|
||||
* attention to. Also, the presence/absence of @GDK_HINT_POS,
|
||||
* @GDK_HINT_USER_POS, and @GDK_HINT_USER_SIZE is significant, though they don't
|
||||
* directly refer to #GdkGeometry fields. @GDK_HINT_USER_POS will be set
|
||||
* automatically by #GtkWindow if you call gtk_window_move().
|
||||
* @GDK_HINT_USER_POS and @GDK_HINT_USER_SIZE should be set if the user
|
||||
* specified a size/position using a --geometry command-line argument;
|
||||
* gtk_window_parse_geometry() automatically sets these flags.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
GDK_HINT_POS = 1 << 0,
|
||||
GDK_HINT_MIN_SIZE = 1 << 1,
|
||||
GDK_HINT_MAX_SIZE = 1 << 2,
|
||||
GDK_HINT_BASE_SIZE = 1 << 3,
|
||||
GDK_HINT_ASPECT = 1 << 4,
|
||||
GDK_HINT_RESIZE_INC = 1 << 5,
|
||||
GDK_HINT_WIN_GRAVITY = 1 << 6,
|
||||
GDK_HINT_USER_POS = 1 << 7,
|
||||
GDK_HINT_USER_SIZE = 1 << 8
|
||||
} GdkSurfaceHints;
|
||||
|
||||
/**
|
||||
* GdkSurfaceEdge:
|
||||
* @GDK_SURFACE_EDGE_NORTH_WEST: the top left corner.
|
||||
@@ -115,97 +77,6 @@ typedef enum
|
||||
GDK_FULLSCREEN_ON_ALL_MONITORS
|
||||
} GdkFullscreenMode;
|
||||
|
||||
/**
|
||||
* GdkGeometry:
|
||||
* @min_width: minimum width of surface (or -1 to use requisition, with
|
||||
* #GtkWindow only)
|
||||
* @min_height: minimum height of surface (or -1 to use requisition, with
|
||||
* #GtkWindow only)
|
||||
* @max_width: maximum width of surface (or -1 to use requisition, with
|
||||
* #GtkWindow only)
|
||||
* @max_height: maximum height of surface (or -1 to use requisition, with
|
||||
* #GtkWindow only)
|
||||
* @base_width: allowed surface widths are @base_width + @width_inc * N where N
|
||||
* is any integer (-1 allowed with #GtkWindow)
|
||||
* @base_height: allowed surface widths are @base_height + @height_inc * N where
|
||||
* N is any integer (-1 allowed with #GtkWindow)
|
||||
* @width_inc: width resize increment
|
||||
* @height_inc: height resize increment
|
||||
* @min_aspect: minimum width/height ratio
|
||||
* @max_aspect: maximum width/height ratio
|
||||
* @win_gravity: surface gravity, see gtk_window_set_gravity()
|
||||
*
|
||||
* The #GdkGeometry struct gives the window manager information about
|
||||
* a surface’s geometry constraints. Normally you would set these on
|
||||
* the GTK+ level using gtk_window_set_geometry_hints(). #GtkWindow
|
||||
* then sets the hints on the #GdkSurface it creates.
|
||||
*
|
||||
* gdk_surface_set_geometry_hints() expects the hints to be fully valid already
|
||||
* and simply passes them to the window manager; in contrast,
|
||||
* gtk_window_set_geometry_hints() performs some interpretation. For example,
|
||||
* #GtkWindow will apply the hints to the geometry widget instead of the
|
||||
* toplevel window, if you set a geometry widget. Also, the
|
||||
* @min_width/@min_height/@max_width/@max_height fields may be set to -1, and
|
||||
* #GtkWindow will substitute the size request of the surface or geometry widget.
|
||||
* If the minimum size hint is not provided, #GtkWindow will use its requisition
|
||||
* as the minimum size. If the minimum size is provided and a geometry widget is
|
||||
* set, #GtkWindow will take the minimum size as the minimum size of the
|
||||
* geometry widget rather than the entire surface. The base size is treated
|
||||
* similarly.
|
||||
*
|
||||
* The canonical use-case for gtk_window_set_geometry_hints() is to get a
|
||||
* terminal widget to resize properly. Here, the terminal text area should be
|
||||
* the geometry widget; #GtkWindow will then automatically set the base size to
|
||||
* the size of other widgets in the terminal window, such as the menubar and
|
||||
* scrollbar. Then, the @width_inc and @height_inc fields should be set to the
|
||||
* size of one character in the terminal. Finally, the base size should be set
|
||||
* to the size of one character. The net effect is that the minimum size of the
|
||||
* terminal will have a 1x1 character terminal area, and only terminal sizes on
|
||||
* the “character grid” will be allowed.
|
||||
*
|
||||
* Here’s an example of how the terminal example would be implemented, assuming
|
||||
* a terminal area widget called “terminal” and a toplevel window “toplevel”:
|
||||
*
|
||||
* |[<!-- language="C" -->
|
||||
* GdkGeometry hints;
|
||||
*
|
||||
* hints.base_width = terminal->char_width;
|
||||
* hints.base_height = terminal->char_height;
|
||||
* hints.min_width = terminal->char_width;
|
||||
* hints.min_height = terminal->char_height;
|
||||
* hints.width_inc = terminal->char_width;
|
||||
* hints.height_inc = terminal->char_height;
|
||||
*
|
||||
* gtk_window_set_geometry_hints (GTK_WINDOW (toplevel),
|
||||
* GTK_WIDGET (terminal),
|
||||
* &hints,
|
||||
* GDK_HINT_RESIZE_INC |
|
||||
* GDK_HINT_MIN_SIZE |
|
||||
* GDK_HINT_BASE_SIZE);
|
||||
* ]|
|
||||
*
|
||||
* The other useful fields are the @min_aspect and @max_aspect fields; these
|
||||
* contain a width/height ratio as a floating point number. If a geometry widget
|
||||
* is set, the aspect applies to the geometry widget rather than the entire
|
||||
* window. The most common use of these hints is probably to set @min_aspect and
|
||||
* @max_aspect to the same value, thus forcing the window to keep a constant
|
||||
* aspect ratio.
|
||||
*/
|
||||
struct _GdkGeometry
|
||||
{
|
||||
gint min_width;
|
||||
gint min_height;
|
||||
gint max_width;
|
||||
gint max_height;
|
||||
gint base_width;
|
||||
gint base_height;
|
||||
gint width_inc;
|
||||
gint height_inc;
|
||||
gdouble min_aspect;
|
||||
gdouble max_aspect;
|
||||
GdkGravity win_gravity;
|
||||
};
|
||||
|
||||
/**
|
||||
* GdkSurfaceState:
|
||||
* @GDK_SURFACE_STATE_WITHDRAWN: the surface is not shown
|
||||
@@ -362,14 +233,6 @@ void gdk_surface_freeze_updates (GdkSurface *surface);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_thaw_updates (GdkSurface *surface);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_constrain_size (GdkGeometry *geometry,
|
||||
GdkSurfaceHints flags,
|
||||
gint width,
|
||||
gint height,
|
||||
gint *new_width,
|
||||
gint *new_height);
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_surface_set_support_multidevice (GdkSurface *surface,
|
||||
gboolean support_multidevice);
|
||||
|
||||
@@ -61,6 +61,9 @@ G_DEFINE_BOXED_TYPE (GdkToplevelLayout, gdk_toplevel_layout,
|
||||
* Used together with gdk_toplevel_present() to describe
|
||||
* how a toplevel surface should be placed and behave on-screen.
|
||||
*
|
||||
* The size is in ”application pixels”, not
|
||||
* ”device pixels” (see gdk_surface_get_scale_factor()).
|
||||
*
|
||||
* Returns: (transfer full): newly created instance of #GdkToplevelLayout
|
||||
*/
|
||||
GdkToplevelLayout *
|
||||
|
||||
@@ -557,4 +557,26 @@ struct _GdkKeymapKey
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
/*< private >
|
||||
* GDK_EXTERN_VAR:
|
||||
*
|
||||
* A macro to annotate extern variables so that they show up properly in
|
||||
* Windows DLLs.
|
||||
*/
|
||||
#ifndef GDK_EXTERN_VAR
|
||||
# ifdef G_PLATFORM_WIN32
|
||||
# ifdef GTK_COMPILATION
|
||||
# ifdef DLL_EXPORT
|
||||
# define GDK_EXTERN_VAR __declspec(dllexport)
|
||||
# else /* !DLL_EXPORT */
|
||||
# define GDK_EXTERN_VAR extern
|
||||
# endif /* !DLL_EXPORT */
|
||||
# else /* !GTK_COMPILATION */
|
||||
# define GDK_EXTERN_VAR extern __declspec(dllimport)
|
||||
# endif /* !GTK_COMPILATION */
|
||||
# else /* !G_PLATFORM_WIN32 */
|
||||
# define GDK_EXTERN_VAR _GDK_EXTERN
|
||||
# endif /* !G_PLATFORM_WIN32 */
|
||||
#endif /* GDK_EXTERN_VAR */
|
||||
|
||||
#endif /* __GDK_TYPES_H__ */
|
||||
|
||||
+15
-1
@@ -97,7 +97,7 @@ gdk_vulkan_strerror (VkResult result)
|
||||
{
|
||||
/* If your compiler brought you here with a warning about missing
|
||||
* enumeration values, you're running a newer Vulkan version than
|
||||
* the GTK developers )or you are a GTK developer) and have
|
||||
* the GTK developers (or you are a GTK developer) and have
|
||||
* encountered a newly added Vulkan error message.
|
||||
* You want to add it to this enum now.
|
||||
*
|
||||
@@ -208,6 +208,20 @@ gdk_vulkan_strerror (VkResult result)
|
||||
#if VK_HEADER_VERSION >= 131
|
||||
case VK_ERROR_UNKNOWN:
|
||||
return "An unknown error has occurred; either the application has provided invalid input, or an implementation failure has occurred.";
|
||||
#endif
|
||||
#if VK_HEADER_VERSION >= 135
|
||||
case VK_ERROR_INCOMPATIBLE_VERSION_KHR:
|
||||
return "Acceleration structure serialized with version as the version information is not compatible with device.";
|
||||
case VK_THREAD_IDLE_KHR:
|
||||
return "A deferred operation is not complete but there is currently no work for this thread to do at the time of this call.";
|
||||
case VK_THREAD_DONE_KHR:
|
||||
return "A deferred operation is not complete but there is no work remaining to assign to additional threads.";
|
||||
case VK_OPERATION_DEFERRED_KHR:
|
||||
return "A deferred operation was requested and at least some of the work was deferred.";
|
||||
case VK_OPERATION_NOT_DEFERRED_KHR:
|
||||
return "A deferred operation was requested and no operations were deferred.";
|
||||
case VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT:
|
||||
return "A requested pipeline creation would have required compilation, but the application requested compilation to not be performed.";
|
||||
#endif
|
||||
case VK_RESULT_RANGE_SIZE:
|
||||
case VK_RESULT_MAX_ENUM:
|
||||
|
||||
@@ -25,7 +25,7 @@ srcdir = sys.argv[1]
|
||||
xml = '''<?xml version='1.0' encoding='UTF-8'?>
|
||||
<gresources>
|
||||
<gresource prefix='/org/gtk/libgdk'>
|
||||
|
||||
<file alias='cursor/default'>default_cursor.png</file>
|
||||
'''
|
||||
|
||||
def get_files(subdir,extension):
|
||||
|
||||
@@ -162,6 +162,8 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
int *height,
|
||||
int *scale)
|
||||
{
|
||||
GdkTexture *texture;
|
||||
|
||||
if (gdk_cursor_get_name (cursor))
|
||||
{
|
||||
struct wl_cursor *c;
|
||||
@@ -199,10 +201,12 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkTexture *texture = gdk_cursor_get_texture (cursor);
|
||||
cairo_surface_t *surface;
|
||||
struct wl_buffer *buffer;
|
||||
|
||||
texture = gdk_cursor_get_texture (cursor);
|
||||
|
||||
from_texture:
|
||||
surface = g_hash_table_lookup (display->cursor_surface_cache, cursor);
|
||||
if (surface == NULL)
|
||||
{
|
||||
@@ -241,6 +245,11 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
hotspot_x, hotspot_y,
|
||||
width, height,
|
||||
scale);
|
||||
else
|
||||
{
|
||||
texture = gdk_texture_new_from_resource ("/org/gtk/libgdk/cursor/default");
|
||||
goto from_texture;
|
||||
}
|
||||
|
||||
none:
|
||||
*hotspot_x = 0;
|
||||
|
||||
@@ -589,7 +589,7 @@ emulate_crossing (GdkSurface *surface,
|
||||
double x, y;
|
||||
|
||||
gdk_surface_get_device_position (surface, device, &x, &y, &state);
|
||||
event = gdk_event_crossing_new (type,
|
||||
event = gdk_crossing_event_new (type,
|
||||
surface,
|
||||
device,
|
||||
device,
|
||||
@@ -614,7 +614,7 @@ emulate_touch_crossing (GdkSurface *surface,
|
||||
{
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_crossing_new (type,
|
||||
event = gdk_crossing_event_new (type,
|
||||
surface,
|
||||
device,
|
||||
source,
|
||||
@@ -633,7 +633,7 @@ emulate_focus (GdkSurface *surface,
|
||||
gboolean focus_in,
|
||||
guint32 time_)
|
||||
{
|
||||
GdkEvent *event = gdk_event_focus_new (surface, device, device, focus_in);
|
||||
GdkEvent *event = gdk_focus_event_new (surface, device, device, focus_in);
|
||||
|
||||
_gdk_wayland_display_deliver_event (gdk_surface_get_display (surface), event);
|
||||
}
|
||||
@@ -1360,7 +1360,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
|
||||
GdkDevice *source;
|
||||
|
||||
source = get_scroll_device (seat, seat->pointer_info.frame.source);
|
||||
event = gdk_event_discrete_scroll_new (seat->pointer_info.focus,
|
||||
event = gdk_scroll_event_new_discrete (seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
source,
|
||||
NULL,
|
||||
@@ -1382,7 +1382,7 @@ flush_smooth_scroll_event (GdkWaylandSeat *seat,
|
||||
GdkDevice *source;
|
||||
|
||||
source = get_scroll_device (seat, seat->pointer_info.frame.source);
|
||||
event = gdk_event_scroll_new (seat->pointer_info.focus,
|
||||
event = gdk_scroll_event_new (seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
source,
|
||||
NULL,
|
||||
@@ -1498,7 +1498,7 @@ pointer_handle_enter (void *data,
|
||||
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
|
||||
seat->pointer_info.enter_serial = serial;
|
||||
|
||||
event = gdk_event_crossing_new (GDK_ENTER_NOTIFY,
|
||||
event = gdk_crossing_event_new (GDK_ENTER_NOTIFY,
|
||||
seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
@@ -1541,7 +1541,7 @@ pointer_handle_leave (void *data,
|
||||
|
||||
_gdk_wayland_display_update_serial (display_wayland, serial);
|
||||
|
||||
event = gdk_event_crossing_new (GDK_LEAVE_NOTIFY,
|
||||
event = gdk_crossing_event_new (GDK_LEAVE_NOTIFY,
|
||||
seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
@@ -1586,7 +1586,7 @@ pointer_handle_motion (void *data,
|
||||
seat->pointer_info.surface_x = wl_fixed_to_double (sx);
|
||||
seat->pointer_info.surface_y = wl_fixed_to_double (sy);
|
||||
|
||||
event = gdk_event_motion_new (seat->pointer_info.focus,
|
||||
event = gdk_motion_event_new (seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
NULL,
|
||||
@@ -1649,7 +1649,7 @@ pointer_handle_button (void *data,
|
||||
if (state)
|
||||
seat->pointer_info.press_serial = serial;
|
||||
|
||||
event = gdk_event_button_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE,
|
||||
event = gdk_button_event_new (state ? GDK_BUTTON_PRESS : GDK_BUTTON_RELEASE,
|
||||
seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
@@ -1914,7 +1914,7 @@ keyboard_handle_enter (void *data,
|
||||
g_object_ref (seat->keyboard_focus);
|
||||
seat->repeat_key = 0;
|
||||
|
||||
event = gdk_event_focus_new (seat->keyboard_focus,
|
||||
event = gdk_focus_event_new (seat->keyboard_focus,
|
||||
seat->master_keyboard,
|
||||
seat->keyboard,
|
||||
TRUE);
|
||||
@@ -1949,7 +1949,7 @@ keyboard_handle_leave (void *data,
|
||||
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
event = gdk_event_focus_new (seat->keyboard_focus,
|
||||
event = gdk_focus_event_new (seat->keyboard_focus,
|
||||
seat->master_keyboard,
|
||||
seat->keyboard,
|
||||
FALSE);
|
||||
@@ -2075,7 +2075,7 @@ deliver_key_event (GdkWaylandSeat *seat,
|
||||
no_lock = translated;
|
||||
}
|
||||
|
||||
event = gdk_event_key_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
|
||||
event = gdk_key_event_new (state ? GDK_KEY_PRESS : GDK_KEY_RELEASE,
|
||||
seat->keyboard_focus,
|
||||
seat->master_keyboard,
|
||||
seat->keyboard,
|
||||
@@ -2313,6 +2313,22 @@ gdk_wayland_seat_remove_touch (GdkWaylandSeat *seat,
|
||||
g_hash_table_remove (seat->touches, GUINT_TO_POINTER (id));
|
||||
}
|
||||
|
||||
void
|
||||
gdk_wayland_seat_clear_touchpoints (GdkWaylandSeat *seat,
|
||||
GdkSurface *surface)
|
||||
{
|
||||
GHashTableIter iter;
|
||||
GdkWaylandTouchData *touch;
|
||||
|
||||
g_hash_table_iter_init (&iter, seat->touches);
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
|
||||
{
|
||||
if (touch->surface == surface)
|
||||
g_hash_table_iter_remove (&iter);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
mimic_pointer_emulating_touch_info (GdkDevice *device,
|
||||
GdkWaylandTouchData *touch)
|
||||
@@ -2375,7 +2391,7 @@ touch_handle_down (void *data,
|
||||
touch->y = wl_fixed_to_double (y);
|
||||
touch->touch_down_serial = serial;
|
||||
|
||||
event = gdk_event_touch_new (GDK_TOUCH_BEGIN,
|
||||
event = gdk_touch_event_new (GDK_TOUCH_BEGIN,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
touch->surface,
|
||||
seat->touch_master,
|
||||
@@ -2418,7 +2434,7 @@ touch_handle_up (void *data,
|
||||
_gdk_wayland_display_update_serial (display, serial);
|
||||
|
||||
touch = gdk_wayland_seat_get_touch (seat, id);
|
||||
event = gdk_event_touch_new (GDK_TOUCH_END,
|
||||
event = gdk_touch_event_new (GDK_TOUCH_END,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
touch->surface,
|
||||
seat->touch_master,
|
||||
@@ -2463,7 +2479,7 @@ touch_handle_motion (void *data,
|
||||
if (touch->initial_touch)
|
||||
mimic_pointer_emulating_touch_info (seat->touch_master, touch);
|
||||
|
||||
event = gdk_event_touch_new (GDK_TOUCH_UPDATE,
|
||||
event = gdk_touch_event_new (GDK_TOUCH_UPDATE,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
touch->surface,
|
||||
seat->touch_master,
|
||||
@@ -2509,7 +2525,7 @@ touch_handle_cancel (void *data,
|
||||
|
||||
while (g_hash_table_iter_next (&iter, NULL, (gpointer *) &touch))
|
||||
{
|
||||
event = gdk_event_touch_new (GDK_TOUCH_CANCEL,
|
||||
event = gdk_touch_event_new (GDK_TOUCH_CANCEL,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
touch->surface,
|
||||
seat->touch_master,
|
||||
@@ -2541,7 +2557,7 @@ emit_gesture_swipe_event (GdkWaylandSeat *seat,
|
||||
|
||||
seat->pointer_info.time = _time;
|
||||
|
||||
event = gdk_event_touchpad_swipe_new (seat->pointer_info.focus,
|
||||
event = gdk_touchpad_event_new_swipe (seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
_time,
|
||||
@@ -2638,7 +2654,7 @@ emit_gesture_pinch_event (GdkWaylandSeat *seat,
|
||||
|
||||
seat->pointer_info.time = _time;
|
||||
|
||||
event = gdk_event_touchpad_pinch_new (seat->pointer_info.focus,
|
||||
event = gdk_touchpad_event_new_pinch (seat->pointer_info.focus,
|
||||
seat->master_pointer,
|
||||
seat->pointer,
|
||||
_time,
|
||||
@@ -3469,7 +3485,7 @@ tablet_tool_handle_proximity_in (void *data,
|
||||
gdk_wayland_device_tablet_clone_tool_axes (tablet, tool->tool);
|
||||
gdk_wayland_mimic_device_axes (tablet->master, tablet->current_device);
|
||||
|
||||
event = gdk_event_proximity_new (GDK_PROXIMITY_IN,
|
||||
event = gdk_proximity_event_new (GDK_PROXIMITY_IN,
|
||||
tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
@@ -3500,7 +3516,7 @@ tablet_tool_handle_proximity_out (void *data,
|
||||
g_message ("proximity out, seat %p, tool %d", tool->seat,
|
||||
gdk_device_tool_get_tool_type (tool->tool)));
|
||||
|
||||
event = gdk_event_proximity_new (GDK_PROXIMITY_OUT,
|
||||
event = gdk_proximity_event_new (GDK_PROXIMITY_OUT,
|
||||
tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
@@ -3537,7 +3553,7 @@ tablet_create_button_event_frame (GdkWaylandTabletData *tablet,
|
||||
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (tablet->seat);
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_button_new (evtype,
|
||||
event = gdk_button_event_new (evtype,
|
||||
tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
@@ -3603,7 +3619,7 @@ tablet_tool_handle_motion (void *data,
|
||||
tablet->pointer_info.surface_x,
|
||||
tablet->pointer_info.surface_y));
|
||||
|
||||
event = gdk_event_motion_new (tablet->pointer_info.focus,
|
||||
event = gdk_motion_event_new (tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
tool->tool,
|
||||
@@ -3765,7 +3781,7 @@ tablet_tool_handle_wheel (void *data,
|
||||
return;
|
||||
|
||||
/* Send smooth event */
|
||||
event = gdk_event_scroll_new (tablet->pointer_info.focus,
|
||||
event = gdk_scroll_event_new (tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
tablet->current_tool->tool,
|
||||
@@ -3777,7 +3793,7 @@ tablet_tool_handle_wheel (void *data,
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
|
||||
/* Send discrete event */
|
||||
event = gdk_event_discrete_scroll_new (tablet->pointer_info.focus,
|
||||
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
|
||||
tablet->master,
|
||||
tablet->current_device,
|
||||
tablet->current_tool->tool,
|
||||
@@ -3888,7 +3904,7 @@ tablet_pad_ring_handle_frame (void *data,
|
||||
GDK_SEAT_NOTE (seat, EVENTS,
|
||||
g_message ("tablet pad ring handle frame, ring = %p", wp_tablet_pad_ring));
|
||||
|
||||
event = gdk_event_pad_ring_new (seat->keyboard_focus,
|
||||
event = gdk_pad_event_new_ring (seat->keyboard_focus,
|
||||
pad->device,
|
||||
pad->device,
|
||||
time,
|
||||
@@ -3963,7 +3979,7 @@ tablet_pad_strip_handle_frame (void *data,
|
||||
g_message ("tablet pad strip handle frame, strip = %p",
|
||||
wp_tablet_pad_strip));
|
||||
|
||||
event = gdk_event_pad_strip_new (seat->keyboard_focus,
|
||||
event = gdk_pad_event_new_strip (seat->keyboard_focus,
|
||||
pad->device,
|
||||
pad->device,
|
||||
time,
|
||||
@@ -4089,7 +4105,7 @@ tablet_pad_group_handle_mode (void *data,
|
||||
group->current_mode = mode;
|
||||
n_group = g_list_index (pad->mode_groups, group);
|
||||
|
||||
event = gdk_event_pad_group_mode_new (seat->keyboard_focus,
|
||||
event = gdk_pad_event_new_group_mode (seat->keyboard_focus,
|
||||
pad->device,
|
||||
pad->device,
|
||||
time,
|
||||
@@ -4201,7 +4217,7 @@ tablet_pad_handle_button (void *data,
|
||||
g_assert (group != NULL);
|
||||
n_group = g_list_index (pad->mode_groups, group);
|
||||
|
||||
event = gdk_event_pad_button_new (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED
|
||||
event = gdk_pad_event_new_button (state == ZWP_TABLET_PAD_V2_BUTTON_STATE_PRESSED
|
||||
? GDK_PAD_BUTTON_PRESS
|
||||
: GDK_PAD_BUTTON_RELEASE,
|
||||
GDK_WAYLAND_SEAT (pad->seat)->keyboard_focus,
|
||||
@@ -5031,7 +5047,7 @@ gdk_wayland_device_unset_touch_grab (GdkDevice *gdk_device,
|
||||
GDK_CURRENT_TIME);
|
||||
}
|
||||
|
||||
event = gdk_event_touch_new (GDK_TOUCH_CANCEL,
|
||||
event = gdk_touch_event_new (GDK_TOUCH_CANCEL,
|
||||
GDK_SLOT_TO_EVENT_SEQUENCE (touch->id),
|
||||
touch->surface,
|
||||
seat->touch_master,
|
||||
|
||||
@@ -431,6 +431,7 @@ gdk_registry_handle_global (void *data,
|
||||
else if (strcmp (interface, "xdg_wm_base") == 0)
|
||||
{
|
||||
display_wayland->xdg_wm_base_id = id;
|
||||
display_wayland->xdg_wm_base_version = version;
|
||||
}
|
||||
else if (strcmp (interface, "zxdg_shell_v6") == 0)
|
||||
{
|
||||
@@ -659,7 +660,8 @@ _gdk_wayland_display_open (const gchar *display_name)
|
||||
display_wayland->xdg_wm_base =
|
||||
wl_registry_bind (display_wayland->wl_registry,
|
||||
display_wayland->xdg_wm_base_id,
|
||||
&xdg_wm_base_interface, 1);
|
||||
&xdg_wm_base_interface,
|
||||
MIN (display_wayland->xdg_wm_base_version, 3));
|
||||
xdg_wm_base_add_listener (display_wayland->xdg_wm_base,
|
||||
&xdg_wm_base_listener,
|
||||
display_wayland);
|
||||
@@ -2537,6 +2539,13 @@ get_monitor_for_output (GdkWaylandDisplay *display_wayland,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
GdkMonitor *
|
||||
gdk_wayland_display_get_monitor_for_output (GdkDisplay *display,
|
||||
struct wl_output *output)
|
||||
{
|
||||
return (GdkMonitor *)get_monitor_for_output (GDK_WAYLAND_DISPLAY (display), output);
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_display_remove_output (GdkWaylandDisplay *display_wayland,
|
||||
guint32 id)
|
||||
|
||||
@@ -86,6 +86,7 @@ struct _GdkWaylandDisplay
|
||||
guint32 serial;
|
||||
|
||||
uint32_t xdg_wm_base_id;
|
||||
int xdg_wm_base_version;
|
||||
uint32_t zxdg_shell_v6_id;
|
||||
GdkWaylandShellVariant shell_variant;
|
||||
|
||||
|
||||
@@ -163,6 +163,8 @@ guint32 gdk_wayland_display_get_output_scale (GdkWaylandDisplay *display_wayland
|
||||
struct wl_output *output);
|
||||
struct wl_output *gdk_wayland_display_get_wl_output (GdkDisplay *display,
|
||||
int monitor_num);
|
||||
GdkMonitor *gdk_wayland_display_get_monitor_for_output (GdkDisplay *display,
|
||||
struct wl_output *output);
|
||||
|
||||
void _gdk_wayland_surface_set_grab_seat (GdkSurface *surface,
|
||||
GdkSeat *seat);
|
||||
|
||||
@@ -43,4 +43,7 @@ GType gdk_wayland_seat_get_type (void) G_GNUC_CONST;
|
||||
|
||||
void gdk_wayland_seat_update_cursor_scale (GdkWaylandSeat *seat);
|
||||
|
||||
void gdk_wayland_seat_clear_touchpoints (GdkWaylandSeat *seat,
|
||||
GdkSurface *surface);
|
||||
|
||||
#endif /* __GDK_WAYLAND_SEAT_H__ */
|
||||
|
||||
+263
-113
@@ -59,6 +59,7 @@ static guint signals[LAST_SIGNAL];
|
||||
typedef enum _PopupState
|
||||
{
|
||||
POPUP_STATE_IDLE,
|
||||
POPUP_STATE_WAITING_FOR_REPOSITIONED,
|
||||
POPUP_STATE_WAITING_FOR_CONFIGURE,
|
||||
POPUP_STATE_WAITING_FOR_FRAME,
|
||||
} PopupState;
|
||||
@@ -94,6 +95,9 @@ struct _GdkWaylandSurface
|
||||
EGLSurface egl_surface;
|
||||
EGLSurface dummy_egl_surface;
|
||||
|
||||
uint32_t reposition_token;
|
||||
uint32_t received_reposition_token;
|
||||
|
||||
PopupState popup_state;
|
||||
|
||||
unsigned int initial_configure_received : 1;
|
||||
@@ -103,8 +107,6 @@ struct _GdkWaylandSurface
|
||||
unsigned int awaiting_frame_frozen : 1;
|
||||
unsigned int is_drag_surface : 1;
|
||||
GdkSurfaceTypeHint hint;
|
||||
GdkSurface *transient_for;
|
||||
GdkSurface *popup_parent;
|
||||
|
||||
int pending_buffer_offset_x;
|
||||
int pending_buffer_offset_y;
|
||||
@@ -167,12 +169,18 @@ struct _GdkWaylandSurface
|
||||
int y;
|
||||
int width;
|
||||
int height;
|
||||
uint32_t repositioned_token;
|
||||
gboolean has_repositioned_token;
|
||||
} popup;
|
||||
|
||||
gboolean is_initial_configure;
|
||||
|
||||
uint32_t serial;
|
||||
gboolean is_dirty;
|
||||
} pending;
|
||||
|
||||
uint32_t last_configure_serial;
|
||||
|
||||
int state_freeze_count;
|
||||
|
||||
struct {
|
||||
@@ -190,6 +198,76 @@ struct _GdkWaylandSurfaceClass
|
||||
GdkSurfaceClass parent_class;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandSurface, gdk_wayland_surface, GDK_TYPE_SURFACE)
|
||||
|
||||
typedef struct _GdkWaylandToplevel GdkWaylandToplevel;
|
||||
struct _GdkWaylandToplevel
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
|
||||
GdkWaylandToplevel *transient_for;
|
||||
};
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandToplevelClass;
|
||||
|
||||
static void gdk_wayland_toplevel_iface_init (GdkToplevelInterface *iface);
|
||||
|
||||
GType gdk_wayland_toplevel_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#define GDK_IS_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_TOPLEVEL))
|
||||
#define GDK_WAYLAND_TOPLEVEL(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_TOPLEVEL, GdkWaylandToplevel))
|
||||
|
||||
#define GDK_TYPE_WAYLAND_TOPLEVEL (gdk_wayland_toplevel_get_type ())
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandToplevel, gdk_wayland_toplevel, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_TOPLEVEL,
|
||||
gdk_wayland_toplevel_iface_init))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
} GdkWaylandPopup;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandPopupClass;
|
||||
|
||||
static void gdk_wayland_popup_iface_init (GdkPopupInterface *iface);
|
||||
|
||||
GType gdk_wayland_popup_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#define GDK_IS_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_POPUP))
|
||||
#define GDK_WAYLAND_POPUP(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GDK_TYPE_WAYLAND_POPUP, GdkWaylandPopup))
|
||||
|
||||
#define GDK_TYPE_WAYLAND_POPUP (gdk_wayland_popup_get_type ())
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandPopup, gdk_wayland_popup, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_POPUP,
|
||||
gdk_wayland_popup_iface_init))
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
} GdkWaylandDragSurface;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandDragSurfaceClass;
|
||||
|
||||
static void gdk_wayland_drag_surface_iface_init (GdkDragSurfaceInterface *iface);
|
||||
|
||||
GType gdk_wayland_drag_surface_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#define GDK_IS_WAYLAND_DRAG_SURFACE(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), GDK_TYPE_WAYLAND_DRAG_SURFACE))
|
||||
|
||||
#define GDK_TYPE_WAYLAND_DRAG_SURFACE (gdk_wayland_drag_surface_get_type ())
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandDragSurface, gdk_wayland_drag_surface, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_DRAG_SURFACE,
|
||||
gdk_wayland_drag_surface_iface_init))
|
||||
|
||||
static void gdk_wayland_surface_maybe_resize (GdkSurface *surface,
|
||||
int width,
|
||||
int height,
|
||||
@@ -221,16 +299,6 @@ static void update_popup_layout_state (GdkSurface *surface,
|
||||
|
||||
static gboolean gdk_wayland_surface_is_exported (GdkSurface *surface);
|
||||
|
||||
G_DEFINE_TYPE (GdkWaylandSurface, gdk_wayland_surface, GDK_TYPE_SURFACE)
|
||||
|
||||
GType gdk_wayland_toplevel_get_type (void) G_GNUC_CONST;
|
||||
GType gdk_wayland_popup_get_type (void) G_GNUC_CONST;
|
||||
GType gdk_wayland_drag_surface_get_type (void) G_GNUC_CONST;
|
||||
|
||||
#define GDK_TYPE_WAYLAND_TOPLEVEL (gdk_wayland_toplevel_get_type ())
|
||||
#define GDK_TYPE_WAYLAND_POPUP (gdk_wayland_popup_get_type ())
|
||||
#define GDK_TYPE_WAYLAND_DRAG_SURFACE (gdk_wayland_drag_surface_get_type ())
|
||||
|
||||
static void
|
||||
gdk_wayland_surface_init (GdkWaylandSurface *impl)
|
||||
{
|
||||
@@ -438,6 +506,7 @@ frame_callback (void *data,
|
||||
switch (impl->popup_state)
|
||||
{
|
||||
case POPUP_STATE_IDLE:
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
case POPUP_STATE_WAITING_FOR_CONFIGURE:
|
||||
break;
|
||||
case POPUP_STATE_WAITING_FOR_FRAME:
|
||||
@@ -632,6 +701,9 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
|
||||
"display", display,
|
||||
"frame-clock", frame_clock,
|
||||
NULL);
|
||||
display_wayland->toplevels = g_list_prepend (display_wayland->toplevels,
|
||||
surface);
|
||||
g_warn_if_fail (!parent);
|
||||
break;
|
||||
case GDK_SURFACE_POPUP:
|
||||
surface = g_object_new (GDK_TYPE_WAYLAND_POPUP,
|
||||
@@ -678,10 +750,6 @@ _gdk_wayland_display_create_surface (GdkDisplay *display,
|
||||
|
||||
gdk_wayland_surface_set_title (surface, get_default_title ());
|
||||
|
||||
if (parent == NULL)
|
||||
display_wayland->toplevels = g_list_prepend (display_wayland->toplevels, surface);
|
||||
|
||||
impl->transient_for = parent;
|
||||
|
||||
gdk_wayland_surface_create_surface (surface);
|
||||
|
||||
@@ -772,8 +840,6 @@ gdk_wayland_surface_dispose (GObject *object)
|
||||
|
||||
impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
g_clear_object (&impl->popup_parent);
|
||||
|
||||
if (impl->event_queue)
|
||||
{
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
@@ -825,7 +891,7 @@ gdk_wayland_surface_resize (GdkSurface *surface,
|
||||
GdkDisplay *display;
|
||||
GdkEvent *event;
|
||||
|
||||
event = gdk_event_configure_new (surface, width, height);
|
||||
event = gdk_configure_event_new (surface, width, height);
|
||||
|
||||
gdk_wayland_surface_update_size (surface, width, height, scale);
|
||||
_gdk_surface_update_size (surface);
|
||||
@@ -903,6 +969,7 @@ gdk_wayland_surface_sync_parent (GdkSurface *surface,
|
||||
GdkSurface *parent)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkWaylandToplevel *toplevel = GDK_WAYLAND_TOPLEVEL (impl);
|
||||
GdkWaylandDisplay *display_wayland =
|
||||
GDK_WAYLAND_DISPLAY (gdk_surface_get_display (surface));
|
||||
GdkWaylandSurface *impl_parent = NULL;
|
||||
@@ -913,8 +980,8 @@ gdk_wayland_surface_sync_parent (GdkSurface *surface,
|
||||
if (!is_realized_toplevel (surface))
|
||||
return;
|
||||
|
||||
if (impl->transient_for)
|
||||
impl_parent = GDK_WAYLAND_SURFACE (impl->transient_for);
|
||||
if (toplevel->transient_for)
|
||||
impl_parent = GDK_WAYLAND_SURFACE (toplevel->transient_for);
|
||||
else if (parent)
|
||||
impl_parent = GDK_WAYLAND_SURFACE (parent);
|
||||
|
||||
@@ -1134,6 +1201,8 @@ surface_enter (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkMonitor *monitor;
|
||||
|
||||
GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
|
||||
g_message ("surface enter, surface %p output %p", surface, output));
|
||||
@@ -1141,6 +1210,9 @@ surface_enter (void *data,
|
||||
impl->display_server.outputs = g_slist_prepend (impl->display_server.outputs, output);
|
||||
|
||||
gdk_wayland_surface_update_scale (surface);
|
||||
|
||||
monitor = gdk_wayland_display_get_monitor_for_output (display, output);
|
||||
gdk_surface_enter_monitor (surface, monitor);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -1150,6 +1222,8 @@ surface_leave (void *data,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkMonitor *monitor;
|
||||
|
||||
GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
|
||||
g_message ("surface leave, surface %p output %p", surface, output));
|
||||
@@ -1158,6 +1232,9 @@ surface_leave (void *data,
|
||||
|
||||
if (impl->display_server.outputs)
|
||||
gdk_wayland_surface_update_scale (surface);
|
||||
|
||||
monitor = gdk_wayland_display_get_monitor_for_output (display, output);
|
||||
gdk_surface_leave_monitor (surface, monitor);
|
||||
}
|
||||
|
||||
static const struct wl_surface_listener surface_listener = {
|
||||
@@ -1282,8 +1359,17 @@ gdk_wayland_surface_configure_popup (GdkSurface *surface)
|
||||
impl->pending.serial);
|
||||
}
|
||||
|
||||
if (impl->pending.popup.has_repositioned_token)
|
||||
impl->received_reposition_token = impl->pending.popup.repositioned_token;
|
||||
|
||||
switch (impl->popup_state)
|
||||
{
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
if (impl->received_reposition_token != impl->reposition_token)
|
||||
return;
|
||||
else
|
||||
gdk_surface_thaw_updates (surface);
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case POPUP_STATE_WAITING_FOR_CONFIGURE:
|
||||
impl->popup_state = POPUP_STATE_WAITING_FOR_FRAME;
|
||||
break;
|
||||
@@ -1306,6 +1392,10 @@ gdk_wayland_surface_configure_popup (GdkSurface *surface)
|
||||
width, height,
|
||||
impl->popup.layout);
|
||||
|
||||
if (!impl->pending.popup.has_repositioned_token &&
|
||||
!impl->pending.is_initial_configure)
|
||||
g_signal_emit_by_name (surface, "popup-layout-changed");
|
||||
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
|
||||
@@ -1318,6 +1408,7 @@ gdk_wayland_surface_configure (GdkSurface *surface)
|
||||
{
|
||||
gdk_surface_thaw_updates (surface);
|
||||
impl->initial_configure_received = TRUE;
|
||||
impl->pending.is_initial_configure = TRUE;
|
||||
}
|
||||
|
||||
if (is_realized_popup (surface))
|
||||
@@ -1327,6 +1418,8 @@ gdk_wayland_surface_configure (GdkSurface *surface)
|
||||
else
|
||||
g_warn_if_reached ();
|
||||
|
||||
impl->last_configure_serial = impl->pending.serial;
|
||||
|
||||
memset (&impl->pending, 0, sizeof (impl->pending));
|
||||
}
|
||||
|
||||
@@ -1368,7 +1461,7 @@ gdk_wayland_surface_handle_close (GdkSurface *surface)
|
||||
|
||||
GDK_DISPLAY_NOTE (display, EVENTS, g_message ("close %p", surface));
|
||||
|
||||
event = gdk_event_delete_new (surface);
|
||||
event = gdk_delete_event_new (surface);
|
||||
|
||||
_gdk_wayland_display_deliver_event (display, event);
|
||||
}
|
||||
@@ -1663,9 +1756,31 @@ xdg_popup_done (void *data,
|
||||
gdk_surface_hide (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_popup_repositioned (void *data,
|
||||
struct xdg_popup *xdg_popup,
|
||||
uint32_t token)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
GDK_DISPLAY_NOTE (gdk_surface_get_display (surface), EVENTS,
|
||||
g_message ("repositioned %p", surface));
|
||||
|
||||
if (impl->popup_state != POPUP_STATE_WAITING_FOR_REPOSITIONED)
|
||||
{
|
||||
g_warning ("Unexpected xdg_popup.repositioned event, probably buggy compositor");
|
||||
return;
|
||||
}
|
||||
|
||||
impl->pending.popup.repositioned_token = token;
|
||||
impl->pending.popup.has_repositioned_token = TRUE;
|
||||
}
|
||||
|
||||
static const struct xdg_popup_listener xdg_popup_listener = {
|
||||
xdg_popup_configure,
|
||||
xdg_popup_done,
|
||||
xdg_popup_repositioned,
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -2052,7 +2167,8 @@ static gpointer
|
||||
create_dynamic_positioner (GdkSurface *surface,
|
||||
int width,
|
||||
int height,
|
||||
GdkPopupLayout *layout)
|
||||
GdkPopupLayout *layout,
|
||||
gboolean ack_parent_configure)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkSurface *parent = surface->parent;
|
||||
@@ -2129,6 +2245,30 @@ create_dynamic_positioner (GdkSurface *surface,
|
||||
xdg_positioner_set_constraint_adjustment (positioner,
|
||||
constraint_adjustment);
|
||||
|
||||
if (xdg_positioner_get_version (positioner) >=
|
||||
XDG_POSITIONER_SET_REACTIVE_SINCE_VERSION)
|
||||
xdg_positioner_set_reactive (positioner);
|
||||
|
||||
if (ack_parent_configure &&
|
||||
xdg_positioner_get_version (positioner) >=
|
||||
XDG_POSITIONER_SET_PARENT_CONFIGURE_SINCE_VERSION)
|
||||
{
|
||||
GdkWaylandSurface *parent_impl = GDK_WAYLAND_SURFACE (parent);
|
||||
int parent_width;
|
||||
int parent_height;
|
||||
|
||||
parent_width = parent->width - (parent_impl->margin_left +
|
||||
parent_impl->margin_right);
|
||||
parent_height = parent->height - (parent_impl->margin_top +
|
||||
parent_impl->margin_bottom);
|
||||
|
||||
xdg_positioner_set_parent_size (positioner,
|
||||
parent_width,
|
||||
parent_height);
|
||||
xdg_positioner_set_parent_configure (positioner,
|
||||
parent_impl->last_configure_serial);
|
||||
}
|
||||
|
||||
return positioner;
|
||||
}
|
||||
case GDK_WAYLAND_SHELL_VARIANT_ZXDG_SHELL_V6:
|
||||
@@ -2194,7 +2334,7 @@ can_map_grabbing_popup (GdkSurface *surface,
|
||||
return top_most_popup == parent;
|
||||
}
|
||||
|
||||
static void
|
||||
static gboolean
|
||||
gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
|
||||
GdkSurface *parent,
|
||||
GdkWaylandSeat *grab_input_seat,
|
||||
@@ -2208,32 +2348,32 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
|
||||
gpointer positioner;
|
||||
|
||||
if (!impl->display_server.wl_surface)
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
if (!is_realized_shell_surface (parent))
|
||||
return;
|
||||
return FALSE;
|
||||
|
||||
if (is_realized_toplevel (surface))
|
||||
{
|
||||
g_warning ("Can't map popup, already mapped as toplevel");
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
if (is_realized_popup (surface))
|
||||
{
|
||||
g_warning ("Can't map popup, already mapped");
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (grab_input_seat &&
|
||||
!can_map_grabbing_popup (surface, parent))
|
||||
{
|
||||
g_warning ("Tried to map a grabbing popup with a non-top most parent");
|
||||
return;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_surface_freeze_updates (surface);
|
||||
|
||||
positioner = create_dynamic_positioner (surface, width, height, layout);
|
||||
positioner = create_dynamic_positioner (surface, width, height, layout, FALSE);
|
||||
|
||||
switch (display->shell_variant)
|
||||
{
|
||||
@@ -2307,13 +2447,14 @@ gdk_wayland_surface_create_xdg_popup (GdkSurface *surface,
|
||||
freeze_popup_toplevel_state (surface);
|
||||
}
|
||||
|
||||
g_set_object (&impl->popup_parent, parent);
|
||||
display->current_popups = g_list_append (display->current_popups, surface);
|
||||
if (grab_input_seat)
|
||||
{
|
||||
display->current_grabbing_popups =
|
||||
g_list_prepend (display->current_grabbing_popups, surface);
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GdkWaylandSeat *
|
||||
@@ -2396,9 +2537,8 @@ unmap_popups_for_surface (GdkSurface *surface)
|
||||
for (l = display_wayland->current_popups; l; l = l->next)
|
||||
{
|
||||
GdkSurface *popup = l->data;
|
||||
GdkWaylandSurface *popup_impl = GDK_WAYLAND_SURFACE (popup);
|
||||
|
||||
if (popup_impl->popup_parent == surface)
|
||||
if (popup->parent == surface)
|
||||
{
|
||||
g_warning ("Tried to unmap the parent of a popup");
|
||||
gdk_surface_hide (popup);
|
||||
@@ -2501,6 +2641,9 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
|
||||
{
|
||||
switch (impl->popup_state)
|
||||
{
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
gdk_surface_thaw_updates (surface);
|
||||
G_GNUC_FALLTHROUGH;
|
||||
case POPUP_STATE_WAITING_FOR_CONFIGURE:
|
||||
case POPUP_STATE_WAITING_FOR_FRAME:
|
||||
thaw_popup_toplevel_state (surface);
|
||||
@@ -2540,6 +2683,14 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
|
||||
static void
|
||||
gdk_wayland_surface_hide (GdkSurface *surface)
|
||||
{
|
||||
GdkSeat *seat;
|
||||
|
||||
seat = gdk_display_get_default_seat (surface->display);
|
||||
|
||||
if (surface->autohide)
|
||||
gdk_seat_ungrab (seat);
|
||||
|
||||
gdk_wayland_seat_clear_touchpoints (GDK_WAYLAND_SEAT (seat), surface);
|
||||
gdk_wayland_surface_hide_surface (surface);
|
||||
_gdk_surface_clear_update_area (surface);
|
||||
}
|
||||
@@ -2602,6 +2753,7 @@ do_queue_relayout (GdkSurface *surface,
|
||||
GdkPopupLayout *layout)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
struct xdg_positioner *positioner;
|
||||
|
||||
g_assert (is_realized_popup (surface));
|
||||
g_assert (impl->popup_state == POPUP_STATE_IDLE ||
|
||||
@@ -2612,7 +2764,41 @@ do_queue_relayout (GdkSurface *surface,
|
||||
impl->popup.unconstrained_width = width;
|
||||
impl->popup.unconstrained_height = height;
|
||||
|
||||
queue_relayout_fallback (surface, layout);
|
||||
if (!impl->display_server.xdg_popup ||
|
||||
xdg_popup_get_version (impl->display_server.xdg_popup) <
|
||||
XDG_POPUP_REPOSITION_SINCE_VERSION)
|
||||
{
|
||||
g_warning_once ("Compositor doesn't support moving popups, "
|
||||
"relying on remapping");
|
||||
queue_relayout_fallback (surface, layout);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
positioner = create_dynamic_positioner (surface,
|
||||
width, height, layout,
|
||||
TRUE);
|
||||
xdg_popup_reposition (impl->display_server.xdg_popup,
|
||||
positioner,
|
||||
++impl->reposition_token);
|
||||
xdg_positioner_destroy (positioner);
|
||||
|
||||
gdk_surface_freeze_updates (surface);
|
||||
|
||||
switch (impl->popup_state)
|
||||
{
|
||||
case POPUP_STATE_IDLE:
|
||||
freeze_popup_toplevel_state (surface);
|
||||
break;
|
||||
case POPUP_STATE_WAITING_FOR_FRAME:
|
||||
break;
|
||||
case POPUP_STATE_WAITING_FOR_CONFIGURE:
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
}
|
||||
|
||||
impl->popup_state = POPUP_STATE_WAITING_FOR_REPOSITIONED;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -2623,6 +2809,9 @@ is_relayout_finished (GdkSurface *surface)
|
||||
if (!impl->initial_configure_received)
|
||||
return FALSE;
|
||||
|
||||
if (impl->reposition_token != impl->received_reposition_token)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
@@ -2648,11 +2837,13 @@ gdk_wayland_surface_map_popup (GdkSurface *surface,
|
||||
grab_input_seat = find_grab_input_seat (surface, parent);
|
||||
else
|
||||
grab_input_seat = NULL;
|
||||
gdk_wayland_surface_create_xdg_popup (surface,
|
||||
parent,
|
||||
grab_input_seat,
|
||||
width, height,
|
||||
layout);
|
||||
|
||||
if (!gdk_wayland_surface_create_xdg_popup (surface,
|
||||
parent,
|
||||
grab_input_seat,
|
||||
width, height,
|
||||
layout))
|
||||
return;
|
||||
|
||||
impl->popup.layout = gdk_popup_layout_copy (layout);
|
||||
impl->popup.unconstrained_width = width;
|
||||
@@ -2707,6 +2898,7 @@ reposition_popup (GdkSurface *surface,
|
||||
case POPUP_STATE_WAITING_FOR_FRAME:
|
||||
do_queue_relayout (surface, width, height, layout);
|
||||
break;
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
case POPUP_STATE_WAITING_FOR_CONFIGURE:
|
||||
g_warn_if_reached ();
|
||||
break;
|
||||
@@ -3172,44 +3364,46 @@ gdk_wayland_surface_set_startup_id (GdkSurface *surface,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
check_transient_for_loop (GdkSurface *surface,
|
||||
GdkSurface *parent)
|
||||
check_transient_for_loop (GdkWaylandToplevel *toplevel,
|
||||
GdkWaylandToplevel *parent)
|
||||
{
|
||||
while (parent)
|
||||
{
|
||||
GdkWaylandSurface *impl;
|
||||
|
||||
if (!GDK_IS_WAYLAND_SURFACE (parent))
|
||||
return FALSE;
|
||||
|
||||
impl = GDK_WAYLAND_SURFACE (parent);
|
||||
if (impl->transient_for == surface)
|
||||
if (parent->transient_for == toplevel)
|
||||
return TRUE;
|
||||
parent = impl->transient_for;
|
||||
parent = parent->transient_for;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_wayland_surface_set_transient_for (GdkSurface *surface,
|
||||
GdkSurface *parent)
|
||||
gdk_wayland_toplevel_set_transient_for (GdkWaylandToplevel *toplevel,
|
||||
GdkSurface *parent)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
g_return_if_fail (!parent || GDK_IS_WAYLAND_TOPLEVEL (parent));
|
||||
g_return_if_fail (!parent ||
|
||||
gdk_surface_get_display (GDK_SURFACE (toplevel)) == gdk_surface_get_display (parent));
|
||||
|
||||
g_assert (parent == NULL ||
|
||||
gdk_surface_get_display (surface) == gdk_surface_get_display (parent));
|
||||
|
||||
if (check_transient_for_loop (surface, parent))
|
||||
if (parent)
|
||||
{
|
||||
g_warning ("Setting %p transient for %p would create a loop", surface, parent);
|
||||
return;
|
||||
GdkWaylandToplevel *parent_toplevel = GDK_WAYLAND_TOPLEVEL (parent);
|
||||
|
||||
if (check_transient_for_loop (toplevel, parent_toplevel))
|
||||
{
|
||||
g_warning ("Setting %p transient for %p would create a loop",
|
||||
toplevel, parent);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
unset_transient_for_exported (surface);
|
||||
unset_transient_for_exported (GDK_SURFACE (toplevel));
|
||||
|
||||
impl->transient_for = parent;
|
||||
if (parent)
|
||||
toplevel->transient_for = GDK_WAYLAND_TOPLEVEL (parent);
|
||||
else
|
||||
toplevel->transient_for = NULL;
|
||||
|
||||
gdk_wayland_surface_sync_parent (surface, NULL);
|
||||
gdk_wayland_surface_sync_parent (GDK_SURFACE (toplevel), NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -3635,7 +3829,8 @@ gdk_wayland_surface_show_window_menu (GdkSurface *surface,
|
||||
double x, y;
|
||||
uint32_t serial;
|
||||
|
||||
switch ((guint) event->any.type)
|
||||
GdkEventType event_type = gdk_event_get_event_type (event);
|
||||
switch ((guint) event_type)
|
||||
{
|
||||
case GDK_BUTTON_PRESS:
|
||||
case GDK_BUTTON_RELEASE:
|
||||
@@ -4097,7 +4292,7 @@ gdk_wayland_surface_set_transient_for_exported (GdkSurface *surface,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gdk_wayland_surface_set_transient_for (surface, NULL);
|
||||
gdk_wayland_toplevel_set_transient_for (GDK_WAYLAND_TOPLEVEL (impl), NULL);
|
||||
|
||||
impl->imported_transient_for =
|
||||
zxdg_importer_v1_import (display_wayland->xdg_importer, parent_handle_str);
|
||||
@@ -4169,22 +4364,6 @@ create_dnd_surface (GdkDisplay *display)
|
||||
|
||||
#define LAST_PROP 1
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
} GdkWaylandPopup;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandPopupClass;
|
||||
|
||||
static void gdk_wayland_popup_iface_init (GdkPopupInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandPopup, gdk_wayland_popup, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_POPUP,
|
||||
gdk_wayland_popup_iface_init))
|
||||
|
||||
static void
|
||||
gdk_wayland_popup_init (GdkWaylandPopup *popup)
|
||||
{
|
||||
@@ -4294,22 +4473,6 @@ gdk_wayland_popup_iface_init (GdkPopupInterface *iface)
|
||||
iface->get_position_y = gdk_wayland_popup_get_position_y;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
} GdkWaylandToplevel;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandToplevelClass;
|
||||
|
||||
static void gdk_wayland_toplevel_iface_init (GdkToplevelInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandToplevel, gdk_wayland_toplevel, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_TOPLEVEL,
|
||||
gdk_wayland_toplevel_iface_init))
|
||||
|
||||
static void
|
||||
gdk_wayland_toplevel_init (GdkWaylandToplevel *toplevel)
|
||||
{
|
||||
@@ -4322,6 +4485,7 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (object);
|
||||
GdkWaylandToplevel *toplevel = GDK_WAYLAND_TOPLEVEL (surface);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -4336,7 +4500,8 @@ gdk_wayland_toplevel_set_property (GObject *object,
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_TRANSIENT_FOR:
|
||||
gdk_wayland_surface_set_transient_for (surface, g_value_get_object (value));
|
||||
gdk_wayland_toplevel_set_transient_for (toplevel,
|
||||
g_value_get_object (value));
|
||||
g_object_notify_by_pspec (G_OBJECT (surface), pspec);
|
||||
break;
|
||||
|
||||
@@ -4376,6 +4541,7 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (object);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkWaylandToplevel *toplevel = GDK_WAYLAND_TOPLEVEL (surface);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
@@ -4392,7 +4558,7 @@ gdk_wayland_toplevel_get_property (GObject *object,
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_TRANSIENT_FOR:
|
||||
g_value_set_object (value, impl->transient_for);
|
||||
g_value_set_object (value, toplevel->transient_for);
|
||||
break;
|
||||
|
||||
case LAST_PROP + GDK_TOPLEVEL_PROP_MODAL:
|
||||
@@ -4617,22 +4783,6 @@ gdk_wayland_toplevel_iface_init (GdkToplevelInterface *iface)
|
||||
iface->restore_system_shortcuts = gdk_wayland_toplevel_restore_system_shortcuts;
|
||||
}
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurface parent_instance;
|
||||
} GdkWaylandDragSurface;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
GdkWaylandSurfaceClass parent_class;
|
||||
} GdkWaylandDragSurfaceClass;
|
||||
|
||||
static void gdk_wayland_drag_surface_iface_init (GdkDragSurfaceInterface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GdkWaylandDragSurface, gdk_wayland_drag_surface, GDK_TYPE_WAYLAND_SURFACE,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_DRAG_SURFACE,
|
||||
gdk_wayland_drag_surface_iface_init))
|
||||
|
||||
static void
|
||||
gdk_wayland_drag_surface_init (GdkWaylandDragSurface *surface)
|
||||
{
|
||||
|
||||
@@ -37,10 +37,6 @@ gdk_wayland_deps = [
|
||||
wlegldep,
|
||||
]
|
||||
|
||||
# wayland protocols
|
||||
proto_dir = dependency('wayland-protocols').get_pkgconfig_variable('pkgdatadir')
|
||||
assert(proto_dir != '', 'Could not get pkgdatadir from wayland-protocols.pc')
|
||||
|
||||
wayland_scanner = find_program('wayland-scanner')
|
||||
|
||||
# Format:
|
||||
@@ -68,14 +64,14 @@ foreach p: proto_sources
|
||||
|
||||
if proto_stability == 'stable'
|
||||
output_base = proto_name
|
||||
input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base))
|
||||
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
|
||||
elif proto_stability == 'private'
|
||||
output_base = proto_name
|
||||
input = 'protocol/@0@.xml'.format(proto_name)
|
||||
input = files('protocol/@0@.xml'.format(proto_name))
|
||||
else
|
||||
proto_version = p.get(2)
|
||||
output_base = '@0@-@1@-@2@'.format(proto_name, proto_stability, proto_version)
|
||||
input = join_paths(proto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base))
|
||||
input = files(join_paths(wlproto_dir, '@0@/@1@/@2@.xml'.format(proto_stability, proto_name, output_base)))
|
||||
endif
|
||||
|
||||
gdk_wayland_gen_headers += custom_target('@0@ client header'.format(output_base),
|
||||
|
||||
@@ -1063,7 +1063,7 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
|
||||
event = gdk_event_button_new (event_type,
|
||||
event = gdk_button_event_new (event_type,
|
||||
window,
|
||||
device_manager->core_pointer,
|
||||
GDK_DEVICE (source_device),
|
||||
@@ -1077,10 +1077,11 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB button %s:%d %g,%g\n",
|
||||
(event->any.type == GDK_BUTTON_PRESS ?
|
||||
(event->event_type == GDK_BUTTON_PRESS ?
|
||||
"press" : "release"),
|
||||
event->button.button,
|
||||
event->button.x, event->button.y));
|
||||
((GdkButtonEvent *) event)->button,
|
||||
((GdkButtonEvent *) event)->x,
|
||||
((GdkButtonEvent *) event)->y));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1097,7 +1098,7 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
| GDK_BUTTON3_MASK | GDK_BUTTON4_MASK
|
||||
| GDK_BUTTON5_MASK));
|
||||
|
||||
event = gdk_event_motion_new (window,
|
||||
event = gdk_motion_event_new (window,
|
||||
device_manager->core_pointer,
|
||||
GDK_DEVICE (source_device),
|
||||
NULL,
|
||||
@@ -1108,7 +1109,8 @@ gdk_input_other_event (GdkDisplay *display,
|
||||
axes);
|
||||
GDK_NOTE (EVENTS_OR_INPUT,
|
||||
g_print ("WINTAB motion: %g,%g\n",
|
||||
event->motion.x, event->motion.y));
|
||||
((GdkMotionEvent *) event)->x,
|
||||
((GdkMotionEvent *) event)->y));
|
||||
}
|
||||
return event;
|
||||
|
||||
|
||||
@@ -2515,7 +2515,8 @@ gdk_win32_drag_handle_event (GdkDrag *drag,
|
||||
if (!drag_win32->handle_events)
|
||||
{
|
||||
/* FIXME: remove this functionality once gtk no longer calls DnD after drag_done() */
|
||||
g_warning ("Got an event %d for drag context %p, even though it's done!", event->any.type, drag);
|
||||
g_warning ("Got an event %d for drag context %p, even though it's done!",
|
||||
event->event_type, drag);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
+15
-19
@@ -207,7 +207,7 @@ generate_focus_event (GdkDeviceManagerWin32 *device_manager,
|
||||
device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->core_keyboard;
|
||||
source_device = GDK_DEVICE_MANAGER_WIN32 (device_manager)->system_keyboard;
|
||||
|
||||
event = gdk_event_focus_new (window, device, source_device, in);
|
||||
event = gdk_focus_event_new (window, device, source_device, in);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
@@ -233,7 +233,7 @@ generate_grab_broken_event (GdkDeviceManagerWin32 *device_manager,
|
||||
source_device = device_manager->system_pointer;
|
||||
}
|
||||
|
||||
event = gdk_event_grab_broken_new (window,
|
||||
event = gdk_grab_broken_event_new (window,
|
||||
device,
|
||||
source_device,
|
||||
grab_window,
|
||||
@@ -885,12 +885,8 @@ decode_key_lparam (LPARAM lParam)
|
||||
static void
|
||||
fixup_event (GdkEvent *event)
|
||||
{
|
||||
if (event->any.surface)
|
||||
g_object_ref (event->any.surface);
|
||||
if (((event->any.type == GDK_ENTER_NOTIFY) ||
|
||||
(event->any.type == GDK_LEAVE_NOTIFY)) &&
|
||||
(event->crossing.child_surface != NULL))
|
||||
g_object_ref (event->crossing.child_surface);
|
||||
if (event->surface)
|
||||
g_object_ref (event->surface);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1080,7 +1076,7 @@ send_crossing_event (GdkDisplay *display,
|
||||
pt = *screen_pt;
|
||||
ScreenToClient (GDK_SURFACE_HWND (window), &pt);
|
||||
|
||||
event = gdk_event_crossing_new (type,
|
||||
event = gdk_crossing_event_new (type,
|
||||
window,
|
||||
device_manager->core_pointer,
|
||||
device_manager->system_pointer,
|
||||
@@ -1589,7 +1585,7 @@ generate_button_event (GdkEventType type,
|
||||
current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
|
||||
current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
|
||||
|
||||
event = gdk_event_button_new (type,
|
||||
event = gdk_button_event_new (type,
|
||||
window,
|
||||
device_manager->core_pointer,
|
||||
device_manager->system_pointer,
|
||||
@@ -2133,7 +2129,7 @@ gdk_event_translate (MSG *msg,
|
||||
translated.consumed = 0;
|
||||
translated.layout = 0;
|
||||
translated.level = 0;
|
||||
event = gdk_event_key_new (GDK_KEY_PRESS,
|
||||
event = gdk_key_event_new (GDK_KEY_PRESS,
|
||||
window,
|
||||
device_manager_win32->core_keyboard,
|
||||
device_manager_win32->system_keyboard,
|
||||
@@ -2336,7 +2332,7 @@ gdk_event_translate (MSG *msg,
|
||||
translated.consumed = 0;
|
||||
translated.layout = group;
|
||||
translated.level = 0;
|
||||
event = gdk_event_key_new ((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
|
||||
event = gdk_key_event_new ((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
|
||||
? GDK_KEY_PRESS
|
||||
: GDK_KEY_RELEASE,
|
||||
window,
|
||||
@@ -2413,7 +2409,7 @@ gdk_event_translate (MSG *msg,
|
||||
translated.consumed = 0;
|
||||
translated.layout = get_active_group ();
|
||||
translated.level = 0;
|
||||
event = gdk_event_key_new (GDK_KEY_PRESS,
|
||||
event = gdk_key_event_new (GDK_KEY_PRESS,
|
||||
window,
|
||||
device_manager_win32->core_keyboard,
|
||||
device_manager_win32->system_keyboard,
|
||||
@@ -2427,7 +2423,7 @@ gdk_event_translate (MSG *msg,
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
/* Build a key release event. */
|
||||
event = gdk_event_key_new (GDK_KEY_RELEASE,
|
||||
event = gdk_key_event_new (GDK_KEY_RELEASE,
|
||||
window,
|
||||
device_manager_win32->core_keyboard,
|
||||
device_manager_win32->system_keyboard,
|
||||
@@ -2641,7 +2637,7 @@ gdk_event_translate (MSG *msg,
|
||||
current_x = (gint16) GET_X_LPARAM (msg->lParam) / impl->surface_scale;
|
||||
current_y = (gint16) GET_Y_LPARAM (msg->lParam) / impl->surface_scale;
|
||||
|
||||
event = gdk_event_motion_new (window,
|
||||
event = gdk_motion_event_new (window,
|
||||
device_manager_win32->core_pointer,
|
||||
device_manager_win32->system_pointer,
|
||||
NULL,
|
||||
@@ -2767,7 +2763,7 @@ gdk_event_translate (MSG *msg,
|
||||
*/
|
||||
delta_y *= -1.0;
|
||||
|
||||
event = gdk_event_scroll_new (window,
|
||||
event = gdk_scroll_event_new (window,
|
||||
device_manager_win32->core_pointer,
|
||||
device_manager_win32->system_pointer,
|
||||
NULL,
|
||||
@@ -2790,7 +2786,7 @@ gdk_event_translate (MSG *msg,
|
||||
? GDK_SCROLL_RIGHT
|
||||
: GDK_SCROLL_LEFT;
|
||||
|
||||
event = gdk_event_discrete_scroll_new (window,
|
||||
event = gdk_scroll_event_new_discrete (window,
|
||||
device_manager_win32->core_pointer,
|
||||
device_manager_win32->system_pointer,
|
||||
NULL,
|
||||
@@ -3425,7 +3421,7 @@ gdk_event_translate (MSG *msg,
|
||||
if (GDK_SURFACE_DESTROYED (window))
|
||||
break;
|
||||
|
||||
event = gdk_event_delete_new (window);
|
||||
event = gdk_delete_event_new (window);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
@@ -3459,7 +3455,7 @@ gdk_event_translate (MSG *msg,
|
||||
if (window == NULL || GDK_SURFACE_DESTROYED (window))
|
||||
break;
|
||||
|
||||
event = gdk_event_delete_new (window);
|
||||
event = gdk_delete_event_new (window);
|
||||
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user