Compare commits
354 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c6dbfc85e9 | |||
| 404f39551e | |||
| 7743f35972 | |||
| db01233520 | |||
| fa1daf50a7 | |||
| 678eb8ab76 | |||
| c46b5ed646 | |||
| f8945b6325 | |||
| 3c67f6a457 | |||
| 9868143696 | |||
| b51eb4bd72 | |||
| 62619a9777 | |||
| d37ccbffa3 | |||
| b3ecc40cf1 | |||
| 5b76d0c226 | |||
| 9eb6de403f | |||
| d104357d40 | |||
| 775435c025 | |||
| 24f31b6797 | |||
| 45f69d2fbe | |||
| af5f75aa77 | |||
| 74494b0b3a | |||
| 94673707e6 | |||
| e204910730 | |||
| afe476c2e3 | |||
| dfe8eb37ce | |||
| 88e8837587 | |||
| f218a4e2d2 | |||
| 685961a8c6 | |||
| dced70a8d0 | |||
| f4f683a469 | |||
| 63fe3345a7 | |||
| 01e99fad1e | |||
| 0074ee3149 | |||
| ad361abc4c | |||
| 103f52bb8a | |||
| c2ec244b84 | |||
| e71f9bb79f | |||
| bf75a21deb | |||
| 1bba874895 | |||
| 01f5142b00 | |||
| 620d48ca0c | |||
| e8c5c2f648 | |||
| 71eb19bf51 | |||
| 7857c1a66b | |||
| 1e3ae95b7e | |||
| 1ff38cdf6a | |||
| 4147dd218d | |||
| e68a3a6123 | |||
| 6368278005 | |||
| edb61cc434 | |||
| 743406998c | |||
| f56c0bc034 | |||
| 988e20cd53 | |||
| 726c9e83d2 | |||
| e7af42c758 | |||
| 7c5d71ebf6 | |||
| d659bc8762 | |||
| 9f2a621328 | |||
| fae2dd9885 | |||
| c673d7cd9b | |||
| 1c8bddf3ca | |||
| ab1cf67432 | |||
| 1097003f6f | |||
| d0894b2786 | |||
| 5ba8fc8f10 | |||
| 5d05daaed0 | |||
| 86dd72fad6 | |||
| b0766a62ec | |||
| a664d06c2f | |||
| d42c51e27d | |||
| 63af01f7c9 | |||
| 12f7929f44 | |||
| 9c4490b7ad | |||
| f0d329cf5e | |||
| 58d79e87ea | |||
| cd40cd145f | |||
| 4f6b5b0fac | |||
| 88bbb933a1 | |||
| 4070e794d2 | |||
| 3b6ec027d3 | |||
| a284dc9f31 | |||
| 091daf4cff | |||
| 64f3ac6760 | |||
| 508ceccb66 | |||
| d6dde63074 | |||
| bdb1886fc9 | |||
| faa9ef2dc0 | |||
| 21b9667f08 | |||
| e4781e393c | |||
| 7536513ef8 | |||
| 6776c21350 | |||
| 9f4ef77663 | |||
| a64bb67ef7 | |||
| 53f3b4b9d9 | |||
| 5bb4d69720 | |||
| 35808a918d | |||
| 672618e560 | |||
| e28516d189 | |||
| dfe9460240 | |||
| 01820d8524 | |||
| be1729b316 | |||
| 57f2b5d2e6 | |||
| c00b234440 | |||
| 8d803e8615 | |||
| 9477ecbc92 | |||
| 1e686ee535 | |||
| 4d883861b1 | |||
| f9c0fc4fdd | |||
| 354f1a783a | |||
| 813dd0a674 | |||
| bbfacb4d22 | |||
| 086f2324a3 | |||
| c378eacb5d | |||
| 0660bb834e | |||
| 092fe2f712 | |||
| 5be54fad82 | |||
| d91e669d98 | |||
| 9a22577e34 | |||
| 88366c5e13 | |||
| 287ed99130 | |||
| 40e09cf2bb | |||
| 5a3ca064ea | |||
| edc991dafd | |||
| a1d03e69a4 | |||
| 18c2ba9b71 | |||
| 3da3cb35a6 | |||
| e54567611b | |||
| ce88d19015 | |||
| 5301a74bd3 | |||
| 381c34783d | |||
| 3ea8dc02a3 | |||
| 83c780cfad | |||
| 4b5d218067 | |||
| 8944493eca | |||
| dd9f26c492 | |||
| 3c038dc239 | |||
| 9ee555719e | |||
| 7953092059 | |||
| de1a8c8d89 | |||
| 98e000beb7 | |||
| 8b3a38779b | |||
| 8d72c8ee5f | |||
| f9b0866415 | |||
| dbe06357ec | |||
| 9e03c3f6cd | |||
| 2d14372142 | |||
| 0a4c08a7be | |||
| 883011f252 | |||
| 4927b6e625 | |||
| c93a01d627 | |||
| 221a18704b | |||
| 62984d091a | |||
| 6d15549f51 | |||
| 4c1fc4f5d7 | |||
| 98e0ca7477 | |||
| 4809efd630 | |||
| d88e935398 | |||
| 393ef4d0a2 | |||
| efd9aac3fa | |||
| c7c8b37e4c | |||
| 11aef91fa5 | |||
| f48c9b8388 | |||
| 62096ebd16 | |||
| f7b8184b00 | |||
| b91f60b4f9 | |||
| b6ba8ecbd0 | |||
| 02ee10639d | |||
| 0e42fa95b1 | |||
| 7a36632afc | |||
| 301f1a577d | |||
| 67e336992f | |||
| e1845f5e90 | |||
| d7dae84af2 | |||
| 0f829c4599 | |||
| 3fca865625 | |||
| bf8b26aa27 | |||
| cbc3d3f3ec | |||
| fd4562aac9 | |||
| c26962c4b1 | |||
| 46ce19d22a | |||
| 303bc3bb1b | |||
| bf5edc6b7c | |||
| 7c034cc283 | |||
| e437a9c348 | |||
| 1517c1813c | |||
| 9973a7173f | |||
| 01fcfc5c2a | |||
| 3f4c88aad1 | |||
| 8a0d6da187 | |||
| b8199bcc1f | |||
| abdbef1b5e | |||
| 6ac7f0562b | |||
| c796b30136 | |||
| 61bc38cd61 | |||
| b56b5ed81b | |||
| b6a8080b2f | |||
| 0400607102 | |||
| 5089fa3ecc | |||
| dec6a93510 | |||
| 27db4b5c2f | |||
| c3706ea9ec | |||
| e4869938b7 | |||
| fa1dca29b6 | |||
| 5abaee4f02 | |||
| d2b6fef1f8 | |||
| 9de027df65 | |||
| a639aaefae | |||
| 39645d3258 | |||
| 526b62e0be | |||
| 19fb336c39 | |||
| 1f3674cf3e | |||
| c76069389c | |||
| eef0c81be9 | |||
| c78eeaa874 | |||
| 2766f61abc | |||
| 45422f7b61 | |||
| c4feca1311 | |||
| 9426b20759 | |||
| f97cff1454 | |||
| 549a2b4c86 | |||
| f4f0daa113 | |||
| d4f8a80f2a | |||
| 8d175801d7 | |||
| 6bc3ecbe56 | |||
| dc4540fae9 | |||
| 31da5f7e2a | |||
| 48228efe42 | |||
| 4b41d4f78c | |||
| fb68600d88 | |||
| 0e6a3ab397 | |||
| e895f7dd70 | |||
| dae892d8f6 | |||
| ad5c3168a9 | |||
| 8f1db27b6b | |||
| 56a1cbe217 | |||
| 63e9e7e899 | |||
| 480a933546 | |||
| 2623c396cb | |||
| 826fdc4a80 | |||
| 3b088281ca | |||
| e61aecd67e | |||
| bd68339390 | |||
| 491d1f67c7 | |||
| 73dc741a82 | |||
| 38ec040fce | |||
| 6bb1873183 | |||
| 5ba5693efd | |||
| 797cc2e91b | |||
| 5507b3f8c1 | |||
| f9a3f13702 | |||
| b4c72ac508 | |||
| bcad305136 | |||
| 00d45c6743 | |||
| 38b393ff5d | |||
| 23f92ca1c2 | |||
| 34a9bc4632 | |||
| d603164ec2 | |||
| a033e838b2 | |||
| 511a2f4d03 | |||
| c089912a52 | |||
| 2694d81d63 | |||
| 213490099b | |||
| 166af48904 | |||
| 6e3dbc42a8 | |||
| 36fbbfc5c7 | |||
| 9bfc89e23d | |||
| 802bf41999 | |||
| 93636d4c5a | |||
| 88f761f2c8 | |||
| 7752467847 | |||
| 8514457d0f | |||
| c0d79aa1ef | |||
| 8a6d6fe6b1 | |||
| 7750a2c423 | |||
| 393893b8db | |||
| 4f16242807 | |||
| e82fb8e894 | |||
| b3e65bfdc1 | |||
| 111daecd3b | |||
| 72fe406c4d | |||
| 0f01629ce3 | |||
| 2f695388e9 | |||
| 3955633aa8 | |||
| f77f941401 | |||
| 288dd406e0 | |||
| 8667b7a46c | |||
| 0410125f20 | |||
| 1ea0de61e1 | |||
| e8eb96ae0c | |||
| 04f924c13e | |||
| 1fbca7a76a | |||
| 3f49d335d1 | |||
| 3882e14053 | |||
| 5f5fda911d | |||
| b9574e119b | |||
| 5f469a0d2d | |||
| ffd3801b1d | |||
| fd21df7244 | |||
| 654d74bfb8 | |||
| a26c72ef79 | |||
| 6b55a14429 | |||
| bc241d62af | |||
| 2b2894490f | |||
| c0747f2c2e | |||
| b34beb9380 | |||
| 8f19099f1a | |||
| db2516af0a | |||
| bd07f846ef | |||
| d938352fb3 | |||
| 13eef432fc | |||
| 1b355ff2e0 | |||
| aa9a8702e4 | |||
| ab2109ea6b | |||
| 926eb161f8 | |||
| 61bb9bb935 | |||
| 8f55a014b1 | |||
| c3e5d80853 | |||
| 8bd77441a9 | |||
| a2af794cb0 | |||
| 0c86b28828 | |||
| 4278e91a46 | |||
| dd16d7c4c8 | |||
| 6164908bd3 | |||
| 2ff98dad03 | |||
| f33c521836 | |||
| e1159dab93 | |||
| c4f423694f | |||
| 4f2b1b3cfc | |||
| 122fa679a8 | |||
| 7302407880 | |||
| 900a23e2bb | |||
| 0f7d93492d | |||
| aee4475c0f | |||
| 1f61cb2251 | |||
| 0382e3b46c | |||
| 547b2891cb | |||
| 89614f5f72 | |||
| f5fc71fe82 | |||
| a546ae32d7 | |||
| 17578a97d6 | |||
| 9536eb654b | |||
| 0f21f6c273 | |||
| 4bf07aeef9 | |||
| 26b250503d | |||
| 8533824084 | |||
| 5a0d6e3fc8 | |||
| 6be466b675 | |||
| 1c587c7d7f | |||
| 2f98de06bc | |||
| 9e6855cdb8 | |||
| a6c3e440f6 | |||
| 08d386844a | |||
| 48e98d333e |
+4
-2
@@ -25,7 +25,7 @@ variables:
|
||||
BACKEND_FLAGS: "-Dx11-backend=true -Dwayland-backend=true -Dbroadway-backend=true"
|
||||
FEATURE_FLAGS: "-Dvulkan=enabled -Dcloudproviders=enabled"
|
||||
MESON_TEST_TIMEOUT_MULTIPLIER: 3
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v36"
|
||||
FEDORA_IMAGE: "registry.gitlab.gnome.org/gnome/gtk/fedora:v38"
|
||||
FLATPAK_IMAGE: "registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master"
|
||||
|
||||
.only-default:
|
||||
@@ -58,6 +58,7 @@ style-check-diff:
|
||||
- "${CI_PROJECT_DIR}/_build/report*.xml"
|
||||
- "${CI_PROJECT_DIR}/_build/report*.html"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/reftests/output/*/*.node"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/tools/output/*/*"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/gsk/compare/*/*/*.png"
|
||||
- "${CI_PROJECT_DIR}/_build/testsuite/css/output/*/*.syscap"
|
||||
@@ -172,7 +173,7 @@ macos:
|
||||
needs: []
|
||||
before_script:
|
||||
- bash .gitlab-ci/show-info-osx.sh
|
||||
- pip3 install --user meson==0.59
|
||||
- pip3 install --user meson==0.60.3
|
||||
- pip3 install --user ninja
|
||||
- export PATH=/Users/gitlabrunner/Library/Python/3.7/bin:$PATH
|
||||
- export MESON_FORCE_BACKTRACE=1
|
||||
@@ -345,6 +346,7 @@ reference:
|
||||
- _reference
|
||||
|
||||
publish-docs:
|
||||
image: fedora:latest
|
||||
stage: publish
|
||||
needs: ['reference']
|
||||
script:
|
||||
|
||||
@@ -14,6 +14,9 @@ Each Docker image has a tag composed of two parts:
|
||||
See the [container registry][registry] for the available images for each
|
||||
branch, as well as their available versions.
|
||||
|
||||
Note that using `latest` as version number will overwrite the most
|
||||
recently uploaded image in the registry.
|
||||
|
||||
### Checklist for Updating a CI image
|
||||
|
||||
- [ ] Update the `${image}.Dockerfile` file with the dependencies
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM fedora:34
|
||||
FROM fedora:36
|
||||
|
||||
RUN dnf -y install \
|
||||
adwaita-icon-theme \
|
||||
@@ -87,7 +87,6 @@ RUN dnf -y install \
|
||||
python3-wheel \
|
||||
redhat-rpm-config \
|
||||
sassc \
|
||||
systemtap-sdt-devel \
|
||||
vulkan-devel \
|
||||
wayland-devel \
|
||||
wayland-protocols-devel \
|
||||
|
||||
@@ -19,7 +19,6 @@ flatpak build ${builddir} meson \
|
||||
--buildtype=release \
|
||||
-Dx11-backend=true \
|
||||
-Dwayland-backend=true \
|
||||
-Dprint-backends=file \
|
||||
-Dbuild-tests=false \
|
||||
-Dbuild-examples=false \
|
||||
-Dintrospection=disabled \
|
||||
|
||||
@@ -185,6 +185,8 @@ ul.images li {
|
||||
<li><img alt="ref" src="{{ failure.image_data.ref }}" /></li>
|
||||
<li><img alt="out" src="{{ failure.image_data.out }}" /></li>
|
||||
<li><img alt="diff" src="{{ failure.image_data.diff }}" /></li>
|
||||
<li><a href="{{ failure.image_data.refnode }}">ref node</a></li>
|
||||
<li><a href="{{ failure.image_data.outnode }}">out node</a></li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</li>
|
||||
@@ -311,6 +313,8 @@ for line in args.infile:
|
||||
image_data = {
|
||||
'ref': os.path.join(args.reftest_output_dir, '{}.ref.png'.format(basename)),
|
||||
'out': os.path.join(args.reftest_output_dir, '{}.out.png'.format(basename)),
|
||||
'refnode': os.path.join(args.reftest_output_dir, '{}.ref.node'.format(basename)),
|
||||
'outnode': os.path.join(args.reftest_output_dir, '{}.out.node'.format(basename)),
|
||||
'diff': os.path.join(args.reftest_output_dir, '{}.diff.png'.format(basename)),
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliar
|
||||
@echo on
|
||||
|
||||
:: FIXME: make warnings fatal
|
||||
pip3 install --upgrade --user meson==0.59 || goto :error
|
||||
pip3 install --upgrade --user meson==0.60.3 || goto :error
|
||||
meson -Ddebug=false -Dmedia-gstreamer=disabled _build || goto :error
|
||||
ninja -C _build || goto :error
|
||||
|
||||
|
||||
@@ -1,3 +1,234 @@
|
||||
Overview of Changes in 4.7.1, 12-07-2022
|
||||
========================================
|
||||
|
||||
* GtkInscription:
|
||||
- A new label-like widget for use in list views
|
||||
|
||||
* GtkColorChooser:
|
||||
- Style improvements
|
||||
|
||||
* GtkFontChooser:
|
||||
- Improve support for OpenType features a bit
|
||||
|
||||
* GtkLabel:
|
||||
- Allow selectable labels to be activated via mnemonic
|
||||
|
||||
* GtkTextView:
|
||||
- Implement GetCharacterExtents for accessibility
|
||||
|
||||
* GtkStack:
|
||||
- Fix a poblem with stack page accessibility
|
||||
|
||||
* GtkListView:
|
||||
- Cull listitems that are out of view
|
||||
- Make all our list models implement ::n-items and
|
||||
::item-type properties
|
||||
|
||||
* Translations:
|
||||
- Stop translating property nicks and blurbs
|
||||
- Fix extracting translations from ui files
|
||||
|
||||
* Debugging:
|
||||
- Support GTK_DEBUG=invert-text-dir
|
||||
- Allow inspecting inspectors
|
||||
- Replace GTK_USE_PORTAL with GDK_DEBUG=portals
|
||||
- Improve responsiveness of the inspector
|
||||
|
||||
* CSS:
|
||||
- Allow fractional letterspacing
|
||||
|
||||
* Theme:
|
||||
- Improve legibility of selectable labels
|
||||
|
||||
* Demos:
|
||||
- Improve the font features demo
|
||||
- Add demos for GtkInscription
|
||||
|
||||
* Wayland:
|
||||
- Freeze popups when hidden
|
||||
- Only send smooth scroll events for tablet tools
|
||||
- Make scaled cursor image have the right size
|
||||
- Fix problems with the activation protocol
|
||||
- Don't force the HighContrast icon theme
|
||||
- Support xdg_toplevel.bounds
|
||||
|
||||
* X11:
|
||||
- Always update the shadoe size
|
||||
|
||||
* Windows:
|
||||
- Improve touchpad support by using DirectManipulation
|
||||
- Add more directories to the builtin hicolor icon theme
|
||||
|
||||
* Translation updates:
|
||||
Basque
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Galician
|
||||
German
|
||||
Lithuanian
|
||||
Nepali
|
||||
Occitan
|
||||
Persian
|
||||
Polish
|
||||
Portuguese
|
||||
Russian
|
||||
Serbian
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.7.0, 07-05-2022
|
||||
========================================
|
||||
|
||||
* GtkTextView:
|
||||
- Reduce overdraws
|
||||
|
||||
* GtkViewport:
|
||||
- Default scroll-to-focus to TRUE
|
||||
|
||||
* GtkText:
|
||||
- Stop blinking when we lose focus
|
||||
|
||||
* GtkSearchEntry:
|
||||
- Make search delay configurable
|
||||
|
||||
* GtkPopoverMenu:
|
||||
- Fix RTL positioning of buttons
|
||||
|
||||
* GtkLabel:
|
||||
- Fix focus keynav with links
|
||||
|
||||
* GtkFileChooser:
|
||||
- Prevent undesirable completion popups
|
||||
- Fix a corner case in save mode
|
||||
- Keep the portal filechooser alive long enough
|
||||
|
||||
* GtkCheckButton:
|
||||
- Allow setting a custom child
|
||||
|
||||
* GtkEditableLabel:
|
||||
- Make the :editing property writable
|
||||
|
||||
* GtkColumnView:
|
||||
- Various optimizations to improve scrolling performance
|
||||
|
||||
* GtkTreeStore:
|
||||
- Allow populating tree stores from ui files
|
||||
|
||||
* GtkBoxLayout:
|
||||
- Avoid infinite loops
|
||||
|
||||
* CSS:
|
||||
- Optimize reordering within the same parent
|
||||
|
||||
* Emoji:
|
||||
- Update to CLDR v40 / Unicode 14
|
||||
- Add more locales
|
||||
|
||||
* Input:
|
||||
- Add scroll unit handling
|
||||
- Handle display changes in GtkIMMultiContext
|
||||
- Always populate GDK_AXIS_X/Y in event history
|
||||
- Don't crash for large compose tables
|
||||
|
||||
* Accessibility:
|
||||
- Fix a crash at start when orca is running
|
||||
|
||||
* Theme:
|
||||
- Refresh icons
|
||||
- Fix selection in vertical spin buttons
|
||||
- Fix selection in editable labels
|
||||
|
||||
* gdk:
|
||||
- Optimize pixel format conversions
|
||||
- Use EGL_KHR_swap_buffers_with_damage for NVidia
|
||||
|
||||
* gsk:
|
||||
- Handle large viewports
|
||||
- Prepare texture libraries for glyphy rendering
|
||||
- Don't leak big glyphs in the glyph cache
|
||||
- Align offscreen rendering with th pixel grid
|
||||
- Check for half-float support before using it
|
||||
|
||||
* Wayland:
|
||||
- Use xdg-activation protocol
|
||||
- Fix text caret coordinates
|
||||
- Fix on-screen keyboard activation
|
||||
|
||||
* MacOS:
|
||||
- Fix sluggish and reversed scrolling
|
||||
- Improve monitor detection
|
||||
- Event handling fixes
|
||||
- Fix keyboard input on popovers
|
||||
- Support OpenGL-based video playback
|
||||
- Suport fullscreen
|
||||
- Improve native filechoooser size allocation
|
||||
- Use CALayer and IOSurface for rendering
|
||||
- Use a per-monitor CVDisplayLink
|
||||
- Fix kinetic scrolling
|
||||
- Improve window placement
|
||||
- Improve multi-monitor handling
|
||||
- Start applications in the foreground
|
||||
- Fix cursor blink time
|
||||
|
||||
* Windows:
|
||||
- Fix preedit window placement on HiDPI
|
||||
|
||||
* Tools:
|
||||
- gtk4-builder-tool: Don't require a display for all commands
|
||||
- gtk4-builder-tool: Add a screenshot command
|
||||
- gtk4-node-editor: Install this utility
|
||||
|
||||
* Debugging:
|
||||
- inspector: Show more application data
|
||||
- inspector: Allow viewing PangoAttrList properties
|
||||
|
||||
* Documentation:
|
||||
- Use the gtk-builder-tool to generate screenshots
|
||||
|
||||
* Build:
|
||||
- Fix cross-compilation
|
||||
- Fix build on aarch64
|
||||
- Fix build with gcc 12
|
||||
|
||||
* Translation updates
|
||||
Basque
|
||||
Brazilian Portuguese
|
||||
British English
|
||||
Catalan
|
||||
Chinese (China)
|
||||
Chinese (Taiwan)
|
||||
Croatian
|
||||
Czech
|
||||
Danish
|
||||
Finnish
|
||||
Galician
|
||||
Georgian
|
||||
German
|
||||
Hebrew
|
||||
Hungarian
|
||||
Indonesian
|
||||
Italian
|
||||
Kazakh
|
||||
Korean
|
||||
Latvian
|
||||
Lithuanian
|
||||
Norwegian Bokmål
|
||||
Persian
|
||||
Polish
|
||||
Portuguese
|
||||
Russian
|
||||
Serbian
|
||||
Slovak
|
||||
Slovenian
|
||||
Spanish
|
||||
Swedish
|
||||
Turkish
|
||||
Ukrainian
|
||||
|
||||
|
||||
Overview of Changes in 4.6.1, 11-02-2022
|
||||
========================================
|
||||
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Dtests=false",
|
||||
"-Dbenchmarks=false"
|
||||
"-Dtests=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
@@ -105,8 +104,8 @@
|
||||
"sources": [
|
||||
{
|
||||
"type": "archive",
|
||||
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2",
|
||||
"sha256": "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406"
|
||||
"url": "https://boostorg.jfrog.io/artifactory/main/release/1.79.0/source/boost_1_79_0.tar.bz2",
|
||||
"sha256": "475d589d51a7f8b3ba2ba4eda022b170e562ca3b760ee922c146b6c65856ef39"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -186,7 +185,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Denable_vulkan=no",
|
||||
"-Dvulkan=disabled",
|
||||
"-Dbuildtype=debugoptimized",
|
||||
"-Dprofile=devel"
|
||||
],
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Dtests=false",
|
||||
"-Dbenchmarks=false"
|
||||
"-Dtests=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
@@ -115,7 +114,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Denable_vulkan=no",
|
||||
"-Dvulkan=disabled",
|
||||
"-Dbuildtype=debugoptimized",
|
||||
"-Dprofile=devel"
|
||||
],
|
||||
|
||||
@@ -54,8 +54,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Dtests=false",
|
||||
"-Dbenchmarks=false"
|
||||
"-Dtests=false"
|
||||
],
|
||||
"sources" : [
|
||||
{
|
||||
@@ -115,7 +114,7 @@
|
||||
"builddir" : true,
|
||||
"config-opts" : [
|
||||
"--libdir=/app/lib",
|
||||
"-Denable_vulkan=no",
|
||||
"-Dvulkan=disabled",
|
||||
"-Dbuildtype=debugoptimized",
|
||||
"-Dprofile=devel"
|
||||
],
|
||||
|
||||
@@ -361,11 +361,11 @@ save_cb (GtkWidget *button,
|
||||
}
|
||||
|
||||
static void
|
||||
constraint_editor_window_finalize (GObject *object)
|
||||
constraint_editor_window_dispose (GObject *object)
|
||||
{
|
||||
//ConstraintEditorWindow *self = (ConstraintEditorWindow *)object;
|
||||
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_WINDOW_TYPE);
|
||||
|
||||
G_OBJECT_CLASS (constraint_editor_window_parent_class)->finalize (object);
|
||||
G_OBJECT_CLASS (constraint_editor_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static int child_counter;
|
||||
@@ -497,7 +497,7 @@ constraint_editor_window_class_init (ConstraintEditorWindowClass *class)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->finalize = constraint_editor_window_finalize;
|
||||
object_class->dispose = constraint_editor_window_dispose;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class,
|
||||
"/org/gtk/gtk4/constraint-editor/constraint-editor-window.ui");
|
||||
|
||||
@@ -607,10 +607,11 @@ constraint_editor_dispose (GObject *object)
|
||||
{
|
||||
ConstraintEditor *self = (ConstraintEditor *)object;
|
||||
|
||||
g_clear_pointer (&self->grid, gtk_widget_unparent);
|
||||
g_clear_object (&self->model);
|
||||
g_clear_object (&self->constraint);
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (object), CONSTRAINT_EDITOR_TYPE);
|
||||
|
||||
G_OBJECT_CLASS (constraint_editor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
||||
@@ -294,9 +294,10 @@ guide_editor_dispose (GObject *object)
|
||||
{
|
||||
GuideEditor *self = (GuideEditor *)object;
|
||||
|
||||
g_clear_pointer (&self->grid, gtk_widget_unparent);
|
||||
g_clear_object (&self->guide);
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (self), GUIDE_EDITOR_TYPE);
|
||||
|
||||
G_OBJECT_CLASS (guide_editor_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
||||
@@ -504,6 +504,8 @@ demo_application_window_dispose (GObject *object)
|
||||
|
||||
demo_application_window_store_state (window);
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (window), demo_application_window_get_type ());
|
||||
|
||||
G_OBJECT_CLASS (demo_application_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
|
||||
@@ -341,16 +341,13 @@ do_clipboard (GtkWidget *do_widget)
|
||||
GtkWidget *button;
|
||||
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
|
||||
"copy_button_clicked", G_CALLBACK (copy_button_clicked),
|
||||
"paste_button_clicked", G_CALLBACK (paste_button_clicked),
|
||||
"source_changed_cb", G_CALLBACK (source_changed_cb),
|
||||
"text_changed_cb", G_CALLBACK (text_changed_cb),
|
||||
"open_file_cb", G_CALLBACK (open_file_cb),
|
||||
"on_drop", G_CALLBACK (on_drop),
|
||||
"drag_prepare", G_CALLBACK (drag_prepare),
|
||||
NULL);
|
||||
|
||||
gtk_builder_cscope_add_callback (scope, copy_button_clicked);
|
||||
gtk_builder_cscope_add_callback (scope, paste_button_clicked);
|
||||
gtk_builder_cscope_add_callback (scope, source_changed_cb);
|
||||
gtk_builder_cscope_add_callback (scope, text_changed_cb);
|
||||
gtk_builder_cscope_add_callback (scope, open_file_cb);
|
||||
gtk_builder_cscope_add_callback (scope, on_drop);
|
||||
gtk_builder_cscope_add_callback (scope, drag_prepare);
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
gtk_builder_add_from_resource (builder, "/clipboard/clipboard.ui", NULL);
|
||||
|
||||
@@ -329,6 +329,7 @@
|
||||
<file>pickers.c</file>
|
||||
<file>printing.c</file>
|
||||
<file>revealer.c</file>
|
||||
<file>read_more.c</file>
|
||||
<file>rotated_text.c</file>
|
||||
<file>scale.c</file>
|
||||
<file>search_entry.c</file>
|
||||
@@ -375,7 +376,7 @@
|
||||
<file>glarea-gles.vs.glsl</file>
|
||||
</gresource>
|
||||
<gresource prefix="/font_features">
|
||||
<file>font-features.ui</file>
|
||||
<file>font_features.ui</file>
|
||||
<file>fontplane.c</file>
|
||||
</gresource>
|
||||
<gresource prefix="/spinbutton">
|
||||
|
||||
@@ -37,7 +37,8 @@ demo3_widget_dispose (GObject *object)
|
||||
Demo3Widget *self = DEMO3_WIDGET (object);
|
||||
|
||||
g_clear_object (&self->paintable);
|
||||
g_clear_pointer (&self->menu, gtk_widget_unparent);
|
||||
|
||||
gtk_widget_dispose_template (GTK_WIDGET (self), DEMO3_TYPE_WIDGET);
|
||||
|
||||
G_OBJECT_CLASS (demo3_widget_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
@@ -90,12 +90,9 @@ do_errorstates (GtkWidget *do_widget)
|
||||
toplevel = GTK_WIDGET (gtk_widget_get_root (do_widget));
|
||||
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback_symbols (GTK_BUILDER_CSCOPE (scope),
|
||||
"validate_more_details", G_CALLBACK (validate_more_details),
|
||||
"mode_switch_state_set", G_CALLBACK (mode_switch_state_set),
|
||||
"level_scale_value_changed", G_CALLBACK (level_scale_value_changed),
|
||||
NULL);
|
||||
|
||||
gtk_builder_cscope_add_callback (scope, validate_more_details);
|
||||
gtk_builder_cscope_add_callback (scope, mode_switch_state_set);
|
||||
gtk_builder_cscope_add_callback (scope, level_scale_value_changed);
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
gtk_builder_expose_object (builder, "toplevel", G_OBJECT (toplevel));
|
||||
|
||||
@@ -1,190 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">500</property>
|
||||
<property name="title">Font Explorer</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="tooltip-text">Reset</property>
|
||||
<property name="icon-name">view-refresh-symbolic</property>
|
||||
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkFontButton" id="font">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
<property name="level">family|style|size|variations|features</property>
|
||||
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Font Features</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="feature_list">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="script_lang">
|
||||
<property name="margin-top">10</property>
|
||||
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="variations_heading">
|
||||
<property name="label" translatable="yes">Font Variations</property>
|
||||
<property name="xalign">0</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"></attribute>
|
||||
</attributes>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="variations_grid">
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="view"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">label</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="selectable">1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">entry</property>
|
||||
<property name="child">
|
||||
<object class="GtkEntry" id="entry">
|
||||
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
|
||||
|
||||
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||
|
||||
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
|
||||
<signal name="activate" handler="font_features_stop_edit"/>
|
||||
<property name="valign">start</property>
|
||||
<property name="width-chars">50</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="settings">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="description">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="edit_toggle">
|
||||
<property name="icon-name">document-edit-symbolic</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">end</property>
|
||||
<signal name="toggled" handler="font_features_toggle_edit"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
+713
-262
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,65 @@
|
||||
--- demos/gtk-demo/font_features.c
|
||||
+++ demos/gtk-demo/font_features.c
|
||||
@@ -434,7 +434,7 @@ static void
|
||||
update_display (void)
|
||||
{
|
||||
GString *s;
|
||||
- const char *text;
|
||||
+ char *text;
|
||||
gboolean has_feature;
|
||||
GtkTreeIter iter;
|
||||
GtkTreeModel *model;
|
||||
@@ -452,8 +452,12 @@ update_display (void)
|
||||
gboolean do_waterfall;
|
||||
GString *waterfall;
|
||||
char *palette;
|
||||
+ GtkTextBuffer *buffer;
|
||||
+ GtkTextIter start_iter, end_iter;
|
||||
|
||||
- text = gtk_editable_get_text (GTK_EDITABLE (demo->the_entry));
|
||||
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
|
||||
+ gtk_text_buffer_get_bounds (buffer, &start_iter, &end_iter);
|
||||
+ text = gtk_text_buffer_get_text (buffer, &start_iter, &end_iter, FALSE);
|
||||
text_len = strlen (text);
|
||||
|
||||
do_waterfall = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (demo->waterfall_toggle));
|
||||
@@ -631,6 +635,8 @@ update_display (void)
|
||||
pango2_font_description_free (desc);
|
||||
g_free (features);
|
||||
pango2_attr_list_unref (attrs);
|
||||
+
|
||||
+ g_free (text);
|
||||
}
|
||||
|
||||
static Pango2Font *
|
||||
@@ -1603,8 +1609,12 @@ font_features_toggle_edit (void)
|
||||
{
|
||||
if (strcmp (gtk_stack_get_visible_child_name (GTK_STACK (demo->stack)), "entry") != 0)
|
||||
{
|
||||
+ GtkTextBuffer *buffer;
|
||||
+ GtkTextIter start, end;
|
||||
g_free (demo->text);
|
||||
- demo->text = g_strdup (gtk_editable_get_text (GTK_EDITABLE (demo->the_entry)));
|
||||
+ buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry));
|
||||
+ gtk_text_buffer_get_bounds (buffer, &start, &end);
|
||||
+ demo->text = gtk_text_buffer_get_text (buffer, &start, &end, FALSE);
|
||||
gtk_stack_set_visible_child_name (GTK_STACK (demo->stack), "entry");
|
||||
gtk_widget_grab_focus (demo->the_entry);
|
||||
gtk_adjustment_set_value (gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (demo->swin)), 0);
|
||||
@@ -1632,7 +1642,7 @@ entry_key_press (GtkEventController *controller,
|
||||
{
|
||||
if (keyval == GDK_KEY_Escape)
|
||||
{
|
||||
- gtk_editable_set_text (GTK_EDITABLE (entry), demo->text);
|
||||
+ gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (demo->the_entry)), demo->text, -1);
|
||||
return GDK_EVENT_STOP;
|
||||
}
|
||||
|
||||
@@ -1701,7 +1711,6 @@ do_font_features (GtkWidget *do_widget)
|
||||
basic_value_changed (demo->line_height_adjustment, demo->line_height_entry);
|
||||
|
||||
controller = gtk_event_controller_key_new ();
|
||||
- g_object_set_data_full (G_OBJECT (demo->the_entry), "controller", g_object_ref (controller), g_object_unref);
|
||||
g_signal_connect (controller, "key-pressed", G_CALLBACK (entry_key_press), demo->the_entry);
|
||||
gtk_widget_add_controller (demo->the_entry, controller);
|
||||
|
||||
@@ -0,0 +1,454 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<object class="GtkAdjustment" id="size_adjustment">
|
||||
<property name="lower">7</property>
|
||||
<property name="upper">100</property>
|
||||
<property name="value">14</property>
|
||||
<property name="step_increment">0.5</property>
|
||||
<property name="page_increment">10</property>
|
||||
<signal name="value-changed" handler="basic_value_changed" object="size_entry" swapped="false"/>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="letterspacing_adjustment">
|
||||
<property name="lower">-1024</property>
|
||||
<property name="upper">8192</property>
|
||||
<property name="value">0</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">512</property>
|
||||
<signal name="value-changed" handler="basic_value_changed" object="letterspacing_entry" swapped="false"/>
|
||||
</object>
|
||||
<object class="GtkAdjustment" id="line_height_adjustment">
|
||||
<property name="lower">0.75</property>
|
||||
<property name="upper">2.5</property>
|
||||
<property name="value">1.0</property>
|
||||
<property name="step_increment">0.1</property>
|
||||
<property name="page_increment">1</property>
|
||||
<signal name="value-changed" handler="basic_value_changed" object="line_height_entry" swapped="false"/>
|
||||
</object>
|
||||
<object class="GtkWindow" id="window">
|
||||
<property name="default-width">600</property>
|
||||
<property name="default-height">500</property>
|
||||
<property name="title">Font Explorer</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<child>
|
||||
<object class="GtkButton" id="reset">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="tooltip-text">Reset</property>
|
||||
<property name="icon-name">view-refresh-symbolic</property>
|
||||
<signal name="clicked" handler="font_features_reset_basic" swapped="no"/>
|
||||
<signal name="clicked" handler="font_features_reset_features" swapped="no"/>
|
||||
<signal name="clicked" handler="font_features_reset_variations" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<child>
|
||||
<object class="GtkScrolledWindow">
|
||||
<property name="hscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkViewport">
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="margin-start">10</property>
|
||||
<property name="margin-end">10</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="spacing">6</property>
|
||||
<child>
|
||||
<object class="GtkFontButton" id="font">
|
||||
<property name="receives-default">1</property>
|
||||
<property name="font">Sans 12</property>
|
||||
<property name="level">family|style</property>
|
||||
<signal name="font-set" handler="font_features_font_changed" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Size</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale" id="size_scale">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="adjustment">size_adjustment</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="size_entry">
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="hexpand">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="activate" handler="basic_entry_activated"
|
||||
object="size_adjustment" swapped="false"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">0</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Letterspacing</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="adjustment">letterspacing_adjustment</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="letterspacing_entry">
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="hexpand">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="activate" handler="basic_entry_activated"
|
||||
object="letterspacing_adjustment" swapped="false"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">1</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Line Height</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkScale">
|
||||
<property name="hexpand">1</property>
|
||||
<property name="width-request">100</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="adjustment">line_height_adjustment</property>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkEntry" id="line_height_entry">
|
||||
<property name="width-chars">4</property>
|
||||
<property name="max-width-chars">4</property>
|
||||
<property name="hexpand">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="activate" handler="basic_entry_activated"
|
||||
object="line_height_adjustment" swapped="false"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Foreground</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="foreground">
|
||||
<property name="valign">baseline</property>
|
||||
<property name="rgba">black</property>
|
||||
<signal name="notify::rgba" handler="color_set_cb"/>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">3</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="label">Background</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">baseline</property>
|
||||
<layout>
|
||||
<property name="column">0</property>
|
||||
<property name="row">4</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkColorButton" id="background">
|
||||
<property name="valign">baseline</property>
|
||||
<property name="rgba">white</property>
|
||||
<signal name="notify::rgba" handler="color_set_cb"/>
|
||||
<layout>
|
||||
<property name="column">1</property>
|
||||
<property name="row">4</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="icon-name">object-flip-vertical-symbolic</property>
|
||||
<property name="halign">start</property>
|
||||
<property name="valign">center</property>
|
||||
<style>
|
||||
<class name="circular"/>
|
||||
</style>
|
||||
<signal name="clicked" handler="swap_colors"/>
|
||||
<layout>
|
||||
<property name="column">2</property>
|
||||
<property name="row">3</property>
|
||||
<property name="row-span">2</property>
|
||||
</layout>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel">
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">OpenType Features</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<style>
|
||||
<class name="title-4"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="feature_list">
|
||||
<property name="orientation">vertical</property>
|
||||
<child>
|
||||
<object class="GtkComboBox" id="script_lang">
|
||||
<property name="tooltip-text" translatable="yes">Language System</property>
|
||||
<property name="margin-top">10</property>
|
||||
<signal name="changed" handler="font_features_script_changed" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkCellRendererText"/>
|
||||
<attributes>
|
||||
<attribute name="text">0</attribute>
|
||||
</attributes>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkExpander">
|
||||
<child type="label">
|
||||
<object class="GtkLabel" id="variations_heading">
|
||||
<property name="label" translatable="yes">Variation Axes</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="margin-top">10</property>
|
||||
<property name="margin-bottom">10</property>
|
||||
<style>
|
||||
<class name="title-4"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid" id="variations_grid">
|
||||
<property name="column-spacing">10</property>
|
||||
<property name="row-spacing">10</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<style>
|
||||
<class name="view"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<property name="margin-start">20</property>
|
||||
<property name="margin-end">20</property>
|
||||
<property name="margin-top">20</property>
|
||||
<property name="margin-bottom">20</property>
|
||||
<property name="spacing">20</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="swin">
|
||||
<property name="hscrollbar-policy">automatic</property>
|
||||
<property name="vscrollbar-policy">automatic</property>
|
||||
<property name="propagate-natural-height">1</property>
|
||||
<property name="vexpand">1</property>
|
||||
<style>
|
||||
<class name="font_features_background"/>
|
||||
</style>
|
||||
<child>
|
||||
<object class="GtkStack" id="stack">
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">label</property>
|
||||
<property name="child">
|
||||
<object class="GtkLabel" id="label">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="yalign">0</property>
|
||||
<property name="valign">start</property>
|
||||
<property name="selectable">1</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStackPage">
|
||||
<property name="name">entry</property>
|
||||
<property name="child">
|
||||
<object class="GtkTextView" id="entry">
|
||||
<property name="buffer">
|
||||
<object class="GtkTextBuffer">
|
||||
<property name="text">Grumpy wizards make toxic brew for the evil Queen and Jack. A quick movement of the enemy will jeopardize six gunboats. The job of waxing linoleum frequently peeves chintzy kids. My girl wove six dozen plaid jackets before she quit. Twelve ziggurats quickly jumped a finch box.
|
||||
|
||||
Разъяренный чтец эгоистично бьёт пятью жердями шустрого фехтовальщика. Наш банк вчера же выплатил Ф.Я. Эйхгольду комиссию за ценные вещи. Эх, чужак, общий съём цен шляп (юфть) – вдрызг! В чащах юга жил бы цитрус? Да, но фальшивый экземпляр!
|
||||
|
||||
Τάχιστη αλώπηξ βαφής ψημένη γη, δρασκελίζει υπέρ νωθρού κυνός</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="valign">fill</property>
|
||||
</object>
|
||||
</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="settings">
|
||||
<property name="wrap">1</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Alphabet</property>
|
||||
<signal name="clicked" handler="set_text_alphabet"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton">
|
||||
<property name="label" translatable="yes">Paragraph</property>
|
||||
<signal name="clicked" handler="set_text_paragraph"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<property name="spacing">10</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="description">
|
||||
<property name="wrap">1</property>
|
||||
<property name="wrap-mode">char</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="valign">end</property>
|
||||
<property name="width-chars">50</property>
|
||||
<property name="max-width-chars">50</property>
|
||||
<property name="hexpand">1</property>
|
||||
<style>
|
||||
<class name="monospace"/>
|
||||
</style>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox">
|
||||
<style>
|
||||
<class name="linked"/>
|
||||
</style>
|
||||
<property name="valign">end</property>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="plain_toggle">
|
||||
<property name="label" translatable="yes">Plain</property>
|
||||
<property name="active">1</property>
|
||||
<property name="valign">baseline</property>
|
||||
<signal name="toggled" handler="font_features_toggle_plain"/>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="waterfall_toggle">
|
||||
<property name="label" translatable="yes">Waterfall</property>
|
||||
<property name="valign">baseline</property>
|
||||
<property name="group">plain_toggle</property>
|
||||
<signal name="toggled" handler="font_features_toggle_plain"/>
|
||||
<signal name="notify::active" handler="font_features_notify_waterfall"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkToggleButton" id="edit_toggle">
|
||||
<property name="group">waterfall_toggle</property>
|
||||
<property name="icon-name">document-edit-symbolic</property>
|
||||
<property name="halign">end</property>
|
||||
<property name="valign">end</property>
|
||||
<signal name="clicked" handler="font_features_toggle_edit"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
||||
@@ -23,7 +23,7 @@ do_headerbar (GtkWidget *do_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), "Welcome to Facebook - Log in, sign up or learn more");
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Welcome to the Hotel California");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
gtk_window_set_default_size (GTK_WINDOW (window), 600, 400);
|
||||
@@ -31,6 +31,7 @@ do_headerbar (GtkWidget *do_widget)
|
||||
header = gtk_header_bar_new ();
|
||||
|
||||
button = gtk_button_new_from_icon_name ("mail-send-receive-symbolic");
|
||||
gtk_widget_set_tooltip_text (button, "Check out");
|
||||
gtk_header_bar_pack_end (GTK_HEADER_BAR (header), button);
|
||||
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
|
||||
@@ -66,11 +66,9 @@ do_links (GtkWidget *do_widget)
|
||||
"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>.");
|
||||
"linking to <a href=\"http://www.flathub.org/\"><b>"
|
||||
"<span letter_spacing=\"1024\" underline=\"none\" color=\"pink\" background=\"darkslategray\">Flathub</span>"
|
||||
"</b></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);
|
||||
|
||||
@@ -260,12 +260,19 @@ gtk_message_row_state_flags_changed (GtkWidget *widget,
|
||||
GTK_WIDGET_CLASS (gtk_message_row_parent_class)->state_flags_changed (widget, previous_state_flags);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_message_row_dispose (GObject *obj)
|
||||
{
|
||||
gtk_widget_dispose_template (GTK_WIDGET (obj), GTK_TYPE_MESSAGE_ROW);
|
||||
G_OBJECT_CLASS (gtk_message_row_parent_class)->dispose (obj);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_message_row_finalize (GObject *obj)
|
||||
{
|
||||
GtkMessageRowPrivate *priv = GTK_MESSAGE_ROW (obj)->priv;
|
||||
g_object_unref (priv->message);
|
||||
G_OBJECT_CLASS (gtk_message_row_parent_class)->finalize(obj);
|
||||
G_OBJECT_CLASS (gtk_message_row_parent_class)->finalize (obj);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -274,6 +281,7 @@ gtk_message_row_class_init (GtkMessageRowClass *klass)
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_message_row_dispose;
|
||||
object_class->finalize = gtk_message_row_finalize;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class, "/listbox/listbox.ui");
|
||||
|
||||
@@ -42,8 +42,7 @@ do_listbox_controls (GtkWidget *do_widget)
|
||||
GtkBuilder *builder;
|
||||
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope),
|
||||
"row_activated", G_CALLBACK (row_activated));
|
||||
gtk_builder_cscope_add_callback (scope, row_activated);
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
|
||||
|
||||
@@ -356,10 +356,10 @@ do_listview_settings (GtkWidget *do_widget)
|
||||
g_type_ensure (SETTINGS_TYPE_KEY);
|
||||
|
||||
scope = gtk_builder_cscope_new ();
|
||||
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_enabled", (GCallback)search_enabled);
|
||||
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "search_changed", (GCallback)search_changed);
|
||||
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "stop_search", (GCallback)stop_search);
|
||||
gtk_builder_cscope_add_callback_symbol (GTK_BUILDER_CSCOPE (scope), "item_value_changed", (GCallback)item_value_changed);
|
||||
gtk_builder_cscope_add_callback (scope, search_enabled);
|
||||
gtk_builder_cscope_add_callback (scope, search_changed);
|
||||
gtk_builder_cscope_add_callback (scope, stop_search);
|
||||
gtk_builder_cscope_add_callback (scope, item_value_changed);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include <gtk/gtk.h>
|
||||
#include "script-names.h"
|
||||
#include "unicode-names.h"
|
||||
#include "simplelabel.h"
|
||||
|
||||
|
||||
#define UCD_TYPE_ITEM (ucd_item_get_type ())
|
||||
@@ -103,9 +102,7 @@ setup_centered_label (GtkSignalListItemFactory *factory,
|
||||
GObject *listitem)
|
||||
{
|
||||
GtkWidget *label;
|
||||
label = simple_label_new ();
|
||||
simple_label_set_min_chars (SIMPLE_LABEL (label), 3);
|
||||
simple_label_set_nat_chars (SIMPLE_LABEL (label), 20);
|
||||
label = gtk_label_new ("");
|
||||
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
|
||||
}
|
||||
|
||||
@@ -114,9 +111,8 @@ setup_label (GtkSignalListItemFactory *factory,
|
||||
GObject *listitem)
|
||||
{
|
||||
GtkWidget *label;
|
||||
label = simple_label_new ();
|
||||
simple_label_set_min_chars (SIMPLE_LABEL (label), 3);
|
||||
simple_label_set_nat_chars (SIMPLE_LABEL (label), 20);
|
||||
label = gtk_label_new ("");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
|
||||
}
|
||||
|
||||
@@ -125,9 +121,10 @@ setup_ellipsizing_label (GtkSignalListItemFactory *factory,
|
||||
GObject *listitem)
|
||||
{
|
||||
GtkWidget *label;
|
||||
label = simple_label_new ();
|
||||
simple_label_set_min_chars (SIMPLE_LABEL (label), 3);
|
||||
simple_label_set_nat_chars (SIMPLE_LABEL (label), 20);
|
||||
label = gtk_label_new ("");
|
||||
gtk_label_set_xalign (GTK_LABEL (label), 0);
|
||||
gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
|
||||
gtk_label_set_width_chars (GTK_LABEL (label), 20);
|
||||
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
|
||||
}
|
||||
|
||||
@@ -145,7 +142,7 @@ bind_codepoint (GtkSignalListItemFactory *factory,
|
||||
codepoint = ucd_item_get_codepoint (UCD_ITEM (item));
|
||||
|
||||
g_snprintf (buffer, 10, "%#06x", codepoint);
|
||||
simple_label_set_text (SIMPLE_LABEL (label), buffer);
|
||||
gtk_label_set_label (GTK_LABEL (label), buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -164,7 +161,7 @@ bind_char (GtkSignalListItemFactory *factory,
|
||||
if (g_unichar_isprint (codepoint))
|
||||
g_unichar_to_utf8 (codepoint, buffer);
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), buffer);
|
||||
gtk_label_set_label (GTK_LABEL (label), buffer);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -179,7 +176,7 @@ bind_name (GtkSignalListItemFactory *factory,
|
||||
item = gtk_list_item_get_item (GTK_LIST_ITEM (listitem));
|
||||
name = ucd_item_get_name (UCD_ITEM (item));
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), name);
|
||||
gtk_label_set_label (GTK_LABEL (label), name);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -194,7 +191,7 @@ bind_type (GtkSignalListItemFactory *factory,
|
||||
item = gtk_list_item_get_item (GTK_LIST_ITEM (listitem));
|
||||
codepoint = ucd_item_get_codepoint (UCD_ITEM (item));
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), get_unicode_type_name (g_unichar_type (codepoint)));
|
||||
gtk_label_set_label (GTK_LABEL (label), get_unicode_type_name (g_unichar_type (codepoint)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -209,7 +206,7 @@ bind_break_type (GtkSignalListItemFactory *factory,
|
||||
item = gtk_list_item_get_item (GTK_LIST_ITEM (listitem));
|
||||
codepoint = ucd_item_get_codepoint (UCD_ITEM (item));
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), get_break_type_name (g_unichar_break_type (codepoint)));
|
||||
gtk_label_set_label (GTK_LABEL (label), get_break_type_name (g_unichar_break_type (codepoint)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -224,7 +221,7 @@ bind_combining_class (GtkSignalListItemFactory *factory,
|
||||
item = gtk_list_item_get_item (GTK_LIST_ITEM (listitem));
|
||||
codepoint = ucd_item_get_codepoint (UCD_ITEM (item));
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), get_combining_class_name (g_unichar_combining_class (codepoint)));
|
||||
gtk_label_set_label (GTK_LABEL (label), get_combining_class_name (g_unichar_combining_class (codepoint)));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -241,7 +238,7 @@ bind_script (GtkSignalListItemFactory *factory,
|
||||
codepoint = ucd_item_get_codepoint (UCD_ITEM (item));
|
||||
script = g_unichar_get_script (codepoint);
|
||||
|
||||
simple_label_set_text (SIMPLE_LABEL (label), get_script_name (script));
|
||||
gtk_label_set_label (GTK_LABEL (label), get_script_name (script));
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/* Lists/Words
|
||||
* #Keywords: GtkListView, GtkFilterListModel
|
||||
* #Keywords: GtkListView, GtkFilterListModel, GtkInscription
|
||||
*
|
||||
* This demo shows filtering a long list - of words.
|
||||
*
|
||||
@@ -17,10 +17,9 @@ const char *factory_text =
|
||||
"<interface>\n"
|
||||
" <template class='GtkListItem'>\n"
|
||||
" <property name='child'>\n"
|
||||
" <object class='GtkLabel'>\n"
|
||||
" <property name='ellipsize'>end</property>\n"
|
||||
" <object class='GtkInscription'>\n"
|
||||
" <property name='xalign'>0</property>\n"
|
||||
" <binding name='label'>\n"
|
||||
" <binding name='text'>\n"
|
||||
" <lookup name='string' type='GtkStringObject'>\n"
|
||||
" <lookup name='item'>GtkListItem</lookup>\n"
|
||||
" </lookup>\n"
|
||||
|
||||
@@ -7,9 +7,9 @@
|
||||
<lookup name="item">GtkListItem</lookup>
|
||||
</binding>
|
||||
<property name="child">
|
||||
<object class="GtkLabel">
|
||||
<property name="halign">start</property>
|
||||
<binding name="label">
|
||||
<object class="GtkInscription">
|
||||
<property name="hexpand">1</property>
|
||||
<binding name="text">
|
||||
<lookup name="title" type="GtkDemo">
|
||||
<lookup name="item">expander</lookup>
|
||||
</lookup>
|
||||
|
||||
@@ -73,6 +73,7 @@ demos = files([
|
||||
'peg_solitaire.c',
|
||||
'pickers.c',
|
||||
'printing.c',
|
||||
'read_more.c',
|
||||
'revealer.c',
|
||||
'rotated_text.c',
|
||||
'scale.c',
|
||||
@@ -130,7 +131,6 @@ extra_demo_sources = files([
|
||||
'unicode-names.c',
|
||||
'suggestionentry.c',
|
||||
'language-names.c',
|
||||
'simplelabel.c',
|
||||
])
|
||||
|
||||
if os_unix
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* #Keywords: GtkColorChooser, GtkFontChooser, GtkApplicationChooser
|
||||
*
|
||||
* These widgets are mainly intended for use in preference dialogs.
|
||||
* They allow to select colors, fonts, directories and applications.
|
||||
* They allow to select colors, fonts and applications.
|
||||
*
|
||||
* This demo shows both the default appearance for these dialogs,
|
||||
* as well as some of the customizations that are possible.
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
/* Read More
|
||||
* #Keywords: GtkInscription
|
||||
*
|
||||
* A simple implementation of a widget that can either
|
||||
* display a lot of text or just the first few lines with a
|
||||
* "Read More" button.
|
||||
*/
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define READ_TYPE_MORE (read_more_get_type ())
|
||||
G_DECLARE_FINAL_TYPE(ReadMore, read_more, READ, MORE, GtkWidget)
|
||||
|
||||
struct _ReadMore {
|
||||
GtkWidget parent_instance;
|
||||
|
||||
GtkWidget *label;
|
||||
GtkWidget *inscription;
|
||||
GtkWidget *box;
|
||||
gboolean show_more;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE (ReadMore, read_more, GTK_TYPE_WIDGET)
|
||||
|
||||
static GtkSizeRequestMode
|
||||
read_more_get_request_mode (GtkWidget *widget)
|
||||
{
|
||||
return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
ReadMore *self = READ_MORE (widget);
|
||||
int label_min, label_nat, label_min_baseline, label_nat_baseline;
|
||||
int box_min, box_nat, box_min_baseline, box_nat_baseline;
|
||||
int min_check;
|
||||
|
||||
if (self->show_more)
|
||||
min_check = G_MAXINT;
|
||||
else if (for_size >= 0)
|
||||
gtk_widget_measure (self->box, 1 - orientation, -1, &min_check, NULL, NULL, NULL);
|
||||
else
|
||||
min_check = -1;
|
||||
|
||||
if (min_check > for_size)
|
||||
{
|
||||
gtk_widget_measure (self->label,
|
||||
orientation,
|
||||
for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
return;
|
||||
}
|
||||
|
||||
else if (for_size >= 0)
|
||||
gtk_widget_measure (self->label, 1 - orientation, -1, &min_check, NULL, NULL, NULL);
|
||||
else
|
||||
min_check = -1;
|
||||
|
||||
if (min_check > for_size)
|
||||
{
|
||||
gtk_widget_measure (self->box,
|
||||
orientation,
|
||||
for_size,
|
||||
minimum, natural,
|
||||
minimum_baseline, natural_baseline);
|
||||
return;
|
||||
}
|
||||
|
||||
gtk_widget_measure (self->label,
|
||||
orientation,
|
||||
for_size,
|
||||
&label_min, &label_nat,
|
||||
&label_min_baseline, &label_nat_baseline);
|
||||
gtk_widget_measure (self->box,
|
||||
orientation,
|
||||
for_size,
|
||||
&box_min, &box_nat,
|
||||
&box_min_baseline, &box_nat_baseline);
|
||||
|
||||
*minimum = MIN (label_min, box_min);
|
||||
*natural = MIN (label_nat, box_nat);
|
||||
|
||||
/* FIXME: Figure out baselines! */
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
ReadMore *self = READ_MORE (widget);
|
||||
gboolean show_more;
|
||||
|
||||
if (self->show_more)
|
||||
{
|
||||
show_more = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
int needed;
|
||||
|
||||
/* check to see if we have enough space to show all text */
|
||||
gtk_widget_measure (self->label,
|
||||
GTK_ORIENTATION_VERTICAL,
|
||||
width,
|
||||
&needed, NULL, NULL, NULL);
|
||||
|
||||
show_more = needed <= height;
|
||||
}
|
||||
|
||||
gtk_widget_set_child_visible (self->label, show_more);
|
||||
gtk_widget_set_child_visible (self->box, !show_more);
|
||||
|
||||
if (show_more)
|
||||
gtk_widget_size_allocate (self->label, &(GtkAllocation) { 0, 0, width, height }, baseline);
|
||||
else
|
||||
gtk_widget_size_allocate (self->box, &(GtkAllocation) { 0, 0, width, height }, baseline);
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_dispose (GObject *object)
|
||||
{
|
||||
ReadMore *self = READ_MORE (object);
|
||||
|
||||
g_clear_pointer (&self->label, gtk_widget_unparent);
|
||||
g_clear_pointer (&self->box, gtk_widget_unparent);
|
||||
|
||||
G_OBJECT_CLASS (read_more_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_class_init (ReadMoreClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
widget_class->get_request_mode = read_more_get_request_mode;
|
||||
widget_class->measure = read_more_measure;
|
||||
widget_class->size_allocate = read_more_allocate;
|
||||
|
||||
object_class->dispose = read_more_dispose;
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_clicked (GtkButton *button,
|
||||
ReadMore *self)
|
||||
{
|
||||
self->show_more = TRUE;
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_init (ReadMore *self)
|
||||
{
|
||||
GtkWidget *button;
|
||||
|
||||
self->label = gtk_label_new (NULL);
|
||||
gtk_label_set_xalign (GTK_LABEL (self->label), 0.0);
|
||||
gtk_label_set_yalign (GTK_LABEL (self->label), 0.0);
|
||||
gtk_label_set_wrap (GTK_LABEL (self->label), TRUE);
|
||||
gtk_label_set_width_chars (GTK_LABEL (self->label), 3);
|
||||
gtk_label_set_max_width_chars (GTK_LABEL (self->label), 30);
|
||||
gtk_widget_set_parent (self->label, GTK_WIDGET (self));
|
||||
|
||||
self->box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
gtk_widget_set_vexpand (self->box, FALSE);
|
||||
gtk_widget_set_parent (self->box, GTK_WIDGET (self));
|
||||
|
||||
self->inscription = gtk_inscription_new (NULL);
|
||||
gtk_inscription_set_xalign (GTK_INSCRIPTION (self->inscription), 0.0);
|
||||
gtk_inscription_set_yalign (GTK_INSCRIPTION (self->inscription), 0.0);
|
||||
gtk_inscription_set_min_lines (GTK_INSCRIPTION (self->inscription), 3);
|
||||
gtk_inscription_set_nat_chars (GTK_INSCRIPTION (self->inscription), 30);
|
||||
gtk_widget_set_vexpand (self->inscription, TRUE);
|
||||
gtk_box_append (GTK_BOX (self->box), self->inscription);
|
||||
|
||||
button = gtk_button_new_with_label ("Read More");
|
||||
g_signal_connect (button, "clicked", G_CALLBACK (read_more_clicked), self);
|
||||
gtk_box_append (GTK_BOX (self->box), button);
|
||||
}
|
||||
|
||||
static void
|
||||
read_more_set_text (ReadMore *self,
|
||||
const char *text)
|
||||
{
|
||||
gtk_label_set_label (GTK_LABEL (self->label), text);
|
||||
gtk_inscription_set_text (GTK_INSCRIPTION (self->inscription), text);
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
read_more_new (const char *text)
|
||||
{
|
||||
ReadMore *self = g_object_new (READ_TYPE_MORE, NULL);
|
||||
|
||||
read_more_set_text (self, text);
|
||||
|
||||
return GTK_WIDGET (self);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
do_read_more (GtkWidget *do_widget)
|
||||
{
|
||||
static GtkWidget *window = NULL;
|
||||
|
||||
if (!window)
|
||||
{
|
||||
GtkWidget *readmore;
|
||||
|
||||
window = gtk_window_new ();
|
||||
gtk_window_set_display (GTK_WINDOW (window),
|
||||
gtk_widget_get_display (do_widget));
|
||||
gtk_window_set_title (GTK_WINDOW (window), "Read More");
|
||||
g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window);
|
||||
|
||||
readmore = read_more_new (
|
||||
"I'd just like to interject for a moment. What you're referring to as Linux, is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX.\n"
|
||||
"\n"
|
||||
"Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called \"Linux\", and many of its users are not aware that it is basically the GNU system, developed by the GNU Project.\n"
|
||||
"\n"
|
||||
"There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine's resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called \"Linux\" distributions are really distributions of GNU/Linux.");
|
||||
gtk_window_set_child (GTK_WINDOW (window), readmore);
|
||||
}
|
||||
|
||||
if (!gtk_widget_get_visible (window))
|
||||
gtk_widget_show (window);
|
||||
else
|
||||
gtk_window_destroy (GTK_WINDOW (window));
|
||||
|
||||
return window;
|
||||
}
|
||||
@@ -1,260 +0,0 @@
|
||||
#include "simplelabel.h"
|
||||
|
||||
struct _SimpleLabel
|
||||
{
|
||||
GtkWidget parent_instance;
|
||||
|
||||
PangoLayout *layout;
|
||||
int min_chars;
|
||||
int nat_chars;
|
||||
|
||||
int min_width;
|
||||
int nat_width;
|
||||
int height;
|
||||
};
|
||||
|
||||
struct _SimpleLabelClass
|
||||
{
|
||||
GtkWidgetClass parent_class;
|
||||
};
|
||||
|
||||
enum {
|
||||
PROP_TEXT = 1,
|
||||
PROP_MIN_CHARS,
|
||||
PROP_NAT_CHARS,
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
G_DEFINE_TYPE (SimpleLabel, simple_label, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
simple_label_init (SimpleLabel *self)
|
||||
{
|
||||
self->layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), "");
|
||||
pango_layout_set_ellipsize (self->layout, PANGO_ELLIPSIZE_NONE);
|
||||
pango_layout_set_wrap (self->layout, PANGO_WRAP_WORD);
|
||||
pango_layout_set_width (self->layout, -1);
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_dispose (GObject *object)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (object);
|
||||
|
||||
g_clear_object (&self->layout);
|
||||
|
||||
G_OBJECT_CLASS (simple_label_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_set_property (GObject *object,
|
||||
guint prop_id,
|
||||
const GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TEXT:
|
||||
simple_label_set_text (self, g_value_get_string (value));
|
||||
break;
|
||||
|
||||
case PROP_MIN_CHARS:
|
||||
simple_label_set_min_chars (self, g_value_get_int (value));
|
||||
break;
|
||||
|
||||
case PROP_NAT_CHARS:
|
||||
simple_label_set_nat_chars (self, g_value_get_int (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
GParamSpec *pspec)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (object);
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_TEXT:
|
||||
g_value_set_string (value, pango_layout_get_text (self->layout));
|
||||
break;
|
||||
|
||||
case PROP_MIN_CHARS:
|
||||
g_value_set_int (value, self->min_chars);
|
||||
break;
|
||||
|
||||
case PROP_NAT_CHARS:
|
||||
g_value_set_int (value, self->nat_chars);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_measure (GtkWidget *widget,
|
||||
GtkOrientation orientation,
|
||||
int for_size,
|
||||
int *minimum,
|
||||
int *natural,
|
||||
int *minimum_baseline,
|
||||
int *natural_baseline)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (widget);
|
||||
|
||||
if (orientation == GTK_ORIENTATION_VERTICAL)
|
||||
{
|
||||
*minimum = *natural = self->height;
|
||||
}
|
||||
else
|
||||
{
|
||||
*minimum = self->min_width;
|
||||
*natural = self->nat_width;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_size_allocate (GtkWidget *widget,
|
||||
int width,
|
||||
int height,
|
||||
int baseline)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (widget);
|
||||
|
||||
pango_layout_set_width (self->layout, width * PANGO_SCALE);
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_snapshot (GtkWidget *widget,
|
||||
GtkSnapshot *snapshot)
|
||||
{
|
||||
SimpleLabel *self = SIMPLE_LABEL (widget);
|
||||
GtkStyleContext *context;
|
||||
|
||||
context = gtk_widget_get_style_context (widget);
|
||||
|
||||
gtk_snapshot_render_layout (snapshot, context, 0, 0, self->layout);
|
||||
}
|
||||
|
||||
static void
|
||||
simple_label_class_init (SimpleLabelClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->dispose = simple_label_dispose;
|
||||
object_class->set_property = simple_label_set_property;
|
||||
object_class->get_property = simple_label_get_property;
|
||||
|
||||
widget_class->measure = simple_label_measure;
|
||||
widget_class->size_allocate = simple_label_size_allocate;
|
||||
widget_class->snapshot = simple_label_snapshot;
|
||||
|
||||
properties[PROP_TEXT] =
|
||||
g_param_spec_string ("text", "Text", "Text",
|
||||
NULL,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
properties[PROP_MIN_CHARS] =
|
||||
g_param_spec_int ("min-chars", "Minimum Characters", "Minimum Characters",
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
properties[PROP_NAT_CHARS] =
|
||||
g_param_spec_int ("nat-chars", "Natural Characters", "Natural Characters",
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE);
|
||||
|
||||
g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
|
||||
}
|
||||
|
||||
GtkWidget *
|
||||
simple_label_new (void)
|
||||
{
|
||||
return g_object_new (SIMPLE_TYPE_LABEL, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
simple_label_set_text (SimpleLabel *self,
|
||||
const char *text)
|
||||
{
|
||||
if (strcmp (text, pango_layout_get_text (self->layout)) == 0)
|
||||
return;
|
||||
|
||||
pango_layout_set_text (self->layout, text, -1);
|
||||
|
||||
gtk_widget_queue_draw (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_TEXT]);
|
||||
}
|
||||
|
||||
static void
|
||||
recalculate (SimpleLabel *self)
|
||||
{
|
||||
PangoContext *context;
|
||||
PangoFontMetrics *metrics;
|
||||
int char_width;
|
||||
int digit_width;
|
||||
int width;
|
||||
int ascent;
|
||||
int descent;
|
||||
|
||||
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
|
||||
metrics = pango_context_get_metrics (context,
|
||||
pango_context_get_font_description (context),
|
||||
pango_context_get_language (context));
|
||||
char_width = pango_font_metrics_get_approximate_char_width (metrics);
|
||||
digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
|
||||
ascent = pango_font_metrics_get_ascent (metrics);
|
||||
descent = pango_font_metrics_get_descent (metrics);
|
||||
pango_font_metrics_unref (metrics);
|
||||
|
||||
width = MAX (char_width, digit_width);
|
||||
|
||||
self->min_width = (width * self->min_chars) / PANGO_SCALE;
|
||||
self->nat_width = (width * self->nat_chars) / PANGO_SCALE;
|
||||
self->height = (ascent + descent) / PANGO_SCALE;
|
||||
}
|
||||
|
||||
void
|
||||
simple_label_set_min_chars (SimpleLabel *self,
|
||||
int min_chars)
|
||||
{
|
||||
if (self->min_chars == min_chars)
|
||||
return;
|
||||
|
||||
self->min_chars = min_chars;
|
||||
|
||||
recalculate (self);
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_MIN_CHARS]);
|
||||
}
|
||||
|
||||
void
|
||||
simple_label_set_nat_chars (SimpleLabel *self,
|
||||
int nat_chars)
|
||||
{
|
||||
if (self->nat_chars == nat_chars)
|
||||
return;
|
||||
|
||||
self->nat_chars = nat_chars;
|
||||
|
||||
recalculate (self);
|
||||
gtk_widget_queue_resize (GTK_WIDGET (self));
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_NAT_CHARS]);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#define SIMPLE_TYPE_LABEL (simple_label_get_type ())
|
||||
G_DECLARE_FINAL_TYPE (SimpleLabel, simple_label, SIMPLE, LABEL, GtkWidget)
|
||||
|
||||
GtkWidget * simple_label_new (void);
|
||||
|
||||
void simple_label_set_text (SimpleLabel *self,
|
||||
const char *text);
|
||||
void simple_label_set_min_chars (SimpleLabel *self,
|
||||
int min_chars);
|
||||
void simple_label_set_nat_chars (SimpleLabel *self,
|
||||
int nat_chars);
|
||||
@@ -137,7 +137,7 @@ insert_text (GtkTextView *view)
|
||||
|
||||
icon_theme = gtk_icon_theme_get_for_display (gtk_widget_get_display (widget));
|
||||
icon = gtk_icon_theme_lookup_icon (icon_theme,
|
||||
"face-cool",
|
||||
"drive-harddisk",
|
||||
NULL,
|
||||
32, 1,
|
||||
gtk_widget_get_direction (widget),
|
||||
@@ -239,8 +239,6 @@ insert_text (GtkTextView *view)
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, "The buffer can have images in it: ", -1);
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, GDK_PAINTABLE (icon));
|
||||
|
||||
gtk_text_buffer_insert_paintable (buffer, &iter, nuclear);
|
||||
|
||||
gtk_text_buffer_insert (buffer, &iter, " for example.\n\n", -1);
|
||||
@@ -441,11 +439,12 @@ attach_widgets (GtkTextView *text_view)
|
||||
{
|
||||
widget = gtk_scale_new (GTK_ORIENTATION_HORIZONTAL, NULL);
|
||||
gtk_range_set_range (GTK_RANGE (widget), 0, 100);
|
||||
gtk_widget_set_size_request (widget, 70, -1);
|
||||
gtk_widget_set_size_request (widget, 100, -1);
|
||||
}
|
||||
else if (i == 3)
|
||||
{
|
||||
widget = gtk_entry_new ();
|
||||
gtk_editable_set_width_chars (GTK_EDITABLE (widget), 10);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -409,6 +409,14 @@ icon_browser_window_init (IconBrowserWindow *win)
|
||||
g_signal_connect (win->context_model, "notify::selected", G_CALLBACK (selected_name_changed), win);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_dispose (GObject *object)
|
||||
{
|
||||
gtk_widget_dispose_template (GTK_WIDGET (object), ICON_BROWSER_WINDOW_TYPE);
|
||||
|
||||
G_OBJECT_CLASS (icon_browser_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
icon_browser_window_finalize (GObject *object)
|
||||
{
|
||||
@@ -424,6 +432,7 @@ icon_browser_window_class_init (IconBrowserWindowClass *class)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
|
||||
object_class->dispose = icon_browser_window_dispose;
|
||||
object_class->finalize = icon_browser_window_finalize;
|
||||
|
||||
g_type_ensure (IB_TYPE_ICON);
|
||||
|
||||
@@ -57,6 +57,7 @@ struct _NodeEditorWindow
|
||||
GtkWidget *testcase_cairo_checkbutton;
|
||||
GtkWidget *testcase_name_entry;
|
||||
GtkWidget *testcase_save_button;
|
||||
GtkWidget *scale_scale;
|
||||
|
||||
GtkWidget *renderer_listbox;
|
||||
GListStore *renderers;
|
||||
@@ -171,6 +172,7 @@ text_changed (GtkTextBuffer *buffer,
|
||||
GBytes *bytes;
|
||||
GtkTextIter iter;
|
||||
GtkTextIter start, end;
|
||||
float scale;
|
||||
|
||||
g_array_remove_range (self->errors, 0, self->errors->len);
|
||||
text = get_current_text (self->text_buffer);
|
||||
@@ -181,6 +183,17 @@ text_changed (GtkTextBuffer *buffer,
|
||||
|
||||
/* If this is too slow, go fix the parser performance */
|
||||
self->node = gsk_render_node_deserialize (bytes, deserialize_error_func, self);
|
||||
|
||||
scale = gtk_scale_button_get_value (GTK_SCALE_BUTTON (self->scale_scale));
|
||||
if (self->node && scale != 1.0)
|
||||
{
|
||||
GskRenderNode *node;
|
||||
|
||||
node = gsk_transform_node_new (self->node, gsk_transform_scale (NULL, scale, scale));
|
||||
gsk_render_node_unref (self->node);
|
||||
self->node = node;
|
||||
}
|
||||
|
||||
g_bytes_unref (bytes);
|
||||
if (self->node)
|
||||
{
|
||||
@@ -277,6 +290,14 @@ text_changed (GtkTextBuffer *buffer,
|
||||
&start, &end);
|
||||
}
|
||||
|
||||
static void
|
||||
scale_changed (GObject *object,
|
||||
GParamSpec *pspec,
|
||||
NodeEditorWindow *self)
|
||||
{
|
||||
text_changed (self->text_buffer, self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
text_view_query_tooltip_cb (GtkWidget *widget,
|
||||
int x,
|
||||
@@ -852,6 +873,14 @@ dark_mode_cb (GtkToggleButton *button,
|
||||
NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
node_editor_window_dispose (GObject *object)
|
||||
{
|
||||
gtk_widget_dispose_template (GTK_WIDGET (object), NODE_EDITOR_WINDOW_TYPE);
|
||||
|
||||
G_OBJECT_CLASS (node_editor_window_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
node_editor_window_finalize (GObject *object)
|
||||
{
|
||||
@@ -946,6 +975,7 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (class);
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
|
||||
|
||||
object_class->dispose = node_editor_window_dispose;
|
||||
object_class->finalize = node_editor_window_finalize;
|
||||
|
||||
gtk_widget_class_set_template_from_resource (widget_class,
|
||||
@@ -962,6 +992,7 @@ node_editor_window_class_init (NodeEditorWindowClass *class)
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_cairo_checkbutton);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_name_entry);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, testcase_save_button);
|
||||
gtk_widget_class_bind_template_child (widget_class, NodeEditorWindow, scale_scale);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, text_view_query_tooltip_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, open_cb);
|
||||
@@ -1068,6 +1099,7 @@ node_editor_window_init (NodeEditorWindow *self)
|
||||
|
||||
self->text_buffer = gtk_text_buffer_new (self->tag_table);
|
||||
g_signal_connect (self->text_buffer, "changed", G_CALLBACK (text_changed), self);
|
||||
g_signal_connect (self->scale_scale, "notify::value", G_CALLBACK (scale_changed), self);
|
||||
gtk_text_view_set_buffer (GTK_TEXT_VIEW (self->text_view), self->text_buffer);
|
||||
|
||||
/* Default */
|
||||
|
||||
@@ -157,6 +157,23 @@
|
||||
<signal name="notify::active" handler="dark_mode_cb" swapped="0"/>
|
||||
</object>
|
||||
</child>
|
||||
<child type="end">
|
||||
<object class="GtkScaleButton" id="scale_scale">
|
||||
<property name="focus-on-click">0</property>
|
||||
<property name="valign">center</property>
|
||||
<property name="adjustment">
|
||||
<object class="GtkAdjustment">
|
||||
<property name="lower">1</property>
|
||||
<property name="value">1</property>
|
||||
<property name="upper">10</property>
|
||||
<property name="step-increment">0.1</property>
|
||||
<property name="page-increment">0.5</property>
|
||||
</object>
|
||||
</property>
|
||||
<property name="icons">zoom-in-symbolic</property>
|
||||
<property name="tooltip-text" translatable="yes">Scale the image</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
|
||||
@@ -2081,26 +2081,24 @@ activate (GApplication *app)
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
scope = gtk_builder_cscope_new ();
|
||||
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_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,
|
||||
"on_range_to_changed", (GCallback)on_range_to_changed,
|
||||
"on_picture_drag_prepare", (GCallback)on_picture_drag_prepare,
|
||||
"on_picture_drop", (GCallback)on_picture_drop,
|
||||
"tab_close_cb", (GCallback)tab_close_cb,
|
||||
"increase_icon_size", (GCallback)increase_icon_size,
|
||||
"decrease_icon_size", (GCallback)decrease_icon_size,
|
||||
"reset_icon_size", (GCallback)reset_icon_size,
|
||||
"osd_frame_pressed", (GCallback)osd_frame_pressed,
|
||||
"age_entry_changed", (GCallback)age_entry_changed,
|
||||
"validate_more_details", (GCallback)validate_more_details,
|
||||
"mode_switch_state_set", (GCallback)mode_switch_state_set,
|
||||
"level_scale_value_changed", (GCallback)level_scale_value_changed,
|
||||
"transition_speed_changed", (GCallback)transition_speed_changed,
|
||||
NULL);
|
||||
gtk_builder_cscope_add_callback (scope, on_entry_icon_release);
|
||||
gtk_builder_cscope_add_callback (scope, on_scale_button_value_changed);
|
||||
gtk_builder_cscope_add_callback (scope, on_record_button_toggled);
|
||||
gtk_builder_cscope_add_callback (scope, on_page_combo_changed);
|
||||
gtk_builder_cscope_add_callback (scope, on_range_from_changed);
|
||||
gtk_builder_cscope_add_callback (scope, on_range_to_changed);
|
||||
gtk_builder_cscope_add_callback (scope, on_picture_drag_prepare);
|
||||
gtk_builder_cscope_add_callback (scope, on_picture_drop);
|
||||
gtk_builder_cscope_add_callback (scope, tab_close_cb);
|
||||
gtk_builder_cscope_add_callback (scope, increase_icon_size);
|
||||
gtk_builder_cscope_add_callback (scope, decrease_icon_size);
|
||||
gtk_builder_cscope_add_callback (scope, osd_frame_pressed);
|
||||
gtk_builder_cscope_add_callback (scope, age_entry_changed);
|
||||
gtk_builder_cscope_add_callback (scope, validate_more_details);
|
||||
gtk_builder_cscope_add_callback (scope, mode_switch_state_set);
|
||||
gtk_builder_cscope_add_callback (scope, level_scale_value_changed);
|
||||
gtk_builder_cscope_add_callback (scope, transition_speed_changed);
|
||||
gtk_builder_cscope_add_callback (scope, reset_icon_size);
|
||||
gtk_builder_set_scope (builder, scope);
|
||||
g_object_unref (scope);
|
||||
if (!gtk_builder_add_from_resource (builder, "/org/gtk/WidgetFactory4/widget-factory.ui", &error))
|
||||
|
||||
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
website_url = "https://www.gtk.org"
|
||||
authors = "GTK Development Team"
|
||||
logo_url = "gtk-logo.svg"
|
||||
license = "GPL-2.1-or-later"
|
||||
license = "LGPL-2.1-or-later"
|
||||
description = "The GTK toolkit"
|
||||
devhelp = true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ repository_url = "https://gitlab.gnome.org/GNOME/gtk.git"
|
||||
website_url = "https://www.gtk.org"
|
||||
authors = "GTK Development Team"
|
||||
logo_url = "gtk-logo.svg"
|
||||
license = "GPL-2.1-or-later"
|
||||
license = "LGPL-2.1-or-later"
|
||||
description = "The GTK toolkit"
|
||||
dependencies = ["Gdk-4.0"]
|
||||
devhelp = true
|
||||
|
||||
@@ -354,6 +354,7 @@ typedef struct {
|
||||
|
||||
typedef union {
|
||||
BroadwayReplyBase base;
|
||||
BroadwayReplySync sync;
|
||||
BroadwayReplyEvent event;
|
||||
BroadwayReplyQueryMouse query_mouse;
|
||||
BroadwayReplyNewSurface new_surface;
|
||||
|
||||
+14
-18
@@ -219,11 +219,7 @@ static void
|
||||
client_handle_request (BroadwayClient *client,
|
||||
BroadwayRequest *request)
|
||||
{
|
||||
BroadwayReplyNewSurface reply_new_surface;
|
||||
BroadwayReplySync reply_sync;
|
||||
BroadwayReplyQueryMouse reply_query_mouse;
|
||||
BroadwayReplyGrabPointer reply_grab_pointer;
|
||||
BroadwayReplyUngrabPointer reply_ungrab_pointer;
|
||||
BroadwayReply reply;
|
||||
guint32 before_serial, now_serial;
|
||||
guint32 global_id;
|
||||
int fd;
|
||||
@@ -233,7 +229,7 @@ client_handle_request (BroadwayClient *client,
|
||||
switch (request->base.type)
|
||||
{
|
||||
case BROADWAY_REQUEST_NEW_SURFACE:
|
||||
reply_new_surface.id =
|
||||
reply.new_surface.id =
|
||||
broadway_server_new_surface (server, client->id,
|
||||
request->new_surface.x,
|
||||
request->new_surface.y,
|
||||
@@ -241,9 +237,9 @@ client_handle_request (BroadwayClient *client,
|
||||
request->new_surface.height);
|
||||
client->surfaces =
|
||||
g_list_prepend (client->surfaces,
|
||||
GUINT_TO_POINTER (reply_new_surface.id));
|
||||
GUINT_TO_POINTER (reply.new_surface.id));
|
||||
|
||||
send_reply (client, request, (BroadwayReply *)&reply_new_surface, sizeof (reply_new_surface),
|
||||
send_reply (client, request, &reply, sizeof (reply.new_surface),
|
||||
BROADWAY_REPLY_NEW_SURFACE);
|
||||
break;
|
||||
case BROADWAY_REQUEST_FLUSH:
|
||||
@@ -251,7 +247,7 @@ client_handle_request (BroadwayClient *client,
|
||||
break;
|
||||
case BROADWAY_REQUEST_SYNC:
|
||||
broadway_server_flush (server);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_sync, sizeof (reply_sync),
|
||||
send_reply (client, request, &reply, sizeof (reply.sync),
|
||||
BROADWAY_REPLY_SYNC);
|
||||
break;
|
||||
case BROADWAY_REQUEST_ROUNDTRIP:
|
||||
@@ -261,11 +257,11 @@ client_handle_request (BroadwayClient *client,
|
||||
break;
|
||||
case BROADWAY_REQUEST_QUERY_MOUSE:
|
||||
broadway_server_query_mouse (server,
|
||||
&reply_query_mouse.surface,
|
||||
&reply_query_mouse.root_x,
|
||||
&reply_query_mouse.root_y,
|
||||
&reply_query_mouse.mask);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_query_mouse, sizeof (reply_query_mouse),
|
||||
&reply.query_mouse.surface,
|
||||
&reply.query_mouse.root_x,
|
||||
&reply.query_mouse.root_y,
|
||||
&reply.query_mouse.mask);
|
||||
send_reply (client, request, &reply, sizeof (reply.query_mouse),
|
||||
BROADWAY_REPLY_QUERY_MOUSE);
|
||||
break;
|
||||
case BROADWAY_REQUEST_DESTROY_SURFACE:
|
||||
@@ -361,21 +357,21 @@ client_handle_request (BroadwayClient *client,
|
||||
request->move_resize.height);
|
||||
break;
|
||||
case BROADWAY_REQUEST_GRAB_POINTER:
|
||||
reply_grab_pointer.status =
|
||||
reply.grab_pointer.status =
|
||||
broadway_server_grab_pointer (server,
|
||||
client->id,
|
||||
request->grab_pointer.id,
|
||||
request->grab_pointer.owner_events,
|
||||
request->grab_pointer.event_mask,
|
||||
request->grab_pointer.time_);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_grab_pointer, sizeof (reply_grab_pointer),
|
||||
send_reply (client, request, &reply, sizeof (reply.grab_pointer),
|
||||
BROADWAY_REPLY_GRAB_POINTER);
|
||||
break;
|
||||
case BROADWAY_REQUEST_UNGRAB_POINTER:
|
||||
reply_ungrab_pointer.status =
|
||||
reply.ungrab_pointer.status =
|
||||
broadway_server_ungrab_pointer (server,
|
||||
request->ungrab_pointer.time_);
|
||||
send_reply (client, request, (BroadwayReply *)&reply_ungrab_pointer, sizeof (reply_ungrab_pointer),
|
||||
send_reply (client, request, &reply, sizeof (reply.ungrab_pointer),
|
||||
BROADWAY_REPLY_UNGRAB_POINTER);
|
||||
break;
|
||||
case BROADWAY_REQUEST_FOCUS_SURFACE:
|
||||
|
||||
@@ -189,8 +189,7 @@ _gdk_broadway_events_got_input (GdkDisplay *display,
|
||||
message->pointer.state,
|
||||
message->scroll.dir == 0
|
||||
? GDK_SCROLL_UP
|
||||
: GDK_SCROLL_DOWN,
|
||||
FALSE);
|
||||
: GDK_SCROLL_DOWN);
|
||||
|
||||
node = _gdk_event_queue_append (display, event);
|
||||
_gdk_windowing_got_event (display, node, event, message->base.serial);
|
||||
|
||||
@@ -117,6 +117,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
|
||||
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
|
||||
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
|
||||
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)" },
|
||||
{ "portals", GDK_DEBUG_PORTALS, "Force the use of portals" },
|
||||
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
|
||||
{ "gl-software", GDK_DEBUG_GL_SOFTWARE, "Force OpenGL software rendering" },
|
||||
{ "gl-texture-rect", GDK_DEBUG_GL_TEXTURE_RECT, "Use OpenGL texture rectangle extension" },
|
||||
@@ -360,21 +361,13 @@ gdk_running_in_sandbox (void)
|
||||
gboolean
|
||||
gdk_should_use_portal (void)
|
||||
{
|
||||
static const char *use_portal = NULL;
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (NULL, PORTALS))
|
||||
return TRUE;
|
||||
|
||||
if (G_UNLIKELY (use_portal == NULL))
|
||||
{
|
||||
if (gdk_running_in_sandbox ())
|
||||
use_portal = "1";
|
||||
else
|
||||
{
|
||||
use_portal = g_getenv ("GTK_USE_PORTAL");
|
||||
if (!use_portal)
|
||||
use_portal = "";
|
||||
}
|
||||
}
|
||||
if (gdk_running_in_sandbox ())
|
||||
return TRUE;
|
||||
|
||||
return use_portal[0] == '1';
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
PangoDirection
|
||||
|
||||
@@ -125,7 +125,7 @@ gdk_app_launch_context_class_init (GdkAppLaunchContextClass *klass)
|
||||
* The display that the `GdkAppLaunchContext` is on.
|
||||
*/
|
||||
g_object_class_install_property (gobject_class, PROP_DISPLAY,
|
||||
g_param_spec_object ("display", P_("Display"), P_("Display"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
+4
-12
@@ -357,9 +357,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
|
||||
* The `GdkDisplay` that the clipboard belongs to.
|
||||
*/
|
||||
properties[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"Display owning this clipboard",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -372,9 +370,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
|
||||
* The possible formats that the clipboard can provide its data in.
|
||||
*/
|
||||
properties[PROP_FORMATS] =
|
||||
g_param_spec_boxed ("formats",
|
||||
"Formats",
|
||||
"The possible formats for data",
|
||||
g_param_spec_boxed ("formats", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -386,9 +382,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
|
||||
* %TRUE if the contents of the clipboard are owned by this process.
|
||||
*/
|
||||
properties[PROP_LOCAL] =
|
||||
g_param_spec_boolean ("local",
|
||||
"Local",
|
||||
"If the contents are owned by this process",
|
||||
g_param_spec_boolean ("local", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -401,9 +395,7 @@ gdk_clipboard_class_init (GdkClipboardClass *class)
|
||||
* provided otherwise.
|
||||
*/
|
||||
properties[PROP_CONTENT] =
|
||||
g_param_spec_object ("content",
|
||||
"Content",
|
||||
"Provider of the clipboard's content",
|
||||
g_param_spec_object ("content", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_PROVIDER,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
|
||||
@@ -173,9 +173,7 @@ gdk_content_provider_class_init (GdkContentProviderClass *class)
|
||||
* The possible formats that the provider can provide its data in.
|
||||
*/
|
||||
properties[PROP_FORMATS] =
|
||||
g_param_spec_boxed ("formats",
|
||||
"Formats",
|
||||
"The possible formats for data",
|
||||
g_param_spec_boxed ("formats", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -187,9 +185,7 @@ gdk_content_provider_class_init (GdkContentProviderClass *class)
|
||||
* The subset of formats that clipboard managers should store this provider's data in.
|
||||
*/
|
||||
properties[PROP_STORABLE_FORMATS] =
|
||||
g_param_spec_boxed ("storable-formats",
|
||||
"Storable formats",
|
||||
"The formats that data should be stored in",
|
||||
g_param_spec_boxed ("storable-formats", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
|
||||
+5
-15
@@ -174,9 +174,7 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_FALLBACK,
|
||||
g_param_spec_object ("fallback",
|
||||
P_("Fallback"),
|
||||
P_("Cursor image to fall back to if this cursor cannot be displayed"),
|
||||
g_param_spec_object ("fallback", NULL, NULL,
|
||||
GDK_TYPE_CURSOR,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -188,9 +186,7 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HOTSPOT_X,
|
||||
g_param_spec_int ("hotspot-x",
|
||||
P_("Hotspot X"),
|
||||
P_("Horizontal offset of the cursor hotspot"),
|
||||
g_param_spec_int ("hotspot-x", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -202,9 +198,7 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_HOTSPOT_Y,
|
||||
g_param_spec_int ("hotspot-y",
|
||||
P_("Hotspot Y"),
|
||||
P_("Vertical offset of the cursor hotspot"),
|
||||
g_param_spec_int ("hotspot-y", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -218,9 +212,7 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_NAME,
|
||||
g_param_spec_string ("name",
|
||||
P_("Name"),
|
||||
P_("Name of this cursor"),
|
||||
g_param_spec_string ("name", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -234,9 +226,7 @@ gdk_cursor_class_init (GdkCursorClass *cursor_class)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_TEXTURE,
|
||||
g_param_spec_object ("texture",
|
||||
P_("Texture"),
|
||||
P_("The texture displayed by this cursor"),
|
||||
g_param_spec_object ("texture", NULL, NULL,
|
||||
GDK_TYPE_TEXTURE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
+14
-13
@@ -38,19 +38,20 @@ typedef enum {
|
||||
GDK_DEBUG_CLIPBOARD = 1 << 10,
|
||||
/* flags below are influencing behavior */
|
||||
GDK_DEBUG_NOGRABS = 1 << 11,
|
||||
GDK_DEBUG_GL_DISABLE = 1 << 12,
|
||||
GDK_DEBUG_GL_SOFTWARE = 1 << 13,
|
||||
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 14,
|
||||
GDK_DEBUG_GL_LEGACY = 1 << 15,
|
||||
GDK_DEBUG_GL_GLES = 1 << 16,
|
||||
GDK_DEBUG_GL_DEBUG = 1 << 17,
|
||||
GDK_DEBUG_GL_EGL = 1 << 18,
|
||||
GDK_DEBUG_GL_GLX = 1 << 19,
|
||||
GDK_DEBUG_GL_WGL = 1 << 20,
|
||||
GDK_DEBUG_VULKAN_DISABLE = 1 << 21,
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 22,
|
||||
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23,
|
||||
GDK_DEBUG_HIGH_DEPTH = 1 << 24,
|
||||
GDK_DEBUG_PORTALS = 1 << 12,
|
||||
GDK_DEBUG_GL_DISABLE = 1 << 13,
|
||||
GDK_DEBUG_GL_SOFTWARE = 1 << 14,
|
||||
GDK_DEBUG_GL_TEXTURE_RECT = 1 << 15,
|
||||
GDK_DEBUG_GL_LEGACY = 1 << 16,
|
||||
GDK_DEBUG_GL_GLES = 1 << 17,
|
||||
GDK_DEBUG_GL_DEBUG = 1 << 18,
|
||||
GDK_DEBUG_GL_EGL = 1 << 19,
|
||||
GDK_DEBUG_GL_GLX = 1 << 20,
|
||||
GDK_DEBUG_GL_WGL = 1 << 21,
|
||||
GDK_DEBUG_VULKAN_DISABLE = 1 << 22,
|
||||
GDK_DEBUG_VULKAN_VALIDATE = 1 << 23,
|
||||
GDK_DEBUG_DEFAULT_SETTINGS= 1 << 24,
|
||||
GDK_DEBUG_HIGH_DEPTH = 1 << 25,
|
||||
} GdkDebugFlags;
|
||||
|
||||
extern guint _gdk_debug_flags;
|
||||
|
||||
+16
-48
@@ -109,9 +109,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* The `GdkDisplay` the `GdkDevice` pertains to.
|
||||
*/
|
||||
device_props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Device Display"),
|
||||
P_("Display which the device belongs to"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -121,9 +119,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* The device name.
|
||||
*/
|
||||
device_props[PROP_NAME] =
|
||||
g_param_spec_string ("name",
|
||||
P_("Device name"),
|
||||
P_("Device name"),
|
||||
g_param_spec_string ("name", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
@@ -134,9 +130,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* Source type for the device.
|
||||
*/
|
||||
device_props[PROP_SOURCE] =
|
||||
g_param_spec_enum ("source",
|
||||
P_("Input source"),
|
||||
P_("Source type for the device"),
|
||||
g_param_spec_enum ("source", NULL, NULL,
|
||||
GDK_TYPE_INPUT_SOURCE,
|
||||
GDK_SOURCE_MOUSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -148,9 +142,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* Whether the device is represented by a cursor on the screen.
|
||||
*/
|
||||
device_props[PROP_HAS_CURSOR] =
|
||||
g_param_spec_boolean ("has-cursor",
|
||||
P_("Whether the device has a cursor"),
|
||||
P_("Whether there is a visible cursor following device motion"),
|
||||
g_param_spec_boolean ("has-cursor", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
@@ -161,9 +153,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* Number of axes in the device.
|
||||
*/
|
||||
device_props[PROP_N_AXES] =
|
||||
g_param_spec_uint ("n-axes",
|
||||
P_("Number of axes in the device"),
|
||||
P_("Number of axes in the device"),
|
||||
g_param_spec_uint ("n-axes", NULL, NULL,
|
||||
0, G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -176,9 +166,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* See [method@Gdk.Device.get_vendor_id].
|
||||
*/
|
||||
device_props[PROP_VENDOR_ID] =
|
||||
g_param_spec_string ("vendor-id",
|
||||
P_("Vendor ID"),
|
||||
P_("Vendor ID"),
|
||||
g_param_spec_string ("vendor-id", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
@@ -191,9 +179,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* See [method@Gdk.Device.get_product_id].
|
||||
*/
|
||||
device_props[PROP_PRODUCT_ID] =
|
||||
g_param_spec_string ("product-id",
|
||||
P_("Product ID"),
|
||||
P_("Product ID"),
|
||||
g_param_spec_string ("product-id", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
@@ -204,9 +190,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* `GdkSeat` of this device.
|
||||
*/
|
||||
device_props[PROP_SEAT] =
|
||||
g_param_spec_object ("seat",
|
||||
P_("Seat"),
|
||||
P_("Seat"),
|
||||
g_param_spec_object ("seat", NULL, NULL,
|
||||
GDK_TYPE_SEAT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_STATIC_STRINGS);
|
||||
@@ -220,9 +204,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* of touches is unknown.
|
||||
*/
|
||||
device_props[PROP_NUM_TOUCHES] =
|
||||
g_param_spec_uint ("num-touches",
|
||||
P_("Number of concurrent touches"),
|
||||
P_("Number of concurrent touches"),
|
||||
g_param_spec_uint ("num-touches", NULL, NULL,
|
||||
0, G_MAXUINT,
|
||||
0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -234,9 +216,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* The `GdkDeviceTool` that is currently used with this device.
|
||||
*/
|
||||
device_props[PROP_TOOL] =
|
||||
g_param_spec_object ("tool",
|
||||
P_("Tool"),
|
||||
P_("The tool that is currently used with this device"),
|
||||
g_param_spec_object ("tool", NULL, NULL,
|
||||
GDK_TYPE_DEVICE_TOOL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -248,9 +228,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_DIRECTION] =
|
||||
g_param_spec_enum ("direction",
|
||||
P_("Direction"),
|
||||
P_("The direction of the current layout of the keyboard"),
|
||||
g_param_spec_enum ("direction", NULL, NULL,
|
||||
PANGO_TYPE_DIRECTION, PANGO_DIRECTION_NEUTRAL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -262,9 +240,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_HAS_BIDI_LAYOUTS] =
|
||||
g_param_spec_boolean ("has-bidi-layouts",
|
||||
P_("Has bidi layouts"),
|
||||
P_("Whether the keyboard has bidi layouts"),
|
||||
g_param_spec_boolean ("has-bidi-layouts", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -276,9 +252,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_CAPS_LOCK_STATE] =
|
||||
g_param_spec_boolean ("caps-lock-state",
|
||||
P_("Caps lock state"),
|
||||
P_("Whether the keyboard caps lock is on"),
|
||||
g_param_spec_boolean ("caps-lock-state", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -290,9 +264,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_NUM_LOCK_STATE] =
|
||||
g_param_spec_boolean ("num-lock-state",
|
||||
P_("Num lock state"),
|
||||
P_("Whether the keyboard num lock is on"),
|
||||
g_param_spec_boolean ("num-lock-state", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -304,9 +276,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_SCROLL_LOCK_STATE] =
|
||||
g_param_spec_boolean ("scroll-lock-state",
|
||||
P_("Scroll lock state"),
|
||||
P_("Whether the keyboard scroll lock is on"),
|
||||
g_param_spec_boolean ("scroll-lock-state", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -318,9 +288,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
|
||||
* This is only relevant for keyboard devices.
|
||||
*/
|
||||
device_props[PROP_MODIFIER_STATE] =
|
||||
g_param_spec_flags ("modifier-state",
|
||||
P_("Modifier state"),
|
||||
P_("The modifier state of the keyboard"),
|
||||
g_param_spec_flags ("modifier-state", NULL, NULL,
|
||||
GDK_TYPE_MODIFIER_TYPE, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
+7
-2
@@ -66,10 +66,15 @@ typedef enum
|
||||
/**
|
||||
* GdkTimeCoord:
|
||||
* @time: The timestamp for this event
|
||||
* @flags: Flags indicating what axes are present
|
||||
* @axes: (array fixed-size=12): axis values
|
||||
* @flags: Flags indicating what axes are present, see [flags@Gdk.AxisFlags]
|
||||
* @axes: (array fixed-size=12): axis values, indexed by [enum@Gdk.AxisUse]
|
||||
*
|
||||
* A `GdkTimeCoord` stores a single event in a motion history.
|
||||
*
|
||||
* To check whether an axis is present, check whether the corresponding
|
||||
* flag from the [flags@Gdk.AxisFlags] enumeration is set in the @flags
|
||||
* To access individual axis values, use the values of the values of
|
||||
* the [enum@Gdk.AxisUse] enumerations as indices.
|
||||
*/
|
||||
struct _GdkTimeCoord
|
||||
{
|
||||
|
||||
+4
-12
@@ -111,9 +111,7 @@ gdk_device_tool_class_init (GdkDeviceToolClass *klass)
|
||||
*
|
||||
* The serial number of the tool.
|
||||
*/
|
||||
tool_props[TOOL_PROP_SERIAL] = g_param_spec_uint64 ("serial",
|
||||
"Serial",
|
||||
"Serial number",
|
||||
tool_props[TOOL_PROP_SERIAL] = g_param_spec_uint64 ("serial", NULL, NULL,
|
||||
0, G_MAXUINT64, 0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -124,9 +122,7 @@ gdk_device_tool_class_init (GdkDeviceToolClass *klass)
|
||||
*
|
||||
* The type of the tool.
|
||||
*/
|
||||
tool_props[TOOL_PROP_TOOL_TYPE] = g_param_spec_enum ("tool-type",
|
||||
"Tool type",
|
||||
"Tool type",
|
||||
tool_props[TOOL_PROP_TOOL_TYPE] = g_param_spec_enum ("tool-type", NULL, NULL,
|
||||
GDK_TYPE_DEVICE_TOOL_TYPE,
|
||||
GDK_DEVICE_TOOL_TYPE_UNKNOWN,
|
||||
G_PARAM_READWRITE |
|
||||
@@ -138,9 +134,7 @@ gdk_device_tool_class_init (GdkDeviceToolClass *klass)
|
||||
*
|
||||
* The axes of the tool.
|
||||
*/
|
||||
tool_props[TOOL_PROP_AXES] = g_param_spec_flags ("axes",
|
||||
"Axes",
|
||||
"Tool axes",
|
||||
tool_props[TOOL_PROP_AXES] = g_param_spec_flags ("axes", NULL, NULL,
|
||||
GDK_TYPE_AXIS_FLAGS, 0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY);
|
||||
@@ -150,9 +144,7 @@ gdk_device_tool_class_init (GdkDeviceToolClass *klass)
|
||||
*
|
||||
* The hardware ID of the tool.
|
||||
*/
|
||||
tool_props[TOOL_PROP_HARDWARE_ID] = g_param_spec_uint64 ("hardware-id",
|
||||
"Hardware ID",
|
||||
"Hardware ID",
|
||||
tool_props[TOOL_PROP_HARDWARE_ID] = g_param_spec_uint64 ("hardware-id", NULL, NULL,
|
||||
0, G_MAXUINT64, 0,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
+6
-12
@@ -213,9 +213,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
* %TRUE if the display properly composites the alpha channel.
|
||||
*/
|
||||
props[PROP_COMPOSITED] =
|
||||
g_param_spec_boolean ("composited",
|
||||
P_("Composited"),
|
||||
P_("Composited"),
|
||||
g_param_spec_boolean ("composited", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -225,9 +223,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
* %TRUE if the display supports an alpha channel.
|
||||
*/
|
||||
props[PROP_RGBA] =
|
||||
g_param_spec_boolean ("rgba",
|
||||
P_("RGBA"),
|
||||
P_("RGBA"),
|
||||
g_param_spec_boolean ("rgba", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -237,9 +233,7 @@ gdk_display_class_init (GdkDisplayClass *class)
|
||||
* %TRUE if the display supports input shapes.
|
||||
*/
|
||||
props[PROP_INPUT_SHAPES] =
|
||||
g_param_spec_boolean ("input-shapes",
|
||||
P_("Input shapes"),
|
||||
P_("Input shapes"),
|
||||
g_param_spec_boolean ("input-shapes", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -1628,10 +1622,10 @@ gdk_display_check_egl_extensions (EGLDisplay egl_display,
|
||||
/* translators: Arguments are the number of missing extensions
|
||||
* followed by a comma-separated list of their names */
|
||||
g_dngettext (GETTEXT_PACKAGE,
|
||||
"EGL implementation is missing extension %2$s",
|
||||
"EGL implementation is missing %d extensions: %s",
|
||||
"EGL implementation is missing extension %s",
|
||||
"EGL implementation is missing %2$d extensions: %1$s",
|
||||
n_missing),
|
||||
(int) n_missing, missing->str);
|
||||
missing->str, (int) n_missing);
|
||||
|
||||
g_string_free (missing, TRUE);
|
||||
return FALSE;
|
||||
|
||||
@@ -155,9 +155,7 @@ gdk_display_manager_class_init (GdkDisplayManagerClass *klass)
|
||||
*/
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_DEFAULT_DISPLAY,
|
||||
g_param_spec_object ("default-display",
|
||||
P_("Default Display"),
|
||||
P_("The default display for GDK"),
|
||||
g_param_spec_object ("default-display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE|G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
+7
-21
@@ -379,9 +379,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The `GdkContentProvider`.
|
||||
*/
|
||||
properties[PROP_CONTENT] =
|
||||
g_param_spec_object ("content",
|
||||
"Content",
|
||||
"The content being dragged",
|
||||
g_param_spec_object ("content", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_PROVIDER,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -394,9 +392,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The `GdkDevice` that is performing the drag.
|
||||
*/
|
||||
properties[PROP_DEVICE] =
|
||||
g_param_spec_object ("device",
|
||||
"Device",
|
||||
"The device performing the drag",
|
||||
g_param_spec_object ("device", NULL, NULL,
|
||||
GDK_TYPE_DEVICE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -409,9 +405,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The `GdkDisplay` that the drag belongs to.
|
||||
*/
|
||||
properties[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"Display this drag belongs to",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -423,9 +417,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The possible formats that the drag can provide its data in.
|
||||
*/
|
||||
properties[PROP_FORMATS] =
|
||||
g_param_spec_boxed ("formats",
|
||||
"Formats",
|
||||
"The possible formats for data",
|
||||
g_param_spec_boxed ("formats", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -438,9 +430,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The currently selected action of the drag.
|
||||
*/
|
||||
properties[PROP_SELECTED_ACTION] =
|
||||
g_param_spec_flags ("selected-action",
|
||||
"Selected action",
|
||||
"The currently selected action",
|
||||
g_param_spec_flags ("selected-action", NULL, NULL,
|
||||
GDK_TYPE_DRAG_ACTION,
|
||||
0,
|
||||
G_PARAM_READWRITE |
|
||||
@@ -453,9 +443,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The possible actions of this drag.
|
||||
*/
|
||||
properties[PROP_ACTIONS] =
|
||||
g_param_spec_flags ("actions",
|
||||
"Actions",
|
||||
"The possible actions",
|
||||
g_param_spec_flags ("actions", NULL, NULL,
|
||||
GDK_TYPE_DRAG_ACTION,
|
||||
0,
|
||||
G_PARAM_READWRITE |
|
||||
@@ -468,9 +456,7 @@ gdk_drag_class_init (GdkDragClass *klass)
|
||||
* The surface where the drag originates.
|
||||
*/
|
||||
properties[PROP_SURFACE] =
|
||||
g_param_spec_object ("surface",
|
||||
"Surface",
|
||||
"The surface where the drag originates",
|
||||
g_param_spec_object ("surface", NULL, NULL,
|
||||
GDK_TYPE_SURFACE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
@@ -168,9 +168,7 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
|
||||
* The `GdkDisplay` used to create the `GdkDrawContext`.
|
||||
*/
|
||||
pspecs[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("The GDK display used to create the context"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -182,9 +180,7 @@ gdk_draw_context_class_init (GdkDrawContextClass *klass)
|
||||
* The `GdkSurface` the context is bound to.
|
||||
*/
|
||||
pspecs[PROP_SURFACE] =
|
||||
g_param_spec_object ("surface",
|
||||
P_("Surface"),
|
||||
P_("The GDK surface bound to the context"),
|
||||
g_param_spec_object ("surface", NULL, NULL,
|
||||
GDK_TYPE_SURFACE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
+6
-18
@@ -325,9 +325,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The possible actions for this drop
|
||||
*/
|
||||
properties[PROP_ACTIONS] =
|
||||
g_param_spec_flags ("actions",
|
||||
"Actions",
|
||||
"The possible actions for this drop",
|
||||
g_param_spec_flags ("actions", NULL, NULL,
|
||||
GDK_TYPE_DRAG_ACTION,
|
||||
GDK_ACTION_ALL,
|
||||
G_PARAM_READWRITE |
|
||||
@@ -341,9 +339,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The `GdkDevice` performing the drop
|
||||
*/
|
||||
properties[PROP_DEVICE] =
|
||||
g_param_spec_object ("device",
|
||||
"Device",
|
||||
"The device performing the drop",
|
||||
g_param_spec_object ("device", NULL, NULL,
|
||||
GDK_TYPE_DEVICE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -356,9 +352,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The `GdkDisplay` that the drop belongs to.
|
||||
*/
|
||||
properties[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"Display this drag belongs to",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READABLE |
|
||||
G_PARAM_STATIC_STRINGS |
|
||||
@@ -370,9 +364,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The `GdkDrag` that initiated this drop
|
||||
*/
|
||||
properties[PROP_DRAG] =
|
||||
g_param_spec_object ("drag",
|
||||
"Drag",
|
||||
"The drag that initiated this drop",
|
||||
g_param_spec_object ("drag", NULL, NULL,
|
||||
GDK_TYPE_DRAG,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -385,9 +377,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The possible formats that the drop can provide its data in.
|
||||
*/
|
||||
properties[PROP_FORMATS] =
|
||||
g_param_spec_boxed ("formats",
|
||||
"Formats",
|
||||
"The possible formats for data",
|
||||
g_param_spec_boxed ("formats", NULL, NULL,
|
||||
GDK_TYPE_CONTENT_FORMATS,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -400,9 +390,7 @@ gdk_drop_class_init (GdkDropClass *klass)
|
||||
* The `GdkSurface` the drop happens on
|
||||
*/
|
||||
properties[PROP_SURFACE] =
|
||||
g_param_spec_object ("surface",
|
||||
"Surface",
|
||||
"The surface the drop is happening on",
|
||||
g_param_spec_object ("surface", NULL, NULL,
|
||||
GDK_TYPE_SURFACE,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
+1
-11
@@ -920,14 +920,6 @@ gdk_event_get_pointer_emulated (GdkEvent *event)
|
||||
return tevent->pointer_emulated;
|
||||
}
|
||||
|
||||
case GDK_SCROLL:
|
||||
case GDK_SCROLL_SMOOTH:
|
||||
{
|
||||
GdkScrollEvent *sevent = (GdkScrollEvent *) event;
|
||||
|
||||
return sevent->pointer_emulated;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -2373,15 +2365,13 @@ gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
gboolean emulated)
|
||||
GdkScrollDirection direction)
|
||||
{
|
||||
GdkScrollEvent *self = gdk_event_alloc (GDK_SCROLL, surface, device, time);
|
||||
|
||||
self->tool = tool != NULL ? g_object_ref (tool) : NULL;
|
||||
self->state = state;
|
||||
self->direction = direction;
|
||||
self->pointer_emulated = emulated;
|
||||
self->unit = GDK_SCROLL_UNIT_WHEEL;
|
||||
|
||||
return (GdkEvent *) self;
|
||||
|
||||
@@ -206,8 +206,6 @@ struct _GdkTouchEvent
|
||||
* %GDK_SCROLL_SMOOTH).
|
||||
* @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`
|
||||
* @history: (element-type GdkTimeCoord): array of times and deltas
|
||||
* for other scroll events that were compressed before delivering the
|
||||
@@ -231,7 +229,6 @@ struct _GdkScrollEvent
|
||||
GdkScrollDirection direction;
|
||||
double delta_x;
|
||||
double delta_y;
|
||||
gboolean pointer_emulated;
|
||||
gboolean is_stop;
|
||||
GdkDeviceTool *tool;
|
||||
GArray *history; /* <GdkTimeCoord> */
|
||||
@@ -496,8 +493,7 @@ GdkEvent * gdk_scroll_event_new_discrete (GdkSurface *surface,
|
||||
GdkDeviceTool *tool,
|
||||
guint32 time,
|
||||
GdkModifierType state,
|
||||
GdkScrollDirection direction,
|
||||
gboolean emulated);
|
||||
GdkScrollDirection direction);
|
||||
|
||||
GdkEvent * gdk_touch_event_new (GdkEventType type,
|
||||
GdkEventSequence *sequence,
|
||||
|
||||
@@ -373,6 +373,9 @@ gdk_frame_clock_flush_idle (void *data)
|
||||
else
|
||||
priv->phase = GDK_FRAME_CLOCK_PHASE_NONE;
|
||||
|
||||
g_clear_handle_id (&priv->paint_idle_id, g_source_remove);
|
||||
gdk_frame_clock_paint_idle (data);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
+245
-247
@@ -256,181 +256,179 @@ gdk_gl_context_get_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
#define N_EGL_ATTRS 16
|
||||
#define N_EGL_ATTRS 16
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
static inline EGLenum
|
||||
gdk_api_to_egl_api (GdkGLAPI api)
|
||||
{
|
||||
switch (api)
|
||||
{
|
||||
case GDK_GL_API_GLES:
|
||||
return EGL_OPENGL_ES_API;
|
||||
case GDK_GL_API_GL:
|
||||
default:
|
||||
return EGL_OPENGL_API;
|
||||
}
|
||||
}
|
||||
|
||||
static GdkGLAPI
|
||||
gdk_gl_context_real_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
gdk_gl_context_create_egl_context (GdkGLContext *context,
|
||||
GdkGLAPI api,
|
||||
gboolean legacy)
|
||||
{
|
||||
#ifdef HAVE_EGL
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
EGLDisplay egl_display = gdk_display_get_egl_display (display);
|
||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
|
||||
EGLConfig egl_config;
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS], i = 0, flags = 0;
|
||||
gboolean debug_bit, forward_bit;
|
||||
int min_major, min_minor, major = 0, minor = 0;
|
||||
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
||||
|
||||
if (egl_display)
|
||||
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
|
||||
return 0;
|
||||
|
||||
/* We will use the default version matching the context status
|
||||
* unless the user requested a version which makes sense */
|
||||
gdk_gl_context_get_matching_version (api, legacy,
|
||||
display->have_egl_win32_libangle,
|
||||
&min_major, &min_minor);
|
||||
gdk_gl_context_get_clipped_version (context,
|
||||
min_major, min_minor,
|
||||
&major, &minor);
|
||||
|
||||
if (!eglBindAPI (gdk_api_to_egl_api (api)))
|
||||
return 0;
|
||||
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
forward_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
if (display->have_egl_no_config_context)
|
||||
egl_config = NULL;
|
||||
else
|
||||
egl_config = gdk_display_get_egl_config (display);
|
||||
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (forward_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
if (api == GDK_GL_API_GL)
|
||||
{
|
||||
EGLConfig egl_config;
|
||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||
GdkGLContextPrivate *share_priv = gdk_gl_context_get_instance_private (share);
|
||||
EGLContext ctx;
|
||||
EGLint context_attribs[N_EGL_ATTRS];
|
||||
int major, minor, flags;
|
||||
gboolean debug_bit, forward_bit, legacy_bit;
|
||||
GdkGLAPI api;
|
||||
int i = 0;
|
||||
G_GNUC_UNUSED gint64 start_time = GDK_PROFILER_CURRENT_TIME;
|
||||
|
||||
if (share != NULL)
|
||||
gdk_gl_context_get_required_version (share, &major, &minor);
|
||||
else
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
forward_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
legacy_bit = GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
|
||||
(share != NULL && gdk_gl_context_is_legacy (share));
|
||||
|
||||
if (display->have_egl_no_config_context)
|
||||
egl_config = NULL;
|
||||
else
|
||||
egl_config = gdk_display_get_egl_config (display);
|
||||
|
||||
flags = 0;
|
||||
|
||||
if (debug_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
if (forward_bit)
|
||||
flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) &&
|
||||
eglBindAPI (EGL_OPENGL_API))
|
||||
{
|
||||
/* We want a core profile, unless in legacy mode */
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = legacy_bit
|
||||
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR
|
||||
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR;
|
||||
|
||||
/* Specify the version */
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION_KHR;
|
||||
context_attribs[i++] = legacy_bit ? 3 : major;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION_KHR;
|
||||
context_attribs[i++] = legacy_bit ? 0 : minor;
|
||||
api = GDK_GL_API_GL;
|
||||
}
|
||||
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) &&
|
||||
eglBindAPI (EGL_OPENGL_ES_API))
|
||||
{
|
||||
context_attribs[i++] = EGL_CONTEXT_CLIENT_VERSION;
|
||||
if (major == 3)
|
||||
context_attribs[i++] = 3;
|
||||
else
|
||||
context_attribs[i++] = 2;
|
||||
api = GDK_GL_API_GLES;
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("The EGL implementation does not support any allowed APIs"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Specify the flags */
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
|
||||
major, minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
forward_bit ? "yes" : "no",
|
||||
legacy_bit ? "yes" : "no",
|
||||
api == GDK_GL_API_GLES ? "yes" : "no"));
|
||||
|
||||
ctx = eglCreateContext (egl_display,
|
||||
egl_config,
|
||||
share != NULL ? share_priv->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
|
||||
/* If context creation failed without the ES bit, let's try again with it */
|
||||
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) && eglBindAPI (EGL_OPENGL_ES_API))
|
||||
{
|
||||
i = 0;
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
|
||||
context_attribs[i++] = 2;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
|
||||
context_attribs[i++] = 0;
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
legacy_bit = FALSE;
|
||||
api = GDK_GL_API_GLES;
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("eglCreateContext failed, switching to OpenGL ES"));
|
||||
ctx = eglCreateContext (egl_display,
|
||||
egl_config,
|
||||
share != NULL ? share_priv->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
}
|
||||
|
||||
/* If context creation failed without the legacy bit, let's try again with it */
|
||||
if (ctx == NULL && gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) && eglBindAPI (EGL_OPENGL_API))
|
||||
{
|
||||
i = 0;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR;
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
|
||||
context_attribs[i++] = 3;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
|
||||
context_attribs[i++] = 0;
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags & ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
legacy_bit = TRUE;
|
||||
api = GDK_GL_API_GL;
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("eglCreateContext failed, switching to legacy"));
|
||||
ctx = eglCreateContext (egl_display,
|
||||
egl_config,
|
||||
share != NULL ? share_priv->egl_context
|
||||
: EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
}
|
||||
|
||||
if (ctx == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
|
||||
|
||||
priv->egl_context = ctx;
|
||||
|
||||
gdk_gl_context_set_is_legacy (context, legacy_bit);
|
||||
|
||||
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
|
||||
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
|
||||
|
||||
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
|
||||
|
||||
return api;
|
||||
/* We want a core profile, unless in legacy mode */
|
||||
context_attribs[i++] = EGL_CONTEXT_OPENGL_PROFILE_MASK;
|
||||
context_attribs[i++] = legacy
|
||||
? EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT
|
||||
: EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT;
|
||||
}
|
||||
|
||||
if (legacy || api == GDK_GL_API_GLES)
|
||||
flags &= ~EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
|
||||
context_attribs[i++] = EGL_CONTEXT_MAJOR_VERSION;
|
||||
context_attribs[i++] = major;
|
||||
context_attribs[i++] = EGL_CONTEXT_MINOR_VERSION;
|
||||
context_attribs[i++] = minor;
|
||||
context_attribs[i++] = EGL_CONTEXT_FLAGS_KHR;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = EGL_NONE;
|
||||
g_assert (i < N_EGL_ATTRS);
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("Creating EGL context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
|
||||
major, minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
forward_bit ? "yes" : "no",
|
||||
legacy ? "yes" : "no",
|
||||
api == GDK_GL_API_GLES ? "yes" : "no"));
|
||||
|
||||
ctx = eglCreateContext (egl_display,
|
||||
egl_config,
|
||||
share ? share_priv->egl_context : EGL_NO_CONTEXT,
|
||||
context_attribs);
|
||||
|
||||
if (ctx == NULL)
|
||||
return 0;
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Created EGL context[%p]", ctx));
|
||||
|
||||
priv->egl_context = ctx;
|
||||
gdk_gl_context_set_is_legacy (context, legacy);
|
||||
|
||||
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
|
||||
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer) epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
|
||||
|
||||
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
static GdkGLAPI
|
||||
gdk_gl_context_realize_egl (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||
GdkGLAPI api, preferred_api;
|
||||
gboolean prefer_legacy;
|
||||
|
||||
if (share && gdk_gl_context_is_api_allowed (context,
|
||||
gdk_gl_context_get_api (share),
|
||||
NULL))
|
||||
preferred_api = gdk_gl_context_get_api (share);
|
||||
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
|
||||
preferred_api = GDK_GL_API_GL;
|
||||
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
|
||||
preferred_api = GDK_GL_API_GLES;
|
||||
else
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("No GL API allowed."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
prefer_legacy = (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY) ||
|
||||
(share != NULL && gdk_gl_context_is_legacy (share)));
|
||||
|
||||
if (preferred_api == GDK_GL_API_GL)
|
||||
{
|
||||
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
|
||||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
|
||||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
|
||||
return api;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GLES, FALSE)) ||
|
||||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, prefer_legacy)) ||
|
||||
(api = gdk_gl_context_create_egl_context (context, GDK_GL_API_GL, TRUE)))
|
||||
return api;
|
||||
}
|
||||
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return 0;
|
||||
}
|
||||
#endif /* HAVE_EGL */
|
||||
|
||||
static GdkGLAPI
|
||||
gdk_gl_context_default_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
#ifdef HAVE_EGL
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
|
||||
if (gdk_display_get_egl_display (display))
|
||||
return gdk_gl_context_realize_egl (context, error);
|
||||
#endif
|
||||
|
||||
g_set_error_literal (error, GDK_GL_ERROR, GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
@@ -667,7 +665,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
GdkDrawContextClass *draw_context_class = GDK_DRAW_CONTEXT_CLASS (klass);
|
||||
|
||||
klass->realize = gdk_gl_context_real_realize;
|
||||
klass->realize = gdk_gl_context_default_realize;
|
||||
klass->get_damage = gdk_gl_context_real_get_damage;
|
||||
klass->is_shared = gdk_gl_context_real_is_shared;
|
||||
klass->make_current = gdk_gl_context_real_make_current;
|
||||
@@ -690,9 +688,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
* can be shared.
|
||||
*/
|
||||
properties[PROP_SHARED_CONTEXT] =
|
||||
g_param_spec_object ("shared-context",
|
||||
P_("Shared context"),
|
||||
P_("The GL context this context shares data with"),
|
||||
g_param_spec_object ("shared-context", NULL, NULL,
|
||||
GDK_TYPE_GL_CONTEXT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
@@ -707,9 +703,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
* Since: 4.6
|
||||
*/
|
||||
properties[PROP_ALLOWED_APIS] =
|
||||
g_param_spec_flags ("allowed-apis",
|
||||
P_("Allowed APIs"),
|
||||
P_("The list of allowed APIs for this context"),
|
||||
g_param_spec_flags ("allowed-apis", NULL, NULL,
|
||||
GDK_TYPE_GL_API,
|
||||
DEFAULT_ALLOWED_APIS,
|
||||
G_PARAM_READWRITE |
|
||||
@@ -724,9 +718,7 @@ gdk_gl_context_class_init (GdkGLContextClass *klass)
|
||||
* Since: 4.6
|
||||
*/
|
||||
properties[PROP_API] =
|
||||
g_param_spec_flags ("api",
|
||||
P_("API"),
|
||||
P_("The API currently in use"),
|
||||
g_param_spec_flags ("api", NULL, NULL,
|
||||
GDK_TYPE_GL_API,
|
||||
0,
|
||||
G_PARAM_READABLE |
|
||||
@@ -960,6 +952,48 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
|
||||
return priv->forward_compatible;
|
||||
}
|
||||
|
||||
void
|
||||
gdk_gl_context_get_matching_version (GdkGLAPI api,
|
||||
gboolean legacy,
|
||||
gboolean win32_libangle,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
int maj, min;
|
||||
|
||||
if (api == GDK_GL_API_GL)
|
||||
{
|
||||
if (legacy)
|
||||
{
|
||||
maj = GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GL_LEGACY_VERSION_MINOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
maj = GDK_GL_MIN_GL_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GL_VERSION_MINOR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (win32_libangle)
|
||||
{
|
||||
maj = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR;
|
||||
}
|
||||
else
|
||||
{
|
||||
maj = GDK_GL_MIN_GLES_VERSION_MAJOR;
|
||||
min = GDK_GL_MIN_GLES_VERSION_MINOR;
|
||||
}
|
||||
}
|
||||
|
||||
if (major != NULL)
|
||||
*major = maj;
|
||||
if (minor != NULL)
|
||||
*minor = min;
|
||||
}
|
||||
|
||||
/**
|
||||
* gdk_gl_context_set_required_version:
|
||||
* @context: a `GdkGLContext`
|
||||
@@ -970,7 +1004,10 @@ gdk_gl_context_get_forward_compatible (GdkGLContext *context)
|
||||
*
|
||||
* Setting @major and @minor to zero will use the default values.
|
||||
*
|
||||
* The `GdkGLContext` must not be realized or made current prior to calling
|
||||
* Setting @major and @minor lower than the minimum versions required
|
||||
* by GTK will result in the context choosing the minimum version.
|
||||
*
|
||||
* The @context must not be realized or made current prior to calling
|
||||
* this function.
|
||||
*/
|
||||
void
|
||||
@@ -979,44 +1016,12 @@ gdk_gl_context_set_required_version (GdkGLContext *context,
|
||||
int minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean force_gles = FALSE;
|
||||
int version, min_ver;
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
GdkDisplay *display;
|
||||
#endif
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
g_return_if_fail (!gdk_gl_context_is_realized (context));
|
||||
|
||||
/* this will take care of the default */
|
||||
if (major == 0 && minor == 0)
|
||||
{
|
||||
priv->major = 0;
|
||||
priv->minor = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
version = (major * 100) + minor;
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
|
||||
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
|
||||
#endif
|
||||
/* Enforce a minimum context version number of 3.2 for desktop GL,
|
||||
* and 2.0 for GLES
|
||||
*/
|
||||
if (gdk_gl_context_get_use_es (context) || force_gles)
|
||||
min_ver = 200;
|
||||
else
|
||||
min_ver = 302;
|
||||
|
||||
if (version < min_ver)
|
||||
{
|
||||
g_warning ("gdk_gl_context_set_required_version - GL context versions less than 3.2 are not supported.");
|
||||
version = min_ver;
|
||||
}
|
||||
priv->major = version / 100;
|
||||
priv->minor = version % 100;
|
||||
priv->major = major;
|
||||
priv->minor = minor;
|
||||
}
|
||||
|
||||
gboolean
|
||||
@@ -1055,7 +1060,10 @@ gdk_gl_context_check_version (GdkGLContext *self,
|
||||
* @major: (out) (nullable): return location for the major version to request
|
||||
* @minor: (out) (nullable): return location for the minor version to request
|
||||
*
|
||||
* Retrieves required OpenGL version.
|
||||
* Retrieves required OpenGL version set as a requirement for the @context
|
||||
* realization. It will not change even if a greater OpenGL version is supported
|
||||
* and used after the @context is realized. See
|
||||
* [method@Gdk.GLContext.get_version] for the real version in use.
|
||||
*
|
||||
* See [method@Gdk.GLContext.set_required_version].
|
||||
*/
|
||||
@@ -1065,47 +1073,32 @@ gdk_gl_context_get_required_version (GdkGLContext *context,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
gboolean force_gles = FALSE;
|
||||
GdkDisplay *display;
|
||||
int default_major, default_minor;
|
||||
int maj, min;
|
||||
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
display = gdk_draw_context_get_display (GDK_DRAW_CONTEXT (context));
|
||||
if (major != NULL)
|
||||
*major = priv->major;
|
||||
if (minor != NULL)
|
||||
*minor = priv->minor;
|
||||
}
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
force_gles = GDK_DISPLAY_DEBUG_CHECK (display, GL_GLES);
|
||||
#endif
|
||||
void
|
||||
gdk_gl_context_get_clipped_version (GdkGLContext *context,
|
||||
int min_major,
|
||||
int min_minor,
|
||||
int *major,
|
||||
int *minor)
|
||||
{
|
||||
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
|
||||
int maj = min_major, min = min_minor;
|
||||
|
||||
/* libANGLE on Windows at least requires GLES 3.0+ */
|
||||
if (display->have_egl_win32_libangle)
|
||||
force_gles = TRUE;
|
||||
g_return_if_fail (GDK_IS_GL_CONTEXT (context));
|
||||
|
||||
/* Default fallback values for uninitialised contexts; we
|
||||
* enforce a context version number of 3.2 for desktop GL,
|
||||
* and 2.0 for GLES
|
||||
*/
|
||||
if (gdk_gl_context_get_use_es (context) || force_gles)
|
||||
if (priv->major > maj || (priv->major == maj && priv->minor > min))
|
||||
{
|
||||
default_major = display->have_egl_win32_libangle ? 3 : 2;
|
||||
default_minor = 0;
|
||||
maj = priv->major;
|
||||
min = priv->minor;
|
||||
}
|
||||
else
|
||||
{
|
||||
default_major = 3;
|
||||
default_minor = 2;
|
||||
}
|
||||
|
||||
if (priv->major > 0)
|
||||
maj = priv->major;
|
||||
else
|
||||
maj = default_major;
|
||||
|
||||
if (priv->minor > 0)
|
||||
min = priv->minor;
|
||||
else
|
||||
min = default_minor;
|
||||
|
||||
if (major != NULL)
|
||||
*major = maj;
|
||||
@@ -1342,7 +1335,9 @@ gdk_gl_context_set_use_es (GdkGLContext *context,
|
||||
*
|
||||
* Checks whether the @context is using an OpenGL or OpenGL ES profile.
|
||||
*
|
||||
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile
|
||||
* Returns: %TRUE if the `GdkGLContext` is using an OpenGL ES profile;
|
||||
* %FALSE if other profile is in use of if the @context has not yet
|
||||
* been realized.
|
||||
*/
|
||||
gboolean
|
||||
gdk_gl_context_get_use_es (GdkGLContext *context)
|
||||
@@ -1673,6 +1668,10 @@ gdk_gl_context_get_shared_context (GdkGLContext *context)
|
||||
* Retrieves the OpenGL version of the @context.
|
||||
*
|
||||
* The @context must be realized prior to calling this function.
|
||||
*
|
||||
* If the @context has never been made current, the version cannot
|
||||
* be known and it will return 0 for both @major and @minor.
|
||||
*
|
||||
*/
|
||||
void
|
||||
gdk_gl_context_get_version (GdkGLContext *context,
|
||||
@@ -1851,4 +1850,3 @@ gdk_gl_backend_use (GdkGLBackend backend_type)
|
||||
|
||||
g_assert (the_gl_backend_type == backend_type);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,22 @@ G_BEGIN_DECLS
|
||||
#define GDK_EGL_MIN_VERSION_MAJOR (1)
|
||||
#define GDK_EGL_MIN_VERSION_MINOR (4)
|
||||
|
||||
/* Minimum OpenGL versions supported by GTK.
|
||||
* Backends should make sure to never create a context of a previous version.
|
||||
*
|
||||
* The macros refer to OpenGL; OpenGL with OPENGL_COMPATIBILITY_PROFILE_BIT as
|
||||
* OPENGL_PROFILE_MASK; OpenGL ES; and OpenGL ES win32 Angle implementation,
|
||||
* respectively
|
||||
*/
|
||||
#define GDK_GL_MIN_GL_VERSION_MAJOR (3)
|
||||
#define GDK_GL_MIN_GL_VERSION_MINOR (2)
|
||||
#define GDK_GL_MIN_GL_LEGACY_VERSION_MAJOR (3)
|
||||
#define GDK_GL_MIN_GL_LEGACY_VERSION_MINOR (0)
|
||||
#define GDK_GL_MIN_GLES_VERSION_MAJOR (2)
|
||||
#define GDK_GL_MIN_GLES_VERSION_MINOR (0)
|
||||
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MAJOR (3)
|
||||
#define GDK_GL_MIN_GLES_WIN32_ANGLE_VERSION_MINOR (0)
|
||||
|
||||
typedef enum {
|
||||
GDK_GL_NONE = 0,
|
||||
GDK_GL_EGL,
|
||||
@@ -117,6 +133,16 @@ gboolean gdk_gl_context_check_version (GdkGLContext
|
||||
int required_gl_minor,
|
||||
int required_gles_major,
|
||||
int required_gles_minor);
|
||||
void gdk_gl_context_get_clipped_version (GdkGLContext *context,
|
||||
int min_major,
|
||||
int min_minor,
|
||||
int *major,
|
||||
int *minor);
|
||||
void gdk_gl_context_get_matching_version (GdkGLAPI api,
|
||||
gboolean legacy,
|
||||
gboolean win32_libangle,
|
||||
int *major,
|
||||
int *minor);
|
||||
|
||||
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
|
||||
void gdk_gl_context_push_debug_group (GdkGLContext *context,
|
||||
|
||||
@@ -27,6 +27,4 @@
|
||||
|
||||
#include <glib/gi18n-lib.h>
|
||||
|
||||
#define P_(String) dgettext (GETTEXT_PACKAGE "-properties", String)
|
||||
|
||||
#endif
|
||||
|
||||
+1
-3
@@ -123,9 +123,7 @@ gdk_keymap_class_init (GdkKeymapClass *klass)
|
||||
klass->keys_changed = gdk_keymap_keys_changed;
|
||||
|
||||
props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"The display of the keymap",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
@@ -178,19 +178,19 @@ gdk_memory_texture_new_subtexture (GdkMemoryTexture *source,
|
||||
GBytes *bytes;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_MEMORY_TEXTURE (source), NULL);
|
||||
g_return_val_if_fail (x < 0 || x >= GDK_TEXTURE (source)->width, NULL);
|
||||
g_return_val_if_fail (y < 0 || y >= GDK_TEXTURE (source)->height, NULL);
|
||||
g_return_val_if_fail (width <= 0 || x + width > GDK_TEXTURE (source)->width, NULL);
|
||||
g_return_val_if_fail (height <= 0 || y + height > GDK_TEXTURE (source)->height, NULL);
|
||||
g_return_val_if_fail (x >= 0 || x < GDK_TEXTURE (source)->width, NULL);
|
||||
g_return_val_if_fail (y >= 0 || y < GDK_TEXTURE (source)->height, NULL);
|
||||
g_return_val_if_fail (width > 0 || x + width <= GDK_TEXTURE (source)->width, NULL);
|
||||
g_return_val_if_fail (height > 0 || y + height <= GDK_TEXTURE (source)->height, NULL);
|
||||
|
||||
texture = GDK_TEXTURE (source);
|
||||
bpp = gdk_memory_format_bytes_per_pixel (texture->format);
|
||||
offset = y * source->stride + x * bpp;
|
||||
size = source->stride * (height - 1) + x * bpp;
|
||||
size = source->stride * (height - 1) + width * bpp;
|
||||
bytes = g_bytes_new_from_bytes (source->bytes, offset, size);
|
||||
|
||||
result = gdk_memory_texture_new (texture->width,
|
||||
texture->height,
|
||||
result = gdk_memory_texture_new (width,
|
||||
height,
|
||||
texture->format,
|
||||
bytes,
|
||||
source->stride);
|
||||
|
||||
+11
-33
@@ -176,9 +176,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The `GdkDisplay` of the monitor.
|
||||
*/
|
||||
props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"The display of the monitor",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -188,9 +186,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The manufacturer name.
|
||||
*/
|
||||
props[PROP_MANUFACTURER] =
|
||||
g_param_spec_string ("manufacturer",
|
||||
"Manufacturer",
|
||||
"The manufacturer name",
|
||||
g_param_spec_string ("manufacturer", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -200,9 +196,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The model name.
|
||||
*/
|
||||
props[PROP_MODEL] =
|
||||
g_param_spec_string ("model",
|
||||
"Model",
|
||||
"The model name",
|
||||
g_param_spec_string ("model", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -212,9 +206,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The connector name.
|
||||
*/
|
||||
props[PROP_CONNECTOR] =
|
||||
g_param_spec_string ("connector",
|
||||
"Connector",
|
||||
"The connector name",
|
||||
g_param_spec_string ("connector", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -224,9 +216,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The scale factor.
|
||||
*/
|
||||
props[PROP_SCALE_FACTOR] =
|
||||
g_param_spec_int ("scale-factor",
|
||||
"Scale factor",
|
||||
"The scale factor",
|
||||
g_param_spec_int ("scale-factor", NULL, NULL,
|
||||
0, G_MAXINT,
|
||||
1,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -237,9 +227,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The geometry of the monitor.
|
||||
*/
|
||||
props[PROP_GEOMETRY] =
|
||||
g_param_spec_boxed ("geometry",
|
||||
"Geometry",
|
||||
"The geometry of the monitor",
|
||||
g_param_spec_boxed ("geometry", NULL, NULL,
|
||||
GDK_TYPE_RECTANGLE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -249,9 +237,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The width of the monitor, in millimeters.
|
||||
*/
|
||||
props[PROP_WIDTH_MM] =
|
||||
g_param_spec_int ("width-mm",
|
||||
"Physical width",
|
||||
"The width of the monitor, in millimeters",
|
||||
g_param_spec_int ("width-mm", NULL, NULL,
|
||||
0, G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -262,9 +248,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The height of the monitor, in millimeters.
|
||||
*/
|
||||
props[PROP_HEIGHT_MM] =
|
||||
g_param_spec_int ("height-mm",
|
||||
"Physical height",
|
||||
"The height of the monitor, in millimeters",
|
||||
g_param_spec_int ("height-mm", NULL, NULL,
|
||||
0, G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -275,9 +259,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The refresh rate, in milli-Hertz.
|
||||
*/
|
||||
props[PROP_REFRESH_RATE] =
|
||||
g_param_spec_int ("refresh-rate",
|
||||
"Refresh rate",
|
||||
"The refresh rate, in millihertz",
|
||||
g_param_spec_int ("refresh-rate", NULL, NULL,
|
||||
0, G_MAXINT,
|
||||
0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -288,9 +270,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* The subpixel layout.
|
||||
*/
|
||||
props[PROP_SUBPIXEL_LAYOUT] =
|
||||
g_param_spec_enum ("subpixel-layout",
|
||||
"Subpixel layout",
|
||||
"The subpixel layout",
|
||||
g_param_spec_enum ("subpixel-layout", NULL, NULL,
|
||||
GDK_TYPE_SUBPIXEL_LAYOUT,
|
||||
GDK_SUBPIXEL_LAYOUT_UNKNOWN,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
@@ -301,9 +281,7 @@ gdk_monitor_class_init (GdkMonitorClass *class)
|
||||
* Whether the object is still valid.
|
||||
*/
|
||||
props[PROP_VALID] =
|
||||
g_param_spec_boolean ("valid",
|
||||
"Valid",
|
||||
"Whether the monitor is still valid",
|
||||
g_param_spec_boolean ("valid", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
+2
-6
@@ -85,9 +85,7 @@ gdk_popup_default_init (GdkPopupInterface *iface)
|
||||
* The parent surface.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_object ("parent",
|
||||
P_("Parent"),
|
||||
P_("The parent surface"),
|
||||
g_param_spec_object ("parent", NULL, NULL,
|
||||
GDK_TYPE_SURFACE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
@@ -97,9 +95,7 @@ gdk_popup_default_init (GdkPopupInterface *iface)
|
||||
* Whether to hide on outside clicks.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("autohide",
|
||||
P_("Autohide"),
|
||||
P_("Whether to hide on outside clicks"),
|
||||
g_param_spec_boolean ("autohide", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS));
|
||||
}
|
||||
|
||||
+1
-3
@@ -184,9 +184,7 @@ gdk_seat_class_init (GdkSeatClass *klass)
|
||||
* `GdkDisplay` of this seat.
|
||||
*/
|
||||
props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("Display"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
+7
-21
@@ -506,9 +506,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The mouse pointer for the `GdkSurface`.
|
||||
*/
|
||||
properties[PROP_CURSOR] =
|
||||
g_param_spec_object ("cursor",
|
||||
P_("Cursor"),
|
||||
P_("Cursor"),
|
||||
g_param_spec_object ("cursor", NULL, NULL,
|
||||
GDK_TYPE_CURSOR,
|
||||
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -518,9 +516,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The `GdkDisplay` connection of the surface.
|
||||
*/
|
||||
properties[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("Display"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -530,9 +526,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The `GdkFrameClock` of the surface.
|
||||
*/
|
||||
properties[PROP_FRAME_CLOCK] =
|
||||
g_param_spec_object ("frame-clock",
|
||||
P_("Frame Clock"),
|
||||
P_("Frame Clock"),
|
||||
g_param_spec_object ("frame-clock", NULL, NULL,
|
||||
GDK_TYPE_FRAME_CLOCK,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -542,9 +536,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* Whether the surface is mapped.
|
||||
*/
|
||||
properties[PROP_MAPPED] =
|
||||
g_param_spec_boolean ("mapped",
|
||||
P_("Mapped"),
|
||||
P_("Mapped"),
|
||||
g_param_spec_boolean ("mapped", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -554,9 +546,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The width of the surface in pixels.
|
||||
*/
|
||||
properties[PROP_WIDTH] =
|
||||
g_param_spec_int ("width",
|
||||
P_("Width"),
|
||||
P_("Width"),
|
||||
g_param_spec_int ("width", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -566,9 +556,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The height of the surface, in pixels.
|
||||
*/
|
||||
properties[PROP_HEIGHT] =
|
||||
g_param_spec_int ("height",
|
||||
P_("Height"),
|
||||
P_("Height"),
|
||||
g_param_spec_int ("height", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
@@ -578,9 +566,7 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
|
||||
* The scale factor of the surface.
|
||||
*/
|
||||
properties[PROP_SCALE_FACTOR] =
|
||||
g_param_spec_int ("scale-factor",
|
||||
P_("Scale factor"),
|
||||
P_("Scale factor"),
|
||||
g_param_spec_int ("scale-factor", NULL, NULL,
|
||||
1, G_MAXINT, 1,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
+2
-6
@@ -304,9 +304,7 @@ gdk_texture_class_init (GdkTextureClass *klass)
|
||||
* The width of the texture, in pixels.
|
||||
*/
|
||||
properties[PROP_WIDTH] =
|
||||
g_param_spec_int ("width",
|
||||
"Width",
|
||||
"The width of the texture",
|
||||
g_param_spec_int ("width", NULL, NULL,
|
||||
1,
|
||||
G_MAXINT,
|
||||
1,
|
||||
@@ -321,9 +319,7 @@ gdk_texture_class_init (GdkTextureClass *klass)
|
||||
* The height of the texture, in pixels.
|
||||
*/
|
||||
properties[PROP_HEIGHT] =
|
||||
g_param_spec_int ("height",
|
||||
"Height",
|
||||
"The height of the texture",
|
||||
g_param_spec_int ("height", NULL, NULL,
|
||||
1,
|
||||
G_MAXINT,
|
||||
1,
|
||||
|
||||
+10
-30
@@ -131,9 +131,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* The state of the toplevel.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_flags ("state",
|
||||
P_("State"),
|
||||
P_("State"),
|
||||
g_param_spec_flags ("state", NULL, NULL,
|
||||
GDK_TYPE_TOPLEVEL_STATE, 0,
|
||||
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
|
||||
|
||||
@@ -143,9 +141,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* The title of the surface.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_string ("title",
|
||||
"Title",
|
||||
"The title of the surface",
|
||||
g_param_spec_string ("title", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -158,9 +154,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* startup feedback.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_string ("startup-id",
|
||||
"Startup ID",
|
||||
"The startup ID of the surface",
|
||||
g_param_spec_string ("startup-id", NULL, NULL,
|
||||
NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -170,9 +164,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* The transient parent of the surface.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_object ("transient-for",
|
||||
"Transient For",
|
||||
"The transient parent of the surface",
|
||||
g_param_spec_object ("transient-for", NULL, NULL,
|
||||
GDK_TYPE_SURFACE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -182,9 +174,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* Whether the surface is modal.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("modal",
|
||||
"Modal",
|
||||
"Whether the surface is modal",
|
||||
g_param_spec_boolean ("modal", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -194,9 +184,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* A list of textures to use as icon.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_pointer ("icon-list",
|
||||
"Icon List",
|
||||
"The list of icon textures",
|
||||
g_param_spec_pointer ("icon-list", NULL, NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
/**
|
||||
@@ -205,9 +193,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* Whether the window manager should add decorations.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("decorated",
|
||||
"Decorated",
|
||||
"Decorated",
|
||||
g_param_spec_boolean ("decorated", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -217,9 +203,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* Whether the window manager should allow to close the surface.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("deletable",
|
||||
"Deletable",
|
||||
"Deletable",
|
||||
g_param_spec_boolean ("deletable", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
@@ -229,9 +213,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* The fullscreen mode of the surface.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_enum ("fullscreen-mode",
|
||||
"Fullscreen mode",
|
||||
"Fullscreen mode",
|
||||
g_param_spec_enum ("fullscreen-mode", NULL, NULL,
|
||||
GDK_TYPE_FULLSCREEN_MODE,
|
||||
GDK_FULLSCREEN_ON_CURRENT_MONITOR,
|
||||
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
@@ -242,9 +224,7 @@ gdk_toplevel_default_init (GdkToplevelInterface *iface)
|
||||
* Whether the surface should inhibit keyboard shortcuts.
|
||||
*/
|
||||
g_object_interface_install_property (iface,
|
||||
g_param_spec_boolean ("shortcuts-inhibited",
|
||||
"Shortcuts inhibited",
|
||||
"Whether keyboard shortcuts are inhibited",
|
||||
g_param_spec_boolean ("shortcuts-inhibited", NULL, NULL,
|
||||
FALSE,
|
||||
G_PARAM_READABLE | G_PARAM_EXPLICIT_NOTIFY));
|
||||
|
||||
|
||||
@@ -700,8 +700,7 @@ fill_scroll_event (GdkMacosDisplay *self,
|
||||
NULL,
|
||||
get_time_from_ns_event (nsevent),
|
||||
state,
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
}
|
||||
|
||||
if (phase == NSEventPhaseEnded || phase == NSEventPhaseCancelled)
|
||||
|
||||
@@ -601,9 +601,7 @@ gdk_macos_drag_class_init (GdkMacosDragClass *klass)
|
||||
drag_class->handle_event = gdk_macos_drag_handle_event;
|
||||
|
||||
properties [PROP_DRAG_SURFACE] =
|
||||
g_param_spec_object ("drag-surface",
|
||||
P_("Drag Surface"),
|
||||
P_("Drag Surface"),
|
||||
g_param_spec_object ("drag-surface", NULL, NULL,
|
||||
GDK_TYPE_MACOS_DRAG_SURFACE,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
|
||||
@@ -378,7 +378,10 @@ gdk_macos_gl_context_real_realize (GdkGLContext *context,
|
||||
|
||||
existing = CGLGetCurrentContext ();
|
||||
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
gdk_gl_context_get_clipped_version (context,
|
||||
GDK_GL_MIN_GL_VERSION_MAJOR,
|
||||
GDK_GL_MIN_GL_VERSION_MINOR,
|
||||
&major, &minor);
|
||||
|
||||
display = gdk_gl_context_get_display (context);
|
||||
shared = gdk_display_get_gl_context (display);
|
||||
|
||||
@@ -602,9 +602,7 @@ gdk_macos_surface_class_init (GdkMacosSurfaceClass *klass)
|
||||
* The "native" property contains the underlying NSWindow.
|
||||
*/
|
||||
properties [PROP_NATIVE] =
|
||||
g_param_spec_pointer ("native",
|
||||
"Native",
|
||||
"The native NSWindow",
|
||||
g_param_spec_pointer ("native", NULL, NULL,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS);
|
||||
|
||||
g_object_class_install_properties (object_class, LAST_PROP, properties);
|
||||
|
||||
@@ -200,23 +200,51 @@ wl_cursor_destroy(struct wl_cursor *cursor)
|
||||
}
|
||||
|
||||
static struct wl_cursor *
|
||||
wl_cursor_create_from_xcursor_images(XcursorImages *images,
|
||||
struct wl_cursor_theme *theme,
|
||||
wl_cursor_create_from_xcursor_images(struct wl_cursor_theme *theme,
|
||||
const char *name,
|
||||
unsigned int load_size)
|
||||
unsigned int size,
|
||||
unsigned int scale)
|
||||
{
|
||||
char *path;
|
||||
XcursorImages *images;
|
||||
struct cursor *cursor;
|
||||
struct cursor_image *image;
|
||||
int i, size;
|
||||
int i, nbytes;
|
||||
unsigned int load_size;
|
||||
int load_scale = 1;
|
||||
|
||||
load_size = size * scale;
|
||||
|
||||
path = g_strconcat (theme->path, "/", name, NULL);
|
||||
images = xcursor_load_images (path, load_size);
|
||||
|
||||
if (!images)
|
||||
{
|
||||
g_free (path);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (images->images[0]->width != load_size ||
|
||||
images->images[0]->height != load_size)
|
||||
{
|
||||
xcursor_images_destroy (images);
|
||||
images = xcursor_load_images (path, size);
|
||||
load_scale = scale;
|
||||
}
|
||||
|
||||
g_free (path);
|
||||
|
||||
cursor = malloc(sizeof *cursor);
|
||||
if (!cursor)
|
||||
if (!cursor) {
|
||||
xcursor_images_destroy (images);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
cursor->cursor.images =
|
||||
malloc(images->nimage * sizeof cursor->cursor.images[0]);
|
||||
if (!cursor->cursor.images) {
|
||||
free(cursor);
|
||||
xcursor_images_destroy (images);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -232,22 +260,37 @@ wl_cursor_create_from_xcursor_images(XcursorImages *images,
|
||||
image->theme = theme;
|
||||
image->buffer = NULL;
|
||||
|
||||
image->image.width = images->images[i]->width;
|
||||
image->image.height = images->images[i]->height;
|
||||
image->image.hotspot_x = images->images[i]->xhot;
|
||||
image->image.hotspot_y = images->images[i]->yhot;
|
||||
image->image.width = images->images[i]->width * load_scale;
|
||||
image->image.height = images->images[i]->height * load_scale;
|
||||
image->image.hotspot_x = images->images[i]->xhot * load_scale;
|
||||
image->image.hotspot_y = images->images[i]->yhot * load_scale;
|
||||
image->image.delay = images->images[i]->delay;
|
||||
|
||||
size = image->image.width * image->image.height * 4;
|
||||
image->offset = shm_pool_allocate(theme->pool, size);
|
||||
nbytes = image->image.width * image->image.height * 4;
|
||||
image->offset = shm_pool_allocate(theme->pool, nbytes);
|
||||
if (image->offset < 0) {
|
||||
free(image);
|
||||
break;
|
||||
}
|
||||
|
||||
/* copy pixels to shm pool */
|
||||
memcpy(theme->pool->data + image->offset,
|
||||
images->images[i]->pixels, size);
|
||||
if (load_scale == 1) {
|
||||
/* copy pixels to shm pool */
|
||||
memcpy(theme->pool->data + image->offset,
|
||||
images->images[i]->pixels, nbytes);
|
||||
}
|
||||
else {
|
||||
/* scale image up while copying it */
|
||||
for (int y = 0; y < image->image.height; y++) {
|
||||
char *p = theme->pool->data + image->offset + y * image->image.width * 4;
|
||||
char *q = ((char *)images->images[i]->pixels) + (y / load_scale) * images->images[i]->width * 4;
|
||||
for (int x = 0; x < image->image.width; x++) {
|
||||
p[4 * x] = q[4 * (x/load_scale)];
|
||||
p[4 * x + 1] = q[4 * (x/load_scale) + 1];
|
||||
p[4 * x + 2] = q[4 * (x/load_scale) + 2];
|
||||
p[4 * x + 3] = q[4 * (x/load_scale) + 3];
|
||||
}
|
||||
}
|
||||
}
|
||||
cursor->total_delay += image->image.delay;
|
||||
cursor->cursor.images[i] = (struct wl_cursor_image *) image;
|
||||
}
|
||||
@@ -257,27 +300,24 @@ wl_cursor_create_from_xcursor_images(XcursorImages *images,
|
||||
free(cursor->cursor.name);
|
||||
free(cursor->cursor.images);
|
||||
free(cursor);
|
||||
xcursor_images_destroy (images);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
xcursor_images_destroy (images);
|
||||
|
||||
return &cursor->cursor;
|
||||
}
|
||||
|
||||
static void
|
||||
load_cursor(struct wl_cursor_theme *theme, const char *name, unsigned int size)
|
||||
load_cursor(struct wl_cursor_theme *theme,
|
||||
const char *name,
|
||||
unsigned int size,
|
||||
unsigned int scale)
|
||||
{
|
||||
XcursorImages *images;
|
||||
struct wl_cursor *cursor;
|
||||
char *path;
|
||||
|
||||
path = g_strconcat (theme->path, "/", name, NULL);
|
||||
images = xcursor_load_images (path, size);
|
||||
g_free (path);
|
||||
|
||||
if (!images)
|
||||
return;
|
||||
|
||||
cursor = wl_cursor_create_from_xcursor_images(images, theme, name, size);
|
||||
cursor = wl_cursor_create_from_xcursor_images(theme, name, size, scale);
|
||||
|
||||
if (cursor) {
|
||||
theme->cursor_count++;
|
||||
@@ -292,8 +332,6 @@ load_cursor(struct wl_cursor_theme *theme, const char *name, unsigned int size)
|
||||
theme->cursors[theme->cursor_count - 1] = cursor;
|
||||
}
|
||||
}
|
||||
|
||||
xcursor_images_destroy (images);
|
||||
}
|
||||
|
||||
/** Load a cursor theme to memory shared with the compositor
|
||||
@@ -373,7 +411,7 @@ wl_cursor_theme_get_cursor(struct wl_cursor_theme *theme,
|
||||
return theme->cursors[i];
|
||||
}
|
||||
|
||||
load_cursor (theme, name, size);
|
||||
load_cursor (theme, name, theme->size, scale);
|
||||
|
||||
if (i < theme->cursor_count) {
|
||||
if (size == theme->cursors[i]->size &&
|
||||
|
||||
@@ -59,13 +59,17 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
if (display->xdg_activation)
|
||||
{
|
||||
struct xdg_activation_token_v1 *token;
|
||||
struct wl_event_queue *event_queue;
|
||||
struct wl_surface *wl_surface = NULL;
|
||||
GdkWaylandSeat *seat;
|
||||
GdkSurface *focus_surface;
|
||||
AppLaunchData app_launch_data = { 0 };
|
||||
|
||||
event_queue = wl_display_create_queue (display->wl_display);
|
||||
|
||||
seat = GDK_WAYLAND_SEAT (gdk_display_get_default_seat (GDK_DISPLAY (display)));
|
||||
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
|
||||
token = xdg_activation_v1_get_activation_token (display->xdg_activation);
|
||||
wl_proxy_set_queue ((struct wl_proxy *) token, event_queue);
|
||||
|
||||
xdg_activation_token_v1_add_listener (token,
|
||||
&token_listener,
|
||||
@@ -73,16 +77,21 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
xdg_activation_token_v1_set_serial (token,
|
||||
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
|
||||
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
|
||||
|
||||
focus_surface = gdk_wayland_device_get_focus (gdk_seat_get_keyboard (GDK_SEAT (seat)));
|
||||
if (focus_surface)
|
||||
xdg_activation_token_v1_set_surface (token,
|
||||
gdk_wayland_surface_get_wl_surface (focus_surface));
|
||||
wl_surface = gdk_wayland_surface_get_wl_surface (focus_surface);
|
||||
if (wl_surface)
|
||||
xdg_activation_token_v1_set_surface (token, wl_surface);
|
||||
|
||||
xdg_activation_token_v1_commit (token);
|
||||
|
||||
while (app_launch_data.token == NULL)
|
||||
wl_display_roundtrip (display->wl_display);
|
||||
wl_display_dispatch_queue (display->wl_display, event_queue);
|
||||
|
||||
xdg_activation_token_v1_destroy (token);
|
||||
id = app_launch_data.token;
|
||||
wl_event_queue_destroy (event_queue);
|
||||
}
|
||||
else if (display->gtk_shell_version >= 3)
|
||||
{
|
||||
|
||||
@@ -178,6 +178,7 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
if (c)
|
||||
{
|
||||
struct wl_cursor_image *image;
|
||||
int cursor_scale;
|
||||
|
||||
if (image_index >= c->image_count)
|
||||
{
|
||||
@@ -189,12 +190,22 @@ _gdk_wayland_cursor_get_buffer (GdkWaylandDisplay *display,
|
||||
|
||||
image = c->images[image_index];
|
||||
|
||||
*hotspot_x = image->hotspot_x / desired_scale;
|
||||
*hotspot_y = image->hotspot_y / desired_scale;
|
||||
cursor_scale = desired_scale;
|
||||
if ((image->width % cursor_scale != 0) ||
|
||||
(image->height % cursor_scale != 0))
|
||||
{
|
||||
g_warning (G_STRLOC " cursor image size (%dx%d) not an integer"
|
||||
"multiple of scale (%d)", image->width, image->height,
|
||||
cursor_scale);
|
||||
cursor_scale = 1;
|
||||
}
|
||||
|
||||
*width = image->width / desired_scale;
|
||||
*height = image->height / desired_scale;
|
||||
*scale = desired_scale;
|
||||
*hotspot_x = image->hotspot_x / cursor_scale;
|
||||
*hotspot_y = image->hotspot_y / cursor_scale;
|
||||
|
||||
*width = image->width / cursor_scale;
|
||||
*height = image->height / cursor_scale;
|
||||
*scale = cursor_scale;
|
||||
|
||||
return wl_cursor_image_get_buffer (image);
|
||||
}
|
||||
|
||||
@@ -1394,8 +1394,7 @@ flush_discrete_scroll_event (GdkWaylandSeat *seat,
|
||||
NULL,
|
||||
seat->pointer_info.time,
|
||||
device_get_modifiers (seat->logical_pointer),
|
||||
direction,
|
||||
TRUE);
|
||||
direction);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
}
|
||||
@@ -3999,17 +3998,6 @@ tablet_tool_handle_wheel (void *data,
|
||||
GDK_SCROLL_UNIT_WHEEL);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
|
||||
/* Send discrete event */
|
||||
event = gdk_scroll_event_new_discrete (tablet->pointer_info.focus,
|
||||
tablet->stylus_device,
|
||||
tablet->current_tool->tool,
|
||||
tablet->pointer_info.time,
|
||||
device_get_modifiers (tablet->logical_device),
|
||||
clicks > 0 ? GDK_SCROLL_DOWN : GDK_SCROLL_UP,
|
||||
TRUE);
|
||||
|
||||
_gdk_wayland_display_deliver_event (seat->display, event);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -623,7 +623,7 @@ _gdk_wayland_display_open (const char *display_name)
|
||||
wl_registry_bind (display_wayland->wl_registry,
|
||||
display_wayland->xdg_wm_base_id,
|
||||
&xdg_wm_base_interface,
|
||||
MIN (display_wayland->xdg_wm_base_version, 3));
|
||||
MIN (display_wayland->xdg_wm_base_version, 4));
|
||||
xdg_wm_base_add_listener (display_wayland->xdg_wm_base,
|
||||
&xdg_wm_base_listener,
|
||||
display_wayland);
|
||||
@@ -2169,8 +2169,7 @@ gdk_wayland_display_get_setting (GdkDisplay *display,
|
||||
{
|
||||
if (strcmp (name, "gtk-decoration-layout") == 0)
|
||||
set_decoration_layout_from_entry (display, entry, value);
|
||||
else if (strcmp (name, "gtk-theme-name") == 0 ||
|
||||
strcmp (name, "gtk-icon-theme-name") == 0)
|
||||
else if (strcmp (name, "gtk-theme-name") == 0)
|
||||
set_theme_from_entry (display, entry, value);
|
||||
else
|
||||
set_value_from_entry (display, entry, value);
|
||||
|
||||
@@ -113,6 +113,7 @@ struct _GdkWaylandSurface
|
||||
|
||||
PopupState popup_state;
|
||||
|
||||
unsigned int popup_thaw_upon_show : 1;
|
||||
unsigned int initial_configure_received : 1;
|
||||
unsigned int has_uncommitted_ack_configure : 1;
|
||||
unsigned int mapped : 1;
|
||||
@@ -167,6 +168,10 @@ struct _GdkWaylandSurface
|
||||
|
||||
struct {
|
||||
GdkToplevelLayout *layout;
|
||||
|
||||
int bounds_width;
|
||||
int bounds_height;
|
||||
gboolean has_bounds;
|
||||
} toplevel;
|
||||
|
||||
struct {
|
||||
@@ -181,6 +186,10 @@ struct _GdkWaylandSurface
|
||||
int height;
|
||||
GdkToplevelState state;
|
||||
gboolean is_resizing;
|
||||
|
||||
int bounds_width;
|
||||
int bounds_height;
|
||||
gboolean has_bounds;
|
||||
} toplevel;
|
||||
|
||||
struct {
|
||||
@@ -1393,19 +1402,28 @@ configure_toplevel_geometry (GdkSurface *surface)
|
||||
{
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
GdkDisplay *display = gdk_surface_get_display (surface);
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle monitor_geometry;
|
||||
int bounds_width, bounds_height;
|
||||
GdkToplevelSize size;
|
||||
GdkToplevelLayout *layout;
|
||||
GdkGeometry geometry;
|
||||
GdkSurfaceHints mask;
|
||||
|
||||
monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
g_object_unref (monitor);
|
||||
bounds_width = monitor_geometry.width;
|
||||
bounds_height = monitor_geometry.height;
|
||||
if (impl->toplevel.has_bounds)
|
||||
{
|
||||
bounds_width = impl->toplevel.bounds_width;
|
||||
bounds_height = impl->toplevel.bounds_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
GdkMonitor *monitor;
|
||||
GdkRectangle monitor_geometry;
|
||||
|
||||
monitor = g_list_model_get_item (gdk_display_get_monitors (display), 0);
|
||||
gdk_monitor_get_geometry (monitor, &monitor_geometry);
|
||||
bounds_width = monitor_geometry.width;
|
||||
bounds_height = monitor_geometry.height;
|
||||
g_object_unref (monitor);
|
||||
}
|
||||
|
||||
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
|
||||
gdk_toplevel_notify_compute_size (GDK_TOPLEVEL (surface), &size);
|
||||
@@ -1507,6 +1525,13 @@ gdk_wayland_surface_configure_toplevel (GdkSurface *surface)
|
||||
is_resizing = impl->pending.toplevel.is_resizing;
|
||||
impl->pending.toplevel.is_resizing = FALSE;
|
||||
|
||||
if (impl->pending.toplevel.has_bounds)
|
||||
{
|
||||
impl->toplevel.bounds_width = impl->pending.toplevel.bounds_width;
|
||||
impl->toplevel.bounds_height = impl->pending.toplevel.bounds_height;
|
||||
impl->toplevel.has_bounds = TRUE;
|
||||
}
|
||||
|
||||
fixed_size =
|
||||
new_state & (GDK_TOPLEVEL_STATE_MAXIMIZED |
|
||||
GDK_TOPLEVEL_STATE_FULLSCREEN |
|
||||
@@ -1846,9 +1871,24 @@ xdg_toplevel_close (void *data,
|
||||
gdk_wayland_surface_handle_close (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
xdg_toplevel_configure_bounds (void *data,
|
||||
struct xdg_toplevel *xdg_toplevel,
|
||||
int32_t width,
|
||||
int32_t height)
|
||||
{
|
||||
GdkSurface *surface = GDK_SURFACE (data);
|
||||
GdkWaylandSurface *impl = GDK_WAYLAND_SURFACE (surface);
|
||||
|
||||
impl->pending.toplevel.bounds_width = width;
|
||||
impl->pending.toplevel.bounds_height = height;
|
||||
impl->pending.toplevel.has_bounds = TRUE;
|
||||
}
|
||||
|
||||
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
|
||||
xdg_toplevel_configure,
|
||||
xdg_toplevel_close,
|
||||
xdg_toplevel_configure_bounds,
|
||||
};
|
||||
|
||||
static void
|
||||
@@ -2984,6 +3024,9 @@ gdk_wayland_surface_hide_surface (GdkSurface *surface)
|
||||
|
||||
if (GDK_IS_POPUP (surface))
|
||||
{
|
||||
impl->popup_thaw_upon_show = TRUE;
|
||||
gdk_surface_freeze_updates (surface);
|
||||
|
||||
switch (impl->popup_state)
|
||||
{
|
||||
case POPUP_STATE_WAITING_FOR_REPOSITIONED:
|
||||
@@ -3223,6 +3266,12 @@ show_popup (GdkSurface *surface,
|
||||
if (!impl->display_server.wl_surface)
|
||||
gdk_wayland_surface_create_surface (surface);
|
||||
|
||||
if (impl->popup_thaw_upon_show)
|
||||
{
|
||||
impl->popup_thaw_upon_show = FALSE;
|
||||
gdk_surface_thaw_updates (surface);
|
||||
}
|
||||
|
||||
gdk_wayland_surface_map_popup (surface, width, height, layout);
|
||||
}
|
||||
|
||||
|
||||
@@ -231,22 +231,16 @@ gdk_win32_hcursor_class_init (GdkWin32HCursorClass *klass)
|
||||
object_class->set_property = gdk_win32_hcursor_set_property;
|
||||
|
||||
hcursor_props[PROP_DISPLAY] =
|
||||
g_param_spec_object ("display",
|
||||
P_("Display"),
|
||||
P_("The display that will use this cursor"),
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
|
||||
|
||||
hcursor_props[PROP_HANDLE] =
|
||||
g_param_spec_pointer ("handle",
|
||||
P_("Handle"),
|
||||
P_("The HCURSOR handle for this cursor"),
|
||||
g_param_spec_pointer ("handle", NULL, NULL,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
|
||||
|
||||
hcursor_props[PROP_DESTROYABLE] =
|
||||
g_param_spec_boolean ("destroyable",
|
||||
P_("Destroyable"),
|
||||
P_("Whether calling DestroyCursor() is allowed on this cursor"),
|
||||
g_param_spec_boolean ("destroyable", NULL, NULL,
|
||||
TRUE,
|
||||
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE);
|
||||
|
||||
|
||||
@@ -58,6 +58,7 @@
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdevice-virtual.h"
|
||||
#include "gdkdevice-wintab.h"
|
||||
#include "gdkinput-dmanipulation.h"
|
||||
#include "gdkinput-winpointer.h"
|
||||
#include "gdkwin32dnd.h"
|
||||
#include "gdkwin32dnd-private.h"
|
||||
@@ -2656,6 +2657,13 @@ gdk_event_translate (MSG *msg,
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
case DM_POINTERHITTEST:
|
||||
gdk_dmanipulation_maybe_add_contact (window, msg);
|
||||
|
||||
*ret_valp = 0;
|
||||
return_val = TRUE;
|
||||
break;
|
||||
|
||||
case WM_MOUSEWHEEL:
|
||||
case WM_MOUSEHWHEEL:
|
||||
{
|
||||
@@ -3156,6 +3164,8 @@ gdk_event_translate (MSG *msg,
|
||||
if (win32_display->tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
|
||||
gdk_winpointer_finalize_surface (window);
|
||||
|
||||
gdk_dmanipulation_finalize_surface (window);
|
||||
|
||||
return_val = FALSE;
|
||||
break;
|
||||
|
||||
|
||||
@@ -548,17 +548,12 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
|
||||
* wglCreateContextAttribsARB() may only give us the GL context version
|
||||
* that we ask for here, and nothing more. So, improve things here by
|
||||
* asking for the GL version that is reported to us via epoxy_gl_version(),
|
||||
* rather than the default GL core 3.2 context. Save this up in our
|
||||
* GdkGLContext so that subsequent contexts that are shared with this
|
||||
* context are created likewise too.
|
||||
* rather than the default GL core 3.2 context.
|
||||
*/
|
||||
if (share != NULL)
|
||||
gdk_gl_context_get_required_version (share, &major, &minor);
|
||||
else
|
||||
{
|
||||
major = display_win32->gl_version / 10;
|
||||
minor = display_win32->gl_version % 10;
|
||||
}
|
||||
gdk_gl_context_get_clipped_version (context,
|
||||
display_win32->gl_version / 10,
|
||||
display_win32->gl_version % 10,
|
||||
&major, &minor);
|
||||
|
||||
if (surface != NULL)
|
||||
hdc = GDK_WIN32_SURFACE (surface)->hdc;
|
||||
@@ -626,7 +621,6 @@ gdk_win32_gl_context_wgl_realize (GdkGLContext *context,
|
||||
|
||||
/* Ensure that any other context is created with a legacy bit set */
|
||||
gdk_gl_context_set_is_legacy (context, legacy_bit);
|
||||
gdk_gl_context_set_required_version (context, major, minor);
|
||||
|
||||
return GDK_GL_API_GL;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,592 @@
|
||||
/* gdkinput-dmanipulation.c
|
||||
*
|
||||
* Copyright © 2022 the GTK team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
/* {{{ */
|
||||
|
||||
#ifdef WINVER
|
||||
#undef WINVER
|
||||
#endif
|
||||
#ifdef _WIN32_WINNT
|
||||
#undef _WIN32_WINNT
|
||||
#endif
|
||||
#define WINVER 0x0603
|
||||
#define _WIN32_WINNT 0x0603
|
||||
#define COBJMACROS
|
||||
#include "config.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
#include "gdkwin32.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkdevicemanager-win32.h"
|
||||
#include "gdkdevice-virtual.h"
|
||||
#include "gdkdeviceprivate.h"
|
||||
#include "gdkdisplayprivate.h"
|
||||
#include "gdkeventsprivate.h"
|
||||
#include "gdkseatdefaultprivate.h"
|
||||
#include "gdkinput-dmanipulation.h"
|
||||
#include "winpointer.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <directmanipulation.h>
|
||||
|
||||
typedef BOOL
|
||||
(WINAPI *getPointerType_t)(UINT32 pointerId, POINTER_INPUT_TYPE *pointerType);
|
||||
static getPointerType_t getPointerType;
|
||||
|
||||
static IDirectManipulationManager *dmanipulation_manager;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
IDirectManipulationViewportEventHandlerVtbl *vtable;
|
||||
LONG reference_count;
|
||||
|
||||
enum {
|
||||
GESTURE_PAN,
|
||||
GESTURE_ZOOM,
|
||||
} gesture;
|
||||
|
||||
GdkTouchpadGesturePhase phase;
|
||||
gpointer sequence;
|
||||
|
||||
float scale;
|
||||
float pan_x;
|
||||
float pan_y;
|
||||
|
||||
GdkSurface *surface;
|
||||
GdkDevice *device;
|
||||
}
|
||||
DManipEventHandler;
|
||||
|
||||
static void dmanip_event_handler_running_state_clear (DManipEventHandler *handler);
|
||||
static void dmanip_event_handler_free (DManipEventHandler *handler);
|
||||
|
||||
static void reset_viewport (IDirectManipulationViewport *viewport);
|
||||
|
||||
static gpointer util_get_next_sequence (void);
|
||||
static GdkModifierType util_get_modifier_state (void);
|
||||
static gboolean util_handler_free (gpointer);
|
||||
|
||||
/* }}} */
|
||||
/* {{{ ViewportEventHandler */
|
||||
|
||||
static STDMETHODIMP_ (ULONG)
|
||||
DManipEventHandler_AddRef (IDirectManipulationViewportEventHandler *self_)
|
||||
{
|
||||
DManipEventHandler *self = (DManipEventHandler*) self_;
|
||||
|
||||
return (ULONG) InterlockedIncrement (&self->reference_count);
|
||||
}
|
||||
|
||||
static STDMETHODIMP_ (ULONG)
|
||||
DManipEventHandler_Release (IDirectManipulationViewportEventHandler *self_)
|
||||
{
|
||||
DManipEventHandler *self = (DManipEventHandler*) self_;
|
||||
|
||||
/* NOTE: This may run from a worker thread */
|
||||
|
||||
LONG new_reference_count = InterlockedDecrement (&self->reference_count);
|
||||
|
||||
if (new_reference_count <= 0)
|
||||
{
|
||||
/* For safety, schedule the cleanup to be executed
|
||||
* on the main thread */
|
||||
g_idle_add (util_handler_free, self);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
return (ULONG) new_reference_count;
|
||||
}
|
||||
|
||||
static STDMETHODIMP
|
||||
DManipEventHandler_QueryInterface (IDirectManipulationViewportEventHandler *self_,
|
||||
REFIID riid,
|
||||
void **ppvObject)
|
||||
{
|
||||
DManipEventHandler *self = (DManipEventHandler*) self_;
|
||||
|
||||
if G_UNLIKELY (!self || !ppvObject)
|
||||
return E_POINTER;
|
||||
|
||||
*ppvObject = NULL;
|
||||
|
||||
if (IsEqualGUID (riid, &IID_IUnknown))
|
||||
*ppvObject = self;
|
||||
else if (IsEqualGUID (riid, &IID_IDirectManipulationViewportEventHandler))
|
||||
*ppvObject = self;
|
||||
|
||||
if (*ppvObject == NULL)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
DManipEventHandler_AddRef (self_);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
/* NOTE:
|
||||
*
|
||||
* All DManipEventHandler callbacks are fired from the main thread */
|
||||
|
||||
static STDMETHODIMP
|
||||
DManipEventHandler_OnViewportUpdated (IDirectManipulationViewportEventHandler *self_,
|
||||
IDirectManipulationViewport *viewport)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static STDMETHODIMP
|
||||
DManipEventHandler_OnContentUpdated (IDirectManipulationViewportEventHandler *self_,
|
||||
IDirectManipulationViewport *viewport,
|
||||
IDirectManipulationContent *content)
|
||||
{
|
||||
DManipEventHandler *self = (DManipEventHandler*) self_;
|
||||
float transform[6] = {1., 0., 0., 1., 0., 0.};
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectManipulationContent_GetContentTransform (content, transform,
|
||||
G_N_ELEMENTS (transform));
|
||||
HR_CHECK_RETURN_VAL (hr, E_FAIL);
|
||||
|
||||
switch (self->gesture)
|
||||
{
|
||||
case GESTURE_PAN:
|
||||
{
|
||||
GdkWin32Surface *surface_win32;
|
||||
GdkModifierType state;
|
||||
uint32_t time;
|
||||
int scale;
|
||||
float pan_x;
|
||||
float pan_y;
|
||||
GdkEvent *event;
|
||||
|
||||
pan_x = transform[4];
|
||||
pan_y = transform[5];
|
||||
|
||||
surface_win32 = GDK_WIN32_SURFACE (self->surface);
|
||||
scale = surface_win32->surface_scale;
|
||||
state = util_get_modifier_state ();
|
||||
time = (uint32_t) GetMessageTime ();
|
||||
|
||||
event = gdk_scroll_event_new (self->surface,
|
||||
self->device,
|
||||
NULL, time, state,
|
||||
(self->pan_x - pan_x) / scale,
|
||||
(self->pan_y - pan_y) / scale,
|
||||
FALSE,
|
||||
GDK_SCROLL_UNIT_SURFACE);
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
self->pan_x = pan_x;
|
||||
self->pan_y = pan_y;
|
||||
}
|
||||
break;
|
||||
case GESTURE_ZOOM:
|
||||
{
|
||||
GdkModifierType state;
|
||||
uint32_t time;
|
||||
POINT cursor = {0, 0};
|
||||
float scale;
|
||||
GdkEvent *event;
|
||||
|
||||
scale = transform[0];
|
||||
|
||||
state = util_get_modifier_state ();
|
||||
time = (uint32_t) GetMessageTime ();
|
||||
_gdk_win32_get_cursor_pos (&cursor);
|
||||
|
||||
ScreenToClient (GDK_SURFACE_HWND (self->surface), &cursor);
|
||||
|
||||
if (!self->sequence)
|
||||
self->sequence = util_get_next_sequence ();
|
||||
|
||||
event = gdk_touchpad_event_new_pinch (self->surface, self->sequence, self->device,
|
||||
time, state, self->phase, cursor.x, cursor.y,
|
||||
2, 0.0, 0.0, scale, 0.0);
|
||||
_gdk_win32_append_event (event);
|
||||
|
||||
self->scale = scale;
|
||||
self->phase = GDK_TOUCHPAD_GESTURE_PHASE_UPDATE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static STDMETHODIMP
|
||||
DManipEventHandler_OnViewportStatusChanged (IDirectManipulationViewportEventHandler *self_,
|
||||
IDirectManipulationViewport *viewport,
|
||||
DIRECTMANIPULATION_STATUS current,
|
||||
DIRECTMANIPULATION_STATUS previous)
|
||||
{
|
||||
DManipEventHandler *self = (DManipEventHandler*) self_;
|
||||
|
||||
if (previous == DIRECTMANIPULATION_RUNNING)
|
||||
{
|
||||
switch (self->gesture)
|
||||
{
|
||||
case GESTURE_PAN:
|
||||
{
|
||||
GdkModifierType state;
|
||||
uint32_t time;
|
||||
GdkEvent *event;
|
||||
|
||||
state = util_get_modifier_state ();
|
||||
time = (uint32_t) GetMessageTime ();
|
||||
|
||||
event = gdk_scroll_event_new (self->surface, self->device,
|
||||
NULL, time, state,
|
||||
0.0, 0.0, TRUE,
|
||||
GDK_SCROLL_UNIT_SURFACE);
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
break;
|
||||
case GESTURE_ZOOM:
|
||||
{
|
||||
GdkModifierType state;
|
||||
uint32_t time;
|
||||
POINT cursor = {0, 0};
|
||||
GdkEvent *event;
|
||||
|
||||
if (self->phase == GDK_TOUCHPAD_GESTURE_PHASE_BEGIN)
|
||||
break;
|
||||
|
||||
state = util_get_modifier_state ();
|
||||
time = (uint32_t) GetMessageTime ();
|
||||
_gdk_win32_get_cursor_pos (&cursor);
|
||||
|
||||
ScreenToClient (GDK_SURFACE_HWND (self->surface), &cursor);
|
||||
|
||||
event = gdk_touchpad_event_new_pinch (self->surface, self->sequence, self->device,
|
||||
time, state, GDK_TOUCHPAD_GESTURE_PHASE_END,
|
||||
cursor.x, cursor.y, 2, 0., 0., self->scale,
|
||||
0.);
|
||||
_gdk_win32_append_event (event);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
dmanip_event_handler_running_state_clear (self);
|
||||
reset_viewport (viewport);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void
|
||||
dmanip_event_handler_running_state_clear (DManipEventHandler *handler)
|
||||
{
|
||||
handler->scale = 1.0;
|
||||
handler->pan_x = 0.0;
|
||||
handler->pan_y = 0.0;
|
||||
|
||||
handler->phase = GDK_TOUCHPAD_GESTURE_PHASE_BEGIN;
|
||||
handler->sequence = NULL;
|
||||
}
|
||||
|
||||
static DManipEventHandler*
|
||||
dmanip_event_handler_new (GdkSurface *surface,
|
||||
int gesture)
|
||||
{
|
||||
static IDirectManipulationViewportEventHandlerVtbl vtable = {
|
||||
DManipEventHandler_QueryInterface,
|
||||
DManipEventHandler_AddRef,
|
||||
DManipEventHandler_Release,
|
||||
DManipEventHandler_OnViewportStatusChanged,
|
||||
DManipEventHandler_OnViewportUpdated,
|
||||
DManipEventHandler_OnContentUpdated,
|
||||
};
|
||||
DManipEventHandler *handler;
|
||||
|
||||
handler = g_new0 (DManipEventHandler, 1);
|
||||
handler->vtable = &vtable;
|
||||
handler->reference_count = 1;
|
||||
|
||||
handler->gesture = gesture;
|
||||
|
||||
handler->surface = surface;
|
||||
handler->device = _gdk_device_manager->core_pointer;
|
||||
|
||||
dmanip_event_handler_running_state_clear (handler);
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
static void
|
||||
dmanip_event_handler_free (DManipEventHandler *handler)
|
||||
{
|
||||
g_free (handler);
|
||||
}
|
||||
|
||||
|
||||
/* }}} */
|
||||
/* {{{ Viewport utils */
|
||||
|
||||
|
||||
static void
|
||||
reset_viewport (IDirectManipulationViewport *viewport)
|
||||
{
|
||||
IDirectManipulationContent *content = NULL;
|
||||
REFIID iid = &IID_IDirectManipulationContent;
|
||||
float identity[6] = {1., 0., 0., 1., 0., 0.};
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectManipulationViewport_GetPrimaryContent (viewport, iid, (void**)&content);
|
||||
HR_CHECK (hr);
|
||||
|
||||
hr = IDirectManipulationContent_SyncContentTransform (content, identity,
|
||||
G_N_ELEMENTS (identity));
|
||||
HR_CHECK (hr);
|
||||
|
||||
IUnknown_Release (content);
|
||||
}
|
||||
|
||||
static void
|
||||
close_viewport (IDirectManipulationViewport **p_viewport)
|
||||
{
|
||||
IDirectManipulationViewport *viewport = *p_viewport;
|
||||
|
||||
if (viewport)
|
||||
{
|
||||
IDirectManipulationViewport_Abandon (viewport);
|
||||
IUnknown_Release (viewport);
|
||||
|
||||
*p_viewport = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
create_viewport (GdkSurface *surface,
|
||||
int gesture,
|
||||
IDirectManipulationViewport **pViewport)
|
||||
{
|
||||
DIRECTMANIPULATION_CONFIGURATION configuration = 0;
|
||||
HWND hwnd = GDK_SURFACE_HWND (surface);
|
||||
IDirectManipulationViewportEventHandler *handler;
|
||||
DWORD cookie = 0;
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectManipulationManager_CreateViewport (dmanipulation_manager, NULL, hwnd,
|
||||
&IID_IDirectManipulationViewport,
|
||||
(void**) pViewport);
|
||||
HR_CHECK_GOTO (hr, failed);
|
||||
|
||||
switch (gesture)
|
||||
{
|
||||
case GESTURE_PAN:
|
||||
configuration = DIRECTMANIPULATION_CONFIGURATION_INTERACTION |
|
||||
DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_X |
|
||||
DIRECTMANIPULATION_CONFIGURATION_TRANSLATION_Y;
|
||||
break;
|
||||
case GESTURE_ZOOM:
|
||||
configuration = DIRECTMANIPULATION_CONFIGURATION_INTERACTION |
|
||||
DIRECTMANIPULATION_CONFIGURATION_SCALING;
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached ();
|
||||
break;
|
||||
}
|
||||
|
||||
handler = (IDirectManipulationViewportEventHandler*)
|
||||
dmanip_event_handler_new (surface, gesture);
|
||||
|
||||
hr = IDirectManipulationViewport_AddEventHandler (*pViewport, hwnd, handler, &cookie);
|
||||
HR_CHECK_GOTO (hr, failed);
|
||||
|
||||
hr = IDirectManipulationViewport_ActivateConfiguration (*pViewport, configuration);
|
||||
HR_CHECK_GOTO (hr, failed);
|
||||
|
||||
hr = IDirectManipulationViewport_SetViewportOptions (*pViewport,
|
||||
DIRECTMANIPULATION_VIEWPORT_OPTIONS_DISABLEPIXELSNAPPING);
|
||||
|
||||
hr = IDirectManipulationViewport_Enable (*pViewport);
|
||||
HR_CHECK_GOTO (hr, failed);
|
||||
|
||||
// drop our initial reference
|
||||
IUnknown_Release (handler);
|
||||
return;
|
||||
|
||||
failed:
|
||||
if (handler)
|
||||
IUnknown_Release (handler);
|
||||
|
||||
close_viewport (pViewport);
|
||||
}
|
||||
|
||||
|
||||
/* }}} */
|
||||
/* {{{ Public */
|
||||
|
||||
|
||||
void gdk_dmanipulation_initialize (void)
|
||||
{
|
||||
if (!getPointerType)
|
||||
{
|
||||
HMODULE user32_mod;
|
||||
|
||||
user32_mod = LoadLibraryW (L"user32.dll");
|
||||
if (!user32_mod)
|
||||
{
|
||||
WIN32_API_FAILED ("LoadLibraryW");
|
||||
return;
|
||||
}
|
||||
|
||||
getPointerType = (getPointerType_t)
|
||||
GetProcAddress (user32_mod, "GetPointerType");
|
||||
|
||||
if (!getPointerType)
|
||||
return;
|
||||
}
|
||||
|
||||
if (!gdk_win32_ensure_com ())
|
||||
return;
|
||||
|
||||
if (dmanipulation_manager == NULL)
|
||||
{
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoCreateInstance (&CLSID_DirectManipulationManager,
|
||||
NULL,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
&IID_IDirectManipulationManager,
|
||||
(LPVOID*)&dmanipulation_manager);
|
||||
if (FAILED (hr))
|
||||
{
|
||||
if (hr == REGDB_E_CLASSNOTREG || hr == E_NOINTERFACE);
|
||||
/* Not an error,
|
||||
* DirectManipulation is not available */
|
||||
else HR_LOG (hr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gdk_dmanipulation_initialize_surface (GdkSurface *surface)
|
||||
{
|
||||
GdkWin32Surface *surface_win32;
|
||||
HRESULT hr;
|
||||
|
||||
if (!dmanipulation_manager)
|
||||
return;
|
||||
|
||||
surface_win32 = GDK_WIN32_SURFACE (surface);
|
||||
|
||||
create_viewport (surface, GESTURE_PAN,
|
||||
&surface_win32->dmanipulation_viewport_pan);
|
||||
|
||||
create_viewport (surface, GESTURE_ZOOM,
|
||||
&surface_win32->dmanipulation_viewport_zoom);
|
||||
|
||||
hr = IDirectManipulationManager_Activate (dmanipulation_manager,
|
||||
GDK_SURFACE_HWND (surface));
|
||||
HR_CHECK (hr);
|
||||
}
|
||||
|
||||
void gdk_dmanipulation_finalize_surface (GdkSurface *surface)
|
||||
{
|
||||
GdkWin32Surface *surface_win32 = GDK_WIN32_SURFACE (surface);
|
||||
|
||||
close_viewport (&surface_win32->dmanipulation_viewport_zoom);
|
||||
close_viewport (&surface_win32->dmanipulation_viewport_pan);
|
||||
}
|
||||
|
||||
void gdk_dmanipulation_maybe_add_contact (GdkSurface *surface,
|
||||
MSG *msg)
|
||||
{
|
||||
POINTER_INPUT_TYPE type = PT_POINTER;
|
||||
UINT32 pointer_id = GET_POINTERID_WPARAM (msg->wParam);
|
||||
|
||||
if (!dmanipulation_manager)
|
||||
return;
|
||||
|
||||
if (!getPointerType)
|
||||
return;
|
||||
|
||||
if G_UNLIKELY (!getPointerType (pointer_id, &type))
|
||||
{
|
||||
WIN32_API_FAILED_LOG_ONCE ("GetPointerType");
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == PT_TOUCHPAD)
|
||||
{
|
||||
GdkWin32Surface *surface_win32 = GDK_WIN32_SURFACE (surface);
|
||||
HRESULT hr;
|
||||
|
||||
hr = IDirectManipulationViewport_SetContact (surface_win32->dmanipulation_viewport_pan,
|
||||
pointer_id);
|
||||
HR_CHECK (hr);
|
||||
|
||||
hr = IDirectManipulationViewport_SetContact (surface_win32->dmanipulation_viewport_zoom,
|
||||
pointer_id);
|
||||
HR_CHECK (hr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* }}} */
|
||||
/* {{{ Utils */
|
||||
|
||||
|
||||
static gpointer
|
||||
util_get_next_sequence (void)
|
||||
{
|
||||
//TODO: sequence of other input types?
|
||||
static unsigned char *sequence_counter = 0;
|
||||
|
||||
if (++sequence_counter == 0)
|
||||
sequence_counter++;
|
||||
|
||||
return sequence_counter;
|
||||
}
|
||||
|
||||
static GdkModifierType
|
||||
util_get_modifier_state (void)
|
||||
{
|
||||
GdkModifierType mask = 0;
|
||||
BYTE kbd[256];
|
||||
|
||||
GetKeyboardState (kbd);
|
||||
if (kbd[VK_SHIFT] & 0x80)
|
||||
mask |= GDK_SHIFT_MASK;
|
||||
if (kbd[VK_CAPITAL] & 0x80)
|
||||
mask |= GDK_LOCK_MASK;
|
||||
if (kbd[VK_CONTROL] & 0x80)
|
||||
mask |= GDK_CONTROL_MASK;
|
||||
if (kbd[VK_MENU] & 0x80)
|
||||
mask |= GDK_ALT_MASK;
|
||||
|
||||
return mask;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
util_handler_free (gpointer handler)
|
||||
{
|
||||
dmanip_event_handler_free ((DManipEventHandler*)handler);
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
|
||||
/* }}} */
|
||||
@@ -0,0 +1,32 @@
|
||||
/* gdkinput-dmanipulation.h
|
||||
*
|
||||
* Copyright © 2022 the GTK team
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
*/
|
||||
|
||||
#ifndef __GDK_INPUT_DMANIPULATION_H__
|
||||
#define __GDK_INPUT_DMANIPULATION_H__
|
||||
|
||||
void gdk_dmanipulation_initialize (void);
|
||||
|
||||
void gdk_dmanipulation_initialize_surface (GdkSurface *surface);
|
||||
void gdk_dmanipulation_finalize_surface (GdkSurface *surface);
|
||||
|
||||
void gdk_dmanipulation_maybe_add_contact (GdkSurface *surface,
|
||||
MSG *msg);
|
||||
|
||||
#endif /* __GDK_INPUT_DMANIPULATION_H__ */
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "gdkkeysyms.h"
|
||||
#include "gdkintl.h"
|
||||
#include "gdkprivate-win32.h"
|
||||
#include "gdkinput-dmanipulation.h"
|
||||
#include "gdkwin32.h"
|
||||
|
||||
#include <objbase.h>
|
||||
@@ -49,6 +50,12 @@
|
||||
|
||||
static gboolean gdk_synchronize = FALSE;
|
||||
|
||||
/* Whether GDK initialized COM */
|
||||
static gboolean co_initialized = FALSE;
|
||||
|
||||
/* Whether GDK initialized OLE */
|
||||
static gboolean ole_initialized = FALSE;
|
||||
|
||||
void
|
||||
_gdk_win32_surfaceing_init (void)
|
||||
{
|
||||
@@ -67,6 +74,82 @@ _gdk_win32_surfaceing_init (void)
|
||||
GDK_NOTE (EVENTS, g_print ("input_locale: %p\n", _gdk_input_locale));
|
||||
|
||||
_gdk_win32_clipdrop_init ();
|
||||
|
||||
gdk_dmanipulation_initialize ();
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_win32_ensure_com (void)
|
||||
{
|
||||
if (!co_initialized)
|
||||
{
|
||||
/* UI thread should only use STA model. See
|
||||
* -> https://devblogs.microsoft.com/oldnewthing/20080424-00/?p=22603
|
||||
* -> https://devblogs.microsoft.com/oldnewthing/20071018-00/?p=24743
|
||||
*/
|
||||
const DWORD flags = COINIT_APARTMENTTHREADED |
|
||||
COINIT_DISABLE_OLE1DDE;
|
||||
HRESULT hr;
|
||||
|
||||
hr = CoInitializeEx (NULL, flags);
|
||||
if (SUCCEEDED (hr))
|
||||
co_initialized = TRUE;
|
||||
else switch (hr)
|
||||
{
|
||||
case RPC_E_CHANGED_MODE:
|
||||
g_warning ("COM runtime already initialized on the main "
|
||||
"thread with an incompatible apartment model");
|
||||
break;
|
||||
default:
|
||||
HR_LOG (hr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return co_initialized;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_finalize_com (void)
|
||||
{
|
||||
if (co_initialized)
|
||||
{
|
||||
CoUninitialize ();
|
||||
co_initialized = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
gboolean
|
||||
gdk_win32_ensure_ole (void)
|
||||
{
|
||||
if (!ole_initialized)
|
||||
{
|
||||
HRESULT hr = OleInitialize (NULL);
|
||||
if (SUCCEEDED (hr))
|
||||
ole_initialized = TRUE;
|
||||
else switch (hr)
|
||||
{
|
||||
case RPC_E_CHANGED_MODE:
|
||||
g_warning ("Failed to initialize the OLE2 runtime because "
|
||||
"the thread has an incompatible apartment model");
|
||||
break;
|
||||
default:
|
||||
HR_LOG (hr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return ole_initialized;
|
||||
}
|
||||
|
||||
static void
|
||||
gdk_win32_finalize_ole (void)
|
||||
{
|
||||
if (ole_initialized)
|
||||
{
|
||||
OleUninitialize ();
|
||||
ole_initialized = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -196,6 +196,9 @@ void _gdk_remove_modal_window (GdkSurface *window);
|
||||
GdkSurface *_gdk_modal_current (void);
|
||||
gboolean _gdk_modal_blocked (GdkSurface *window);
|
||||
|
||||
gboolean gdk_win32_ensure_com (void);
|
||||
gboolean gdk_win32_ensure_ole (void);
|
||||
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
void _gdk_win32_print_paletteentries (const PALETTEENTRY *pep,
|
||||
const int nentries);
|
||||
@@ -252,6 +255,13 @@ void _gdk_other_api_failed (const char *where,
|
||||
#define GDI_CALL(api, arglist) (api arglist ? 1 : (WIN32_GDI_FAILED (#api), 0))
|
||||
#define API_CALL(api, arglist) (api arglist ? 1 : (WIN32_API_FAILED (#api), 0))
|
||||
|
||||
#define HR_LOG(hr)
|
||||
|
||||
#define HR_CHECK_RETURN(hr) { if G_UNLIKELY (FAILED (hr)) return; }
|
||||
#define HR_CHECK_RETURN_VAL(hr, val) { if G_UNLIKELY (FAILED (hr)) return val; }
|
||||
#define HR_CHECK(hr)
|
||||
#define HR_CHECK_GOTO(hr, label) { if G_UNLIKELY (FAILED (hr)) goto label; }
|
||||
|
||||
extern LRESULT CALLBACK _gdk_win32_surface_procedure (HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
extern GdkDisplay *_gdk_display;
|
||||
|
||||
@@ -220,6 +220,19 @@ _gdk_win32_get_setting (const char *name,
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
else if (strcmp ("gtk-overlay-scrolling", name) == 0)
|
||||
{
|
||||
DWORD val = 0;
|
||||
DWORD sz = sizeof (val);
|
||||
LSTATUS ret = 0;
|
||||
|
||||
ret = RegGetValueW (HKEY_CURRENT_USER, L"Control Panel\\Accessibility", L"DynamicScrollbars", RRF_RT_DWORD, NULL, &val, &sz);
|
||||
if (ret == ERROR_SUCCESS)
|
||||
{
|
||||
g_value_set_boolean (value, val != 0);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include "gdktoplevelprivate.h"
|
||||
#include "gdkwin32surface.h"
|
||||
#include "gdkwin32cursor.h"
|
||||
#include "gdkinput-dmanipulation.h"
|
||||
#include "gdkinput-winpointer.h"
|
||||
#include "gdkglcontext-win32.h"
|
||||
#include "gdkdisplay-win32.h"
|
||||
@@ -639,8 +640,14 @@ _gdk_win32_display_create_surface (GdkDisplay *display,
|
||||
}
|
||||
|
||||
gdk_surface_set_egl_native_window (surface, (void *) impl->handle);
|
||||
if (display_win32->tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
|
||||
gdk_winpointer_initialize_surface (surface);
|
||||
|
||||
if (surface_type != GDK_SURFACE_TEMP)
|
||||
{
|
||||
if (display_win32->tablet_input_api == GDK_WIN32_TABLET_INPUT_API_WINPOINTER)
|
||||
gdk_winpointer_initialize_surface (surface);
|
||||
|
||||
gdk_dmanipulation_initialize_surface (surface);
|
||||
}
|
||||
|
||||
_gdk_win32_surface_enable_transparency (surface);
|
||||
_gdk_win32_surface_register_dnd (surface);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "gdk/gdkcursor.h"
|
||||
|
||||
#include <windows.h>
|
||||
#include <directmanipulation.h>
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
# include <epoxy/egl.h>
|
||||
@@ -339,6 +340,9 @@ struct _GdkWin32Surface
|
||||
} next_layout;
|
||||
gboolean force_recompute_size;
|
||||
|
||||
IDirectManipulationViewport *dmanipulation_viewport_pan;
|
||||
IDirectManipulationViewport *dmanipulation_viewport_zoom;
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
guint egl_force_redraw_all : 1;
|
||||
#endif
|
||||
|
||||
@@ -17,6 +17,7 @@ gdk_win32_sources = files([
|
||||
'gdkglcontext-win32-wgl.c',
|
||||
'gdkglobals-win32.c',
|
||||
'gdkhdataoutputstream-win32.c',
|
||||
'gdkinput-dmanipulation.c',
|
||||
'gdkinput-winpointer.c',
|
||||
'gdkkeys-win32.c',
|
||||
'gdkkeys-win32-impl.c',
|
||||
|
||||
@@ -116,9 +116,7 @@ gdk_x11_device_xi2_class_init (GdkX11DeviceXI2Class *klass)
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_DEVICE_ID,
|
||||
g_param_spec_int ("device-id",
|
||||
P_("Device ID"),
|
||||
P_("Device identifier"),
|
||||
g_param_spec_int ("device-id", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
|
||||
@@ -145,33 +145,25 @@ gdk_x11_device_manager_xi2_class_init (GdkX11DeviceManagerXI2Class *klass)
|
||||
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_DISPLAY,
|
||||
g_param_spec_object ("display",
|
||||
"Display",
|
||||
"Display for the device manager",
|
||||
g_param_spec_object ("display", NULL, NULL,
|
||||
GDK_TYPE_DISPLAY,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_OPCODE,
|
||||
g_param_spec_int ("opcode",
|
||||
P_("Opcode"),
|
||||
P_("Opcode for XInput2 requests"),
|
||||
g_param_spec_int ("opcode", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_MAJOR,
|
||||
g_param_spec_int ("major",
|
||||
P_("Major"),
|
||||
P_("Major version number"),
|
||||
g_param_spec_int ("major", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
g_object_class_install_property (object_class,
|
||||
PROP_MINOR,
|
||||
g_param_spec_int ("minor",
|
||||
P_("Minor"),
|
||||
P_("Minor version number"),
|
||||
g_param_spec_int ("minor", NULL, NULL,
|
||||
0, G_MAXINT, 0,
|
||||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY |
|
||||
G_PARAM_STATIC_STRINGS));
|
||||
@@ -1663,8 +1655,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
NULL,
|
||||
xev->time,
|
||||
_gdk_x11_device_xi2_translate_state (&xev->mods, &xev->buttons, &xev->group),
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1766,8 +1757,7 @@ gdk_x11_device_manager_xi2_translate_event (GdkEventTranslator *translator,
|
||||
NULL,
|
||||
xev->time,
|
||||
state,
|
||||
direction,
|
||||
FALSE);
|
||||
direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+143
-168
@@ -213,7 +213,7 @@ gdk_x11_gl_context_glx_clear_current (GdkGLContext *context)
|
||||
static gboolean
|
||||
gdk_x11_gl_context_glx_make_current (GdkGLContext *context,
|
||||
gboolean surfaceless)
|
||||
|
||||
|
||||
{
|
||||
GdkX11GLContextGLX *self = GDK_X11_GL_CONTEXT_GLX (context);
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
@@ -302,68 +302,6 @@ gdk_x11_gl_context_glx_get_damage (GdkGLContext *context)
|
||||
return GDK_GL_CONTEXT_CLASS (gdk_x11_gl_context_glx_parent_class)->get_damage (context);
|
||||
}
|
||||
|
||||
static GLXContext
|
||||
create_gl3_context (GdkDisplay *display,
|
||||
GLXFBConfig config,
|
||||
GdkGLContext *share,
|
||||
int profile,
|
||||
int flags,
|
||||
int major,
|
||||
int minor)
|
||||
{
|
||||
int attrib_list[] = {
|
||||
GLX_CONTEXT_PROFILE_MASK_ARB, profile,
|
||||
GLX_CONTEXT_MAJOR_VERSION_ARB, major,
|
||||
GLX_CONTEXT_MINOR_VERSION_ARB, minor,
|
||||
GLX_CONTEXT_FLAGS_ARB, flags,
|
||||
None,
|
||||
};
|
||||
GLXContext res;
|
||||
|
||||
GdkX11GLContextGLX *share_glx = NULL;
|
||||
|
||||
if (share != NULL)
|
||||
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
res = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
|
||||
config,
|
||||
share_glx != NULL ? share_glx->glx_context : NULL,
|
||||
True,
|
||||
attrib_list);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
return NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static GLXContext
|
||||
create_legacy_context (GdkDisplay *display,
|
||||
GLXFBConfig config,
|
||||
GdkGLContext *share)
|
||||
{
|
||||
GdkX11GLContextGLX *share_glx = NULL;
|
||||
GLXContext res;
|
||||
|
||||
if (share != NULL)
|
||||
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
res = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
|
||||
config,
|
||||
GLX_RGBA_TYPE,
|
||||
share_glx != NULL ? share_glx->glx_context : NULL,
|
||||
TRUE);
|
||||
|
||||
if (gdk_x11_display_error_trap_pop (display))
|
||||
return NULL;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#ifdef HAVE_XDAMAGE
|
||||
static void
|
||||
bind_context_for_frame_fence (GdkX11GLContextGLX *self)
|
||||
@@ -507,134 +445,111 @@ on_surface_state_changed (GdkGLContext *context)
|
||||
*/
|
||||
finish_frame (context);
|
||||
}
|
||||
#endif
|
||||
#endif /* HAVE_XDAMAGE */
|
||||
|
||||
#define N_GLX_ATTRS 16
|
||||
|
||||
static GdkGLAPI
|
||||
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
gdk_x11_context_create_glx_context (GdkGLContext *context,
|
||||
GdkGLAPI api,
|
||||
gboolean legacy)
|
||||
{
|
||||
GdkX11Display *display_x11;
|
||||
GdkDisplay *display;
|
||||
GdkX11GLContextGLX *context_glx;
|
||||
Display *dpy;
|
||||
GdkSurface *surface;
|
||||
GdkGLContext *share;
|
||||
gboolean debug_bit, compat_bit, legacy_bit;
|
||||
int major, minor, flags;
|
||||
GdkGLAPI api = 0;
|
||||
GdkX11GLContextGLX *context_glx = GDK_X11_GL_CONTEXT_GLX (context);;
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkX11Display *display_x11 = GDK_X11_DISPLAY (display);
|
||||
Display *dpy = gdk_x11_display_get_xdisplay (display);
|
||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||
GdkX11GLContextGLX *share_glx = NULL;
|
||||
GdkSurface *surface = gdk_gl_context_get_surface (context);
|
||||
GLXContext ctx;
|
||||
int context_attribs[N_GLX_ATTRS], i = 0, flags = 0;
|
||||
int min_major, min_minor, major, minor;
|
||||
gboolean debug_bit, compat_bit;
|
||||
|
||||
display = gdk_gl_context_get_display (context);
|
||||
dpy = gdk_x11_display_get_xdisplay (display);
|
||||
context_glx = GDK_X11_GL_CONTEXT_GLX (context);
|
||||
display_x11 = GDK_X11_DISPLAY (display);
|
||||
share = gdk_display_get_gl_context (display);
|
||||
surface = gdk_gl_context_get_surface (context);
|
||||
if (!gdk_gl_context_is_api_allowed (context, api, NULL))
|
||||
return 0;
|
||||
|
||||
if (api == GDK_GL_API_GLES && legacy)
|
||||
return 0;
|
||||
|
||||
/* We will use the default version matching the context status
|
||||
* unless the user requested a version which makes sense */
|
||||
gdk_gl_context_get_matching_version (api, legacy, 0,
|
||||
&min_major, &min_minor);
|
||||
gdk_gl_context_get_clipped_version (context, min_major, min_minor,
|
||||
&major, &minor);
|
||||
|
||||
gdk_gl_context_get_required_version (context, &major, &minor);
|
||||
debug_bit = gdk_gl_context_get_debug_enabled (context);
|
||||
compat_bit = gdk_gl_context_get_forward_compatible (context);
|
||||
|
||||
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
|
||||
legacy_bit = !display_x11->has_glx_create_context || GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY);
|
||||
|
||||
/* We cannot share legacy contexts with core profile ones, so the
|
||||
* shared context is the one that decides if we're going to create
|
||||
* a legacy context or not.
|
||||
*/
|
||||
if (share != NULL && gdk_gl_context_is_legacy (share))
|
||||
legacy_bit = TRUE;
|
||||
|
||||
flags = 0;
|
||||
if (debug_bit)
|
||||
flags |= GLX_CONTEXT_DEBUG_BIT_ARB;
|
||||
if (compat_bit)
|
||||
flags |= GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB;
|
||||
|
||||
context_attribs[i++] = GLX_CONTEXT_PROFILE_MASK_ARB;
|
||||
if (api == GDK_GL_API_GL)
|
||||
if (legacy)
|
||||
context_attribs[i++] = GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
|
||||
else
|
||||
context_attribs[i++] = GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
else if (api == GDK_GL_API_GLES)
|
||||
context_attribs[i++] = GLX_CONTEXT_ES2_PROFILE_BIT_EXT;
|
||||
|
||||
context_attribs[i++] = GLX_CONTEXT_MAJOR_VERSION_ARB;
|
||||
context_attribs[i++] = major;
|
||||
context_attribs[i++] = GLX_CONTEXT_MINOR_VERSION_ARB;
|
||||
context_attribs[i++] = minor;
|
||||
context_attribs[i++] = GLX_CONTEXT_FLAGS_ARB;
|
||||
context_attribs[i++] = flags;
|
||||
|
||||
context_attribs[i++] = None;
|
||||
g_assert (i < N_GLX_ATTRS);
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("Creating GLX context (GL version:%d.%d, debug:%s, forward:%s, legacy:%s, GL:%s, GLES:%s)",
|
||||
major, minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no",
|
||||
legacy_bit ? "yes" : "no",
|
||||
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL) ? "yes" : "no",
|
||||
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL) ? "yes" : "no"));
|
||||
g_message ("Creating GLX context version %d.%d (debug:%s, forward:%s, legacy:%s, es:%s)",
|
||||
major, minor,
|
||||
debug_bit ? "yes" : "no",
|
||||
compat_bit ? "yes" : "no",
|
||||
legacy ? "yes" : "no",
|
||||
api == GDK_GL_API_GLES ? "yes" : "no"));
|
||||
|
||||
/* If we have access to GLX_ARB_create_context_profile then we can ask for
|
||||
* a compatibility profile; if we don't, then we have to fall back to the
|
||||
* old GLX 1.3 API.
|
||||
if (share != NULL)
|
||||
share_glx = GDK_X11_GL_CONTEXT_GLX (share);
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
/* If we don't have access to GLX_ARB_create_context_profile, then
|
||||
* we have to fall back to the old GLX 1.3 API.
|
||||
*/
|
||||
if (legacy_bit && !GDK_X11_DISPLAY (display)->has_glx_create_context)
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating legacy GL context on request"));
|
||||
/* do it below */
|
||||
}
|
||||
if (legacy && !display_x11->has_glx_create_context)
|
||||
ctx = glXCreateNewContext (gdk_x11_display_get_xdisplay (display),
|
||||
display_x11->glx_config,
|
||||
GLX_RGBA_TYPE,
|
||||
share_glx != NULL ? share_glx->glx_context : NULL,
|
||||
TRUE);
|
||||
|
||||
else
|
||||
{
|
||||
if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
|
||||
{
|
||||
int profile = legacy_bit ? GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
|
||||
: GLX_CONTEXT_CORE_PROFILE_BIT_ARB;
|
||||
ctx = glXCreateContextAttribsARB (gdk_x11_display_get_xdisplay (display),
|
||||
display_x11->glx_config,
|
||||
share_glx != NULL ? share_glx->glx_context : NULL,
|
||||
True,
|
||||
context_attribs);
|
||||
|
||||
/* We need to tweak the version, otherwise we may end up requesting
|
||||
* a compatibility context with a minimum version of 3.2, which is
|
||||
* an error
|
||||
*/
|
||||
if (legacy_bit)
|
||||
{
|
||||
major = 3;
|
||||
minor = 0;
|
||||
}
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 context"));
|
||||
context_glx->glx_context = create_gl3_context (display,
|
||||
display_x11->glx_config,
|
||||
share,
|
||||
profile,
|
||||
flags, major, minor);
|
||||
api = GDK_GL_API_GL;
|
||||
}
|
||||
|
||||
if (context_glx->glx_context == NULL && !legacy_bit &&
|
||||
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating GL3 GLES context"));
|
||||
context_glx->glx_context = create_gl3_context (display,
|
||||
display_x11->glx_config,
|
||||
share,
|
||||
GLX_CONTEXT_ES2_PROFILE_BIT_EXT,
|
||||
flags, major, minor);
|
||||
api = GDK_GL_API_GLES;
|
||||
}
|
||||
}
|
||||
|
||||
/* Fall back to legacy in case the GL3 context creation failed */
|
||||
if (context_glx->glx_context == NULL &&
|
||||
gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
|
||||
{
|
||||
GDK_DISPLAY_NOTE (display, OPENGL, g_message ("Creating fallback legacy context"));
|
||||
context_glx->glx_context = create_legacy_context (display, display_x11->glx_config, share);
|
||||
legacy_bit = TRUE;
|
||||
api = GDK_GL_API_GL;
|
||||
}
|
||||
|
||||
if (context_glx->glx_context == NULL)
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Ensure that any other context is created with a legacy bit set */
|
||||
gdk_gl_context_set_is_legacy (context, legacy_bit);
|
||||
if (gdk_x11_display_error_trap_pop (display) || ctx == NULL)
|
||||
return 0;
|
||||
|
||||
GDK_DISPLAY_NOTE (display, OPENGL,
|
||||
g_message ("Realized GLX context[%p], %s, version: %d.%d",
|
||||
context_glx->glx_context,
|
||||
glXIsDirect (dpy, context_glx->glx_context) ? "direct" : "indirect",
|
||||
display_x11->glx_version / 10,
|
||||
|
||||
display_x11->glx_version % 10));
|
||||
|
||||
context_glx->glx_context = ctx;
|
||||
gdk_gl_context_set_is_legacy (context, legacy);
|
||||
|
||||
#ifdef HAVE_XDAMAGE
|
||||
if (display_x11->have_damage &&
|
||||
display_x11->has_async_glx_swap_buffers)
|
||||
@@ -663,10 +578,70 @@ gdk_x11_gl_context_glx_realize (GdkGLContext *context,
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return api;
|
||||
}
|
||||
|
||||
static GdkGLAPI
|
||||
gdk_x11_gl_context_glx_realize (GdkGLContext *context,
|
||||
GError **error)
|
||||
{
|
||||
GdkDisplay *display = gdk_gl_context_get_display (context);
|
||||
GdkGLContext *share = gdk_display_get_gl_context (display);
|
||||
gboolean legacy;
|
||||
GdkGLAPI api, preferred_api;
|
||||
|
||||
if (share && gdk_gl_context_is_api_allowed (context,
|
||||
gdk_gl_context_get_api (share),
|
||||
NULL))
|
||||
preferred_api = gdk_gl_context_get_api (share);
|
||||
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GL, NULL))
|
||||
preferred_api = GDK_GL_API_GL;
|
||||
else if (gdk_gl_context_is_api_allowed (context, GDK_GL_API_GLES, NULL))
|
||||
preferred_api = GDK_GL_API_GLES;
|
||||
else
|
||||
{
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("No GL API allowed."));
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* If there is no glXCreateContextAttribsARB() then we default to legacy */
|
||||
legacy = !GDK_X11_DISPLAY (display)->has_glx_create_context;
|
||||
|
||||
if (GDK_DISPLAY_DEBUG_CHECK (display, GL_LEGACY))
|
||||
legacy = TRUE;
|
||||
|
||||
/* We cannot share legacy contexts with core profile ones, so the
|
||||
* shared context is the one that decides if we're going to create
|
||||
* a legacy context or not.
|
||||
*/
|
||||
if (share != NULL && gdk_gl_context_is_legacy (share))
|
||||
legacy = TRUE;
|
||||
|
||||
if (preferred_api == GDK_GL_API_GL)
|
||||
{
|
||||
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
|
||||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, legacy)) ||
|
||||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
|
||||
return api;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GLES, FALSE)) ||
|
||||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, legacy)) ||
|
||||
(api = gdk_x11_context_create_glx_context (context, GDK_GL_API_GL, TRUE)))
|
||||
return api;
|
||||
}
|
||||
|
||||
g_set_error_literal (error, GDK_GL_ERROR,
|
||||
GDK_GL_ERROR_NOT_AVAILABLE,
|
||||
_("Unable to create a GL context"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
#undef N_GLX_ATTRS
|
||||
|
||||
static void
|
||||
gdk_x11_gl_context_glx_dispose (GObject *gobject)
|
||||
{
|
||||
@@ -820,7 +795,7 @@ gdk_x11_display_create_glx_config (GdkX11Display *self,
|
||||
XFree (visinfo);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
if (!visual_is_rgba (visinfo))
|
||||
{
|
||||
if (best_features < NO_ALPHA_VISUAL)
|
||||
@@ -894,7 +869,7 @@ gdk_x11_display_get_glx_version (GdkDisplay *display,
|
||||
|
||||
/*< private >
|
||||
* gdk_x11_display_init_glx:
|
||||
* @display_x11: an X11 display that has not been inited yet.
|
||||
* @display_x11: an X11 display that has not been inited yet.
|
||||
* @out_visual: set to the Visual to be used with the returned config
|
||||
* @out_depth: set to the depth to be used with the returned config
|
||||
* @error: Return location for error
|
||||
|
||||
@@ -280,7 +280,7 @@ compute_toplevel_size (GdkSurface *surface,
|
||||
gdk_toplevel_size_init (&size, bounds_width, bounds_height);
|
||||
gdk_toplevel_notify_compute_size (GDK_TOPLEVEL (surface), &size);
|
||||
|
||||
if (size.shadow.is_valid && update_geometry)
|
||||
if (size.shadow.is_valid)
|
||||
{
|
||||
update_shadow_size (surface,
|
||||
size.shadow.left,
|
||||
@@ -2793,14 +2793,19 @@ gdk_x11_surface_get_frame_extents (GdkSurface *surface,
|
||||
impl = GDK_X11_SURFACE (surface);
|
||||
|
||||
/* Refine our fallback answer a bit using local information */
|
||||
rect->x = impl->abs_x * impl->surface_scale;
|
||||
rect->y = impl->abs_y * impl->surface_scale;
|
||||
rect->width = surface->width * impl->surface_scale;
|
||||
rect->height = surface->height * impl->surface_scale;
|
||||
rect->x = impl->abs_x;
|
||||
rect->y = impl->abs_y;
|
||||
rect->width = surface->width;
|
||||
rect->height = surface->height;
|
||||
|
||||
if (GDK_SURFACE_DESTROYED (surface) || impl->override_redirect)
|
||||
return;
|
||||
|
||||
rect->x *= impl->surface_scale;
|
||||
rect->y *= impl->surface_scale;
|
||||
rect->width *= impl->surface_scale;
|
||||
rect->height *= impl->surface_scale;
|
||||
|
||||
nvroots = 0;
|
||||
vroots = NULL;
|
||||
|
||||
|
||||
@@ -94,9 +94,7 @@ gsk_gl_profiler_class_init (GskGLProfilerClass *klass)
|
||||
gobject_class->finalize = gsk_gl_profiler_finalize;
|
||||
|
||||
gsk_gl_profiler_properties[PROP_GL_CONTEXT] =
|
||||
g_param_spec_object ("gl-context",
|
||||
"GL Context",
|
||||
"The GdkGLContext used by the GL profiler",
|
||||
g_param_spec_object ("gl-context", NULL, NULL,
|
||||
GDK_TYPE_GL_CONTEXT,
|
||||
G_PARAM_READWRITE |
|
||||
G_PARAM_CONSTRUCT_ONLY |
|
||||
|
||||
@@ -158,6 +158,10 @@ failure:
|
||||
|
||||
gdk_profiler_end_mark (start_time, "realize GskGLRenderer", NULL);
|
||||
|
||||
/* Assert either all or no state was set */
|
||||
g_assert ((ret && self->driver != NULL && self->context != NULL && self->command_queue != NULL) ||
|
||||
(!ret && self->driver == NULL && self->context == NULL && self->command_queue == NULL));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -403,11 +407,11 @@ gsk_gl_renderer_render_texture (GskRenderer *renderer,
|
||||
static void
|
||||
gsk_gl_renderer_dispose (GObject *object)
|
||||
{
|
||||
#ifdef G_ENABLE_DEBUG
|
||||
GskGLRenderer *self = (GskGLRenderer *)object;
|
||||
|
||||
g_assert (self->driver == NULL);
|
||||
#endif
|
||||
if (self->driver != NULL)
|
||||
g_critical ("Attempt to dispose %s without calling gsk_renderer_unrealize()",
|
||||
G_OBJECT_TYPE_NAME (self));
|
||||
|
||||
G_OBJECT_CLASS (gsk_gl_renderer_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user