pax_global_header00006660000000000000000000000064146677547460014544gustar00rootroot0000000000000052 comment=984dbbfc1d64c763e15a56dff662af267b551f68 gtk-layer-shell-0.9.0/000077500000000000000000000000001466775474600145565ustar00rootroot00000000000000gtk-layer-shell-0.9.0/.editorconfig000066400000000000000000000001631466775474600172330ustar00rootroot00000000000000root = true [*] end_of_line = lf insert_final_newline = true charset = utf-8 indent_style = space indent_size = 4 gtk-layer-shell-0.9.0/.github/000077500000000000000000000000001466775474600161165ustar00rootroot00000000000000gtk-layer-shell-0.9.0/.github/pull_request_template.md000066400000000000000000000005011466775474600230530ustar00rootroot00000000000000Replace this paragraph with your normal PR comment. Do NOT remove the agreement below. It simply means if you changed an MIT licensed file, the entire file remains MIT. *By opening this pull request, I agree for my modifications to be licensed under whatever licenses are indicated at the start of the files I modified* gtk-layer-shell-0.9.0/.github/workflows/000077500000000000000000000000001466775474600201535ustar00rootroot00000000000000gtk-layer-shell-0.9.0/.github/workflows/build_and_test.yml000066400000000000000000000014771466775474600236670ustar00rootroot00000000000000name: 'Build library and run tests' on: push: branches: [ master ] pull_request: branches: [ master ] jobs: build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v2 - name: Apt update run: sudo apt update - name: Install depends run: sudo apt install meson libwayland-dev libgtk-3-dev gobject-introspection libgirepository1.0-dev valac gtk-doc-tools - name: Meson run: meson build -Dexamples=true -Ddocs=true -Dtests=true env: CFLAGS: -Werror - name: Build run: ninja -C build - name: Test run: ninja -C build test - name: Install run: sudo ninja -C build install - name: Meson Vala example run: cd examples/vala-standalone && meson ../../vala-build - name: Build Vala example run: ninja -C vala-build gtk-layer-shell-0.9.0/.github/workflows/check_pr.yml000066400000000000000000000006531466775474600224600ustar00rootroot00000000000000name: "PR body contains license agreement" on: [pull_request] jobs: license_agreement: runs-on: ubuntu-latest steps: - name: Check PR uses: JJ/github-pr-contains-action@releases/v2 with: github-token: ${{github.token}} bodyContains: 'By opening this pull request, I agree for my modifications to be licensed under whatever licenses are indicated at the start of the files I modified' gtk-layer-shell-0.9.0/.github/workflows/deploy_docs.yml000066400000000000000000000032241466775474600232030ustar00rootroot00000000000000name: 'Deploy docs' on: # Runs on pushes targeting the default branch push: branches: ["master"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages permissions: contents: read pages: write id-token: write # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. concurrency: group: "pages" cancel-in-progress: false jobs: # Build job build: runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - name: Setup Pages uses: actions/configure-pages@v3 - name: Apt update run: sudo apt update - name: Install depends run: sudo apt install meson libwayland-dev libgtk-3-dev gobject-introspection libgirepository1.0-dev valac gtk-doc-tools - name: Meson run: meson build -Dexamples=false -Ddocs=true -Dtests=false --prefix $HOME - name: Build Install run: ninja -C build install - name: Move files into place run: | mv $HOME/share/gtk-doc/html/gtk-layer-shell ./_site cp ./_site/gtk-layer-shell-Gtk-Layer-Shell.html ./_site/index.html - name: Upload artifact uses: actions/upload-pages-artifact@v1 # Deployment job deploy: environment: name: github-pages url: ${{ steps.deployment.outputs.page_url }} runs-on: ubuntu-latest needs: build steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v2 gtk-layer-shell-0.9.0/.gitignore000066400000000000000000000000701466775474600165430ustar00rootroot00000000000000build/ gtk-priv/build/ */__pycache__ *.pyc .mypy_cache/ gtk-layer-shell-0.9.0/CHANGELOG.md000066400000000000000000000130311466775474600163650ustar00rootroot00000000000000# Changelog ## [Unreleased] ## [0.9.0] - 9 Sep 2024 - Project: officially place the project in maintenance mode, more details in readme - API: add `gtk_layer_try_force_commit()` - Fix: unmap tooltips of popups in correct order, fixes [#178](https://github.com/wmww/gtk-layer-shell/issues/178) - Fix: handle `xdg_wm_base::ping`, don't get labled as unresponsive - Compat: bump supported GTK to v3.24.43 - Compat: __NOTE:__ GTK v3.24.44 may break previous versions of gtk-layer-shell and work with this one, but we won't know for sure until it's released ## [0.8.2] - 4 Jan 2024 - Compat: bump supported GTK to v3.24.39 - Compat: __NOTE:__ GTK v3.24.40 may break previous versions of gtk-layer-shell and work with this one, but we won't know for sure until it's released ## [0.8.1] - 12 Apr 2023 - __The GTK4 port is complete!__ - It lives in a separate repository: [gtk4-layer-shell](github.com/wmww/gtk4-layer-shell) - v1.0.0 has been released, and is available to be packaged for distros - The GTK3 version will continue to be maintained here for the foreseeable future - Meson: mark wayland-scanner as a build-time dependency - Docs: deploy docs to [GitHub Pages](wmww.github.io/gtk-layer-shell) - Compat: bump supported GTK to v3.24.37 ## [0.8.0] - 23 Oct 2022 - Vala: support generating vapi files - Fix: memory leak, [#128](https://github.com/wmww/gtk-layer-shell/issues/128) - Compat: stop warning when GTK version is not explicitly supported - Compat: bump supported GTK to 3.24.34 ## [0.7.0] - 25 Jan 2022 - Meson: allow disabling building with gobject-introspection - Compat: bump supported GTK to v3.24.31 ## [0.6.0] - 2 Mar 2021 - Layer Shell: support protocol version 4 - API: support on-demand keyboard interactivity on protocol version 4 - API: deprecate `gtk_layer_set_keyboard_interactivity()` in favor of `gtk_layer_set_keyboard_mode()` - API: add `gtk_layer_get_protocol_version()` - Compat: bump supported GTK to v3.24.26 ## [0.5.2] - 11 Dec 2020 - Fix: normalize keyboard interactivity boolean to `TRUE` or `FALSE` - Fix: Set layer windows to mapped (removes warning on tooltip creation and fixes subsurfaces created as a `GTK_WINDOW_POPUP` window, fixes [#38](https://github.com/wmww/gtk-layer-shell/issues/38)) - Examples: Rename `gtk-layer-example` -> `simple-example-c` - Examples: merge `simple-example-c` and `gtk-layer-demo` into `examples` directory - Examples: add Vala example (not built with rest of project, does not add dependency) - Examples: add Python example - Meson: change GTK dependency `gtk+-wayland-3.0` -> `gtk+-3.0` - Meson: drop .types file in docs - Tests: change "test client" terminology to "integration test" - Tests: colored output - Tests: check that all tests are added to meson - Compat: bump supported GTK to v3.24.24 ## [0.5.1] - 1 Nov 2020 - Tests: fix integration test timeout on GTK v3.24.23 (fixes [#91](https://github.com/wmww/gtk-layer-shell/issues/91)) ## [0.5.0] - 28 Oct 2020 - API: add getters for all properties (fixes [#56](https://github.com/wmww/gtk-layer-shell/issues/56)) - API: add `gtk_layer_is_supported()` (fixes [#83](https://github.com/wmww/gtk-layer-shell/issues/83)) - API: add `gtk_layer_is_layer_window(window)` - Docs: add `Since: ` annotations for functions added since the initial release (fixes [#82](https://github.com/wmww/gtk-layer-shell/issues/82)) - Fix: accept non-1 true boolean values (thanks [@alebastr](https://github.com/alebastr)) - Tests: fix license test for release tarball (fixes [#73](https://github.com/wmww/gtk-layer-shell/issues/73)) - Tests: test popup with grab (the most likely thing to break on an incompatible GTK version) (fixes [#68](https://github.com/wmww/gtk-layer-shell/issues/68)) ## [0.4.0] - 21 Oct 2020 - Demo: show GTK Layer Shell version - Demo: fix initially set auto-exclusive zone and fixed size properties (fixes [#64](https://github.com/wmww/gtk-layer-shell/issues/64)) - API: expose GTK Layer Shell version - API: expose the underlying layer shell surface (fixes [#41](https://github.com/wmww/gtk-layer-shell/issues/41)) - Tests: add mock server - Tests: add integration tests (fixes [#60](https://github.com/wmww/gtk-layer-shell/issues/60)) - Diagnostics: remove "transient_for != window transient_for" warning - Diagnostics: improve warning when GTK version may not work by linking to a [compatibility table](https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md) (fixes [#66](https://github.com/wmww/gtk-layer-shell/issues/66)) - Compat: bump supported GTK to v3.24.23 ## [0.3.0] - 12 Aug 2020 - Demo: Display GTK version - Demo: Add option for disabling gtk-layer-shell for testing - Fix intermittent crash relating to popovers ([#51](https://github.com/wmww/gtk-layer-shell/issues/51)) - Clarify that our license is LGPL version 3 or any later version - Use system XDG Shell protocol when available (thanks [@alebastr](https://github.com/alebastr)) - ~Allow accessing the underlying layer shell surface~ (EDIT: this change was accidentally omitted from the release) - Bump explicitly supported GTK version to 3.24.22 ## [0.2.0] - 28 Jul 2020 - __RELICENSE TO LGPL v3__ (EDIT: we are using LGPL version 3 or any later version) - Fix long standing issue with [popup grabs](https://github.com/wmww/gtk-layer-shell/issues/9) - Fix potential compatibility issues between GTK versions with gtk-priv headers - Add GitHub Actions CI (just building and license check for now) - Add script to check that are files are licensed correctly - Use layer_surface->set_layer instead of remapping (when available) (thanks [@alebastr](https://github.com/alebastr)) ## [0.1.0] - 17 Sep 2019 - Initial release gtk-layer-shell-0.9.0/LICENSE_GPL.txt000066400000000000000000001045151466775474600171110ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . gtk-layer-shell-0.9.0/LICENSE_LGPL.txt000066400000000000000000000167441466775474600172330ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library. gtk-layer-shell-0.9.0/LICENSE_MIT.txt000066400000000000000000000021371466775474600171150ustar00rootroot00000000000000The MIT License (MIT) Copyright (c) 2014 Dennis Blommesteijn Copyright (c) 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. gtk-layer-shell-0.9.0/README.md000066400000000000000000000146761466775474600160530ustar00rootroot00000000000000# GTK Layer Shell (GTK3 version) __This project is complete and in maintenance mode.__ It will continue to receive fixes and updates to new GTK3 versions for the foreseeable future, but minimal development beyond that. New fetures will only be merged if they are critical for existing apps and don't threaten stability. New projects are recommended to use GTK4 instead. ![GTK Layer Shell demo screenshot](https://i.imgur.com/dIuYcBM.png) A library to write [GTK](https://www.gtk.org/) applications that use [Layer Shell](https://github.com/swaywm/wlr-protocols/blob/master/unstable/wlr-layer-shell-unstable-v1.xml). Layer Shell is a Wayland protocol for desktop shell components, such as panels, notifications and wallpapers. You can use it to anchor your windows to a corner or edge of the output, or stretch them across the entire output. It supports all Layer Shell features including popups and popovers (GTK popups Just Work™). This Library is compatible with C, C++ and any language that supports GObject introspection files (Python, Vala, etc, see using the library below). [Documentation](https://wmww.github.io/gtk-layer-shell/) [GTK4 version](https://github.com/wmww/gtk4-layer-shell) ## Reporting Bugs To report a crash or other problem using this library open a new [issue on Github](https://github.com/wmww/gtk-layer-shell/issues). Try to include a minimum reproducer if possible (ideally in C). **DO NOT REPORT GTK LAYER SHELL BUGS TO UPSTREAM GTK**. If you can reproduce the problem without including or linking to the gtk-layer-shell library **at all** then and only then report it to GTK instead of here. ## Supported Desktops This library only works on Wayland, and only on Wayland compositors that support the Layer Shell protocol. Layer shell __is supported__ on: - wlroots based compositors (such as __Sway__) - __KDE Plasma__ on wayland - __Mir__-based compositors (some may not enable the protocol by default and require `--add-wayland-extension zwlr_layer_shell_v1`) Layer shell __is not supported__ on: - Gnome-on-Wayland - Any X11 desktop ## Using the Library ### Demo `gtk-layer-demo` is built if examples are enabled. Its UI exposes all features of the library, and it's useful for testing layer shell support in compositors. Its code can be found in [examples/demo/](examples/demo/). ### C/C++ The easiest way to build against GTK Layer Shell is to use the `gtk-layer-shell-0` pkg-config package. Refer to your build system or the pkg-config docs for further instructions. [examples/simple-example.c](examples/simple-example.c) is a minimal complete app written in C. ### Python [examples/simple-example.py](examples/simple-example.py) contains sample Python code. ### Vala [examples/vala-standalone](examples/vala-standalone) contains a minimal working standalone Vala project, see [the readme](examples/vala-standalone/README.md) for details. ### Rust [@pentamassiv](https://github.com/pentamassiv) maintains [safe Rust bindings](https://github.com/pentamassiv/gtk-layer-shell-gir) and the [crates.io crate](https://crates.io/crates/gtk-layer-shell/). Rust examples can be found [here](https://github.com/pentamassiv/gtk-layer-shell-gir/tree/main/gtk-layer-shell/examples). ### Ruby [mswiger](https://github.com/mswiger) maintains [Ruby bindings](https://github.com/mswiger/ruby-gtk-layer-shell) which are published to [RubyGems](https://rubygems.org/gems/gtk_layer_shell). ## Distro Packages [![List of distros GTK Layer Shell is packaged for](https://repology.org/badge/vertical-allrepos/gtk-layer-shell.svg)](https://repology.org/project/gtk-layer-shell/versions) ## Building From Source 1. Clone this repo 2. Install build dependencies (see below) 3. `$ meson setup -Dexamples=true -Ddocs=true -Dtests=true build` 4. `$ ninja -C build` 5. `$ sudo ninja -C build install` 6. `$ sudo ldconfig` ### Build Dependencies * [Meson](https://mesonbuild.com/) (>=0.45.1) * [libwayland](https://gitlab.freedesktop.org/wayland/wayland) (>=1.10.0) * [GTK3](https://www.gtk.org/) (>=3.22.0) * [GObject introspection](https://gitlab.gnome.org/GNOME/gobject-introspection/) * [GTK Doc](https://www.gtk.org/gtk-doc/) (only required if docs are enabled) * [Vala](https://wiki.gnome.org/Projects/Vala) (only required if vapi is enabled) To install these dependencies on Ubuntu 18.04 and later: ``` sudo apt install meson libwayland-dev libgtk-3-dev gobject-introspection libgirepository1.0-dev gtk-doc-tools valac ``` ### Meson Options * `-Dexamples` (default `false`): If to build the example C apps; gtk-layer-demo is installed if examples are built; The Vala example is never built with the rest of the project * `-Ddocs` (default `false`): If to generate the docs * `-Dtests` (default `false`): If to build the tests * `-Dintrospection` (default: `true`): If to build GObject Introspection data (used for bindings to languages other than C/C++) * `-Dvapi` (default: `true`): If to build VAPI data (allows this library to be used in Vala). Requires `-Dintrospection=true` ### Running the Tests * `ninja -C build test` * Or, to run a specific test and print the complete output `meson test --verbose -C build` ## Licensing GTK Layer Shell is licensed under the GNU Lesser General Public License version 3.0 or any later version. Most of the individual source files are licensed under MIT. To prevent possible future confusion, all contributions must contain the following in the PR message: *By opening this pull request, I agree for my modifications to be licensed under whatever licenses are indicated at the start of the files I modified* ### Licensing Rationale I want everyone to be able to use GTK Layer Shell however they desire, but parts of it are extracted from GTK. Therefore, the project as a whole is licensed under [GNU Lesser General Public License (LGPL) version 3](https://www.gnu.org/licenses/lgpl-3.0.en.html) or any later version (a newer version of the same license as GTK). See [LICENSE_LGPL.txt](LICENSE_LGPL.txt) and [LICENSE_GPL.txt](LICENSE_GPL.txt) for details. Almost all of the non-generated code, however, is licensed under [MIT](https://en.wikipedia.org/wiki/MIT_License) ([LICENSE_MIT.txt](LICENSE_MIT.txt)). At the top of each file should be a header that specifies which license applies to it. Please refer to that if in doubt. ### What This Means For You This library can be linked against under similar terms as GTK itself, so licensing shouldn't be a problem for most potential users. Furthermore, most of the code within this library can be used in permissively licensed or proprietary projects. gtk-layer-shell-0.9.0/compatibility.md000066400000000000000000000040411466775474600177500ustar00rootroot00000000000000# GTK compatibility __NOTE: the warning that linked you to this page is probably a red herring. GTK Layer Shell has a hard time *explicitly* supporting each version of GTK, but new unsupported versions almost always work in practice.__ __NOTE: in versions of GTK Layer Shell >= 0.8.0 this warning has been turned off by default. It can be re-enabled by setting `GTK_LAYER_SHELL_UNSUPPORTED_GTK_WARNING=1`__ __Before opening an issue on this repo about an app crashing__ - assume the app is crashing for some other reason, investigate - if you're at wits end, clone GTK Layer Shell - check out the tag for the version you were using (ex `git checkout v0.6.0`) - build - run `./build/examples/gtk-layer-demo` - if that also crashes, open an issue Due to limitations of GTK, GTK Layer Shell depends on unstable GTK internals. Each release works with all versions of GTK >=3.22.0 at the time of release, but future GTK updates may occasionally break them. See [gtk-priv/README.md](gtk-priv/README.md) for more details. The table below shows which GTK Layer Shell versions work with which GTK versions. If there is a mistake, missing info or you have any other questions, please [open an issue](https://github.com/wmww/gtk-layer-shell/issues). | GTK Layer Shell | Explicitly supported GTK | Highest GTK known to work | GTK versions known to crash | |---|---|---|---| | __v0.1.0__ | v3.20.0 - v3.24.11 | v3.24.24 | - | | __v0.2.0__ | v3.20.0 - v3.24.21 | v3.24.24 | - | | __v0.3.0__ | v3.20.0 - v3.24.22 | v3.24.24 | - | | __v0.4.0__ | v3.20.0 - v3.24.23 | v3.24.24 | - | | __v0.5.0__ | v3.20.0 - v3.24.23 | v3.24.24 | - | | __v0.5.1__ | v3.20.0 - v3.24.23 | v3.24.24 | - | | __v0.5.2__ | v3.20.0 - v3.24.24 | v3.24.26 | - | | __v0.6.0__ | v3.20.0 - v3.24.26 | v3.24.31 | - | | __v0.7.0__ | v3.20.0 - v3.24.31 | v3.24.34 | - | | __v0.8.0__ | v3.20.0 - v3.24.34 | v3.24.34 | - | | __v0.8.1__ | v3.20.0 - v3.24.37 | v3.24.37 | - | | __v0.8.2__ | v3.20.0 - v3.24.39 | v3.24.39 | - | | __v0.9.0__ | v3.20.0 - v3.24.43 | v3.24.43 | - | | __master__ | v3.20.0 - v3.24.43 | v3.24.43 | - | gtk-layer-shell-0.9.0/doc/000077500000000000000000000000001466775474600153235ustar00rootroot00000000000000gtk-layer-shell-0.9.0/doc/gtk-layer-shell-docs.sgml000066400000000000000000000072441466775474600221500ustar00rootroot00000000000000 %gtkdocentities; ]> &package_name; Reference Manual This document is the API reference for for &package_name; &package_version;. If you find any issues in this API reference, please report it using the online bug reporting tool. The MIT License (MIT) 2014 Dennis Blommesteijn 2019 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. API Reference Gtk-layer-shell is a library to write GTK applications that use Layer Shell. Layer Shell is a Wayland protocol for desktop shell components, such as panels, notifications and wallpapers. You can use it to anchor your windows to a corner or edge of the output, or stretch them across the entire output. This library only makes sense on Wayland compositors that support Layer Shell, and will not work on X11. It supports all Layer Shell features including popups and popovers (GTK popups Just Work™). Please open issues for any bugs you come across. API Index Index of deprecated API gtk-layer-shell-0.9.0/doc/meson.build000066400000000000000000000015611466775474600174700ustar00rootroot00000000000000subdir('xml') glib_prefix = dependency('glib-2.0').get_pkgconfig_variable('prefix') glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html') docpath = join_paths(get_option('datadir'), 'gtk-doc', 'html') gnome.gtkdoc( 'gtk-layer-shell', main_xml: 'gtk-layer-shell-docs.sgml', src_dir: [ join_paths(meson.source_root(), 'include'), join_paths(meson.build_root(), 'include'), ], dependencies: [ gtk, wayland_client, wayland_scanner, ], fixxref_args: [ '--html-dir=@0@'.format(docpath), '--extra-dir=@0@'.format(join_paths(glib_docpath, 'glib')), '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gobject')), '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gio')), '--extra-dir=@0@'.format(join_paths(glib_docpath, 'gtk3')), ], install_dir: 'gtk-layer-shell', install: true ) gtk-layer-shell-0.9.0/doc/xml/000077500000000000000000000000001466775474600161235ustar00rootroot00000000000000gtk-layer-shell-0.9.0/doc/xml/gtkdocentities.ent.in000066400000000000000000000005341466775474600222620ustar00rootroot00000000000000 gtk-layer-shell-0.9.0/doc/xml/meson.build000066400000000000000000000011631466775474600202660ustar00rootroot00000000000000ent_conf = configuration_data() ent_conf.set('PACKAGE', 'gtk-layer-shell') ent_conf.set('PACKAGE_BUGREPORT', 'https://github.com/wmww/gtk-layer-shell/issues') ent_conf.set('PACKAGE_NAME', 'gtk-layer-shell') ent_conf.set('PACKAGE_STRING', 'gtk-layer-shell') ent_conf.set('PACKAGE_TARNAME', 'gtk-layer-shell-' + meson.project_version()) ent_conf.set('PACKAGE_URL', 'https://github.com/wmww/gtk-layer-shell') ent_conf.set('PACKAGE_VERSION', meson.project_version()) ent_conf.set('PACKAGE_API_VERSION', meson.project_version()) configure_file(input: 'gtkdocentities.ent.in', output: 'gtkdocentities.ent', configuration: ent_conf) gtk-layer-shell-0.9.0/examples/000077500000000000000000000000001466775474600163745ustar00rootroot00000000000000gtk-layer-shell-0.9.0/examples/demo/000077500000000000000000000000001466775474600173205ustar00rootroot00000000000000gtk-layer-shell-0.9.0/examples/demo/anchor-control.c000066400000000000000000000110741466775474600224170ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" typedef struct { GtkLayerShellEdge edge; GtkWindow *layer_window; } AnchorButtonData; static void on_anchor_toggled (GtkToggleButton *button, AnchorButtonData *data) { gboolean is_anchored = gtk_toggle_button_get_active (button); ToplevelData *toplevel_data = g_object_get_data (G_OBJECT (data->layer_window), anchor_edges_key); g_return_if_fail (toplevel_data); toplevel_data->edges[data->edge] = is_anchored; layer_window_update_orientation (data->layer_window); gtk_layer_set_anchor (data->layer_window, data->edge, is_anchored); } static GtkWidget * anchor_edge_button_new (GtkWindow *layer_window, GtkLayerShellEdge edge, const gboolean defaults[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER], const char *icon_name, const char *tooltip) { GtkWidget *button = gtk_toggle_button_new (); gtk_button_set_image (GTK_BUTTON (button), gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON)); gtk_widget_set_tooltip_text (button, tooltip); AnchorButtonData *data = g_new0 (AnchorButtonData, 1); *data = (AnchorButtonData) { .edge = edge, .layer_window = layer_window, }; g_object_set_data_full(G_OBJECT (button), "clicked_signal_data", data, (GDestroyNotify)g_free); g_signal_connect (button, "clicked", G_CALLBACK (on_anchor_toggled), data); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), defaults[edge]); return button; } GtkWidget * anchor_control_new (GtkWindow *layer_window, const gboolean default_anchors[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]) { GtkWidget *outside_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); GtkWidget *outside_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (outside_vbox), outside_hbox, TRUE, FALSE, 0); { GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4); gtk_box_pack_start (GTK_BOX (outside_hbox), hbox, TRUE, FALSE, 0); { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (hbox), vbox); { GtkWidget *button = anchor_edge_button_new (layer_window, GTK_LAYER_SHELL_EDGE_LEFT, default_anchors, "go-first", "Anchor left"); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, FALSE, 0); } }{ GtkWidget *center_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 40); gtk_container_add (GTK_CONTAINER (hbox), center_vbox); { GtkWidget *button = anchor_edge_button_new (layer_window, GTK_LAYER_SHELL_EDGE_TOP, default_anchors, "go-top", "Anchor top"); gtk_box_pack_start (GTK_BOX (center_vbox), button, FALSE, FALSE, 0); }{ GtkWidget *button = anchor_edge_button_new (layer_window, GTK_LAYER_SHELL_EDGE_BOTTOM, default_anchors, "go-bottom", "Anchor bottom"); gtk_box_pack_end (GTK_BOX (center_vbox), button, FALSE, FALSE, 0); } }{ GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (hbox), vbox); { GtkWidget *button = anchor_edge_button_new (layer_window, GTK_LAYER_SHELL_EDGE_RIGHT, default_anchors, "go-last", "Anchor right"); gtk_box_pack_start (GTK_BOX (vbox), button, TRUE, FALSE, 0); } } } return outside_vbox; } gtk-layer-shell-0.9.0/examples/demo/gtk-layer-demo.c000066400000000000000000000432111466775474600223060ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" #include static GtkLayerShellLayer default_layer = GTK_LAYER_SHELL_LAYER_TOP; static gboolean default_anchors[] = {FALSE, FALSE, FALSE, FALSE}; static int default_margins[] = {0, 0, 0, 0}; static gboolean default_auto_exclusive_zone = FALSE; // always set by command line option static GtkLayerShellKeyboardMode default_keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; // always set by command line option static gboolean default_fixed_size = FALSE; // always set by command line option static gboolean no_layer_shell = FALSE; // always set by command line option static gboolean show_version_and_exit = FALSE; // always set by command line option const char *prog_name = "gtk-layer-demo"; const char *prog_summary = "A GTK application for demonstrating the functionality of the Layer Shell Wayland protocol"; const char *prog_details = "See https://github.com/wmww/gtk-layer-shell for more information, and to report bugs"; const char *anchor_edges_key = "anchor_edges"; const int fixed_size_width = 600; const int fixed_size_height = 500; gboolean layer_option_callback (const gchar *option_name, const gchar *value, void *data, GError **error); gboolean anchor_option_callback (const gchar *option_name, const gchar *value, void *data, GError **error); gboolean keyboard_option_callback (const gchar *option_name, const gchar *value, void *data, GError **error); gboolean margin_option_callback (const gchar *option_name, const gchar *value, void *data, GError **error); static const GOptionEntry options[] = { { .long_name = "version", .short_name = 'v', .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_NONE, .arg_data = &show_version_and_exit, .description = "Show version and exit", .arg_description = NULL, }, { .long_name = "layer", .short_name = 'l', .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_CALLBACK, .arg_data = (void *)&layer_option_callback, .description = "'overlay', 'top', 'bottom' or 'background' (or 'o', 't', 'b' or 'g')", .arg_description = NULL, }, { .long_name = "anchor", .short_name = 'a', .flags = G_OPTION_FLAG_OPTIONAL_ARG, .arg = G_OPTION_ARG_CALLBACK, .arg_data = (void *)&anchor_option_callback, .description = "A sequence of 'l', 'r', 't' and 'b' to anchor to those edges, or '0' for no anchor", .arg_description = NULL, }, { .long_name = "margin", .short_name = 'm', .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_CALLBACK, .arg_data = (void *)&margin_option_callback, .description = "Comma separated list of margin values, in the order LEFT,RIGHT,TOP,BOTTOM", .arg_description = NULL, }, { .long_name = "exclusive", .short_name = 'e', .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_NONE, .arg_data = &default_auto_exclusive_zone, .description = "Enable auto exclusive zone", .arg_description = NULL, }, { .long_name = "keyboard", .short_name = 'k', .flags = G_OPTION_FLAG_OPTIONAL_ARG, .arg = G_OPTION_ARG_CALLBACK, .arg_data = (void*)&keyboard_option_callback, .description = "Set keyboard interactivity: 'none', 'exclusive' or 'on-demand' (or 'n', 'e' or 'o')", .arg_description = NULL, }, { .long_name = "fixed-size", .short_name = 'f', .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_NONE, .arg_data = &default_fixed_size, .description = "Enable a fixed window size", .arg_description = NULL, }, { .long_name = "no-layer-shell", .short_name = 0, .flags = G_OPTION_FLAG_NONE, .arg = G_OPTION_ARG_NONE, .arg_data = &no_layer_shell, .description = "Disable gtk-layer-shell, create a normal shell surface instead", .arg_description = NULL, }, { NULL, 0, 0, 0, NULL, NULL, NULL } }; gboolean layer_option_callback (const gchar *_option_name, const gchar *value, void *_data, GError **error) { (void)_option_name; (void)_data; if (g_strcmp0 (value, "overlay") == 0 || g_strcmp0 (value, "o") == 0) { default_layer = GTK_LAYER_SHELL_LAYER_OVERLAY; } else if (g_strcmp0 (value, "top") == 0 || g_strcmp0 (value, "t") == 0) { default_layer = GTK_LAYER_SHELL_LAYER_TOP; } else if (g_strcmp0 (value, "bottom") == 0 || g_strcmp0 (value, "b") == 0) { default_layer = GTK_LAYER_SHELL_LAYER_BOTTOM; } else if (g_strcmp0 (value, "background") == 0 || g_strcmp0 (value, "g") == 0) { default_layer = GTK_LAYER_SHELL_LAYER_BACKGROUND; } else { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Invalid layer '%s' " "(valid layers are 'overlay', 'top', 'bottom', 'background', 'o', 't', 'b' and 'g')", value); return FALSE; } return TRUE; } gboolean anchor_option_callback (const gchar *_option_name, const gchar *value, void *_data, GError **error) { (void)_option_name; (void)_data; for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) { default_anchors[i] = FALSE; } if (!value || !*value || g_strcmp0 (value, "0") == 0 || g_strcmp0 (value, "none") == 0) { return TRUE; } for (const char *c = value; *c; c++) { if (*c == 'l') { default_anchors[GTK_LAYER_SHELL_EDGE_LEFT] = TRUE; } else if (*c == 'r') { default_anchors[GTK_LAYER_SHELL_EDGE_RIGHT] = TRUE; } else if (*c == 't') { default_anchors[GTK_LAYER_SHELL_EDGE_TOP] = TRUE; } else if (*c == 'b') { default_anchors[GTK_LAYER_SHELL_EDGE_BOTTOM] = TRUE; } else { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Invalid anchor edge '%c' (valid edges are 'l', 'r', 't' and 'b')", *c); return FALSE; } } return TRUE; } gboolean keyboard_option_callback (const gchar *_option_name, const gchar *value, void *_data, GError **error) { (void)_option_name; (void)_data; if (!value) { // without argument = exclusive (retain old behavior) default_keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE; return TRUE; } if (g_strcmp0 (value, "none") == 0 || g_strcmp0 (value, "n") == 0) { default_keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; } else if (g_strcmp0 (value, "exclusive") == 0 || g_strcmp0 (value, "e") == 0) { default_keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE; } else if (g_strcmp0 (value, "on-demand") == 0 || g_strcmp0 (value, "o") == 0) { default_keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND; } else { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Invalid keyboard interactivity '%s' " "(valid values are 'none', 'exclusive', 'on-demand', 'n', 'e' and 'o')", value); return FALSE; } return TRUE; } gboolean margin_option_callback (const gchar *_option_name, const gchar *value, void *_data, GError **error) { (void)_option_name; (void)_data; for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) { if (!*value) { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Not enough comma separated arguments for margin"); return FALSE; } char *end; long long margin = strtol (value, &end, 10); default_margins[i] = margin; if (end == value) { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Unable to parse margin"); return FALSE; } value = end; if (*value == ',') value++; } if (*value) { g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, "Too many comma separated arguments for margin"); return FALSE; } return TRUE; } static void process_args (int *argc, char ***argv) { GOptionContext *context = g_option_context_new (""); g_option_context_add_group (context, gtk_get_option_group (TRUE)); g_option_context_set_summary (context, prog_summary); g_option_context_set_description (context, prog_details); g_option_context_add_main_entries (context, options, NULL); GError *error = NULL; if (!g_option_context_parse (context, argc, argv, &error)) { g_printerr ("%s\n", error->message); g_error_free (error); g_option_context_free (context); exit (1); } if (show_version_and_exit) { g_print ( "%s on gtk-layer-shell v%d.%d.%d\n", prog_name, gtk_layer_get_major_version (), gtk_layer_get_minor_version (), gtk_layer_get_micro_version ()); exit(0); } g_option_context_free (context); } void layer_window_update_orientation (GtkWindow *layer_window) { ToplevelData *data = g_object_get_data (G_OBJECT (layer_window), anchor_edges_key); gboolean horiz = data->edges[GTK_LAYER_SHELL_EDGE_LEFT] == data->edges[GTK_LAYER_SHELL_EDGE_RIGHT]; gboolean vert = data->edges[GTK_LAYER_SHELL_EDGE_TOP] == data->edges[GTK_LAYER_SHELL_EDGE_BOTTOM]; WindowOrientation orientation = WINDOW_ORIENTATION_NONE; if (horiz && (!vert || (data->edges[GTK_LAYER_SHELL_EDGE_LEFT] && !data->edges[GTK_LAYER_SHELL_EDGE_TOP]))) { orientation = WINDOW_ORIENTATION_HORIZONTAL; } else if (vert && (!horiz || (data->edges[GTK_LAYER_SHELL_EDGE_TOP] && !data->edges[GTK_LAYER_SHELL_EDGE_LEFT]))) { orientation = WINDOW_ORIENTATION_VERTICAL; } if (orientation != data->orientation) { data->orientation = orientation; g_signal_emit_by_name(layer_window, "orientation-changed", orientation); } } static void on_orientation_changed (GtkWindow *window, WindowOrientation orientation, ToplevelData *data) { GtkOrientation orient_toplevel, orient_sub; orient_toplevel = GTK_ORIENTATION_HORIZONTAL; orient_sub = GTK_ORIENTATION_VERTICAL; switch (orientation) { case WINDOW_ORIENTATION_HORIZONTAL: orient_toplevel = GTK_ORIENTATION_HORIZONTAL; orient_sub = GTK_ORIENTATION_HORIZONTAL; break; case WINDOW_ORIENTATION_VERTICAL: orient_toplevel = GTK_ORIENTATION_VERTICAL; orient_sub = GTK_ORIENTATION_VERTICAL; break; case WINDOW_ORIENTATION_NONE: orient_toplevel = GTK_ORIENTATION_HORIZONTAL; orient_sub = GTK_ORIENTATION_VERTICAL; break; } gtk_orientable_set_orientation (GTK_ORIENTABLE (data->toplevel_box), orient_toplevel); gtk_orientable_set_orientation (GTK_ORIENTABLE (data->first_box), orient_sub); gtk_orientable_set_orientation (GTK_ORIENTABLE (data->second_box), orient_sub); gtk_window_resize (window, 1, 1); // force the window to shrink to the smallest size it can } static void on_window_destroy(GtkWindow *_window, void *_data) { (void)_window; (void)_data; gtk_main_quit (); } static GtkWidget * layer_window_new () { GtkWindow *gtk_window = GTK_WINDOW (gtk_window_new (GTK_WINDOW_TOPLEVEL)); ToplevelData *data = g_new0 (ToplevelData, 1); g_object_set_data_full (G_OBJECT (gtk_window), anchor_edges_key, data, g_free); for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) data->edges[i] = default_anchors[i]; if (default_fixed_size) gtk_widget_set_size_request (GTK_WIDGET (gtk_window), fixed_size_width, fixed_size_height); if (no_layer_shell) { g_message ("GTK layer shell disabled on command line"); g_message ("Expect controls to have no effect and warnings to be shown"); } else { gtk_layer_init_for_window (gtk_window); } for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) gtk_layer_set_anchor (gtk_window, i, default_anchors[i]); for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) gtk_layer_set_margin (gtk_window, i, default_margins[i]); gtk_layer_set_layer (gtk_window, default_layer); gtk_layer_set_keyboard_mode (gtk_window, default_keyboard_mode); gtk_layer_set_namespace (gtk_window, "demo"); if (default_auto_exclusive_zone) gtk_layer_auto_exclusive_zone_enable (gtk_window); GtkWidget *centered_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (gtk_window), centered_vbox); GtkWidget *centered_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0); gtk_box_pack_start (GTK_BOX (centered_vbox), centered_hbox, TRUE, FALSE, 0); data->toplevel_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_container_set_border_width (GTK_CONTAINER (data->toplevel_box), 16); gtk_box_pack_start (GTK_BOX (centered_hbox), data->toplevel_box, TRUE, FALSE, 0); { data->first_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (data->toplevel_box), data->first_box, FALSE, FALSE, 0); { GtkWidget *selections_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); gtk_box_pack_start (GTK_BOX (selections_box), menu_bar_new (gtk_window), FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (data->first_box), selections_box, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (selections_box), monitor_selection_new (gtk_window), FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (selections_box), layer_selection_new (gtk_window, default_layer), FALSE, FALSE, 0); }{ gtk_box_pack_start (GTK_BOX (data->first_box), anchor_control_new (gtk_window, default_anchors), FALSE, FALSE, 0); } }{ data->second_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (data->toplevel_box), data->second_box, TRUE, TRUE, 0); { GtkWidget *toggles_box = mscl_toggles_new (gtk_window, default_auto_exclusive_zone, default_fixed_size); gtk_box_pack_start (GTK_BOX (data->second_box), toggles_box, FALSE, FALSE, 0); GtkWidget *kb_box = keyboard_selection_new (gtk_window, default_keyboard_mode); gtk_box_pack_start (GTK_BOX (data->second_box), kb_box, FALSE, FALSE, 0); } { GtkWidget *margin_and_version_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12); gtk_box_pack_start (GTK_BOX (margin_and_version_box), margin_control_new (gtk_window, default_margins), TRUE, FALSE, 0); gtk_box_pack_start (GTK_BOX (margin_and_version_box), version_info_new (), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (data->second_box), margin_and_version_box, TRUE, TRUE, 0); } } g_signal_connect (gtk_window, "orientation-changed", G_CALLBACK (on_orientation_changed), data); data->orientation = -1; // invalid value will force anchor_edges_update_orientation to update layer_window_update_orientation (gtk_window); return GTK_WIDGET (gtk_window); } int main (int argc, char **argv) { g_set_prgname (prog_name); gtk_init (&argc, &argv); process_args (&argc, &argv); // The int arg is an enum of type WindowOrientation // Signal is emitted in anchor-control.c g_signal_new ("orientation-changed", GTK_TYPE_WINDOW, G_SIGNAL_RUN_FIRST, 0, NULL, NULL, g_cclosure_marshal_VOID__INT, G_TYPE_NONE, 1, G_TYPE_INT); GtkWidget *initial_window = layer_window_new (); g_signal_connect (initial_window, "destroy", G_CALLBACK (on_window_destroy), NULL); gtk_widget_show_all (GTK_WIDGET (initial_window)); gtk_main (); } gtk-layer-shell-0.9.0/examples/demo/gtk-layer-demo.h000066400000000000000000000047271466775474600223240ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef GTK_LAYER_DEMO_H #define GTK_LAYER_DEMO_H #include "gtk-layer-shell.h" #include typedef enum { WINDOW_ORIENTATION_NONE = 0, WINDOW_ORIENTATION_HORIZONTAL, WINDOW_ORIENTATION_VERTICAL, } WindowOrientation; typedef struct { gboolean edges[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]; WindowOrientation orientation; GtkWidget *toplevel_box; GtkWidget *first_box; GtkWidget *second_box; } ToplevelData; extern const char *anchor_edges_key; extern const int fixed_size_width; extern const int fixed_size_height; void layer_window_update_orientation (GtkWindow *layer_window); GtkWidget * layer_selection_new (GtkWindow *layer_window, GtkLayerShellLayer default_layer); GtkWidget * monitor_selection_new (GtkWindow *layer_window); GtkWidget * anchor_control_new (GtkWindow *layer_window, const gboolean default_anchors[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]); GtkWidget * margin_control_new (GtkWindow *layer_window, const int default_margins[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]); GtkWidget * version_info_new (); GtkWidget * mscl_toggles_new (GtkWindow *layer_window, gboolean default_auto_exclusive_zone, gboolean default_fixed_size); GtkWidget * menu_bar_new (GtkWindow *layer_window); GtkWidget * keyboard_selection_new (GtkWindow *layer_window, GtkLayerShellKeyboardMode default_kb); #endif // GTK_LAYER_DEMO_H gtk-layer-shell-0.9.0/examples/demo/keyboard-selection.c000066400000000000000000000056521466775474600232570ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" struct { const char *name; GtkLayerShellKeyboardMode value; } const all_kb_settings[] = { {"None", GTK_LAYER_SHELL_KEYBOARD_MODE_NONE}, {"Exclusive", GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE}, {"On demand", GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND}, }; static void on_kb_selected (GtkComboBox *widget, GtkWindow *layer_window) { GtkComboBox *combo_box = widget; gchar *keyboard = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box)); gboolean kb_was_set = FALSE; for (unsigned i = 0; i < sizeof(all_kb_settings) / sizeof(all_kb_settings[0]); i++) { if (g_strcmp0 (keyboard, all_kb_settings[i].name) == 0) { gtk_layer_set_keyboard_mode (layer_window, all_kb_settings[i].value); kb_was_set = TRUE; break; } } g_free (keyboard); g_return_if_fail (kb_was_set); } GtkWidget * keyboard_selection_new (GtkWindow *layer_window, GtkLayerShellKeyboardMode default_kb) { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); { GtkWidget *label = gtk_label_new ("Keyboard:"); GtkWidget *combo_box = gtk_combo_box_text_new (); gtk_widget_set_tooltip_text (combo_box, "Keyboard interactivity mode"); for (unsigned i = 0; i < sizeof(all_kb_settings) / sizeof(all_kb_settings[0]); i++) { gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), all_kb_settings[i].name); if (all_kb_settings[i].value == default_kb) gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), i); } g_signal_connect (combo_box, "changed", G_CALLBACK (on_kb_selected), layer_window); gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); } return vbox; } gtk-layer-shell-0.9.0/examples/demo/layer-selection.c000066400000000000000000000053571466775474600225750ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" struct { const char *name; GtkLayerShellLayer value; } const all_layers[] = { {"Overlay", GTK_LAYER_SHELL_LAYER_OVERLAY}, {"Top", GTK_LAYER_SHELL_LAYER_TOP}, {"Bottom", GTK_LAYER_SHELL_LAYER_BOTTOM}, {"Background", GTK_LAYER_SHELL_LAYER_BACKGROUND}, }; static void on_layer_selected (GtkComboBox *widget, GtkWindow *layer_window) { GtkComboBox *combo_box = widget; gchar *layer = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box)); gboolean layer_was_set = FALSE; for (unsigned i = 0; i < sizeof(all_layers) / sizeof(all_layers[0]); i++) { if (g_strcmp0 (layer, all_layers[i].name) == 0) { gtk_layer_set_layer (layer_window, all_layers[i].value); layer_was_set = TRUE; break; } } g_free (layer); g_return_if_fail (layer_was_set); } GtkWidget * layer_selection_new (GtkWindow *layer_window, GtkLayerShellLayer default_layer) { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); { GtkWidget *combo_box = gtk_combo_box_text_new (); gtk_widget_set_tooltip_text (combo_box, "Layer"); for (unsigned i = 0; i < sizeof(all_layers) / sizeof(all_layers[0]); i++) { gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), all_layers[i].name); if (all_layers[i].value == default_layer) gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), i); } g_signal_connect (combo_box, "changed", G_CALLBACK (on_layer_selected), layer_window); gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); } return vbox; } gtk-layer-shell-0.9.0/examples/demo/margin-control.c000066400000000000000000000122301466775474600224150ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" static void on_orientation_changed (GtkWindow *_window, WindowOrientation orientation, GtkWidget *box) { (void)_window; switch (orientation) { case WINDOW_ORIENTATION_HORIZONTAL: gtk_orientable_set_orientation (GTK_ORIENTABLE (box), GTK_ORIENTATION_HORIZONTAL); break; case WINDOW_ORIENTATION_VERTICAL: gtk_orientable_set_orientation (GTK_ORIENTABLE (box), GTK_ORIENTATION_VERTICAL); break; case WINDOW_ORIENTATION_NONE: gtk_orientable_set_orientation (GTK_ORIENTABLE (box), GTK_ORIENTATION_VERTICAL); break; } } typedef struct { GtkLayerShellEdge edge; GtkWindow *layer_window; } MarginSpinButtonData; static void on_margin_changed (GtkSpinButton *button, MarginSpinButtonData *data) { int value = gtk_spin_button_get_value (button); gtk_layer_set_margin (data->layer_window, data->edge, value); } static GtkWidget * margin_spin_button_new (GtkWindow *layer_window, GtkLayerShellEdge edge, const char *tooltip, const int default_margins[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]) { GtkAdjustment *adjustment = gtk_adjustment_new (default_margins[edge], 0.0, 4000.0, 20.0, 50.0, 0.0); GtkWidget *button = gtk_spin_button_new (adjustment, 0.5, 0); gtk_widget_set_tooltip_text (button, tooltip); MarginSpinButtonData *data = g_new0 (MarginSpinButtonData, 1); *data = (MarginSpinButtonData) { .edge = edge, .layer_window = layer_window, }; g_object_set_data_full(G_OBJECT (button), "value-changed_signal_data", data, (GDestroyNotify)g_free); g_signal_connect (button, "value-changed", G_CALLBACK (on_margin_changed), data); return button; } static void on_open_clicked (GtkWidget *_button, GtkWidget *popover) { (void)_button; gtk_popover_popup (GTK_POPOVER (popover)); } GtkWidget * margin_control_new (GtkWindow *layer_window, const int default_margins[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]) { const int spacing = 4; GtkWidget *switch_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, spacing); g_signal_connect (layer_window, "orientation-changed", G_CALLBACK (on_orientation_changed), switch_box); { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, spacing); gtk_box_pack_start (GTK_BOX (switch_box), vbox, FALSE, FALSE, 0); { GtkWidget *button = margin_spin_button_new (layer_window, GTK_LAYER_SHELL_EDGE_LEFT, "Left margin", default_margins); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); } { GtkWidget *button = margin_spin_button_new (layer_window, GTK_LAYER_SHELL_EDGE_RIGHT, "Right margin", default_margins); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); } } { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, spacing); gtk_box_pack_start (GTK_BOX (switch_box), vbox, FALSE, FALSE, 0); { GtkWidget *button = margin_spin_button_new (layer_window, GTK_LAYER_SHELL_EDGE_TOP, "Top margin", default_margins); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); } { GtkWidget *button = margin_spin_button_new (layer_window, GTK_LAYER_SHELL_EDGE_BOTTOM, "Bottom margin", default_margins); gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0); } } GtkWidget *open_button = gtk_button_new_with_label ("Set margin"); gtk_widget_set_tooltip_text (open_button, "Space to leave empty around surface"); GtkWidget *popover = gtk_popover_new (open_button); gtk_popover_set_modal (GTK_POPOVER (popover), TRUE); gtk_popover_set_constrain_to (GTK_POPOVER (popover), GTK_POPOVER_CONSTRAINT_WINDOW); gtk_popover_set_position (GTK_POPOVER (popover), GTK_POS_BOTTOM); gtk_container_add (GTK_CONTAINER (popover), switch_box); gtk_widget_show_all (switch_box); g_signal_connect (open_button, "clicked", G_CALLBACK (on_open_clicked), popover); return open_button; } gtk-layer-shell-0.9.0/examples/demo/menu-bar.c000066400000000000000000000077401466775474600212020ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" static void on_close_clicked (GtkMenuItem *_item, GtkWindow *layer_window) { (void)_item; gtk_window_close (layer_window); } GtkWidget * menu_bar_new (GtkWindow *layer_window) { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); { GtkWidget *menu_bar = gtk_menu_bar_new (); gtk_box_pack_start (GTK_BOX (vbox), menu_bar, FALSE, FALSE, 0); { GtkWidget *menu_item = gtk_menu_item_new_with_label ("Popup menu"); gtk_container_add (GTK_CONTAINER (menu_bar), menu_item); { GtkWidget *submenu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), submenu); { GtkWidget *nested_menu_item = gtk_menu_item_new_with_label ("Nested popup"); gtk_menu_shell_append (GTK_MENU_SHELL (submenu), nested_menu_item); { GtkWidget *nested_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (nested_menu_item), nested_menu); for (int i = 0; i < 3; i++) { GString *label = g_string_new (""); g_string_printf (label, "Menu item %d", i); GtkWidget *submenu_item = gtk_menu_item_new_with_label (label->str); g_string_free (label, TRUE); gtk_menu_shell_append (GTK_MENU_SHELL (nested_menu), submenu_item); } { GtkWidget *submenu_item = gtk_menu_item_new_with_label ("Nested again"); gtk_menu_shell_append (GTK_MENU_SHELL (nested_menu), submenu_item); { GtkWidget *nested_menu = gtk_menu_new (); gtk_menu_item_set_submenu (GTK_MENU_ITEM (submenu_item), nested_menu); { GtkWidget *submenu_item = gtk_menu_item_new_with_label ("Final item"); gtk_widget_set_tooltip_text (submenu_item, "Final item tooltip"); gtk_menu_shell_append (GTK_MENU_SHELL (nested_menu), submenu_item); } } } } } { GtkWidget *close_item = gtk_menu_item_new_with_label ("Close"); gtk_widget_set_tooltip_text (close_item, "Stop the demo"); g_signal_connect (close_item, "activate", G_CALLBACK (on_close_clicked), layer_window); gtk_menu_shell_append (GTK_MENU_SHELL (submenu), close_item); } } } } return vbox; } gtk-layer-shell-0.9.0/examples/demo/meson.build000066400000000000000000000003511466775474600214610ustar00rootroot00000000000000demo_srcs = files( 'gtk-layer-demo.c', 'anchor-control.c', 'margin-control.c', 'layer-selection.c', 'monitor-selection.c', 'mscl-toggles.c', 'version-info.c', 'menu-bar.c', 'keyboard-selection.c') gtk-layer-shell-0.9.0/examples/demo/monitor-selection.c000066400000000000000000000071731466775474600231460ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" const char *current_monitor_key = "current_layer_monitor"; static void on_monitor_selected (GtkComboBox *combo_box, GtkWindow *layer_window) { int monitor_index = gtk_combo_box_get_active (combo_box) - 1; // 1st element is default monitor GdkMonitor *monitor = NULL; if (monitor_index >= 0) { GdkDisplay *display = gdk_display_get_default (); g_return_if_fail (monitor_index < gdk_display_get_n_monitors (display)); monitor = gdk_display_get_monitor (display, monitor_index); } g_object_set_data (G_OBJECT (combo_box), current_monitor_key, monitor); gtk_layer_set_monitor (layer_window, monitor); } void on_monitors_changed (GdkDisplay *display, GdkMonitor *_monitor, GtkComboBox *combo_box) { (void)_monitor; gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (combo_box)); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), "Default"); GdkMonitor *current_monitor = g_object_get_data (G_OBJECT (combo_box), current_monitor_key); if (current_monitor == NULL) { gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); } for (int i = 0; i < gdk_display_get_n_monitors (display); i++) { GdkMonitor *monitor = gdk_display_get_monitor (display, i); GString *text = g_string_new (""); g_string_printf (text, "%d. %s", i + 1, gdk_monitor_get_model (monitor)); gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_box), text->str); g_string_free (text, TRUE); if (monitor == current_monitor) { gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), i + 1); } } } GtkWidget * monitor_selection_new (GtkWindow *layer_window) { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); { GtkWidget *combo_box = gtk_combo_box_text_new (); gtk_widget_set_tooltip_text (combo_box, "Monitor"); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combo_box), NULL, "Default"); gtk_combo_box_set_active (GTK_COMBO_BOX (combo_box), 0); GdkDisplay *display = gdk_display_get_default (); g_signal_connect (display, "monitor-added", G_CALLBACK (on_monitors_changed), combo_box); g_signal_connect (display, "monitor-removed", G_CALLBACK (on_monitors_changed), combo_box); on_monitors_changed (display, NULL, GTK_COMBO_BOX (combo_box)); g_signal_connect (combo_box, "changed", G_CALLBACK (on_monitor_selected), layer_window); gtk_box_pack_start (GTK_BOX (vbox), combo_box, FALSE, FALSE, 0); } return vbox; } gtk-layer-shell-0.9.0/examples/demo/mscl-toggles.c000066400000000000000000000070411466775474600220660ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" gboolean on_exclusive_zone_state_set (GtkToggleButton *_toggle_button, gboolean state, GtkWindow *layer_window) { (void)_toggle_button; if (state) { gtk_layer_auto_exclusive_zone_enable (layer_window); } else { gtk_layer_set_exclusive_zone (layer_window, 0); } return FALSE; } gboolean on_fixed_size_set (GtkToggleButton *_toggle_button, gboolean state, GtkWindow *layer_window) { (void)_toggle_button; if (state) { gtk_widget_set_size_request (GTK_WIDGET (layer_window), fixed_size_width, fixed_size_height); } else { gtk_widget_set_size_request (GTK_WIDGET (layer_window), -1, -1); } gtk_window_resize (layer_window, 1, 1); return FALSE; } struct { const char *name; const char *tooltip; gboolean (*callback) (GtkToggleButton *toggle_button, gboolean state, GtkWindow *layer_window); } const mscl_toggles[] = { {"Exclusive", "Create an exclusive zone when anchored", on_exclusive_zone_state_set}, {"Fixed size", "Set a fixed window size (ignored depending on anchors)", on_fixed_size_set}, }; GtkWidget * mscl_toggles_new (GtkWindow *layer_window, gboolean default_auto_exclusive_zone, gboolean default_fixed_size) { GtkWidget *vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6); for (unsigned i = 0; i < sizeof (mscl_toggles) / sizeof (mscl_toggles[0]); i++) { GtkWidget *hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0); { GtkWidget *label = gtk_label_new (mscl_toggles[i].name); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0); }{ GtkWidget *toggle = gtk_switch_new (); gtk_widget_set_tooltip_text (toggle, mscl_toggles[i].tooltip); gboolean default_value; if (mscl_toggles[i].callback == on_exclusive_zone_state_set) default_value = default_auto_exclusive_zone; else if (mscl_toggles[i].callback == on_fixed_size_set) default_value = default_fixed_size; else g_assert_not_reached (); gtk_switch_set_active (GTK_SWITCH (toggle), default_value); g_signal_connect (toggle, "state-set", G_CALLBACK (mscl_toggles[i].callback), layer_window); gtk_box_pack_end (GTK_BOX (hbox), toggle, FALSE, FALSE, 0); } } return vbox; } gtk-layer-shell-0.9.0/examples/demo/version-info.c000066400000000000000000000036711466775474600221110ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-demo.h" GtkWidget * version_info_new () { gchar *version_str = g_strdup_printf("GTK LS v%d.%d.%d\nGTK v%d.%d.%d", gtk_layer_get_major_version (), gtk_layer_get_minor_version (), gtk_layer_get_micro_version (), gtk_get_major_version (), gtk_get_minor_version (), gtk_get_micro_version ()); GtkWidget *version_info = gtk_label_new(version_str); g_free(version_str); gtk_label_set_justify(GTK_LABEL(version_info), GTK_JUSTIFY_CENTER); gtk_label_set_xalign(GTK_LABEL(version_info), 0.5); gtk_label_set_yalign(GTK_LABEL(version_info), 0.25); return version_info; } gtk-layer-shell-0.9.0/examples/meson.build000066400000000000000000000006611466775474600205410ustar00rootroot00000000000000subdir('demo') # vala-standalone is it's own meson project, so do not subdir() it executable( 'gtk-layer-demo', demo_srcs, build_by_default: get_option('examples'), dependencies: [gtk, gtk_layer_shell], install: get_option('examples')) executable( 'simple-example-c', files('simple-example.c'), build_by_default: get_option('examples'), dependencies: [gtk, gtk_layer_shell], install: false) gtk-layer-shell-0.9.0/examples/simple-example.c000066400000000000000000000063571466775474600214750ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-shell.h" #include static void activate (GtkApplication* app, void *_data) { (void)_data; // Create a normal GTK window however you like GtkWindow *gtk_window = GTK_WINDOW (gtk_application_window_new (app)); // Before the window is first realized, set it up to be a layer surface gtk_layer_init_for_window (gtk_window); // Order below normal windows gtk_layer_set_layer (gtk_window, GTK_LAYER_SHELL_LAYER_BOTTOM); // Push other windows out of the way gtk_layer_auto_exclusive_zone_enable (gtk_window); // We don't need to get keyboard input // gtk_layer_set_keyboard_mode (gtk_window, GTK_LAYER_SHELL_KEYBOARD_MODE_NONE); // NONE is default // The margins are the gaps around the window's edges // Margins and anchors can be set like this... gtk_layer_set_margin (gtk_window, GTK_LAYER_SHELL_EDGE_LEFT, 40); gtk_layer_set_margin (gtk_window, GTK_LAYER_SHELL_EDGE_RIGHT, 40); gtk_layer_set_margin (gtk_window, GTK_LAYER_SHELL_EDGE_TOP, 20); // gtk_layer_set_margin (gtk_window, GTK_LAYER_SHELL_EDGE_BOTTOM, 0); // 0 is default // ... or like this // Anchors are if the window is pinned to each edge of the output static const gboolean anchors[] = {TRUE, TRUE, FALSE, TRUE}; for (int i = 0; i < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER; i++) { gtk_layer_set_anchor (gtk_window, i, anchors[i]); } // Set up a widget GtkWidget *label = gtk_label_new (""); gtk_label_set_markup (GTK_LABEL (label), "" "GTK Layer Shell example!" ""); gtk_container_add (GTK_CONTAINER (gtk_window), label); gtk_container_set_border_width (GTK_CONTAINER (gtk_window), 12); gtk_widget_show_all (GTK_WIDGET (gtk_window)); } int main (int argc, char **argv) { GtkApplication * app = gtk_application_new ("sh.wmww.gtk-layer-example", G_APPLICATION_FLAGS_NONE); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); int status = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return status; } gtk-layer-shell-0.9.0/examples/simple-example.py000066400000000000000000000037771466775474600217060ustar00rootroot00000000000000'''This entire file is licensed under MIT. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import gi gi.require_version('Gtk', '3.0') try: gi.require_version('GtkLayerShell', '0.1') except ValueError: import sys raise RuntimeError('\n\n' + 'If you haven\'t installed GTK Layer Shell, you need to point Python to the\n' + 'library by setting GI_TYPELIB_PATH and LD_LIBRARY_PATH to /src/.\n' + 'For example you might need to run:\n\n' + 'GI_TYPELIB_PATH=build/src LD_LIBRARY_PATH=build/src python3 ' + ' '.join(sys.argv)) from gi.repository import Gtk, GtkLayerShell window = Gtk.Window() label = Gtk.Label(label='GTK Layer Shell with Python!') window.add(label) GtkLayerShell.init_for_window(window) GtkLayerShell.auto_exclusive_zone_enable(window) GtkLayerShell.set_margin(window, GtkLayerShell.Edge.TOP, 10) GtkLayerShell.set_margin(window, GtkLayerShell.Edge.BOTTOM, 10) GtkLayerShell.set_anchor(window, GtkLayerShell.Edge.BOTTOM, 1) window.show_all() window.connect('destroy', Gtk.main_quit) Gtk.main() gtk-layer-shell-0.9.0/examples/vala-standalone/000077500000000000000000000000001466775474600214455ustar00rootroot00000000000000gtk-layer-shell-0.9.0/examples/vala-standalone/README.md000066400000000000000000000006441466775474600227300ustar00rootroot00000000000000# GTK Layer Shell Vala Standalone Project This is part of GTK Layer Shell, but is not built with the rest of the library. It requires the library be installed in order to build. It is built as part of CI. ## Dependencies - valac - GTK3 (>=3.22.0) - [GTK Layer Shell](https://github.com/wmww/gtk-layer-shell) (>=0.1.0) ## Building - `meson build` - `ninja -C build` ## Licensing This sub-project is licensed under MIT gtk-layer-shell-0.9.0/examples/vala-standalone/main.vala000066400000000000000000000032211466775474600232340ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ using Gtk; using GtkLayerShell; int main(string[] args) { Gtk.init(ref args); var window = new Window(); var label = new Label("GTK Layer Shell with Vala!"); window.add(label); GtkLayerShell.init_for_window(window); GtkLayerShell.auto_exclusive_zone_enable(window); GtkLayerShell.set_margin(window, GtkLayerShell.Edge.TOP, 10); GtkLayerShell.set_margin(window, GtkLayerShell.Edge.BOTTOM, 10); GtkLayerShell.set_anchor(window, GtkLayerShell.Edge.BOTTOM, true); window.destroy.connect(Gtk.main_quit); window.show_all(); Gtk.main(); return 0; } gtk-layer-shell-0.9.0/examples/vala-standalone/meson.build000066400000000000000000000004751466775474600236150ustar00rootroot00000000000000project('vala-gtk-layer-shell-example', ['vala', 'c'], version: '0.1.0', license: 'MIT', meson_version: '>=0.45.1') gtk = dependency('gtk+-3.0') gtk_layer_shell = dependency('gtk-layer-shell-0') executable( 'vala-layer-shell', files('main.vala'), dependencies: [ gtk, gtk_layer_shell ]) gtk-layer-shell-0.9.0/gtk-priv/000077500000000000000000000000001466775474600163215ustar00rootroot00000000000000gtk-layer-shell-0.9.0/gtk-priv/README.md000066400000000000000000000016551466775474600176070ustar00rootroot00000000000000# GTK private This subproject allows access into private and unstable GTK structs. The headers in h are automatically constructed from multiple versions of GTK3. This lets us be compatible with all supported GTK3 versions, despite using internals that are not part of the stable API. This was originally developed as a standalone project under the name gtk3-espionage. Git history can be found [here](https://github.com/wmww/gtk3-espionage). ## Building the headers __NOTE: you don't need to rebuild the headers in order to build GTK Layer Shell__. Building the header files is only required when GTK has been updated or a structure is added. To build, run `./scripts/build.py` This script will - Load the list of structures from [scripts/config.py](scripts/config.py) - Clone the official GTK git repository - Detect all supported versions of GTK - Check out and extract data from each version - Write header files for each structure gtk-layer-shell-0.9.0/gtk-priv/h/000077500000000000000000000000001466775474600165505ustar00rootroot00000000000000gtk-layer-shell-0.9.0/gtk-priv/h/common.h000066400000000000000000000043301466775474600202110ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef GTK_PRIV_COMMON_H #define GTK_PRIV_COMMON_H #define GdkTitlebarGesture int #define GdkTitleGesture int void gtk_priv_assert_gtk_version_valid() { if (gtk_get_major_version() != 3 || gtk_get_minor_version() < 22) { g_error( "gtk-layer-shell only supports GTK3 >= v3.22.0 (you have v%d.%d.%d)", gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version()); g_abort(); } } void gtk_priv_warn_gtk_version_may_be_unsupported() { static gboolean shown = FALSE; if (shown) return; if (getenv("GTK_LAYER_SHELL_UNSUPPORTED_GTK_WARNING")) { g_warning( "gtk-layer-shell v%d.%d.%d may not work on GTK v%d.%d.%d. " "If you experience crashes, check " "https://github.com/wmww/gtk-layer-shell/blob/master/compatibility.md", GTK_LAYER_SHELL_MAJOR, GTK_LAYER_SHELL_MINOR, GTK_LAYER_SHELL_MICRO, gtk_get_major_version(), gtk_get_minor_version(), gtk_get_micro_version()); } shown = TRUE; } #endif // GTK_PRIV_COMMON_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_wayland_pointer_data_priv.h000066400000000000000000000336631466775474600250110ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 2009 Carlos Garnacho * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WAYLAND_POINTER_DATA_PRIV_H #define GDK_WAYLAND_POINTER_DATA_PRIV_H #include "common.h" typedef struct _GdkWaylandPointerData GdkWaylandPointerData; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.44 (unreleased) struct _GdkWaylandPointerData_v3_22_0 { GdkWindow *focus; double surface_x; double surface_y; GdkModifierType button_modifiers; uint32_t time; uint32_t enter_serial; uint32_t press_serial; GdkWindow *grab_window; uint32_t grab_time; struct wl_surface *pointer_surface; GdkCursor *cursor; guint cursor_timeout_id; guint cursor_image_index; guint cursor_image_delay; guint current_output_scale; GSList *pointer_surface_outputs; struct _GdkWaylandPointerFrameData_v3_22_0 frame; }; // For internal use only int gdk_wayland_pointer_data_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } { version_id = 0; } } return version_id; } // GdkWaylandPointerData::focus GdkWindow * gdk_wayland_pointer_data_priv_get_focus(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->focus; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_focus(GdkWaylandPointerData * self, GdkWindow * focus) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->focus = focus; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::surface_x double gdk_wayland_pointer_data_priv_get_surface_x(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->surface_x; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_surface_x(GdkWaylandPointerData * self, double surface_x) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->surface_x = surface_x; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::surface_y double gdk_wayland_pointer_data_priv_get_surface_y(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->surface_y; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_surface_y(GdkWaylandPointerData * self, double surface_y) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->surface_y = surface_y; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::button_modifiers GdkModifierType * gdk_wayland_pointer_data_priv_get_button_modifiers_ptr(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return (GdkModifierType *)&((struct _GdkWaylandPointerData_v3_22_0*)self)->button_modifiers; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::time uint32_t gdk_wayland_pointer_data_priv_get_time(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->time; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_time(GdkWaylandPointerData * self, uint32_t time) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->time = time; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::enter_serial uint32_t gdk_wayland_pointer_data_priv_get_enter_serial(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->enter_serial; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_enter_serial(GdkWaylandPointerData * self, uint32_t enter_serial) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->enter_serial = enter_serial; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::press_serial uint32_t gdk_wayland_pointer_data_priv_get_press_serial(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->press_serial; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_press_serial(GdkWaylandPointerData * self, uint32_t press_serial) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->press_serial = press_serial; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::grab_window GdkWindow * gdk_wayland_pointer_data_priv_get_grab_window(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->grab_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_grab_window(GdkWaylandPointerData * self, GdkWindow * grab_window) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->grab_window = grab_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::grab_time uint32_t gdk_wayland_pointer_data_priv_get_grab_time(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->grab_time; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_grab_time(GdkWaylandPointerData * self, uint32_t grab_time) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->grab_time = grab_time; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::pointer_surface struct wl_surface * gdk_wayland_pointer_data_priv_get_pointer_surface(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->pointer_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_pointer_surface(GdkWaylandPointerData * self, struct wl_surface * pointer_surface) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->pointer_surface = pointer_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::cursor GdkCursor * gdk_wayland_pointer_data_priv_get_cursor(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_cursor(GdkWaylandPointerData * self, GdkCursor * cursor) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor = cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::cursor_timeout_id guint gdk_wayland_pointer_data_priv_get_cursor_timeout_id(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_timeout_id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_cursor_timeout_id(GdkWaylandPointerData * self, guint cursor_timeout_id) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_timeout_id = cursor_timeout_id; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::cursor_image_index guint gdk_wayland_pointer_data_priv_get_cursor_image_index(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_image_index; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_cursor_image_index(GdkWaylandPointerData * self, guint cursor_image_index) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_image_index = cursor_image_index; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::cursor_image_delay guint gdk_wayland_pointer_data_priv_get_cursor_image_delay(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_image_delay; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_cursor_image_delay(GdkWaylandPointerData * self, guint cursor_image_delay) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->cursor_image_delay = cursor_image_delay; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::current_output_scale guint gdk_wayland_pointer_data_priv_get_current_output_scale(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->current_output_scale; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_current_output_scale(GdkWaylandPointerData * self, guint current_output_scale) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->current_output_scale = current_output_scale; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::pointer_surface_outputs GSList * gdk_wayland_pointer_data_priv_get_pointer_surface_outputs(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerData_v3_22_0*)self)->pointer_surface_outputs; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_data_priv_set_pointer_surface_outputs(GdkWaylandPointerData * self, GSList * pointer_surface_outputs) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerData_v3_22_0*)self)->pointer_surface_outputs = pointer_surface_outputs; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerData::frame GdkWaylandPointerFrameData * gdk_wayland_pointer_data_priv_get_frame_ptr(GdkWaylandPointerData * self) { switch (gdk_wayland_pointer_data_priv_get_version_id()) { case 0: return (GdkWaylandPointerFrameData *)&((struct _GdkWaylandPointerData_v3_22_0*)self)->frame; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WAYLAND_POINTER_DATA_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_wayland_pointer_frame_data_priv.h000066400000000000000000000141361466775474600261550ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 2009 Carlos Garnacho * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WAYLAND_POINTER_FRAME_DATA_PRIV_H #define GDK_WAYLAND_POINTER_FRAME_DATA_PRIV_H #include "common.h" typedef struct _GdkWaylandPointerFrameData GdkWaylandPointerFrameData; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.44 (unreleased) struct _GdkWaylandPointerFrameData_v3_22_0 { GdkEvent *event; gdouble delta_x; gdouble delta_y; int32_t discrete_x; int32_t discrete_y; gint8 is_scroll_stop; enum wl_pointer_axis_source source; }; // For internal use only int gdk_wayland_pointer_frame_data_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } { version_id = 0; } } return version_id; } // GdkWaylandPointerFrameData::event GdkEvent * gdk_wayland_pointer_frame_data_priv_get_event(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->event; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_pointer_frame_data_priv_set_event(GdkWaylandPointerFrameData * self, GdkEvent * event) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->event = event; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::delta_x gdouble * gdk_wayland_pointer_frame_data_priv_get_delta_x_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (gdouble *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->delta_x; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::delta_y gdouble * gdk_wayland_pointer_frame_data_priv_get_delta_y_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (gdouble *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->delta_y; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::discrete_x int32_t * gdk_wayland_pointer_frame_data_priv_get_discrete_x_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (int32_t *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->discrete_x; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::discrete_y int32_t * gdk_wayland_pointer_frame_data_priv_get_discrete_y_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (int32_t *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->discrete_y; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::is_scroll_stop gint8 * gdk_wayland_pointer_frame_data_priv_get_is_scroll_stop_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (gint8 *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->is_scroll_stop; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandPointerFrameData::source enum wl_pointer_axis_source * gdk_wayland_pointer_frame_data_priv_get_source_ptr(GdkWaylandPointerFrameData * self) { switch (gdk_wayland_pointer_frame_data_priv_get_version_id()) { case 0: return (enum wl_pointer_axis_source *)&((struct _GdkWaylandPointerFrameData_v3_22_0*)self)->source; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WAYLAND_POINTER_FRAME_DATA_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_wayland_seat_priv.h000066400000000000000000001776211466775474600232770ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 2009 Carlos Garnacho * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WAYLAND_SEAT_PRIV_H #define GDK_WAYLAND_SEAT_PRIV_H #include "common.h" typedef struct _GdkWaylandSeat GdkWaylandSeat; // Version ID 0 // Valid for GTK v3.22.0 - v3.22.8 struct _GdkWaylandSeat_v3_22_0 { GdkSeat parent_instance; guint32 id; struct wl_seat *wl_seat; struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; struct zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe; struct zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch; struct zwp_tablet_seat_v2 *wp_tablet_seat; GdkDisplay *display; GdkDeviceManager *device_manager; GdkDevice *master_pointer; GdkDevice *master_keyboard; GdkDevice *pointer; GdkDevice *wheel_scrolling; GdkDevice *finger_scrolling; GdkDevice *continuous_scrolling; GdkDevice *keyboard; GdkDevice *touch_master; GdkDevice *touch; GdkCursor *cursor; GdkKeymap *keymap; GHashTable *touches; GList *tablets; GList *tablet_tools; GList *tablet_pads; struct _GdkWaylandPointerData_v3_22_0 pointer_info; struct _GdkWaylandPointerData_v3_22_0 touch_info; GdkModifierType key_modifiers; GdkWindow *keyboard_focus; GdkAtom pending_selection; GdkWindow *grab_window; uint32_t grab_time; gboolean have_server_repeat; uint32_t server_repeat_rate; uint32_t server_repeat_delay; struct wl_callback *repeat_callback; guint32 repeat_timer; guint32 repeat_key; guint32 repeat_count; gint64 repeat_deadline; GSettings *keyboard_settings; uint32_t keyboard_time; uint32_t keyboard_key_serial; struct gtk_primary_selection_device *primary_data_device; struct wl_data_device *data_device; GdkDragContext *drop_context; GdkWindow *foreign_dnd_window; guint gesture_n_fingers; gdouble gesture_scale; GdkCursor *grab_cursor; }; // Version ID 1 // Diff from previous version: // + gint32 nkeys; // Valid for GTK v3.22.9 - v3.22.15 struct _GdkWaylandSeat_v3_22_9 { GdkSeat parent_instance; guint32 id; struct wl_seat *wl_seat; struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; struct zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe; struct zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch; struct zwp_tablet_seat_v2 *wp_tablet_seat; GdkDisplay *display; GdkDeviceManager *device_manager; GdkDevice *master_pointer; GdkDevice *master_keyboard; GdkDevice *pointer; GdkDevice *wheel_scrolling; GdkDevice *finger_scrolling; GdkDevice *continuous_scrolling; GdkDevice *keyboard; GdkDevice *touch_master; GdkDevice *touch; GdkCursor *cursor; GdkKeymap *keymap; GHashTable *touches; GList *tablets; GList *tablet_tools; GList *tablet_pads; struct _GdkWaylandPointerData_v3_22_0 pointer_info; struct _GdkWaylandPointerData_v3_22_0 touch_info; GdkModifierType key_modifiers; GdkWindow *keyboard_focus; GdkAtom pending_selection; GdkWindow *grab_window; uint32_t grab_time; gboolean have_server_repeat; uint32_t server_repeat_rate; uint32_t server_repeat_delay; struct wl_callback *repeat_callback; guint32 repeat_timer; guint32 repeat_key; guint32 repeat_count; gint64 repeat_deadline; gint32 nkeys; GSettings *keyboard_settings; uint32_t keyboard_time; uint32_t keyboard_key_serial; struct gtk_primary_selection_device *primary_data_device; struct wl_data_device *data_device; GdkDragContext *drop_context; GdkWindow *foreign_dnd_window; guint gesture_n_fingers; gdouble gesture_scale; GdkCursor *grab_cursor; }; // Version ID 2 // Diff from previous version: // - gint32 nkeys; // Valid for GTK v3.22.16 - v3.24.23 struct _GdkWaylandSeat_v3_22_16 { GdkSeat parent_instance; guint32 id; struct wl_seat *wl_seat; struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; struct zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe; struct zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch; struct zwp_tablet_seat_v2 *wp_tablet_seat; GdkDisplay *display; GdkDeviceManager *device_manager; GdkDevice *master_pointer; GdkDevice *master_keyboard; GdkDevice *pointer; GdkDevice *wheel_scrolling; GdkDevice *finger_scrolling; GdkDevice *continuous_scrolling; GdkDevice *keyboard; GdkDevice *touch_master; GdkDevice *touch; GdkCursor *cursor; GdkKeymap *keymap; GHashTable *touches; GList *tablets; GList *tablet_tools; GList *tablet_pads; struct _GdkWaylandPointerData_v3_22_0 pointer_info; struct _GdkWaylandPointerData_v3_22_0 touch_info; GdkModifierType key_modifiers; GdkWindow *keyboard_focus; GdkAtom pending_selection; GdkWindow *grab_window; uint32_t grab_time; gboolean have_server_repeat; uint32_t server_repeat_rate; uint32_t server_repeat_delay; struct wl_callback *repeat_callback; guint32 repeat_timer; guint32 repeat_key; guint32 repeat_count; gint64 repeat_deadline; GSettings *keyboard_settings; uint32_t keyboard_time; uint32_t keyboard_key_serial; struct gtk_primary_selection_device *primary_data_device; struct wl_data_device *data_device; GdkDragContext *drop_context; GdkWindow *foreign_dnd_window; guint gesture_n_fingers; gdouble gesture_scale; GdkCursor *grab_cursor; }; // Version ID 3 // Diff from previous version: // - struct gtk_primary_selection_device *primary_data_device; // + struct gtk_primary_selection_device *gtk_primary_data_device; // + struct zwp_primary_selection_device_v1 *zwp_primary_data_device_v1; // Valid for GTK v3.24.24 - v3.24.44 (unreleased) struct _GdkWaylandSeat_v3_24_24 { GdkSeat parent_instance; guint32 id; struct wl_seat *wl_seat; struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_touch *wl_touch; struct zwp_pointer_gesture_swipe_v1 *wp_pointer_gesture_swipe; struct zwp_pointer_gesture_pinch_v1 *wp_pointer_gesture_pinch; struct zwp_tablet_seat_v2 *wp_tablet_seat; GdkDisplay *display; GdkDeviceManager *device_manager; GdkDevice *master_pointer; GdkDevice *master_keyboard; GdkDevice *pointer; GdkDevice *wheel_scrolling; GdkDevice *finger_scrolling; GdkDevice *continuous_scrolling; GdkDevice *keyboard; GdkDevice *touch_master; GdkDevice *touch; GdkCursor *cursor; GdkKeymap *keymap; GHashTable *touches; GList *tablets; GList *tablet_tools; GList *tablet_pads; struct _GdkWaylandPointerData_v3_22_0 pointer_info; struct _GdkWaylandPointerData_v3_22_0 touch_info; GdkModifierType key_modifiers; GdkWindow *keyboard_focus; GdkAtom pending_selection; GdkWindow *grab_window; uint32_t grab_time; gboolean have_server_repeat; uint32_t server_repeat_rate; uint32_t server_repeat_delay; struct wl_callback *repeat_callback; guint32 repeat_timer; guint32 repeat_key; guint32 repeat_count; gint64 repeat_deadline; GSettings *keyboard_settings; uint32_t keyboard_time; uint32_t keyboard_key_serial; struct gtk_primary_selection_device *gtk_primary_data_device; struct zwp_primary_selection_device_v1 *zwp_primary_data_device_v1; struct wl_data_device *data_device; GdkDragContext *drop_context; GdkWindow *foreign_dnd_window; guint gesture_n_fingers; gdouble gesture_scale; GdkCursor *grab_cursor; }; // For internal use only int gdk_wayland_seat_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } if (combo >= 24024) { version_id = 3; } else if (combo >= 22016) { version_id = 2; } else if (combo >= 22009) { version_id = 1; } else { version_id = 0; } } return version_id; } // GdkWaylandSeat::parent_instance GdkSeat * gdk_wayland_seat_priv_get_parent_instance_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (GdkSeat *)&((struct _GdkWaylandSeat_v3_22_0*)self)->parent_instance; case 1: return (GdkSeat *)&((struct _GdkWaylandSeat_v3_22_9*)self)->parent_instance; case 2: return (GdkSeat *)&((struct _GdkWaylandSeat_v3_22_16*)self)->parent_instance; case 3: return (GdkSeat *)&((struct _GdkWaylandSeat_v3_24_24*)self)->parent_instance; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::id guint32 * gdk_wayland_seat_priv_get_id_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_0*)self)->id; case 1: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->id; case 2: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_16*)self)->id; case 3: return (guint32 *)&((struct _GdkWaylandSeat_v3_24_24*)self)->id; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wl_seat struct wl_seat * gdk_wayland_seat_priv_get_wl_seat(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_seat; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_seat; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_seat; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_seat; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wl_seat(GdkWaylandSeat * self, struct wl_seat * wl_seat) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_seat = wl_seat; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_seat = wl_seat; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_seat = wl_seat; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_seat = wl_seat; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wl_pointer struct wl_pointer * gdk_wayland_seat_priv_get_wl_pointer(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_pointer; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_pointer; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_pointer; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_pointer; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wl_pointer(GdkWaylandSeat * self, struct wl_pointer * wl_pointer) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_pointer = wl_pointer; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_pointer = wl_pointer; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_pointer = wl_pointer; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_pointer = wl_pointer; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wl_keyboard struct wl_keyboard * gdk_wayland_seat_priv_get_wl_keyboard(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_keyboard; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_keyboard; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_keyboard; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_keyboard; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wl_keyboard(GdkWaylandSeat * self, struct wl_keyboard * wl_keyboard) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_keyboard = wl_keyboard; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_keyboard = wl_keyboard; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_keyboard = wl_keyboard; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_keyboard = wl_keyboard; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wl_touch struct wl_touch * gdk_wayland_seat_priv_get_wl_touch(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_touch; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_touch; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_touch; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_touch; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wl_touch(GdkWaylandSeat * self, struct wl_touch * wl_touch) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wl_touch = wl_touch; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wl_touch = wl_touch; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wl_touch = wl_touch; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wl_touch = wl_touch; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wp_pointer_gesture_swipe struct zwp_pointer_gesture_swipe_v1 * gdk_wayland_seat_priv_get_wp_pointer_gesture_swipe(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_pointer_gesture_swipe; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_pointer_gesture_swipe; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_pointer_gesture_swipe; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_pointer_gesture_swipe; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wp_pointer_gesture_swipe(GdkWaylandSeat * self, struct zwp_pointer_gesture_swipe_v1 * wp_pointer_gesture_swipe) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_pointer_gesture_swipe = wp_pointer_gesture_swipe; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_pointer_gesture_swipe = wp_pointer_gesture_swipe; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_pointer_gesture_swipe = wp_pointer_gesture_swipe; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_pointer_gesture_swipe = wp_pointer_gesture_swipe; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wp_pointer_gesture_pinch struct zwp_pointer_gesture_pinch_v1 * gdk_wayland_seat_priv_get_wp_pointer_gesture_pinch(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_pointer_gesture_pinch; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_pointer_gesture_pinch; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_pointer_gesture_pinch; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_pointer_gesture_pinch; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wp_pointer_gesture_pinch(GdkWaylandSeat * self, struct zwp_pointer_gesture_pinch_v1 * wp_pointer_gesture_pinch) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_pointer_gesture_pinch = wp_pointer_gesture_pinch; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_pointer_gesture_pinch = wp_pointer_gesture_pinch; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_pointer_gesture_pinch = wp_pointer_gesture_pinch; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_pointer_gesture_pinch = wp_pointer_gesture_pinch; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wp_tablet_seat struct zwp_tablet_seat_v2 * gdk_wayland_seat_priv_get_wp_tablet_seat(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_tablet_seat; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_tablet_seat; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_tablet_seat; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_tablet_seat; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wp_tablet_seat(GdkWaylandSeat * self, struct zwp_tablet_seat_v2 * wp_tablet_seat) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wp_tablet_seat = wp_tablet_seat; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wp_tablet_seat = wp_tablet_seat; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wp_tablet_seat = wp_tablet_seat; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wp_tablet_seat = wp_tablet_seat; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::display GdkDisplay * gdk_wayland_seat_priv_get_display(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->display; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->display; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->display; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->display; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_display(GdkWaylandSeat * self, GdkDisplay * display) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->display = display; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->display = display; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->display = display; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->display = display; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::device_manager GdkDeviceManager * gdk_wayland_seat_priv_get_device_manager(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->device_manager; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->device_manager; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->device_manager; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->device_manager; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_device_manager(GdkWaylandSeat * self, GdkDeviceManager * device_manager) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->device_manager = device_manager; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->device_manager = device_manager; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->device_manager = device_manager; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->device_manager = device_manager; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::master_pointer GdkDevice * gdk_wayland_seat_priv_get_master_pointer(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->master_pointer; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->master_pointer; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->master_pointer; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->master_pointer; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_master_pointer(GdkWaylandSeat * self, GdkDevice * master_pointer) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->master_pointer = master_pointer; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->master_pointer = master_pointer; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->master_pointer = master_pointer; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->master_pointer = master_pointer; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::master_keyboard GdkDevice * gdk_wayland_seat_priv_get_master_keyboard(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->master_keyboard; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->master_keyboard; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->master_keyboard; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->master_keyboard; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_master_keyboard(GdkWaylandSeat * self, GdkDevice * master_keyboard) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->master_keyboard = master_keyboard; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->master_keyboard = master_keyboard; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->master_keyboard = master_keyboard; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->master_keyboard = master_keyboard; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::pointer GdkDevice * gdk_wayland_seat_priv_get_pointer(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->pointer; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->pointer; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->pointer; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->pointer; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_pointer(GdkWaylandSeat * self, GdkDevice * pointer) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->pointer = pointer; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->pointer = pointer; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->pointer = pointer; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->pointer = pointer; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::wheel_scrolling GdkDevice * gdk_wayland_seat_priv_get_wheel_scrolling(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->wheel_scrolling; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->wheel_scrolling; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->wheel_scrolling; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->wheel_scrolling; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_wheel_scrolling(GdkWaylandSeat * self, GdkDevice * wheel_scrolling) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->wheel_scrolling = wheel_scrolling; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->wheel_scrolling = wheel_scrolling; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->wheel_scrolling = wheel_scrolling; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->wheel_scrolling = wheel_scrolling; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::finger_scrolling GdkDevice * gdk_wayland_seat_priv_get_finger_scrolling(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->finger_scrolling; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->finger_scrolling; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->finger_scrolling; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->finger_scrolling; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_finger_scrolling(GdkWaylandSeat * self, GdkDevice * finger_scrolling) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->finger_scrolling = finger_scrolling; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->finger_scrolling = finger_scrolling; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->finger_scrolling = finger_scrolling; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->finger_scrolling = finger_scrolling; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::continuous_scrolling GdkDevice * gdk_wayland_seat_priv_get_continuous_scrolling(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->continuous_scrolling; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->continuous_scrolling; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->continuous_scrolling; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->continuous_scrolling; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_continuous_scrolling(GdkWaylandSeat * self, GdkDevice * continuous_scrolling) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->continuous_scrolling = continuous_scrolling; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->continuous_scrolling = continuous_scrolling; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->continuous_scrolling = continuous_scrolling; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->continuous_scrolling = continuous_scrolling; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keyboard GdkDevice * gdk_wayland_seat_priv_get_keyboard(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keyboard(GdkWaylandSeat * self, GdkDevice * keyboard) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard = keyboard; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard = keyboard; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard = keyboard; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard = keyboard; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::touch_master GdkDevice * gdk_wayland_seat_priv_get_touch_master(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->touch_master; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->touch_master; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->touch_master; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->touch_master; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_touch_master(GdkWaylandSeat * self, GdkDevice * touch_master) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->touch_master = touch_master; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->touch_master = touch_master; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->touch_master = touch_master; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->touch_master = touch_master; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::touch GdkDevice * gdk_wayland_seat_priv_get_touch(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->touch; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->touch; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->touch; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->touch; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_touch(GdkWaylandSeat * self, GdkDevice * touch) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->touch = touch; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->touch = touch; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->touch = touch; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->touch = touch; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::cursor GdkCursor * gdk_wayland_seat_priv_get_cursor(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->cursor; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->cursor; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->cursor; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_cursor(GdkWaylandSeat * self, GdkCursor * cursor) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->cursor = cursor; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->cursor = cursor; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->cursor = cursor; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->cursor = cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keymap GdkKeymap * gdk_wayland_seat_priv_get_keymap(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keymap; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keymap; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keymap; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keymap; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keymap(GdkWaylandSeat * self, GdkKeymap * keymap) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keymap = keymap; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keymap = keymap; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keymap = keymap; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keymap = keymap; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::touches GHashTable * gdk_wayland_seat_priv_get_touches(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->touches; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->touches; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->touches; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->touches; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_touches(GdkWaylandSeat * self, GHashTable * touches) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->touches = touches; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->touches = touches; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->touches = touches; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->touches = touches; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::tablets GList * gdk_wayland_seat_priv_get_tablets(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->tablets; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->tablets; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->tablets; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->tablets; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_tablets(GdkWaylandSeat * self, GList * tablets) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->tablets = tablets; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->tablets = tablets; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->tablets = tablets; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->tablets = tablets; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::tablet_tools GList * gdk_wayland_seat_priv_get_tablet_tools(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->tablet_tools; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->tablet_tools; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->tablet_tools; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->tablet_tools; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_tablet_tools(GdkWaylandSeat * self, GList * tablet_tools) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->tablet_tools = tablet_tools; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->tablet_tools = tablet_tools; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->tablet_tools = tablet_tools; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->tablet_tools = tablet_tools; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::tablet_pads GList * gdk_wayland_seat_priv_get_tablet_pads(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->tablet_pads; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->tablet_pads; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->tablet_pads; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->tablet_pads; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_tablet_pads(GdkWaylandSeat * self, GList * tablet_pads) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->tablet_pads = tablet_pads; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->tablet_pads = tablet_pads; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->tablet_pads = tablet_pads; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->tablet_pads = tablet_pads; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::pointer_info GdkWaylandPointerData * gdk_wayland_seat_priv_get_pointer_info_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_0*)self)->pointer_info; case 1: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_9*)self)->pointer_info; case 2: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_16*)self)->pointer_info; case 3: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_24_24*)self)->pointer_info; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::touch_info GdkWaylandPointerData * gdk_wayland_seat_priv_get_touch_info_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_0*)self)->touch_info; case 1: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_9*)self)->touch_info; case 2: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_22_16*)self)->touch_info; case 3: return (GdkWaylandPointerData *)&((struct _GdkWaylandSeat_v3_24_24*)self)->touch_info; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::key_modifiers GdkModifierType * gdk_wayland_seat_priv_get_key_modifiers_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (GdkModifierType *)&((struct _GdkWaylandSeat_v3_22_0*)self)->key_modifiers; case 1: return (GdkModifierType *)&((struct _GdkWaylandSeat_v3_22_9*)self)->key_modifiers; case 2: return (GdkModifierType *)&((struct _GdkWaylandSeat_v3_22_16*)self)->key_modifiers; case 3: return (GdkModifierType *)&((struct _GdkWaylandSeat_v3_24_24*)self)->key_modifiers; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keyboard_focus GdkWindow * gdk_wayland_seat_priv_get_keyboard_focus(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_focus; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_focus; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_focus; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_focus; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keyboard_focus(GdkWaylandSeat * self, GdkWindow * keyboard_focus) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_focus = keyboard_focus; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_focus = keyboard_focus; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_focus = keyboard_focus; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_focus = keyboard_focus; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::pending_selection GdkAtom * gdk_wayland_seat_priv_get_pending_selection_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (GdkAtom *)&((struct _GdkWaylandSeat_v3_22_0*)self)->pending_selection; case 1: return (GdkAtom *)&((struct _GdkWaylandSeat_v3_22_9*)self)->pending_selection; case 2: return (GdkAtom *)&((struct _GdkWaylandSeat_v3_22_16*)self)->pending_selection; case 3: return (GdkAtom *)&((struct _GdkWaylandSeat_v3_24_24*)self)->pending_selection; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::grab_window GdkWindow * gdk_wayland_seat_priv_get_grab_window(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_window; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_window; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_window; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_grab_window(GdkWaylandSeat * self, GdkWindow * grab_window) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_window = grab_window; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_window = grab_window; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_window = grab_window; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_window = grab_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::grab_time uint32_t gdk_wayland_seat_priv_get_grab_time(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_time; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_time; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_time; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_time; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_grab_time(GdkWaylandSeat * self, uint32_t grab_time) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_time = grab_time; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_time = grab_time; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_time = grab_time; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_time = grab_time; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::have_server_repeat gboolean gdk_wayland_seat_priv_get_have_server_repeat(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->have_server_repeat; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->have_server_repeat; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->have_server_repeat; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->have_server_repeat; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_have_server_repeat(GdkWaylandSeat * self, gboolean have_server_repeat) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->have_server_repeat = have_server_repeat; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->have_server_repeat = have_server_repeat; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->have_server_repeat = have_server_repeat; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->have_server_repeat = have_server_repeat; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::server_repeat_rate uint32_t gdk_wayland_seat_priv_get_server_repeat_rate(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->server_repeat_rate; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->server_repeat_rate; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->server_repeat_rate; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->server_repeat_rate; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_server_repeat_rate(GdkWaylandSeat * self, uint32_t server_repeat_rate) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->server_repeat_rate = server_repeat_rate; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->server_repeat_rate = server_repeat_rate; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->server_repeat_rate = server_repeat_rate; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->server_repeat_rate = server_repeat_rate; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::server_repeat_delay uint32_t gdk_wayland_seat_priv_get_server_repeat_delay(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->server_repeat_delay; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->server_repeat_delay; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->server_repeat_delay; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->server_repeat_delay; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_server_repeat_delay(GdkWaylandSeat * self, uint32_t server_repeat_delay) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->server_repeat_delay = server_repeat_delay; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->server_repeat_delay = server_repeat_delay; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->server_repeat_delay = server_repeat_delay; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->server_repeat_delay = server_repeat_delay; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::repeat_callback struct wl_callback * gdk_wayland_seat_priv_get_repeat_callback(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_callback; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_callback; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_callback; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_callback; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_repeat_callback(GdkWaylandSeat * self, struct wl_callback * repeat_callback) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_callback = repeat_callback; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_callback = repeat_callback; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_callback = repeat_callback; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_callback = repeat_callback; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::repeat_timer guint32 * gdk_wayland_seat_priv_get_repeat_timer_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_timer; case 1: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_timer; case 2: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_timer; case 3: return (guint32 *)&((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_timer; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::repeat_key guint32 * gdk_wayland_seat_priv_get_repeat_key_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_key; case 1: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_key; case 2: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_key; case 3: return (guint32 *)&((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_key; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::repeat_count guint32 * gdk_wayland_seat_priv_get_repeat_count_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_count; case 1: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_count; case 2: return (guint32 *)&((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_count; case 3: return (guint32 *)&((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_count; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::repeat_deadline gint64 * gdk_wayland_seat_priv_get_repeat_deadline_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (gint64 *)&((struct _GdkWaylandSeat_v3_22_0*)self)->repeat_deadline; case 1: return (gint64 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->repeat_deadline; case 2: return (gint64 *)&((struct _GdkWaylandSeat_v3_22_16*)self)->repeat_deadline; case 3: return (gint64 *)&((struct _GdkWaylandSeat_v3_24_24*)self)->repeat_deadline; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keyboard_settings GSettings * gdk_wayland_seat_priv_get_keyboard_settings(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_settings; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_settings; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_settings; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_settings; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keyboard_settings(GdkWaylandSeat * self, GSettings * keyboard_settings) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_settings = keyboard_settings; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_settings = keyboard_settings; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_settings = keyboard_settings; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_settings = keyboard_settings; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keyboard_time uint32_t gdk_wayland_seat_priv_get_keyboard_time(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_time; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_time; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_time; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_time; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keyboard_time(GdkWaylandSeat * self, uint32_t keyboard_time) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_time = keyboard_time; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_time = keyboard_time; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_time = keyboard_time; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_time = keyboard_time; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::keyboard_key_serial uint32_t gdk_wayland_seat_priv_get_keyboard_key_serial(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_key_serial; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_key_serial; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_key_serial; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_key_serial; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_keyboard_key_serial(GdkWaylandSeat * self, uint32_t keyboard_key_serial) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->keyboard_key_serial = keyboard_key_serial; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->keyboard_key_serial = keyboard_key_serial; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->keyboard_key_serial = keyboard_key_serial; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->keyboard_key_serial = keyboard_key_serial; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::primary_data_device gboolean gdk_wayland_seat_priv_get_primary_data_device_supported() { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return TRUE; case 1: return TRUE; case 2: return TRUE; case 3: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } struct gtk_primary_selection_device * gdk_wayland_seat_priv_get_primary_data_device_or_abort(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->primary_data_device; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->primary_data_device; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->primary_data_device; case 3: g_error("GdkWaylandSeat::primary_data_device not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_primary_data_device_or_abort(GdkWaylandSeat * self, struct gtk_primary_selection_device * primary_data_device) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->primary_data_device = primary_data_device; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->primary_data_device = primary_data_device; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->primary_data_device = primary_data_device; break; case 3: g_error("GdkWaylandSeat::primary_data_device not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::data_device struct wl_data_device * gdk_wayland_seat_priv_get_data_device(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->data_device; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->data_device; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->data_device; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->data_device; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_data_device(GdkWaylandSeat * self, struct wl_data_device * data_device) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->data_device = data_device; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->data_device = data_device; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->data_device = data_device; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->data_device = data_device; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::drop_context GdkDragContext * gdk_wayland_seat_priv_get_drop_context(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->drop_context; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->drop_context; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->drop_context; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->drop_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_drop_context(GdkWaylandSeat * self, GdkDragContext * drop_context) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->drop_context = drop_context; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->drop_context = drop_context; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->drop_context = drop_context; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->drop_context = drop_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::foreign_dnd_window GdkWindow * gdk_wayland_seat_priv_get_foreign_dnd_window(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->foreign_dnd_window; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->foreign_dnd_window; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->foreign_dnd_window; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->foreign_dnd_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_foreign_dnd_window(GdkWaylandSeat * self, GdkWindow * foreign_dnd_window) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->foreign_dnd_window = foreign_dnd_window; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->foreign_dnd_window = foreign_dnd_window; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->foreign_dnd_window = foreign_dnd_window; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->foreign_dnd_window = foreign_dnd_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::gesture_n_fingers guint gdk_wayland_seat_priv_get_gesture_n_fingers(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->gesture_n_fingers; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->gesture_n_fingers; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->gesture_n_fingers; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->gesture_n_fingers; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_gesture_n_fingers(GdkWaylandSeat * self, guint gesture_n_fingers) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->gesture_n_fingers = gesture_n_fingers; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->gesture_n_fingers = gesture_n_fingers; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->gesture_n_fingers = gesture_n_fingers; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->gesture_n_fingers = gesture_n_fingers; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::gesture_scale gdouble * gdk_wayland_seat_priv_get_gesture_scale_ptr(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return (gdouble *)&((struct _GdkWaylandSeat_v3_22_0*)self)->gesture_scale; case 1: return (gdouble *)&((struct _GdkWaylandSeat_v3_22_9*)self)->gesture_scale; case 2: return (gdouble *)&((struct _GdkWaylandSeat_v3_22_16*)self)->gesture_scale; case 3: return (gdouble *)&((struct _GdkWaylandSeat_v3_24_24*)self)->gesture_scale; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::grab_cursor GdkCursor * gdk_wayland_seat_priv_get_grab_cursor(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_cursor; case 1: return ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_cursor; case 2: return ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_cursor; case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_grab_cursor(GdkWaylandSeat * self, GdkCursor * grab_cursor) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: ((struct _GdkWaylandSeat_v3_22_0*)self)->grab_cursor = grab_cursor; break; case 1: ((struct _GdkWaylandSeat_v3_22_9*)self)->grab_cursor = grab_cursor; break; case 2: ((struct _GdkWaylandSeat_v3_22_16*)self)->grab_cursor = grab_cursor; break; case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->grab_cursor = grab_cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::nkeys gboolean gdk_wayland_seat_priv_get_nkeys_supported() { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return FALSE; case 3: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } gint32 * gdk_wayland_seat_priv_get_nkeys_ptr_or_null(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return NULL; case 1: return (gint32 *)&((struct _GdkWaylandSeat_v3_22_9*)self)->nkeys; case 2: return NULL; case 3: return NULL; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::gtk_primary_data_device gboolean gdk_wayland_seat_priv_get_gtk_primary_data_device_supported() { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct gtk_primary_selection_device * gdk_wayland_seat_priv_get_gtk_primary_data_device_or_abort(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 1: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 2: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->gtk_primary_data_device; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_gtk_primary_data_device_or_abort(GdkWaylandSeat * self, struct gtk_primary_selection_device * gtk_primary_data_device) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 1: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 2: g_error("GdkWaylandSeat::gtk_primary_data_device not supported on this GTK"); g_abort(); case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->gtk_primary_data_device = gtk_primary_data_device; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandSeat::zwp_primary_data_device_v1 gboolean gdk_wayland_seat_priv_get_zwp_primary_data_device_v1_supported() { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zwp_primary_selection_device_v1 * gdk_wayland_seat_priv_get_zwp_primary_data_device_v1_or_abort(GdkWaylandSeat * self) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 1: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 2: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 3: return ((struct _GdkWaylandSeat_v3_24_24*)self)->zwp_primary_data_device_v1; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_seat_priv_set_zwp_primary_data_device_v1_or_abort(GdkWaylandSeat * self, struct zwp_primary_selection_device_v1 * zwp_primary_data_device_v1) { switch (gdk_wayland_seat_priv_get_version_id()) { case 0: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 1: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 2: g_error("GdkWaylandSeat::zwp_primary_data_device_v1 not supported on this GTK"); g_abort(); case 3: ((struct _GdkWaylandSeat_v3_24_24*)self)->zwp_primary_data_device_v1 = zwp_primary_data_device_v1; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WAYLAND_SEAT_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_wayland_tablet_data_priv.h000066400000000000000000000277771466775474600246150ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 2009 Carlos Garnacho * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WAYLAND_TABLET_DATA_PRIV_H #define GDK_WAYLAND_TABLET_DATA_PRIV_H #include "common.h" typedef struct _GdkWaylandTabletData GdkWaylandTabletData; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.44 (unreleased) struct _GdkWaylandTabletData_v3_22_0 { struct zwp_tablet_v2 *wp_tablet; gchar *name; gchar *path; uint32_t vid; uint32_t pid; GdkDevice *master; GdkDevice *stylus_device; GdkDevice *eraser_device; GdkDevice *current_device; GdkSeat *seat; struct _GdkWaylandPointerData_v3_22_0 pointer_info; GList *pads; GdkWaylandTabletToolData *current_tool; gint axis_indices[GDK_AXIS_LAST]; gdouble *axes; }; // For internal use only int gdk_wayland_tablet_data_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } { version_id = 0; } } return version_id; } // GdkWaylandTabletData::wp_tablet struct zwp_tablet_v2 * gdk_wayland_tablet_data_priv_get_wp_tablet(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->wp_tablet; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_wp_tablet(GdkWaylandTabletData * self, struct zwp_tablet_v2 * wp_tablet) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->wp_tablet = wp_tablet; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::name gchar * gdk_wayland_tablet_data_priv_get_name(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->name; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_name(GdkWaylandTabletData * self, gchar * name) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->name = name; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::path gchar * gdk_wayland_tablet_data_priv_get_path(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->path; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_path(GdkWaylandTabletData * self, gchar * path) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->path = path; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::vid uint32_t gdk_wayland_tablet_data_priv_get_vid(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->vid; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_vid(GdkWaylandTabletData * self, uint32_t vid) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->vid = vid; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::pid uint32_t gdk_wayland_tablet_data_priv_get_pid(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->pid; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_pid(GdkWaylandTabletData * self, uint32_t pid) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->pid = pid; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::master GdkDevice * gdk_wayland_tablet_data_priv_get_master(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->master; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_master(GdkWaylandTabletData * self, GdkDevice * master) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->master = master; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::stylus_device GdkDevice * gdk_wayland_tablet_data_priv_get_stylus_device(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->stylus_device; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_stylus_device(GdkWaylandTabletData * self, GdkDevice * stylus_device) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->stylus_device = stylus_device; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::eraser_device GdkDevice * gdk_wayland_tablet_data_priv_get_eraser_device(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->eraser_device; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_eraser_device(GdkWaylandTabletData * self, GdkDevice * eraser_device) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->eraser_device = eraser_device; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::current_device GdkDevice * gdk_wayland_tablet_data_priv_get_current_device(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->current_device; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_current_device(GdkWaylandTabletData * self, GdkDevice * current_device) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->current_device = current_device; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::seat GdkSeat * gdk_wayland_tablet_data_priv_get_seat(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->seat; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_seat(GdkWaylandTabletData * self, GdkSeat * seat) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->seat = seat; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::pointer_info GdkWaylandPointerData * gdk_wayland_tablet_data_priv_get_pointer_info_ptr(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return (GdkWaylandPointerData *)&((struct _GdkWaylandTabletData_v3_22_0*)self)->pointer_info; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::pads GList * gdk_wayland_tablet_data_priv_get_pads(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->pads; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_pads(GdkWaylandTabletData * self, GList * pads) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->pads = pads; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::current_tool GdkWaylandTabletToolData * gdk_wayland_tablet_data_priv_get_current_tool(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->current_tool; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_current_tool(GdkWaylandTabletData * self, GdkWaylandTabletToolData * current_tool) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->current_tool = current_tool; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::axis_indices gint* * gdk_wayland_tablet_data_priv_get_axis_indices_ptr(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return (gint* *)&((struct _GdkWaylandTabletData_v3_22_0*)self)->axis_indices; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTabletData::axes gdouble * gdk_wayland_tablet_data_priv_get_axes(GdkWaylandTabletData * self) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTabletData_v3_22_0*)self)->axes; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_tablet_data_priv_set_axes(GdkWaylandTabletData * self, gdouble * axes) { switch (gdk_wayland_tablet_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTabletData_v3_22_0*)self)->axes = axes; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WAYLAND_TABLET_DATA_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_wayland_touch_data_priv.h000066400000000000000000000143051466775474600244430ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 2009 Carlos Garnacho * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WAYLAND_TOUCH_DATA_PRIV_H #define GDK_WAYLAND_TOUCH_DATA_PRIV_H #include "common.h" typedef struct _GdkWaylandTouchData GdkWaylandTouchData; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.44 (unreleased) struct _GdkWaylandTouchData_v3_22_0 { uint32_t id; gdouble x; gdouble y; GdkWindow *window; uint32_t touch_down_serial; guint initial_touch : 1; }; // For internal use only int gdk_wayland_touch_data_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } { version_id = 0; } } return version_id; } // GdkWaylandTouchData::id uint32_t gdk_wayland_touch_data_priv_get_id(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTouchData_v3_22_0*)self)->id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_touch_data_priv_set_id(GdkWaylandTouchData * self, uint32_t id) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTouchData_v3_22_0*)self)->id = id; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTouchData::x gdouble * gdk_wayland_touch_data_priv_get_x_ptr(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return (gdouble *)&((struct _GdkWaylandTouchData_v3_22_0*)self)->x; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTouchData::y gdouble * gdk_wayland_touch_data_priv_get_y_ptr(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return (gdouble *)&((struct _GdkWaylandTouchData_v3_22_0*)self)->y; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTouchData::window GdkWindow * gdk_wayland_touch_data_priv_get_window(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTouchData_v3_22_0*)self)->window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_touch_data_priv_set_window(GdkWaylandTouchData * self, GdkWindow * window) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTouchData_v3_22_0*)self)->window = window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTouchData::touch_down_serial uint32_t gdk_wayland_touch_data_priv_get_touch_down_serial(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTouchData_v3_22_0*)self)->touch_down_serial; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_touch_data_priv_set_touch_down_serial(GdkWaylandTouchData * self, uint32_t touch_down_serial) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTouchData_v3_22_0*)self)->touch_down_serial = touch_down_serial; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWaylandTouchData::initial_touch guint gdk_wayland_touch_data_priv_get_initial_touch(GdkWaylandTouchData * self) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: return ((struct _GdkWaylandTouchData_v3_22_0*)self)->initial_touch; default: g_error("Invalid version ID"); g_abort(); } } void gdk_wayland_touch_data_priv_set_initial_touch(GdkWaylandTouchData * self, guint initial_touch) { switch (gdk_wayland_touch_data_priv_get_version_id()) { case 0: ((struct _GdkWaylandTouchData_v3_22_0*)self)->initial_touch = initial_touch; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WAYLAND_TOUCH_DATA_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_window_impl_class_priv.h000066400000000000000000003101041466775474600243220ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WINDOW_IMPL_CLASS_PRIV_H #define GDK_WINDOW_IMPL_CLASS_PRIV_H #include "common.h" typedef struct _GdkWindowImplClass GdkWindowImplClass; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.34 struct _GdkWindowImplClass_v3_22_0 { GObjectClass parent_class; cairo_surface_t * (* ref_cairo_surface) (GdkWindow *window); cairo_surface_t * (* create_similar_image_surface) (GdkWindow *window, cairo_format_t format, int width, int height); void (* show) (GdkWindow *window, gboolean already_mapped); void (* hide) (GdkWindow *window); void (* withdraw) (GdkWindow *window); void (* raise) (GdkWindow *window); void (* lower) (GdkWindow *window); void (* restack_under) (GdkWindow *window, GList *native_siblings); void (* restack_toplevel) (GdkWindow *window, GdkWindow *sibling, gboolean above); void (* move_resize) (GdkWindow *window, gboolean with_move, gint x, gint y, gint width, gint height); void (* move_to_rect) (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy); void (* set_background) (GdkWindow *window, cairo_pattern_t *pattern); GdkEventMask (* get_events) (GdkWindow *window); void (* set_events) (GdkWindow *window, GdkEventMask event_mask); gboolean (* reparent) (GdkWindow *window, GdkWindow *new_parent, gint x, gint y); void (* set_device_cursor) (GdkWindow *window, GdkDevice *device, GdkCursor *cursor); void (* get_geometry) (GdkWindow *window, gint *x, gint *y, gint *width, gint *height); void (* get_root_coords) (GdkWindow *window, gint x, gint y, gint *root_x, gint *root_y); gboolean (* get_device_state) (GdkWindow *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask); gboolean (* begin_paint) (GdkWindow *window); void (* end_paint) (GdkWindow *window); cairo_region_t * (* get_shape) (GdkWindow *window); cairo_region_t * (* get_input_shape) (GdkWindow *window); void (* shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); void (* input_shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); void (* queue_antiexpose) (GdkWindow *window, cairo_region_t *update_area); void (* destroy) (GdkWindow *window, gboolean recursing, gboolean foreign_destroy); void (* destroy_foreign) (GdkWindow *window); gboolean (* beep) (GdkWindow *window); void (* focus) (GdkWindow *window, guint32 timestamp); void (* set_type_hint) (GdkWindow *window, GdkWindowTypeHint hint); GdkWindowTypeHint (* get_type_hint) (GdkWindow *window); void (* set_modal_hint) (GdkWindow *window, gboolean modal); void (* set_skip_taskbar_hint) (GdkWindow *window, gboolean skips_taskbar); void (* set_skip_pager_hint) (GdkWindow *window, gboolean skips_pager); void (* set_urgency_hint) (GdkWindow *window, gboolean urgent); void (* set_geometry_hints) (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask); void (* set_title) (GdkWindow *window, const gchar *title); void (* set_role) (GdkWindow *window, const gchar *role); void (* set_startup_id) (GdkWindow *window, const gchar *startup_id); void (* set_transient_for) (GdkWindow *window, GdkWindow *parent); void (* get_frame_extents) (GdkWindow *window, GdkRectangle *rect); void (* set_override_redirect) (GdkWindow *window, gboolean override_redirect); void (* set_accept_focus) (GdkWindow *window, gboolean accept_focus); void (* set_focus_on_map) (GdkWindow *window, gboolean focus_on_map); void (* set_icon_list) (GdkWindow *window, GList *pixbufs); void (* set_icon_name) (GdkWindow *window, const gchar *name); void (* iconify) (GdkWindow *window); void (* deiconify) (GdkWindow *window); void (* stick) (GdkWindow *window); void (* unstick) (GdkWindow *window); void (* maximize) (GdkWindow *window); void (* unmaximize) (GdkWindow *window); void (* fullscreen) (GdkWindow *window); void (* fullscreen_on_monitor) (GdkWindow *window, gint monitor); void (* apply_fullscreen_mode) (GdkWindow *window); void (* unfullscreen) (GdkWindow *window); void (* set_keep_above) (GdkWindow *window, gboolean setting); void (* set_keep_below) (GdkWindow *window, gboolean setting); GdkWindow * (* get_group) (GdkWindow *window); void (* set_group) (GdkWindow *window, GdkWindow *leader); void (* set_decorations) (GdkWindow *window, GdkWMDecoration decorations); gboolean (* get_decorations) (GdkWindow *window, GdkWMDecoration *decorations); void (* set_functions) (GdkWindow *window, GdkWMFunction functions); void (* begin_resize_drag) (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); void (* begin_move_drag) (GdkWindow *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); void (* enable_synchronized_configure) (GdkWindow *window); void (* configure_finished) (GdkWindow *window); void (* set_opacity) (GdkWindow *window, gdouble opacity); void (* set_composited) (GdkWindow *window, gboolean composited); void (* destroy_notify) (GdkWindow *window); GdkDragProtocol (* get_drag_protocol) (GdkWindow *window, GdkWindow **target); void (* register_dnd) (GdkWindow *window); GdkDragContext * (* drag_begin) (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root); void (* process_updates_recurse) (GdkWindow *window, cairo_region_t *region); void (* sync_rendering) (GdkWindow *window); gboolean (* simulate_key) (GdkWindow *window, gint x, gint y, guint keyval, GdkModifierType modifiers, GdkEventType event_type); gboolean (* simulate_button) (GdkWindow *window, gint x, gint y, guint button, GdkModifierType modifiers, GdkEventType event_type); gboolean (* get_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gulong offset, gulong length, gint pdelete, GdkAtom *actual_type, gint *actual_format, gint *actual_length, guchar **data); void (* change_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gint format, GdkPropMode mode, const guchar *data, gint n_elements); void (* delete_property) (GdkWindow *window, GdkAtom property); gint (* get_scale_factor) (GdkWindow *window); void (* get_unscaled_size) (GdkWindow *window, int *unscaled_width, int *unscaled_height); void (* set_opaque_region) (GdkWindow *window, cairo_region_t *region); void (* set_shadow_width) (GdkWindow *window, gint left, gint right, gint top, gint bottom); gboolean (* show_window_menu) (GdkWindow *window, GdkEvent *event); GdkGLContext * (* create_gl_context) (GdkWindow *window, gboolean attached, GdkGLContext *share, GError **error); gboolean (* realize_gl_context) (GdkWindow *window, GdkGLContext *context, GError **error); void (* invalidate_for_new_frame) (GdkWindow *window, cairo_region_t *update_area); GdkDrawingContext * (* create_draw_context) (GdkWindow *window, const cairo_region_t *region); void (* destroy_draw_context) (GdkWindow *window, GdkDrawingContext *context); }; // Version ID 1 // Diff from previous version: // + gboolean (* titlebar_gesture) (GdkWindow *window, GdkTitlebarGesture gesture); // Valid for GTK v3.24.35 - v3.24.44 (unreleased) struct _GdkWindowImplClass_v3_24_35 { GObjectClass parent_class; cairo_surface_t * (* ref_cairo_surface) (GdkWindow *window); cairo_surface_t * (* create_similar_image_surface) (GdkWindow *window, cairo_format_t format, int width, int height); void (* show) (GdkWindow *window, gboolean already_mapped); void (* hide) (GdkWindow *window); void (* withdraw) (GdkWindow *window); void (* raise) (GdkWindow *window); void (* lower) (GdkWindow *window); void (* restack_under) (GdkWindow *window, GList *native_siblings); void (* restack_toplevel) (GdkWindow *window, GdkWindow *sibling, gboolean above); void (* move_resize) (GdkWindow *window, gboolean with_move, gint x, gint y, gint width, gint height); void (* move_to_rect) (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy); void (* set_background) (GdkWindow *window, cairo_pattern_t *pattern); GdkEventMask (* get_events) (GdkWindow *window); void (* set_events) (GdkWindow *window, GdkEventMask event_mask); gboolean (* reparent) (GdkWindow *window, GdkWindow *new_parent, gint x, gint y); void (* set_device_cursor) (GdkWindow *window, GdkDevice *device, GdkCursor *cursor); void (* get_geometry) (GdkWindow *window, gint *x, gint *y, gint *width, gint *height); void (* get_root_coords) (GdkWindow *window, gint x, gint y, gint *root_x, gint *root_y); gboolean (* get_device_state) (GdkWindow *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask); gboolean (* begin_paint) (GdkWindow *window); void (* end_paint) (GdkWindow *window); cairo_region_t * (* get_shape) (GdkWindow *window); cairo_region_t * (* get_input_shape) (GdkWindow *window); void (* shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); void (* input_shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y); void (* queue_antiexpose) (GdkWindow *window, cairo_region_t *update_area); void (* destroy) (GdkWindow *window, gboolean recursing, gboolean foreign_destroy); void (* destroy_foreign) (GdkWindow *window); gboolean (* beep) (GdkWindow *window); void (* focus) (GdkWindow *window, guint32 timestamp); void (* set_type_hint) (GdkWindow *window, GdkWindowTypeHint hint); GdkWindowTypeHint (* get_type_hint) (GdkWindow *window); void (* set_modal_hint) (GdkWindow *window, gboolean modal); void (* set_skip_taskbar_hint) (GdkWindow *window, gboolean skips_taskbar); void (* set_skip_pager_hint) (GdkWindow *window, gboolean skips_pager); void (* set_urgency_hint) (GdkWindow *window, gboolean urgent); void (* set_geometry_hints) (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask); void (* set_title) (GdkWindow *window, const gchar *title); void (* set_role) (GdkWindow *window, const gchar *role); void (* set_startup_id) (GdkWindow *window, const gchar *startup_id); void (* set_transient_for) (GdkWindow *window, GdkWindow *parent); void (* get_frame_extents) (GdkWindow *window, GdkRectangle *rect); void (* set_override_redirect) (GdkWindow *window, gboolean override_redirect); void (* set_accept_focus) (GdkWindow *window, gboolean accept_focus); void (* set_focus_on_map) (GdkWindow *window, gboolean focus_on_map); void (* set_icon_list) (GdkWindow *window, GList *pixbufs); void (* set_icon_name) (GdkWindow *window, const gchar *name); void (* iconify) (GdkWindow *window); void (* deiconify) (GdkWindow *window); void (* stick) (GdkWindow *window); void (* unstick) (GdkWindow *window); void (* maximize) (GdkWindow *window); void (* unmaximize) (GdkWindow *window); void (* fullscreen) (GdkWindow *window); void (* fullscreen_on_monitor) (GdkWindow *window, gint monitor); void (* apply_fullscreen_mode) (GdkWindow *window); void (* unfullscreen) (GdkWindow *window); void (* set_keep_above) (GdkWindow *window, gboolean setting); void (* set_keep_below) (GdkWindow *window, gboolean setting); GdkWindow * (* get_group) (GdkWindow *window); void (* set_group) (GdkWindow *window, GdkWindow *leader); void (* set_decorations) (GdkWindow *window, GdkWMDecoration decorations); gboolean (* get_decorations) (GdkWindow *window, GdkWMDecoration *decorations); void (* set_functions) (GdkWindow *window, GdkWMFunction functions); void (* begin_resize_drag) (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); void (* begin_move_drag) (GdkWindow *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp); void (* enable_synchronized_configure) (GdkWindow *window); void (* configure_finished) (GdkWindow *window); void (* set_opacity) (GdkWindow *window, gdouble opacity); void (* set_composited) (GdkWindow *window, gboolean composited); void (* destroy_notify) (GdkWindow *window); GdkDragProtocol (* get_drag_protocol) (GdkWindow *window, GdkWindow **target); void (* register_dnd) (GdkWindow *window); GdkDragContext * (* drag_begin) (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root); void (* process_updates_recurse) (GdkWindow *window, cairo_region_t *region); void (* sync_rendering) (GdkWindow *window); gboolean (* simulate_key) (GdkWindow *window, gint x, gint y, guint keyval, GdkModifierType modifiers, GdkEventType event_type); gboolean (* simulate_button) (GdkWindow *window, gint x, gint y, guint button, GdkModifierType modifiers, GdkEventType event_type); gboolean (* get_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gulong offset, gulong length, gint pdelete, GdkAtom *actual_type, gint *actual_format, gint *actual_length, guchar **data); void (* change_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gint format, GdkPropMode mode, const guchar *data, gint n_elements); void (* delete_property) (GdkWindow *window, GdkAtom property); gint (* get_scale_factor) (GdkWindow *window); void (* get_unscaled_size) (GdkWindow *window, int *unscaled_width, int *unscaled_height); void (* set_opaque_region) (GdkWindow *window, cairo_region_t *region); void (* set_shadow_width) (GdkWindow *window, gint left, gint right, gint top, gint bottom); gboolean (* show_window_menu) (GdkWindow *window, GdkEvent *event); GdkGLContext * (* create_gl_context) (GdkWindow *window, gboolean attached, GdkGLContext *share, GError **error); gboolean (* realize_gl_context) (GdkWindow *window, GdkGLContext *context, GError **error); void (* invalidate_for_new_frame) (GdkWindow *window, cairo_region_t *update_area); GdkDrawingContext * (* create_draw_context) (GdkWindow *window, const cairo_region_t *region); void (* destroy_draw_context) (GdkWindow *window, GdkDrawingContext *context); gboolean (* titlebar_gesture) (GdkWindow *window, GdkTitlebarGesture gesture); }; // For internal use only int gdk_window_impl_class_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } if (combo >= 24035) { version_id = 1; } else { version_id = 0; } } return version_id; } // GdkWindowImplClass::parent_class GObjectClass * gdk_window_impl_class_priv_get_parent_class_ptr(GdkWindowImplClass * self) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return (GObjectClass *)&((struct _GdkWindowImplClass_v3_22_0*)self)->parent_class; case 1: return (GObjectClass *)&((struct _GdkWindowImplClass_v3_24_35*)self)->parent_class; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::ref_cairo_surface cairo_surface_t * (* gdk_window_impl_class_priv_get_ref_cairo_surface(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->ref_cairo_surface; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->ref_cairo_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_ref_cairo_surface(GdkWindowImplClass * self, cairo_surface_t * (* ref_cairo_surface) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->ref_cairo_surface = ref_cairo_surface; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->ref_cairo_surface = ref_cairo_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::create_similar_image_surface cairo_surface_t * (* gdk_window_impl_class_priv_get_create_similar_image_surface(GdkWindowImplClass * self)) (GdkWindow *window, cairo_format_t format, int width, int height) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->create_similar_image_surface; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->create_similar_image_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_create_similar_image_surface(GdkWindowImplClass * self, cairo_surface_t * (* create_similar_image_surface) (GdkWindow *window, cairo_format_t format, int width, int height)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->create_similar_image_surface = create_similar_image_surface; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->create_similar_image_surface = create_similar_image_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::show void (* gdk_window_impl_class_priv_get_show(GdkWindowImplClass * self)) (GdkWindow *window, gboolean already_mapped) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->show; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->show; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_show(GdkWindowImplClass * self, void (* show) (GdkWindow *window, gboolean already_mapped)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->show = show; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->show = show; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::hide void (* gdk_window_impl_class_priv_get_hide(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->hide; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->hide; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_hide(GdkWindowImplClass * self, void (* hide) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->hide = hide; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->hide = hide; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::withdraw void (* gdk_window_impl_class_priv_get_withdraw(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->withdraw; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->withdraw; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_withdraw(GdkWindowImplClass * self, void (* withdraw) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->withdraw = withdraw; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->withdraw = withdraw; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::raise void (* gdk_window_impl_class_priv_get_raise(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->raise; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->raise; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_raise(GdkWindowImplClass * self, void (* raise) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->raise = raise; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->raise = raise; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::lower void (* gdk_window_impl_class_priv_get_lower(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->lower; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->lower; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_lower(GdkWindowImplClass * self, void (* lower) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->lower = lower; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->lower = lower; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::restack_under void (* gdk_window_impl_class_priv_get_restack_under(GdkWindowImplClass * self)) (GdkWindow *window, GList *native_siblings) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->restack_under; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->restack_under; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_restack_under(GdkWindowImplClass * self, void (* restack_under) (GdkWindow *window, GList *native_siblings)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->restack_under = restack_under; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->restack_under = restack_under; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::restack_toplevel void (* gdk_window_impl_class_priv_get_restack_toplevel(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindow *sibling, gboolean above) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->restack_toplevel; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->restack_toplevel; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_restack_toplevel(GdkWindowImplClass * self, void (* restack_toplevel) (GdkWindow *window, GdkWindow *sibling, gboolean above)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->restack_toplevel = restack_toplevel; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->restack_toplevel = restack_toplevel; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::move_resize void (* gdk_window_impl_class_priv_get_move_resize(GdkWindowImplClass * self)) (GdkWindow *window, gboolean with_move, gint x, gint y, gint width, gint height) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->move_resize; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->move_resize; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_move_resize(GdkWindowImplClass * self, void (* move_resize) (GdkWindow *window, gboolean with_move, gint x, gint y, gint width, gint height)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->move_resize = move_resize; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->move_resize = move_resize; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::move_to_rect void (* gdk_window_impl_class_priv_get_move_to_rect(GdkWindowImplClass * self)) (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->move_to_rect; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->move_to_rect; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_move_to_rect(GdkWindowImplClass * self, void (* move_to_rect) (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, gint rect_anchor_dx, gint rect_anchor_dy)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->move_to_rect = move_to_rect; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->move_to_rect = move_to_rect; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_background void (* gdk_window_impl_class_priv_get_set_background(GdkWindowImplClass * self)) (GdkWindow *window, cairo_pattern_t *pattern) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_background; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_background; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_background(GdkWindowImplClass * self, void (* set_background) (GdkWindow *window, cairo_pattern_t *pattern)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_background = set_background; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_background = set_background; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_events GdkEventMask (* gdk_window_impl_class_priv_get_get_events(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_events; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_events; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_events(GdkWindowImplClass * self, GdkEventMask (* get_events) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_events = get_events; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_events = get_events; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_events void (* gdk_window_impl_class_priv_get_set_events(GdkWindowImplClass * self)) (GdkWindow *window, GdkEventMask event_mask) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_events; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_events; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_events(GdkWindowImplClass * self, void (* set_events) (GdkWindow *window, GdkEventMask event_mask)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_events = set_events; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_events = set_events; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::reparent gboolean (* gdk_window_impl_class_priv_get_reparent(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindow *new_parent, gint x, gint y) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->reparent; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->reparent; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_reparent(GdkWindowImplClass * self, gboolean (* reparent) (GdkWindow *window, GdkWindow *new_parent, gint x, gint y)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->reparent = reparent; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->reparent = reparent; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_device_cursor void (* gdk_window_impl_class_priv_get_set_device_cursor(GdkWindowImplClass * self)) (GdkWindow *window, GdkDevice *device, GdkCursor *cursor) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_device_cursor; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_device_cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_device_cursor(GdkWindowImplClass * self, void (* set_device_cursor) (GdkWindow *window, GdkDevice *device, GdkCursor *cursor)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_device_cursor = set_device_cursor; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_device_cursor = set_device_cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_geometry void (* gdk_window_impl_class_priv_get_get_geometry(GdkWindowImplClass * self)) (GdkWindow *window, gint *x, gint *y, gint *width, gint *height) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_geometry; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_geometry; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_geometry(GdkWindowImplClass * self, void (* get_geometry) (GdkWindow *window, gint *x, gint *y, gint *width, gint *height)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_geometry = get_geometry; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_geometry = get_geometry; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_root_coords void (* gdk_window_impl_class_priv_get_get_root_coords(GdkWindowImplClass * self)) (GdkWindow *window, gint x, gint y, gint *root_x, gint *root_y) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_root_coords; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_root_coords; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_root_coords(GdkWindowImplClass * self, void (* get_root_coords) (GdkWindow *window, gint x, gint y, gint *root_x, gint *root_y)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_root_coords = get_root_coords; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_root_coords = get_root_coords; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_device_state gboolean (* gdk_window_impl_class_priv_get_get_device_state(GdkWindowImplClass * self)) (GdkWindow *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_device_state; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_device_state; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_device_state(GdkWindowImplClass * self, gboolean (* get_device_state) (GdkWindow *window, GdkDevice *device, gdouble *x, gdouble *y, GdkModifierType *mask)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_device_state = get_device_state; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_device_state = get_device_state; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::begin_paint gboolean (* gdk_window_impl_class_priv_get_begin_paint(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_paint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_paint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_begin_paint(GdkWindowImplClass * self, gboolean (* begin_paint) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_paint = begin_paint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_paint = begin_paint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::end_paint void (* gdk_window_impl_class_priv_get_end_paint(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->end_paint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->end_paint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_end_paint(GdkWindowImplClass * self, void (* end_paint) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->end_paint = end_paint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->end_paint = end_paint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_shape cairo_region_t * (* gdk_window_impl_class_priv_get_get_shape(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_shape; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_shape; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_shape(GdkWindowImplClass * self, cairo_region_t * (* get_shape) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_shape = get_shape; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_shape = get_shape; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_input_shape cairo_region_t * (* gdk_window_impl_class_priv_get_get_input_shape(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_input_shape; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_input_shape; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_input_shape(GdkWindowImplClass * self, cairo_region_t * (* get_input_shape) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_input_shape = get_input_shape; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_input_shape = get_input_shape; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::shape_combine_region void (* gdk_window_impl_class_priv_get_shape_combine_region(GdkWindowImplClass * self)) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->shape_combine_region; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->shape_combine_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_shape_combine_region(GdkWindowImplClass * self, void (* shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->shape_combine_region = shape_combine_region; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->shape_combine_region = shape_combine_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::input_shape_combine_region void (* gdk_window_impl_class_priv_get_input_shape_combine_region(GdkWindowImplClass * self)) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->input_shape_combine_region; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->input_shape_combine_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_input_shape_combine_region(GdkWindowImplClass * self, void (* input_shape_combine_region) (GdkWindow *window, const cairo_region_t *shape_region, gint offset_x, gint offset_y)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->input_shape_combine_region = input_shape_combine_region; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->input_shape_combine_region = input_shape_combine_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::queue_antiexpose void (* gdk_window_impl_class_priv_get_queue_antiexpose(GdkWindowImplClass * self)) (GdkWindow *window, cairo_region_t *update_area) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->queue_antiexpose; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->queue_antiexpose; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_queue_antiexpose(GdkWindowImplClass * self, void (* queue_antiexpose) (GdkWindow *window, cairo_region_t *update_area)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->queue_antiexpose = queue_antiexpose; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->queue_antiexpose = queue_antiexpose; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::destroy void (* gdk_window_impl_class_priv_get_destroy(GdkWindowImplClass * self)) (GdkWindow *window, gboolean recursing, gboolean foreign_destroy) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_destroy(GdkWindowImplClass * self, void (* destroy) (GdkWindow *window, gboolean recursing, gboolean foreign_destroy)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy = destroy; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy = destroy; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::destroy_foreign void (* gdk_window_impl_class_priv_get_destroy_foreign(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_foreign; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_foreign; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_destroy_foreign(GdkWindowImplClass * self, void (* destroy_foreign) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_foreign = destroy_foreign; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_foreign = destroy_foreign; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::beep gboolean (* gdk_window_impl_class_priv_get_beep(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->beep; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->beep; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_beep(GdkWindowImplClass * self, gboolean (* beep) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->beep = beep; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->beep = beep; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::focus void (* gdk_window_impl_class_priv_get_focus(GdkWindowImplClass * self)) (GdkWindow *window, guint32 timestamp) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->focus; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->focus; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_focus(GdkWindowImplClass * self, void (* focus) (GdkWindow *window, guint32 timestamp)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->focus = focus; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->focus = focus; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_type_hint void (* gdk_window_impl_class_priv_get_set_type_hint(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindowTypeHint hint) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_type_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_type_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_type_hint(GdkWindowImplClass * self, void (* set_type_hint) (GdkWindow *window, GdkWindowTypeHint hint)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_type_hint = set_type_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_type_hint = set_type_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_type_hint GdkWindowTypeHint (* gdk_window_impl_class_priv_get_get_type_hint(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_type_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_type_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_type_hint(GdkWindowImplClass * self, GdkWindowTypeHint (* get_type_hint) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_type_hint = get_type_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_type_hint = get_type_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_modal_hint void (* gdk_window_impl_class_priv_get_set_modal_hint(GdkWindowImplClass * self)) (GdkWindow *window, gboolean modal) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_modal_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_modal_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_modal_hint(GdkWindowImplClass * self, void (* set_modal_hint) (GdkWindow *window, gboolean modal)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_modal_hint = set_modal_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_modal_hint = set_modal_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_skip_taskbar_hint void (* gdk_window_impl_class_priv_get_set_skip_taskbar_hint(GdkWindowImplClass * self)) (GdkWindow *window, gboolean skips_taskbar) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_skip_taskbar_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_skip_taskbar_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_skip_taskbar_hint(GdkWindowImplClass * self, void (* set_skip_taskbar_hint) (GdkWindow *window, gboolean skips_taskbar)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_skip_taskbar_hint = set_skip_taskbar_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_skip_taskbar_hint = set_skip_taskbar_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_skip_pager_hint void (* gdk_window_impl_class_priv_get_set_skip_pager_hint(GdkWindowImplClass * self)) (GdkWindow *window, gboolean skips_pager) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_skip_pager_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_skip_pager_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_skip_pager_hint(GdkWindowImplClass * self, void (* set_skip_pager_hint) (GdkWindow *window, gboolean skips_pager)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_skip_pager_hint = set_skip_pager_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_skip_pager_hint = set_skip_pager_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_urgency_hint void (* gdk_window_impl_class_priv_get_set_urgency_hint(GdkWindowImplClass * self)) (GdkWindow *window, gboolean urgent) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_urgency_hint; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_urgency_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_urgency_hint(GdkWindowImplClass * self, void (* set_urgency_hint) (GdkWindow *window, gboolean urgent)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_urgency_hint = set_urgency_hint; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_urgency_hint = set_urgency_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_geometry_hints void (* gdk_window_impl_class_priv_get_set_geometry_hints(GdkWindowImplClass * self)) (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_geometry_hints; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_geometry_hints; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_geometry_hints(GdkWindowImplClass * self, void (* set_geometry_hints) (GdkWindow *window, const GdkGeometry *geometry, GdkWindowHints geom_mask)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_geometry_hints = set_geometry_hints; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_geometry_hints = set_geometry_hints; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_title void (* gdk_window_impl_class_priv_get_set_title(GdkWindowImplClass * self)) (GdkWindow *window, const gchar *title) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_title; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_title; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_title(GdkWindowImplClass * self, void (* set_title) (GdkWindow *window, const gchar *title)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_title = set_title; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_title = set_title; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_role void (* gdk_window_impl_class_priv_get_set_role(GdkWindowImplClass * self)) (GdkWindow *window, const gchar *role) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_role; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_role; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_role(GdkWindowImplClass * self, void (* set_role) (GdkWindow *window, const gchar *role)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_role = set_role; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_role = set_role; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_startup_id void (* gdk_window_impl_class_priv_get_set_startup_id(GdkWindowImplClass * self)) (GdkWindow *window, const gchar *startup_id) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_startup_id; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_startup_id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_startup_id(GdkWindowImplClass * self, void (* set_startup_id) (GdkWindow *window, const gchar *startup_id)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_startup_id = set_startup_id; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_startup_id = set_startup_id; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_transient_for void (* gdk_window_impl_class_priv_get_set_transient_for(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindow *parent) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_transient_for; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_transient_for; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_transient_for(GdkWindowImplClass * self, void (* set_transient_for) (GdkWindow *window, GdkWindow *parent)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_transient_for = set_transient_for; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_transient_for = set_transient_for; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_frame_extents void (* gdk_window_impl_class_priv_get_get_frame_extents(GdkWindowImplClass * self)) (GdkWindow *window, GdkRectangle *rect) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_frame_extents; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_frame_extents; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_frame_extents(GdkWindowImplClass * self, void (* get_frame_extents) (GdkWindow *window, GdkRectangle *rect)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_frame_extents = get_frame_extents; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_frame_extents = get_frame_extents; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_override_redirect void (* gdk_window_impl_class_priv_get_set_override_redirect(GdkWindowImplClass * self)) (GdkWindow *window, gboolean override_redirect) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_override_redirect; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_override_redirect; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_override_redirect(GdkWindowImplClass * self, void (* set_override_redirect) (GdkWindow *window, gboolean override_redirect)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_override_redirect = set_override_redirect; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_override_redirect = set_override_redirect; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_accept_focus void (* gdk_window_impl_class_priv_get_set_accept_focus(GdkWindowImplClass * self)) (GdkWindow *window, gboolean accept_focus) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_accept_focus; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_accept_focus; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_accept_focus(GdkWindowImplClass * self, void (* set_accept_focus) (GdkWindow *window, gboolean accept_focus)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_accept_focus = set_accept_focus; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_accept_focus = set_accept_focus; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_focus_on_map void (* gdk_window_impl_class_priv_get_set_focus_on_map(GdkWindowImplClass * self)) (GdkWindow *window, gboolean focus_on_map) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_focus_on_map; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_focus_on_map; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_focus_on_map(GdkWindowImplClass * self, void (* set_focus_on_map) (GdkWindow *window, gboolean focus_on_map)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_focus_on_map = set_focus_on_map; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_focus_on_map = set_focus_on_map; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_icon_list void (* gdk_window_impl_class_priv_get_set_icon_list(GdkWindowImplClass * self)) (GdkWindow *window, GList *pixbufs) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_icon_list; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_icon_list; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_icon_list(GdkWindowImplClass * self, void (* set_icon_list) (GdkWindow *window, GList *pixbufs)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_icon_list = set_icon_list; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_icon_list = set_icon_list; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_icon_name void (* gdk_window_impl_class_priv_get_set_icon_name(GdkWindowImplClass * self)) (GdkWindow *window, const gchar *name) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_icon_name; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_icon_name; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_icon_name(GdkWindowImplClass * self, void (* set_icon_name) (GdkWindow *window, const gchar *name)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_icon_name = set_icon_name; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_icon_name = set_icon_name; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::iconify void (* gdk_window_impl_class_priv_get_iconify(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->iconify; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->iconify; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_iconify(GdkWindowImplClass * self, void (* iconify) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->iconify = iconify; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->iconify = iconify; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::deiconify void (* gdk_window_impl_class_priv_get_deiconify(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->deiconify; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->deiconify; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_deiconify(GdkWindowImplClass * self, void (* deiconify) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->deiconify = deiconify; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->deiconify = deiconify; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::stick void (* gdk_window_impl_class_priv_get_stick(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->stick; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->stick; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_stick(GdkWindowImplClass * self, void (* stick) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->stick = stick; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->stick = stick; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::unstick void (* gdk_window_impl_class_priv_get_unstick(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->unstick; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->unstick; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_unstick(GdkWindowImplClass * self, void (* unstick) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->unstick = unstick; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->unstick = unstick; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::maximize void (* gdk_window_impl_class_priv_get_maximize(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->maximize; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->maximize; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_maximize(GdkWindowImplClass * self, void (* maximize) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->maximize = maximize; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->maximize = maximize; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::unmaximize void (* gdk_window_impl_class_priv_get_unmaximize(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->unmaximize; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->unmaximize; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_unmaximize(GdkWindowImplClass * self, void (* unmaximize) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->unmaximize = unmaximize; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->unmaximize = unmaximize; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::fullscreen void (* gdk_window_impl_class_priv_get_fullscreen(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->fullscreen; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->fullscreen; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_fullscreen(GdkWindowImplClass * self, void (* fullscreen) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->fullscreen = fullscreen; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->fullscreen = fullscreen; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::fullscreen_on_monitor void (* gdk_window_impl_class_priv_get_fullscreen_on_monitor(GdkWindowImplClass * self)) (GdkWindow *window, gint monitor) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->fullscreen_on_monitor; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->fullscreen_on_monitor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_fullscreen_on_monitor(GdkWindowImplClass * self, void (* fullscreen_on_monitor) (GdkWindow *window, gint monitor)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->fullscreen_on_monitor = fullscreen_on_monitor; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->fullscreen_on_monitor = fullscreen_on_monitor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::apply_fullscreen_mode void (* gdk_window_impl_class_priv_get_apply_fullscreen_mode(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->apply_fullscreen_mode; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->apply_fullscreen_mode; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_apply_fullscreen_mode(GdkWindowImplClass * self, void (* apply_fullscreen_mode) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->apply_fullscreen_mode = apply_fullscreen_mode; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->apply_fullscreen_mode = apply_fullscreen_mode; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::unfullscreen void (* gdk_window_impl_class_priv_get_unfullscreen(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->unfullscreen; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->unfullscreen; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_unfullscreen(GdkWindowImplClass * self, void (* unfullscreen) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->unfullscreen = unfullscreen; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->unfullscreen = unfullscreen; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_keep_above void (* gdk_window_impl_class_priv_get_set_keep_above(GdkWindowImplClass * self)) (GdkWindow *window, gboolean setting) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_keep_above; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_keep_above; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_keep_above(GdkWindowImplClass * self, void (* set_keep_above) (GdkWindow *window, gboolean setting)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_keep_above = set_keep_above; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_keep_above = set_keep_above; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_keep_below void (* gdk_window_impl_class_priv_get_set_keep_below(GdkWindowImplClass * self)) (GdkWindow *window, gboolean setting) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_keep_below; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_keep_below; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_keep_below(GdkWindowImplClass * self, void (* set_keep_below) (GdkWindow *window, gboolean setting)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_keep_below = set_keep_below; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_keep_below = set_keep_below; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_group GdkWindow * (* gdk_window_impl_class_priv_get_get_group(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_group; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_group; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_group(GdkWindowImplClass * self, GdkWindow * (* get_group) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_group = get_group; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_group = get_group; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_group void (* gdk_window_impl_class_priv_get_set_group(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindow *leader) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_group; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_group; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_group(GdkWindowImplClass * self, void (* set_group) (GdkWindow *window, GdkWindow *leader)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_group = set_group; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_group = set_group; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_decorations void (* gdk_window_impl_class_priv_get_set_decorations(GdkWindowImplClass * self)) (GdkWindow *window, GdkWMDecoration decorations) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_decorations; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_decorations; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_decorations(GdkWindowImplClass * self, void (* set_decorations) (GdkWindow *window, GdkWMDecoration decorations)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_decorations = set_decorations; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_decorations = set_decorations; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_decorations gboolean (* gdk_window_impl_class_priv_get_get_decorations(GdkWindowImplClass * self)) (GdkWindow *window, GdkWMDecoration *decorations) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_decorations; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_decorations; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_decorations(GdkWindowImplClass * self, gboolean (* get_decorations) (GdkWindow *window, GdkWMDecoration *decorations)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_decorations = get_decorations; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_decorations = get_decorations; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_functions void (* gdk_window_impl_class_priv_get_set_functions(GdkWindowImplClass * self)) (GdkWindow *window, GdkWMFunction functions) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_functions; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_functions; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_functions(GdkWindowImplClass * self, void (* set_functions) (GdkWindow *window, GdkWMFunction functions)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_functions = set_functions; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_functions = set_functions; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::begin_resize_drag void (* gdk_window_impl_class_priv_get_begin_resize_drag(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_resize_drag; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_resize_drag; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_begin_resize_drag(GdkWindowImplClass * self, void (* begin_resize_drag) (GdkWindow *window, GdkWindowEdge edge, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_resize_drag = begin_resize_drag; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_resize_drag = begin_resize_drag; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::begin_move_drag void (* gdk_window_impl_class_priv_get_begin_move_drag(GdkWindowImplClass * self)) (GdkWindow *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_move_drag; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_move_drag; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_begin_move_drag(GdkWindowImplClass * self, void (* begin_move_drag) (GdkWindow *window, GdkDevice *device, gint button, gint root_x, gint root_y, guint32 timestamp)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->begin_move_drag = begin_move_drag; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->begin_move_drag = begin_move_drag; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::enable_synchronized_configure void (* gdk_window_impl_class_priv_get_enable_synchronized_configure(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->enable_synchronized_configure; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->enable_synchronized_configure; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_enable_synchronized_configure(GdkWindowImplClass * self, void (* enable_synchronized_configure) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->enable_synchronized_configure = enable_synchronized_configure; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->enable_synchronized_configure = enable_synchronized_configure; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::configure_finished void (* gdk_window_impl_class_priv_get_configure_finished(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->configure_finished; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->configure_finished; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_configure_finished(GdkWindowImplClass * self, void (* configure_finished) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->configure_finished = configure_finished; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->configure_finished = configure_finished; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_opacity void (* gdk_window_impl_class_priv_get_set_opacity(GdkWindowImplClass * self)) (GdkWindow *window, gdouble opacity) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_opacity; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_opacity; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_opacity(GdkWindowImplClass * self, void (* set_opacity) (GdkWindow *window, gdouble opacity)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_opacity = set_opacity; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_opacity = set_opacity; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_composited void (* gdk_window_impl_class_priv_get_set_composited(GdkWindowImplClass * self)) (GdkWindow *window, gboolean composited) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_composited; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_composited; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_composited(GdkWindowImplClass * self, void (* set_composited) (GdkWindow *window, gboolean composited)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_composited = set_composited; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_composited = set_composited; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::destroy_notify void (* gdk_window_impl_class_priv_get_destroy_notify(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_notify; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_notify; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_destroy_notify(GdkWindowImplClass * self, void (* destroy_notify) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_notify = destroy_notify; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_notify = destroy_notify; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_drag_protocol GdkDragProtocol (* gdk_window_impl_class_priv_get_get_drag_protocol(GdkWindowImplClass * self)) (GdkWindow *window, GdkWindow **target) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_drag_protocol; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_drag_protocol; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_drag_protocol(GdkWindowImplClass * self, GdkDragProtocol (* get_drag_protocol) (GdkWindow *window, GdkWindow **target)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_drag_protocol = get_drag_protocol; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_drag_protocol = get_drag_protocol; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::register_dnd void (* gdk_window_impl_class_priv_get_register_dnd(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->register_dnd; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->register_dnd; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_register_dnd(GdkWindowImplClass * self, void (* register_dnd) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->register_dnd = register_dnd; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->register_dnd = register_dnd; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::drag_begin GdkDragContext * (* gdk_window_impl_class_priv_get_drag_begin(GdkWindowImplClass * self)) (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->drag_begin; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->drag_begin; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_drag_begin(GdkWindowImplClass * self, GdkDragContext * (* drag_begin) (GdkWindow *window, GdkDevice *device, GList *targets, gint x_root, gint y_root)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->drag_begin = drag_begin; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->drag_begin = drag_begin; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::process_updates_recurse void (* gdk_window_impl_class_priv_get_process_updates_recurse(GdkWindowImplClass * self)) (GdkWindow *window, cairo_region_t *region) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->process_updates_recurse; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->process_updates_recurse; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_process_updates_recurse(GdkWindowImplClass * self, void (* process_updates_recurse) (GdkWindow *window, cairo_region_t *region)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->process_updates_recurse = process_updates_recurse; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->process_updates_recurse = process_updates_recurse; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::sync_rendering void (* gdk_window_impl_class_priv_get_sync_rendering(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->sync_rendering; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->sync_rendering; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_sync_rendering(GdkWindowImplClass * self, void (* sync_rendering) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->sync_rendering = sync_rendering; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->sync_rendering = sync_rendering; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::simulate_key gboolean (* gdk_window_impl_class_priv_get_simulate_key(GdkWindowImplClass * self)) (GdkWindow *window, gint x, gint y, guint keyval, GdkModifierType modifiers, GdkEventType event_type) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->simulate_key; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->simulate_key; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_simulate_key(GdkWindowImplClass * self, gboolean (* simulate_key) (GdkWindow *window, gint x, gint y, guint keyval, GdkModifierType modifiers, GdkEventType event_type)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->simulate_key = simulate_key; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->simulate_key = simulate_key; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::simulate_button gboolean (* gdk_window_impl_class_priv_get_simulate_button(GdkWindowImplClass * self)) (GdkWindow *window, gint x, gint y, guint button, GdkModifierType modifiers, GdkEventType event_type) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->simulate_button; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->simulate_button; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_simulate_button(GdkWindowImplClass * self, gboolean (* simulate_button) (GdkWindow *window, gint x, gint y, guint button, GdkModifierType modifiers, GdkEventType event_type)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->simulate_button = simulate_button; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->simulate_button = simulate_button; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_property gboolean (* gdk_window_impl_class_priv_get_get_property(GdkWindowImplClass * self)) (GdkWindow *window, GdkAtom property, GdkAtom type, gulong offset, gulong length, gint pdelete, GdkAtom *actual_type, gint *actual_format, gint *actual_length, guchar **data) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_property; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_property; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_property(GdkWindowImplClass * self, gboolean (* get_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gulong offset, gulong length, gint pdelete, GdkAtom *actual_type, gint *actual_format, gint *actual_length, guchar **data)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_property = get_property; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_property = get_property; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::change_property void (* gdk_window_impl_class_priv_get_change_property(GdkWindowImplClass * self)) (GdkWindow *window, GdkAtom property, GdkAtom type, gint format, GdkPropMode mode, const guchar *data, gint n_elements) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->change_property; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->change_property; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_change_property(GdkWindowImplClass * self, void (* change_property) (GdkWindow *window, GdkAtom property, GdkAtom type, gint format, GdkPropMode mode, const guchar *data, gint n_elements)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->change_property = change_property; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->change_property = change_property; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::delete_property void (* gdk_window_impl_class_priv_get_delete_property(GdkWindowImplClass * self)) (GdkWindow *window, GdkAtom property) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->delete_property; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->delete_property; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_delete_property(GdkWindowImplClass * self, void (* delete_property) (GdkWindow *window, GdkAtom property)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->delete_property = delete_property; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->delete_property = delete_property; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_scale_factor gint (* gdk_window_impl_class_priv_get_get_scale_factor(GdkWindowImplClass * self)) (GdkWindow *window) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_scale_factor; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_scale_factor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_scale_factor(GdkWindowImplClass * self, gint (* get_scale_factor) (GdkWindow *window)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_scale_factor = get_scale_factor; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_scale_factor = get_scale_factor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::get_unscaled_size void (* gdk_window_impl_class_priv_get_get_unscaled_size(GdkWindowImplClass * self)) (GdkWindow *window, int *unscaled_width, int *unscaled_height) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->get_unscaled_size; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->get_unscaled_size; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_get_unscaled_size(GdkWindowImplClass * self, void (* get_unscaled_size) (GdkWindow *window, int *unscaled_width, int *unscaled_height)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->get_unscaled_size = get_unscaled_size; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->get_unscaled_size = get_unscaled_size; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_opaque_region void (* gdk_window_impl_class_priv_get_set_opaque_region(GdkWindowImplClass * self)) (GdkWindow *window, cairo_region_t *region) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_opaque_region; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_opaque_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_opaque_region(GdkWindowImplClass * self, void (* set_opaque_region) (GdkWindow *window, cairo_region_t *region)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_opaque_region = set_opaque_region; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_opaque_region = set_opaque_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::set_shadow_width void (* gdk_window_impl_class_priv_get_set_shadow_width(GdkWindowImplClass * self)) (GdkWindow *window, gint left, gint right, gint top, gint bottom) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->set_shadow_width; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->set_shadow_width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_set_shadow_width(GdkWindowImplClass * self, void (* set_shadow_width) (GdkWindow *window, gint left, gint right, gint top, gint bottom)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->set_shadow_width = set_shadow_width; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->set_shadow_width = set_shadow_width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::show_window_menu gboolean (* gdk_window_impl_class_priv_get_show_window_menu(GdkWindowImplClass * self)) (GdkWindow *window, GdkEvent *event) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->show_window_menu; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->show_window_menu; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_show_window_menu(GdkWindowImplClass * self, gboolean (* show_window_menu) (GdkWindow *window, GdkEvent *event)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->show_window_menu = show_window_menu; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->show_window_menu = show_window_menu; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::create_gl_context GdkGLContext * (* gdk_window_impl_class_priv_get_create_gl_context(GdkWindowImplClass * self)) (GdkWindow *window, gboolean attached, GdkGLContext *share, GError **error) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->create_gl_context; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->create_gl_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_create_gl_context(GdkWindowImplClass * self, GdkGLContext * (* create_gl_context) (GdkWindow *window, gboolean attached, GdkGLContext *share, GError **error)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->create_gl_context = create_gl_context; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->create_gl_context = create_gl_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::realize_gl_context gboolean (* gdk_window_impl_class_priv_get_realize_gl_context(GdkWindowImplClass * self)) (GdkWindow *window, GdkGLContext *context, GError **error) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->realize_gl_context; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->realize_gl_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_realize_gl_context(GdkWindowImplClass * self, gboolean (* realize_gl_context) (GdkWindow *window, GdkGLContext *context, GError **error)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->realize_gl_context = realize_gl_context; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->realize_gl_context = realize_gl_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::invalidate_for_new_frame void (* gdk_window_impl_class_priv_get_invalidate_for_new_frame(GdkWindowImplClass * self)) (GdkWindow *window, cairo_region_t *update_area) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->invalidate_for_new_frame; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->invalidate_for_new_frame; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_invalidate_for_new_frame(GdkWindowImplClass * self, void (* invalidate_for_new_frame) (GdkWindow *window, cairo_region_t *update_area)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->invalidate_for_new_frame = invalidate_for_new_frame; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->invalidate_for_new_frame = invalidate_for_new_frame; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::create_draw_context GdkDrawingContext * (* gdk_window_impl_class_priv_get_create_draw_context(GdkWindowImplClass * self)) (GdkWindow *window, const cairo_region_t *region) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->create_draw_context; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->create_draw_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_create_draw_context(GdkWindowImplClass * self, GdkDrawingContext * (* create_draw_context) (GdkWindow *window, const cairo_region_t *region)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->create_draw_context = create_draw_context; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->create_draw_context = create_draw_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::destroy_draw_context void (* gdk_window_impl_class_priv_get_destroy_draw_context(GdkWindowImplClass * self)) (GdkWindow *window, GdkDrawingContext *context) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_draw_context; case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_draw_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_destroy_draw_context(GdkWindowImplClass * self, void (* destroy_draw_context) (GdkWindow *window, GdkDrawingContext *context)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: ((struct _GdkWindowImplClass_v3_22_0*)self)->destroy_draw_context = destroy_draw_context; break; case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->destroy_draw_context = destroy_draw_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplClass::titlebar_gesture gboolean gdk_window_impl_class_priv_get_titlebar_gesture_supported() { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } gboolean (* gdk_window_impl_class_priv_get_titlebar_gesture_or_abort(GdkWindowImplClass * self)) (GdkWindow *window, GdkTitlebarGesture gesture) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: g_error("GdkWindowImplClass::titlebar_gesture not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindowImplClass_v3_24_35*)self)->titlebar_gesture; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_class_priv_set_titlebar_gesture_or_abort(GdkWindowImplClass * self, gboolean (* titlebar_gesture) (GdkWindow *window, GdkTitlebarGesture gesture)) { switch (gdk_window_impl_class_priv_get_version_id()) { case 0: g_error("GdkWindowImplClass::titlebar_gesture not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindowImplClass_v3_24_35*)self)->titlebar_gesture = titlebar_gesture; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WINDOW_IMPL_CLASS_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_window_impl_priv.h000066400000000000000000000065201466775474600231410ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WINDOW_IMPL_PRIV_H #define GDK_WINDOW_IMPL_PRIV_H #include "common.h" typedef struct _GdkWindowImpl GdkWindowImpl; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.44 (unreleased) struct _GdkWindowImpl_v3_22_0 { GObject parent; }; // For internal use only int gdk_window_impl_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } { version_id = 0; } } return version_id; } // GdkWindowImpl::parent GObject * gdk_window_impl_priv_get_parent_ptr(GdkWindowImpl * self) { switch (gdk_window_impl_priv_get_version_id()) { case 0: return (GObject *)&((struct _GdkWindowImpl_v3_22_0*)self)->parent; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WINDOW_IMPL_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_window_impl_wayland_class_priv.h000066400000000000000000000077361466775474600260570ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright © 2010 Intel Corporation * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WINDOW_IMPL_WAYLAND_CLASS_PRIV_H #define GDK_WINDOW_IMPL_WAYLAND_CLASS_PRIV_H #include "common.h" typedef struct _GdkWindowImplWaylandClass GdkWindowImplWaylandClass; // Version ID 0 // Valid for GTK v3.22.0 - v3.24.34 struct _GdkWindowImplWaylandClass_v3_22_0 { struct _GdkWindowImplClass_v3_22_0 parent_class; }; // Version ID 1 // Diff from previous version: // - struct _GdkWindowImplClass_v3_22_0 parent_class; // + struct _GdkWindowImplClass_v3_24_35 parent_class; // Valid for GTK v3.24.35 - v3.24.44 (unreleased) struct _GdkWindowImplWaylandClass_v3_24_35 { struct _GdkWindowImplClass_v3_24_35 parent_class; }; // For internal use only int gdk_window_impl_wayland_class_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } if (combo >= 24035) { version_id = 1; } else { version_id = 0; } } return version_id; } // GdkWindowImplWaylandClass::parent_class GdkWindowImplClass * gdk_window_impl_wayland_class_priv_get_parent_class_ptr(GdkWindowImplWaylandClass * self) { switch (gdk_window_impl_wayland_class_priv_get_version_id()) { case 0: return (GdkWindowImplClass *)&((struct _GdkWindowImplWaylandClass_v3_22_0*)self)->parent_class; case 1: return (GdkWindowImplClass *)&((struct _GdkWindowImplWaylandClass_v3_24_35*)self)->parent_class; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WINDOW_IMPL_WAYLAND_CLASS_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_window_impl_wayland_priv.h000066400000000000000000012050241466775474600246610ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright © 2010 Intel Corporation * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WINDOW_IMPL_WAYLAND_PRIV_H #define GDK_WINDOW_IMPL_WAYLAND_PRIV_H #include "common.h" typedef struct _GdkWindowImplWayland GdkWindowImplWayland; // Version ID 0 // Valid for GTK v3.22.0 - v3.22.15 struct _GdkWindowImplWayland_v3_22_0 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct zxdg_surface_v6 *xdg_surface; struct zxdg_toplevel_v6 *xdg_toplevel; struct zxdg_popup_v6 *xdg_popup; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { GdkWaylandWindowExported callback; gpointer user_data; GDestroyNotify destroy_func; } exported; struct zxdg_imported_v1 *imported_transient_for; }; // Version ID 1 // Diff from previous version: // - GdkWaylandWindowExported callback; // - gpointer user_data; // - GDestroyNotify destroy_func; // + char *handle; // + int export_count; // + GList *closures; // + guint idle_source_id; // Valid for GTK v3.22.16 - v3.22.17 struct _GdkWindowImplWayland_v3_22_16 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct zxdg_surface_v6 *xdg_surface; struct zxdg_toplevel_v6 *xdg_toplevel; struct zxdg_popup_v6 *xdg_popup; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; }; // Version ID 2 // Diff from previous version: // + GHashTable *shortcuts_inhibitors; // Valid for GTK v3.22.18 - v3.22.24 struct _GdkWindowImplWayland_v3_22_18 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct zxdg_surface_v6 *xdg_surface; struct zxdg_toplevel_v6 *xdg_toplevel; struct zxdg_popup_v6 *xdg_popup; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 3 // Diff from previous version: // + struct org_kde_kwin_server_decoration *server_decoration; // Valid for GTK v3.22.25 - v3.22.29 struct _GdkWindowImplWayland_v3_22_25 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct zxdg_surface_v6 *xdg_surface; struct zxdg_toplevel_v6 *xdg_toplevel; struct zxdg_popup_v6 *xdg_popup; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 4 // Diff from previous version: // - struct zxdg_surface_v6 *xdg_surface; // - struct zxdg_toplevel_v6 *xdg_toplevel; // - struct zxdg_popup_v6 *xdg_popup; // + struct xdg_surface *xdg_surface; // + struct xdg_toplevel *xdg_toplevel; // + struct xdg_popup *xdg_popup; // + struct zxdg_surface_v6 *zxdg_surface_v6; // + struct zxdg_toplevel_v6 *zxdg_toplevel_v6; // + struct zxdg_popup_v6 *zxdg_popup_v6; // Valid for GTK v3.22.30 - v3.23.0 struct _GdkWindowImplWayland_v3_22_30 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 5 // Diff from previous version: // + unsigned int using_csd : 1; // Valid for GTK v3.23.1 - v3.23.2 struct _GdkWindowImplWayland_v3_23_1 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 6 // Diff from previous version: // + int subsurface_x; // + int subsurface_y; // Valid for GTK v3.23.3 - v3.24.3 struct _GdkWindowImplWayland_v3_23_3 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 7 // Diff from previous version: // + unsigned int configuring_popup : 1; // Valid for GTK v3.24.4 - v3.24.16 struct _GdkWindowImplWayland_v3_24_4 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 8 // Diff from previous version: // + int unconfigured_width; // + int unconfigured_height; // + int fixed_size_width; // + int fixed_size_height; // Valid for GTK v3.24.17 - v3.24.21 struct _GdkWindowImplWayland_v3_24_17 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; int unconfigured_width; int unconfigured_height; int fixed_size_width; int fixed_size_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 9 // Diff from previous version: // + gboolean saved_size_changed; // Valid for GTK v3.24.22 - v3.24.24 struct _GdkWindowImplWayland_v3_24_22 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gboolean saved_size_changed; int unconfigured_width; int unconfigured_height; int fixed_size_width; int fixed_size_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; }; // Version ID 10 // Diff from previous version: // + struct wl_callback *surface_callback; // + GHashTable *frame_callback_surfaces; // Valid for GTK v3.24.25 - v3.24.39 struct _GdkWindowImplWayland_v3_24_25 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gboolean saved_size_changed; int unconfigured_width; int unconfigured_height; int fixed_size_width; int fixed_size_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; struct wl_callback *surface_callback; GHashTable *frame_callback_surfaces; }; // Version ID 11 // Diff from previous version: // + unsigned int suspended : 1; // + gboolean suspended; // Valid for GTK v3.24.40 - v3.24.43 struct _GdkWindowImplWayland_v3_24_40 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; unsigned int suspended : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gboolean saved_size_changed; int unconfigured_width; int unconfigured_height; int fixed_size_width; int fixed_size_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; gboolean suspended; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_transient_for; GHashTable *shortcuts_inhibitors; struct wl_callback *surface_callback; GHashTable *frame_callback_surfaces; }; // Version ID 12 // Diff from previous version: // - struct zxdg_exported_v1 *xdg_exported; // + struct zxdg_exported_v1 *xdg_exported_v1; // + struct zxdg_exported_v2 *xdg_exported_v2; // - struct zxdg_imported_v1 *imported_transient_for; // + struct zxdg_imported_v1 *imported_v1_transient_for; // + struct zxdg_imported_v2 *imported_v2_transient_for; // Valid for GTK v3.24.44 (unreleased) struct _GdkWindowImplWayland_v3_24_44 { struct _GdkWindowImpl_v3_22_0 parent_instance; GdkWindow *wrapper; struct { GSList *outputs; struct wl_surface *wl_surface; struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; struct xdg_popup *xdg_popup; struct zxdg_surface_v6 *zxdg_surface_v6; struct zxdg_toplevel_v6 *zxdg_toplevel_v6; struct zxdg_popup_v6 *zxdg_popup_v6; struct gtk_surface1 *gtk_surface; struct wl_subsurface *wl_subsurface; struct wl_egl_window *egl_window; struct wl_egl_window *dummy_egl_window; struct zxdg_exported_v1 *xdg_exported_v1; struct zxdg_exported_v2 *xdg_exported_v2; struct org_kde_kwin_server_decoration *server_decoration; } display_server; EGLSurface egl_surface; EGLSurface dummy_egl_surface; unsigned int initial_configure_received : 1; unsigned int configuring_popup : 1; unsigned int mapped : 1; unsigned int use_custom_surface : 1; unsigned int pending_buffer_attached : 1; unsigned int pending_commit : 1; unsigned int awaiting_frame : 1; unsigned int using_csd : 1; unsigned int suspended : 1; GdkWindowTypeHint hint; GdkWindow *transient_for; GdkWindow *popup_parent; PositionMethod position_method; cairo_surface_t *staging_cairo_surface; cairo_surface_t *committed_cairo_surface; cairo_surface_t *backfill_cairo_surface; int pending_buffer_offset_x; int pending_buffer_offset_y; int subsurface_x; int subsurface_y; gchar *title; struct { gboolean was_set; gchar *application_id; gchar *app_menu_path; gchar *menubar_path; gchar *window_object_path; gchar *application_object_path; gchar *unique_bus_name; } application; GdkGeometry geometry_hints; GdkWindowHints geometry_mask; GdkSeat *grab_input_seat; gint64 pending_frame_counter; guint32 scale; int margin_left; int margin_right; int margin_top; int margin_bottom; gboolean margin_dirty; int initial_fullscreen_monitor; cairo_region_t *opaque_region; gboolean opaque_region_dirty; cairo_region_t *input_region; gboolean input_region_dirty; cairo_region_t *staged_updates_region; int saved_width; int saved_height; gboolean saved_size_changed; int unconfigured_width; int unconfigured_height; int fixed_size_width; int fixed_size_height; gulong parent_surface_committed_handler; struct { GdkRectangle rect; GdkGravity rect_anchor; GdkGravity window_anchor; GdkAnchorHints anchor_hints; gint rect_anchor_dx; gint rect_anchor_dy; } pending_move_to_rect; struct { int width; int height; GdkWindowState state; gboolean suspended; } pending; struct { char *handle; int export_count; GList *closures; guint idle_source_id; } exported; struct zxdg_imported_v1 *imported_v1_transient_for; struct zxdg_imported_v2 *imported_v2_transient_for; GHashTable *shortcuts_inhibitors; struct wl_callback *surface_callback; GHashTable *frame_callback_surfaces; }; // For internal use only int gdk_window_impl_wayland_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } if (combo >= 24044) { version_id = 12; } else if (combo >= 24040) { version_id = 11; } else if (combo >= 24025) { version_id = 10; } else if (combo >= 24022) { version_id = 9; } else if (combo >= 24017) { version_id = 8; } else if (combo >= 24004) { version_id = 7; } else if (combo >= 23003) { version_id = 6; } else if (combo >= 23001) { version_id = 5; } else if (combo >= 22030) { version_id = 4; } else if (combo >= 22025) { version_id = 3; } else if (combo >= 22018) { version_id = 2; } else if (combo >= 22016) { version_id = 1; } else { version_id = 0; } } return version_id; } // GdkWindowImplWayland::parent_instance GdkWindowImpl * gdk_window_impl_wayland_priv_get_parent_instance_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->parent_instance; case 1: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->parent_instance; case 2: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->parent_instance; case 3: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->parent_instance; case 4: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->parent_instance; case 5: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->parent_instance; case 6: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->parent_instance; case 7: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->parent_instance; case 8: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->parent_instance; case 9: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->parent_instance; case 10: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->parent_instance; case 11: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->parent_instance; case 12: return (GdkWindowImpl *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->parent_instance; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::wrapper GdkWindow * gdk_window_impl_wayland_priv_get_wrapper(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->wrapper; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->wrapper; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->wrapper; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->wrapper; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->wrapper; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->wrapper; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->wrapper; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->wrapper; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->wrapper; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->wrapper; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->wrapper; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->wrapper; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->wrapper; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_wrapper(GdkWindowImplWayland * self, GdkWindow * wrapper) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->wrapper = wrapper; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->wrapper = wrapper; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->wrapper = wrapper; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->wrapper = wrapper; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->wrapper = wrapper; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->wrapper = wrapper; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->wrapper = wrapper; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->wrapper = wrapper; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->wrapper = wrapper; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->wrapper = wrapper; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->wrapper = wrapper; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->wrapper = wrapper; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->wrapper = wrapper; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.outputs GSList * gdk_window_impl_wayland_priv_get_display_server_outputs(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.outputs; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.outputs; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.outputs; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.outputs; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.outputs; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.outputs; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.outputs; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.outputs; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.outputs; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.outputs; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.outputs; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.outputs; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.outputs; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_outputs(GdkWindowImplWayland * self, GSList * display_server_outputs) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.outputs = display_server_outputs; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.outputs = display_server_outputs; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.outputs = display_server_outputs; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.outputs = display_server_outputs; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.outputs = display_server_outputs; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.outputs = display_server_outputs; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.outputs = display_server_outputs; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.outputs = display_server_outputs; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.outputs = display_server_outputs; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.outputs = display_server_outputs; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.outputs = display_server_outputs; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.outputs = display_server_outputs; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.outputs = display_server_outputs; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.wl_surface struct wl_surface * gdk_window_impl_wayland_priv_get_display_server_wl_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.wl_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.wl_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.wl_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.wl_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.wl_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.wl_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.wl_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.wl_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.wl_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.wl_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.wl_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.wl_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.wl_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_wl_surface(GdkWindowImplWayland * self, struct wl_surface * display_server_wl_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.wl_surface = display_server_wl_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.wl_surface = display_server_wl_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.wl_surface = display_server_wl_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.wl_surface = display_server_wl_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.wl_surface = display_server_wl_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.wl_surface = display_server_wl_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.wl_surface = display_server_wl_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.wl_surface = display_server_wl_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.wl_surface = display_server_wl_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.wl_surface = display_server_wl_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.wl_surface = display_server_wl_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.wl_surface = display_server_wl_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.wl_surface = display_server_wl_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.gtk_surface struct gtk_surface1 * gdk_window_impl_wayland_priv_get_display_server_gtk_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.gtk_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.gtk_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.gtk_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.gtk_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.gtk_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.gtk_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.gtk_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.gtk_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.gtk_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.gtk_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.gtk_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.gtk_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.gtk_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_gtk_surface(GdkWindowImplWayland * self, struct gtk_surface1 * display_server_gtk_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.gtk_surface = display_server_gtk_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.gtk_surface = display_server_gtk_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.wl_subsurface struct wl_subsurface * gdk_window_impl_wayland_priv_get_display_server_wl_subsurface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.wl_subsurface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.wl_subsurface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.wl_subsurface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.wl_subsurface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.wl_subsurface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.wl_subsurface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.wl_subsurface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.wl_subsurface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.wl_subsurface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.wl_subsurface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.wl_subsurface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.wl_subsurface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.wl_subsurface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_wl_subsurface(GdkWindowImplWayland * self, struct wl_subsurface * display_server_wl_subsurface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.wl_subsurface = display_server_wl_subsurface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.egl_window struct wl_egl_window * gdk_window_impl_wayland_priv_get_display_server_egl_window(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.egl_window; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.egl_window; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.egl_window; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.egl_window; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.egl_window; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.egl_window; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.egl_window; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.egl_window; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.egl_window; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.egl_window; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.egl_window; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.egl_window; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.egl_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_egl_window(GdkWindowImplWayland * self, struct wl_egl_window * display_server_egl_window) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.egl_window = display_server_egl_window; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.egl_window = display_server_egl_window; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.egl_window = display_server_egl_window; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.egl_window = display_server_egl_window; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.egl_window = display_server_egl_window; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.egl_window = display_server_egl_window; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.egl_window = display_server_egl_window; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.egl_window = display_server_egl_window; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.egl_window = display_server_egl_window; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.egl_window = display_server_egl_window; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.egl_window = display_server_egl_window; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.egl_window = display_server_egl_window; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.egl_window = display_server_egl_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.dummy_egl_window struct wl_egl_window * gdk_window_impl_wayland_priv_get_display_server_dummy_egl_window(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.dummy_egl_window; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.dummy_egl_window; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.dummy_egl_window; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.dummy_egl_window; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.dummy_egl_window; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.dummy_egl_window; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.dummy_egl_window; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.dummy_egl_window; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.dummy_egl_window; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.dummy_egl_window; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.dummy_egl_window; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.dummy_egl_window; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.dummy_egl_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_dummy_egl_window(GdkWindowImplWayland * self, struct wl_egl_window * display_server_dummy_egl_window) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.dummy_egl_window = display_server_dummy_egl_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_exported gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_exported_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return TRUE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_exported_v1 * gdk_window_impl_wayland_priv_get_display_server_xdg_exported_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.xdg_exported; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.xdg_exported; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.xdg_exported; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.xdg_exported; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_exported; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_exported; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_exported; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_exported; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_exported; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_exported; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_exported; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_exported; case 12: g_error("GdkWindowImplWayland::display_server.xdg_exported not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_exported_or_abort(GdkWindowImplWayland * self, struct zxdg_exported_v1 * display_server_xdg_exported) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_exported = display_server_xdg_exported; break; case 12: g_error("GdkWindowImplWayland::display_server.xdg_exported not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::egl_surface EGLSurface * gdk_window_impl_wayland_priv_get_egl_surface_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->egl_surface; case 1: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->egl_surface; case 2: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->egl_surface; case 3: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->egl_surface; case 4: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->egl_surface; case 5: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->egl_surface; case 6: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->egl_surface; case 7: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->egl_surface; case 8: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->egl_surface; case 9: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->egl_surface; case 10: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->egl_surface; case 11: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->egl_surface; case 12: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->egl_surface; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::dummy_egl_surface EGLSurface * gdk_window_impl_wayland_priv_get_dummy_egl_surface_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->dummy_egl_surface; case 1: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->dummy_egl_surface; case 2: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->dummy_egl_surface; case 3: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->dummy_egl_surface; case 4: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->dummy_egl_surface; case 5: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->dummy_egl_surface; case 6: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->dummy_egl_surface; case 7: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->dummy_egl_surface; case 8: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->dummy_egl_surface; case 9: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->dummy_egl_surface; case 10: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->dummy_egl_surface; case 11: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->dummy_egl_surface; case 12: return (EGLSurface *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->dummy_egl_surface; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::initial_configure_received unsigned int gdk_window_impl_wayland_priv_get_initial_configure_received(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->initial_configure_received; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->initial_configure_received; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->initial_configure_received; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->initial_configure_received; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->initial_configure_received; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->initial_configure_received; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->initial_configure_received; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->initial_configure_received; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->initial_configure_received; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->initial_configure_received; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->initial_configure_received; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->initial_configure_received; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->initial_configure_received; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_initial_configure_received(GdkWindowImplWayland * self, unsigned int initial_configure_received) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->initial_configure_received = initial_configure_received; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->initial_configure_received = initial_configure_received; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->initial_configure_received = initial_configure_received; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->initial_configure_received = initial_configure_received; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->initial_configure_received = initial_configure_received; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->initial_configure_received = initial_configure_received; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->initial_configure_received = initial_configure_received; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->initial_configure_received = initial_configure_received; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->initial_configure_received = initial_configure_received; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->initial_configure_received = initial_configure_received; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->initial_configure_received = initial_configure_received; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->initial_configure_received = initial_configure_received; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->initial_configure_received = initial_configure_received; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::mapped unsigned int gdk_window_impl_wayland_priv_get_mapped(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->mapped; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->mapped; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->mapped; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->mapped; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->mapped; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->mapped; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->mapped; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->mapped; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->mapped; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->mapped; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->mapped; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->mapped; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->mapped; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_mapped(GdkWindowImplWayland * self, unsigned int mapped) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->mapped = mapped; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->mapped = mapped; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->mapped = mapped; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->mapped = mapped; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->mapped = mapped; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->mapped = mapped; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->mapped = mapped; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->mapped = mapped; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->mapped = mapped; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->mapped = mapped; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->mapped = mapped; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->mapped = mapped; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->mapped = mapped; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::use_custom_surface unsigned int gdk_window_impl_wayland_priv_get_use_custom_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->use_custom_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->use_custom_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->use_custom_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->use_custom_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->use_custom_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->use_custom_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->use_custom_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->use_custom_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->use_custom_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->use_custom_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->use_custom_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->use_custom_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->use_custom_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_use_custom_surface(GdkWindowImplWayland * self, unsigned int use_custom_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->use_custom_surface = use_custom_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->use_custom_surface = use_custom_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->use_custom_surface = use_custom_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->use_custom_surface = use_custom_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->use_custom_surface = use_custom_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->use_custom_surface = use_custom_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->use_custom_surface = use_custom_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->use_custom_surface = use_custom_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->use_custom_surface = use_custom_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->use_custom_surface = use_custom_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->use_custom_surface = use_custom_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->use_custom_surface = use_custom_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->use_custom_surface = use_custom_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_buffer_attached unsigned int gdk_window_impl_wayland_priv_get_pending_buffer_attached(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_attached; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_attached; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_attached; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_attached; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_attached; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_attached; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_attached; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_attached; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_attached; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_attached; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_attached; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_attached; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_attached; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_buffer_attached(GdkWindowImplWayland * self, unsigned int pending_buffer_attached) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_attached = pending_buffer_attached; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_attached = pending_buffer_attached; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_attached = pending_buffer_attached; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_attached = pending_buffer_attached; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_attached = pending_buffer_attached; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_attached = pending_buffer_attached; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_attached = pending_buffer_attached; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_attached = pending_buffer_attached; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_attached = pending_buffer_attached; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_attached = pending_buffer_attached; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_attached = pending_buffer_attached; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_attached = pending_buffer_attached; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_attached = pending_buffer_attached; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_commit unsigned int gdk_window_impl_wayland_priv_get_pending_commit(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_commit; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_commit; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_commit; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_commit; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_commit; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_commit; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_commit; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_commit; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_commit; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_commit; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_commit; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_commit; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_commit; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_commit(GdkWindowImplWayland * self, unsigned int pending_commit) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_commit = pending_commit; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_commit = pending_commit; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_commit = pending_commit; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_commit = pending_commit; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_commit = pending_commit; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_commit = pending_commit; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_commit = pending_commit; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_commit = pending_commit; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_commit = pending_commit; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_commit = pending_commit; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_commit = pending_commit; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_commit = pending_commit; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_commit = pending_commit; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::awaiting_frame unsigned int gdk_window_impl_wayland_priv_get_awaiting_frame(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->awaiting_frame; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->awaiting_frame; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->awaiting_frame; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->awaiting_frame; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->awaiting_frame; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->awaiting_frame; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->awaiting_frame; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->awaiting_frame; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->awaiting_frame; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->awaiting_frame; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->awaiting_frame; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->awaiting_frame; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->awaiting_frame; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_awaiting_frame(GdkWindowImplWayland * self, unsigned int awaiting_frame) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->awaiting_frame = awaiting_frame; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->awaiting_frame = awaiting_frame; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->awaiting_frame = awaiting_frame; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->awaiting_frame = awaiting_frame; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->awaiting_frame = awaiting_frame; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->awaiting_frame = awaiting_frame; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->awaiting_frame = awaiting_frame; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->awaiting_frame = awaiting_frame; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->awaiting_frame = awaiting_frame; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->awaiting_frame = awaiting_frame; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->awaiting_frame = awaiting_frame; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->awaiting_frame = awaiting_frame; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->awaiting_frame = awaiting_frame; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::hint GdkWindowTypeHint * gdk_window_impl_wayland_priv_get_hint_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->hint; case 1: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->hint; case 2: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->hint; case 3: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->hint; case 4: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->hint; case 5: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->hint; case 6: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->hint; case 7: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->hint; case 8: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->hint; case 9: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->hint; case 10: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->hint; case 11: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->hint; case 12: return (GdkWindowTypeHint *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->hint; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::transient_for GdkWindow * gdk_window_impl_wayland_priv_get_transient_for(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->transient_for; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->transient_for; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->transient_for; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->transient_for; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->transient_for; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->transient_for; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->transient_for; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->transient_for; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->transient_for; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->transient_for; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->transient_for; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->transient_for; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->transient_for; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_transient_for(GdkWindowImplWayland * self, GdkWindow * transient_for) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->transient_for = transient_for; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->transient_for = transient_for; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->transient_for = transient_for; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->transient_for = transient_for; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->transient_for = transient_for; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->transient_for = transient_for; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->transient_for = transient_for; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->transient_for = transient_for; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->transient_for = transient_for; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->transient_for = transient_for; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->transient_for = transient_for; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->transient_for = transient_for; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->transient_for = transient_for; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::popup_parent GdkWindow * gdk_window_impl_wayland_priv_get_popup_parent(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->popup_parent; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->popup_parent; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->popup_parent; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->popup_parent; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->popup_parent; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->popup_parent; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->popup_parent; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->popup_parent; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->popup_parent; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->popup_parent; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->popup_parent; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->popup_parent; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->popup_parent; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_popup_parent(GdkWindowImplWayland * self, GdkWindow * popup_parent) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->popup_parent = popup_parent; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->popup_parent = popup_parent; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->popup_parent = popup_parent; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->popup_parent = popup_parent; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->popup_parent = popup_parent; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->popup_parent = popup_parent; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->popup_parent = popup_parent; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->popup_parent = popup_parent; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->popup_parent = popup_parent; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->popup_parent = popup_parent; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->popup_parent = popup_parent; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->popup_parent = popup_parent; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->popup_parent = popup_parent; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::position_method PositionMethod * gdk_window_impl_wayland_priv_get_position_method_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->position_method; case 1: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->position_method; case 2: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->position_method; case 3: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->position_method; case 4: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->position_method; case 5: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->position_method; case 6: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->position_method; case 7: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->position_method; case 8: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->position_method; case 9: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->position_method; case 10: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->position_method; case 11: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->position_method; case 12: return (PositionMethod *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->position_method; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::staging_cairo_surface cairo_surface_t * gdk_window_impl_wayland_priv_get_staging_cairo_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->staging_cairo_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->staging_cairo_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->staging_cairo_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->staging_cairo_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->staging_cairo_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->staging_cairo_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->staging_cairo_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->staging_cairo_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->staging_cairo_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->staging_cairo_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->staging_cairo_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->staging_cairo_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->staging_cairo_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_staging_cairo_surface(GdkWindowImplWayland * self, cairo_surface_t * staging_cairo_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->staging_cairo_surface = staging_cairo_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->staging_cairo_surface = staging_cairo_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->staging_cairo_surface = staging_cairo_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->staging_cairo_surface = staging_cairo_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->staging_cairo_surface = staging_cairo_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->staging_cairo_surface = staging_cairo_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->staging_cairo_surface = staging_cairo_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->staging_cairo_surface = staging_cairo_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->staging_cairo_surface = staging_cairo_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->staging_cairo_surface = staging_cairo_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->staging_cairo_surface = staging_cairo_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->staging_cairo_surface = staging_cairo_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->staging_cairo_surface = staging_cairo_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::committed_cairo_surface cairo_surface_t * gdk_window_impl_wayland_priv_get_committed_cairo_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->committed_cairo_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->committed_cairo_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->committed_cairo_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->committed_cairo_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->committed_cairo_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->committed_cairo_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->committed_cairo_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->committed_cairo_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->committed_cairo_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->committed_cairo_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->committed_cairo_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->committed_cairo_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->committed_cairo_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_committed_cairo_surface(GdkWindowImplWayland * self, cairo_surface_t * committed_cairo_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->committed_cairo_surface = committed_cairo_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->committed_cairo_surface = committed_cairo_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->committed_cairo_surface = committed_cairo_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->committed_cairo_surface = committed_cairo_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->committed_cairo_surface = committed_cairo_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->committed_cairo_surface = committed_cairo_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->committed_cairo_surface = committed_cairo_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->committed_cairo_surface = committed_cairo_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->committed_cairo_surface = committed_cairo_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->committed_cairo_surface = committed_cairo_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->committed_cairo_surface = committed_cairo_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->committed_cairo_surface = committed_cairo_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->committed_cairo_surface = committed_cairo_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::backfill_cairo_surface cairo_surface_t * gdk_window_impl_wayland_priv_get_backfill_cairo_surface(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->backfill_cairo_surface; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->backfill_cairo_surface; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->backfill_cairo_surface; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->backfill_cairo_surface; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->backfill_cairo_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->backfill_cairo_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->backfill_cairo_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->backfill_cairo_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->backfill_cairo_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->backfill_cairo_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->backfill_cairo_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->backfill_cairo_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->backfill_cairo_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_backfill_cairo_surface(GdkWindowImplWayland * self, cairo_surface_t * backfill_cairo_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->backfill_cairo_surface = backfill_cairo_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->backfill_cairo_surface = backfill_cairo_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_buffer_offset_x int gdk_window_impl_wayland_priv_get_pending_buffer_offset_x(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_offset_x; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_offset_x; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_offset_x; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_offset_x; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_offset_x; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_offset_x; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_offset_x; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_offset_x; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_offset_x; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_offset_x; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_offset_x; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_offset_x; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_offset_x; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_buffer_offset_x(GdkWindowImplWayland * self, int pending_buffer_offset_x) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_offset_x = pending_buffer_offset_x; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_buffer_offset_y int gdk_window_impl_wayland_priv_get_pending_buffer_offset_y(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_offset_y; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_offset_y; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_offset_y; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_offset_y; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_offset_y; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_offset_y; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_offset_y; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_offset_y; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_offset_y; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_offset_y; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_offset_y; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_offset_y; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_offset_y; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_buffer_offset_y(GdkWindowImplWayland * self, int pending_buffer_offset_y) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_buffer_offset_y = pending_buffer_offset_y; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::title gchar * gdk_window_impl_wayland_priv_get_title(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->title; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->title; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->title; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->title; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->title; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->title; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->title; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->title; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->title; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->title; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->title; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->title; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->title; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_title(GdkWindowImplWayland * self, gchar * title) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->title = title; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->title = title; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->title = title; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->title = title; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->title = title; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->title = title; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->title = title; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->title = title; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->title = title; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->title = title; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->title = title; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->title = title; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->title = title; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.was_set gboolean gdk_window_impl_wayland_priv_get_application_was_set(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.was_set; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.was_set; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.was_set; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.was_set; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.was_set; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.was_set; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.was_set; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.was_set; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.was_set; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.was_set; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.was_set; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.was_set; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.was_set; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_was_set(GdkWindowImplWayland * self, gboolean application_was_set) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.was_set = application_was_set; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.was_set = application_was_set; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.was_set = application_was_set; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.was_set = application_was_set; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.was_set = application_was_set; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.was_set = application_was_set; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.was_set = application_was_set; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.was_set = application_was_set; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.was_set = application_was_set; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.was_set = application_was_set; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.was_set = application_was_set; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.was_set = application_was_set; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.was_set = application_was_set; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.application_id gchar * gdk_window_impl_wayland_priv_get_application_application_id(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.application_id; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.application_id; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.application_id; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.application_id; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.application_id; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.application_id; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.application_id; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.application_id; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.application_id; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.application_id; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.application_id; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.application_id; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.application_id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_application_id(GdkWindowImplWayland * self, gchar * application_application_id) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.application_id = application_application_id; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.application_id = application_application_id; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.application_id = application_application_id; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.application_id = application_application_id; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.application_id = application_application_id; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.application_id = application_application_id; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.application_id = application_application_id; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.application_id = application_application_id; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.application_id = application_application_id; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.application_id = application_application_id; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.application_id = application_application_id; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.application_id = application_application_id; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.application_id = application_application_id; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.app_menu_path gchar * gdk_window_impl_wayland_priv_get_application_app_menu_path(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.app_menu_path; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.app_menu_path; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.app_menu_path; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.app_menu_path; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.app_menu_path; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.app_menu_path; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.app_menu_path; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.app_menu_path; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.app_menu_path; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.app_menu_path; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.app_menu_path; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.app_menu_path; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.app_menu_path; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_app_menu_path(GdkWindowImplWayland * self, gchar * application_app_menu_path) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.app_menu_path = application_app_menu_path; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.app_menu_path = application_app_menu_path; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.app_menu_path = application_app_menu_path; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.app_menu_path = application_app_menu_path; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.app_menu_path = application_app_menu_path; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.app_menu_path = application_app_menu_path; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.app_menu_path = application_app_menu_path; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.app_menu_path = application_app_menu_path; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.app_menu_path = application_app_menu_path; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.app_menu_path = application_app_menu_path; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.app_menu_path = application_app_menu_path; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.app_menu_path = application_app_menu_path; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.app_menu_path = application_app_menu_path; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.menubar_path gchar * gdk_window_impl_wayland_priv_get_application_menubar_path(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.menubar_path; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.menubar_path; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.menubar_path; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.menubar_path; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.menubar_path; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.menubar_path; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.menubar_path; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.menubar_path; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.menubar_path; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.menubar_path; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.menubar_path; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.menubar_path; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.menubar_path; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_menubar_path(GdkWindowImplWayland * self, gchar * application_menubar_path) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.menubar_path = application_menubar_path; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.menubar_path = application_menubar_path; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.menubar_path = application_menubar_path; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.menubar_path = application_menubar_path; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.menubar_path = application_menubar_path; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.menubar_path = application_menubar_path; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.menubar_path = application_menubar_path; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.menubar_path = application_menubar_path; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.menubar_path = application_menubar_path; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.menubar_path = application_menubar_path; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.menubar_path = application_menubar_path; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.menubar_path = application_menubar_path; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.menubar_path = application_menubar_path; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.window_object_path gchar * gdk_window_impl_wayland_priv_get_application_window_object_path(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.window_object_path; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.window_object_path; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.window_object_path; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.window_object_path; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.window_object_path; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.window_object_path; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.window_object_path; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.window_object_path; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.window_object_path; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.window_object_path; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.window_object_path; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.window_object_path; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.window_object_path; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_window_object_path(GdkWindowImplWayland * self, gchar * application_window_object_path) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.window_object_path = application_window_object_path; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.window_object_path = application_window_object_path; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.window_object_path = application_window_object_path; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.window_object_path = application_window_object_path; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.window_object_path = application_window_object_path; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.window_object_path = application_window_object_path; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.window_object_path = application_window_object_path; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.window_object_path = application_window_object_path; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.window_object_path = application_window_object_path; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.window_object_path = application_window_object_path; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.window_object_path = application_window_object_path; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.window_object_path = application_window_object_path; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.window_object_path = application_window_object_path; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.application_object_path gchar * gdk_window_impl_wayland_priv_get_application_application_object_path(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.application_object_path; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.application_object_path; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.application_object_path; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.application_object_path; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.application_object_path; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.application_object_path; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.application_object_path; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.application_object_path; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.application_object_path; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.application_object_path; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.application_object_path; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.application_object_path; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.application_object_path; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_application_object_path(GdkWindowImplWayland * self, gchar * application_application_object_path) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.application_object_path = application_application_object_path; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.application_object_path = application_application_object_path; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.application_object_path = application_application_object_path; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.application_object_path = application_application_object_path; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.application_object_path = application_application_object_path; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.application_object_path = application_application_object_path; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.application_object_path = application_application_object_path; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.application_object_path = application_application_object_path; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.application_object_path = application_application_object_path; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.application_object_path = application_application_object_path; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.application_object_path = application_application_object_path; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.application_object_path = application_application_object_path; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.application_object_path = application_application_object_path; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::application.unique_bus_name gchar * gdk_window_impl_wayland_priv_get_application_unique_bus_name(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.unique_bus_name; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.unique_bus_name; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.unique_bus_name; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.unique_bus_name; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.unique_bus_name; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.unique_bus_name; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.unique_bus_name; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.unique_bus_name; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.unique_bus_name; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.unique_bus_name; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.unique_bus_name; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.unique_bus_name; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.unique_bus_name; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_application_unique_bus_name(GdkWindowImplWayland * self, gchar * application_unique_bus_name) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->application.unique_bus_name = application_unique_bus_name; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->application.unique_bus_name = application_unique_bus_name; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->application.unique_bus_name = application_unique_bus_name; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->application.unique_bus_name = application_unique_bus_name; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->application.unique_bus_name = application_unique_bus_name; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->application.unique_bus_name = application_unique_bus_name; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->application.unique_bus_name = application_unique_bus_name; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->application.unique_bus_name = application_unique_bus_name; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->application.unique_bus_name = application_unique_bus_name; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->application.unique_bus_name = application_unique_bus_name; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->application.unique_bus_name = application_unique_bus_name; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->application.unique_bus_name = application_unique_bus_name; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->application.unique_bus_name = application_unique_bus_name; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::geometry_hints GdkGeometry * gdk_window_impl_wayland_priv_get_geometry_hints_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->geometry_hints; case 1: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->geometry_hints; case 2: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->geometry_hints; case 3: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->geometry_hints; case 4: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->geometry_hints; case 5: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->geometry_hints; case 6: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->geometry_hints; case 7: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->geometry_hints; case 8: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->geometry_hints; case 9: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->geometry_hints; case 10: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->geometry_hints; case 11: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->geometry_hints; case 12: return (GdkGeometry *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->geometry_hints; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::geometry_mask GdkWindowHints * gdk_window_impl_wayland_priv_get_geometry_mask_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->geometry_mask; case 1: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->geometry_mask; case 2: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->geometry_mask; case 3: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->geometry_mask; case 4: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->geometry_mask; case 5: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->geometry_mask; case 6: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->geometry_mask; case 7: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->geometry_mask; case 8: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->geometry_mask; case 9: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->geometry_mask; case 10: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->geometry_mask; case 11: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->geometry_mask; case 12: return (GdkWindowHints *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->geometry_mask; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::grab_input_seat GdkSeat * gdk_window_impl_wayland_priv_get_grab_input_seat(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->grab_input_seat; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->grab_input_seat; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->grab_input_seat; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->grab_input_seat; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->grab_input_seat; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->grab_input_seat; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->grab_input_seat; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->grab_input_seat; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->grab_input_seat; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->grab_input_seat; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->grab_input_seat; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->grab_input_seat; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->grab_input_seat; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_grab_input_seat(GdkWindowImplWayland * self, GdkSeat * grab_input_seat) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->grab_input_seat = grab_input_seat; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->grab_input_seat = grab_input_seat; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->grab_input_seat = grab_input_seat; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->grab_input_seat = grab_input_seat; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->grab_input_seat = grab_input_seat; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->grab_input_seat = grab_input_seat; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->grab_input_seat = grab_input_seat; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->grab_input_seat = grab_input_seat; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->grab_input_seat = grab_input_seat; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->grab_input_seat = grab_input_seat; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->grab_input_seat = grab_input_seat; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->grab_input_seat = grab_input_seat; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->grab_input_seat = grab_input_seat; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_frame_counter gint64 * gdk_window_impl_wayland_priv_get_pending_frame_counter_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (gint64 *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_frame_counter; case 1: return (gint64 *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_frame_counter; case 2: return (gint64 *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_frame_counter; case 3: return (gint64 *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_frame_counter; case 4: return (gint64 *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_frame_counter; case 5: return (gint64 *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_frame_counter; case 6: return (gint64 *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_frame_counter; case 7: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_frame_counter; case 8: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_frame_counter; case 9: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_frame_counter; case 10: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_frame_counter; case 11: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_frame_counter; case 12: return (gint64 *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_frame_counter; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::scale guint32 * gdk_window_impl_wayland_priv_get_scale_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (guint32 *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->scale; case 1: return (guint32 *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->scale; case 2: return (guint32 *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->scale; case 3: return (guint32 *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->scale; case 4: return (guint32 *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->scale; case 5: return (guint32 *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->scale; case 6: return (guint32 *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->scale; case 7: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->scale; case 8: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->scale; case 9: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->scale; case 10: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->scale; case 11: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->scale; case 12: return (guint32 *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->scale; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::margin_left int gdk_window_impl_wayland_priv_get_margin_left(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_left; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_left; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_left; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_left; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_left; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_left; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_left; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_left; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_left; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_left; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_left; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_left; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_left; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_margin_left(GdkWindowImplWayland * self, int margin_left) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_left = margin_left; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_left = margin_left; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_left = margin_left; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_left = margin_left; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_left = margin_left; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_left = margin_left; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_left = margin_left; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_left = margin_left; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_left = margin_left; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_left = margin_left; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_left = margin_left; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_left = margin_left; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_left = margin_left; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::margin_right int gdk_window_impl_wayland_priv_get_margin_right(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_right; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_right; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_right; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_right; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_right; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_right; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_right; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_right; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_right; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_right; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_right; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_right; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_right; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_margin_right(GdkWindowImplWayland * self, int margin_right) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_right = margin_right; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_right = margin_right; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_right = margin_right; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_right = margin_right; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_right = margin_right; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_right = margin_right; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_right = margin_right; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_right = margin_right; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_right = margin_right; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_right = margin_right; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_right = margin_right; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_right = margin_right; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_right = margin_right; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::margin_top int gdk_window_impl_wayland_priv_get_margin_top(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_top; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_top; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_top; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_top; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_top; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_top; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_top; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_top; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_top; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_top; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_top; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_top; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_top; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_margin_top(GdkWindowImplWayland * self, int margin_top) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_top = margin_top; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_top = margin_top; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_top = margin_top; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_top = margin_top; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_top = margin_top; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_top = margin_top; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_top = margin_top; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_top = margin_top; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_top = margin_top; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_top = margin_top; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_top = margin_top; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_top = margin_top; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_top = margin_top; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::margin_bottom int gdk_window_impl_wayland_priv_get_margin_bottom(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_bottom; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_bottom; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_bottom; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_bottom; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_bottom; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_bottom; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_bottom; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_bottom; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_bottom; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_bottom; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_bottom; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_bottom; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_bottom; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_margin_bottom(GdkWindowImplWayland * self, int margin_bottom) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_bottom = margin_bottom; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_bottom = margin_bottom; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_bottom = margin_bottom; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_bottom = margin_bottom; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_bottom = margin_bottom; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_bottom = margin_bottom; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_bottom = margin_bottom; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_bottom = margin_bottom; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_bottom = margin_bottom; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_bottom = margin_bottom; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_bottom = margin_bottom; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_bottom = margin_bottom; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_bottom = margin_bottom; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::margin_dirty gboolean gdk_window_impl_wayland_priv_get_margin_dirty(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_dirty; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_dirty; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_dirty; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_dirty; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_dirty; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_dirty; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_dirty; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_dirty; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_dirty; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_dirty; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_dirty; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_dirty; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_dirty; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_margin_dirty(GdkWindowImplWayland * self, gboolean margin_dirty) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->margin_dirty = margin_dirty; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->margin_dirty = margin_dirty; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->margin_dirty = margin_dirty; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->margin_dirty = margin_dirty; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->margin_dirty = margin_dirty; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->margin_dirty = margin_dirty; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->margin_dirty = margin_dirty; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->margin_dirty = margin_dirty; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->margin_dirty = margin_dirty; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->margin_dirty = margin_dirty; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->margin_dirty = margin_dirty; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->margin_dirty = margin_dirty; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->margin_dirty = margin_dirty; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::initial_fullscreen_monitor int gdk_window_impl_wayland_priv_get_initial_fullscreen_monitor(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->initial_fullscreen_monitor; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->initial_fullscreen_monitor; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->initial_fullscreen_monitor; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->initial_fullscreen_monitor; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->initial_fullscreen_monitor; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->initial_fullscreen_monitor; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->initial_fullscreen_monitor; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->initial_fullscreen_monitor; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->initial_fullscreen_monitor; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->initial_fullscreen_monitor; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->initial_fullscreen_monitor; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->initial_fullscreen_monitor; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->initial_fullscreen_monitor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_initial_fullscreen_monitor(GdkWindowImplWayland * self, int initial_fullscreen_monitor) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->initial_fullscreen_monitor = initial_fullscreen_monitor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::opaque_region cairo_region_t * gdk_window_impl_wayland_priv_get_opaque_region(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->opaque_region; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->opaque_region; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->opaque_region; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->opaque_region; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->opaque_region; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->opaque_region; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->opaque_region; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->opaque_region; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->opaque_region; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->opaque_region; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->opaque_region; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->opaque_region; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->opaque_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_opaque_region(GdkWindowImplWayland * self, cairo_region_t * opaque_region) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->opaque_region = opaque_region; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->opaque_region = opaque_region; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->opaque_region = opaque_region; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->opaque_region = opaque_region; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->opaque_region = opaque_region; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->opaque_region = opaque_region; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->opaque_region = opaque_region; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->opaque_region = opaque_region; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->opaque_region = opaque_region; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->opaque_region = opaque_region; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->opaque_region = opaque_region; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->opaque_region = opaque_region; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->opaque_region = opaque_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::opaque_region_dirty gboolean gdk_window_impl_wayland_priv_get_opaque_region_dirty(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->opaque_region_dirty; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->opaque_region_dirty; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->opaque_region_dirty; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->opaque_region_dirty; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->opaque_region_dirty; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->opaque_region_dirty; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->opaque_region_dirty; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->opaque_region_dirty; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->opaque_region_dirty; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->opaque_region_dirty; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->opaque_region_dirty; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->opaque_region_dirty; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->opaque_region_dirty; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_opaque_region_dirty(GdkWindowImplWayland * self, gboolean opaque_region_dirty) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->opaque_region_dirty = opaque_region_dirty; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->opaque_region_dirty = opaque_region_dirty; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->opaque_region_dirty = opaque_region_dirty; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->opaque_region_dirty = opaque_region_dirty; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->opaque_region_dirty = opaque_region_dirty; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->opaque_region_dirty = opaque_region_dirty; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->opaque_region_dirty = opaque_region_dirty; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->opaque_region_dirty = opaque_region_dirty; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->opaque_region_dirty = opaque_region_dirty; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->opaque_region_dirty = opaque_region_dirty; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->opaque_region_dirty = opaque_region_dirty; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->opaque_region_dirty = opaque_region_dirty; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->opaque_region_dirty = opaque_region_dirty; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::input_region cairo_region_t * gdk_window_impl_wayland_priv_get_input_region(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->input_region; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->input_region; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->input_region; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->input_region; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->input_region; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->input_region; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->input_region; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->input_region; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->input_region; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->input_region; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->input_region; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->input_region; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->input_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_input_region(GdkWindowImplWayland * self, cairo_region_t * input_region) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->input_region = input_region; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->input_region = input_region; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->input_region = input_region; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->input_region = input_region; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->input_region = input_region; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->input_region = input_region; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->input_region = input_region; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->input_region = input_region; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->input_region = input_region; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->input_region = input_region; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->input_region = input_region; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->input_region = input_region; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->input_region = input_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::input_region_dirty gboolean gdk_window_impl_wayland_priv_get_input_region_dirty(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->input_region_dirty; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->input_region_dirty; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->input_region_dirty; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->input_region_dirty; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->input_region_dirty; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->input_region_dirty; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->input_region_dirty; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->input_region_dirty; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->input_region_dirty; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->input_region_dirty; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->input_region_dirty; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->input_region_dirty; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->input_region_dirty; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_input_region_dirty(GdkWindowImplWayland * self, gboolean input_region_dirty) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->input_region_dirty = input_region_dirty; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->input_region_dirty = input_region_dirty; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->input_region_dirty = input_region_dirty; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->input_region_dirty = input_region_dirty; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->input_region_dirty = input_region_dirty; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->input_region_dirty = input_region_dirty; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->input_region_dirty = input_region_dirty; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->input_region_dirty = input_region_dirty; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->input_region_dirty = input_region_dirty; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->input_region_dirty = input_region_dirty; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->input_region_dirty = input_region_dirty; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->input_region_dirty = input_region_dirty; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->input_region_dirty = input_region_dirty; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::staged_updates_region cairo_region_t * gdk_window_impl_wayland_priv_get_staged_updates_region(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->staged_updates_region; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->staged_updates_region; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->staged_updates_region; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->staged_updates_region; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->staged_updates_region; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->staged_updates_region; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->staged_updates_region; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->staged_updates_region; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->staged_updates_region; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->staged_updates_region; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->staged_updates_region; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->staged_updates_region; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->staged_updates_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_staged_updates_region(GdkWindowImplWayland * self, cairo_region_t * staged_updates_region) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->staged_updates_region = staged_updates_region; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->staged_updates_region = staged_updates_region; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->staged_updates_region = staged_updates_region; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->staged_updates_region = staged_updates_region; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->staged_updates_region = staged_updates_region; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->staged_updates_region = staged_updates_region; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->staged_updates_region = staged_updates_region; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->staged_updates_region = staged_updates_region; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->staged_updates_region = staged_updates_region; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->staged_updates_region = staged_updates_region; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->staged_updates_region = staged_updates_region; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->staged_updates_region = staged_updates_region; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->staged_updates_region = staged_updates_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::saved_width int gdk_window_impl_wayland_priv_get_saved_width(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->saved_width; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->saved_width; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->saved_width; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->saved_width; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->saved_width; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->saved_width; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->saved_width; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->saved_width; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->saved_width; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_width; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_width; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_width; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_saved_width(GdkWindowImplWayland * self, int saved_width) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->saved_width = saved_width; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->saved_width = saved_width; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->saved_width = saved_width; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->saved_width = saved_width; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->saved_width = saved_width; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->saved_width = saved_width; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->saved_width = saved_width; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->saved_width = saved_width; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->saved_width = saved_width; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_width = saved_width; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_width = saved_width; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_width = saved_width; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_width = saved_width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::saved_height int gdk_window_impl_wayland_priv_get_saved_height(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->saved_height; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->saved_height; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->saved_height; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->saved_height; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->saved_height; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->saved_height; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->saved_height; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->saved_height; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->saved_height; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_height; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_height; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_height; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_height; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_saved_height(GdkWindowImplWayland * self, int saved_height) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->saved_height = saved_height; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->saved_height = saved_height; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->saved_height = saved_height; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->saved_height = saved_height; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->saved_height = saved_height; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->saved_height = saved_height; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->saved_height = saved_height; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->saved_height = saved_height; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->saved_height = saved_height; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_height = saved_height; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_height = saved_height; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_height = saved_height; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_height = saved_height; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::parent_surface_committed_handler gulong * gdk_window_impl_wayland_priv_get_parent_surface_committed_handler_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (gulong *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->parent_surface_committed_handler; case 1: return (gulong *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->parent_surface_committed_handler; case 2: return (gulong *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->parent_surface_committed_handler; case 3: return (gulong *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->parent_surface_committed_handler; case 4: return (gulong *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->parent_surface_committed_handler; case 5: return (gulong *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->parent_surface_committed_handler; case 6: return (gulong *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->parent_surface_committed_handler; case 7: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->parent_surface_committed_handler; case 8: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->parent_surface_committed_handler; case 9: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->parent_surface_committed_handler; case 10: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->parent_surface_committed_handler; case 11: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->parent_surface_committed_handler; case 12: return (gulong *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->parent_surface_committed_handler; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.rect GdkRectangle * gdk_window_impl_wayland_priv_get_pending_move_to_rect_rect_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect; case 1: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect; case 2: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect; case 3: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect; case 4: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect; case 5: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect; case 6: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect; case 7: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect; case 8: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect; case 9: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect; case 10: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect; case 11: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect; case 12: return (GdkRectangle *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.rect_anchor GdkGravity * gdk_window_impl_wayland_priv_get_pending_move_to_rect_rect_anchor_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect_anchor; case 1: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect_anchor; case 2: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect_anchor; case 3: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect_anchor; case 4: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect_anchor; case 5: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect_anchor; case 6: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect_anchor; case 7: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect_anchor; case 8: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect_anchor; case 9: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect_anchor; case 10: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect_anchor; case 11: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect_anchor; case 12: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect_anchor; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.window_anchor GdkGravity * gdk_window_impl_wayland_priv_get_pending_move_to_rect_window_anchor_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.window_anchor; case 1: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.window_anchor; case 2: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.window_anchor; case 3: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.window_anchor; case 4: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.window_anchor; case 5: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.window_anchor; case 6: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.window_anchor; case 7: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.window_anchor; case 8: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.window_anchor; case 9: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.window_anchor; case 10: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.window_anchor; case 11: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.window_anchor; case 12: return (GdkGravity *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.window_anchor; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.anchor_hints GdkAnchorHints * gdk_window_impl_wayland_priv_get_pending_move_to_rect_anchor_hints_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.anchor_hints; case 1: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.anchor_hints; case 2: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.anchor_hints; case 3: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.anchor_hints; case 4: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.anchor_hints; case 5: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.anchor_hints; case 6: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.anchor_hints; case 7: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.anchor_hints; case 8: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.anchor_hints; case 9: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.anchor_hints; case 10: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.anchor_hints; case 11: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.anchor_hints; case 12: return (GdkAnchorHints *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.anchor_hints; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.rect_anchor_dx gint gdk_window_impl_wayland_priv_get_pending_move_to_rect_rect_anchor_dx(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect_anchor_dx; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect_anchor_dx; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect_anchor_dx; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect_anchor_dx; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect_anchor_dx; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect_anchor_dx; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect_anchor_dx; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect_anchor_dx; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect_anchor_dx; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect_anchor_dx; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect_anchor_dx; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect_anchor_dx; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect_anchor_dx; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_move_to_rect_rect_anchor_dx(GdkWindowImplWayland * self, gint pending_move_to_rect_rect_anchor_dx) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect_anchor_dx = pending_move_to_rect_rect_anchor_dx; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending_move_to_rect.rect_anchor_dy gint gdk_window_impl_wayland_priv_get_pending_move_to_rect_rect_anchor_dy(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect_anchor_dy; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect_anchor_dy; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect_anchor_dy; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect_anchor_dy; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect_anchor_dy; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect_anchor_dy; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect_anchor_dy; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect_anchor_dy; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect_anchor_dy; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect_anchor_dy; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect_anchor_dy; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect_anchor_dy; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect_anchor_dy; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_move_to_rect_rect_anchor_dy(GdkWindowImplWayland * self, gint pending_move_to_rect_rect_anchor_dy) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending_move_to_rect.rect_anchor_dy = pending_move_to_rect_rect_anchor_dy; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending.width int gdk_window_impl_wayland_priv_get_pending_width(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending.width; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending.width; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending.width; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending.width; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending.width; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending.width; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending.width; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending.width; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending.width; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending.width; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending.width; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.width; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_width(GdkWindowImplWayland * self, int pending_width) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending.width = pending_width; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending.width = pending_width; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending.width = pending_width; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending.width = pending_width; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending.width = pending_width; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending.width = pending_width; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending.width = pending_width; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending.width = pending_width; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending.width = pending_width; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending.width = pending_width; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending.width = pending_width; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.width = pending_width; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.width = pending_width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending.height int gdk_window_impl_wayland_priv_get_pending_height(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending.height; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending.height; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending.height; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending.height; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending.height; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending.height; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending.height; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending.height; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending.height; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending.height; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending.height; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.height; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.height; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_height(GdkWindowImplWayland * self, int pending_height) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->pending.height = pending_height; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->pending.height = pending_height; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->pending.height = pending_height; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->pending.height = pending_height; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->pending.height = pending_height; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->pending.height = pending_height; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->pending.height = pending_height; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->pending.height = pending_height; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->pending.height = pending_height; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->pending.height = pending_height; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->pending.height = pending_height; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.height = pending_height; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.height = pending_height; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending.state GdkWindowState * gdk_window_impl_wayland_priv_get_pending_state_ptr(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->pending.state; case 1: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_22_16*)self)->pending.state; case 2: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_22_18*)self)->pending.state; case 3: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_22_25*)self)->pending.state; case 4: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_22_30*)self)->pending.state; case 5: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_23_1*)self)->pending.state; case 6: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_23_3*)self)->pending.state; case 7: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_4*)self)->pending.state; case 8: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_17*)self)->pending.state; case 9: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_22*)self)->pending.state; case 10: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_25*)self)->pending.state; case 11: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.state; case 12: return (GdkWindowState *)&((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.state; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.callback gboolean gdk_window_impl_wayland_priv_get_exported_callback_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return TRUE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } GdkWaylandWindowExported * gdk_window_impl_wayland_priv_get_exported_callback_ptr_or_null(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GdkWaylandWindowExported *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->exported.callback; case 1: return NULL; case 2: return NULL; case 3: return NULL; case 4: return NULL; case 5: return NULL; case 6: return NULL; case 7: return NULL; case 8: return NULL; case 9: return NULL; case 10: return NULL; case 11: return NULL; case 12: return NULL; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.user_data gboolean gdk_window_impl_wayland_priv_get_exported_user_data_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return TRUE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } gpointer gdk_window_impl_wayland_priv_get_exported_user_data_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->exported.user_data; case 1: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 12: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_exported_user_data_or_abort(GdkWindowImplWayland * self, gpointer exported_user_data) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->exported.user_data = exported_user_data; break; case 1: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); case 12: g_error("GdkWindowImplWayland::exported.user_data not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.destroy_func gboolean gdk_window_impl_wayland_priv_get_exported_destroy_func_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return TRUE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } GDestroyNotify * gdk_window_impl_wayland_priv_get_exported_destroy_func_ptr_or_null(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return (GDestroyNotify *)&((struct _GdkWindowImplWayland_v3_22_0*)self)->exported.destroy_func; case 1: return NULL; case 2: return NULL; case 3: return NULL; case 4: return NULL; case 5: return NULL; case 6: return NULL; case 7: return NULL; case 8: return NULL; case 9: return NULL; case 10: return NULL; case 11: return NULL; case 12: return NULL; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::imported_transient_for gboolean gdk_window_impl_wayland_priv_get_imported_transient_for_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return TRUE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_imported_v1 * gdk_window_impl_wayland_priv_get_imported_transient_for_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return ((struct _GdkWindowImplWayland_v3_22_0*)self)->imported_transient_for; case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->imported_transient_for; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->imported_transient_for; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->imported_transient_for; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->imported_transient_for; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->imported_transient_for; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->imported_transient_for; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->imported_transient_for; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->imported_transient_for; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->imported_transient_for; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->imported_transient_for; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->imported_transient_for; case 12: g_error("GdkWindowImplWayland::imported_transient_for not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_imported_transient_for_or_abort(GdkWindowImplWayland * self, struct zxdg_imported_v1 * imported_transient_for) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: ((struct _GdkWindowImplWayland_v3_22_0*)self)->imported_transient_for = imported_transient_for; break; case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->imported_transient_for = imported_transient_for; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->imported_transient_for = imported_transient_for; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->imported_transient_for = imported_transient_for; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->imported_transient_for = imported_transient_for; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->imported_transient_for = imported_transient_for; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->imported_transient_for = imported_transient_for; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->imported_transient_for = imported_transient_for; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->imported_transient_for = imported_transient_for; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->imported_transient_for = imported_transient_for; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->imported_transient_for = imported_transient_for; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->imported_transient_for = imported_transient_for; break; case 12: g_error("GdkWindowImplWayland::imported_transient_for not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.handle gboolean gdk_window_impl_wayland_priv_get_exported_handle_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } char * gdk_window_impl_wayland_priv_get_exported_handle_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.handle not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.handle; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.handle; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.handle; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.handle; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.handle; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.handle; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.handle; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.handle; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.handle; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.handle; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.handle; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.handle; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_exported_handle_or_abort(GdkWindowImplWayland * self, char * exported_handle) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.handle not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.handle = exported_handle; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.handle = exported_handle; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.handle = exported_handle; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.handle = exported_handle; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.handle = exported_handle; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.handle = exported_handle; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.handle = exported_handle; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.handle = exported_handle; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.handle = exported_handle; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.handle = exported_handle; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.handle = exported_handle; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.handle = exported_handle; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.export_count gboolean gdk_window_impl_wayland_priv_get_exported_export_count_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_exported_export_count_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.export_count not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.export_count; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.export_count; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.export_count; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.export_count; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.export_count; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.export_count; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.export_count; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.export_count; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.export_count; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.export_count; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.export_count; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.export_count; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_exported_export_count_or_abort(GdkWindowImplWayland * self, int exported_export_count) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.export_count not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.export_count = exported_export_count; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.export_count = exported_export_count; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.export_count = exported_export_count; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.export_count = exported_export_count; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.export_count = exported_export_count; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.export_count = exported_export_count; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.export_count = exported_export_count; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.export_count = exported_export_count; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.export_count = exported_export_count; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.export_count = exported_export_count; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.export_count = exported_export_count; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.export_count = exported_export_count; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.closures gboolean gdk_window_impl_wayland_priv_get_exported_closures_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } GList * gdk_window_impl_wayland_priv_get_exported_closures_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.closures not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.closures; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.closures; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.closures; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.closures; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.closures; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.closures; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.closures; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.closures; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.closures; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.closures; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.closures; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.closures; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_exported_closures_or_abort(GdkWindowImplWayland * self, GList * exported_closures) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.closures not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.closures = exported_closures; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.closures = exported_closures; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.closures = exported_closures; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.closures = exported_closures; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.closures = exported_closures; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.closures = exported_closures; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.closures = exported_closures; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.closures = exported_closures; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.closures = exported_closures; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.closures = exported_closures; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.closures = exported_closures; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.closures = exported_closures; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::exported.idle_source_id gboolean gdk_window_impl_wayland_priv_get_exported_idle_source_id_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } guint gdk_window_impl_wayland_priv_get_exported_idle_source_id_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.idle_source_id not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.idle_source_id; case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.idle_source_id; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.idle_source_id; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.idle_source_id; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.idle_source_id; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.idle_source_id; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.idle_source_id; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.idle_source_id; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.idle_source_id; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.idle_source_id; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.idle_source_id; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.idle_source_id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_exported_idle_source_id_or_abort(GdkWindowImplWayland * self, guint exported_idle_source_id) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::exported.idle_source_id not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindowImplWayland_v3_22_16*)self)->exported.idle_source_id = exported_idle_source_id; break; case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->exported.idle_source_id = exported_idle_source_id; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->exported.idle_source_id = exported_idle_source_id; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->exported.idle_source_id = exported_idle_source_id; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->exported.idle_source_id = exported_idle_source_id; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->exported.idle_source_id = exported_idle_source_id; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->exported.idle_source_id = exported_idle_source_id; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->exported.idle_source_id = exported_idle_source_id; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->exported.idle_source_id = exported_idle_source_id; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->exported.idle_source_id = exported_idle_source_id; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->exported.idle_source_id = exported_idle_source_id; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->exported.idle_source_id = exported_idle_source_id; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::shortcuts_inhibitors gboolean gdk_window_impl_wayland_priv_get_shortcuts_inhibitors_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return TRUE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } GHashTable * gdk_window_impl_wayland_priv_get_shortcuts_inhibitors_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::shortcuts_inhibitors not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::shortcuts_inhibitors not supported on this GTK"); g_abort(); case 2: return ((struct _GdkWindowImplWayland_v3_22_18*)self)->shortcuts_inhibitors; case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->shortcuts_inhibitors; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->shortcuts_inhibitors; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->shortcuts_inhibitors; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->shortcuts_inhibitors; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->shortcuts_inhibitors; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->shortcuts_inhibitors; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->shortcuts_inhibitors; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->shortcuts_inhibitors; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->shortcuts_inhibitors; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->shortcuts_inhibitors; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_shortcuts_inhibitors_or_abort(GdkWindowImplWayland * self, GHashTable * shortcuts_inhibitors) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::shortcuts_inhibitors not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::shortcuts_inhibitors not supported on this GTK"); g_abort(); case 2: ((struct _GdkWindowImplWayland_v3_22_18*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->shortcuts_inhibitors = shortcuts_inhibitors; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.server_decoration gboolean gdk_window_impl_wayland_priv_get_display_server_server_decoration_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return TRUE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct org_kde_kwin_server_decoration * gdk_window_impl_wayland_priv_get_display_server_server_decoration_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 3: return ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.server_decoration; case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.server_decoration; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.server_decoration; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.server_decoration; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.server_decoration; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.server_decoration; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.server_decoration; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.server_decoration; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.server_decoration; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.server_decoration; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_server_decoration_or_abort(GdkWindowImplWayland * self, struct org_kde_kwin_server_decoration * display_server_server_decoration) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.server_decoration not supported on this GTK"); g_abort(); case 3: ((struct _GdkWindowImplWayland_v3_22_25*)self)->display_server.server_decoration = display_server_server_decoration; break; case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.server_decoration = display_server_server_decoration; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.server_decoration = display_server_server_decoration; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.server_decoration = display_server_server_decoration; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.server_decoration = display_server_server_decoration; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.server_decoration = display_server_server_decoration; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.server_decoration = display_server_server_decoration; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.server_decoration = display_server_server_decoration; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.server_decoration = display_server_server_decoration; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.server_decoration = display_server_server_decoration; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_surface gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_surface_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct xdg_surface * gdk_window_impl_wayland_priv_get_display_server_xdg_surface_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_surface; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_surface; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_surface; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_surface; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_surface; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_surface; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_surface; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_surface; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_surface_or_abort(GdkWindowImplWayland * self, struct xdg_surface * display_server_xdg_surface) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_surface not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_surface = display_server_xdg_surface; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_surface = display_server_xdg_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_toplevel gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_toplevel_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct xdg_toplevel * gdk_window_impl_wayland_priv_get_display_server_xdg_toplevel_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_toplevel; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_toplevel; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_toplevel; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_toplevel; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_toplevel; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_toplevel; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_toplevel; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_toplevel; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_toplevel; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_toplevel_or_abort(GdkWindowImplWayland * self, struct xdg_toplevel * display_server_xdg_toplevel) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_toplevel not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_toplevel = display_server_xdg_toplevel; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_popup gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_popup_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct xdg_popup * gdk_window_impl_wayland_priv_get_display_server_xdg_popup_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_popup; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_popup; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_popup; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_popup; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_popup; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_popup; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_popup; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_popup; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_popup; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_popup_or_abort(GdkWindowImplWayland * self, struct xdg_popup * display_server_xdg_popup) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_popup not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.xdg_popup = display_server_xdg_popup; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_popup = display_server_xdg_popup; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.zxdg_surface_v6 gboolean gdk_window_impl_wayland_priv_get_display_server_zxdg_surface_v6_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_surface_v6 * gdk_window_impl_wayland_priv_get_display_server_zxdg_surface_v6_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_surface_v6; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_surface_v6; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_surface_v6; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_surface_v6; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_surface_v6; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_surface_v6; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_surface_v6; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_surface_v6; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_surface_v6; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_zxdg_surface_v6_or_abort(GdkWindowImplWayland * self, struct zxdg_surface_v6 * display_server_zxdg_surface_v6) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_surface_v6 not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_surface_v6 = display_server_zxdg_surface_v6; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.zxdg_toplevel_v6 gboolean gdk_window_impl_wayland_priv_get_display_server_zxdg_toplevel_v6_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_toplevel_v6 * gdk_window_impl_wayland_priv_get_display_server_zxdg_toplevel_v6_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_toplevel_v6; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_toplevel_v6; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_toplevel_v6; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_toplevel_v6; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_toplevel_v6; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_toplevel_v6; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_toplevel_v6; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_toplevel_v6; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_toplevel_v6; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_zxdg_toplevel_v6_or_abort(GdkWindowImplWayland * self, struct zxdg_toplevel_v6 * display_server_zxdg_toplevel_v6) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_toplevel_v6 not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_toplevel_v6 = display_server_zxdg_toplevel_v6; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.zxdg_popup_v6 gboolean gdk_window_impl_wayland_priv_get_display_server_zxdg_popup_v6_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return TRUE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_popup_v6 * gdk_window_impl_wayland_priv_get_display_server_zxdg_popup_v6_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 4: return ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_popup_v6; case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_popup_v6; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_popup_v6; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_popup_v6; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_popup_v6; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_popup_v6; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_popup_v6; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_popup_v6; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_popup_v6; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_zxdg_popup_v6_or_abort(GdkWindowImplWayland * self, struct zxdg_popup_v6 * display_server_zxdg_popup_v6) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.zxdg_popup_v6 not supported on this GTK"); g_abort(); case 4: ((struct _GdkWindowImplWayland_v3_22_30*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.zxdg_popup_v6 = display_server_zxdg_popup_v6; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::using_csd gboolean gdk_window_impl_wayland_priv_get_using_csd_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return TRUE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } unsigned int gdk_window_impl_wayland_priv_get_using_csd_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 5: return ((struct _GdkWindowImplWayland_v3_23_1*)self)->using_csd; case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->using_csd; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->using_csd; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->using_csd; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->using_csd; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->using_csd; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->using_csd; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->using_csd; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_using_csd_or_abort(GdkWindowImplWayland * self, unsigned int using_csd) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::using_csd not supported on this GTK"); g_abort(); case 5: ((struct _GdkWindowImplWayland_v3_23_1*)self)->using_csd = using_csd; break; case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->using_csd = using_csd; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->using_csd = using_csd; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->using_csd = using_csd; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->using_csd = using_csd; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->using_csd = using_csd; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->using_csd = using_csd; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->using_csd = using_csd; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::subsurface_x gboolean gdk_window_impl_wayland_priv_get_subsurface_x_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_subsurface_x_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->subsurface_x; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->subsurface_x; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->subsurface_x; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->subsurface_x; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->subsurface_x; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->subsurface_x; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->subsurface_x; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_subsurface_x_or_abort(GdkWindowImplWayland * self, int subsurface_x) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::subsurface_x not supported on this GTK"); g_abort(); case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->subsurface_x = subsurface_x; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->subsurface_x = subsurface_x; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->subsurface_x = subsurface_x; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->subsurface_x = subsurface_x; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->subsurface_x = subsurface_x; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->subsurface_x = subsurface_x; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->subsurface_x = subsurface_x; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::subsurface_y gboolean gdk_window_impl_wayland_priv_get_subsurface_y_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return TRUE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_subsurface_y_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 6: return ((struct _GdkWindowImplWayland_v3_23_3*)self)->subsurface_y; case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->subsurface_y; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->subsurface_y; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->subsurface_y; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->subsurface_y; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->subsurface_y; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->subsurface_y; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_subsurface_y_or_abort(GdkWindowImplWayland * self, int subsurface_y) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::subsurface_y not supported on this GTK"); g_abort(); case 6: ((struct _GdkWindowImplWayland_v3_23_3*)self)->subsurface_y = subsurface_y; break; case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->subsurface_y = subsurface_y; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->subsurface_y = subsurface_y; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->subsurface_y = subsurface_y; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->subsurface_y = subsurface_y; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->subsurface_y = subsurface_y; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->subsurface_y = subsurface_y; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::configuring_popup gboolean gdk_window_impl_wayland_priv_get_configuring_popup_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return TRUE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } unsigned int gdk_window_impl_wayland_priv_get_configuring_popup_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 7: return ((struct _GdkWindowImplWayland_v3_24_4*)self)->configuring_popup; case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->configuring_popup; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->configuring_popup; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->configuring_popup; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->configuring_popup; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->configuring_popup; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_configuring_popup_or_abort(GdkWindowImplWayland * self, unsigned int configuring_popup) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::configuring_popup not supported on this GTK"); g_abort(); case 7: ((struct _GdkWindowImplWayland_v3_24_4*)self)->configuring_popup = configuring_popup; break; case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->configuring_popup = configuring_popup; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->configuring_popup = configuring_popup; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->configuring_popup = configuring_popup; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->configuring_popup = configuring_popup; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->configuring_popup = configuring_popup; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::unconfigured_width gboolean gdk_window_impl_wayland_priv_get_unconfigured_width_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_unconfigured_width_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->unconfigured_width; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->unconfigured_width; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->unconfigured_width; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->unconfigured_width; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->unconfigured_width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_unconfigured_width_or_abort(GdkWindowImplWayland * self, int unconfigured_width) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::unconfigured_width not supported on this GTK"); g_abort(); case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->unconfigured_width = unconfigured_width; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->unconfigured_width = unconfigured_width; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->unconfigured_width = unconfigured_width; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->unconfigured_width = unconfigured_width; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->unconfigured_width = unconfigured_width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::unconfigured_height gboolean gdk_window_impl_wayland_priv_get_unconfigured_height_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_unconfigured_height_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->unconfigured_height; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->unconfigured_height; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->unconfigured_height; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->unconfigured_height; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->unconfigured_height; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_unconfigured_height_or_abort(GdkWindowImplWayland * self, int unconfigured_height) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::unconfigured_height not supported on this GTK"); g_abort(); case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->unconfigured_height = unconfigured_height; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->unconfigured_height = unconfigured_height; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->unconfigured_height = unconfigured_height; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->unconfigured_height = unconfigured_height; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->unconfigured_height = unconfigured_height; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::fixed_size_width gboolean gdk_window_impl_wayland_priv_get_fixed_size_width_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_fixed_size_width_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->fixed_size_width; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->fixed_size_width; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->fixed_size_width; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->fixed_size_width; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->fixed_size_width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_fixed_size_width_or_abort(GdkWindowImplWayland * self, int fixed_size_width) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::fixed_size_width not supported on this GTK"); g_abort(); case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->fixed_size_width = fixed_size_width; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->fixed_size_width = fixed_size_width; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->fixed_size_width = fixed_size_width; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->fixed_size_width = fixed_size_width; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->fixed_size_width = fixed_size_width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::fixed_size_height gboolean gdk_window_impl_wayland_priv_get_fixed_size_height_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return TRUE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } int gdk_window_impl_wayland_priv_get_fixed_size_height_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 8: return ((struct _GdkWindowImplWayland_v3_24_17*)self)->fixed_size_height; case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->fixed_size_height; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->fixed_size_height; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->fixed_size_height; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->fixed_size_height; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_fixed_size_height_or_abort(GdkWindowImplWayland * self, int fixed_size_height) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::fixed_size_height not supported on this GTK"); g_abort(); case 8: ((struct _GdkWindowImplWayland_v3_24_17*)self)->fixed_size_height = fixed_size_height; break; case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->fixed_size_height = fixed_size_height; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->fixed_size_height = fixed_size_height; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->fixed_size_height = fixed_size_height; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->fixed_size_height = fixed_size_height; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::saved_size_changed gboolean gdk_window_impl_wayland_priv_get_saved_size_changed_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return TRUE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } gboolean gdk_window_impl_wayland_priv_get_saved_size_changed_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 9: return ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_size_changed; case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_size_changed; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_size_changed; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_size_changed; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_saved_size_changed_or_abort(GdkWindowImplWayland * self, gboolean saved_size_changed) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::saved_size_changed not supported on this GTK"); g_abort(); case 9: ((struct _GdkWindowImplWayland_v3_24_22*)self)->saved_size_changed = saved_size_changed; break; case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->saved_size_changed = saved_size_changed; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->saved_size_changed = saved_size_changed; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->saved_size_changed = saved_size_changed; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::surface_callback gboolean gdk_window_impl_wayland_priv_get_surface_callback_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct wl_callback * gdk_window_impl_wayland_priv_get_surface_callback_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->surface_callback; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->surface_callback; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->surface_callback; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_surface_callback_or_abort(GdkWindowImplWayland * self, struct wl_callback * surface_callback) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::surface_callback not supported on this GTK"); g_abort(); case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->surface_callback = surface_callback; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->surface_callback = surface_callback; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->surface_callback = surface_callback; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::frame_callback_surfaces gboolean gdk_window_impl_wayland_priv_get_frame_callback_surfaces_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return TRUE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } GHashTable * gdk_window_impl_wayland_priv_get_frame_callback_surfaces_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 10: return ((struct _GdkWindowImplWayland_v3_24_25*)self)->frame_callback_surfaces; case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->frame_callback_surfaces; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->frame_callback_surfaces; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_frame_callback_surfaces_or_abort(GdkWindowImplWayland * self, GHashTable * frame_callback_surfaces) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::frame_callback_surfaces not supported on this GTK"); g_abort(); case 10: ((struct _GdkWindowImplWayland_v3_24_25*)self)->frame_callback_surfaces = frame_callback_surfaces; break; case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->frame_callback_surfaces = frame_callback_surfaces; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->frame_callback_surfaces = frame_callback_surfaces; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::suspended gboolean gdk_window_impl_wayland_priv_get_suspended_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } unsigned int gdk_window_impl_wayland_priv_get_suspended_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->suspended; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->suspended; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_suspended_or_abort(GdkWindowImplWayland * self, unsigned int suspended) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::suspended not supported on this GTK"); g_abort(); case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->suspended = suspended; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->suspended = suspended; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::pending.suspended gboolean gdk_window_impl_wayland_priv_get_pending_suspended_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return TRUE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } gboolean gdk_window_impl_wayland_priv_get_pending_suspended_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 11: return ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.suspended; case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.suspended; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_pending_suspended_or_abort(GdkWindowImplWayland * self, gboolean pending_suspended) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::pending.suspended not supported on this GTK"); g_abort(); case 11: ((struct _GdkWindowImplWayland_v3_24_40*)self)->pending.suspended = pending_suspended; break; case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->pending.suspended = pending_suspended; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_exported_v1 gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_exported_v1_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_exported_v1 * gdk_window_impl_wayland_priv_get_display_server_xdg_exported_v1_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_exported_v1; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_exported_v1_or_abort(GdkWindowImplWayland * self, struct zxdg_exported_v1 * display_server_xdg_exported_v1) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::display_server.xdg_exported_v1 not supported on this GTK"); g_abort(); case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_exported_v1 = display_server_xdg_exported_v1; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::display_server.xdg_exported_v2 gboolean gdk_window_impl_wayland_priv_get_display_server_xdg_exported_v2_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_exported_v2 * gdk_window_impl_wayland_priv_get_display_server_xdg_exported_v2_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_exported_v2; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_display_server_xdg_exported_v2_or_abort(GdkWindowImplWayland * self, struct zxdg_exported_v2 * display_server_xdg_exported_v2) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::display_server.xdg_exported_v2 not supported on this GTK"); g_abort(); case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->display_server.xdg_exported_v2 = display_server_xdg_exported_v2; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::imported_v1_transient_for gboolean gdk_window_impl_wayland_priv_get_imported_v1_transient_for_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_imported_v1 * gdk_window_impl_wayland_priv_get_imported_v1_transient_for_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->imported_v1_transient_for; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_imported_v1_transient_for_or_abort(GdkWindowImplWayland * self, struct zxdg_imported_v1 * imported_v1_transient_for) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::imported_v1_transient_for not supported on this GTK"); g_abort(); case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->imported_v1_transient_for = imported_v1_transient_for; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindowImplWayland::imported_v2_transient_for gboolean gdk_window_impl_wayland_priv_get_imported_v2_transient_for_supported() { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return FALSE; case 3: return FALSE; case 4: return FALSE; case 5: return FALSE; case 6: return FALSE; case 7: return FALSE; case 8: return FALSE; case 9: return FALSE; case 10: return FALSE; case 11: return FALSE; case 12: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } struct zxdg_imported_v2 * gdk_window_impl_wayland_priv_get_imported_v2_transient_for_or_abort(GdkWindowImplWayland * self) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 12: return ((struct _GdkWindowImplWayland_v3_24_44*)self)->imported_v2_transient_for; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_impl_wayland_priv_set_imported_v2_transient_for_or_abort(GdkWindowImplWayland * self, struct zxdg_imported_v2 * imported_v2_transient_for) { switch (gdk_window_impl_wayland_priv_get_version_id()) { case 0: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 1: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 2: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 3: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 4: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 5: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 6: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 7: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 8: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 9: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 10: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 11: g_error("GdkWindowImplWayland::imported_v2_transient_for not supported on this GTK"); g_abort(); case 12: ((struct _GdkWindowImplWayland_v3_24_44*)self)->imported_v2_transient_for = imported_v2_transient_for; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WINDOW_IMPL_WAYLAND_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/h/gdk_window_priv.h000066400000000000000000002177521466775474600221330ustar00rootroot00000000000000/* AUTOGENERATED, DO NOT EDIT DIRECTLY * See gtk-priv/README.md for more information * * This file is part of gtk-layer-shell * * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald * Copyright © 2024 gtk-priv/scripts/code.py * * This program 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 3 of the License, or (at your option) any later version. * * This program 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 program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef GDK_WINDOW_PRIV_H #define GDK_WINDOW_PRIV_H #include "common.h" typedef struct _GdkWindow GdkWindow; // Version ID 0 // Valid for GTK v3.22.0 - v3.22.18 struct _GdkWindow_v3_22_0 { GObject parent_instance; GdkWindowImpl *impl; GdkWindow *parent; GdkWindow *transient_for; GdkVisual *visual; gpointer user_data; gint x; gint y; GdkEventMask event_mask; guint8 window_type; guint8 depth; guint8 resize_count; gint8 toplevel_window_type; GList *filters; GList *children; GList children_list_node; GList *native_children; cairo_pattern_t *background; struct { cairo_surface_t *surface; cairo_region_t *region; cairo_region_t *flushed_region; cairo_region_t *need_blend_region; gboolean surface_needs_composite; gboolean use_gl; } current_paint; GdkGLContext *gl_paint_context; cairo_region_t *update_area; guint update_freeze_count; cairo_region_t *active_update_area; cairo_region_t * old_updated_area[2]; GdkWindowState old_state; GdkWindowState state; guint8 alpha; guint8 fullscreen_mode; guint input_only : 1; guint pass_through : 1; guint modal_hint : 1; guint composited : 1; guint has_alpha_background : 1; guint destroyed : 2; guint accept_focus : 1; guint focus_on_map : 1; guint shaped : 1; guint support_multidevice : 1; guint synthesize_crossing_event_queued : 1; guint effective_visibility : 2; guint visibility : 2; guint native_visibility : 2; guint viewable : 1; guint applied_shape : 1; guint in_update : 1; guint geometry_dirty : 1; guint event_compression : 1; guint frame_clock_events_paused : 1; GdkWindow *impl_window; guint update_and_descendants_freeze_count; gint abs_x; gint abs_y; gint width; gint height; gint shadow_top; gint shadow_left; gint shadow_right; gint shadow_bottom; guint num_offscreen_children; cairo_region_t *clip_region; GdkCursor *cursor; GHashTable *device_cursor; cairo_region_t *shape; cairo_region_t *input_shape; GList *devices_inside; GHashTable *device_events; GHashTable *source_event_masks; gulong device_added_handler_id; gulong device_changed_handler_id; GdkFrameClock *frame_clock; GdkWindowInvalidateHandlerFunc invalidate_handler; GdkDrawingContext *drawing_context; }; // Version ID 1 // Diff from previous version: // + cairo_region_t *opaque_region; // Valid for GTK v3.22.19 - v3.24.10 struct _GdkWindow_v3_22_19 { GObject parent_instance; GdkWindowImpl *impl; GdkWindow *parent; GdkWindow *transient_for; GdkVisual *visual; gpointer user_data; gint x; gint y; GdkEventMask event_mask; guint8 window_type; guint8 depth; guint8 resize_count; gint8 toplevel_window_type; GList *filters; GList *children; GList children_list_node; GList *native_children; cairo_pattern_t *background; struct { cairo_surface_t *surface; cairo_region_t *region; cairo_region_t *flushed_region; cairo_region_t *need_blend_region; gboolean surface_needs_composite; gboolean use_gl; } current_paint; GdkGLContext *gl_paint_context; cairo_region_t *update_area; guint update_freeze_count; cairo_region_t *active_update_area; cairo_region_t * old_updated_area[2]; GdkWindowState old_state; GdkWindowState state; guint8 alpha; guint8 fullscreen_mode; guint input_only : 1; guint pass_through : 1; guint modal_hint : 1; guint composited : 1; guint has_alpha_background : 1; guint destroyed : 2; guint accept_focus : 1; guint focus_on_map : 1; guint shaped : 1; guint support_multidevice : 1; guint synthesize_crossing_event_queued : 1; guint effective_visibility : 2; guint visibility : 2; guint native_visibility : 2; guint viewable : 1; guint applied_shape : 1; guint in_update : 1; guint geometry_dirty : 1; guint event_compression : 1; guint frame_clock_events_paused : 1; GdkWindow *impl_window; guint update_and_descendants_freeze_count; gint abs_x; gint abs_y; gint width; gint height; gint shadow_top; gint shadow_left; gint shadow_right; gint shadow_bottom; guint num_offscreen_children; cairo_region_t *clip_region; GdkCursor *cursor; GHashTable *device_cursor; cairo_region_t *shape; cairo_region_t *input_shape; GList *devices_inside; GHashTable *device_events; GHashTable *source_event_masks; gulong device_added_handler_id; gulong device_changed_handler_id; GdkFrameClock *frame_clock; GdkWindowInvalidateHandlerFunc invalidate_handler; GdkDrawingContext *drawing_context; cairo_region_t *opaque_region; }; // Version ID 2 // Diff from previous version: // + guint synthesized_crossing_event_id; // - guint synthesize_crossing_event_queued : 1; // Valid for GTK v3.24.11 - v3.24.44 (unreleased) struct _GdkWindow_v3_24_11 { GObject parent_instance; GdkWindowImpl *impl; GdkWindow *parent; GdkWindow *transient_for; GdkVisual *visual; gpointer user_data; gint x; gint y; GdkEventMask event_mask; guint8 window_type; guint8 depth; guint8 resize_count; gint8 toplevel_window_type; GList *filters; GList *children; GList children_list_node; GList *native_children; cairo_pattern_t *background; struct { cairo_surface_t *surface; cairo_region_t *region; cairo_region_t *flushed_region; cairo_region_t *need_blend_region; gboolean surface_needs_composite; gboolean use_gl; } current_paint; GdkGLContext *gl_paint_context; cairo_region_t *update_area; guint update_freeze_count; cairo_region_t *active_update_area; cairo_region_t * old_updated_area[2]; GdkWindowState old_state; GdkWindowState state; guint synthesized_crossing_event_id; guint8 alpha; guint8 fullscreen_mode; guint input_only : 1; guint pass_through : 1; guint modal_hint : 1; guint composited : 1; guint has_alpha_background : 1; guint destroyed : 2; guint accept_focus : 1; guint focus_on_map : 1; guint shaped : 1; guint support_multidevice : 1; guint effective_visibility : 2; guint visibility : 2; guint native_visibility : 2; guint viewable : 1; guint applied_shape : 1; guint in_update : 1; guint geometry_dirty : 1; guint event_compression : 1; guint frame_clock_events_paused : 1; GdkWindow *impl_window; guint update_and_descendants_freeze_count; gint abs_x; gint abs_y; gint width; gint height; gint shadow_top; gint shadow_left; gint shadow_right; gint shadow_bottom; guint num_offscreen_children; cairo_region_t *clip_region; GdkCursor *cursor; GHashTable *device_cursor; cairo_region_t *shape; cairo_region_t *input_shape; GList *devices_inside; GHashTable *device_events; GHashTable *source_event_masks; gulong device_added_handler_id; gulong device_changed_handler_id; GdkFrameClock *frame_clock; GdkWindowInvalidateHandlerFunc invalidate_handler; GdkDrawingContext *drawing_context; cairo_region_t *opaque_region; }; // For internal use only int gdk_window_priv_get_version_id() { static int version_id = -1; if (version_id == -1) { gtk_priv_assert_gtk_version_valid(); int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version(); switch (combo) { case 22000: case 22001: case 22002: case 22003: case 22004: case 22005: case 22006: case 22007: case 22008: case 22009: case 22010: case 22011: case 22012: case 22013: case 22014: case 22015: case 22016: case 22017: case 22018: case 22019: case 22020: case 22021: case 22022: case 22023: case 22024: case 22025: case 22026: case 22027: case 22028: case 22029: case 22030: case 23000: case 23001: case 23002: case 23003: case 24000: case 24001: case 24002: case 24003: case 24004: case 24005: case 24006: case 24007: case 24008: case 24009: case 24010: case 24011: case 24012: case 24013: case 24014: case 24015: case 24016: case 24017: case 24018: case 24020: case 24021: case 24022: case 24023: case 24024: case 24025: case 24026: case 24027: case 24028: case 24029: case 24030: case 24031: case 24032: case 24033: case 24034: case 24035: case 24036: case 24037: case 24038: case 24039: case 24040: case 24041: case 24042: case 24043: break; default: gtk_priv_warn_gtk_version_may_be_unsupported(); } if (combo >= 24011) { version_id = 2; } else if (combo >= 22019) { version_id = 1; } else { version_id = 0; } } return version_id; } // GdkWindow::parent_instance GObject * gdk_window_priv_get_parent_instance_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GObject *)&((struct _GdkWindow_v3_22_0*)self)->parent_instance; case 1: return (GObject *)&((struct _GdkWindow_v3_22_19*)self)->parent_instance; case 2: return (GObject *)&((struct _GdkWindow_v3_24_11*)self)->parent_instance; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::impl GdkWindowImpl * gdk_window_priv_get_impl(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->impl; case 1: return ((struct _GdkWindow_v3_22_19*)self)->impl; case 2: return ((struct _GdkWindow_v3_24_11*)self)->impl; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_impl(GdkWindow * self, GdkWindowImpl * impl) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->impl = impl; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->impl = impl; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->impl = impl; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::parent GdkWindow * gdk_window_priv_get_parent(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->parent; case 1: return ((struct _GdkWindow_v3_22_19*)self)->parent; case 2: return ((struct _GdkWindow_v3_24_11*)self)->parent; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_parent(GdkWindow * self, GdkWindow * parent) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->parent = parent; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->parent = parent; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->parent = parent; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::transient_for GdkWindow * gdk_window_priv_get_transient_for(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->transient_for; case 1: return ((struct _GdkWindow_v3_22_19*)self)->transient_for; case 2: return ((struct _GdkWindow_v3_24_11*)self)->transient_for; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_transient_for(GdkWindow * self, GdkWindow * transient_for) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->transient_for = transient_for; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->transient_for = transient_for; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->transient_for = transient_for; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::visual GdkVisual * gdk_window_priv_get_visual(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->visual; case 1: return ((struct _GdkWindow_v3_22_19*)self)->visual; case 2: return ((struct _GdkWindow_v3_24_11*)self)->visual; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_visual(GdkWindow * self, GdkVisual * visual) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->visual = visual; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->visual = visual; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->visual = visual; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::user_data gpointer gdk_window_priv_get_user_data(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->user_data; case 1: return ((struct _GdkWindow_v3_22_19*)self)->user_data; case 2: return ((struct _GdkWindow_v3_24_11*)self)->user_data; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_user_data(GdkWindow * self, gpointer user_data) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->user_data = user_data; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->user_data = user_data; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->user_data = user_data; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::x gint gdk_window_priv_get_x(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->x; case 1: return ((struct _GdkWindow_v3_22_19*)self)->x; case 2: return ((struct _GdkWindow_v3_24_11*)self)->x; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_x(GdkWindow * self, gint x) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->x = x; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->x = x; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->x = x; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::y gint gdk_window_priv_get_y(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->y; case 1: return ((struct _GdkWindow_v3_22_19*)self)->y; case 2: return ((struct _GdkWindow_v3_24_11*)self)->y; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_y(GdkWindow * self, gint y) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->y = y; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->y = y; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->y = y; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::event_mask GdkEventMask * gdk_window_priv_get_event_mask_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GdkEventMask *)&((struct _GdkWindow_v3_22_0*)self)->event_mask; case 1: return (GdkEventMask *)&((struct _GdkWindow_v3_22_19*)self)->event_mask; case 2: return (GdkEventMask *)&((struct _GdkWindow_v3_24_11*)self)->event_mask; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::window_type guint8 * gdk_window_priv_get_window_type_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (guint8 *)&((struct _GdkWindow_v3_22_0*)self)->window_type; case 1: return (guint8 *)&((struct _GdkWindow_v3_22_19*)self)->window_type; case 2: return (guint8 *)&((struct _GdkWindow_v3_24_11*)self)->window_type; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::depth guint8 * gdk_window_priv_get_depth_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (guint8 *)&((struct _GdkWindow_v3_22_0*)self)->depth; case 1: return (guint8 *)&((struct _GdkWindow_v3_22_19*)self)->depth; case 2: return (guint8 *)&((struct _GdkWindow_v3_24_11*)self)->depth; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::resize_count guint8 * gdk_window_priv_get_resize_count_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (guint8 *)&((struct _GdkWindow_v3_22_0*)self)->resize_count; case 1: return (guint8 *)&((struct _GdkWindow_v3_22_19*)self)->resize_count; case 2: return (guint8 *)&((struct _GdkWindow_v3_24_11*)self)->resize_count; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::toplevel_window_type gint8 * gdk_window_priv_get_toplevel_window_type_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (gint8 *)&((struct _GdkWindow_v3_22_0*)self)->toplevel_window_type; case 1: return (gint8 *)&((struct _GdkWindow_v3_22_19*)self)->toplevel_window_type; case 2: return (gint8 *)&((struct _GdkWindow_v3_24_11*)self)->toplevel_window_type; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::filters GList * gdk_window_priv_get_filters(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->filters; case 1: return ((struct _GdkWindow_v3_22_19*)self)->filters; case 2: return ((struct _GdkWindow_v3_24_11*)self)->filters; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_filters(GdkWindow * self, GList * filters) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->filters = filters; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->filters = filters; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->filters = filters; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::children GList * gdk_window_priv_get_children(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->children; case 1: return ((struct _GdkWindow_v3_22_19*)self)->children; case 2: return ((struct _GdkWindow_v3_24_11*)self)->children; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_children(GdkWindow * self, GList * children) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->children = children; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->children = children; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->children = children; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::children_list_node GList * gdk_window_priv_get_children_list_node_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GList *)&((struct _GdkWindow_v3_22_0*)self)->children_list_node; case 1: return (GList *)&((struct _GdkWindow_v3_22_19*)self)->children_list_node; case 2: return (GList *)&((struct _GdkWindow_v3_24_11*)self)->children_list_node; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::native_children GList * gdk_window_priv_get_native_children(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->native_children; case 1: return ((struct _GdkWindow_v3_22_19*)self)->native_children; case 2: return ((struct _GdkWindow_v3_24_11*)self)->native_children; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_native_children(GdkWindow * self, GList * native_children) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->native_children = native_children; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->native_children = native_children; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->native_children = native_children; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::background cairo_pattern_t * gdk_window_priv_get_background(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->background; case 1: return ((struct _GdkWindow_v3_22_19*)self)->background; case 2: return ((struct _GdkWindow_v3_24_11*)self)->background; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_background(GdkWindow * self, cairo_pattern_t * background) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->background = background; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->background = background; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->background = background; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.surface cairo_surface_t * gdk_window_priv_get_current_paint_surface(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.surface; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.surface; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.surface; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_surface(GdkWindow * self, cairo_surface_t * current_paint_surface) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.surface = current_paint_surface; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.surface = current_paint_surface; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.surface = current_paint_surface; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.region cairo_region_t * gdk_window_priv_get_current_paint_region(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.region; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.region; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_region(GdkWindow * self, cairo_region_t * current_paint_region) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.region = current_paint_region; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.region = current_paint_region; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.region = current_paint_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.flushed_region cairo_region_t * gdk_window_priv_get_current_paint_flushed_region(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.flushed_region; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.flushed_region; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.flushed_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_flushed_region(GdkWindow * self, cairo_region_t * current_paint_flushed_region) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.flushed_region = current_paint_flushed_region; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.flushed_region = current_paint_flushed_region; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.flushed_region = current_paint_flushed_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.need_blend_region cairo_region_t * gdk_window_priv_get_current_paint_need_blend_region(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.need_blend_region; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.need_blend_region; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.need_blend_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_need_blend_region(GdkWindow * self, cairo_region_t * current_paint_need_blend_region) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.need_blend_region = current_paint_need_blend_region; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.need_blend_region = current_paint_need_blend_region; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.need_blend_region = current_paint_need_blend_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.surface_needs_composite gboolean gdk_window_priv_get_current_paint_surface_needs_composite(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.surface_needs_composite; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.surface_needs_composite; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.surface_needs_composite; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_surface_needs_composite(GdkWindow * self, gboolean current_paint_surface_needs_composite) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.surface_needs_composite = current_paint_surface_needs_composite; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.surface_needs_composite = current_paint_surface_needs_composite; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.surface_needs_composite = current_paint_surface_needs_composite; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::current_paint.use_gl gboolean gdk_window_priv_get_current_paint_use_gl(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->current_paint.use_gl; case 1: return ((struct _GdkWindow_v3_22_19*)self)->current_paint.use_gl; case 2: return ((struct _GdkWindow_v3_24_11*)self)->current_paint.use_gl; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_current_paint_use_gl(GdkWindow * self, gboolean current_paint_use_gl) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->current_paint.use_gl = current_paint_use_gl; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->current_paint.use_gl = current_paint_use_gl; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->current_paint.use_gl = current_paint_use_gl; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::gl_paint_context GdkGLContext * gdk_window_priv_get_gl_paint_context(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->gl_paint_context; case 1: return ((struct _GdkWindow_v3_22_19*)self)->gl_paint_context; case 2: return ((struct _GdkWindow_v3_24_11*)self)->gl_paint_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_gl_paint_context(GdkWindow * self, GdkGLContext * gl_paint_context) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->gl_paint_context = gl_paint_context; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->gl_paint_context = gl_paint_context; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->gl_paint_context = gl_paint_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::update_area cairo_region_t * gdk_window_priv_get_update_area(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->update_area; case 1: return ((struct _GdkWindow_v3_22_19*)self)->update_area; case 2: return ((struct _GdkWindow_v3_24_11*)self)->update_area; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_update_area(GdkWindow * self, cairo_region_t * update_area) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->update_area = update_area; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->update_area = update_area; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->update_area = update_area; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::update_freeze_count guint gdk_window_priv_get_update_freeze_count(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->update_freeze_count; case 1: return ((struct _GdkWindow_v3_22_19*)self)->update_freeze_count; case 2: return ((struct _GdkWindow_v3_24_11*)self)->update_freeze_count; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_update_freeze_count(GdkWindow * self, guint update_freeze_count) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->update_freeze_count = update_freeze_count; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->update_freeze_count = update_freeze_count; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->update_freeze_count = update_freeze_count; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::active_update_area cairo_region_t * gdk_window_priv_get_active_update_area(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->active_update_area; case 1: return ((struct _GdkWindow_v3_22_19*)self)->active_update_area; case 2: return ((struct _GdkWindow_v3_24_11*)self)->active_update_area; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_active_update_area(GdkWindow * self, cairo_region_t * active_update_area) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->active_update_area = active_update_area; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->active_update_area = active_update_area; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->active_update_area = active_update_area; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::old_updated_area cairo_region_t ** * gdk_window_priv_get_old_updated_area_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (cairo_region_t ** *)&((struct _GdkWindow_v3_22_0*)self)->old_updated_area; case 1: return (cairo_region_t ** *)&((struct _GdkWindow_v3_22_19*)self)->old_updated_area; case 2: return (cairo_region_t ** *)&((struct _GdkWindow_v3_24_11*)self)->old_updated_area; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::old_state GdkWindowState * gdk_window_priv_get_old_state_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GdkWindowState *)&((struct _GdkWindow_v3_22_0*)self)->old_state; case 1: return (GdkWindowState *)&((struct _GdkWindow_v3_22_19*)self)->old_state; case 2: return (GdkWindowState *)&((struct _GdkWindow_v3_24_11*)self)->old_state; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::state GdkWindowState * gdk_window_priv_get_state_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GdkWindowState *)&((struct _GdkWindow_v3_22_0*)self)->state; case 1: return (GdkWindowState *)&((struct _GdkWindow_v3_22_19*)self)->state; case 2: return (GdkWindowState *)&((struct _GdkWindow_v3_24_11*)self)->state; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::alpha guint8 * gdk_window_priv_get_alpha_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (guint8 *)&((struct _GdkWindow_v3_22_0*)self)->alpha; case 1: return (guint8 *)&((struct _GdkWindow_v3_22_19*)self)->alpha; case 2: return (guint8 *)&((struct _GdkWindow_v3_24_11*)self)->alpha; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::fullscreen_mode guint8 * gdk_window_priv_get_fullscreen_mode_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (guint8 *)&((struct _GdkWindow_v3_22_0*)self)->fullscreen_mode; case 1: return (guint8 *)&((struct _GdkWindow_v3_22_19*)self)->fullscreen_mode; case 2: return (guint8 *)&((struct _GdkWindow_v3_24_11*)self)->fullscreen_mode; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::input_only guint gdk_window_priv_get_input_only(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->input_only; case 1: return ((struct _GdkWindow_v3_22_19*)self)->input_only; case 2: return ((struct _GdkWindow_v3_24_11*)self)->input_only; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_input_only(GdkWindow * self, guint input_only) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->input_only = input_only; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->input_only = input_only; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->input_only = input_only; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::pass_through guint gdk_window_priv_get_pass_through(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->pass_through; case 1: return ((struct _GdkWindow_v3_22_19*)self)->pass_through; case 2: return ((struct _GdkWindow_v3_24_11*)self)->pass_through; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_pass_through(GdkWindow * self, guint pass_through) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->pass_through = pass_through; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->pass_through = pass_through; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->pass_through = pass_through; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::modal_hint guint gdk_window_priv_get_modal_hint(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->modal_hint; case 1: return ((struct _GdkWindow_v3_22_19*)self)->modal_hint; case 2: return ((struct _GdkWindow_v3_24_11*)self)->modal_hint; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_modal_hint(GdkWindow * self, guint modal_hint) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->modal_hint = modal_hint; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->modal_hint = modal_hint; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->modal_hint = modal_hint; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::composited guint gdk_window_priv_get_composited(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->composited; case 1: return ((struct _GdkWindow_v3_22_19*)self)->composited; case 2: return ((struct _GdkWindow_v3_24_11*)self)->composited; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_composited(GdkWindow * self, guint composited) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->composited = composited; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->composited = composited; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->composited = composited; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::has_alpha_background guint gdk_window_priv_get_has_alpha_background(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->has_alpha_background; case 1: return ((struct _GdkWindow_v3_22_19*)self)->has_alpha_background; case 2: return ((struct _GdkWindow_v3_24_11*)self)->has_alpha_background; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_has_alpha_background(GdkWindow * self, guint has_alpha_background) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->has_alpha_background = has_alpha_background; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->has_alpha_background = has_alpha_background; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->has_alpha_background = has_alpha_background; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::destroyed guint gdk_window_priv_get_destroyed(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->destroyed; case 1: return ((struct _GdkWindow_v3_22_19*)self)->destroyed; case 2: return ((struct _GdkWindow_v3_24_11*)self)->destroyed; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_destroyed(GdkWindow * self, guint destroyed) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->destroyed = destroyed; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->destroyed = destroyed; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->destroyed = destroyed; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::accept_focus guint gdk_window_priv_get_accept_focus(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->accept_focus; case 1: return ((struct _GdkWindow_v3_22_19*)self)->accept_focus; case 2: return ((struct _GdkWindow_v3_24_11*)self)->accept_focus; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_accept_focus(GdkWindow * self, guint accept_focus) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->accept_focus = accept_focus; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->accept_focus = accept_focus; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->accept_focus = accept_focus; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::focus_on_map guint gdk_window_priv_get_focus_on_map(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->focus_on_map; case 1: return ((struct _GdkWindow_v3_22_19*)self)->focus_on_map; case 2: return ((struct _GdkWindow_v3_24_11*)self)->focus_on_map; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_focus_on_map(GdkWindow * self, guint focus_on_map) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->focus_on_map = focus_on_map; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->focus_on_map = focus_on_map; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->focus_on_map = focus_on_map; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shaped guint gdk_window_priv_get_shaped(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shaped; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shaped; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shaped; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shaped(GdkWindow * self, guint shaped) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shaped = shaped; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shaped = shaped; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shaped = shaped; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::support_multidevice guint gdk_window_priv_get_support_multidevice(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->support_multidevice; case 1: return ((struct _GdkWindow_v3_22_19*)self)->support_multidevice; case 2: return ((struct _GdkWindow_v3_24_11*)self)->support_multidevice; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_support_multidevice(GdkWindow * self, guint support_multidevice) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->support_multidevice = support_multidevice; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->support_multidevice = support_multidevice; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->support_multidevice = support_multidevice; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::synthesize_crossing_event_queued gboolean gdk_window_priv_get_synthesize_crossing_event_queued_supported() { switch (gdk_window_priv_get_version_id()) { case 0: return TRUE; case 1: return TRUE; case 2: return FALSE; default: g_error("Invalid version ID"); g_abort(); } } guint gdk_window_priv_get_synthesize_crossing_event_queued_or_abort(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->synthesize_crossing_event_queued; case 1: return ((struct _GdkWindow_v3_22_19*)self)->synthesize_crossing_event_queued; case 2: g_error("GdkWindow::synthesize_crossing_event_queued not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_synthesize_crossing_event_queued_or_abort(GdkWindow * self, guint synthesize_crossing_event_queued) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->synthesize_crossing_event_queued = synthesize_crossing_event_queued; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->synthesize_crossing_event_queued = synthesize_crossing_event_queued; break; case 2: g_error("GdkWindow::synthesize_crossing_event_queued not supported on this GTK"); g_abort(); default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::effective_visibility guint gdk_window_priv_get_effective_visibility(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->effective_visibility; case 1: return ((struct _GdkWindow_v3_22_19*)self)->effective_visibility; case 2: return ((struct _GdkWindow_v3_24_11*)self)->effective_visibility; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_effective_visibility(GdkWindow * self, guint effective_visibility) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->effective_visibility = effective_visibility; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->effective_visibility = effective_visibility; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->effective_visibility = effective_visibility; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::visibility guint gdk_window_priv_get_visibility(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->visibility; case 1: return ((struct _GdkWindow_v3_22_19*)self)->visibility; case 2: return ((struct _GdkWindow_v3_24_11*)self)->visibility; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_visibility(GdkWindow * self, guint visibility) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->visibility = visibility; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->visibility = visibility; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->visibility = visibility; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::native_visibility guint gdk_window_priv_get_native_visibility(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->native_visibility; case 1: return ((struct _GdkWindow_v3_22_19*)self)->native_visibility; case 2: return ((struct _GdkWindow_v3_24_11*)self)->native_visibility; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_native_visibility(GdkWindow * self, guint native_visibility) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->native_visibility = native_visibility; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->native_visibility = native_visibility; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->native_visibility = native_visibility; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::viewable guint gdk_window_priv_get_viewable(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->viewable; case 1: return ((struct _GdkWindow_v3_22_19*)self)->viewable; case 2: return ((struct _GdkWindow_v3_24_11*)self)->viewable; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_viewable(GdkWindow * self, guint viewable) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->viewable = viewable; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->viewable = viewable; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->viewable = viewable; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::applied_shape guint gdk_window_priv_get_applied_shape(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->applied_shape; case 1: return ((struct _GdkWindow_v3_22_19*)self)->applied_shape; case 2: return ((struct _GdkWindow_v3_24_11*)self)->applied_shape; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_applied_shape(GdkWindow * self, guint applied_shape) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->applied_shape = applied_shape; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->applied_shape = applied_shape; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->applied_shape = applied_shape; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::in_update guint gdk_window_priv_get_in_update(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->in_update; case 1: return ((struct _GdkWindow_v3_22_19*)self)->in_update; case 2: return ((struct _GdkWindow_v3_24_11*)self)->in_update; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_in_update(GdkWindow * self, guint in_update) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->in_update = in_update; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->in_update = in_update; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->in_update = in_update; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::geometry_dirty guint gdk_window_priv_get_geometry_dirty(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->geometry_dirty; case 1: return ((struct _GdkWindow_v3_22_19*)self)->geometry_dirty; case 2: return ((struct _GdkWindow_v3_24_11*)self)->geometry_dirty; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_geometry_dirty(GdkWindow * self, guint geometry_dirty) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->geometry_dirty = geometry_dirty; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->geometry_dirty = geometry_dirty; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->geometry_dirty = geometry_dirty; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::event_compression guint gdk_window_priv_get_event_compression(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->event_compression; case 1: return ((struct _GdkWindow_v3_22_19*)self)->event_compression; case 2: return ((struct _GdkWindow_v3_24_11*)self)->event_compression; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_event_compression(GdkWindow * self, guint event_compression) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->event_compression = event_compression; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->event_compression = event_compression; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->event_compression = event_compression; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::frame_clock_events_paused guint gdk_window_priv_get_frame_clock_events_paused(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->frame_clock_events_paused; case 1: return ((struct _GdkWindow_v3_22_19*)self)->frame_clock_events_paused; case 2: return ((struct _GdkWindow_v3_24_11*)self)->frame_clock_events_paused; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_frame_clock_events_paused(GdkWindow * self, guint frame_clock_events_paused) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->frame_clock_events_paused = frame_clock_events_paused; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->frame_clock_events_paused = frame_clock_events_paused; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->frame_clock_events_paused = frame_clock_events_paused; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::impl_window GdkWindow * gdk_window_priv_get_impl_window(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->impl_window; case 1: return ((struct _GdkWindow_v3_22_19*)self)->impl_window; case 2: return ((struct _GdkWindow_v3_24_11*)self)->impl_window; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_impl_window(GdkWindow * self, GdkWindow * impl_window) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->impl_window = impl_window; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->impl_window = impl_window; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->impl_window = impl_window; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::update_and_descendants_freeze_count guint gdk_window_priv_get_update_and_descendants_freeze_count(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->update_and_descendants_freeze_count; case 1: return ((struct _GdkWindow_v3_22_19*)self)->update_and_descendants_freeze_count; case 2: return ((struct _GdkWindow_v3_24_11*)self)->update_and_descendants_freeze_count; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_update_and_descendants_freeze_count(GdkWindow * self, guint update_and_descendants_freeze_count) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->update_and_descendants_freeze_count = update_and_descendants_freeze_count; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->update_and_descendants_freeze_count = update_and_descendants_freeze_count; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->update_and_descendants_freeze_count = update_and_descendants_freeze_count; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::abs_x gint gdk_window_priv_get_abs_x(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->abs_x; case 1: return ((struct _GdkWindow_v3_22_19*)self)->abs_x; case 2: return ((struct _GdkWindow_v3_24_11*)self)->abs_x; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_abs_x(GdkWindow * self, gint abs_x) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->abs_x = abs_x; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->abs_x = abs_x; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->abs_x = abs_x; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::abs_y gint gdk_window_priv_get_abs_y(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->abs_y; case 1: return ((struct _GdkWindow_v3_22_19*)self)->abs_y; case 2: return ((struct _GdkWindow_v3_24_11*)self)->abs_y; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_abs_y(GdkWindow * self, gint abs_y) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->abs_y = abs_y; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->abs_y = abs_y; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->abs_y = abs_y; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::width gint gdk_window_priv_get_width(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->width; case 1: return ((struct _GdkWindow_v3_22_19*)self)->width; case 2: return ((struct _GdkWindow_v3_24_11*)self)->width; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_width(GdkWindow * self, gint width) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->width = width; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->width = width; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->width = width; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::height gint gdk_window_priv_get_height(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->height; case 1: return ((struct _GdkWindow_v3_22_19*)self)->height; case 2: return ((struct _GdkWindow_v3_24_11*)self)->height; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_height(GdkWindow * self, gint height) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->height = height; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->height = height; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->height = height; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shadow_top gint gdk_window_priv_get_shadow_top(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shadow_top; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shadow_top; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shadow_top; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shadow_top(GdkWindow * self, gint shadow_top) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shadow_top = shadow_top; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shadow_top = shadow_top; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shadow_top = shadow_top; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shadow_left gint gdk_window_priv_get_shadow_left(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shadow_left; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shadow_left; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shadow_left; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shadow_left(GdkWindow * self, gint shadow_left) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shadow_left = shadow_left; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shadow_left = shadow_left; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shadow_left = shadow_left; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shadow_right gint gdk_window_priv_get_shadow_right(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shadow_right; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shadow_right; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shadow_right; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shadow_right(GdkWindow * self, gint shadow_right) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shadow_right = shadow_right; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shadow_right = shadow_right; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shadow_right = shadow_right; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shadow_bottom gint gdk_window_priv_get_shadow_bottom(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shadow_bottom; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shadow_bottom; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shadow_bottom; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shadow_bottom(GdkWindow * self, gint shadow_bottom) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shadow_bottom = shadow_bottom; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shadow_bottom = shadow_bottom; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shadow_bottom = shadow_bottom; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::num_offscreen_children guint gdk_window_priv_get_num_offscreen_children(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->num_offscreen_children; case 1: return ((struct _GdkWindow_v3_22_19*)self)->num_offscreen_children; case 2: return ((struct _GdkWindow_v3_24_11*)self)->num_offscreen_children; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_num_offscreen_children(GdkWindow * self, guint num_offscreen_children) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->num_offscreen_children = num_offscreen_children; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->num_offscreen_children = num_offscreen_children; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->num_offscreen_children = num_offscreen_children; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::clip_region cairo_region_t * gdk_window_priv_get_clip_region(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->clip_region; case 1: return ((struct _GdkWindow_v3_22_19*)self)->clip_region; case 2: return ((struct _GdkWindow_v3_24_11*)self)->clip_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_clip_region(GdkWindow * self, cairo_region_t * clip_region) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->clip_region = clip_region; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->clip_region = clip_region; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->clip_region = clip_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::cursor GdkCursor * gdk_window_priv_get_cursor(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->cursor; case 1: return ((struct _GdkWindow_v3_22_19*)self)->cursor; case 2: return ((struct _GdkWindow_v3_24_11*)self)->cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_cursor(GdkWindow * self, GdkCursor * cursor) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->cursor = cursor; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->cursor = cursor; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->cursor = cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::device_cursor GHashTable * gdk_window_priv_get_device_cursor(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->device_cursor; case 1: return ((struct _GdkWindow_v3_22_19*)self)->device_cursor; case 2: return ((struct _GdkWindow_v3_24_11*)self)->device_cursor; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_device_cursor(GdkWindow * self, GHashTable * device_cursor) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->device_cursor = device_cursor; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->device_cursor = device_cursor; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->device_cursor = device_cursor; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::shape cairo_region_t * gdk_window_priv_get_shape(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->shape; case 1: return ((struct _GdkWindow_v3_22_19*)self)->shape; case 2: return ((struct _GdkWindow_v3_24_11*)self)->shape; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_shape(GdkWindow * self, cairo_region_t * shape) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->shape = shape; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->shape = shape; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->shape = shape; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::input_shape cairo_region_t * gdk_window_priv_get_input_shape(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->input_shape; case 1: return ((struct _GdkWindow_v3_22_19*)self)->input_shape; case 2: return ((struct _GdkWindow_v3_24_11*)self)->input_shape; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_input_shape(GdkWindow * self, cairo_region_t * input_shape) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->input_shape = input_shape; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->input_shape = input_shape; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->input_shape = input_shape; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::devices_inside GList * gdk_window_priv_get_devices_inside(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->devices_inside; case 1: return ((struct _GdkWindow_v3_22_19*)self)->devices_inside; case 2: return ((struct _GdkWindow_v3_24_11*)self)->devices_inside; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_devices_inside(GdkWindow * self, GList * devices_inside) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->devices_inside = devices_inside; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->devices_inside = devices_inside; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->devices_inside = devices_inside; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::device_events GHashTable * gdk_window_priv_get_device_events(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->device_events; case 1: return ((struct _GdkWindow_v3_22_19*)self)->device_events; case 2: return ((struct _GdkWindow_v3_24_11*)self)->device_events; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_device_events(GdkWindow * self, GHashTable * device_events) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->device_events = device_events; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->device_events = device_events; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->device_events = device_events; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::source_event_masks GHashTable * gdk_window_priv_get_source_event_masks(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->source_event_masks; case 1: return ((struct _GdkWindow_v3_22_19*)self)->source_event_masks; case 2: return ((struct _GdkWindow_v3_24_11*)self)->source_event_masks; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_source_event_masks(GdkWindow * self, GHashTable * source_event_masks) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->source_event_masks = source_event_masks; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->source_event_masks = source_event_masks; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->source_event_masks = source_event_masks; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::device_added_handler_id gulong * gdk_window_priv_get_device_added_handler_id_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (gulong *)&((struct _GdkWindow_v3_22_0*)self)->device_added_handler_id; case 1: return (gulong *)&((struct _GdkWindow_v3_22_19*)self)->device_added_handler_id; case 2: return (gulong *)&((struct _GdkWindow_v3_24_11*)self)->device_added_handler_id; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::device_changed_handler_id gulong * gdk_window_priv_get_device_changed_handler_id_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (gulong *)&((struct _GdkWindow_v3_22_0*)self)->device_changed_handler_id; case 1: return (gulong *)&((struct _GdkWindow_v3_22_19*)self)->device_changed_handler_id; case 2: return (gulong *)&((struct _GdkWindow_v3_24_11*)self)->device_changed_handler_id; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::frame_clock GdkFrameClock * gdk_window_priv_get_frame_clock(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->frame_clock; case 1: return ((struct _GdkWindow_v3_22_19*)self)->frame_clock; case 2: return ((struct _GdkWindow_v3_24_11*)self)->frame_clock; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_frame_clock(GdkWindow * self, GdkFrameClock * frame_clock) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->frame_clock = frame_clock; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->frame_clock = frame_clock; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->frame_clock = frame_clock; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::invalidate_handler GdkWindowInvalidateHandlerFunc * gdk_window_priv_get_invalidate_handler_ptr(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return (GdkWindowInvalidateHandlerFunc *)&((struct _GdkWindow_v3_22_0*)self)->invalidate_handler; case 1: return (GdkWindowInvalidateHandlerFunc *)&((struct _GdkWindow_v3_22_19*)self)->invalidate_handler; case 2: return (GdkWindowInvalidateHandlerFunc *)&((struct _GdkWindow_v3_24_11*)self)->invalidate_handler; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::drawing_context GdkDrawingContext * gdk_window_priv_get_drawing_context(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: return ((struct _GdkWindow_v3_22_0*)self)->drawing_context; case 1: return ((struct _GdkWindow_v3_22_19*)self)->drawing_context; case 2: return ((struct _GdkWindow_v3_24_11*)self)->drawing_context; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_drawing_context(GdkWindow * self, GdkDrawingContext * drawing_context) { switch (gdk_window_priv_get_version_id()) { case 0: ((struct _GdkWindow_v3_22_0*)self)->drawing_context = drawing_context; break; case 1: ((struct _GdkWindow_v3_22_19*)self)->drawing_context = drawing_context; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->drawing_context = drawing_context; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::opaque_region gboolean gdk_window_priv_get_opaque_region_supported() { switch (gdk_window_priv_get_version_id()) { case 0: return FALSE; case 1: return TRUE; case 2: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } cairo_region_t * gdk_window_priv_get_opaque_region_or_abort(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: g_error("GdkWindow::opaque_region not supported on this GTK"); g_abort(); case 1: return ((struct _GdkWindow_v3_22_19*)self)->opaque_region; case 2: return ((struct _GdkWindow_v3_24_11*)self)->opaque_region; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_opaque_region_or_abort(GdkWindow * self, cairo_region_t * opaque_region) { switch (gdk_window_priv_get_version_id()) { case 0: g_error("GdkWindow::opaque_region not supported on this GTK"); g_abort(); case 1: ((struct _GdkWindow_v3_22_19*)self)->opaque_region = opaque_region; break; case 2: ((struct _GdkWindow_v3_24_11*)self)->opaque_region = opaque_region; break; default: g_error("Invalid version ID"); g_abort(); } } // GdkWindow::synthesized_crossing_event_id gboolean gdk_window_priv_get_synthesized_crossing_event_id_supported() { switch (gdk_window_priv_get_version_id()) { case 0: return FALSE; case 1: return FALSE; case 2: return TRUE; default: g_error("Invalid version ID"); g_abort(); } } guint gdk_window_priv_get_synthesized_crossing_event_id_or_abort(GdkWindow * self) { switch (gdk_window_priv_get_version_id()) { case 0: g_error("GdkWindow::synthesized_crossing_event_id not supported on this GTK"); g_abort(); case 1: g_error("GdkWindow::synthesized_crossing_event_id not supported on this GTK"); g_abort(); case 2: return ((struct _GdkWindow_v3_24_11*)self)->synthesized_crossing_event_id; default: g_error("Invalid version ID"); g_abort(); } } void gdk_window_priv_set_synthesized_crossing_event_id_or_abort(GdkWindow * self, guint synthesized_crossing_event_id) { switch (gdk_window_priv_get_version_id()) { case 0: g_error("GdkWindow::synthesized_crossing_event_id not supported on this GTK"); g_abort(); case 1: g_error("GdkWindow::synthesized_crossing_event_id not supported on this GTK"); g_abort(); case 2: ((struct _GdkWindow_v3_24_11*)self)->synthesized_crossing_event_id = synthesized_crossing_event_id; break; default: g_error("Invalid version ID"); g_abort(); } } #endif // GDK_WINDOW_PRIV_H gtk-layer-shell-0.9.0/gtk-priv/meson.build000066400000000000000000000001221466775474600204560ustar00rootroot00000000000000gtk_priv = declare_dependency( include_directories: include_directories('h')) gtk-layer-shell-0.9.0/gtk-priv/scripts/000077500000000000000000000000001466775474600200105ustar00rootroot00000000000000gtk-layer-shell-0.9.0/gtk-priv/scripts/ast.py000066400000000000000000000171171466775474600211600ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import logging import re from version import Version import code logger = logging.getLogger(__name__) def remove_comments(code): return re.sub(r'(/\*.*?\*/|//.*?\n)', '', code, flags=re.DOTALL) # These can be combined in any order, we do not check that it is valid std_types = set([ 'void', 'int', 'char', 'signed', 'unsigned', 'short', 'long', 'float', 'double', 'uint32_t', 'gint', 'guint', 'gchar', 'gboolean', 'gpointer', ]) def is_std_type(name): for i in name.split(): if not i in std_types: return False return True class CType: def __str__(self): return self.str_left(False) + self.str_right(False) def str_right(self, resolved): return '' def __eq__(self, other): return str(self) == str(other) class StdType(CType): def __init__(self, name): assert isinstance(name, str) assert is_std_type(name), name self.name = name def resolve(self, ctx): pass def str_left(self, resolved): return self.name class CustomType(CType): def __init__(self, name): assert isinstance(name, str) self.explicit_struct = False if name.startswith('struct'): name = name[6:].strip() self.explicit_struct = True self.explicit_enum = False if name.startswith('enum'): name = name[4:].strip() self.explicit_enum = True self.name = name self.version = None self.resolved_struct = None def resolve(self, ctx): if self.explicit_enum: struct = None elif self.explicit_struct: struct = ctx.project.lookup_struct_name(self.name) else: struct = ctx.project.lookup_typedef(self.name) if struct: self.resolved_struct = struct self.version = ctx.version def str_left(self, resolved): if self.resolved_struct and resolved: v = self.resolved_struct.lookup_version(self.version) return 'struct ' + v.versioned_struct_name() else: result = '' if self.explicit_struct: result += 'struct ' if self.explicit_enum: result += 'enum ' result += self.name return result class PtrType(CType): def __init__(self, inner): assert isinstance(inner, CType) self.inner = inner def resolve(self, ctx): self.inner.resolve(ctx) def str_left(self, resolved): result = self.inner.str_left(False) if not isinstance(self.inner, PtrType): result += ' ' result += '*' return result def str_right(self, resolved): return self.inner.str_right(False) class ConstType(CType): def __init__(self, inner): assert isinstance(inner, CType) self.inner = inner def resolve(self, ctx): self.inner.resolve(ctx) def str_left(self, resolved): return 'const ' + self.inner.str_left(resolved) def str_right(self, resolved): return self.inner.str_right(resolved) # Note the first (and usually only) layer of "pointer" is consumed by this type # Do not wrap in a PtrType in most cases class FpType(CType): def __init__(self, return_type, arg_list): assert isinstance(return_type, CType) assert isinstance(arg_list, list) for i in arg_list: assert isinstance(i, PropertyNode), str(i) + ' is not a property node' self.return_type = return_type self.arg_list = arg_list def resolve(self, ctx): self.return_type.resolve(ctx) for arg in self.arg_list: arg.resolve(ctx) def str_left(self, resolved): return str(self.return_type) + ' (*' def str_right(self, resolved): return ') (' + str(', '.join([str(t) for t in self.arg_list])) + ')' class ArrayType(CType): def __init__(self, inner, size): assert isinstance(inner, CType) assert isinstance(size, str) self.inner = inner self.size = size def resolve(self, ctx): self.inner.resolve(ctx) def str_left(self, resolved): if resolved: return self.inner.str_left(True) else: return self.inner.str_left(False) + '*' def str_right(self, resolved): if resolved: return '[' + self.size + ']' + self.inner.str_right(True) else: return self.inner.str_right(False) class AstNode: def __eq__(self, other): return str(self) == str(other) class PropertyNode(AstNode): def __init__(self, c_type, name, bit_field): assert isinstance(c_type, CType) assert name is None or isinstance(name, str) assert bit_field is None or isinstance(bit_field, int) self.c_type = c_type self.name = name self.statement = False self.bit_field = bit_field def resolve(self, ctx): self.c_type.resolve(ctx) def get_property_list(self, prefix): return [(self.c_type, prefix + self.name)] def __str__(self): result = self.c_type.str_left(True) if self.name: if not isinstance(self.c_type, PtrType): result += ' ' result += self.name result += self.c_type.str_right(True) if self.bit_field: result += ' : ' + str(self.bit_field) if self.statement: result += ';\n' return result class ListNode(AstNode): def __init__(self, nodes): assert isinstance(nodes, list) for node in nodes: assert isinstance(node, AstNode) self.nodes = nodes def resolve(self, ctx): for node in self.nodes: node.resolve(ctx) def get_property_list(self, prefix): result = [] for node in self.nodes: result += node.get_property_list(prefix) return result def __str__(self): return ''.join(str(node) for node in self.nodes) class SubStructNode(AstNode): def __init__(self, name, content): assert isinstance(name, str) assert isinstance(content, AstNode) self.name = name self.content = content def resolve(self, ctx): self.content.resolve(ctx) def get_property_list(self, prefix): return self.content.get_property_list(prefix + self.name + '.') def __str__(self): return ( 'struct {' + ('\n' + code.INDENT).join([''] + str(self.content).splitlines()) + '\n} ' + self.name + ';\n') gtk-layer-shell-0.9.0/gtk-priv/scripts/build.py000077500000000000000000000044201466775474600214640ustar00rootroot00000000000000#!/usr/bin/python3 ''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import logging from os import path import os import sys from version import parse_tags_and_branches from repo import Repo from code import Project from config import STRUCT_LIST def get_project_root(): return path.dirname(path.dirname(path.realpath(__file__))) GTK_GIT_URL = 'https://gitlab.gnome.org/GNOME/gtk.git' BUILD_DIR = path.join(get_project_root(), 'build') OUTPUT_DIR = path.join(get_project_root(), 'h') REPO_DIR = path.join(BUILD_DIR, 'gtk') logger = logging.getLogger('build.py') logging.basicConfig(level=logging.DEBUG) def build(): if not path.exists(BUILD_DIR): logger.info('Creating directory ' + BUILD_DIR) os.makedirs(BUILD_DIR) repo = Repo(GTK_GIT_URL, REPO_DIR) tags = repo.get_tags() branches = repo.get_branches() versions = parse_tags_and_branches(tags, branches) project = Project(REPO_DIR, STRUCT_LIST) for i, v in enumerate(versions): percent = int(((i + 1) / len(versions)) * 1000) / 10 logger.info('[' + str(percent) + '%] Checking out ' + v.get_checkout_name()) repo.checkout(v.get_checkout_name()) project.update(v) project.simplify() project.write(OUTPUT_DIR) if __name__ == '__main__': build() gtk-layer-shell-0.9.0/gtk-priv/scripts/code.py000066400000000000000000000464041466775474600213040ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import logging from datetime import datetime import os from os import path import re import mmap from collections import OrderedDict import tempfile import subprocess import parse from ast import * from version import COMBO_FACTOR, Version logger = logging.getLogger(__name__) INDENT = ' ' # used for generating code PROJECT_NAME = 'gtk-layer-shell' LGPL3_HEADER = ''' This program 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 3 of the License, or (at your option) any later version. This program 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 program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ''' CODE_EXTENSIONS = set(['.h', '.hpp', '.c', '.cpp', '.cc']) def typdef_to_struct_name(typedef): return '_' + typedef def get_all_source_files(search_dir): result = [] for item in os.listdir(search_dir): p = path.join(search_dir, item) if path.isdir(p): result += get_all_source_files(p) elif path.splitext(p)[1] in CODE_EXTENSIONS: result.append(p) return result def remove_headers_from_dir(header_dir): logger.info('Clearing header files out of ' + header_dir) for item in os.listdir(header_dir): p = path.join(header_dir, item) if item != 'common.h' and path.splitext(p)[1] == '.h': os.remove(p) def struct_regex_string(struct_name): return r'struct\s+' + struct_name + r'\s*\{' def extract_body(file_content, struct_name): halves = re.split(struct_regex_string(struct_name), file_content) if len(halves) < 2: raise RuntimeError(struct_name + ' not declared in ' + code_path + ' (even though it was detected)') if len(halves) > 2: raise RuntimeError(struct_name + ' declared multiple times in ' + code_path) body = '' brace_level = 1 for c in halves[1]: if c == '{': brace_level += 1 elif c == '}': brace_level -= 1 if brace_level <= 0: break body += c return body def camel_case_to_words(name): result = [] word = '' for l in name: if l.isupper() and word: result.append(word) word = '' word += l.lower() if word: result.append(word) return result def c_function(return_type, name, arg_list, body): result = '' result += return_type.str_left(False) result += ' ' + name + '(' arg_strs = [c_type.str_left(False) + ' ' + name + c_type.str_right(False) for c_type, name in arg_list] result += ', '.join(arg_strs) result += ')' + return_type.str_right(False) + ' {\n' for line in body.strip().splitlines(): result += INDENT + line + '\n' result += '}\n' return result def write_tmp_file(text): f = tempfile.NamedTemporaryFile(mode='w', delete=True) f.write(text) f.flush() return f def diff_between(old, new): old_f = write_tmp_file(old) new_f = write_tmp_file(new) result = subprocess.run(['diff', old_f.name, new_f.name], capture_output=True, text=True) code = '' for line in result.stdout.splitlines(): if line.startswith('<'): code += '// -' + line[1:] + '\n' elif line.startswith('>'): code += '// +' + line[1:] + '\n' return code class ResolveContext: def __init__(self, project, struct, version): self.project = project self.struct = struct self.version = version class StructVersion: def __init__(self, code_path, project, struct, version): with open(code_path, 'r') as f: source_code = f.read() self.code_path = code_path self.first_version = version self.last_version = version self.struct_name = struct.struct_name self.copyright_lines = set(re.findall(r'[Cc]opyright .*(?=\n)', source_code)) self.body = extract_body(source_code, self.struct_name) self.ast = parse.parse_ast(self.body) self.ast.resolve(ResolveContext(project, struct, version)) def get_code_path(self): return self.code_path def get_property_list(self): return self.ast.get_property_list('') def version_range_str(self): if self.first_version == self.last_version: return str(self.first_version) else: return str(self.first_version) + ' - ' + str(self.last_version) def emit_definition(self, generated): result = '' result += '// Valid for GTK ' + self.version_range_str() + '\n' result += 'struct ' + str(self) + '\n{' if generated: result += ( '\n' + INDENT + ('\n' + INDENT).join(str(self.ast).splitlines()) + '\n') else: result += self.body result += '};\n' return result def is_valid_for(self, version): return version >= self.first_version and version <= self.last_version def versioned_struct_name(self): return self.struct_name + '_' + self.first_version.c_id() def __str__(self): return self.versioned_struct_name() def __eq__(self, other): assert isinstance(other, StructVersion) return self.ast == other.ast class Property: def __init__(self, struct, c_type, name, version_ids): assert isinstance(struct, Struct) assert isinstance(c_type, CType) assert isinstance(name, str) assert isinstance(version_ids, list) for i in version_ids: assert isinstance(i, bool) # If this property is supported for each version ID self.struct = struct self.c_type = c_type self.name = name self.version_ids = version_ids def all_versions_supported(self): for i in self.version_ids: if not i: return False return True def get_id_name(self): return self.name.replace('.', '_') def get_fn_name(self, action, suffix): result = '' result += '_'.join(camel_case_to_words(self.struct.typedef)) result += '_priv_' if action: result += action + '_' result += self.get_id_name() if suffix: result += '_' + suffix return result def emit_version_id_switch(self, on_supported, on_unsupported): result = '' result += 'switch (' + self.struct.get_version_id_fn_name() + '()) {\n' for i, supported in enumerate(self.version_ids): result += INDENT + 'case ' + str(i) + ': ' type_name = 'struct ' + self.struct.versions[i].versioned_struct_name() if supported: result += on_supported(type_name) else: result += on_unsupported(type_name) result += '\n' result += INDENT + 'default: g_error("Invalid version ID"); g_abort();\n' result += '}' return result def emit_ptr_getter(self): ret_type = PtrType(self.c_type) suffix = 'ptr' if self.all_versions_supported() else 'ptr_or_null' fn_name = self.get_fn_name('get', suffix) arg_list = [(self.struct.get_ptr_type(), 'self')] body = self.emit_version_id_switch( lambda type_name: 'return (' + str(ret_type) + ')&((' + type_name + '*)self)->' + self.name + ';', lambda type_name: 'return NULL;') return c_function(ret_type, fn_name, arg_list, body) def emit_is_supported(self): ret_type = StdType('gboolean') fn_name = self.get_fn_name('get', 'supported') body = self.emit_version_id_switch( lambda type_name: 'return TRUE;', lambda type_name: 'return FALSE;') return c_function(ret_type, fn_name, [], body) def emit_not_supported_error(self, type_name): msg = '"' + self.struct.typedef + '::' + self.name + ' not supported on this GTK"' return 'g_error(' + msg + '); g_abort();' def emit_getter(self): ret_type = self.c_type suffix = '' if self.all_versions_supported() else 'or_abort' fn_name = self.get_fn_name('get', suffix) arg_list = [(self.struct.get_ptr_type(), 'self')] body = self.emit_version_id_switch( lambda type_name: 'return ((' + type_name + '*)self)->' + self.name + ';', self.emit_not_supported_error) return c_function(ret_type, fn_name, arg_list, body) def emit_setter(self): ret_type = StdType('void') suffix = '' if self.all_versions_supported() else 'or_abort' fn_name = self.get_fn_name('set', suffix) arg_list = [(self.struct.get_ptr_type(), 'self'), (self.c_type, self.get_id_name())] body = self.emit_version_id_switch( lambda type_name: '((' + type_name + '*)self)->' + self.name + ' = ' + self.get_id_name() + '; break;', self.emit_not_supported_error) return c_function(ret_type, fn_name, arg_list, body) def emit_functions(self): result = '' result += '// ' + self.struct.typedef + '::' + self.name + '\n\n' if not self.all_versions_supported(): result += self.emit_is_supported() result += '\n' if isinstance(self.c_type, CustomType) or isinstance(self.c_type, ArrayType): result += self.emit_ptr_getter() else: result += self.emit_getter() result += '\n' result += self.emit_setter() return result class Struct: def __init__(self, typedef): self.typedef = typedef self.struct_name = typdef_to_struct_name(typedef) self.versions = [] self.supported_versions = [] self.copyright_lines = set() self.search_regex = re.compile(bytes(struct_regex_string(self.struct_name), 'utf-8')) def lookup_version(self, version): for i in self.versions: if i.is_valid_for(version): return i def get_code_path(self): if self.versions: return self.versions[-1].get_code_path() else: return None def get_ptr_type(self): return PtrType(CustomType(self.typedef)) def get_version_id_fn_name(self): return '_'.join(camel_case_to_words(self.typedef)) + '_priv_get_version_id' def header_name(self): return '_'.join(camel_case_to_words(self.typedef)) + '_priv.h' def macro_name(self): return self.header_name().replace('.', '_').upper() def add_version(self, new): self.versions.append(new) self.supported_versions.append(new.first_version) self.copyright_lines = self.copyright_lines.union(new.copyright_lines) # Returns if any changes were made def simplify(self): new_versions = [] dropped_versions = 0 for v in self.versions: if new_versions and new_versions[-1] == v: dropped_versions += 1 new_versions[-1].last_version = v.last_version else: new_versions.append(v) if dropped_versions > 0: logger.info('Found ' + str(dropped_versions) + ' unnecessary versions of ' + self.typedef); self.versions = new_versions return dropped_versions > 0 def setup_properties(self): prop_dict = OrderedDict() for i, v in enumerate(self.versions): for c_type, name in v.get_property_list(): if name in prop_dict and not (prop_dict[name][0] == c_type): logger.warning( 'Property ' + name + ' changes type from ' + str(prop_dict[name][0]) + ' to ' + str(c_type) + ', ignoring old type') del prop_dict[name] if name in prop_dict: assert prop_dict[name][0] == c_type prop_dict[name][1].add(i) else: prop_dict[name] = (c_type, set([i])) self.properties = [] for name, (c_type, supported_ids) in prop_dict.items(): versions_ids = [bool(i in supported_ids) for i in range(len(self.versions))] self.properties.append(Property(self, c_type, name, versions_ids)) def emit_get_version_id_fn(self): return_type = StdType('int') fn_name = self.get_version_id_fn_name() body = '' body += 'static int version_id = -1;\n' body += '\n' body += 'if (version_id == -1) {\n' body += INDENT + 'gtk_priv_assert_gtk_version_valid();' body += '\n' body += INDENT + 'int combo = gtk_get_minor_version() * 1000 + gtk_get_micro_version();\n' body += '\n' body += INDENT + 'switch (combo) {\n' for v in self.supported_versions: if v.is_released(): body += INDENT * 2 + 'case ' + str(v.get_combo()) + ':\n' body += INDENT * 3 + 'break;\n' body += '\n' body += INDENT * 2 + 'default:\n' body += INDENT * 3 + 'gtk_priv_warn_gtk_version_may_be_unsupported();\n' body += INDENT + '}\n' body += '\n' body += INDENT for i in range(len(self.versions) - 1, -1, -1): if i > 0: body += 'if (combo >= ' + str(self.versions[i].first_version.get_combo()) + ') ' body += '{\n' body += INDENT * 2 + 'version_id = ' + str(i) + ';\n' body += INDENT + '}' if i > 0: body += ' else ' body += '\n' body += '}\n' body += '\n' body += 'return version_id;\n' return c_function(return_type, fn_name, [], body) def emit_header(self, generated): result = '' result += '/* AUTOGENERATED, DO NOT EDIT DIRECTLY\n' result += ' * See gtk-priv/README.md for more information\n' result += ' *\n' result += ' * This file is part of ' + PROJECT_NAME + '\n' result += ' *\n' me = path.relpath(__file__, path.dirname(path.dirname(path.dirname(__file__)))) my_copyright_line = 'Copyright © ' + str(datetime.now().year) + ' ' + me for line in list(self.copyright_lines) + [my_copyright_line]: result += ' * ' + line + '\n' result += ' *' result += '\n * '.join(LGPL3_HEADER.splitlines()) result += '\n */\n' result += '\n' result += '#ifndef ' + self.macro_name() + '\n' result += '#define ' + self.macro_name() + '\n' result += '\n' result += '#include "common.h"\n' result += '\n' result += 'typedef struct ' + self.struct_name + ' ' + self.typedef + ';\n' result += '\n' prev_definition = None for i, struct in enumerate(self.versions): result += '// Version ID ' + str(i) + '\n' definition = struct.emit_definition(generated) if prev_definition: result += '// Diff from previous version:\n' result += '\n'.join(diff_between(prev_definition, definition).splitlines()[4:]) + '\n' prev_definition = definition result += definition result += '\n' result += '// For internal use only\n' result += self.emit_get_version_id_fn() result += '\n' for p in self.properties: result += p.emit_functions() result += '\n' result += '#endif // ' + self.macro_name() + '\n' return result def file_contains_byte_regex(source_file, regex): try: with open(source_file) as f: with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as s: return bool(regex.search(s)) except (ValueError, FileNotFoundError): return False class Project: def __init__(self, repo_dir, typedef_names): self.repo_dir = repo_dir structs = [Struct(typedef) for typedef in typedef_names] self.typedefs = {struct.typedef: struct for struct in structs} self.struct_names = {struct.struct_name: struct for struct in structs} def lookup_struct_name(self, struct_name): return self.struct_names.get(struct_name) def lookup_typedef(self, typedef): return self.typedefs.get(typedef) def update(self, version): source_files = None for typedef, struct in self.typedefs.items(): code_path = struct.get_code_path() search_regex = struct.search_regex if not code_path or not file_contains_byte_regex(code_path, search_regex): if source_files is None: source_files = get_all_source_files(self.repo_dir) files = set() for source_file in source_files: if file_contains_byte_regex(source_file, search_regex): files.add(source_file) if not files: raise RuntimeError('Could not find ' + typedef + ' in ' + str(version)) if len(files) > 1: raise RuntimeError(typedef + ' implemented multiple places: ' + str(files)) code_path = list(files)[0] struct_version = StructVersion(code_path, self, struct, version) struct.add_version(struct_version) def simplify(self): i = 1; while True: logger.info('Detecting identical versions, round ' + str(i)) i += 1 made_change = False for _, struct in self.typedefs.items(): if struct.simplify(): made_change = True if not made_change: break for _, struct in self.typedefs.items(): struct.setup_properties() def write(self, output_dir): remove_headers_from_dir(output_dir) for typedef, struct in self.typedefs.items(): output_path = path.join(output_dir, struct.header_name()) logger.info('Writing ' + str(len(struct.versions)) + ' versions of ' + typedef + ' to ' + output_path) with open(output_path, "w") as f: f.write(struct.emit_header(True)) gtk-layer-shell-0.9.0/gtk-priv/scripts/config.py000066400000000000000000000034161466775474600216330ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' ''' The list of GTK structures to build header for It is assumed these are the 'typedef' names, and the actual struct names are the same with an underscore prepended Adding a name here is all that's needed to start building it's header (searching, naming the header, etc are all done automatically) ''' STRUCT_LIST = [ 'GdkWindow', 'GdkWindowImplWayland', 'GdkWindowImplWaylandClass', 'GdkWindowImpl', 'GdkWindowImplClass', 'GdkWaylandSeat', 'GdkWaylandPointerData', 'GdkWaylandPointerFrameData', 'GdkWaylandTouchData', 'GdkWaylandTabletData', ] MIN_SUPPORTED_GTK = '3.22.0' # same format as the tag names MAX_SUPPORTED_GTK = '3.70.0' # they randomly jumped to 3.89.1 for beta 4.0 releases gtk-layer-shell-0.9.0/gtk-priv/scripts/parse.py000066400000000000000000000107041466775474600214760ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import logging import re from ast import * logger = logging.getLogger(__name__) def remove_comments(code): return re.sub(r'(/\*.*?\*/|//.*?\n)', '', code, flags=re.DOTALL) def parse_type(code): code = code.strip() if code.endswith('*'): return PtrType(parse_type(code[:-1])) elif code.startswith('const '): return ConstType(parse_type(code[5:])) if code.endswith(' const'): return ConstType(parse_type(code[:5])) elif is_std_type(code): return StdType(code) elif re.search(r'^((struct|enum)\s+)?\w+$', code): return CustomType(code) else: assert False, 'Unknown type `' + code + '`' def parse_property(code): code = code.strip() bit_field = None bit_field_split = code.rsplit(':', 1) if len(bit_field_split) > 1: code = bit_field_split[0].strip() bit_field = int(bit_field_split[1].strip()) fp = re.search(r'^(.*)\(\s*(\*\s*)+(\w*)\s*\)\s*\((.*)\)$', code) if fp: assert bit_field is None ret = parse_type(fp.group(1)) pointer_count = fp.group(2).count('*') - 1 assert pointer_count == 0, ( 'Function pointers with multiple levels of indirection not supported ' '(indirection count: ' + str(pointer_count) + ' for ' + code + ')') name = fp.group(3) if name == '': name = None args = [] for i in fp.group(4).split(','): args.append(parse_property(i)) c_type = FpType(ret, args) return PropertyNode(c_type, name, None) array = re.search(r'^(.*)\[(.*)\]$', code) if array: prop = parse_property(array.group(1)) prop.c_type = ArrayType(prop.c_type, array.group(2).strip()) return prop normal = re.search(r'^((\w+\s*[^\w\,])+(\*\s*)*)([\w\s\,]*)$', code) if normal: c_type = parse_type(normal.group(1)) names = normal.group(4).split(',') names = [name.strip() for name in names if name.strip()] if len(names) > 1: nodes = [] for name in names: nodes.append(PropertyNode(c_type, name, None)) nodes[-1].statement = True return ListNode(nodes) elif len(names) == 1: return PropertyNode(c_type, names[0], bit_field) else: return PropertyNode(c_type, None, bit_field) assert False, 'Could not parse property `' + code + '`' def parse_token_list(tokens, i): nodes = [] while i < len(tokens): token = tokens[i].strip() if token == '' or token == ';': pass elif token == 'struct' and tokens[i + 1].strip() == '{': i, node = parse_token_list(tokens, i + 2) i += 1 assert i < len(tokens) name = tokens[i].strip() assert re.search(r'^\w+$', name) struct = SubStructNode(name, node) nodes.append(struct) elif token == '}': break else: node = parse_property(token) if isinstance(node, PropertyNode): node.statement = True nodes.append(node) i += 1 return i, ListNode(nodes) def parse_ast(code): code = remove_comments(code) code = code.replace('\n', ' ') code = code.replace('\t', ' ') tokens = re.split(r'([;\{\}])', code) i, node = parse_token_list(tokens, 0) assert i == len(tokens), code return node gtk-layer-shell-0.9.0/gtk-priv/scripts/repo.py000066400000000000000000000053651466775474600213400ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import subprocess import logging from os import path logger = logging.getLogger(__name__) class Repo: def __init__(self, repo_url, repo_dir): self.repo_dir = repo_dir if not path.exists(self.repo_dir): logger.info('Cloning ' + repo_url + ' into ' + self.repo_dir) subprocess.run( ['git', 'clone', repo_url, self.repo_dir] ).check_returncode() else: logger.info('Fetching') subprocess.run( ['git', 'fetch'], cwd=self.repo_dir ).check_returncode() def get_branches(self): result = subprocess.run( ['git', 'branch', '-r'], capture_output=True, encoding='utf-8', cwd=self.repo_dir) result.check_returncode() branches = result.stdout.splitlines() # strip of origin/ branches = [branch.split('/')[-1] for branch in branches] logger.info('Found ' + str(len(branches)) + ' git branches') return branches def get_tags(self): '''Returns a list of git tags''' result = subprocess.run( ['git', 'tag', '-l'], capture_output=True, encoding='utf-8', cwd=self.repo_dir) result.check_returncode() tags = result.stdout.splitlines() logger.info('Found ' + str(len(tags)) + ' git tags') return tags def checkout(self, tag): '''Checks out a branch or tag''' # logger.info('Checking out ' + tag) result = subprocess.run( ['git', 'checkout', tag], cwd=self.repo_dir, capture_output=True ).check_returncode() gtk-layer-shell-0.9.0/gtk-priv/scripts/version.py000066400000000000000000000073661466775474600220630ustar00rootroot00000000000000''' MIT License Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' import logging import functools import re from config import MIN_SUPPORTED_GTK, MAX_SUPPORTED_GTK logger = logging.getLogger(__name__) COMBO_FACTOR = 1000 @functools.total_ordering # implement all comparisons with just eq and lt class Version: def __init__(self, git_name, minor, micro, released): self.git_name = git_name self.minor = minor self.micro = micro self.released = released def __eq__(self, other): return self.minor == other.minor and self.micro == other.micro def __lt__(self, other): if self.minor == other.minor: return self.micro < other.micro else: return self.minor < other.minor def get_checkout_name(self): return self.git_name def is_supported(self): '''Returns if the version is one we support''' return ( self >= min_supported_version and self <= max_supported_version and self != bad_release_3_24_19) def is_released(self): return self.released def get_combo(self): return self.minor * 1000 + self.micro def __str__(self): result = 'v3.' + str(self.minor) + '.' + str(self.micro) if not self.is_released(): result += ' (unreleased)' return result def c_id(self): '''a string suitable for a C identifier''' return 'v3_' + str(self.minor) + '_' + str(self.micro) def parse_tag(tag): match = re.search(r'^3\.(\d+)\.(\d+)$', tag) if match: minor = int(match.group(1)) micro = int(match.group(2)) return Version(tag, minor, micro, True) else: return None def parse_branch(branch): match = re.search(r'^gtk\-3\-(\d+)$', branch) if match: minor = int(match.group(1)) return minor else: return None min_supported_version = parse_tag(MIN_SUPPORTED_GTK) max_supported_version = parse_tag(MAX_SUPPORTED_GTK) bad_release_3_24_19 = parse_tag('3.24.19') # this is not a good release def parse_tags_and_branches(tags, branches): result = [] for tag in tags: version = parse_tag(tag) if version and version.is_supported(): result.append(version) highest_micro = {} for v in result: highest_micro[v.minor] = max(v.micro, highest_micro.get(v.minor, -1)) for branch in branches: minor = parse_branch(branch) if minor is not None: micro = highest_micro.get(minor, -1) + 1 version = Version('origin/' + branch, minor, micro, False) if version.is_supported(): result.append(version) result.sort() logger.info('Found ' + str(len(result)) + ' supported versions') return result gtk-layer-shell-0.9.0/include/000077500000000000000000000000001466775474600162015ustar00rootroot00000000000000gtk-layer-shell-0.9.0/include/gtk-layer-shell.h000066400000000000000000000325141466775474600213630ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef GTK_LAYER_SHELL_H #define GTK_LAYER_SHELL_H #include /** * SECTION:gtk-layer-shell * @title: Gtk Layer Shell * @short_description: A library to write GTK Applications using Layer Shell * * There is also a [version of this library compatible with GTK4](https://github.com/wmww/gtk4-layer-shell/) * * # Forcing Window Size * If you wish to force your layer surface window to be a different size than it * is by default: * |[ * gtk_widget_set_size_request (GTK_WIDGET (layer_gtk_window), width, height); * // force the window to resize to the new request * gtk_window_resize (layer_gtk_window, 1, 1); * ]| * If width or height is -1, the default is used for that axis. If the window is * anchored to opposite edges of the output (see gtk_layer_set_anchor ()), the * size request is ignored. If you later wish to use the default window size, * simply repeat the two calls but with both width and height as -1. */ G_BEGIN_DECLS /** * GtkLayerShellLayer: * @GTK_LAYER_SHELL_LAYER_BACKGROUND: The background layer. * @GTK_LAYER_SHELL_LAYER_BOTTOM: The bottom layer. * @GTK_LAYER_SHELL_LAYER_TOP: The top layer. * @GTK_LAYER_SHELL_LAYER_OVERLAY: The overlay layer. * @GTK_LAYER_SHELL_LAYER_ENTRY_NUMBER: Should not be used except to get the number of entries. (NOTE: may change in * future releases as more entries are added) */ typedef enum { GTK_LAYER_SHELL_LAYER_BACKGROUND, GTK_LAYER_SHELL_LAYER_BOTTOM, GTK_LAYER_SHELL_LAYER_TOP, GTK_LAYER_SHELL_LAYER_OVERLAY, GTK_LAYER_SHELL_LAYER_ENTRY_NUMBER, // Should not be used except to get the number of entries } GtkLayerShellLayer; /** * GtkLayerShellEdge: * @GTK_LAYER_SHELL_EDGE_LEFT: The left edge of the screen. * @GTK_LAYER_SHELL_EDGE_RIGHT: The right edge of the screen. * @GTK_LAYER_SHELL_EDGE_TOP: The top edge of the screen. * @GTK_LAYER_SHELL_EDGE_BOTTOM: The bottom edge of the screen. * @GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER: Should not be used except to get the number of entries. (NOTE: may change in * future releases as more entries are added) */ typedef enum { GTK_LAYER_SHELL_EDGE_LEFT = 0, GTK_LAYER_SHELL_EDGE_RIGHT, GTK_LAYER_SHELL_EDGE_TOP, GTK_LAYER_SHELL_EDGE_BOTTOM, GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER, // Should not be used except to get the number of entries } GtkLayerShellEdge; /** * GtkLayerShellKeyboardMode: * @GTK_LAYER_SHELL_KEYBOARD_MODE_NONE: This window should not receive keyboard events. * @GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE: This window should have exclusive focus if it is on the top or overlay layer. * @GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND: The user should be able to focus and unfocues this window in an implementation * defined way. Not supported for protocol version < 4. * @GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER: Should not be used except to get the number of entries. (NOTE: may change in * future releases as more entries are added) */ typedef enum { GTK_LAYER_SHELL_KEYBOARD_MODE_NONE = 0, GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE = 1, GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND = 2, GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER = 3, // Should not be used except to get the number of entries } GtkLayerShellKeyboardMode; /** * gtk_layer_get_major_version: * * Returns: the major version number of the GTK Layer Shell library * * Since: 0.4 */ guint gtk_layer_get_major_version (); /** * gtk_layer_get_minor_version: * * Returns: the minor version number of the GTK Layer Shell library * * Since: 0.4 */ guint gtk_layer_get_minor_version (); /** * gtk_layer_get_micro_version: * * Returns: the micro/patch version number of the GTK Layer Shell library * * Since: 0.4 */ guint gtk_layer_get_micro_version (); /** * gtk_layer_is_supported: * * May block for a Wayland roundtrip the first time it's called. * * Returns: %TRUE if the platform is Wayland and Wayland compositor supports the * zwlr_layer_shell_v1 protocol. * * Since: 0.5 */ gboolean gtk_layer_is_supported (); /** * gtk_layer_get_protocol_version: * * May block for a Wayland roundtrip the first time it's called. * * Returns: version of the zwlr_layer_shell_v1 protocol supported by the * compositor or 0 if the protocol is not supported. * * Since: 0.6 */ guint gtk_layer_get_protocol_version (); /** * gtk_layer_init_for_window: * @window: A #GtkWindow to be turned into a layer surface. * * Set the @window up to be a layer surface once it is mapped. this must be called before * the @window is realized. */ void gtk_layer_init_for_window (GtkWindow *window); /** * gtk_layer_is_layer_window: * @window: A #GtkWindow that may or may not have a layer surface. * * Returns: if @window has been initialized as a layer surface. * * Since: 0.5 */ gboolean gtk_layer_is_layer_window (GtkWindow *window); /** * gtk_layer_get_zwlr_layer_surface_v1: * @window: A layer surface. * * Returns: The underlying layer surface Wayland object * * Since: 0.4 */ struct zwlr_layer_surface_v1 *gtk_layer_get_zwlr_layer_surface_v1 (GtkWindow *window); /** * gtk_layer_set_namespace: * @window: A layer surface. * @name_space: The namespace of this layer surface. * * Set the "namespace" of the surface. * * No one is quite sure what this is for, but it probably should be something generic * ("panel", "osk", etc). The @name_space string is copied, and caller maintains * ownership of original. If the window is currently mapped, it will get remapped so * the change can take effect. * * Default is "gtk-layer-shell" (which will be used if set to %NULL) */ void gtk_layer_set_namespace (GtkWindow *window, char const* name_space); /** * gtk_layer_get_namespace: * @window: A layer surface. * * NOTE: this function does not return ownership of the string. Do not free the returned string. * Future calls into the library may invalidate the returned string. * * Returns: a reference to the namespace property. If namespace is unset, returns the * default namespace ("gtk-layer-shell"). Never returns %NULL. * * Since: 0.5 */ const char *gtk_layer_get_namespace (GtkWindow *window); /** * gtk_layer_set_layer: * @window: A layer surface. * @layer: The layer on which this surface appears. * * Set the "layer" on which the surface appears (controls if it is over top of or below other surfaces). The layer may * be changed on-the-fly in the current version of the layer shell protocol, but on compositors that only support an * older version the @window is remapped so the change can take effect. * * Default is %GTK_LAYER_SHELL_LAYER_TOP */ void gtk_layer_set_layer (GtkWindow *window, GtkLayerShellLayer layer); /** * gtk_layer_get_layer: * @window: A layer surface. * * Returns: the current layer. * * Since: 0.5 */ GtkLayerShellLayer gtk_layer_get_layer (GtkWindow *window); /** * gtk_layer_set_monitor: * @window: A layer surface. * @monitor: The output this layer surface will be placed on (%NULL to let the compositor decide). * * Set the output for the window to be placed on, or %NULL to let the compositor choose. * If the window is currently mapped, it will get remapped so the change can take effect. * * Default is %NULL */ void gtk_layer_set_monitor (GtkWindow *window, GdkMonitor *monitor); /** * gtk_layer_get_monitor: * @window: A layer surface. * * NOTE: To get which monitor the surface is actually on, use * gdk_display_get_monitor_at_window(). * * Returns: (transfer none): the monitor this surface will/has requested to be on, can be %NULL. * * Since: 0.5 */ GdkMonitor *gtk_layer_get_monitor (GtkWindow *window); /** * gtk_layer_set_anchor: * @window: A layer surface. * @edge: A #GtkLayerShellEdge this layer surface may be anchored to. * @anchor_to_edge: Whether or not to anchor this layer surface to @edge. * * Set whether @window should be anchored to @edge. * - If two perpendicular edges are anchored, the surface with be anchored to that corner * - If two opposite edges are anchored, the window will be stretched across the screen in that direction * * Default is %FALSE for each #GtkLayerShellEdge */ void gtk_layer_set_anchor (GtkWindow *window, GtkLayerShellEdge edge, gboolean anchor_to_edge); /** * gtk_layer_get_anchor: * @window: A layer surface. * * Returns: if this surface is anchored to the given edge. * * Since: 0.5 */ gboolean gtk_layer_get_anchor (GtkWindow *window, GtkLayerShellEdge edge); /** * gtk_layer_set_margin: * @window: A layer surface. * @edge: The #GtkLayerShellEdge for which to set the margin. * @margin_size: The margin for @edge to be set. * * Set the margin for a specific @edge of a @window. Effects both surface's distance from * the edge and its exclusive zone size (if auto exclusive zone enabled). * * Default is 0 for each #GtkLayerShellEdge */ void gtk_layer_set_margin (GtkWindow *window, GtkLayerShellEdge edge, int margin_size); /** * gtk_layer_get_margin: * @window: A layer surface. * * Returns: the size of the margin for the given edge. * * Since: 0.5 */ int gtk_layer_get_margin (GtkWindow *window, GtkLayerShellEdge edge); /** * gtk_layer_set_exclusive_zone: * @window: A layer surface. * @exclusive_zone: The size of the exclusive zone. * * Has no effect unless the surface is anchored to an edge. Requests that the compositor * does not place other surfaces within the given exclusive zone of the anchored edge. * For example, a panel can request to not be covered by maximized windows. See * wlr-layer-shell-unstable-v1.xml for details. * * Default is 0 */ void gtk_layer_set_exclusive_zone (GtkWindow *window, int exclusive_zone); /** * gtk_layer_get_exclusive_zone: * @window: A layer surface. * * Returns: the window's exclusive zone (which may have been set manually or automatically) * * Since: 0.5 */ int gtk_layer_get_exclusive_zone (GtkWindow *window); /** * gtk_layer_auto_exclusive_zone_enable: * @window: A layer surface. * * When auto exclusive zone is enabled, exclusive zone is automatically set to the * size of the @window + relevant margin. To disable auto exclusive zone, just set the * exclusive zone to 0 or any other fixed value. * * NOTE: you can control the auto exclusive zone by changing the margin on the non-anchored * edge. This behavior is specific to gtk-layer-shell and not part of the underlying protocol */ void gtk_layer_auto_exclusive_zone_enable (GtkWindow *window); /** * gtk_layer_auto_exclusive_zone_is_enabled: * @window: A layer surface. * * Returns: if the surface's exclusive zone is set to change based on the window's size * * Since: 0.5 */ gboolean gtk_layer_auto_exclusive_zone_is_enabled (GtkWindow *window); /** * gtk_layer_set_keyboard_mode: * @window: A layer surface. * @mode: The type of keyboard interactivity requested. * * Sets if/when @window should receive keyboard events from the compositor, see * GtkLayerShellKeyboardMode for details. * * Default is %GTK_LAYER_SHELL_KEYBOARD_MODE_NONE * * Since: 0.6 */ void gtk_layer_set_keyboard_mode (GtkWindow *window, GtkLayerShellKeyboardMode mode); /** * gtk_layer_get_keyboard_mode: * @window: A layer surface. * * Returns: current keyboard interactivity mode for @window. * * Since: 0.6 */ GtkLayerShellKeyboardMode gtk_layer_get_keyboard_mode (GtkWindow *window); /** * gtk_layer_set_keyboard_interactivity: * @window: A layer surface. * @interactivity: Whether the layer surface should receive keyboard events. * * Whether the @window should receive keyboard events from the compositor. * * Default is %FALSE * * Deprecated: 0.6: Use gtk_layer_set_keyboard_mode () instead. */ void gtk_layer_set_keyboard_interactivity (GtkWindow *window, gboolean interactivity); /** * gtk_layer_get_keyboard_interactivity: * @window: A layer surface. * * Returns: if keyboard interactivity is enabled * * Since: 0.5 * Deprecated: 0.6: Use gtk_layer_get_keyboard_mode () instead. */ gboolean gtk_layer_get_keyboard_interactivity (GtkWindow *window); /** * gtk_layer_try_force_commit: * @window: A layer surface. * * Commits a surface state if there's no pending commit scheduled by the GTK. * You almost never need to call this; the only known case is when the surface is in a state * where it does not receive frame callbacks and the regular deferred commit mechanism * is unavailable. * * Since: 0.9 */ void gtk_layer_try_force_commit (GtkWindow *window); G_END_DECLS #endif // GTK_LAYER_SHELL_H gtk-layer-shell-0.9.0/include/meson.build000066400000000000000000000001601466775474600203400ustar00rootroot00000000000000gtk_layer_shell_inc = include_directories('.') install_headers('gtk-layer-shell.h', subdir: 'gtk-layer-shell') gtk-layer-shell-0.9.0/meson.build000066400000000000000000000027131466775474600167230ustar00rootroot00000000000000project('gtk-layer-shell', ['c'], version: '0.9.0', license: 'LGPLv3', meson_version: '>=0.45.1', default_options: ['c_std=gnu11', 'warning_level=3']) lib_so_version = '0' add_project_arguments( ['-Wno-pedantic', '-Werror=unused-function'], language: 'c') gtk = dependency('gtk+-3.0', version: '>=3.22.0') wayland_client = dependency('wayland-client', version: '>=1.10.0') # only required for the tests wayland_server = dependency('wayland-server', version: '>=1.10.0', required: false) # wayland_scanner is required, but we can find it without pkg-config wayland_scanner = dependency('wayland-scanner', version: '>=1.10.0', required: false, native: true) # use system xdg-shell protocol when available wayland_protocols = dependency('wayland-protocols', version: '>=1.16', required: false) pkg_config = import('pkgconfig') gnome = import('gnome') subdir('include') subdir('protocol') subdir('gtk-priv') subdir('src') gtk_layer_shell = declare_dependency( link_with: gtk_layer_shell_lib, include_directories: gtk_layer_shell_inc) subdir('examples') if get_option('docs') subdir('doc') endif if get_option('tests') subdir('test') else # Add a single always-failing test to tell the user to reconfigure with tests enabled py = find_program('python3') tests_not_enabled_script = files(meson.current_source_dir() + '/test/tests-not-enabled.py') test('Tests not enabled', py, args: [tests_not_enabled_script]) endif gtk-layer-shell-0.9.0/meson_options.txt000066400000000000000000000007441466775474600202200ustar00rootroot00000000000000option('examples', type: 'boolean', value: false, description: 'Build example applications') option('docs', type: 'boolean', value: false, description: 'Build devhelp API documentation') option('tests', type: 'boolean', value: false, description: 'Build tests') option('introspection', type: 'boolean', value: true, description: 'Build gobject-introspection data') option('vapi', type: 'boolean', value: true, description: 'Generate vapi data (needs vapigen & introspection option)') gtk-layer-shell-0.9.0/protocol/000077500000000000000000000000001466775474600164175ustar00rootroot00000000000000gtk-layer-shell-0.9.0/protocol/meson.build000066400000000000000000000026711466775474600205670ustar00rootroot00000000000000if wayland_scanner.found() prog_wayland_scanner = find_program(wayland_scanner.get_pkgconfig_variable('wayland_scanner')) else prog_wayland_scanner = find_program('wayland-scanner') endif protocols = [ 'wlr-layer-shell-unstable-v1.xml' ] if wayland_protocols.found() protocols += join_paths( wayland_protocols.get_pkgconfig_variable('pkgdatadir'), 'stable/xdg-shell/xdg-shell.xml') else # use bundled xdg-shell.xml protocols += 'xdg-shell.xml' endif gen_client_header = generator(prog_wayland_scanner, output: ['@BASENAME@-client.h'], arguments: ['-c', 'client-header', '@INPUT@', '@BUILD_DIR@/@BASENAME@-client.h']) gen_server_header = generator(prog_wayland_scanner, output: ['@BASENAME@-server.h'], arguments: ['-c', 'server-header', '@INPUT@', '@BUILD_DIR@/@BASENAME@-server.h']) gen_private_code = generator(prog_wayland_scanner, output: ['@BASENAME@.c'], arguments: ['-c', 'code', '@INPUT@', '@BUILD_DIR@/@BASENAME@.c']) # 'code' is deprecated, and can be replaced with 'private-code' when all platforms have a new enough wayland-scanner client_protocol_srcs = [] server_protocol_srcs = [] foreach protocol : protocols client_header = gen_client_header.process(protocol) server_header = gen_server_header.process(protocol) code = gen_private_code.process(protocol) client_protocol_srcs += [client_header, code] server_protocol_srcs += [server_header, code] endforeach gtk-layer-shell-0.9.0/protocol/wlr-layer-shell-unstable-v1.xml000066400000000000000000000440361466775474600243320ustar00rootroot00000000000000 Copyright © 2017 Drew DeVault Permission to use, copy, modify, distribute, and sell this software and its documentation for any purpose is hereby granted without fee, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of the copyright holders not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. The copyright holders make no representations about the suitability of this software for any purpose. It is provided "as is" without express or implied warranty. THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. Clients can use this interface to assign the surface_layer role to wl_surfaces. Such surfaces are assigned to a "layer" of the output and rendered with a defined z-depth respective to each other. They may also be anchored to the edges and corners of a screen and specify input handling semantics. This interface should be suitable for the implementation of many desktop shell components, and a broad number of other applications that interact with the desktop. Create a layer surface for an existing surface. This assigns the role of layer_surface, or raises a protocol error if another role is already assigned. Creating a layer surface from a wl_surface which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first layer_surface.configure call must also be treated as errors. After creating a layer_surface object and setting it up, the client must perform an initial commit without any buffer attached. The compositor will reply with a layer_surface.configure event. The client must acknowledge it and is then allowed to attach a buffer to map the surface. You may pass NULL for output to allow the compositor to decide which output to use. Generally this will be the one that the user most recently interacted with. Clients can specify a namespace that defines the purpose of the layer surface. These values indicate which layers a surface can be rendered in. They are ordered by z depth, bottom-most first. Traditional shell surfaces will typically be rendered between the bottom and top layers. Fullscreen shell surfaces are typically rendered at the top layer. Multiple surfaces can share a single layer, and ordering within a single layer is undefined. This request indicates that the client will not use the layer_shell object any more. Objects that have been created through this instance are not affected. An interface that may be implemented by a wl_surface, for surfaces that are designed to be rendered as a layer of a stacked desktop-like environment. Layer surface state (layer, size, anchor, exclusive zone, margin, interactivity) is double-buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. Attaching a null buffer to a layer surface unmaps it. Unmapping a layer_surface means that the surface cannot be shown by the compositor until it is explicitly mapped again. The layer_surface returns to the state it had right after layer_shell.get_layer_surface. The client can re-map the surface by performing a commit without any buffer attached, waiting for a configure event and handling it as usual. Sets the size of the surface in surface-local coordinates. The compositor will display the surface centered with respect to its anchors. If you pass 0 for either value, the compositor will assign it and inform you of the assignment in the configure event. You must set your anchor to opposite edges in the dimensions you omit; not doing so is a protocol error. Both values are 0 by default. Size is double-buffered, see wl_surface.commit. Requests that the compositor anchor the surface to the specified edges and corners. If two orthogonal edges are specified (e.g. 'top' and 'left'), then the anchor point will be the intersection of the edges (e.g. the top left corner of the output); otherwise the anchor point will be centered on that edge, or in the center if none is specified. Anchor is double-buffered, see wl_surface.commit. Requests that the compositor avoids occluding an area with other surfaces. The compositor's use of this information is implementation-dependent - do not assume that this region will not actually be occluded. A positive value is only meaningful if the surface is anchored to one edge or an edge and both perpendicular edges. If the surface is not anchored, anchored to only two perpendicular edges (a corner), anchored to only two parallel edges or anchored to all edges, a positive value will be treated the same as zero. A positive zone is the distance from the edge in surface-local coordinates to consider exclusive. Surfaces that do not wish to have an exclusive zone may instead specify how they should interact with surfaces that do. If set to zero, the surface indicates that it would like to be moved to avoid occluding surfaces with a positive exclusive zone. If set to -1, the surface indicates that it would not like to be moved to accommodate for other surfaces, and the compositor should extend it all the way to the edges it is anchored to. For example, a panel might set its exclusive zone to 10, so that maximized shell surfaces are not shown on top of it. A notification might set its exclusive zone to 0, so that it is moved to avoid occluding the panel, but shell surfaces are shown underneath it. A wallpaper or lock screen might set their exclusive zone to -1, so that they stretch below or over the panel. The default value is 0. Exclusive zone is double-buffered, see wl_surface.commit. Requests that the surface be placed some distance away from the anchor point on the output, in surface-local coordinates. Setting this value for edges you are not anchored to has no effect. The exclusive zone includes the margin. Margin is double-buffered, see wl_surface.commit. Types of keyboard interaction possible for layer shell surfaces. The rationale for this is twofold: (1) some applications are not interested in keyboard events and not allowing them to be focused can improve the desktop experience; (2) some applications will want to take exclusive keyboard focus. This value indicates that this surface is not interested in keyboard events and the compositor should never assign it the keyboard focus. This is the default value, set for newly created layer shell surfaces. This is useful for e.g. desktop widgets that display information or only have interaction with non-keyboard input devices. Request exclusive keyboard focus if this surface is above the shell surface layer. For the top and overlay layers, the seat will always give exclusive keyboard focus to the top-most layer which has keyboard interactivity set to exclusive. If this layer contains multiple surfaces with keyboard interactivity set to exclusive, the compositor determines the one receiving keyboard events in an implementation- defined manner. In this case, no guarantee is made when this surface will receive keyboard focus (if ever). For the bottom and background layers, the compositor is allowed to use normal focus semantics. This setting is mainly intended for applications that need to ensure they receive all keyboard events, such as a lock screen or a password prompt. This requests the compositor to allow this surface to be focused and unfocused by the user in an implementation-defined manner. The user should be able to unfocus this surface even regardless of the layer it is on. Typically, the compositor will want to use its normal mechanism to manage keyboard focus between layer shell surfaces with this setting and regular toplevels on the desktop layer (e.g. click to focus). Nevertheless, it is possible for a compositor to require a special interaction to focus or unfocus layer shell surfaces (e.g. requiring a click even if focus follows the mouse normally, or providing a keybinding to switch focus between layers). This setting is mainly intended for desktop shell components (e.g. panels) that allow keyboard interaction. Using this option can allow implementing a desktop shell that can be fully usable without the mouse. Set how keyboard events are delivered to this surface. By default, layer shell surfaces do not receive keyboard events; this request can be used to change this. This setting is inherited by child surfaces set by the get_popup request. Layer surfaces receive pointer, touch, and tablet events normally. If you do not want to receive them, set the input region on your surface to an empty region. Keyboard interactivity is double-buffered, see wl_surface.commit. This assigns an xdg_popup's parent to this layer_surface. This popup should have been created via xdg_surface::get_popup with the parent set to NULL, and this request must be invoked before committing the popup's initial state. See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used. When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack_configure request sometime before the commit request, passing along the serial of the configure event. If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event. A client is not required to commit immediately after sending an ack_configure request - it may even ack_configure several times before its next surface commit. A client may send multiple ack_configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to. This request destroys the layer surface. The configure event asks the client to resize its surface. Clients should arrange their surface for the new states, and then send an ack_configure request with the serial sent in this configure event at some point before committing the new surface. The client is free to dismiss all but the last configure event it received. The width and height arguments specify the size of the window in surface-local coordinates. The size is a hint, in the sense that the client is free to ignore it if it doesn't resize, pick a smaller size (to satisfy aspect ratio or resize in steps of NxM pixels). If the client picks a smaller size and is anchored to two opposite anchors (e.g. 'top' and 'bottom'), the surface will be centered on this axis. If the width or height arguments are zero, it means the client should decide its own window dimension. The closed event is sent by the compositor when the surface will no longer be shown. The output may have been destroyed or the user may have asked for it to be removed. Further changes to the surface will be ignored. The client should destroy the resource after receiving this event, and create a new surface if they so choose. Change the layer that the surface is rendered on. Layer is double-buffered, see wl_surface.commit. gtk-layer-shell-0.9.0/protocol/xdg-shell.xml000066400000000000000000001412111466775474600210300ustar00rootroot00000000000000 Copyright © 2008-2013 Kristian Høgsberg Copyright © 2013 Rafael Antognolli Copyright © 2013 Jasper St. Pierre Copyright © 2010-2013 Intel Corporation Copyright © 2015-2017 Samsung Electronics Co., Ltd Copyright © 2015-2017 Red Hat Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. The xdg_wm_base interface is exposed as a global object enabling clients to turn their wl_surfaces into windows in a desktop environment. It defines the basic functionality needed for clients and the compositor to create windows that can be dragged, resized, maximized, etc, as well as creating transient windows such as popup menus. Destroy this xdg_wm_base object. Destroying a bound xdg_wm_base object while there are surfaces still alive created by this xdg_wm_base object instance is illegal and will result in a protocol error. Create a positioner object. A positioner object is used to position surfaces relative to some parent surface. See the interface description and xdg_surface.get_popup for details. This creates an xdg_surface for the given surface. While xdg_surface itself is not a role, the corresponding surface may only be assigned a role extending xdg_surface, such as xdg_toplevel or xdg_popup. This creates an xdg_surface for the given surface. An xdg_surface is used as basis to define a role to a given surface, such as xdg_toplevel or xdg_popup. It also manages functionality shared between xdg_surface based surface roles. See the documentation of xdg_surface for more details about what an xdg_surface is and how it is used. A client must respond to a ping event with a pong request or the client may be deemed unresponsive. See xdg_wm_base.ping. The ping event asks the client if it's still alive. Pass the serial specified in the event back to the compositor by sending a "pong" request back with the specified serial. See xdg_wm_base.ping. Compositors can use this to determine if the client is still alive. It's unspecified what will happen if the client doesn't respond to the ping request, or in what timeframe. Clients should try to respond in a reasonable amount of time. A compositor is free to ping in any way it wants, but a client must always respond to any xdg_wm_base object it created. The xdg_positioner provides a collection of rules for the placement of a child surface relative to a parent surface. Rules can be defined to ensure the child surface remains within the visible area's borders, and to specify how the child surface changes its position, such as sliding along an axis, or flipping around a rectangle. These positioner-created rules are constrained by the requirement that a child surface must intersect with or be at least partially adjacent to its parent surface. See the various requests for details about possible rules. At the time of the request, the compositor makes a copy of the rules specified by the xdg_positioner. Thus, after the request is complete the xdg_positioner object can be destroyed or reused; further changes to the object will have no effect on previous usages. For an xdg_positioner object to be considered complete, it must have a non-zero size set by set_size, and a non-zero anchor rectangle set by set_anchor_rect. Passing an incomplete xdg_positioner object when positioning a surface raises an error. Notify the compositor that the xdg_positioner will no longer be used. Set the size of the surface that is to be positioned with the positioner object. The size is in surface-local coordinates and corresponds to the window geometry. See xdg_surface.set_window_geometry. If a zero or negative size is set the invalid_input error is raised. Specify the anchor rectangle within the parent surface that the child surface will be placed relative to. The rectangle is relative to the window geometry as defined by xdg_surface.set_window_geometry of the parent surface. When the xdg_positioner object is used to position a child surface, the anchor rectangle may not extend outside the window geometry of the positioned child's parent surface. If a negative size is set the invalid_input error is raised. Defines the anchor point for the anchor rectangle. The specified anchor is used derive an anchor point that the child surface will be positioned relative to. If a corner anchor is set (e.g. 'top_left' or 'bottom_right'), the anchor point will be at the specified corner; otherwise, the derived anchor point will be centered on the specified edge, or in the center of the anchor rectangle if no edge is specified. Defines in what direction a surface should be positioned, relative to the anchor point of the parent surface. If a corner gravity is specified (e.g. 'bottom_right' or 'top_left'), then the child surface will be placed towards the specified gravity; otherwise, the child surface will be centered over the anchor point on any axis that had no gravity specified. The constraint adjustment value define ways the compositor will adjust the position of the surface, if the unadjusted position would result in the surface being partly constrained. Whether a surface is considered 'constrained' is left to the compositor to determine. For example, the surface may be partly outside the compositor's defined 'work area', thus necessitating the child surface's position be adjusted until it is entirely inside the work area. The adjustments can be combined, according to a defined precedence: 1) Flip, 2) Slide, 3) Resize. Don't alter the surface position even if it is constrained on some axis, for example partially outside the edge of an output. Slide the surface along the x axis until it is no longer constrained. First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained. Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained. Slide the surface along the y axis until it is no longer constrained. First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained. Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained. Invert the anchor and gravity on the x axis if the surface is constrained on the x axis. For example, if the left edge of the surface is constrained, the gravity is 'left' and the anchor is 'left', change the gravity to 'right' and the anchor to 'right'. If the adjusted position also ends up being constrained, the resulting position of the flip_x adjustment will be the one before the adjustment. Invert the anchor and gravity on the y axis if the surface is constrained on the y axis. For example, if the bottom edge of the surface is constrained, the gravity is 'bottom' and the anchor is 'bottom', change the gravity to 'top' and the anchor to 'top'. The adjusted position is calculated given the original anchor rectangle and offset, but with the new flipped anchor and gravity values. If the adjusted position also ends up being constrained, the resulting position of the flip_y adjustment will be the one before the adjustment. Resize the surface horizontally so that it is completely unconstrained. Resize the surface vertically so that it is completely unconstrained. Specify how the window should be positioned if the originally intended position caused the surface to be constrained, meaning at least partially outside positioning boundaries set by the compositor. The adjustment is set by constructing a bitmask describing the adjustment to be made when the surface is constrained on that axis. If no bit for one axis is set, the compositor will assume that the child surface should not change its position on that axis when constrained. If more than one bit for one axis is set, the order of how adjustments are applied is specified in the corresponding adjustment descriptions. The default adjustment is none. Specify the surface position offset relative to the position of the anchor on the anchor rectangle and the anchor on the surface. For example if the anchor of the anchor rectangle is at (x, y), the surface has the gravity bottom|right, and the offset is (ox, oy), the calculated surface position will be (x + ox, y + oy). The offset position of the surface is the one used for constraint testing. See set_constraint_adjustment. An example use case is placing a popup menu on top of a user interface element, while aligning the user interface element of the parent surface with some user interface element placed somewhere in the popup surface. An interface that may be implemented by a wl_surface, for implementations that provide a desktop-style user interface. It provides a base set of functionality required to construct user interface elements requiring management by the compositor, such as toplevel windows, menus, etc. The types of functionality are split into xdg_surface roles. Creating an xdg_surface does not set the role for a wl_surface. In order to map an xdg_surface, the client must create a role-specific object using, e.g., get_toplevel, get_popup. The wl_surface for any given xdg_surface can have at most one role, and may not be assigned any role not based on xdg_surface. A role must be assigned before any other requests are made to the xdg_surface object. The client must call wl_surface.commit on the corresponding wl_surface for the xdg_surface state to take effect. Creating an xdg_surface from a wl_surface which has a buffer attached or committed is a client error, and any attempts by a client to attach or manipulate a buffer prior to the first xdg_surface.configure call must also be treated as errors. Mapping an xdg_surface-based role surface is defined as making it possible for the surface to be shown by the compositor. Note that a mapped surface is not guaranteed to be visible once it is mapped. For an xdg_surface to be mapped by the compositor, the following conditions must be met: (1) the client has assigned an xdg_surface-based role to the surface (2) the client has set and committed the xdg_surface state and the role-dependent state to the surface (3) the client has committed a buffer to the surface A newly-unmapped surface is considered to have met condition (1) out of the 3 required conditions for mapping a surface if its role surface has not been destroyed. Destroy the xdg_surface object. An xdg_surface must only be destroyed after its role object has been destroyed. This creates an xdg_toplevel object for the given xdg_surface and gives the associated wl_surface the xdg_toplevel role. See the documentation of xdg_toplevel for more details about what an xdg_toplevel is and how it is used. This creates an xdg_popup object for the given xdg_surface and gives the associated wl_surface the xdg_popup role. If null is passed as a parent, a parent surface must be specified using some other protocol, before committing the initial state. See the documentation of xdg_popup for more details about what an xdg_popup is and how it is used. The window geometry of a surface is its "visible bounds" from the user's perspective. Client-side decorations often have invisible portions like drop-shadows which should be ignored for the purposes of aligning, placing and constraining windows. The window geometry is double buffered, and will be applied at the time wl_surface.commit of the corresponding wl_surface is called. When maintaining a position, the compositor should treat the (x, y) coordinate of the window geometry as the top left corner of the window. A client changing the (x, y) window geometry coordinate should in general not alter the position of the window. Once the window geometry of the surface is set, it is not possible to unset it, and it will remain the same until set_window_geometry is called again, even if a new subsurface or buffer is attached. If never set, the value is the full bounds of the surface, including any subsurfaces. This updates dynamically on every commit. This unset is meant for extremely simple clients. The arguments are given in the surface-local coordinate space of the wl_surface associated with this xdg_surface. The width and height must be greater than zero. Setting an invalid size will raise an error. When applied, the effective window geometry will be the set window geometry clamped to the bounding rectangle of the combined geometry of the surface of the xdg_surface and the associated subsurfaces. When a configure event is received, if a client commits the surface in response to the configure event, then the client must make an ack_configure request sometime before the commit request, passing along the serial of the configure event. For instance, for toplevel surfaces the compositor might use this information to move a surface to the top left only when the client has drawn itself for the maximized or fullscreen state. If the client receives multiple configure events before it can respond to one, it only has to ack the last configure event. A client is not required to commit immediately after sending an ack_configure request - it may even ack_configure several times before its next surface commit. A client may send multiple ack_configure requests before committing, but only the last request sent before a commit indicates which configure event the client really is responding to. The configure event marks the end of a configure sequence. A configure sequence is a set of one or more events configuring the state of the xdg_surface, including the final xdg_surface.configure event. Where applicable, xdg_surface surface roles will during a configure sequence extend this event as a latched state sent as events before the xdg_surface.configure event. Such events should be considered to make up a set of atomically applied configuration states, where the xdg_surface.configure commits the accumulated state. Clients should arrange their surface for the new states, and then send an ack_configure request with the serial sent in this configure event at some point before committing the new surface. If the client receives multiple configure events before it can respond to one, it is free to discard all but the last event it received. This interface defines an xdg_surface role which allows a surface to, among other things, set window-like properties such as maximize, fullscreen, and minimize, set application-specific metadata like title and id, and well as trigger user interactive operations such as interactive resize and move. Unmapping an xdg_toplevel means that the surface cannot be shown by the compositor until it is explicitly mapped again. All active operations (e.g., move, resize) are canceled and all attributes (e.g. title, state, stacking, ...) are discarded for an xdg_toplevel surface when it is unmapped. Attaching a null buffer to a toplevel unmaps the surface. This request destroys the role surface and unmaps the surface; see "Unmapping" behavior in interface section for details. Set the "parent" of this surface. This surface should be stacked above the parent surface and all other ancestor surfaces. Parent windows should be set on dialogs, toolboxes, or other "auxiliary" surfaces, so that the parent is raised when the dialog is raised. Setting a null parent for a child window removes any parent-child relationship for the child. Setting a null parent for a window which currently has no parent is a no-op. If the parent is unmapped then its children are managed as though the parent of the now-unmapped parent has become the parent of this surface. If no parent exists for the now-unmapped parent then the children are managed as though they have no parent surface. Set a short title for the surface. This string may be used to identify the surface in a task bar, window list, or other user interface elements provided by the compositor. The string must be encoded in UTF-8. Set an application identifier for the surface. The app ID identifies the general class of applications to which the surface belongs. The compositor can use this to group multiple surfaces together, or to determine how to launch a new application. For D-Bus activatable applications, the app ID is used as the D-Bus service name. The compositor shell will try to group application surfaces together by their app ID. As a best practice, it is suggested to select app ID's that match the basename of the application's .desktop file. For example, "org.freedesktop.FooViewer" where the .desktop file is "org.freedesktop.FooViewer.desktop". See the desktop-entry specification [0] for more details on application identifiers and how they relate to well-known D-Bus names and .desktop files. [0] http://standards.freedesktop.org/desktop-entry-spec/ Clients implementing client-side decorations might want to show a context menu when right-clicking on the decorations, giving the user a menu that they can use to maximize or minimize the window. This request asks the compositor to pop up such a window menu at the given position, relative to the local surface coordinates of the parent surface. There are no guarantees as to what menu items the window menu contains. This request must be used in response to some sort of user action like a button press, key press, or touch down event. Start an interactive, user-driven move of the surface. This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive move (touch, pointer, etc). The server may ignore move requests depending on the state of the surface (e.g. fullscreen or maximized), or if the passed serial is no longer valid. If triggered, the surface will lose the focus of the device (wl_pointer, wl_touch, etc) used for the move. It is up to the compositor to visually indicate that the move is taking place, such as updating a pointer cursor, during the move. There is no guarantee that the device focus will return when the move is completed. These values are used to indicate which edge of a surface is being dragged in a resize operation. Start a user-driven, interactive resize of the surface. This request must be used in response to some sort of user action like a button press, key press, or touch down event. The passed serial is used to determine the type of interactive resize (touch, pointer, etc). The server may ignore resize requests depending on the state of the surface (e.g. fullscreen or maximized). If triggered, the client will receive configure events with the "resize" state enum value and the expected sizes. See the "resize" enum value for more details about what is required. The client must also acknowledge configure events using "ack_configure". After the resize is completed, the client will receive another "configure" event without the resize state. If triggered, the surface also will lose the focus of the device (wl_pointer, wl_touch, etc) used for the resize. It is up to the compositor to visually indicate that the resize is taking place, such as updating a pointer cursor, during the resize. There is no guarantee that the device focus will return when the resize is completed. The edges parameter specifies how the surface should be resized, and is one of the values of the resize_edge enum. The compositor may use this information to update the surface position for example when dragging the top left corner. The compositor may also use this information to adapt its behavior, e.g. choose an appropriate cursor image. The different state values used on the surface. This is designed for state values like maximized, fullscreen. It is paired with the configure event to ensure that both the client and the compositor setting the state can be synchronized. States set in this way are double-buffered. They will get applied on the next commit. The surface is maximized. The window geometry specified in the configure event must be obeyed by the client. The client should draw without shadow or other decoration outside of the window geometry. The surface is fullscreen. The window geometry specified in the configure event is a maximum; the client cannot resize beyond it. For a surface to cover the whole fullscreened area, the geometry dimensions must be obeyed by the client. For more details, see xdg_toplevel.set_fullscreen. The surface is being resized. The window geometry specified in the configure event is a maximum; the client cannot resize beyond it. Clients that have aspect ratio or cell sizing configuration can use a smaller size, however. Client window decorations should be painted as if the window is active. Do not assume this means that the window actually has keyboard or pointer focus. The window is currently in a tiled layout and the left edge is considered to be adjacent to another part of the tiling grid. The window is currently in a tiled layout and the right edge is considered to be adjacent to another part of the tiling grid. The window is currently in a tiled layout and the top edge is considered to be adjacent to another part of the tiling grid. The window is currently in a tiled layout and the bottom edge is considered to be adjacent to another part of the tiling grid. Set a maximum size for the window. The client can specify a maximum size so that the compositor does not try to configure the window beyond this size. The width and height arguments are in window geometry coordinates. See xdg_surface.set_window_geometry. Values set in this way are double-buffered. They will get applied on the next commit. The compositor can use this information to allow or disallow different states like maximize or fullscreen and draw accurate animations. Similarly, a tiling window manager may use this information to place and resize client windows in a more effective way. The client should not rely on the compositor to obey the maximum size. The compositor may decide to ignore the values set by the client and request a larger size. If never set, or a value of zero in the request, means that the client has no expected maximum size in the given dimension. As a result, a client wishing to reset the maximum size to an unspecified state can use zero for width and height in the request. Requesting a maximum size to be smaller than the minimum size of a surface is illegal and will result in a protocol error. The width and height must be greater than or equal to zero. Using strictly negative values for width and height will result in a protocol error. Set a minimum size for the window. The client can specify a minimum size so that the compositor does not try to configure the window below this size. The width and height arguments are in window geometry coordinates. See xdg_surface.set_window_geometry. Values set in this way are double-buffered. They will get applied on the next commit. The compositor can use this information to allow or disallow different states like maximize or fullscreen and draw accurate animations. Similarly, a tiling window manager may use this information to place and resize client windows in a more effective way. The client should not rely on the compositor to obey the minimum size. The compositor may decide to ignore the values set by the client and request a smaller size. If never set, or a value of zero in the request, means that the client has no expected minimum size in the given dimension. As a result, a client wishing to reset the minimum size to an unspecified state can use zero for width and height in the request. Requesting a minimum size to be larger than the maximum size of a surface is illegal and will result in a protocol error. The width and height must be greater than or equal to zero. Using strictly negative values for width and height will result in a protocol error. Maximize the surface. After requesting that the surface should be maximized, the compositor will respond by emitting a configure event. Whether this configure actually sets the window maximized is subject to compositor policies. The client must then update its content, drawing in the configured state. The client must also acknowledge the configure when committing the new content (see ack_configure). It is up to the compositor to decide how and where to maximize the surface, for example which output and what region of the screen should be used. If the surface was already maximized, the compositor will still emit a configure event with the "maximized" state. If the surface is in a fullscreen state, this request has no direct effect. It may alter the state the surface is returned to when unmaximized unless overridden by the compositor. Unmaximize the surface. After requesting that the surface should be unmaximized, the compositor will respond by emitting a configure event. Whether this actually un-maximizes the window is subject to compositor policies. If available and applicable, the compositor will include the window geometry dimensions the window had prior to being maximized in the configure event. The client must then update its content, drawing it in the configured state. The client must also acknowledge the configure when committing the new content (see ack_configure). It is up to the compositor to position the surface after it was unmaximized; usually the position the surface had before maximizing, if applicable. If the surface was already not maximized, the compositor will still emit a configure event without the "maximized" state. If the surface is in a fullscreen state, this request has no direct effect. It may alter the state the surface is returned to when unmaximized unless overridden by the compositor. Make the surface fullscreen. After requesting that the surface should be fullscreened, the compositor will respond by emitting a configure event. Whether the client is actually put into a fullscreen state is subject to compositor policies. The client must also acknowledge the configure when committing the new content (see ack_configure). The output passed by the request indicates the client's preference as to which display it should be set fullscreen on. If this value is NULL, it's up to the compositor to choose which display will be used to map this surface. If the surface doesn't cover the whole output, the compositor will position the surface in the center of the output and compensate with with border fill covering the rest of the output. The content of the border fill is undefined, but should be assumed to be in some way that attempts to blend into the surrounding area (e.g. solid black). If the fullscreened surface is not opaque, the compositor must make sure that other screen content not part of the same surface tree (made up of subsurfaces, popups or similarly coupled surfaces) are not visible below the fullscreened surface. Make the surface no longer fullscreen. After requesting that the surface should be unfullscreened, the compositor will respond by emitting a configure event. Whether this actually removes the fullscreen state of the client is subject to compositor policies. Making a surface unfullscreen sets states for the surface based on the following: * the state(s) it may have had before becoming fullscreen * any state(s) decided by the compositor * any state(s) requested by the client while the surface was fullscreen The compositor may include the previous window geometry dimensions in the configure event, if applicable. The client must also acknowledge the configure when committing the new content (see ack_configure). Request that the compositor minimize your surface. There is no way to know if the surface is currently minimized, nor is there any way to unset minimization on this surface. If you are looking to throttle redrawing when minimized, please instead use the wl_surface.frame event for this, as this will also work with live previews on windows in Alt-Tab, Expose or similar compositor features. This configure event asks the client to resize its toplevel surface or to change its state. The configured state should not be applied immediately. See xdg_surface.configure for details. The width and height arguments specify a hint to the window about how its surface should be resized in window geometry coordinates. See set_window_geometry. If the width or height arguments are zero, it means the client should decide its own window dimension. This may happen when the compositor needs to configure the state of the surface but doesn't have any information about any previous or expected dimension. The states listed in the event specify how the width/height arguments should be interpreted, and possibly how it should be drawn. Clients must send an ack_configure in response to this event. See xdg_surface.configure and xdg_surface.ack_configure for details. The close event is sent by the compositor when the user wants the surface to be closed. This should be equivalent to the user clicking the close button in client-side decorations, if your application has any. This is only a request that the user intends to close the window. The client may choose to ignore this request, or show a dialog to ask the user to save their data, etc. A popup surface is a short-lived, temporary surface. It can be used to implement for example menus, popovers, tooltips and other similar user interface concepts. A popup can be made to take an explicit grab. See xdg_popup.grab for details. When the popup is dismissed, a popup_done event will be sent out, and at the same time the surface will be unmapped. See the xdg_popup.popup_done event for details. Explicitly destroying the xdg_popup object will also dismiss the popup and unmap the surface. Clients that want to dismiss the popup when another surface of their own is clicked should dismiss the popup using the destroy request. A newly created xdg_popup will be stacked on top of all previously created xdg_popup surfaces associated with the same xdg_toplevel. The parent of an xdg_popup must be mapped (see the xdg_surface description) before the xdg_popup itself. The x and y arguments passed when creating the popup object specify where the top left of the popup should be placed, relative to the local surface coordinates of the parent surface. See xdg_surface.get_popup. An xdg_popup must intersect with or be at least partially adjacent to its parent surface. The client must call wl_surface.commit on the corresponding wl_surface for the xdg_popup state to take effect. This destroys the popup. Explicitly destroying the xdg_popup object will also dismiss the popup, and unmap the surface. If this xdg_popup is not the "topmost" popup, a protocol error will be sent. This request makes the created popup take an explicit grab. An explicit grab will be dismissed when the user dismisses the popup, or when the client destroys the xdg_popup. This can be done by the user clicking outside the surface, using the keyboard, or even locking the screen through closing the lid or a timeout. If the compositor denies the grab, the popup will be immediately dismissed. This request must be used in response to some sort of user action like a button press, key press, or touch down event. The serial number of the event should be passed as 'serial'. The parent of a grabbing popup must either be an xdg_toplevel surface or another xdg_popup with an explicit grab. If the parent is another xdg_popup it means that the popups are nested, with this popup now being the topmost popup. Nested popups must be destroyed in the reverse order they were created in, e.g. the only popup you are allowed to destroy at all times is the topmost one. When compositors choose to dismiss a popup, they may dismiss every nested grabbing popup as well. When a compositor dismisses popups, it will follow the same dismissing order as required from the client. The parent of a grabbing popup must either be another xdg_popup with an active explicit grab, or an xdg_popup or xdg_toplevel, if there are no explicit grabs already taken. If the topmost grabbing popup is destroyed, the grab will be returned to the parent of the popup, if that parent previously had an explicit grab. If the parent is a grabbing popup which has already been dismissed, this popup will be immediately dismissed. If the parent is a popup that did not take an explicit grab, an error will be raised. During a popup grab, the client owning the grab will receive pointer and touch events for all their surfaces as normal (similar to an "owner-events" grab in X11 parlance), while the top most grabbing popup will always have keyboard focus. This event asks the popup surface to configure itself given the configuration. The configured state should not be applied immediately. See xdg_surface.configure for details. The x and y arguments represent the position the popup was placed at given the xdg_positioner rule, relative to the upper left corner of the window geometry of the parent surface. The popup_done event is sent out when a popup is dismissed by the compositor. The client should destroy the xdg_popup object at this point. gtk-layer-shell-0.9.0/release_process.md000066400000000000000000000021621466775474600202570ustar00rootroot00000000000000# GTK Layer Shell release process 1. Make sure you've pulled latest changes from master 1. Create/checkout branch for this series: `git checkout -b release-A.B`/`git checkout release-A.B` 1. Pull GTK and update gtk-priv: `./gtk-priv/scripts/build.py` (see [gtk-priv/README.md](gtk-priv/README.md) for details) 1. Commit any changes to gtk-priv the script may have made 1. Make sure the tests pass: `ninja -C build test` 1. Compile and play around with gtk-layer-demo: `./build/examples/gtk-layer-demo` (catch anything the automatic tests missed) 1. Bump version in [meson.build](meson.build) 1. Update [compatibility.md](compatibility.md) 1. Update [CHANGELOG.md](CHANGELOG.md) ([GitHub compare](https://github.com/wmww/gtk-layer-shell/compare/) is useful here) 1. Commit and push meson, compatibility and changelog changes 1. Tag release: `git tag vA.B.C` 1. Push tag: `git push origin vA.B.C` 1. PR and merge release branch into master 1. Under Releases in the GitHub repo, the tag should have already appeared, click it 1. Click Edit tag 1. Enter release name (version number, no v prefix) and copy in the changelog 1. Publish release gtk-layer-shell-0.9.0/src/000077500000000000000000000000001466775474600153455ustar00rootroot00000000000000gtk-layer-shell-0.9.0/src/api.c000066400000000000000000000241371466775474600162710ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-shell.h" #include "gtk-wayland.h" #include "custom-shell-surface.h" #include "simple-conversions.h" #include "layer-surface.h" #include "xdg-toplevel-surface.h" #include guint gtk_layer_get_major_version () { return GTK_LAYER_SHELL_MAJOR; } guint gtk_layer_get_minor_version () { return GTK_LAYER_SHELL_MINOR; } guint gtk_layer_get_micro_version () { return GTK_LAYER_SHELL_MICRO; } gboolean gtk_layer_is_supported () { if (!GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) return FALSE; gtk_wayland_init_if_needed (); return gtk_wayland_get_layer_shell_global () != NULL; } guint gtk_layer_get_protocol_version () { if (!GDK_IS_WAYLAND_DISPLAY (gdk_display_get_default ())) return 0; gtk_wayland_init_if_needed (); struct zwlr_layer_shell_v1 *layer_shell_global = gtk_wayland_get_layer_shell_global (); if (!layer_shell_global) return 0; return zwlr_layer_shell_v1_get_version (layer_shell_global); } static LayerSurface* gtk_window_get_layer_surface (GtkWindow *window) { g_return_val_if_fail (window, NULL); CustomShellSurface *shell_surface = gtk_window_get_custom_shell_surface (window); if (!shell_surface) { g_critical ("GtkWindow is not a layer surface. Make sure you called gtk_layer_init_for_window ()"); return NULL; } LayerSurface *layer_surface = custom_shell_surface_get_layer_surface (shell_surface); if (!layer_surface) { g_critical ("Custom wayland shell surface is not a layer surface, your Wayland compositor may not support Layer Shell"); return NULL; } return layer_surface; } void gtk_layer_init_for_window (GtkWindow *window) { gtk_wayland_init_if_needed (); LayerSurface* layer_surface = layer_surface_new (window); if (!layer_surface) { g_warning ("Falling back to XDG shell instead of Layer Shell (surface should appear but layer features will not work)"); XdgToplevelSurface* toplevel_surface = xdg_toplevel_surface_new (window); if (!toplevel_surface) { g_warning ("Shell does not support XDG shell stable. Falling back to default GTK behavior"); } } } gboolean gtk_layer_is_layer_window (GtkWindow *window) { g_return_val_if_fail (window, FALSE); CustomShellSurface *shell_surface = gtk_window_get_custom_shell_surface (window); if (!shell_surface) return FALSE; LayerSurface *layer_surface = custom_shell_surface_get_layer_surface (shell_surface); return layer_surface != NULL; } struct zwlr_layer_surface_v1 * gtk_layer_get_zwlr_layer_surface_v1 (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return NULL; // Error message already shown in gtk_window_get_layer_surface return layer_surface->layer_surface; } void gtk_layer_set_namespace (GtkWindow *window, char const* name_space) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_name_space (layer_surface, name_space); } const char * gtk_layer_get_namespace (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); // If layer_surface is NULL, error message already shown in gtk_window_get_layer_surface return layer_surface_get_namespace (layer_surface); // NULL-safe } void gtk_layer_set_layer (GtkWindow *window, GtkLayerShellLayer layer) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_layer (layer_surface, layer); } GtkLayerShellLayer gtk_layer_get_layer (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return GTK_LAYER_SHELL_LAYER_TOP; // Error message already shown in gtk_window_get_layer_surface return layer_surface->layer; } void gtk_layer_set_monitor (GtkWindow *window, GdkMonitor *monitor) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_monitor (layer_surface, monitor); } GdkMonitor * gtk_layer_get_monitor (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return NULL; // Error message already shown in gtk_window_get_layer_surface return layer_surface->monitor; } void gtk_layer_set_anchor (GtkWindow *window, GtkLayerShellEdge edge, gboolean anchor_to_edge) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_anchor (layer_surface, edge, anchor_to_edge); } gboolean gtk_layer_get_anchor (GtkWindow *window, GtkLayerShellEdge edge) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return FALSE; // Error message already shown in gtk_window_get_layer_surface g_return_val_if_fail(edge >= 0 && edge < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER, FALSE); return layer_surface->anchors[edge]; } void gtk_layer_set_margin (GtkWindow *window, GtkLayerShellEdge edge, int margin_size) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_margin (layer_surface, edge, margin_size); } int gtk_layer_get_margin (GtkWindow *window, GtkLayerShellEdge edge) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return 0; // Error message already shown in gtk_window_get_layer_surface g_return_val_if_fail(edge >= 0 && edge < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER, FALSE); return layer_surface->margins[edge]; } void gtk_layer_set_exclusive_zone (GtkWindow *window, int exclusive_zone) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_exclusive_zone (layer_surface, exclusive_zone); } int gtk_layer_get_exclusive_zone (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return 0; // Error message already shown in gtk_window_get_layer_surface return layer_surface->exclusive_zone; } void gtk_layer_auto_exclusive_zone_enable (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_auto_exclusive_zone_enable (layer_surface); } gboolean gtk_layer_auto_exclusive_zone_is_enabled (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return FALSE; // Error message already shown in gtk_window_get_layer_surface return layer_surface->auto_exclusive_zone; } void gtk_layer_set_keyboard_interactivity (GtkWindow *window, gboolean interactivity) { if (interactivity != TRUE && interactivity != FALSE) { g_warning ( "boolean with value %d sent to gtk_layer_set_keyboard_interactivity (), " "perhaps gtk_layer_set_keyboard_mode () was intended?", interactivity); } gtk_layer_set_keyboard_mode ( window, interactivity ? GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE : GTK_LAYER_SHELL_KEYBOARD_MODE_NONE); } gboolean gtk_layer_get_keyboard_interactivity (GtkWindow *window) { GtkLayerShellKeyboardMode mode = gtk_layer_get_keyboard_mode (window); if (mode != GTK_LAYER_SHELL_KEYBOARD_MODE_NONE && mode != GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE) { g_warning ( "gtk_layer_get_keyboard_interactivity () used after keyboard mode set to %d," "consider using gtk_layer_get_keyboard_mode ().", mode); } return mode != GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; } void gtk_layer_set_keyboard_mode (GtkWindow *window, GtkLayerShellKeyboardMode mode) { g_return_if_fail(mode < GTK_LAYER_SHELL_KEYBOARD_MODE_ENTRY_NUMBER); LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return; // Error message already shown in gtk_window_get_layer_surface layer_surface_set_keyboard_mode (layer_surface, mode); } GtkLayerShellKeyboardMode gtk_layer_get_keyboard_mode (GtkWindow *window) { LayerSurface *layer_surface = gtk_window_get_layer_surface (window); if (!layer_surface) return GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; // Error message already shown in gtk_window_get_layer_surface return layer_surface->keyboard_mode; } void gtk_layer_try_force_commit (GtkWindow *window) { CustomShellSurface *shell_surface = gtk_window_get_custom_shell_surface (window); if (!shell_surface) return; custom_shell_surface_force_commit (shell_surface); } gtk-layer-shell-0.9.0/src/custom-shell-surface.c000066400000000000000000000202211466775474600215530ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "custom-shell-surface.h" #include "gtk-wayland.h" #include "gtk-priv-access.h" #include #include #include static const char *custom_shell_surface_key = "wayland_custom_shell_surface"; struct _CustomShellSurfacePrivate { GtkWindow *gtk_window; CustomShellSurface *popup_parent; GList *popup_children; }; static void custom_shell_surface_on_window_destroy (CustomShellSurface *self) { self->virtual->finalize (self); if (self->private->popup_parent) { g_warning ("Shell surface has popup parent on finalize (should have been cleared by unmap)"); struct _CustomShellSurfacePrivate *parent_private = self->private->popup_parent->private; parent_private->popup_children = g_list_remove(parent_private->popup_children, self); } while (self->private->popup_children) { g_warning ("Shell surface has popup children on finalize (should have been cleared by unmap)"); CustomShellSurface *child_private = self->private->popup_children->data; child_private->private->popup_parent = NULL; self->private->popup_children = g_list_remove_link (self->private->popup_children, self->private->popup_children); } g_free (self->private); g_free (self); } static void custom_shell_surface_on_window_realize (GtkWidget *widget, CustomShellSurface *self) { g_return_if_fail (GTK_WIDGET (self->private->gtk_window) == widget); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (self->private->gtk_window)); g_return_if_fail (gdk_window); gtk_priv_access_init (gdk_window); gdk_wayland_window_set_use_custom_surface (gdk_window); } static void custom_shell_surface_on_window_map (GtkWidget *widget, CustomShellSurface *self) { g_return_if_fail (GTK_WIDGET (self->private->gtk_window) == widget); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (self->private->gtk_window)); g_return_if_fail (gdk_window); struct wl_surface *wl_surface = gdk_wayland_window_get_wl_surface (gdk_window); g_return_if_fail (wl_surface); // In some cases (observed when a mate panel has an image background) GDK will attach a buffer just after creating // the surface (see the implementation of gdk_wayland_window_show() for details). Giving the surface a role with a // buffer attached is a protocol violation, so we attach a null buffer. GDK hasn't committed the buffer it may have // attached, so we don't need to commit. If this is removed, test-window-with-initially-attached-buffer should fail. wl_surface_attach (wl_surface, NULL, 0, 0); self->virtual->map (self, wl_surface); gdk_window_set_priv_mapped (gdk_window); wl_surface_commit (wl_surface); wl_display_roundtrip (gdk_wayland_display_get_wl_display (gdk_display_get_default ())); } void custom_shell_surface_init (CustomShellSurface *self, GtkWindow *gtk_window) { g_assert (self->virtual); // Subclass should have set this up first self->private = g_new0 (CustomShellSurfacePrivate, 1); self->private->gtk_window = gtk_window; g_return_if_fail (gtk_window); g_return_if_fail (!gtk_widget_get_mapped (GTK_WIDGET (gtk_window))); g_object_set_data_full (G_OBJECT (gtk_window), custom_shell_surface_key, self, (GDestroyNotify) custom_shell_surface_on_window_destroy); g_signal_connect (gtk_window, "realize", G_CALLBACK (custom_shell_surface_on_window_realize), self); g_signal_connect (gtk_window, "map", G_CALLBACK (custom_shell_surface_on_window_map), self); if (gtk_widget_get_realized (GTK_WIDGET (gtk_window))) { // We must be in the process of realizing now custom_shell_surface_on_window_realize (GTK_WIDGET (gtk_window), self); } } CustomShellSurface * gtk_window_get_custom_shell_surface (GtkWindow *gtk_window) { if (!gtk_window) return NULL; return g_object_get_data (G_OBJECT (gtk_window), custom_shell_surface_key); } GtkWindow * custom_shell_surface_get_gtk_window (CustomShellSurface *self) { g_return_val_if_fail (self, NULL); return self->private->gtk_window; } void custom_shell_surface_needs_commit (CustomShellSurface *self) { if (!self->private->gtk_window) return; GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (self->private->gtk_window)); if (!gdk_window) return; // Hopefully this will trigger a commit // Don't commit directly, as that screws up GTK's internal state // (see https://github.com/wmww/gtk-layer-shell/issues/51) gdk_window_invalidate_rect (gdk_window, NULL, FALSE); } void custom_shell_surface_force_commit (CustomShellSurface *self) { if (!self->private->gtk_window) return; GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (self->private->gtk_window)); if (!gdk_window || gdk_window_get_priv_pending_commit (gdk_window)) return; struct wl_surface *wl_surface = gdk_wayland_window_get_wl_surface (gdk_window); if (!wl_surface) return; wl_surface_commit (wl_surface); } void custom_shell_surface_remap (CustomShellSurface *self) { GtkWidget *window_widget = GTK_WIDGET (self->private->gtk_window); g_return_if_fail (window_widget); gtk_widget_hide (window_widget); gtk_widget_show (window_widget); } // Calls virtual->get_popup and adds the surface to the list of popups struct xdg_popup* custom_shell_surface_add_popup (CustomShellSurface *self, CustomShellSurface *popup, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner) { if (g_list_find (self->private->popup_children, popup)) { g_warning ("Popup added to shell surface multiple times"); } else { self->private->popup_children = g_list_append (self->private->popup_children, popup); } popup->private->popup_parent = self; return self->virtual->get_popup (self, popup_xdg_surface, positioner); } // Unamps all popups and then calls virtual->unmap() void custom_shell_surface_unmap (CustomShellSurface *self) { // Since we have to unmap *before* the default GTK handler (so we delete our objects before the wl_surface gets // deleted), we also unmap before the GTK logic kicks in that unmaps children before parents. That means we have to // handle that ourselves. GList* local_children = self->private->popup_children; self->private->popup_children = NULL; while (local_children) { custom_shell_surface_unmap (local_children->data); local_children = g_list_remove_link (local_children, local_children); } if (self->private->popup_parent) { struct _CustomShellSurfacePrivate *parent_private = self->private->popup_parent->private; parent_private->popup_children = g_list_remove (parent_private->popup_children, self); self->private->popup_parent = NULL; } self->virtual->unmap (self); } gtk-layer-shell-0.9.0/src/custom-shell-surface.h000066400000000000000000000077151466775474600215750ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef CUSTOM_SHELL_SURFACE_H #define CUSTOM_SHELL_SURFACE_H #include #include struct wl_surface; struct xdg_surface; struct xdg_positioner; typedef struct _CustomShellSurface CustomShellSurface; typedef struct _CustomShellSurfacePrivate CustomShellSurfacePrivate; typedef struct _CustomShellSurfaceVirtual CustomShellSurfaceVirtual; struct _CustomShellSurfaceVirtual { // Called during the window's gtk signal of the same name // Should create the wayland objects needed to map the surface void (*map) (CustomShellSurface *super, struct wl_surface *wl_surface); // Must be called before the associated GtkWindow is unmapped void (*unmap) (CustomShellSurface *super); // Will usually call unmap; can be the same function if no other resources need to be freed void (*finalize) (CustomShellSurface *super); struct xdg_popup *(*get_popup) (CustomShellSurface *super, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner); // Returns the logical geometry of the window (excludes shadows and such) GdkRectangle (*get_logical_geom) (CustomShellSurface *super); }; struct _CustomShellSurface { CustomShellSurfaceVirtual const *virtual; CustomShellSurfacePrivate *private; }; // Usually called by the subclass constructors // Does not map the surface yet void custom_shell_surface_init (CustomShellSurface *self, GtkWindow *gtk_window); // If the window has a shell surface, return it; else return NULL // NULL input is handled gracefully CustomShellSurface *gtk_window_get_custom_shell_surface (GtkWindow *gtk_window); GtkWindow *custom_shell_surface_get_gtk_window (CustomShellSurface *self); // Schedules commit on the next frame callback // Does nothing is the shell surface does not currently have a GdkWindow with a wl_surface void custom_shell_surface_needs_commit (CustomShellSurface *self); // Attempts to commit the surface immediately // Does nothing is the shell surface does not currently have a GdkWindow with a wl_surface void custom_shell_surface_force_commit (CustomShellSurface *self); // Unmap and remap a currently mapped shell surface void custom_shell_surface_remap (CustomShellSurface *self); // Calls virtual->get_popup and adds the surface to the list of popups struct xdg_popup* custom_shell_surface_add_popup (CustomShellSurface *self, CustomShellSurface *popup, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner); // Unamps all popups and then calls virtual->unmap() void custom_shell_surface_unmap (CustomShellSurface *self); // Destruction is taken care of automatically when the associated window is destroyed #endif // CUSTOM_SHELL_SURFACE_H gtk-layer-shell-0.9.0/src/gtk-priv-access.c000066400000000000000000000221041466775474600205120ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-priv-access.h" #include "gtk-wayland.h" #include "xdg-popup-surface.h" #include "wayland-client.h" typedef enum _PositionMethod { POSITION_METHOD_ENUM } PositionMethod; typedef void *EGLSurface; typedef void *GdkWaylandWindowExported; typedef void *GdkWaylandTabletToolData; #include "gdk_window_impl_priv.h" #include "gdk_window_priv.h" #include "gdk_window_impl_wayland_priv.h" #include "gdk_window_impl_class_priv.h" #include "gdk_wayland_pointer_frame_data_priv.h" #include "gdk_wayland_pointer_data_priv.h" #include "gdk_wayland_seat_priv.h" #include "gdk_wayland_touch_data_priv.h" #include "gdk_wayland_tablet_data_priv.h" #include // The type of the function pointer of GdkWindowImpl's move_to_rect method (gdkwindowimpl.h:78)' typedef void (*MoveToRectFunc) (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, int rect_anchor_dx, int rect_anchor_dy); static MoveToRectFunc gdk_window_move_to_rect_real = NULL; static GdkWindow * gdk_window_get_priv_transient_for (GdkWindow *gdk_window) { GdkWindow *window_transient_for = gdk_window_priv_get_transient_for (gdk_window); GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); GdkWindow *wayland_transient_for = gdk_window_impl_wayland_priv_get_transient_for (window_impl); if (wayland_transient_for) return wayland_transient_for; else return window_transient_for; } uint32_t gdk_window_get_priv_latest_serial (GdkSeat *seat) { uint32_t serial = 0; GdkWaylandSeat *wayland_seat = (GdkWaylandSeat *)seat; serial = MAX(serial, gdk_wayland_seat_priv_get_keyboard_key_serial (wayland_seat)); GdkWaylandPointerData* pointer_data = gdk_wayland_seat_priv_get_pointer_info_ptr (wayland_seat); serial = MAX(serial, gdk_wayland_pointer_data_priv_get_press_serial (pointer_data)); GHashTableIter i; GdkWaylandTouchData *touch; g_hash_table_iter_init (&i, gdk_wayland_seat_priv_get_touches (wayland_seat)); while (g_hash_table_iter_next (&i, NULL, (gpointer *)&touch)) serial = MAX(serial, gdk_wayland_touch_data_priv_get_touch_down_serial (touch)); for (GList *l = gdk_wayland_seat_priv_get_tablets (wayland_seat); l; l = l->next) { GdkWaylandTabletData *tablet_data = l->data; GdkWaylandPointerData *pointer_data = gdk_wayland_tablet_data_priv_get_pointer_info_ptr (tablet_data); serial = MAX(serial, gdk_wayland_pointer_data_priv_get_press_serial (pointer_data)); } return serial; } static GdkSeat * gdk_window_get_priv_grab_seat_for_single_window (GdkWindow *gdk_window) { if (!gdk_window) return NULL; GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); return gdk_window_impl_wayland_priv_get_grab_input_seat (window_impl); } GdkSeat * gdk_window_get_priv_grab_seat (GdkWindow *gdk_window) { GdkSeat *seat = NULL; seat = gdk_window_get_priv_grab_seat_for_single_window (gdk_window); if (seat) return seat; // see the comment in find_grab_input_seat () GdkWindow* grab_window = g_object_get_data (G_OBJECT (gdk_window), "gdk-attached-grab-window"); seat = gdk_window_get_priv_grab_seat_for_single_window (grab_window); if (seat) return seat; while (gdk_window) { gdk_window = gdk_window_get_priv_transient_for (gdk_window); seat = gdk_window_get_priv_grab_seat_for_single_window (gdk_window); if (seat) return seat; } return NULL; } static void gdk_window_move_to_rect_impl_override (GdkWindow *window, const GdkRectangle *rect, GdkGravity rect_anchor, GdkGravity window_anchor, GdkAnchorHints anchor_hints, int rect_anchor_dx, int rect_anchor_dy) { g_assert (gdk_window_move_to_rect_real); gdk_window_move_to_rect_real (window, rect, rect_anchor, window_anchor, anchor_hints, rect_anchor_dx, rect_anchor_dy); GdkWindow *transient_for_gdk_window = gdk_window_get_priv_transient_for (window); CustomShellSurface *transient_for_shell_surface = NULL; GdkWindow *toplevel_gdk_window = transient_for_gdk_window; while (toplevel_gdk_window) { toplevel_gdk_window = gdk_window_get_toplevel (toplevel_gdk_window); GtkWindow *toplevel_gtk_window = gtk_wayland_gdk_to_gtk_window (toplevel_gdk_window); transient_for_shell_surface = gtk_window_get_custom_shell_surface (toplevel_gtk_window); if (transient_for_shell_surface) break; toplevel_gdk_window = gdk_window_get_priv_transient_for (toplevel_gdk_window); } if (transient_for_shell_surface) { g_return_if_fail (rect); XdgPopupPosition position = { .transient_for_shell_surface = transient_for_shell_surface, .transient_for_gdk_window = transient_for_gdk_window, .rect = *rect, .rect_anchor = rect_anchor, .window_anchor = window_anchor, .anchor_hints = anchor_hints, .rect_anchor_d = { .x = rect_anchor_dx, .y = rect_anchor_dy, }, }; gtk_wayland_setup_window_as_custom_popup (window, &position); } } void gdk_window_set_priv_mapped (GdkWindow *gdk_window) { GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); gdk_window_impl_wayland_priv_set_mapped (window_impl, TRUE); } void gtk_priv_access_init (GdkWindow *gdk_window) { // Don't do anything once this has run successfully once if (gdk_window_move_to_rect_real) return; GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); GdkWindowImplClass *window_class = (GdkWindowImplClass *)G_OBJECT_GET_CLASS(window_impl); // If we have not already done the override, set the window's function to be the override and our "real" fp to the one that was there before if (gdk_window_impl_class_priv_get_move_to_rect (window_class) != gdk_window_move_to_rect_impl_override) { gdk_window_move_to_rect_real = gdk_window_impl_class_priv_get_move_to_rect (window_class); gdk_window_impl_class_priv_set_move_to_rect (window_class, gdk_window_move_to_rect_impl_override); } } GdkRectangle gtk_window_get_priv_logical_geom (GtkWindow *gtk_window) { GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (gtk_window)); GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); GdkRectangle result; result.x = gdk_window_impl_wayland_priv_get_margin_left (window_impl); result.y = gdk_window_impl_wayland_priv_get_margin_top (window_impl); result.width = gdk_window_get_width (gdk_window) - gdk_window_impl_wayland_priv_get_margin_left (window_impl) - gdk_window_impl_wayland_priv_get_margin_right (window_impl); result.height = gdk_window_get_height (gdk_window) - gdk_window_impl_wayland_priv_get_margin_top (window_impl) - gdk_window_impl_wayland_priv_get_margin_bottom (window_impl); return result; } gboolean gdk_window_get_priv_pending_commit (GdkWindow *gdk_window) { GdkWindowImplWayland *window_impl = (GdkWindowImplWayland *)gdk_window_priv_get_impl (gdk_window); return (gdk_window_impl_wayland_priv_get_pending_commit (window_impl) || gdk_window_impl_wayland_priv_get_pending_buffer_attached (window_impl)); } gtk-layer-shell-0.9.0/src/gtk-priv-access.h000066400000000000000000000043351466775474600205250ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef GDK_WINDOW_HACK_H #define GDK_WINDOW_HACK_H #include #include #include // This only has an effect the first time it's called // It enables gtk_window_hack_get_position () working later void gtk_priv_access_init (GdkWindow *gdk_window); // Returns the laster serial from a user input event // Can be used for popups grabs and such uint32_t gdk_window_get_priv_latest_serial (GdkSeat *seat); // Returns the GdkSeat that can be used for popup grabs GdkSeat *gdk_window_get_priv_grab_seat (GdkWindow *gdk_window); // Sets the window as mapped (mapped is set to false automatically in gdk_wayland_window_hide_surface ()) // If window is not set to mapped, some subsurfaces fail (see https://github.com/wmww/gtk-layer-shell/issues/38) void gdk_window_set_priv_mapped (GdkWindow *gdk_window); // Gets the window geometry (area inside the window that excludes the shadow) GdkRectangle gtk_window_get_priv_logical_geom (GtkWindow *widget); // Checks if it is safe to commit wl_surface for the window directly gboolean gdk_window_get_priv_pending_commit (GdkWindow *gdk_window); #endif // GDK_WINDOW_HACK_H gtk-layer-shell-0.9.0/src/gtk-wayland.c000066400000000000000000000202721466775474600177360ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-wayland.h" #include "custom-shell-surface.h" #include "xdg-popup-surface.h" #include "gtk-priv-access.h" #include "xdg-shell-client.h" #include "wlr-layer-shell-unstable-v1-client.h" #include #include #include static const char *gtk_window_key = "linked-gtk-window"; static const char *popup_position_key = "custom-popup-position"; static struct wl_registry *wl_registry_global = NULL; static struct xdg_wm_base *xdg_wm_base_global = NULL; static struct zwlr_layer_shell_v1 *layer_shell_global = NULL; static gboolean has_initialized = FALSE; static void xdg_wm_base_handle_ping (void *_data, struct xdg_wm_base *xdg_wm_base, uint32_t serial) { (void)_data; xdg_wm_base_pong (xdg_wm_base, serial); } static const struct xdg_wm_base_listener xdg_wm_base_listener = { .ping = xdg_wm_base_handle_ping, }; gboolean gtk_wayland_get_has_initialized (void) { return has_initialized; } struct zwlr_layer_shell_v1 * gtk_wayland_get_layer_shell_global () { return layer_shell_global; } struct xdg_wm_base * gtk_wayland_get_xdg_wm_base_global () { return xdg_wm_base_global; } static void wl_registry_handle_global (void *_data, struct wl_registry *registry, uint32_t id, const char *interface, uint32_t version) { (void)_data; // pull out needed globals if (strcmp (interface, zwlr_layer_shell_v1_interface.name) == 0) { g_warn_if_fail (zwlr_layer_shell_v1_interface.version >= 3); layer_shell_global = wl_registry_bind (registry, id, &zwlr_layer_shell_v1_interface, MIN((uint32_t)zwlr_layer_shell_v1_interface.version, version)); } else if (strcmp (interface, xdg_wm_base_interface.name) == 0) { g_warn_if_fail (xdg_wm_base_interface.version >= 2); xdg_wm_base_global = wl_registry_bind (registry, id, &xdg_wm_base_interface, MIN((uint32_t)xdg_wm_base_interface.version, version)); xdg_wm_base_add_listener (xdg_wm_base_global, &xdg_wm_base_listener, NULL); } } static void wl_registry_handle_global_remove (void *_data, struct wl_registry *_registry, uint32_t _id) { (void)_data; (void)_registry; (void)_id; // TODO } static const struct wl_registry_listener wl_registry_listener = { .global = wl_registry_handle_global, .global_remove = wl_registry_handle_global_remove, }; // Does not take ownership of position static void gtk_wayland_setup_custom_popup (GtkWindow *gtk_window, XdgPopupPosition const *position) { CustomShellSurface *shell_surface = gtk_window_get_custom_shell_surface (gtk_window); if (shell_surface) { XdgPopupSurface *popup_surface = custom_shell_surface_get_xdg_popup (shell_surface); // If there's already a custom surface on the window, it better be a popup g_return_if_fail (popup_surface); xdg_popup_surface_update_position (popup_surface, position); } else { xdg_popup_surface_new (gtk_window, position); } } // This function associates a GTK window with a GDK window // It overrides the default so it can run for EVERY window without needed to be attached to each one static void gtk_wayland_override_on_window_realize (GtkWindow *gtk_window, void *_data) { (void)_data; // Call the super class's realize handler GValue args[1] = { G_VALUE_INIT }; g_value_init_from_instance (&args[0], gtk_window); g_signal_chain_from_overridden (args, NULL); g_value_unset (&args[0]); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (gtk_window)); g_object_set_data (G_OBJECT (gdk_window), gtk_window_key, gtk_window); XdgPopupPosition *position = g_object_get_data (G_OBJECT (gdk_window), popup_position_key); if (position) { // This is a custom popup waiting to be realized gtk_wayland_setup_custom_popup (gtk_window, position); g_object_set_data (G_OBJECT (gdk_window), popup_position_key, NULL); } } // This callback must override the default unmap handler, so it can run first // The custom surface's unmap method must be called before GtkWidget's unmap, or Wayland objects are destroyed in the wrong order static void gtk_wayland_override_on_window_unmap (GtkWindow *gtk_window, void *_data) { (void)_data; CustomShellSurface *shell_surface = gtk_window_get_custom_shell_surface (gtk_window); if (shell_surface) custom_shell_surface_unmap (shell_surface); // Call the super class's unmap handler GValue args[1] = { G_VALUE_INIT }; g_value_init_from_instance (&args[0], gtk_window); g_signal_chain_from_overridden (args, NULL); g_value_unset (&args[0]); } void gtk_wayland_init_if_needed () { if (has_initialized) return; GdkDisplay *gdk_display = gdk_display_get_default (); g_return_if_fail (gdk_display); g_return_if_fail (GDK_IS_WAYLAND_DISPLAY (gdk_display)); struct wl_display *wl_display = gdk_wayland_display_get_wl_display (gdk_display); wl_registry_global = wl_display_get_registry (wl_display); wl_registry_add_listener (wl_registry_global, &wl_registry_listener, NULL); wl_display_roundtrip (wl_display); if (!layer_shell_global) g_warning ("It appears your Wayland compositor does not support the Layer Shell protocol"); if (!xdg_wm_base_global) g_warning ("It appears your Wayland compositor does not support the XDG Shell stable protocol"); gint realize_signal_id = g_signal_lookup ("realize", GTK_TYPE_WINDOW); GClosure *realize_closure = g_cclosure_new (G_CALLBACK (gtk_wayland_override_on_window_realize), NULL, NULL); g_signal_override_class_closure (realize_signal_id, GTK_TYPE_WINDOW, realize_closure); gint unmap_signal_id = g_signal_lookup ("unmap", GTK_TYPE_WINDOW); GClosure *unmap_closure = g_cclosure_new (G_CALLBACK (gtk_wayland_override_on_window_unmap), NULL, NULL); g_signal_override_class_closure (unmap_signal_id, GTK_TYPE_WINDOW, unmap_closure); has_initialized = TRUE; } GtkWindow * gtk_wayland_gdk_to_gtk_window (GdkWindow *gdk_window) { return GTK_WINDOW (g_object_get_data (G_OBJECT (gdk_window), gtk_window_key)); } void gtk_wayland_setup_window_as_custom_popup (GdkWindow *gdk_window, XdgPopupPosition const *position) { GtkWindow *gtk_window = gtk_wayland_gdk_to_gtk_window (gdk_window); if (GTK_IS_WINDOW (gtk_window)) { // The GDK window has been connected to a GTK window gtk_wayland_setup_custom_popup (gtk_window, position); } else { // We need to hold the position and wait for a connected GTK window to be realized XdgPopupPosition *position_owned = g_new (XdgPopupPosition, 1); *position_owned = *position; g_object_set_data_full (G_OBJECT (gdk_window), popup_position_key, position_owned, g_free); } } gtk-layer-shell-0.9.0/src/gtk-wayland.h000066400000000000000000000032621466775474600177430ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef WAYLAND_GLOBALS_H #define WAYLAND_GLOBALS_H #include #include #include "xdg-popup-surface.h" gboolean gtk_wayland_get_has_initialized (void); struct xdg_wm_base *gtk_wayland_get_xdg_wm_base_global (void); struct zwlr_layer_shell_v1 *gtk_wayland_get_layer_shell_global (void); void gtk_wayland_init_if_needed (void); GtkWindow *gtk_wayland_gdk_to_gtk_window (GdkWindow *gdk_window); // Does not take ownership of position void gtk_wayland_setup_window_as_custom_popup (GdkWindow *gdk_window, XdgPopupPosition const *position); #endif // WAYLAND_GLOBALS_H gtk-layer-shell-0.9.0/src/layer-surface.c000066400000000000000000000405521466775474600202610ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "layer-surface.h" #include "gtk-layer-shell.h" #include "simple-conversions.h" #include "custom-shell-surface.h" #include "gtk-wayland.h" #include "wlr-layer-shell-unstable-v1-client.h" #include "xdg-shell-client.h" #include #include /* * Sends the .set_size request if the current allocation differs from the last size sent * Needs to be called whenever current_allocation or anchors are changed * If .set_size is sent, it should trigger the compositor to send a .configure event */ static void layer_surface_send_set_size (LayerSurface *self) { GtkRequisition request_size = self->current_allocation; if ((self->anchors[GTK_LAYER_SHELL_EDGE_LEFT]) && (self->anchors[GTK_LAYER_SHELL_EDGE_RIGHT])) { request_size.width = 0; } if ((self->anchors[GTK_LAYER_SHELL_EDGE_TOP]) && (self->anchors[GTK_LAYER_SHELL_EDGE_BOTTOM])) { request_size.height = 0; } if (request_size.width != self->cached_layer_size.width || request_size.height != self->cached_layer_size.height) { self->cached_layer_size = request_size; if (self->layer_surface) { zwlr_layer_surface_v1_set_size (self->layer_surface, self->cached_layer_size.width, self->cached_layer_size.height); } } } /* * Sets the window's geometry hints (used to force the window to be a specific size) * Needs to be called whenever last_configure_size or anchors are changed * Lets windows decide their own size along any axis the surface is not stretched along * Forces window (by setting the max and min hints) to be of configured size along axes they are stretched along */ static void layer_surface_update_size (LayerSurface *self) { GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gint width = -1; gint height = -1; if ((self->anchors[GTK_LAYER_SHELL_EDGE_LEFT]) && (self->anchors[GTK_LAYER_SHELL_EDGE_RIGHT])) { width = self->last_configure_size.width; } if ((self->anchors[GTK_LAYER_SHELL_EDGE_TOP]) && (self->anchors[GTK_LAYER_SHELL_EDGE_BOTTOM])) { height = self->last_configure_size.height; } GdkGeometry hints; hints.min_width = width; hints.max_width = width; hints.min_height = height; hints.max_height = height; gtk_window_set_geometry_hints (gtk_window, NULL, &hints, GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE); // This will usually get called in a moment by the layer_surface_on_size_allocate () triggered by the above // gtk_window_set_geometry_hints (). However in some cases (such as a streatching a window after a size request has // been set), an allocate will not be triggered but the set size does need to change. For this reason we make the // call here as well and let the later call clean up any mistakes this one makes. This makes the flicker problem // worse, but I think it's more important that the end result is correct. layer_surface_send_set_size (self); } static void layer_surface_handle_configure (void *data, struct zwlr_layer_surface_v1 *surface, uint32_t serial, uint32_t w, uint32_t h) { LayerSurface *self = data; zwlr_layer_surface_v1_ack_configure (surface, serial); self->last_configure_size = (GtkRequisition) { .width = (gint)w, .height = (gint)h, }; layer_surface_update_size (self); } static void layer_surface_handle_closed (void *data, struct zwlr_layer_surface_v1 *_surface) { LayerSurface *self = data; (void)_surface; GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gtk_window_close (gtk_window); } static const struct zwlr_layer_surface_v1_listener layer_surface_listener = { .configure = layer_surface_handle_configure, .closed = layer_surface_handle_closed, }; static void layer_surface_send_set_anchor (LayerSurface *self) { if (self->layer_surface) { uint32_t wlr_anchor = gtk_layer_shell_edge_array_get_zwlr_layer_shell_v1_anchor (self->anchors); zwlr_layer_surface_v1_set_anchor (self->layer_surface, wlr_anchor); } } static void layer_surface_send_set_margin (LayerSurface *self) { if (self->layer_surface) { zwlr_layer_surface_v1_set_margin (self->layer_surface, self->margins[GTK_LAYER_SHELL_EDGE_TOP], self->margins[GTK_LAYER_SHELL_EDGE_RIGHT], self->margins[GTK_LAYER_SHELL_EDGE_BOTTOM], self->margins[GTK_LAYER_SHELL_EDGE_LEFT]); } } static void layer_surface_map (CustomShellSurface *super, struct wl_surface *wl_surface) { LayerSurface *self = (LayerSurface *)super; g_return_if_fail (!self->layer_surface); struct zwlr_layer_shell_v1 *layer_shell_global = gtk_wayland_get_layer_shell_global (); g_return_if_fail (layer_shell_global); const char *name_space = layer_surface_get_namespace(self); struct wl_output *output = NULL; if (self->monitor) { output = gdk_wayland_monitor_get_wl_output (self->monitor); } enum zwlr_layer_shell_v1_layer layer = gtk_layer_shell_layer_get_zwlr_layer_shell_v1_layer(self->layer); self->layer_surface = zwlr_layer_shell_v1_get_layer_surface (layer_shell_global, wl_surface, output, layer, name_space); g_return_if_fail (self->layer_surface); zwlr_layer_surface_v1_set_keyboard_interactivity (self->layer_surface, self->keyboard_mode); zwlr_layer_surface_v1_set_exclusive_zone (self->layer_surface, self->exclusive_zone); layer_surface_send_set_anchor (self); layer_surface_send_set_margin (self); if (self->cached_layer_size.width >= 0 && self->cached_layer_size.height >= 0) { zwlr_layer_surface_v1_set_size (self->layer_surface, self->cached_layer_size.width, self->cached_layer_size.height); } zwlr_layer_surface_v1_add_listener (self->layer_surface, &layer_surface_listener, self); } static void layer_surface_unmap (CustomShellSurface *super) { LayerSurface *self = (LayerSurface *)super; if (self->layer_surface) { zwlr_layer_surface_v1_destroy (self->layer_surface); self->layer_surface = NULL; } } static void layer_surface_finalize (CustomShellSurface *super) { LayerSurface *self = (LayerSurface *)super; custom_shell_surface_unmap (super); g_free ((gpointer)self->name_space); } static struct xdg_popup * layer_surface_get_popup (CustomShellSurface *super, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner) { LayerSurface *self = (LayerSurface *)super; if (!self->layer_surface) { g_critical ("layer_surface_get_popup () called when the layer surface wayland object has not yet been created"); return NULL; } struct xdg_popup *xdg_popup = xdg_surface_get_popup (popup_xdg_surface, NULL, positioner); zwlr_layer_surface_v1_get_popup (self->layer_surface, xdg_popup); return xdg_popup; } static GdkRectangle layer_surface_get_logical_geom (CustomShellSurface *super) { (void)super; return (GdkRectangle){0, 0, 0, 0}; } static const CustomShellSurfaceVirtual layer_surface_virtual = { .map = layer_surface_map, .unmap = layer_surface_unmap, .finalize = layer_surface_finalize, .get_popup = layer_surface_get_popup, .get_logical_geom = layer_surface_get_logical_geom, }; static void layer_surface_update_auto_exclusive_zone (LayerSurface *self) { if (!self->auto_exclusive_zone) return; gboolean horiz = (self->anchors[GTK_LAYER_SHELL_EDGE_LEFT] == self->anchors[GTK_LAYER_SHELL_EDGE_RIGHT]); gboolean vert = (self->anchors[GTK_LAYER_SHELL_EDGE_TOP] == self->anchors[GTK_LAYER_SHELL_EDGE_BOTTOM]); int new_exclusive_zone = -1; if (horiz && !vert) { new_exclusive_zone = self->current_allocation.height; if (!self->anchors[GTK_LAYER_SHELL_EDGE_TOP]) new_exclusive_zone += self->margins[GTK_LAYER_SHELL_EDGE_TOP]; if (!self->anchors[GTK_LAYER_SHELL_EDGE_BOTTOM]) new_exclusive_zone += self->margins[GTK_LAYER_SHELL_EDGE_BOTTOM]; } else if (vert && !horiz) { new_exclusive_zone = self->current_allocation.width; if (!self->anchors[GTK_LAYER_SHELL_EDGE_LEFT]) new_exclusive_zone += self->margins[GTK_LAYER_SHELL_EDGE_LEFT]; if (!self->anchors[GTK_LAYER_SHELL_EDGE_RIGHT]) new_exclusive_zone += self->margins[GTK_LAYER_SHELL_EDGE_RIGHT]; } if (new_exclusive_zone >= 0 && self->exclusive_zone != new_exclusive_zone) { self->exclusive_zone = new_exclusive_zone; if (self->layer_surface) { zwlr_layer_surface_v1_set_exclusive_zone (self->layer_surface, self->exclusive_zone); } } } static void layer_surface_on_size_allocate (GtkWidget *_gtk_window, GdkRectangle *allocation, LayerSurface *self) { (void)_gtk_window; if (self->current_allocation.width != allocation->width || self->current_allocation.height != allocation->height) { self->current_allocation = (GtkRequisition) { .width = allocation->width, .height = allocation->height, }; layer_surface_send_set_size (self); layer_surface_update_auto_exclusive_zone (self); } } LayerSurface * layer_surface_new (GtkWindow *gtk_window) { g_return_val_if_fail (gtk_wayland_get_layer_shell_global (), NULL); LayerSurface *self = g_new0 (LayerSurface, 1); self->super.virtual = &layer_surface_virtual; custom_shell_surface_init ((CustomShellSurface *)self, gtk_window); self->current_allocation = (GtkRequisition) { .width = 0, .height = 0, }; self->cached_layer_size = self->current_allocation; self->last_configure_size = self->current_allocation; self->monitor = NULL; self->layer = GTK_LAYER_SHELL_LAYER_TOP; self->name_space = NULL; self->exclusive_zone = 0; self->auto_exclusive_zone = FALSE; self->keyboard_mode = GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; self->layer_surface = NULL; gtk_window_set_decorated (gtk_window, FALSE); g_signal_connect (gtk_window, "size-allocate", G_CALLBACK (layer_surface_on_size_allocate), self); return self; } LayerSurface * custom_shell_surface_get_layer_surface (CustomShellSurface *shell_surface) { if (shell_surface && shell_surface->virtual == &layer_surface_virtual) return (LayerSurface *)shell_surface; else return NULL; } void layer_surface_set_monitor (LayerSurface *self, GdkMonitor *monitor) { if (monitor) g_return_if_fail (GDK_IS_WAYLAND_MONITOR (monitor)); if (monitor != self->monitor) { self->monitor = monitor; if (self->layer_surface) { custom_shell_surface_remap ((CustomShellSurface *)self); } } } void layer_surface_set_name_space (LayerSurface *self, char const* name_space) { if (g_strcmp0(self->name_space, name_space) != 0) { g_free ((gpointer)self->name_space); self->name_space = g_strdup (name_space); if (self->layer_surface) { custom_shell_surface_remap ((CustomShellSurface *)self); } } } void layer_surface_set_layer (LayerSurface *self, GtkLayerShellLayer layer) { if (self->layer != layer) { self->layer = layer; if (self->layer_surface) { uint32_t version = zwlr_layer_surface_v1_get_version (self->layer_surface); if (version >= ZWLR_LAYER_SURFACE_V1_SET_LAYER_SINCE_VERSION) { enum zwlr_layer_shell_v1_layer wlr_layer = gtk_layer_shell_layer_get_zwlr_layer_shell_v1_layer(layer); zwlr_layer_surface_v1_set_layer (self->layer_surface, wlr_layer); custom_shell_surface_needs_commit ((CustomShellSurface *)self); } else { custom_shell_surface_remap ((CustomShellSurface *)self); } } } } void layer_surface_set_anchor (LayerSurface *self, GtkLayerShellEdge edge, gboolean anchor_to_edge) { g_return_if_fail (edge >= 0 && edge < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER); anchor_to_edge = (anchor_to_edge != FALSE); if (anchor_to_edge != self->anchors[edge]) { self->anchors[edge] = anchor_to_edge; if (self->layer_surface) { layer_surface_send_set_anchor (self); layer_surface_update_size (self); layer_surface_update_auto_exclusive_zone (self); custom_shell_surface_needs_commit ((CustomShellSurface *)self); } } } void layer_surface_set_margin (LayerSurface *self, GtkLayerShellEdge edge, int margin_size) { g_return_if_fail (edge >= 0 && edge < GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER); if (margin_size != self->margins[edge]) { self->margins[edge] = margin_size; layer_surface_send_set_margin (self); layer_surface_update_auto_exclusive_zone (self); custom_shell_surface_needs_commit ((CustomShellSurface *)self); } } void layer_surface_set_exclusive_zone (LayerSurface *self, int exclusive_zone) { self->auto_exclusive_zone = FALSE; if (exclusive_zone < -1) exclusive_zone = -1; if (self->exclusive_zone != exclusive_zone) { self->exclusive_zone = exclusive_zone; if (self->layer_surface) { zwlr_layer_surface_v1_set_exclusive_zone (self->layer_surface, self->exclusive_zone); custom_shell_surface_needs_commit ((CustomShellSurface *)self); } } } void layer_surface_auto_exclusive_zone_enable (LayerSurface *self) { if (!self->auto_exclusive_zone) { self->auto_exclusive_zone = TRUE; layer_surface_update_auto_exclusive_zone (self); } } void layer_surface_set_keyboard_mode (LayerSurface *self, GtkLayerShellKeyboardMode mode) { if (mode == GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND) { uint32_t version = gtk_layer_get_protocol_version(); if (version <= 3) { g_warning ( "Compositor uses layer shell version %d, which does not support on-demand keyboard interactivity", version); mode = GTK_LAYER_SHELL_KEYBOARD_MODE_NONE; } } if (self->keyboard_mode != mode) { self->keyboard_mode = mode; if (self->layer_surface) { zwlr_layer_surface_v1_set_keyboard_interactivity (self->layer_surface, self->keyboard_mode); custom_shell_surface_needs_commit ((CustomShellSurface *)self); } } } const char* layer_surface_get_namespace (LayerSurface *self) { if (self && self->name_space) return self->name_space; else return "gtk-layer-shell"; } gtk-layer-shell-0.9.0/src/layer-surface.h000066400000000000000000000100401466775474600202530ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LAYER_SHELL_SURFACE_H #define LAYER_SHELL_SURFACE_H #include "custom-shell-surface.h" #include "wlr-layer-shell-unstable-v1-client.h" #include "gtk-layer-shell.h" #include // A LayerSurface * can be safely cast to a CustomShellSurface * typedef struct _LayerSurface LayerSurface; // Functions that mutate this structure should all be in layer-surface.c to make the logic easier to understand // Struct is declared in this header to prevent the need for excess getters struct _LayerSurface { CustomShellSurface super; // Can be set at any time gboolean anchors[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]; // The current anchor int margins[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]; // The current margins int exclusive_zone; // The current exclusive zone (set either explicitly or automatically) gboolean auto_exclusive_zone; // If to automatically change the exclusive zone to match the window size GtkLayerShellKeyboardMode keyboard_mode; // Type of keyboard interactivity enabled for this surface GtkLayerShellLayer layer; // The current layer, needs surface recreation on old layer shell versions // Need the surface to be recreated to change GdkMonitor *monitor; // Can be null const char *name_space; // Can be null, freed on destruction // Not set by user requests struct zwlr_layer_surface_v1 *layer_surface; // The actual layer surface Wayland object (can be NULL) GtkRequisition current_allocation; // Last size allocation, or (0, 0) if there hasn't been one GtkRequisition cached_layer_size; // Last size sent to zwlr_layer_surface_v1_set_size (starts as 0, 0) GtkRequisition last_configure_size; // Last size received from a configure event }; LayerSurface *layer_surface_new (GtkWindow *gtk_window); // Safe cast, returns NULL if wrong type sent LayerSurface *custom_shell_surface_get_layer_surface (CustomShellSurface *shell_surface); // Surface is remapped in order to set void layer_surface_set_monitor (LayerSurface *self, GdkMonitor *monitor); // Can be null for default void layer_surface_set_name_space (LayerSurface *self, char const* name_space); // Makes a copy of the string, can be null // Can be set without remapping the surface void layer_surface_set_layer (LayerSurface *self, GtkLayerShellLayer layer); // Remaps surface on old layer shell versions void layer_surface_set_anchor (LayerSurface *self, GtkLayerShellEdge edge, gboolean anchor_to_edge); void layer_surface_set_margin (LayerSurface *self, GtkLayerShellEdge edge, int margin_size); void layer_surface_set_exclusive_zone (LayerSurface *self, int exclusive_zone); void layer_surface_auto_exclusive_zone_enable (LayerSurface *self); void layer_surface_set_keyboard_mode (LayerSurface *self, GtkLayerShellKeyboardMode mode); // Returns the effective namespace (default if unset). Does not return ownership. Never returns NULL. Handles null self. const char* layer_surface_get_namespace (LayerSurface *self); #endif // LAYER_SHELL_SURFACE_H gtk-layer-shell-0.9.0/src/meson.build000066400000000000000000000034401466775474600175100ustar00rootroot00000000000000srcs = files( 'api.c', 'gtk-wayland.c', 'custom-shell-surface.c', 'layer-surface.c', 'xdg-popup-surface.c', 'xdg-toplevel-surface.c', 'gtk-priv-access.c', 'simple-conversions.c') version_args = [ '-DGTK_LAYER_SHELL_MAJOR=' + meson.project_version().split('.')[0], '-DGTK_LAYER_SHELL_MINOR=' + meson.project_version().split('.')[1], '-DGTK_LAYER_SHELL_MICRO=' + meson.project_version().split('.')[2], ] gtk_layer_shell_lib = library('gtk-layer-shell', srcs, client_protocol_srcs, c_args: version_args, include_directories: [gtk_layer_shell_inc], dependencies: [gtk, wayland_client, gtk_priv], version: meson.project_version(), soversion: lib_so_version, install: true) pkg_config_name = 'gtk-layer-shell-0' # GObject introspection file used to interface with other languages if get_option('introspection') gir = gnome.generate_gir( gtk_layer_shell_lib, dependencies: [gtk], sources: srcs + files('../include/gtk-layer-shell.h'), namespace: 'GtkLayerShell', nsversion: '0.1', identifier_prefix: 'GtkLayerShell', symbol_prefix: 'gtk_layer', export_packages: pkg_config_name, includes: [ 'Gtk-3.0' ], header: 'gtk-layer-shell/gtk-layer-shell.h', install: true) if get_option('vapi') gnome.generate_vapi( pkg_config_name, sources: gir[0], packages: 'gtk+-3.0', install: true) endif endif pkg_config.generate( name: 'gtk-layer-shell', version: meson.project_version(), libraries: [gtk_layer_shell_lib], filebase: pkg_config_name, subdirs: 'gtk-layer-shell', description: 'Use the Layer Shell Wayland protocol with GTK', url: 'https://github.com/wmww/gtk-layer-shell') gtk-layer-shell-0.9.0/src/simple-conversions.c000066400000000000000000000114331466775474600213520ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "simple-conversions.h" enum zwlr_layer_shell_v1_layer gtk_layer_shell_layer_get_zwlr_layer_shell_v1_layer (GtkLayerShellLayer layer) { switch (layer) { case GTK_LAYER_SHELL_LAYER_BACKGROUND: return ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; case GTK_LAYER_SHELL_LAYER_BOTTOM: return ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM; case GTK_LAYER_SHELL_LAYER_TOP: return ZWLR_LAYER_SHELL_V1_LAYER_TOP; case GTK_LAYER_SHELL_LAYER_OVERLAY: return ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY; default: g_critical ("Invalid GtkLayerShellLayer %d", layer); return ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND; } } uint32_t gtk_layer_shell_edge_array_get_zwlr_layer_shell_v1_anchor (gboolean edges[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]) { uint32_t anchor = 0; if (edges[GTK_LAYER_SHELL_EDGE_LEFT]) anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT; if (edges[GTK_LAYER_SHELL_EDGE_RIGHT]) anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; if (edges[GTK_LAYER_SHELL_EDGE_TOP]) anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; if (edges[GTK_LAYER_SHELL_EDGE_BOTTOM]) anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; return anchor; } enum xdg_positioner_gravity gdk_gravity_get_xdg_positioner_gravity (GdkGravity gravity) { switch (gravity) { case GDK_GRAVITY_NORTH_WEST: return XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT; case GDK_GRAVITY_NORTH: return XDG_POSITIONER_GRAVITY_BOTTOM; case GDK_GRAVITY_NORTH_EAST: return XDG_POSITIONER_GRAVITY_BOTTOM_LEFT; case GDK_GRAVITY_WEST: return XDG_POSITIONER_GRAVITY_RIGHT; case GDK_GRAVITY_CENTER: return XDG_POSITIONER_GRAVITY_NONE; case GDK_GRAVITY_EAST: return XDG_POSITIONER_GRAVITY_LEFT; case GDK_GRAVITY_SOUTH_WEST: return XDG_POSITIONER_GRAVITY_TOP_RIGHT; case GDK_GRAVITY_SOUTH: return XDG_POSITIONER_GRAVITY_TOP; case GDK_GRAVITY_SOUTH_EAST: return XDG_POSITIONER_GRAVITY_TOP_LEFT; case GDK_GRAVITY_STATIC: return XDG_POSITIONER_GRAVITY_NONE; default: g_critical ("Invalid GdkGravity %d", gravity); return XDG_POSITIONER_GRAVITY_NONE; } } enum xdg_positioner_anchor gdk_gravity_get_xdg_positioner_anchor (GdkGravity anchor) { switch (anchor) { case GDK_GRAVITY_NORTH_WEST: return XDG_POSITIONER_ANCHOR_TOP_LEFT; case GDK_GRAVITY_NORTH: return XDG_POSITIONER_ANCHOR_TOP; case GDK_GRAVITY_NORTH_EAST: return XDG_POSITIONER_ANCHOR_TOP_RIGHT; case GDK_GRAVITY_WEST: return XDG_POSITIONER_ANCHOR_LEFT; case GDK_GRAVITY_CENTER: return XDG_POSITIONER_ANCHOR_NONE; case GDK_GRAVITY_EAST: return XDG_POSITIONER_ANCHOR_RIGHT; case GDK_GRAVITY_SOUTH_WEST: return XDG_POSITIONER_ANCHOR_BOTTOM_LEFT; case GDK_GRAVITY_SOUTH: return XDG_POSITIONER_ANCHOR_BOTTOM; case GDK_GRAVITY_SOUTH_EAST: return XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT; case GDK_GRAVITY_STATIC: return XDG_POSITIONER_ANCHOR_NONE; default: g_critical ("Invalid GdkGravity %d", anchor); return XDG_POSITIONER_ANCHOR_NONE; } } enum xdg_positioner_constraint_adjustment gdk_anchor_hints_get_xdg_positioner_constraint_adjustment (GdkAnchorHints hints) { enum xdg_positioner_constraint_adjustment adjustment = 0; if (hints & GDK_ANCHOR_FLIP_X) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_X; if (hints & GDK_ANCHOR_FLIP_Y) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y; if (hints & GDK_ANCHOR_SLIDE_X) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X; if (hints & GDK_ANCHOR_SLIDE_Y) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_Y; if (hints & GDK_ANCHOR_RESIZE_X) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_X; if (hints & GDK_ANCHOR_RESIZE_Y) adjustment |= XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_RESIZE_Y; return adjustment; } gtk-layer-shell-0.9.0/src/simple-conversions.h000066400000000000000000000035171466775474600213630ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef SIMPLE_CONVERSIONS_H #define SIMPLE_CONVERSIONS_H #include "xdg-shell-client.h" #include "wlr-layer-shell-unstable-v1-client.h" #include "gtk-layer-shell.h" #include enum zwlr_layer_shell_v1_layer gtk_layer_shell_layer_get_zwlr_layer_shell_v1_layer (GtkLayerShellLayer layer); uint32_t gtk_layer_shell_edge_array_get_zwlr_layer_shell_v1_anchor (gboolean edges[GTK_LAYER_SHELL_EDGE_ENTRY_NUMBER]); enum xdg_positioner_gravity gdk_gravity_get_xdg_positioner_gravity (GdkGravity gravity); enum xdg_positioner_anchor gdk_gravity_get_xdg_positioner_anchor (GdkGravity anchor); enum xdg_positioner_constraint_adjustment gdk_anchor_hints_get_xdg_positioner_constraint_adjustment (GdkAnchorHints hints); #endif // SIMPLE_CONVERSIONS_H gtk-layer-shell-0.9.0/src/xdg-popup-surface.c000066400000000000000000000276761466775474600211040ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "xdg-popup-surface.h" #include "custom-shell-surface.h" #include "gtk-wayland.h" #include "simple-conversions.h" #include "gtk-priv-access.h" #include "xdg-shell-client.h" #include #include #include struct _XdgPopupSurface { CustomShellSurface super; XdgPopupPosition position; GdkRectangle cached_allocation; GdkRectangle geom; // These can be NULL struct xdg_surface *xdg_surface; struct xdg_popup *xdg_popup; }; static void xdg_surface_handle_configure (void *data, struct xdg_surface *_xdg_surface, uint32_t serial) { XdgPopupSurface *self = data; (void)_xdg_surface; xdg_surface_ack_configure (self->xdg_surface, serial); } static const struct xdg_surface_listener xdg_surface_listener = { .configure = xdg_surface_handle_configure, }; static void xdg_popup_handle_configure (void *data, struct xdg_popup *_xdg_popup, int32_t x, int32_t y, int32_t width, int32_t height) { XdgPopupSurface *self = data; (void)_xdg_popup; g_return_if_fail(width >= 0 && height >= 0); // Protocol error // Technically this should not be applied until we get a xdg_surface.configure GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gtk_window_move (gtk_window, x, y); gtk_window_resize (gtk_window, width, height); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (gtk_window)); g_return_if_fail (gdk_window); // calculating the correct values is hard, but we're not required to provide them g_signal_emit_by_name (gdk_window, "moved-to-rect", NULL, NULL, FALSE, FALSE); } static void xdg_popup_handle_popup_done (void *data, struct xdg_popup *_xdg_popup) { (void)_xdg_popup; XdgPopupSurface *self = data; GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gtk_widget_unmap (GTK_WIDGET (gtk_window)); } static const struct xdg_popup_listener xdg_popup_listener = { .configure = xdg_popup_handle_configure, .popup_done = xdg_popup_handle_popup_done, }; static void xdg_popup_surface_get_anchor_rect (XdgPopupSurface *self, GdkRectangle *rect) { // The anchor rect is given relative to the actual top-left of the parent GDK window surface // We need it realative to the logical geometry of the transient-for window, which may be sevel layers up *rect = self->position.rect; // It is a protocol error for size to be <= 0 rect->width = MAX (rect->width, 1); rect->height = MAX (rect->height, 1); GdkWindow *parent_window = self->position.transient_for_gdk_window; CustomShellSurface *transient_for_shell_surface = self->position.transient_for_shell_surface; GtkWidget *transient_for_widget = GTK_WIDGET (custom_shell_surface_get_gtk_window (transient_for_shell_surface)); GdkWindow *transient_for_window = gtk_widget_get_window (transient_for_widget); g_return_if_fail (parent_window); g_return_if_fail (transient_for_window); // Traverse up to the transient-for window adding each window's position relative to it's parent along the way while (parent_window && parent_window != transient_for_window) { gint x, y; gdk_window_get_position (parent_window, &x, &y); rect->x += x; rect->y += y; parent_window = gdk_window_get_effective_parent (parent_window); } if (parent_window != transient_for_window) { g_warning ("Could not find position of child window %p relative to parent window %p", (void *)self->position.transient_for_gdk_window, (void *)transient_for_window); } // Subtract the transient-for window's logical top-left GdkRectangle transient_for_geom = transient_for_shell_surface->virtual->get_logical_geom (transient_for_shell_surface); rect->x -= transient_for_geom.x; rect->y -= transient_for_geom.y; } static void xdg_popup_surface_maybe_grab (XdgPopupSurface *self, GdkWindow *gdk_window) { GdkSeat *grab_gdk_seat = gdk_window_get_priv_grab_seat (gdk_window); if (!grab_gdk_seat) { // If we really wanted a seat we could get the default one // but grab_gdk_seat being null is an indication we should not grab return; } struct wl_seat *grab_wl_seat = gdk_wayland_seat_get_wl_seat (grab_gdk_seat); if (!grab_wl_seat) return; // unlikely uint32_t serial = gdk_window_get_priv_latest_serial (grab_gdk_seat); // serial might be 0, but the compositor might not care; YOLO xdg_popup_grab(self->xdg_popup, grab_wl_seat, serial); } static void xdg_popup_surface_map (CustomShellSurface *super, struct wl_surface *wl_surface) { XdgPopupSurface *self = (XdgPopupSurface *)super; g_return_if_fail (!self->xdg_popup); g_return_if_fail (!self->xdg_surface); GtkWindow *gtk_window = custom_shell_surface_get_gtk_window (super); GdkWindow *gdk_window = gtk_widget_get_window (GTK_WIDGET (gtk_window)); g_return_if_fail (gdk_window); GdkRectangle rect; xdg_popup_surface_get_anchor_rect (self, &rect); struct xdg_wm_base *xdg_wm_base_global = gtk_wayland_get_xdg_wm_base_global (); g_return_if_fail (xdg_wm_base_global); struct xdg_positioner *positioner = xdg_wm_base_create_positioner (xdg_wm_base_global); self->geom = gtk_window_get_priv_logical_geom (gtk_window); enum xdg_positioner_anchor anchor = gdk_gravity_get_xdg_positioner_anchor(self->position.rect_anchor); enum xdg_positioner_gravity gravity = gdk_gravity_get_xdg_positioner_gravity(self->position.window_anchor); enum xdg_positioner_constraint_adjustment constraint_adjustment = gdk_anchor_hints_get_xdg_positioner_constraint_adjustment (self->position.anchor_hints); xdg_positioner_set_size (positioner, self->geom.width, self->geom.height); xdg_positioner_set_anchor_rect (positioner, rect.x, rect.y, rect.width, rect.height); xdg_positioner_set_offset (positioner, self->position.rect_anchor_d.x, self->position.rect_anchor_d.y); xdg_positioner_set_anchor (positioner, anchor); xdg_positioner_set_gravity (positioner, gravity); xdg_positioner_set_constraint_adjustment (positioner, constraint_adjustment); self->xdg_surface = xdg_wm_base_get_xdg_surface (xdg_wm_base_global, wl_surface); g_return_if_fail (self->xdg_surface); xdg_surface_add_listener (self->xdg_surface, &xdg_surface_listener, self); CustomShellSurface *transient_for_shell_surface = self->position.transient_for_shell_surface; self->xdg_popup = custom_shell_surface_add_popup (transient_for_shell_surface, super, self->xdg_surface, positioner); g_return_if_fail (self->xdg_popup); xdg_popup_add_listener (self->xdg_popup, &xdg_popup_listener, self); xdg_positioner_destroy (positioner); xdg_popup_surface_maybe_grab (self, gdk_window); xdg_surface_set_window_geometry (self->xdg_surface, self->geom.x, self->geom.y, self->geom.width, self->geom.height); } static void xdg_popup_surface_unmap (CustomShellSurface *super) { XdgPopupSurface *self = (XdgPopupSurface *)super; if (self->xdg_popup) { xdg_popup_destroy (self->xdg_popup); self->xdg_popup = NULL; } if (self->xdg_surface) { xdg_surface_destroy (self->xdg_surface); self->xdg_surface = NULL; } } static void xdg_popup_surface_finalize (CustomShellSurface *super) { custom_shell_surface_unmap (super); } static struct xdg_popup * xdg_popup_surface_get_popup (CustomShellSurface *super, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner) { XdgPopupSurface *self = (XdgPopupSurface *)super; if (!self->xdg_surface) { g_critical ("xdg_popup_surface_get_popup () called when the xdg surface wayland object has not yet been created"); return NULL; } return xdg_surface_get_popup (popup_xdg_surface, self->xdg_surface, positioner); } static GdkRectangle xdg_popup_surface_get_logical_geom (CustomShellSurface *super) { XdgPopupSurface *self = (XdgPopupSurface *)super; return self->geom; } static const CustomShellSurfaceVirtual xdg_popup_surface_virtual = { .map = xdg_popup_surface_map, .unmap = xdg_popup_surface_unmap, .finalize = xdg_popup_surface_finalize, .get_popup = xdg_popup_surface_get_popup, .get_logical_geom = xdg_popup_surface_get_logical_geom, }; static void xdg_popup_surface_on_size_allocate (GtkWidget *_widget, GdkRectangle *allocation, XdgPopupSurface *self) { (void)_widget; if (self->xdg_surface && !gdk_rectangle_equal (&self->cached_allocation, allocation)) { self->cached_allocation = *allocation; // allocation only used for catching duplicate calls. To get the correct geom we need to check something else GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); self->geom = gtk_window_get_priv_logical_geom (gtk_window); xdg_surface_set_window_geometry (self->xdg_surface, self->geom.x, self->geom.y, self->geom.width, self->geom.height); } } XdgPopupSurface * xdg_popup_surface_new (GtkWindow *gtk_window, XdgPopupPosition const* position) { XdgPopupSurface *self = g_new0 (XdgPopupSurface, 1); g_assert (gtk_window); g_assert (position); self->super.virtual = &xdg_popup_surface_virtual; custom_shell_surface_init ((CustomShellSurface *)self, gtk_window); self->position = *position; self->cached_allocation = (GdkRectangle) { .x = 0, .y = 0, .width = 0, .height = 0, }; self->xdg_surface = NULL; self->xdg_popup = NULL; g_signal_connect (gtk_window, "size-allocate", G_CALLBACK (xdg_popup_surface_on_size_allocate), self); return self; } void xdg_popup_surface_update_position (XdgPopupSurface *self, XdgPopupPosition const* position) { self->position = *position; // Don't bother trying to remap. It's not needed and breaks shit } XdgPopupSurface * custom_shell_surface_get_xdg_popup (CustomShellSurface *shell_surface) { if (shell_surface && shell_surface->virtual == &xdg_popup_surface_virtual) return (XdgPopupSurface *)shell_surface; else return NULL; } gtk-layer-shell-0.9.0/src/xdg-popup-surface.h000066400000000000000000000037741466775474600211020ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef XDG_POPUP_SURFACE_H #define XDG_POPUP_SURFACE_H #include "custom-shell-surface.h" // an XdgPopupSurface * can be safely cast to a CustomShellSurface * typedef struct _XdgPopupSurface XdgPopupSurface; typedef struct { CustomShellSurface *transient_for_shell_surface; GdkWindow *transient_for_gdk_window; GdkRectangle rect; GdkGravity rect_anchor, window_anchor; GdkAnchorHints anchor_hints; GdkPoint rect_anchor_d; } XdgPopupPosition; // Copies position, does not take ownership XdgPopupSurface *xdg_popup_surface_new (GtkWindow *gtk_window, XdgPopupPosition const* position); // Copies position, does not take ownership void xdg_popup_surface_update_position (XdgPopupSurface *self, XdgPopupPosition const* position); // Safe cast, returns NULL if wrong type sent XdgPopupSurface *custom_shell_surface_get_xdg_popup (CustomShellSurface *shell_surface); #endif // XDG_POPUP_SURFACE_H gtk-layer-shell-0.9.0/src/xdg-toplevel-surface.c000066400000000000000000000174161466775474600215620ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "xdg-toplevel-surface.h" #include "custom-shell-surface.h" #include "gtk-wayland.h" #include "simple-conversions.h" #include "gtk-priv-access.h" #include "xdg-shell-client.h" #include #include #include struct _XdgToplevelSurface { CustomShellSurface super; GdkRectangle cached_allocation; GdkRectangle geom; // These can be NULL struct xdg_surface *xdg_surface; struct xdg_toplevel *xdg_toplevel; }; static void xdg_surface_handle_configure (void *_data, struct xdg_surface *xdg_surface, uint32_t serial) { (void)_data; xdg_surface_ack_configure (xdg_surface, serial); } static const struct xdg_surface_listener xdg_surface_listener = { .configure = xdg_surface_handle_configure, }; static void xdg_toplevel_handle_configure (void *data, struct xdg_toplevel *_xdg_toplevel, int32_t width, int32_t height, struct wl_array *_states) { XdgToplevelSurface *self = data; (void)_xdg_toplevel; (void)_states; // Technically this should not be applied until we get a xdg_surface.configure if (width > 0 || height > 0) { GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gtk_window_resize (gtk_window, width, height); } // Ignore the states } static void xdg_toplevel_handle_close (void *data, struct xdg_toplevel *_xdg_toplevel) { XdgToplevelSurface *self = data; (void)_xdg_toplevel; GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); gtk_window_close (gtk_window); } static const struct xdg_toplevel_listener xdg_toplevel_listener = { .configure = xdg_toplevel_handle_configure, .close = xdg_toplevel_handle_close, }; static void xdg_toplevel_surface_map (CustomShellSurface *super, struct wl_surface *wl_surface) { XdgToplevelSurface *self = (XdgToplevelSurface *)super; g_return_if_fail (!self->xdg_toplevel); g_return_if_fail (!self->xdg_surface); struct xdg_wm_base *xdg_wm_base_global = gtk_wayland_get_xdg_wm_base_global (); g_return_if_fail (xdg_wm_base_global); self->xdg_surface = xdg_wm_base_get_xdg_surface (xdg_wm_base_global, wl_surface); g_return_if_fail (self->xdg_surface); xdg_surface_add_listener (self->xdg_surface, &xdg_surface_listener, self); self->xdg_toplevel = xdg_surface_get_toplevel (self->xdg_surface); // name is either static or managed by the window widget const char *name = gtk_window_get_title (custom_shell_surface_get_gtk_window (super)); if (name == NULL) name = "gtk-layer-shell"; xdg_toplevel_set_title (self->xdg_toplevel, name); GtkWindow *gtk_window = custom_shell_surface_get_gtk_window (super); self->geom = gtk_window_get_priv_logical_geom (gtk_window); xdg_surface_set_window_geometry (self->xdg_surface, self->geom.x, self->geom.y, self->geom.width, self->geom.height); xdg_toplevel_add_listener (self->xdg_toplevel, &xdg_toplevel_listener, self); } static void xdg_toplevel_surface_unmap (CustomShellSurface *super) { XdgToplevelSurface *self = (XdgToplevelSurface *)super; if (self->xdg_toplevel) { xdg_toplevel_destroy (self->xdg_toplevel); self->xdg_toplevel = NULL; } if (self->xdg_surface) { xdg_surface_destroy (self->xdg_surface); self->xdg_surface = NULL; } } static void xdg_toplevel_surface_finalize (CustomShellSurface *super) { custom_shell_surface_unmap (super); } static struct xdg_popup * xdg_toplevel_surface_get_popup (CustomShellSurface *super, struct xdg_surface *popup_xdg_surface, struct xdg_positioner *positioner) { XdgToplevelSurface *self = (XdgToplevelSurface *)super; if (!self->xdg_surface) { g_critical ("xdg_toplevel_surface_get_popup () called when the xdg surface wayland object has not yet been created"); return NULL; } return xdg_surface_get_popup (popup_xdg_surface, self->xdg_surface, positioner); } static GdkRectangle xdg_toplevel_surface_get_logical_geom (CustomShellSurface *super) { XdgToplevelSurface *self = (XdgToplevelSurface *)super; return self->geom; } static const CustomShellSurfaceVirtual xdg_toplevel_surface_virtual = { .map = xdg_toplevel_surface_map, .unmap = xdg_toplevel_surface_unmap, .finalize = xdg_toplevel_surface_finalize, .get_popup = xdg_toplevel_surface_get_popup, .get_logical_geom = xdg_toplevel_surface_get_logical_geom, }; static void xdg_toplevel_surface_on_size_allocate (GtkWidget *_widget, GdkRectangle *allocation, XdgToplevelSurface *self) { (void)_widget; if (self->xdg_surface && !gdk_rectangle_equal (&self->cached_allocation, allocation)) { self->cached_allocation = *allocation; // allocation only used for catching duplicate calls. To get the correct geom we need to check something else GtkWindow *gtk_window = custom_shell_surface_get_gtk_window ((CustomShellSurface *)self); self->geom = gtk_window_get_priv_logical_geom (gtk_window); xdg_surface_set_window_geometry (self->xdg_surface, self->geom.x, self->geom.y, self->geom.width, self->geom.height); } } XdgToplevelSurface * xdg_toplevel_surface_new (GtkWindow *gtk_window) { g_return_val_if_fail (gtk_wayland_get_xdg_wm_base_global (), NULL); XdgToplevelSurface *self = g_new0 (XdgToplevelSurface, 1); self->super.virtual = &xdg_toplevel_surface_virtual; custom_shell_surface_init ((CustomShellSurface *)self, gtk_window); self->cached_allocation = (GdkRectangle) { .x = 0, .y = 0, .width = 0, .height = 0, }; self->xdg_surface = NULL; self->xdg_toplevel = NULL; gtk_window_set_decorated (gtk_window, FALSE); g_signal_connect (gtk_window, "size-allocate", G_CALLBACK (xdg_toplevel_surface_on_size_allocate), self); return self; } XdgToplevelSurface * custom_shell_surface_get_xdg_toplevel (CustomShellSurface *shell_surface) { if (shell_surface && shell_surface->virtual == &xdg_toplevel_surface_virtual) return (XdgToplevelSurface *)shell_surface; else return NULL; } gtk-layer-shell-0.9.0/src/xdg-toplevel-surface.h000066400000000000000000000030711466775474600215570ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef XDG_TOPLEVEL_SURFACE_H #define XDG_TOPLEVEL_SURFACE_H #include "custom-shell-surface.h" // an XdgToplevelSurface * can be safely cast to a CustomShellSurface * typedef struct _XdgToplevelSurface XdgToplevelSurface; XdgToplevelSurface *xdg_toplevel_surface_new (GtkWindow *gtk_window); // Safe cast, returns NULL if wrong type sent XdgToplevelSurface *custom_shell_surface_get_xdg_toplevel (CustomShellSurface *shell_surface); #endif // XDG_TOPLEVEL_SURFACE_H gtk-layer-shell-0.9.0/test/000077500000000000000000000000001466775474600155355ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/README.md000066400000000000000000000073151466775474600170220ustar00rootroot00000000000000# GTK Layer Shell tests This directory is home to the gtk-layer-shell test suite. ## To run tests `ninja -C build test` (where `build` is the path to your build directory). ### To add a new integration test 1. Copy an existing integration test file 2. Implement your test as a series of one or more callbacks 3. Add its name to the list in `test/integration-tests/meson.build` ## Scripts - `check-licenses.py` makes sure all files have licenses at the top - `tests-not-enabled.py` is only run if tests are disabled, and explains to the user how to enable them - `run-integration-test.py` runs a single integration test - `check-all-tests-are-in-meson.py` fails if any test files exist that haven't been added to meson (an easy mistake to make) ## Integration tests Most of the potential bugs in GTK Layer Shell arise from interactions between the library, GTK and the Wayland compositor, so unit tests aren't particularly useful. Instead, most of our tests are integration tests. ### Integration test app Each integration test is a single unique GTK app that uses GTK Layer Shell. All test clients are located in `integration-tests`. Anything common to multiple tests gets pulled into `integration-test-common` or `test-common`. Tests consist of a sequence of callbacks. At the start of each callback the app can state that specific Wayland messages should be sent during or after the callback is run (see expectations format below). Each meson test runs a single integration test. Integration tests can be run directly on a normal Wayland compositor (this may be useful for debugging). When run without arguments, they open an additional layer shell window with a `Continue ->` button to manually advance the test. Pass `--auto` to run each test callback with a timeout the way they are run when automated. ### Expectations format Integration tests emit protocol expectations by using the `EXPECT_MESSAGE` macro. Each expectation is a white-space-separated sequence of tokens written to a line of stdout. The first element must be `EXPECT:` (this is automatically inserted by `EXPECT_MESSAGE`). For an expectation to match a message, each following token must appear in order in the message line. The list of expected messages must match in the correct order. Messages are matched against the output of the app run with `WAYLAND_DEBUG=1`. Events and requests are not distinguished. When the script encounters `CHECK EXPECTATIONS COMPLETED` (emitted by the `CHECK_EXPECTATIONS()` macro), it will assert that all previous expectations have been met. This is emitted automatically at the start of each test callback. ### Test runner `ninja -C build test` will run `run-integration-test.py` for each test defined in `test/meson.build`. This script: - Creates a temporary directory in `/tmp` to serve as `XDG_RUNTIME_DIR` (this allows tests to run in parallel without interfering with each other) - Spins up a mock Wayland server - Runs the given integration test within it - (Both are run with `WAYLAND_DEBUG=1` so protocol messages are written to stderr by libwayland) - Ensures both the client and server exit successfully - Parses the client's protocol message expectations - Ensures they match the protocol messages generated by libwayland ### Mock server Rather than running the integration tests in an external Wayland compositor, we implement our own mock Wayland compositor (located in `mock-server`). This doesn't show anything on-screen or get real user input, it simply gives the required responses to protocol messages. It's only dependency is libwayland. It implements most of the protocol with a single default dispatcher. This reads the message signature and takes whatever action appears to be required. The behavior of some messages is overridden in `overrides.c`. gtk-layer-shell-0.9.0/test/check-all-tests-are-in-meson.py000077500000000000000000000045241466775474600233720ustar00rootroot00000000000000#!/usr/bin/python3 ''' This entire file is licensed under MIT. Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' # Tests need to be added to meson.build. This script makes sure they are. import os from os import path import logging logger = logging.getLogger(__name__) logging.basicConfig(level=logging.WARNING) dead_tests = [] def check_dir(dir_path): logger.info('checking ' + dir_path) assert path.isdir(dir_path) meson_path = path.join(dir_path, 'meson.build') assert path.isfile(meson_path) with open(meson_path, 'r') as f: meson = f.read() for filename in os.listdir(dir_path): root, ext = path.splitext(filename) if ext == '.c': search_str = "'" + root + "'" if search_str in meson: logger.info(search_str + ' is in meson') else: logger.info(search_str + ' is not in meson') dead_tests.append(path.join(dir_path, filename)) else: logger.info(filename + ' ignored') if __name__ == '__main__': test_dir = path.dirname(path.realpath(__file__)) check_dir(path.join(test_dir, 'integration-tests')) check_dir(path.join(test_dir, 'unit-tests')) if dead_tests: print('The following tests have not been added to meson:') for test in dead_tests: print(' ' + test) exit(1) gtk-layer-shell-0.9.0/test/check-licenses.py000077500000000000000000000167701466775474600210050ustar00rootroot00000000000000#!/usr/bin/python3 ''' This entire file is licensed under MIT. Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' # This script checks that every source file in the project has an appropriate license import logging import re import os from os import path import subprocess import re logger = logging.getLogger(__name__) logging.basicConfig(level=logging.WARNING) toplevel_dirs = ['include', 'src', 'gtk-priv', 'examples', 'test'] ignore_patterns_file = 'test/license-ignore.txt' MIT_EXAMPLE = ''' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' LGPL3_EXAMPLE = ''' This program 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 3 of the License, or (at your option) any later version. This program 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 program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ''' def canonify_str(s): return re.sub(r'[/#\'\n\s\*]', '', s) def get_project_root(): return path.dirname(path.dirname(path.realpath(__file__))) ignore_patterns = None def get_ignore_patterns(): global ignore_patterns if ignore_patterns is not None: return ignore_patterns ignore_patterns = [] for f in ['.gitignore', '.git/info/exclude', ignore_patterns_file]: p = get_project_root() + '/' + f if path.isfile(p): logger.info('Excluding paths in ' + p + ' from the license check') for raw_line in open(p, 'r').read().splitlines(): line = re.sub(r'([^#]*)(.*)', r'\1', raw_line).strip() if line: ignore_patterns.append(line) else: logger.warning(p + ' not found, it will not be used to exclude paths from the license check') return ignore_patterns def path_matches(base_path, original): pattern = re.escape(original) pattern = re.sub(r'\\\*', r'.*', pattern) pattern = re.sub(r'\\?/', r'(^|$|/)', pattern) try: return bool(re.match(pattern, base_path)) except Exception as e: raise RuntimeError('Failed to match pattern ' + pattern + ' (original: ' + original + ') against ' + base_path + ': ' + str(e)) def get_files(prefix, search_path): full_path = path.join(prefix, search_path); assert path.exists(full_path), full_path + ' does not exist' if path.exists(path.join(full_path, 'build.ninja')): logger.info(search_path + ' ignored because it is a build directory') return [] for pattern in get_ignore_patterns(): if path_matches(search_path, pattern): logger.info(search_path + ' ignored because it matches ' + pattern) return [] if path.isfile(full_path): logger.info('Found ' + search_path) return [search_path] elif path.isdir(full_path): logger.info('Scanning ' + search_path) result = [] for item in os.listdir(full_path): result += get_files(prefix, path.join(search_path, item)) return result else: return [] def get_important_files(): result = [] for toplevel_dir in toplevel_dirs: logger.info('Scanning toplevel directory ' + toplevel_dir) result += get_files(get_project_root(), toplevel_dir) return result def print_list(name, files): if files: print('The following files are licensed under ' + name + ':') for f in files: print(' ' + f) else: print('No files are licensed under ' + name) print() def load_file(p): try: with open(p, 'r') as f: contents = f.read() return canonify_str(contents) except Exception: rel = path.relpath(p, get_project_root()) raise RuntimeError( 'Failed to read ' + rel + '. If this file should have been ignored, add it to ' + ignore_patterns_file) def main(): logger.info('Project root: ' + get_project_root()) logger.info('Ignore paths: \n ' + '\n '.join(get_ignore_patterns())) all_files = get_important_files() logger.info('Found ' + str(len(all_files)) + ' files') assert len(all_files) > 10, 'There are ' + str(len(all_files)) + ' files (which is not as many as there should be)' mit_files = [] lgpl3_files = [] none_files = [] multiples_files = [] mit_example = canonify_str(MIT_EXAMPLE) lgpl3_example = canonify_str(LGPL3_EXAMPLE) for p in all_files: contents = load_file(path.join(get_project_root(), p)) found = 0 if mit_example in contents: mit_files.append(p) found += 1 if lgpl3_example in contents: lgpl3_files.append(p) found += 1 if found > 1: multiples_files.append(p) elif found < 1: none_files.append(p) print() print_list('MIT', mit_files) print_list('LGPLv3', lgpl3_files) print_list('no license', none_files) print_list('multiple licenses', multiples_files) if none_files or multiples_files: print('If some files should be excluded from the license check, add them to ' + ignore_patterns_file) print('Failed license check') exit(1) else: print('Passed license check') exit(0) if __name__ == '__main__': main() gtk-layer-shell-0.9.0/test/integration-test-common/000077500000000000000000000000001466775474600223235ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/integration-test-common/integration-test-common.c000066400000000000000000000065361466775474600272670ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" // Time in milliseconds for each callback to run static int step_time = 300; static int return_code = 0; static int callback_index = 0; static gboolean next_step(gpointer _data) { (void)_data; CHECK_EXPECTATIONS(); if (test_callbacks[callback_index]) { test_callbacks[callback_index](); callback_index++; return TRUE; } else { gtk_main_quit(); return FALSE; } } GtkWindow* create_default_window() { GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); GtkWidget *label = gtk_label_new(""); gtk_label_set_markup( GTK_LABEL(label), "" "Layer shell test" ""); gtk_container_add(GTK_CONTAINER(window), label); gtk_container_set_border_width(GTK_CONTAINER(window), 12); return window; } static void continue_button_callback(GtkWidget *_widget, gpointer _data) { (void)_widget; (void)_data; next_step(NULL); } static void create_debug_control_window() { // Make a window with a continue button for debugging GtkWindow* window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); gtk_layer_init_for_window(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_layer_set_margin(window, GTK_LAYER_SHELL_EDGE_BOTTOM, 200); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_OVERLAY); GtkWidget* button = gtk_button_new_with_label("Continue ->"); g_signal_connect (button, "clicked", G_CALLBACK(continue_button_callback), NULL); gtk_container_add(GTK_CONTAINER(window), button); gtk_widget_show_all(GTK_WIDGET(window)); // This will only be called once, so leaking the window is fine } int main(int argc, char** argv) { gtk_init(0, NULL); if (argc == 1) { // Run with a debug mode window that lets the user advance manually create_debug_control_window(); next_step(NULL); } else if (argc == 2 && g_strcmp0(argv[1], "--auto") == 0) { // Run normally with a timeout next_step(NULL); g_timeout_add(step_time, next_step, NULL); } else { g_critical("Invalid arguments to integration test"); return 1; } gtk_main(); return return_code; } gtk-layer-shell-0.9.0/test/integration-test-common/integration-test-common.h000066400000000000000000000041031466775474600272600ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEST_CLIENT_COMMON_H #define TEST_CLIENT_COMMON_H #include "gtk-layer-shell.h" #include "test-common.h" #include #include #include #include // Tell the test script that a request containing the given space-separated components is expected #define EXPECT_MESSAGE(message) fprintf(stderr, "EXPECT: %s\n", #message) // Tell the test script that all expected messages should now be fulfilled // (called automatically before each callback and at the end of the test) #define CHECK_EXPECTATIONS() fprintf(stderr, "CHECK EXPECTATIONS COMPLETED\n") // NULL-terminated list of callbacks that will be called before quitting // Should be defined in the test file using TEST_CALLBACKS() extern void (* test_callbacks[])(void); // Input is a sequence of callback names with a trailing comma #define TEST_CALLBACKS(...) void (* test_callbacks[])(void) = {__VA_ARGS__ NULL}; GtkWindow* create_default_window(); #endif // TEST_CLIENT_COMMON_H gtk-layer-shell-0.9.0/test/integration-test-common/meson.build000066400000000000000000000002631466775474600244660ustar00rootroot00000000000000integration_test_common = declare_dependency( dependencies: [test_common], include_directories: include_directories('.'), sources: files('integration-test-common.c')) gtk-layer-shell-0.9.0/test/integration-tests/000077500000000000000000000000001466775474600212205ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/integration-tests/meson.build000066400000000000000000000021171466775474600233630ustar00rootroot00000000000000integration_tests = [ 'test-is-supported-true', 'test-expect-fail', 'test-creation-properties', 'test-is-layer-window', 'test-single-anchors', 'test-multi-anchors', 'test-set-anchor-normalizes-booleans', 'test-set-layer', 'test-get-layer', 'test-set-size-request', 'test-adapts-to-screen-size', 'test-auto-exclusive-zone-no-margin', 'test-auto-exclusive-zone-with-margin', 'test-auto-exclusive-zone-weird-bool-values', 'test-get-explicit-exclusive-zone', 'test-get-auto-exclusive-zone', 'test-exclusive-zone-below-negative-1', 'test-menu-popup', 'test-nested-popup', 'test-nested-popup-unmap-order', 'test-window-with-initially-attached-buffer', 'test-close-layer-surface', 'test-get-namespace-default', 'test-get-namespace-on-non-layer-window', 'test-get-namespace-custom-namespace', 'test-set-keyboard-interactivity', 'test-set-keyboard-mode', 'test-get-keyboard-interactivity', 'test-get-keyboard-mode', 'test-get-monitor', 'test-set-monitor', 'test-create-subsurface', ] gtk-layer-shell-0.9.0/test/integration-tests/test-adapts-to-screen-size.c000066400000000000000000000047351466775474600264730ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 0 0); EXPECT_MESSAGE(.create_buffer 1920 1080); // size must match DEFAULT_OUTPUT_WIDTH/DEFAULT_OUTPUT_HEIGHT in common.h window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM); gtk_layer_set_namespace(window, "foobar"); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, TRUE); gtk_widget_set_size_request(GTK_WIDGET(window), 600, 700); gtk_window_resize(window, 1, 1); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 600 0); EXPECT_MESSAGE(.create_buffer 600 1080); // size must match DEFAULT_OUTPUT_HEIGHT in common.h gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, FALSE); } static void callback_2() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 600 700); EXPECT_MESSAGE(.create_buffer 600 700); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, FALSE); } TEST_CALLBACKS( callback_0, callback_1, callback_2, ) gtk-layer-shell-0.9.0/test/integration-tests/test-auto-exclusive-zone-no-margin.c000066400000000000000000000052251466775474600301600ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { // First, anchor to bottom EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 200); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_auto_exclusive_zone_enable(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_widget_set_size_request(GTK_WIDGET(window), 300, 200); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { // Resize EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 240); gtk_widget_set_size_request(GTK_WIDGET(window), 320, 240); gtk_window_resize(window, 1, 1); } static void callback_2() { // Streatch across left edge EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 320); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, TRUE); } static void callback_3() { // Stretch across top EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 240); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, FALSE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, TRUE); } static void callback_4() { // Anchor right EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 320); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, FALSE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, FALSE); } TEST_CALLBACKS( callback_0, callback_1, callback_2, callback_3, callback_4, ) gtk-layer-shell-0.9.0/test/integration-tests/test-auto-exclusive-zone-weird-bool-values.c000066400000000000000000000036031466775474600316270ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 300); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_auto_exclusive_zone_enable(window); // Note that true bools are normally 1, but can be other non-zero values // This used to cause a problem, as noted in https://github.com/wmww/gtk-layer-shell/pull/79 gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, 1); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, 2); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, 3); gtk_widget_set_size_request(GTK_WIDGET(window), 300, 200); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-auto-exclusive-zone-with-margin.c000066400000000000000000000036361466775474600305230ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 240); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_auto_exclusive_zone_enable(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_widget_set_size_request(GTK_WIDGET(window), 320, 240); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { // Bottom margin should have no effect on exclusive zone but top margin should EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 250); gtk_layer_set_margin(window, GTK_LAYER_SHELL_EDGE_TOP, 10); gtk_layer_set_margin(window, GTK_LAYER_SHELL_EDGE_BOTTOM, 5); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-close-layer-surface.c000066400000000000000000000030051466775474600262040ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .destroy); EXPECT_MESSAGE(wl_surface .destroy); gtk_window_close(window); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-create-subsurface.c000066400000000000000000000034661466775474600257550ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static GtkWindow* subsurface; static void callback_0() { EXPECT_MESSAGE(wl_subcompositor .get_subsurface); EXPECT_MESSAGE(wl_subsurface .set_position -20 30); window = create_default_window(); gtk_layer_init_for_window(window); subsurface = GTK_WINDOW(gtk_window_new(GTK_WINDOW_POPUP)); gtk_container_add(GTK_CONTAINER(subsurface), gtk_label_new("Subsurface")); gtk_window_set_modal(subsurface, TRUE); gtk_window_set_transient_for(subsurface, window); gtk_window_move(subsurface, -20, 30); gtk_widget_show_all(GTK_WIDGET(window)); gtk_widget_show_all(GTK_WIDGET(subsurface)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-creation-properties.c000066400000000000000000000034341466775474600263430ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM); gtk_layer_set_namespace(window, "foobar"); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_layer_set_exclusive_zone(window, 32); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface 1 "foobar"); EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone 32); EXPECT_MESSAGE(wl_surface .commit); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-exclusive-zone-below-negative-1.c000066400000000000000000000031211466775474600303620ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_exclusive_zone -1); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_widget_show_all(GTK_WIDGET(window)); gtk_layer_set_exclusive_zone(window, -2); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), -1, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-expect-fail.c000066400000000000000000000027331466775474600245470ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow *window; static void callback_0() { // This should fail because the tokens are in the wrong order EXPECT_MESSAGE(.get_layer_surface zwlr_layer_shell_v1); window = create_default_window(); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-auto-exclusive-zone.c000066400000000000000000000041741466775474600270520ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_widget_set_size_request(GTK_WIDGET(window), 300, 200); gtk_layer_init_for_window(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); ASSERT(!gtk_layer_auto_exclusive_zone_is_enabled(window)); gtk_layer_auto_exclusive_zone_enable(window); ASSERT(gtk_layer_auto_exclusive_zone_is_enabled(window)); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 200, "%d"); gtk_widget_set_size_request(GTK_WIDGET(window), 320, 240); gtk_window_resize(window, 1, 1); } static void callback_2() { ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 240, "%d"); ASSERT(gtk_layer_auto_exclusive_zone_is_enabled(window)); gtk_layer_set_exclusive_zone(window, 20); ASSERT(!gtk_layer_auto_exclusive_zone_is_enabled(window)); } TEST_CALLBACKS( callback_0, callback_1, callback_2, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-explicit-exclusive-zone.c000066400000000000000000000035431466775474600277220ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 0, "%d"); gtk_layer_set_exclusive_zone(window, 12); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 12, "%d"); gtk_widget_show_all(GTK_WIDGET(window)); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 12, "%d"); gtk_layer_set_exclusive_zone(window, 0); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), 0, "%d"); gtk_layer_set_exclusive_zone(window, -1); ASSERT_EQ(gtk_layer_get_exclusive_zone(window), -1, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-keyboard-interactivity.c000066400000000000000000000033631466775474600276170ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); ASSERT_EQ(gtk_layer_get_keyboard_interactivity(window), FALSE, "%d"); gtk_layer_set_keyboard_interactivity(window, TRUE); ASSERT_EQ(gtk_layer_get_keyboard_interactivity(window), TRUE, "%d"); gtk_widget_show_all(GTK_WIDGET(window)); ASSERT_EQ(gtk_layer_get_keyboard_interactivity(window), TRUE, "%d"); gtk_layer_set_keyboard_interactivity(window, FALSE); ASSERT_EQ(gtk_layer_get_keyboard_interactivity(window), FALSE, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-keyboard-mode.c000066400000000000000000000036071466775474600256460ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); ASSERT_EQ(gtk_layer_get_keyboard_mode(window), GTK_LAYER_SHELL_KEYBOARD_MODE_NONE, "%d"); gtk_layer_set_keyboard_mode(window, GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND); ASSERT_EQ(gtk_layer_get_keyboard_mode(window), GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND, "%d"); gtk_widget_show_all(GTK_WIDGET(window)); ASSERT_EQ(gtk_layer_get_keyboard_mode(window), GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND, "%d"); gtk_layer_set_keyboard_mode(window, GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE); ASSERT_EQ(gtk_layer_get_keyboard_mode(window), GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-layer.c000066400000000000000000000036341466775474600242400ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_OVERLAY); ASSERT_EQ(gtk_layer_get_layer(window), GTK_LAYER_SHELL_LAYER_OVERLAY, "%d"); gtk_widget_show_all(GTK_WIDGET(window)); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_TOP); ASSERT_EQ(gtk_layer_get_layer(window), GTK_LAYER_SHELL_LAYER_TOP, "%d"); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BACKGROUND); ASSERT_EQ(gtk_layer_get_layer(window), GTK_LAYER_SHELL_LAYER_BACKGROUND, "%d"); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM); ASSERT_EQ(gtk_layer_get_layer(window), GTK_LAYER_SHELL_LAYER_BOTTOM, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-monitor.c000066400000000000000000000035441466775474600246130ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); ASSERT_EQ(gdk_display_get_n_monitors(gdk_display_get_default()), 1, "%d"); GdkMonitor *monitor = gdk_display_get_monitor(gdk_display_get_default(), 0); ASSERT(GDK_IS_MONITOR(monitor)); ASSERT_EQ(gtk_layer_get_monitor(window), NULL, "%p"); gtk_layer_set_monitor(window, monitor); ASSERT_EQ(gtk_layer_get_monitor(window), monitor, "%p"); gtk_widget_show_all(GTK_WIDGET(window)); ASSERT_EQ(gtk_layer_get_monitor(window), monitor, "%p"); gtk_layer_set_monitor(window, NULL); ASSERT_EQ(gtk_layer_get_monitor(window), NULL, "%p"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-namespace-custom-namespace.c000066400000000000000000000027621466775474600303230ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_namespace(window, "foobar"); gtk_widget_show_all(GTK_WIDGET(window)); const char *name_space = gtk_layer_get_namespace(window); ASSERT_STR_EQ(name_space, "foobar"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-namespace-default.c000066400000000000000000000027141466775474600265000ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); const char *name_space = gtk_layer_get_namespace(window); ASSERT_STR_EQ(name_space, "gtk-layer-shell"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-get-namespace-on-non-layer-window.c000066400000000000000000000025701466775474600306770ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); const char *name_space = gtk_layer_get_namespace(window); ASSERT_STR_EQ(name_space, "gtk-layer-shell"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-is-layer-window.c000066400000000000000000000033161466775474600253760ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window_a; static GtkWindow* window_b; static void callback_0() { window_a = create_default_window(); window_b = create_default_window(); gtk_layer_init_for_window(window_a); ASSERT(gtk_layer_is_layer_window(window_a)); ASSERT(!gtk_layer_is_layer_window(window_b)); gtk_widget_show_all(GTK_WIDGET(window_a)); gtk_widget_show_all(GTK_WIDGET(window_b)); } static void callback_1() { ASSERT(gtk_layer_is_layer_window(window_a)); ASSERT(!gtk_layer_is_layer_window(window_b)); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-is-supported-true.c000066400000000000000000000024231466775474600257550ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static void callback_0() { ASSERT(gtk_layer_is_supported()); ASSERT(gtk_layer_is_supported()); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-menu-popup.c000066400000000000000000000044341466775474600244530ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { // The mock server will automatically click on our window, triggering the menu to open EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface); EXPECT_MESSAGE(xdg_wm_base .get_xdg_surface); EXPECT_MESSAGE(xdg_surface .get_popup nil); EXPECT_MESSAGE(zwlr_layer_surface_v1 .get_popup xdg_popup); EXPECT_MESSAGE(xdg_popup .grab); window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); GtkWidget *menu_bar = gtk_menu_bar_new(); gtk_container_add(GTK_CONTAINER(window), menu_bar); GtkWidget *menu_item = gtk_menu_item_new_with_label("Popup menu"); gtk_widget_set_size_request(menu_item, 100, 100); gtk_container_add(GTK_CONTAINER(menu_bar), menu_item); GtkWidget *submenu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu); GtkWidget *close_item = gtk_menu_item_new_with_label("Menu item"); gtk_widget_set_size_request(close_item, 100, 100); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), close_item); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-multi-anchors.c000066400000000000000000000046631466775474600251370ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void set_anchors(GtkWindow* window, gboolean top, gboolean bottom, gboolean left, gboolean right) { gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, top); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, bottom); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, left); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, right); } static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 0); window = create_default_window(); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); set_anchors(window, FALSE, FALSE, FALSE, FALSE); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 3); set_anchors(window, TRUE, TRUE, FALSE, FALSE); } static void callback_2() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 13); set_anchors(window, TRUE, FALSE, TRUE, TRUE); } static void callback_3() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 15); set_anchors(window, TRUE, TRUE, TRUE, TRUE); } static void callback_4() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 0); set_anchors(window, FALSE, FALSE, FALSE, FALSE); } TEST_CALLBACKS( callback_0, callback_1, callback_2, callback_3, callback_4, ) gtk-layer-shell-0.9.0/test/integration-tests/test-nested-popup-unmap-order.c000066400000000000000000000054711466775474600272220ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow *window; static GtkWidget *popup_menu; // Regression test for https://github.com/wmww/gtk-layer-shell/issues/178 static void callback_0() { // The mock server will automatically click on our window, triggering the menu to open EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface); EXPECT_MESSAGE(xdg_surface .get_popup nil); // Menu EXPECT_MESSAGE(xdg_surface .get_popup xdg_surface); // Sub-menu window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); GtkWidget *menu_bar = gtk_menu_bar_new(); gtk_container_add(GTK_CONTAINER(window), menu_bar); GtkWidget *menu_item = gtk_menu_item_new_with_label("Popup menu"); gtk_widget_set_size_request(menu_item, 100, 100); gtk_container_add(GTK_CONTAINER(menu_bar), menu_item); popup_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), popup_menu); GtkWidget *sub_item = gtk_menu_item_new_with_label("Menu item"); gtk_widget_set_size_request(sub_item, 100, 100); gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), sub_item); GtkWidget *sub_sub_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(sub_item), sub_sub_menu); GtkWidget *sub_sub_item = gtk_menu_item_new_with_label("Sub item"); gtk_widget_set_size_request(sub_sub_item, 100, 100); gtk_menu_shell_append(GTK_MENU_SHELL(sub_sub_menu), sub_sub_item); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(xdg_popup .destroy); // Sub-menu EXPECT_MESSAGE(xdg_popup .destroy); // Menu gtk_widget_unmap(gtk_widget_get_toplevel(popup_menu)); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-nested-popup.c000066400000000000000000000050161466775474600247660ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow *window; static void callback_0() { // The mock server will automatically click on our window, triggering the menu to open EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface); EXPECT_MESSAGE(xdg_surface .get_popup nil); // Menu EXPECT_MESSAGE(xdg_surface .get_popup xdg_surface); // Sub-menu window = GTK_WINDOW(gtk_window_new(GTK_WINDOW_TOPLEVEL)); GtkWidget *menu_bar = gtk_menu_bar_new(); gtk_container_add(GTK_CONTAINER(window), menu_bar); GtkWidget *menu_item = gtk_menu_item_new_with_label("Popup menu"); gtk_widget_set_size_request(menu_item, 100, 100); gtk_container_add(GTK_CONTAINER(menu_bar), menu_item); GtkWidget* popup_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), popup_menu); GtkWidget *sub_item = gtk_menu_item_new_with_label("Menu item"); gtk_widget_set_size_request(sub_item, 100, 100); gtk_menu_shell_append(GTK_MENU_SHELL(popup_menu), sub_item); GtkWidget *sub_sub_menu = gtk_menu_new(); gtk_menu_item_set_submenu(GTK_MENU_ITEM(sub_item), sub_sub_menu); GtkWidget *sub_sub_item = gtk_menu_item_new_with_label("Sub item"); gtk_widget_set_size_request(sub_sub_item, 100, 100); gtk_menu_shell_append(GTK_MENU_SHELL(sub_sub_menu), sub_sub_item); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-anchor-normalizes-booleans.c000066400000000000000000000034211466775474600303650ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, 1); ASSERT_EQ(gtk_layer_get_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT), 1, "%d"); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, 2); ASSERT_EQ(gtk_layer_get_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT), 1, "%d"); gtk_widget_show_all(GTK_WIDGET(window)); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, -1); ASSERT_EQ(gtk_layer_get_anchor(window, GTK_LAYER_SHELL_EDGE_TOP), 1, "%d"); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-keyboard-interactivity.c000066400000000000000000000031401466775474600276240ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_keyboard_interactivity 1); EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_keyboard_interactivity 0); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_keyboard_interactivity(window, TRUE); gtk_widget_show_all(GTK_WIDGET(window)); gtk_layer_set_keyboard_interactivity(window, FALSE); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-keyboard-mode.c000066400000000000000000000034511466775474600256570ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_keyboard_interactivity 1); EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_keyboard_interactivity 0); EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_keyboard_interactivity 2); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_keyboard_mode(window, GTK_LAYER_SHELL_KEYBOARD_MODE_EXCLUSIVE); gtk_widget_show_all(GTK_WIDGET(window)); gtk_layer_set_keyboard_mode(window, GTK_LAYER_SHELL_KEYBOARD_MODE_NONE); gtk_layer_set_keyboard_mode(window, GTK_LAYER_SHELL_KEYBOARD_MODE_ON_DEMAND); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-layer.c000066400000000000000000000037161466775474600242550ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface 2); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_TOP); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_layer 3); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_OVERLAY); } static void callback_2() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_layer 0); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BACKGROUND); } static void callback_3() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_layer 1); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM); } TEST_CALLBACKS( callback_0, callback_1, callback_2, callback_3, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-monitor.c000066400000000000000000000034521466775474600246250ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface wl_output); window = create_default_window(); gtk_layer_init_for_window(window); ASSERT_EQ(gdk_display_get_n_monitors(gdk_display_get_default()), 1, "%d"); GdkMonitor *monitor = gdk_display_get_monitor(gdk_display_get_default(), 0); ASSERT(GDK_IS_MONITOR(monitor)); gtk_layer_set_monitor(window, monitor); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_shell_v1 .get_layer_surface nil); gtk_layer_set_monitor(window, NULL); } TEST_CALLBACKS( callback_0, callback_1, ) gtk-layer-shell-0.9.0/test/integration-tests/test-set-size-request.c000066400000000000000000000056031466775474600255760ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 0 0); window = create_default_window(); gtk_layer_init_for_window(window); gtk_layer_set_layer(window, GTK_LAYER_SHELL_LAYER_BOTTOM); gtk_layer_set_namespace(window, "foobar"); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, TRUE); gtk_widget_show_all(GTK_WIDGET(window)); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 600 700); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, FALSE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, FALSE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, FALSE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, FALSE); gtk_widget_set_size_request(GTK_WIDGET(window), 600, 700); gtk_window_resize(window, 1, 1); } static void callback_2() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 0 700); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, TRUE); } static void callback_3() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 0 0); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, TRUE); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, TRUE); } static void callback_4() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_size 600 0); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, FALSE); } TEST_CALLBACKS( callback_0, callback_1, callback_2, callback_3, callback_4, ) gtk-layer-shell-0.9.0/test/integration-tests/test-single-anchors.c000066400000000000000000000044321466775474600252600ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void set_anchors(GtkWindow* window, gboolean top, gboolean bottom, gboolean left, gboolean right) { gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_TOP, top); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_BOTTOM, bottom); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_LEFT, left); gtk_layer_set_anchor(window, GTK_LAYER_SHELL_EDGE_RIGHT, right); } static void callback_0() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 1); window = create_default_window(); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); set_anchors(window, TRUE, FALSE, FALSE, FALSE); } static void callback_1() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 2); set_anchors(window, FALSE, TRUE, FALSE, FALSE); } static void callback_2() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 4); set_anchors(window, FALSE, FALSE, TRUE, FALSE); } static void callback_3() { EXPECT_MESSAGE(zwlr_layer_surface_v1 .set_anchor 8); set_anchors(window, FALSE, FALSE, FALSE, TRUE); } TEST_CALLBACKS( callback_0, callback_1, callback_2, callback_3, ) gtk-layer-shell-0.9.0/test/integration-tests/test-window-with-initially-attached-buffer.c000066400000000000000000000036511466775474600316440ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "integration-test-common.h" static GtkWindow* window; static void on_realize(GtkWidget *widget, gpointer _data) { (void)_data; GdkWindow *gdk_window = gtk_widget_get_window(widget); // This forces GTK to create a cairo surface for the window, which results in in being attached before our custom // surface role objects are created/configured, which causes an error unless we clear the attached buffer cairo_surface_t *cr = gdk_window_create_similar_surface (gdk_window, CAIRO_CONTENT_COLOR_ALPHA, 100, 100); cairo_surface_destroy(cr); } static void callback_0() { window = create_default_window(); g_signal_connect(G_OBJECT(window), "realize", G_CALLBACK(on_realize), NULL); gtk_layer_init_for_window(window); gtk_widget_show_all(GTK_WIDGET(window)); } TEST_CALLBACKS( callback_0, ) gtk-layer-shell-0.9.0/test/license-ignore.txt000066400000000000000000000005771466775474600212120ustar00rootroot00000000000000# Used by the check-license.py test # Relative to project root and same format as .gitignore (although syntax may not be fully implemented) *.git *.gitignore *.github */doc *.md *.editorconfig *.txt *.xml */check-licenses.py # Contains multiple license texts in strings */meson.build *.kate-swp */gtk-priv/scripts/code.py # Contains multiple license texts in strings */.pytest_cache gtk-layer-shell-0.9.0/test/meson.build000066400000000000000000000022211466775474600176740ustar00rootroot00000000000000subdir('test-common') subdir('mock-server') subdir('integration-test-common') subdir('integration-tests') subdir('unit-tests') py = find_program('python3') run_test_script = files(meson.current_source_dir() + '/run-integration-test.py') foreach integration_test : integration_tests integration_test_srcs = files('integration-tests/' + integration_test + '.c') exe = executable( integration_test, integration_test_srcs, dependencies: [gtk, wayland_client, gtk_layer_shell, integration_test_common]) expect_fail = integration_test.endswith('expect-fail') test( integration_test, py, should_fail: expect_fail, workdir: meson.current_source_dir(), args: [ run_test_script, meson.current_build_dir() + '/' + integration_test, ]) endforeach check_licenses_script = files(meson.current_source_dir() + '/check-licenses.py') test('check-licenses', py, args: [check_licenses_script]) check_tests_in_meson_script = files(meson.current_source_dir() + '/check-all-tests-are-in-meson.py') test('check-all-tests-are-in-meson', py, args: [check_tests_in_meson_script]) gtk-layer-shell-0.9.0/test/mock-server/000077500000000000000000000000001466775474600177725ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/mock-server/meson.build000066400000000000000000000004111466775474600221300ustar00rootroot00000000000000mock_server_srcs = files( 'mock-server.h', 'mock-server.c', 'overrides.c') mock_server = executable( 'mock-server', mock_server_srcs, server_protocol_srcs, c_args: ['-Wno-unused-parameter'], dependencies: [wayland_server, test_common]) gtk-layer-shell-0.9.0/test/mock-server/mock-server.c000066400000000000000000000125021466775474600223730ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "mock-server.h" struct wl_display* display = NULL; void* alloc_zeroed(size_t size) { void* data = malloc(size); memset(data, 0, size); return data; } static const char* get_display_name() { const char* result = getenv("WAYLAND_DISPLAY"); if (!result) { FATAL("WAYLAND_DISPLAY not set"); } return result; } typedef struct { const struct wl_message* message; RequestOverrideFunction function; struct wl_list link; } RequestOverride; struct wl_list request_overrides; void install_request_override(const struct wl_interface* interface, const char* name, RequestOverrideFunction function) { for (int i = 0; i < interface->method_count; i++) { if (strcmp(name, interface->methods[i].name) == 0) { RequestOverride* override = ALLOC_STRUCT(RequestOverride); override->message = &interface->methods[i]; override->function = function; wl_list_insert(&request_overrides, &override->link); return; } } FATAL_FMT("Interface %s does not have a request named %s", interface->name, name); } static int default_dispatcher(const void* data, void* resource, uint32_t opcode, const struct wl_message* message, union wl_argument* args) { // First, check if there is an override RequestOverride* override; wl_list_for_each(override, &request_overrides, link) { if (override->message == message) { override->function(resource, message, args); return 0; } } // If there are any new-id type arguments, resources need to be created for them // See https://wayland.freedesktop.org/docs/html/apb.html#Client-structwl__message int arg = 0; for (const char* c = message->signature; *c; c++) { if (*c == 'n' && args[arg].n != 0) { struct wl_resource* new_resource = wl_resource_create( wl_resource_get_client(resource), message->types[arg], wl_resource_get_version(resource), args[arg].n); wl_resource_set_dispatcher(new_resource, default_dispatcher, NULL, NULL, NULL); } if (*c >= 'a' && *c <= 'z') arg++; } if (strcmp(message->name, "destroy") == 0) { wl_resource_destroy(resource); } return 0; } void use_default_impl(struct wl_resource* resource) { wl_resource_set_dispatcher(resource, default_dispatcher, NULL, NULL, NULL); } static void default_global_bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) { struct wl_interface* interface = data; struct wl_resource* resource = wl_resource_create(client, interface, version, id); use_default_impl(resource); }; void default_global_create(struct wl_display* display, const struct wl_interface* interface, int version) { wl_global_create(display, interface, version, (void*)interface, default_global_bind); } char type_code_at_index(const struct wl_message* message, int index) { int i = 0; for (const char* c = message->signature; *c; c++) { if (*c >= 'a' && *c <= 'z') { if (i == index) return *c; else i++; } } FATAL_FMT(".%s does not have an argument %d", message->name, index); } static void client_disconnect(struct wl_listener *listener, void *data) { wl_display_terminate(display); } static struct wl_listener client_disconnect_listener = { .notify = client_disconnect, }; static void client_connect(struct wl_listener *listener, void *data) { struct wl_client* client = (struct wl_client*)data; wl_client_add_destroy_listener(client, &client_disconnect_listener); } static struct wl_listener client_connect_listener = { .notify = client_connect, }; int main(int argc, const char** argv) { wl_list_init(&request_overrides); display = wl_display_create(); if (wl_display_add_socket(display, get_display_name()) != 0) { FATAL_FMT("server failed to connect to Wayland display %s", get_display_name()); } wl_display_add_client_created_listener(display, &client_connect_listener); init(); wl_display_run(display); wl_display_destroy(display); return 0; } gtk-layer-shell-0.9.0/test/mock-server/mock-server.h000066400000000000000000000061251466775474600224040ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ // This is an implementation of a mock Wayland compositor for testing // It does not show anything on the screen, and is only as conforment as is required by GTK // Useful regex for importing a Wayland protocol. First, copy from header file then: // Find: (struct (\w+)_interface (\{?\n\t.*)*)[\{;]\n(\t[/ ]\*.*\n)+\tvoid \(\*(\w+)\)(\((.*(,\n)?)*\));\n\};((([^=]*\n)*)\nstatic const struct \w+ \w+ = \{\n(( \.\w+ = \w+\,\n)*)\};)? // Replace with: \1;\n};\nstatic void \2_\5\6\n{\n FATAL_NOT_IMPL;\n}\n\{10}\nstatic const struct \2_interface \2_impl = {\n .\5 = \2_\5,\n\{12}}; // Then remove the struct artifact and replace this with a space: \n\t\s* #ifndef MOCK_SERVER_H #define MOCK_SERVER_H #include "test-common.h" #include #include "xdg-shell-server.h" #include "wlr-layer-shell-unstable-v1-server.h" extern struct wl_display* display; #define ALLOC_STRUCT(type) ((type*)alloc_zeroed(sizeof(type))) void* alloc_zeroed(size_t size); #define OVERRIDE_REQUEST(type, method) install_request_override(&type##_interface, #method, type##_##method) #define NEW_ID_ARG(name, index) ASSERT(type_code_at_index(message, index) == 'n'); uint32_t name = args[index].n; #define RESOURCE_ARG(type, name, index) ASSERT(type_code_at_index(message, index) == 'o'); ASSERT(message->types[index] == &type##_interface); struct wl_resource* name = (struct wl_resource*)args[index].o; #define UINT_ARG(name, index) ASSERT(type_code_at_index(message, index) == 'u'); uint32_t name = args[index].u; typedef void (*RequestOverrideFunction)(struct wl_resource* resource, const struct wl_message* message, union wl_argument* args); void install_request_override(const struct wl_interface* interface, const char* name, RequestOverrideFunction function); void use_default_impl(struct wl_resource* resource); void default_global_create(struct wl_display* display, const struct wl_interface* interface, int version); char type_code_at_index(const struct wl_message* message, int index); void init(); #endif // MOCK_SERVER_H gtk-layer-shell-0.9.0/test/mock-server/overrides.c000066400000000000000000000370371466775474600221520ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "mock-server.h" #include "linux/input.h" typedef enum { SURFACE_ROLE_NONE = 0, SURFACE_ROLE_XDG_TOPLEVEL, SURFACE_ROLE_XDG_POPUP, SURFACE_ROLE_LAYER, } SurfaceRole; typedef struct SurfaceData SurfaceData; struct SurfaceData { SurfaceRole role; struct wl_resource* surface; struct wl_resource* pending_frame; struct wl_resource* xdg_toplevel; struct wl_resource* xdg_popup; struct wl_resource* xdg_surface; struct wl_resource* layer_surface; char has_pending_buffer; // If the pending buffer is non-null; same as has_committed_buffer if no pending buffer char has_committed_buffer; // This surface has a non-null committed buffer char initial_commit_for_role; // Set to 1 when a role is created for a surface, and cleared after the first commit char layer_send_configure; // If to send a layer surface configure on the next commit char click_on_surface; // If to click on the surface next commit int layer_set_w; // The width to configure the layer surface with int layer_set_h; // The height to configure the layer surface with uint32_t layer_anchor; // The layer surface's anchor uint32_t click_serial; // The most recent serial that was used to click on this surface SurfaceData* most_recent_popup; // Start of the popup linked list SurfaceData* previous_popup_sibling; // Forms a linked list of popups SurfaceData* popup_parent; }; static struct wl_resource* seat_global = NULL; static struct wl_resource* pointer_global = NULL; static struct wl_resource* output_global = NULL; // Needs to be called before any role objects are assigned static void surface_data_set_role(SurfaceData* data, SurfaceRole role) { ASSERT_EQ(data->role, SURFACE_ROLE_NONE, "%u"); char is_xdg_role = (role == SURFACE_ROLE_XDG_TOPLEVEL || role == SURFACE_ROLE_XDG_POPUP); ASSERT_EQ(data->xdg_surface != NULL, is_xdg_role, "%d"); ASSERT(!data->xdg_toplevel); ASSERT(!data->xdg_popup); ASSERT(!data->layer_surface); ASSERT(!data->has_committed_buffer); data->role = role; data->initial_commit_for_role = 1; } static void surface_data_unmap(SurfaceData* data) { SurfaceData* popup = data->most_recent_popup; while (popup) { // Popups must be unmapped before their parents ASSERT(!popup->layer_surface); ASSERT(!popup->xdg_popup); ASSERT(!popup->xdg_toplevel); ASSERT(!popup->xdg_surface); popup = popup->previous_popup_sibling; } } static void surface_data_add_pupup(SurfaceData* parent, SurfaceData* popup) { ASSERT(!popup->previous_popup_sibling); popup->previous_popup_sibling = parent->most_recent_popup; parent->most_recent_popup = popup; popup->popup_parent = parent; } static void wl_surface_frame(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(callback, 0); SurfaceData* data = wl_resource_get_user_data(resource); ASSERT(!data->pending_frame); data->pending_frame = wl_resource_create( wl_resource_get_client(resource), &wl_callback_interface, wl_resource_get_version(resource), callback); } static void wl_surface_attach(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { RESOURCE_ARG(wl_buffer, buffer, 0); SurfaceData* data = wl_resource_get_user_data(resource); data->has_pending_buffer = (buffer != NULL); data->click_on_surface = 1; } static void wl_surface_commit(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); data->has_committed_buffer = data->has_pending_buffer; // leave the contents of has_pending_buffer alone if (data->pending_frame) { wl_callback_send_done(data->pending_frame, 0); wl_resource_destroy(data->pending_frame); data->pending_frame = NULL; } if (data->initial_commit_for_role) { ASSERT(!data->has_committed_buffer); data->initial_commit_for_role = 0; } if (data->layer_surface && data->layer_send_configure) { char horiz = ( (data->layer_anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT) && (data->layer_anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT)); char vert = ( (data->layer_anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP) && (data->layer_anchor & ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM)); int width = data->layer_set_w; int height = data->layer_set_h; if (width == 0 && !horiz) FATAL("not horizontally stretched and no width given"); if (height == 0 && !vert) FATAL("not horizontally stretched and no width given"); if (horiz) width = DEFAULT_OUTPUT_WIDTH; if (vert) height = DEFAULT_OUTPUT_HEIGHT; zwlr_layer_surface_v1_send_configure(data->layer_surface, wl_display_next_serial(display), width, height); data->layer_send_configure = 0; } if (data->click_on_surface) { // Move the pointer onto the surface and click // This is needed to trigger a tooltip or popup menu to open for the popup tests ASSERT(pointer_global); wl_pointer_send_enter( pointer_global, wl_display_next_serial(display), data->surface, wl_fixed_from_double(50), wl_fixed_from_double(50)); wl_pointer_send_frame(pointer_global); data->click_serial = wl_display_next_serial(display); wl_pointer_send_button( pointer_global, data->click_serial, 0, BTN_LEFT, WL_POINTER_BUTTON_STATE_PRESSED); wl_pointer_send_frame(pointer_global); data->click_on_surface = 0; } } static void wl_surface_destroy(struct wl_resource* resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); ASSERT(!data->xdg_popup); ASSERT(!data->xdg_toplevel); ASSERT(!data->xdg_surface); ASSERT(!data->layer_surface); data->surface = NULL; // Don't free surfaces to guarantee traversing popups is always safe // We're employing the missile memory management pattern here https://x.com/pomeranian99/status/858856994438094848 } static void wl_compositor_create_surface(struct wl_resource* resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); struct wl_resource* surface = wl_resource_create( wl_resource_get_client(resource), &wl_surface_interface, wl_resource_get_version(resource), id); SurfaceData* data = ALLOC_STRUCT(SurfaceData); data->surface = surface; use_default_impl(surface); wl_resource_set_user_data(surface, data); } void wl_seat_bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) { ASSERT(!seat_global); seat_global = wl_resource_create(client, &wl_seat_interface, version, id); use_default_impl(seat_global); wl_seat_send_capabilities(seat_global, WL_SEAT_CAPABILITY_POINTER | WL_SEAT_CAPABILITY_KEYBOARD); }; void wl_output_bind(struct wl_client* client, void* data, uint32_t version, uint32_t id) { ASSERT(!output_global); output_global = wl_resource_create(client, &wl_output_interface, version, id); use_default_impl(output_global); wl_output_send_done(output_global); }; static void wl_seat_get_pointer(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); ASSERT(!pointer_global); pointer_global = wl_resource_create( wl_resource_get_client(resource), &wl_pointer_interface, wl_resource_get_version(resource), id); use_default_impl(pointer_global); } static void xdg_wm_base_get_xdg_surface(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); RESOURCE_ARG(wl_surface, surface, 1); struct wl_resource* xdg_surface = wl_resource_create( wl_resource_get_client(resource), &xdg_surface_interface, wl_resource_get_version(resource), id); use_default_impl(xdg_surface); SurfaceData* data = wl_resource_get_user_data(surface); wl_resource_set_user_data(xdg_surface, data); data->xdg_surface = xdg_surface; } static void xdg_surface_destroy(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); ASSERT(!data->xdg_toplevel); ASSERT(!data->xdg_popup); data->xdg_surface = NULL; } static void xdg_surface_get_toplevel(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); struct wl_resource* toplevel = wl_resource_create( wl_resource_get_client(resource), &xdg_toplevel_interface, wl_resource_get_version(resource), id); use_default_impl(toplevel); struct wl_array states; wl_array_init(&states); xdg_toplevel_send_configure(toplevel, 0, 0, &states); wl_array_release(&states); xdg_surface_send_configure(resource, wl_display_next_serial(display)); SurfaceData* data = wl_resource_get_user_data(resource); surface_data_set_role(data, SURFACE_ROLE_XDG_TOPLEVEL); wl_resource_set_user_data(toplevel, data); data->xdg_toplevel = toplevel; } static void xdg_toplevel_destroy(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); ASSERT(data->xdg_surface); data->xdg_toplevel = NULL; surface_data_unmap(data); } static void xdg_surface_get_popup(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); RESOURCE_ARG(xdg_surface, parent, 1); struct wl_resource* popup = wl_resource_create( wl_resource_get_client(resource), &xdg_popup_interface, wl_resource_get_version(resource), id); use_default_impl(popup); xdg_popup_send_configure(popup, 0, 0, 100, 100); xdg_surface_send_configure(resource, wl_display_next_serial(display)); SurfaceData* data = wl_resource_get_user_data(resource); surface_data_set_role(data, SURFACE_ROLE_XDG_POPUP); wl_resource_set_user_data(popup, data); data->xdg_popup = popup; if (parent) { SurfaceData* parent_data = wl_resource_get_user_data(parent); surface_data_add_pupup(parent_data, data); } } static void xdg_popup_grab(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); RESOURCE_ARG(wl_seat, seat, 0); UINT_ARG(serial, 1); ASSERT_EQ(seat, seat_global, "%p"); ASSERT(data->popup_parent); ASSERT(data->popup_parent->click_serial); ASSERT_EQ(serial, data->popup_parent->click_serial, "%u"); } static void xdg_popup_destroy(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); ASSERT(data->xdg_surface); data->xdg_popup = NULL; surface_data_unmap(data); } static void zwlr_layer_surface_v1_set_anchor(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { UINT_ARG(anchor, 0); SurfaceData* data = wl_resource_get_user_data(resource); data->layer_send_configure = 1; data->layer_anchor = anchor; } static void zwlr_layer_surface_v1_set_size(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { UINT_ARG(width, 0); UINT_ARG(height, 1); SurfaceData* data = wl_resource_get_user_data(resource); data->layer_send_configure = 1; data->layer_set_w = width; data->layer_set_h = height; } static void zwlr_layer_surface_v1_get_popup(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { RESOURCE_ARG(xdg_popup, popup, 0); SurfaceData* data = wl_resource_get_user_data(resource); SurfaceData* popup_data = wl_resource_get_user_data(popup); ASSERT(!popup_data->popup_parent); surface_data_add_pupup(data, popup_data); } static void zwlr_layer_shell_v1_get_layer_surface(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { NEW_ID_ARG(id, 0); RESOURCE_ARG(wl_surface, surface, 1); struct wl_resource* layer_surface = wl_resource_create( wl_resource_get_client(resource), &zwlr_layer_surface_v1_interface, wl_resource_get_version(resource), id); use_default_impl(layer_surface); SurfaceData* data = wl_resource_get_user_data(surface); surface_data_set_role(data, SURFACE_ROLE_LAYER); wl_resource_set_user_data(layer_surface, data); data->layer_send_configure = 1; data->layer_surface = layer_surface; } static void zwlr_layer_surface_v1_destroy(struct wl_resource *resource, const struct wl_message* message, union wl_argument* args) { SurfaceData* data = wl_resource_get_user_data(resource); data->layer_surface = NULL; surface_data_unmap(data); } void init() { OVERRIDE_REQUEST(wl_surface, commit); OVERRIDE_REQUEST(wl_surface, frame); OVERRIDE_REQUEST(wl_surface, attach); OVERRIDE_REQUEST(wl_surface, destroy); OVERRIDE_REQUEST(wl_compositor, create_surface); OVERRIDE_REQUEST(wl_seat, get_pointer); OVERRIDE_REQUEST(xdg_wm_base, get_xdg_surface); OVERRIDE_REQUEST(xdg_surface, destroy); OVERRIDE_REQUEST(xdg_surface, get_toplevel); OVERRIDE_REQUEST(xdg_toplevel, destroy); OVERRIDE_REQUEST(xdg_surface, get_popup); OVERRIDE_REQUEST(xdg_popup, grab); OVERRIDE_REQUEST(xdg_popup, destroy); OVERRIDE_REQUEST(zwlr_layer_shell_v1, get_layer_surface); OVERRIDE_REQUEST(zwlr_layer_surface_v1, set_anchor); OVERRIDE_REQUEST(zwlr_layer_surface_v1, set_size); OVERRIDE_REQUEST(zwlr_layer_surface_v1, get_popup); OVERRIDE_REQUEST(zwlr_layer_surface_v1, destroy); wl_global_create(display, &wl_seat_interface, 6, NULL, wl_seat_bind); wl_global_create(display, &wl_output_interface, 2, NULL, wl_output_bind); default_global_create(display, &wl_shm_interface, 1); default_global_create(display, &wl_data_device_manager_interface, 2); default_global_create(display, &wl_compositor_interface, 4); default_global_create(display, &wl_subcompositor_interface, 1); default_global_create(display, &xdg_wm_base_interface, 2); default_global_create(display, &zwlr_layer_shell_v1_interface, 4); } gtk-layer-shell-0.9.0/test/run-integration-test.py000077500000000000000000000244701466775474600222230ustar00rootroot00000000000000#!/usr/bin/python3 ''' This entire file is licensed under MIT. Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' # This script runs an integration test. See test/README.md for details usage = 'Usage: python3 run-test ' import os from os import path import sys import shutil import time import subprocess import threading from typing import List, Dict, Optional, Any # All callables (generally lambdas) appended to this list will be called at the end of the program cleanup_funcs = [] class TestError(RuntimeError): pass def get_xdg_runtime_dir() -> str: ''' Creates a directory to use as the XDG_RUNTIME_DIR. It bases the result on the current PID because each test running in parallel needs a unique directory. ''' tmp_runtime_dir = '/tmp/layer-shell-test-runtime-dir-' + str(os.getpid()) if (path.exists(tmp_runtime_dir)): # We should wipe the dir on cleanup, but things can go wrong wipe_xdg_runtime_dir(tmp_runtime_dir) os.mkdir(tmp_runtime_dir) cleanup_funcs.append(lambda: wipe_xdg_runtime_dir(tmp_runtime_dir)) return tmp_runtime_dir def wipe_xdg_runtime_dir(p: str): assert p.startswith('/tmp'), 'Sanity check' assert 'layer-shell-test-runtime-dir' in p, 'Sanity check' shutil.rmtree(p) def wait_until_appears(p: str): '''Waits for something to appear at the given path''' sleep_time = 0.01 timeout = 5.0 for i in range(int(timeout / sleep_time)): if path.exists(p): return time.sleep(0.01) raise TestError(p + ' did not appear in ' + str(timeout) + ' seconds') def format_stream(name: str, stream: str) -> str: ''' After collecting a programs output stream into a string, this function formats it for easy reading. Specifically, it gives it a colored border and a name. ''' l_pad = 28 - len(name) // 2 r_pad = l_pad if len(name) % 2 == 1: r_pad -= 1 l_pad = max(l_pad, 1) r_pad = max(r_pad, 1) header = '─' * l_pad + '┤ ' + name + ' ├' + '─' * r_pad + '┈' divider = '\n│' body = divider.join(' ' + line for line in stream.strip().splitlines()) footer = '─' * 60 + '┈' return '╭' + header + divider + body + '\n╰' + footer def format_process_report(name: str, returncode: int, stdout: str, stderr: str) -> str: '''After running a program, this function is used to format it's output for easy reading''' result = format_stream(name + ' stderr', stderr) + '\n\n' if stdout: result += format_stream(name + ' stdout', stdout) + '\n\n' else: result += 'stdout empty, ' result += 'exit code: ' + str(returncode) return result class Pipe: ''' The normal Python subprocess.PIPE freezes the subprocess after it fills up a finite output buffer. This class solves that by opening a pipe and reading from it from another thread whil the subprocess runs. This increases the output limit to the system's available memory See: https://github.com/wmww/gtk-layer-shell/issues/91#issuecomment-719082062 See: https://thraxil.org/users/anders/posts/2008/03/13/Subprocess-Hanging-PIPE-is-your-enemy/ ''' def __init__(self, name: str): '''name is only for debugging''' readable, writable = os.pipe() self.fd = writable self.data: Any = bytes() self.result: Optional[str] = None # Read the data coming out of the pipe on a background thread # This keeps the buffer from filling up and blocking self.reader_thread = threading.Thread(name=name, target=self.read, args=(readable,)) self.reader_thread.start() cleanup_funcs.append(lambda: self.close()) def read(self, readable: int): '''Reads from the given fd until the other side closes''' while True: data = os.read(readable, 1000) if not data: # We've reached the end of the data os.close(readable) return self.data += data def close(self): '''Closes the fd and stops the reader''' if self.reader_thread.is_alive(): os.close(self.fd) self.reader_thread.join(timeout=1) assert not self.reader_thread.is_alive(), 'Failed to join pipe reader thread' def collect_str(self) -> str: '''Closes the pipe if needed and returns the read data decoded as UTF-8''' if self.result is None: self.close() self.result = self.data.decode('utf-8') self.data = None return self.result class Program: '''A program to run as a subprocess''' def __init__(self, name: str, args: List[str], env: Dict[str, str]): self.name = name self.stdout = Pipe(name + ' stdout') self.stderr = Pipe(name + ' stderr') self.subprocess = subprocess.Popen(args, stdout=self.stdout.fd, stderr=self.stderr.fd, env=env) cleanup_funcs.append(lambda: self.kill()) def finish(self, timeout: float): try: self.subprocess.wait(timeout=timeout) except subprocess.TimeoutExpired: self.kill() raise TestError(self.format_output() + '\n\n' + self.name + ' timed out') def kill(self): if self.subprocess.returncode is None: self.subprocess.kill() self.subprocess.wait() def format_output(self): assert self.subprocess.returncode is not None, 'Program.format_output() called before process exited' return format_process_report( self.name, self.subprocess.returncode, self.stdout.collect_str(), self.stderr.collect_str()) def check_returncode(self): assert self.subprocess.returncode is not None, repr(self.name) + '.check_returncode() called before process exited' if self.subprocess.returncode != 0: raise TestError( self.format_output() + '\n\n' + self.name + ' failed (return code ' + str(self.subprocess.returncode) + ')') def collect_output(self): return self.stdout.collect_str(), self.stderr.collect_str() def run_test(name: str, server_args: List[str], client_args: List[str], xdg_runtime: str, wayland_display: str) -> str: ''' Runs two processes: a mock server and the test client Does *not* check that client's message assertions pass, this must be done later using the returned output ''' env = os.environ.copy() env['XDG_RUNTIME_DIR'] = xdg_runtime env['WAYLAND_DISPLAY'] = wayland_display env['WAYLAND_DEBUG'] = '1' server = Program('server', server_args, env) try: wait_until_appears(path.join(xdg_runtime, wayland_display)) except TestError as e: server.kill() raise TestError(server.format_output() + '\n\n' + str(e)) client = Program(name, client_args, env) client.finish(timeout=10) server.finish(timeout=1) server.check_returncode() client.check_returncode() client_stdout, client_stderr = client.collect_output() if client_stdout.strip() != '': raise TestError(format_stream(name + ' stdout', client_stdout) + '\n\n' + name + ' stdout not empty') return client_stderr def line_contains(line: str, tokens: List[str]) -> bool: '''Returns if the given line contains a list of tokens in the given order (anything can be between tokens)''' found = True for token in tokens: if token in line: line = line[line.find(token) + len(token):] else: found = False return found def verify_result(lines: List[str]): '''Runs through the output of a client and verifies that all expectations pass, see the test README.md details''' assertions = [] section_start = 0 for i, line in enumerate(lines): if line.startswith('EXPECT: '): assertions.append(line.split()[1:]) elif line.startswith('[') and line.endswith(')') and ('@' in line or '#' in line): if assertions and line_contains(line, assertions[0]): assertions = assertions[1:] elif line == 'CHECK EXPECTATIONS COMPLETED' or i == len(lines) - 1: if assertions: section = format_stream('relevant section', '\n'.join(lines[section_start:i])) raise TestError(section + '\n\ndid not find "' + ' '.join(assertions[0]) + '"') section_start = i + 1 def main(): client_bin = sys.argv[1] name = path.basename(client_bin) server_bin = path.join(path.dirname(client_bin), 'mock-server', 'mock-server') assert path.exists(client_bin), 'Could not find client at ' + client_bin assert path.exists(server_bin), 'Could not find server at ' + server_bin wayland_display = 'wayland-test' xdg_runtime = get_xdg_runtime_dir() client_stderr = run_test(name, [server_bin], [client_bin, '--auto'], xdg_runtime, wayland_display) client_lines = [line.strip() for line in client_stderr.strip().splitlines()] try: verify_result(client_lines) except TestError as e: raise TestError(format_stream(name + ' stderr', client_stderr) + '\n\n' + str(e)) if __name__ == '__main__': assert len(sys.argv) == 2, 'Incorrect number of args. ' + usage fail = False try: main() print('Passed') except TestError as e: fail = True print(e) finally: for func in cleanup_funcs: func() if fail: exit(1) gtk-layer-shell-0.9.0/test/test-common/000077500000000000000000000000001466775474600200025ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/test-common/meson.build000066400000000000000000000001251466775474600221420ustar00rootroot00000000000000test_common = declare_dependency( include_directories: include_directories('.')) gtk-layer-shell-0.9.0/test/test-common/test-common.h000066400000000000000000000036661466775474600224330ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TEST_COMMON_H #define TEST_COMMON_H #include #include #include #include #define DEFAULT_OUTPUT_WIDTH 1920 #define DEFAULT_OUTPUT_HEIGHT 1080 #define FATAL_FMT(format, ...) do {fprintf(stderr, "Fatal error at %s:%d in %s(): " format "\n", __FILE__, __LINE__, __func__, ##__VA_ARGS__); exit(1);} while (0) #define FATAL(message) FATAL_FMT(message"%s", "") #define ASSERT(assertion) do {if (!(assertion)) {FATAL_FMT("\n assertion failed: %s", #assertion);}} while (0) #define ASSERT_EQ(a, b, format) do {if (!((a) == (b))) {FATAL_FMT("\n expected: %s == %s\n actual: " format " != " format "\n", #a, #b, a, b);}} while (0) #define ASSERT_STR_EQ(a, b) do {if (strcmp(a, b)) {FATAL_FMT("\n expected: %s ≈ %s\n actual: \"%s\" ≠ \"%s\"\n", #a, #b, a, b);}} while (0) #endif // TEST_COMMON_H gtk-layer-shell-0.9.0/test/tests-not-enabled.py000066400000000000000000000027401466775474600214420ustar00rootroot00000000000000#!/usr/bin/python3 ''' This entire file is licensed under MIT. Copyright 2020 Sophie Winter Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ''' # When the tests are not enabled, this script serves as a failing test that explains the problem import sys color_green = '\x1b[32;1m' color_normal = '\x1b[0m' reconfig_command = color_green + 'meson build --reconfigure -Dtests=true' + color_normal print('you must run ' + reconfig_command + ' in order to run the tests (where build is the path to your build directory)') exit(1) gtk-layer-shell-0.9.0/test/unit-tests/000077500000000000000000000000001466775474600176545ustar00rootroot00000000000000gtk-layer-shell-0.9.0/test/unit-tests/meson.build000066400000000000000000000003341466775474600220160ustar00rootroot00000000000000test_get_version = executable( 'test-get-version', files('test-get-version.c'), dependencies: [gtk, gtk_layer_shell, test_common]) test('test-get-version', test_get_version, args: [meson.project_version()]) gtk-layer-shell-0.9.0/test/unit-tests/test-get-version.c000066400000000000000000000030441466775474600232400ustar00rootroot00000000000000/* This entire file is licensed under MIT * * Copyright 2020 Sophie Winter * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "gtk-layer-shell.h" #include "test-common.h" int main(int argc, char** argv) { ASSERT_EQ(argc, 2, "%d"); char version_provided_by_gtk_layer_shell[1024]; sprintf( version_provided_by_gtk_layer_shell, "%d.%d.%d", gtk_layer_get_major_version(), gtk_layer_get_minor_version(), gtk_layer_get_micro_version()); ASSERT_STR_EQ(version_provided_by_gtk_layer_shell, argv[1]); return 0; }