pax_global_header00006660000000000000000000000064146071337300014516gustar00rootroot0000000000000052 comment=c8e43d028ff99364168ec7cc51236e827bd1813b go-x11-client-1.0.2/000077500000000000000000000000001460713373000140065ustar00rootroot00000000000000go-x11-client-1.0.2/.github/000077500000000000000000000000001460713373000153465ustar00rootroot00000000000000go-x11-client-1.0.2/.github/workflows/000077500000000000000000000000001460713373000174035ustar00rootroot00000000000000go-x11-client-1.0.2/.github/workflows/backup-to-gitlab.yml000066400000000000000000000005371460713373000232600ustar00rootroot00000000000000name: backup to gitlab on: [push] concurrency: group: ${{ github.workflow }} cancel-in-progress: true jobs: backup-to-gitlabwh: uses: linuxdeepin/.github/.github/workflows/backup-to-gitlabwh.yml@master secrets: inherit backup-to-gitee: uses: linuxdeepin/.github/.github/workflows/backup-to-gitee.yml@master secrets: inherit go-x11-client-1.0.2/.github/workflows/call-auto-tag.yml000066400000000000000000000005171460713373000225630ustar00rootroot00000000000000name: auto tag on: pull_request_target: types: [opened, synchronize, closed] paths: - "debian/changelog" concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: auto_tag: uses: linuxdeepin/.github/.github/workflows/auto-tag.yml@master secrets: inherit go-x11-client-1.0.2/.github/workflows/call-build-distribution.yml000066400000000000000000000004321460713373000246520ustar00rootroot00000000000000name: Call build-distribution on: push: paths-ignore: - ".github/workflows/**" pull_request_target: paths-ignore: - ".github/workflows/**" jobs: check_job: uses: linuxdeepin/.github/.github/workflows/build-distribution.yml@master secrets: inherit go-x11-client-1.0.2/.github/workflows/call-chatOps.yml000066400000000000000000000002421460713373000224360ustar00rootroot00000000000000name: chatOps on: issue_comment: types: [created] jobs: chatopt: uses: linuxdeepin/.github/.github/workflows/chatOps.yml@master secrets: inherit go-x11-client-1.0.2/.github/workflows/call-clacheck.yml000066400000000000000000000005251460713373000225760ustar00rootroot00000000000000name: Call CLA check on: issue_comment: types: [created] pull_request_target: types: [opened, closed, synchronize] concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: clacheck: uses: linuxdeepin/.github/.github/workflows/cla-check.yml@master secrets: inherit go-x11-client-1.0.2/.github/workflows/call-commitlint.yml000066400000000000000000000003641460713373000232210ustar00rootroot00000000000000name: Call commitlint on: pull_request_target: concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: check_job: uses: linuxdeepin/.github/.github/workflows/commitlint.yml@master go-x11-client-1.0.2/.github/workflows/call-license-check.yml000066400000000000000000000005521460713373000235360ustar00rootroot00000000000000name: Call License and README Check on: pull_request_target: types: [opened, synchronize, reopened] permissions: pull-requests: write contents: read concurrency: group: ${{ github.workflow }}-pull/${{ github.event.number }} cancel-in-progress: true jobs: license-check: uses: linuxdeepin/.github/.github/workflows/license-check.yml@master go-x11-client-1.0.2/.gitlab-ci.yml000066400000000000000000000001411460713373000164360ustar00rootroot00000000000000include: - remote: 'https://gitlab.deepin.io/dev-tools/letmeci/raw/master/gitlab-ci/dde.yml' go-x11-client-1.0.2/.obs/000077500000000000000000000000001460713373000146475ustar00rootroot00000000000000go-x11-client-1.0.2/.obs/workflows.yml000066400000000000000000000022231460713373000174260ustar00rootroot00000000000000test_build: steps: - link_package: source_project: deepin:Develop:dde source_package: %{SCM_REPOSITORY_NAME} target_project: deepin:CI - configure_repositories: project: deepin:CI repositories: - name: deepin_develop paths: - target_project: deepin:CI target_repository: deepin_develop architectures: - x86_64 - aarch64 - name: debian paths: - target_project: deepin:CI target_repository: debian_sid architectures: - x86_64 - name: archlinux paths: - target_project: deepin:CI target_repository: archlinux architectures: - x86_64 filters: event: pull_request tag_build: steps: - trigger_services: project: deepin:Unstable:dde package: %{SCM_REPOSITORY_NAME} filters: event: tag_push commit_build: steps: - trigger_services: project: deepin:Develop:dde package: %{SCM_REPOSITORY_NAME} filters: event: push go-x11-client-1.0.2/.packit.yaml000066400000000000000000000011321460713373000162200ustar00rootroot00000000000000# See the documentation for more information: # https://packit.dev/docs/configuration/ specfile_path: rpm/golang-github-linuxdeepin-go-x11-client.spec # add or remove files that should be synced synced_files: - rpm/golang-github-linuxdeepin-go-x11-client.spec - .packit.yaml upstream_package_name: go-x11-client # downstream (Fedora) RPM package name downstream_package_name: golang-github-linuxdeepin-go-x11-client actions: fix-spec-file: | bash -c "sed -i -r \"0,/Version:/ s/Version:(\s*)\S*/Version:\1${PACKIT_PROJECT_VERSION}/\" rpm/golang-github-linuxdeepin-go-x11-client.spec" go-x11-client-1.0.2/.reuse/000077500000000000000000000000001460713373000152075ustar00rootroot00000000000000go-x11-client-1.0.2/.reuse/dep5000066400000000000000000000027201460713373000157700ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: go-x11-client Upstream-Contact: UnionTech Software Technology Co., Ltd. <> Source: https://github.com/linuxdeepin/go-x11-client # gitignore clang-format gitreview .tx Files: .gitignore .clang-format .gitreview .mailmap .tx/config Copyright: None License: CC0-1.0 # README Files: *.md README README.zh_CN.md Copyright: UnionTech Software Technology Co., Ltd. License: CC-BY-4.0 # Project file Files: *Makefile* Copyright: None License: CC0-1.0 # ci Files: .github/* .gitlab-ci.yml .obs/workflows.yml Copyright: None License: CC0-1.0 # sh Files: gen.sh util/tool/gen-keysymdef/gen.sh Copyright: None License: GPL-3.0-or-later # debian rpm archlinux Files: debian/* rpm/* archlinux/* Copyright: None License: CC0-1.0 # README Files: *.md src/gi/README README.zh_CN.md Copyright: UnionTech Software Technology Co., Ltd. License: CC-BY-4.0 # docs documentation Files: docs/* documentation/* Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later # org xml json yaml html yml css in ui Files: *.org *.xml *.json *.yaml *.html *.yml *.css *.devhelp2 *.in *.ui Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later # png svg jpg gif Files: *.png *.svg *.jpg *.gif Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later # test file Files: *testdata/* Copyright: UnionTech Software Technology Co., Ltd. License: GPL-3.0-or-later go-x11-client-1.0.2/CHANGELOG.md000066400000000000000000000032541460713373000156230ustar00rootroot00000000000000[0.4.1] 2019-04-03 * fix: build failed [0.4.0] 2019-03-27 * feat: add util xcursor [0.3.0] 2019-02-26 * chore: use WriteBool and ReadBool * feat: xkb add more functions * chore: exts use new reader * chore: xproto event use new reader * feat: implement new Reader * feat: add ext xkb * feat: delete other error types, leaving only the Error type * chore: continue to replace uint64 with SeqNum * feat: use special seqNum to indicate error * fix: requestCheck do not unlock c.ioMu before return * chore: replace uint64 with SeqNum * feat: reduce memory usage for encoding requests # [0.2.0] - 2018-11-23 * fix: readSetup # [0.1.0] - 2018-10-25 * fix(wm/ewmh): get icon failed * feat: add WriteSelectionNotifyEvent * chore: add makefile for `sw_64` # [0.0.4] - 2018-07-19 * fix: requestCheck method * feat: add ext shm * feat: add ext render * feat: support ge generic event * feat: add ext input * fix: readMapNotifyEvent no set Window field * fix: conn read blocked when event chan full * feat(ext/randr): add more events * fix(ext/randr): name typo * feat: add ext xfixes * fead: handle conn read write error * feat: Conn add method IDUsedCount * fix: wrong call NewError * feat: add resource id allocator * feat: conn add atom cache * fix: ewmh _NET_SUPPORTING_WM_CHECK is not root property * feat: add ext randr * feat: add ext dpms and screensaver * chore: call log.Print if env DEBUG_X11_CLIENT = 1 * chore(deb): set env DH_GOLANG_EXCLUDES * feat: handwriting encode decode part * fix: atom WM_CHANGE_STATE not found # [0.0.3] - 2018-03-07 * remove usr/bin * expand event chan buffer size * fix: Adapt lintian go-x11-client-1.0.2/LICENSE000066400000000000000000001045131460713373000150170ustar00rootroot00000000000000 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 . go-x11-client-1.0.2/LICENSES/000077500000000000000000000000001460713373000152135ustar00rootroot00000000000000go-x11-client-1.0.2/LICENSES/CC-BY-4.0.txt000066400000000000000000000411771460713373000170620ustar00rootroot00000000000000Creative Commons Attribution 4.0 International Creative Commons Corporation (“Creative Commons”) is not a law firm and does not provide legal services or legal advice. Distribution of Creative Commons public licenses does not create a lawyer-client or other relationship. Creative Commons makes its licenses and related information available on an “as-is” basis. Creative Commons gives no warranties regarding its licenses, any material licensed under their terms and conditions, or any related information. Creative Commons disclaims all liability for damages resulting from their use to the fullest extent possible. Using Creative Commons Public Licenses Creative Commons public licenses provide a standard set of terms and conditions that creators and other rights holders may use to share original works of authorship and other material subject to copyright and certain other rights specified in the public license below. The following considerations are for informational purposes only, are not exhaustive, and do not form part of our licenses. Considerations for licensors: Our public licenses are intended for use by those authorized to give the public permission to use material in ways otherwise restricted by copyright and certain other rights. Our licenses are irrevocable. Licensors should read and understand the terms and conditions of the license they choose before applying it. Licensors should also secure all rights necessary before applying our licenses so that the public can reuse the material as expected. Licensors should clearly mark any material not subject to the license. This includes other CC-licensed material, or material used under an exception or limitation to copyright. More considerations for licensors. Considerations for the public: By using one of our public licenses, a licensor grants the public permission to use the licensed material under specified terms and conditions. If the licensor’s permission is not necessary for any reason–for example, because of any applicable exception or limitation to copyright–then that use is not regulated by the license. Our licenses grant only permissions under copyright and certain other rights that a licensor has authority to grant. Use of the licensed material may still be restricted for other reasons, including because others have copyright or other rights in the material. A licensor may make special requests, such as asking that all changes be marked or described. Although not required by our licenses, you are encouraged to respect those requests where reasonable. More considerations for the public. Creative Commons Attribution 4.0 International Public License By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions. Section 1 – Definitions. a. Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image. b. Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License. c. Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights. d. Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements. e. Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material. f. Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License. g. Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license. h. Licensor means the individual(s) or entity(ies) granting rights under this Public License. i. Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them. j. Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world. k. You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning. Section 2 – Scope. a. License grant. 1. Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to: A. reproduce and Share the Licensed Material, in whole or in part; and B. produce, reproduce, and Share Adapted Material. 2. Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions. 3. Term. The term of this Public License is specified in Section 6(a). 4. Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material. 5. Downstream recipients. A. Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License. B. No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material. 6. No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i). b. Other rights. 1. Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise. 2. Patent and trademark rights are not licensed under this Public License. 3. To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties. Section 3 – License Conditions. Your exercise of the Licensed Rights is expressly made subject to the following conditions. a. Attribution. 1. If You Share the Licensed Material (including in modified form), You must: A. retain the following if it is supplied by the Licensor with the Licensed Material: i. identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated); ii. a copyright notice; iii. a notice that refers to this Public License; iv. a notice that refers to the disclaimer of warranties; v. a URI or hyperlink to the Licensed Material to the extent reasonably practicable; B. indicate if You modified the Licensed Material and retain an indication of any previous modifications; and C. indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License. 2. You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information. 3. If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable. 4. If You Share Adapted Material You produce, the Adapter's License You apply must not prevent recipients of the Adapted Material from complying with this Public License. Section 4 – Sui Generis Database Rights. Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material: a. for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database; b. if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material; and c. You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database. For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights. Section 5 – Disclaimer of Warranties and Limitation of Liability. a. Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You. b. To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You. c. The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability. Section 6 – Term and Termination. a. This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically. b. Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates: 1. automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or 2. upon express reinstatement by the Licensor. c. For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License. d. For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License. e. Sections 1, 5, 6, 7, and 8 survive termination of this Public License. Section 7 – Other Terms and Conditions. a. The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed. b. Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License. Section 8 – Interpretation. a. For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License. b. To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions. c. No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor. d. Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority. Creative Commons is not a party to its public licenses. Notwithstanding, Creative Commons may elect to apply one of its public licenses to material it publishes and in those instances will be considered the “Licensor.” Except for the limited purpose of indicating that material is shared under a Creative Commons public license or as otherwise permitted by the Creative Commons policies published at creativecommons.org/policies, Creative Commons does not authorize the use of the trademark “Creative Commons” or any other trademark or logo of Creative Commons without its prior written consent including, without limitation, in connection with any unauthorized modifications to any of its public licenses or any other arrangements, understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. Creative Commons may be contacted at creativecommons.org. go-x11-client-1.0.2/LICENSES/CC0-1.0.txt000066400000000000000000000156101460713373000166200ustar00rootroot00000000000000Creative Commons Legal Code CC0 1.0 Universal CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED HEREUNDER. Statement of Purpose The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 1. Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; ii. moral rights retained by the original author(s) and/or performer(s); iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; v. rights protecting the extraction, dissemination, use and reuse of data in a Work; vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 2. Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 3. Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 4. Limitations and Disclaimers. a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. go-x11-client-1.0.2/LICENSES/GPL-3.0-or-later.txt000066400000000000000000001035561460713373000204310ustar00rootroot00000000000000GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright © 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 . go-x11-client-1.0.2/Makefile000066400000000000000000000005341460713373000154500ustar00rootroot00000000000000PREFIX = /usr GOSITE_DIR = ${PREFIX}/share/gocode GOPKG_PERFIX = github.com/linuxdeepin/go-x11-client SRC_DIR=${DESTDIR}${GOSITE_DIR}/src/${GOPKG_PERFIX} all: build build: echo ignore build print_gopath: GOPATH="${CURDIR}/${GOPATH_DIR}:${GOPATH}" install: mkdir -p ${SRC_DIR} cp *.go ${SRC_DIR} cp -r ext ${SRC_DIR} cp -r util ${SRC_DIR} go-x11-client-1.0.2/README.md000066400000000000000000000026461460713373000152750ustar00rootroot00000000000000# go-x11-client **Description**: go-x11-client it is a X11 protocol go language binding. ## Dependencies You can also check the "Depends" provided in the debian/control file. ### Build dependencies You can also check the "Build-Depends" provided in the debian/control file. ## Installation ### Deepin Install prerequisites ``` $ sudo apt-get build-dep go-x11-client ``` Build ``` $ GOPATH=/usr/share/gocode make ``` Install If you have isolated testing build environment (say a docker container), you can install it directly. ``` $ sudo make install ``` generate package files and install go-x11-client with it. ``` $ debuild -uc -us ... $ sudo dpkg -i ../golang-github-linuxdeepin-go-x11-client.deb ``` ## Usage go get github.com/linuxdeepin/go-x11-client ## Getting help Any usage issues can ask for help via * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC channel](https://webchat.freenode.net/?channels=deepin) * [Forum](https://bbs.deepin.org) * [WiKi](https://wiki.deepin.org/) ## Getting involved We encourage you to report issues and contribute changes. * [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en). (English) * [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) (中文) ## License go-x11-client is licensed under [GPL-3.0-or-later](LICENSE). go-x11-client-1.0.2/README.zh_CN.md000066400000000000000000000026651460713373000162760ustar00rootroot00000000000000# go-x11-client **Description**: go-x11-client是一个用go语言实现与X11协议进行绑定的项目。 ## 依赖 请查看“debian/control”文件中提供的“Depends”。 ### 编译依赖 请查看“debian/control”文件中提供的“Build-Depends”。 ## 安装 ### Deepin go-x11-client需要预安装以下包 ``` $ sudo apt-get build-dep go-x11-client ``` 构建 ``` $ GOPATH=/usr/share/gocode make ``` 安装 如果你有独立的测试构建环境(比如一个 docker 容器),你可以直接安装它。 ``` $ sudo make install ``` 生成包文件并安装 go-x11-client ``` $ debuild -uc -us ... $ sudo dpkg -i ../golang-github-linuxdeepin-go-x11-client.deb ``` ## 用法 go get github.com/linuxdeepin/go-x11-client ## 获得帮助 如果您遇到任何其他问题,您可能还会发现这些渠道很有用: * [Gitter](https://gitter.im/orgs/linuxdeepin/rooms) * [IRC channel](https://webchat.freenode.net/?channels=deepin) * [Forum](https://bbs.deepin.org) * [WiKi](https://wiki.deepin.org/) ## 贡献指南 我们鼓励您报告问题并做出更改 * [Contribution guide for developers](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers-en). (English) * [开发者代码贡献指南](https://github.com/linuxdeepin/developer-center/wiki/Contribution-Guidelines-for-Developers) (中文) ## License go-x11-client项目在 [GPL-3.0-or-later](LICENSE)下发布。 go-x11-client-1.0.2/archlinux/000077500000000000000000000000001460713373000160035ustar00rootroot00000000000000go-x11-client-1.0.2/archlinux/PKGBUILD000066400000000000000000000027321460713373000171330ustar00rootroot00000000000000# Maintainer: justforlxz pkgname=golang-github-linuxdeepin-go-x11-client-git pkgver=0.6.8.r2.g9476531 pkgrel=1 sourcename=go-x11-client pkgsourcename="golang-github-linuxdeepin-go-x11-client" sourcetars=("$pkgsourcename"_"$pkgver".tar.xz) sourcedir="$sourcename" pkgdesc='X11 protocol go language binding' arch=('any') url="https://github.com/linuxdeepin/go-x11-client" license=('GPL') conflicts=('golang-github-linuxdeepin-go-x11-client') provides=('golang-github-linuxdeepin-go-x11-client') groups=('deepin-git') depends=('golang-golang-x-text') makedepends=('git' 'go' 'xorg-server-xvfb' 'golang-github-stretchr-testify' 'golang-gopkg-check.v1' 'golang-gopkg-yaml.v3') checkdepends=('xorg-server-xvfb' 'golang-github-stretchr-testify' 'golang-gopkg-check.v1' 'golang-gopkg-yaml.v3' 'git') source=("${sourcetars[@]}") sha512sums=('SKIP') prepare() { cd $sourcedir rm -rf tools } check() { export GOPATH="$srcdir/build:/usr/share/gocode" export GO111MODULE=off mkdir -p "$srcdir"/build/src/github.com/linuxdeepin cp -a "$srcdir/$sourcedir" "$srcdir"/build/src/github.com/linuxdeepin/go-x11-client cd "$srcdir"/build/src/github.com/linuxdeepin/go-x11-client xvfb-run go test -v $(go list ./...) } package() { mkdir -p "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin cp -a "$srcdir/$sourcedir" "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-x11-client rm -r "$pkgdir"/usr/share/gocode/src/github.com/linuxdeepin/go-x11-client/debian } go-x11-client-1.0.2/atom.go000066400000000000000000000042401460713373000152750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "sync" ) type AtomCache struct { atoms map[string]Atom atomNames map[Atom]string mu sync.RWMutex } func (ac *AtomCache) getVal(name string) (val Atom, ok bool) { ac.mu.RLock() val, ok = ac.atoms[name] ac.mu.RUnlock() return } func (ac *AtomCache) getName(val Atom) (name string, ok bool) { ac.mu.RLock() name, ok = ac.atomNames[val] ac.mu.RUnlock() return } func (ac *AtomCache) store(name string, val Atom) { ac.mu.Lock() ac.atoms[name] = val ac.atomNames[val] = name ac.mu.Unlock() } func NewAtomCache() *AtomCache { ac := &AtomCache{ atoms: make(map[string]Atom), atomNames: make(map[Atom]string), } return ac } var defaultAtomCache *AtomCache var defaultAtomCacheMu sync.Mutex func (c *Conn) getAtomCache() *AtomCache { c.atomCacheMu.Lock() if c.atomCache == nil { // try default atom cache defaultAtomCacheMu.Lock() if defaultAtomCache == nil { defaultAtomCache = NewAtomCache() } c.atomCache = defaultAtomCache defaultAtomCacheMu.Unlock() } v := c.atomCache c.atomCacheMu.Unlock() return v } func (c *Conn) SetAtomCache(ac *AtomCache) { c.atomCacheMu.Lock() c.atomCache = ac c.atomCacheMu.Unlock() } func (c *Conn) GetAtomCache() (ac *AtomCache) { c.atomCacheMu.Lock() ac = c.atomCache c.atomCacheMu.Unlock() return } func (c *Conn) GetAtom(name string) (Atom, error) { return c.getAtom(false, name) } func (c *Conn) GetAtomExisting(name string) (Atom, error) { return c.getAtom(true, name) } func (c *Conn) getAtom(onlyIfExists bool, name string) (Atom, error) { ac := c.getAtomCache() val, ok := ac.getVal(name) if ok { return val, nil } reply, err := InternAtom(c, onlyIfExists, name).Reply(c) if err != nil { return AtomNone, err } ac.store(name, reply.Atom) return reply.Atom, nil } func (c *Conn) GetAtomName(atom Atom) (string, error) { ac := c.getAtomCache() name, ok := ac.getName(atom) if ok { return name, nil } reply, err := GetAtomName(c, atom).Reply(c) if err != nil { return "", err } ac.store(reply.Name, atom) return reply.Name, nil } go-x11-client-1.0.2/auth.go000066400000000000000000000045621460713373000153050ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x /* auth.go contains functions to facilitate the parsing of .Xauthority files. It is largely unmodified from the original XGB package that I forked. */ import ( "encoding/binary" "errors" "io" "os" ) // readAuthority reads the X authority file for the DISPLAY. // If hostname == "" or hostname == "localhost", // then use the system's hostname (as returned by os.Hostname) instead. func readAuthority(hostname, display string) ( name string, data []byte, err error) { // b is a scratch buffer to use and should be at least 256 bytes long // (i.e. it should be able to hold a hostname). b := make([]byte, 256) // As per /usr/include/X11/Xauth.h. const familyLocal = 256 const familyWild = 65535 if len(hostname) == 0 || hostname == "localhost" { hostname, err = os.Hostname() if err != nil { return "", nil, err } } fname := os.Getenv("XAUTHORITY") if len(fname) == 0 { home := os.Getenv("HOME") if len(home) == 0 { err = errors.New("Xauthority not found: $XAUTHORITY, $HOME not set") return "", nil, err } fname = home + "/.Xauthority" } r, err := os.Open(fname) if err != nil { return "", nil, err } defer r.Close() for { var family uint16 if err := binary.Read(r, binary.BigEndian, &family); err != nil { return "", nil, err } addr, err := getString(r, b) if err != nil { return "", nil, err } disp, err := getString(r, b) if err != nil { return "", nil, err } name0, err := getString(r, b) if err != nil { return "", nil, err } data0, err := getBytes(r, b) if err != nil { return "", nil, err } addrmatch := (family == familyWild) || (family == familyLocal && addr == hostname) dispmatch := (disp == "") || (disp == display) if addrmatch && dispmatch { return name0, data0, nil } } } func getBytes(r io.Reader, b []byte) ([]byte, error) { var n uint16 if err := binary.Read(r, binary.BigEndian, &n); err != nil { return nil, err } else if n > uint16(len(b)) { return nil, errors.New("bytes too long for buffer") } if _, err := io.ReadFull(r, b[0:n]); err != nil { return nil, err } return b[0:n], nil } func getString(r io.Reader, b []byte) (string, error) { b, err := getBytes(r, b) if err != nil { return "", err } return string(b), nil } go-x11-client-1.0.2/client_message_data.go000066400000000000000000000022321460713373000203070ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x type ClientMessageData struct { data []byte } func ClientMessageDataRead(r *Reader, v *ClientMessageData) int { v.data = r.MustReadBytes(20) return 20 } func writeClientMessageData(w *Writer, v *ClientMessageData) int { w.WriteNBytes(20, v.data) return 20 } func (v *ClientMessageData) GetData8() []byte { return v.data } func (v *ClientMessageData) GetData16() []uint16 { ret := make([]uint16, 10) idx := 0 for i := 0; i < 20; i += 2 { ret[idx] = Get16(v.data[i : i+2]) idx++ } return ret } func (v *ClientMessageData) GetData32() []uint32 { ret := make([]uint32, 5) idx := 0 for i := 0; i < 20; i += 4 { ret[idx] = Get32(v.data[i : i+4]) idx++ } return ret } func (v *ClientMessageData) SetData8(p *[20]byte) { v.data = p[:] } func (v *ClientMessageData) SetData16(p *[10]uint16) { w := NewWriter() for i := 0; i < 10; i++ { w.Write2b(p[i]) } v.data = w.Bytes() } func (v *ClientMessageData) SetData32(p *[5]uint32) { w := NewWriter() for i := 0; i < 5; i++ { w.Write4b(p[i]) } v.data = w.Bytes() } go-x11-client-1.0.2/conn.go000066400000000000000000000037301460713373000152750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "bufio" "errors" "fmt" "log" "net" "os" "sync" "sync/atomic" ) var Logger *log.Logger var debugEnabled bool func init() { if os.Getenv("DEBUG_X11_CLIENT") == "1" { debugEnabled = true Logger = log.New(os.Stderr, "[x] ", log.Lshortfile) } } func logPrintln(v ...interface{}) { if debugEnabled { _ = Logger.Output(2, fmt.Sprintln(v...)) } } func logPrintf(format string, v ...interface{}) { if debugEnabled { _ = Logger.Output(2, fmt.Sprintf(format, v...)) } } type Conn struct { conn net.Conn closed int32 bufReader *bufio.Reader host string display string DisplayNumber int ScreenNumber int setup *Setup ioMu sync.Mutex in in out out ext ext ridAllocator resourceIdAllocator atomCache *AtomCache atomCacheMu sync.Mutex errorCb func(err *Error) } func (c *Conn) GetSetup() *Setup { return c.setup } func (c *Conn) GetDefaultScreen() *Screen { return &c.setup.Roots[c.ScreenNumber] } func (c *Conn) isClosed() bool { return 1 == atomic.LoadInt32(&c.closed) } func (c *Conn) markClosed() { atomic.StoreInt32(&c.closed, 1) } func (c *Conn) Close() { if c.isClosed() { return } c.markClosed() c.conn.Close() c.in.eventsCond.Signal() go func() { c.ioMu.Lock() c.in.wakeUpAllReaders() c.ioMu.Unlock() }() } var errConnClosed = errors.New("conn closed") func (c *Conn) AddEventChan(eventChan chan<- GenericEvent) { if c.isClosed() || eventChan == nil { return } c.in.addEventChan(eventChan) } func (c *Conn) RemoveEventChan(eventChan chan<- GenericEvent) { if eventChan == nil { return } c.in.removeEventChan(eventChan) } func (c *Conn) SetErrorCallback(fn func(err *Error)) { c.errorCb = fn } func (c *Conn) MakeAndAddEventChan(bufSize int) chan GenericEvent { ch := make(chan GenericEvent, bufSize) c.AddEventChan(ch) return ch } go-x11-client-1.0.2/conn_connect.go000066400000000000000000000106641460713373000170120ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "bufio" "errors" "fmt" "io" "net" "os" "strconv" "strings" ) func NewConn() (*Conn, error) { return NewConnDisplay("") } func NewConnDisplay(display string) (*Conn, error) { c := new(Conn) err := c.connectDisplay(display) if err != nil { return nil, err } c.bufReader = bufio.NewReader(c.conn) c.in.init(&c.ioMu) c.out.bw = bufio.NewWriter(c.conn) c.ridAllocator.init(c.setup.ResourceIdBase, c.setup.ResourceIdMask) go c.readLoop() go c.eventSendLoop() return c, nil } func (c *Conn) connectDisplay(display string) error { err := c.dial(display) if err != nil { return err } return c.postConnect() } // dial initializes the actual net connection with X. func (c *Conn) dial(display string) error { if len(display) == 0 { display = os.Getenv("DISPLAY") } display0 := display if len(display) == 0 { return errors.New("empty display string") } colonIdx := strings.LastIndex(display, ":") if colonIdx < 0 { return errors.New("bad display string: " + display0) } var protocol, socket string if display[0] == '/' { socket = display[0:colonIdx] } else { slashIdx := strings.LastIndex(display, "/") if slashIdx >= 0 { protocol = display[0:slashIdx] c.host = display[slashIdx+1 : colonIdx] } else { c.host = display[0:colonIdx] } } display = display[colonIdx+1:] if len(display) == 0 { return errors.New("bad display string: " + display0) } var scr string dotIdx := strings.LastIndex(display, ".") if dotIdx < 0 { c.display = display[0:] } else { c.display = display[0:dotIdx] scr = display[dotIdx+1:] } var err error c.DisplayNumber, err = strconv.Atoi(c.display) if err != nil || c.DisplayNumber < 0 { return errors.New("bad display string: " + display0) } if scr != "" { c.ScreenNumber, err = strconv.Atoi(scr) if err != nil { return errors.New("bad display string: " + display0) } } logPrintf("socket: %q, protocol: %q\n", socket, protocol) // Connect to server if len(socket) != 0 { c.conn, err = net.Dial("unix", socket+":"+c.display) } else if len(c.host) != 0 { if protocol == "" { protocol = "tcp" } logPrintln("dial tcp") c.conn, err = net.Dial(protocol, c.host+":"+strconv.Itoa(6000+c.DisplayNumber)) } else { logPrintln("dial unix") c.conn, err = net.Dial("unix", "/tmp/.X11-unix/X"+c.display) } if err != nil { return errors.New("cannot connect to " + display0 + ": " + err.Error()) } return nil } // do the postConnect action after Conn get it's underly net.Conn func (c *Conn) postConnect() error { // Get authentication data authName, authData, err := readAuthority(c.host, c.display) noAuth := false if err != nil { logPrintf("Could not get authority info: %v", err) logPrintln("Trying connection without authority info...") authName = "" authData = []byte{} noAuth = true } // Assume that the authentication protocol is "MIT-MAGIC-COOKIE-1". if !noAuth && (authName != "MIT-MAGIC-COOKIE-1" || len(authData) != 16) { return errors.New("unsupported auth protocol " + authName) } bufLen := 12 + len(authName) + Pad(len(authName)) + len(authData) + Pad(len(authData)) buf := make([]byte, bufLen) buf[0] = 0x6c buf[1] = 0 Put16(buf[2:], 11) Put16(buf[4:], 0) Put16(buf[6:], uint16(len(authName))) Put16(buf[8:], uint16(len(authData))) Put16(buf[10:], 0) copy(buf[12:], []byte(authName)) copy(buf[12+len(authName)+Pad(len(authName)):], authData) if _, err = c.conn.Write(buf); err != nil { return err } head := make([]byte, 8) if _, err = io.ReadFull(c.conn, head[0:8]); err != nil { return err } respType := head[0] major := Get16(head[2:]) minor := Get16(head[4:]) dataLen := Get16(head[6:]) if major != 11 || minor != 0 { return fmt.Errorf("x protocol version mismatch: %d.%d", major, minor) } buf = make([]byte, 8+dataLen*4) copy(buf, head) if _, err = io.ReadFull(c.conn, buf[8:]); err != nil { return err } if respType == ResponseTypeError { reasonLen := head[1] reason := buf[8 : 8+reasonLen] return fmt.Errorf("x protocol authentication refused: %s", string(reason)) } var setup Setup r := NewReaderFromData(buf) err = readSetup(r, &setup) if err != nil { return err } c.setup = &setup /* Make sure requested screen number is in bounds for this server */ if c.ScreenNumber >= len(setup.Roots) { return errors.New("invalid screen") } return nil } go-x11-client-1.0.2/conn_in.go000066400000000000000000000170141460713373000157630ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "container/list" "io" "sync" ) const ( ResponseTypeError = 0 ResponseTypeReply = 1 ) //enum xcb_send_request_flags_t { //XCB_REQUEST_CHECKED = 1 << 0, //XCB_REQUEST_RAW = 1 << 1, //XCB_REQUEST_DISCARD_REPLY = 1 << 2, //XCB_REQUEST_REPLY_FDS = 1 << 3 //}; const ( RequestChecked = 1 << 0 RequestRaw = 1 << 1 // ? RequestDiscardReply = 1 << 2 RequestReplyFds = 1 << 3 // ? ) //typedef struct { //uint8_t response_type; [>*< Type of the response <] //uint8_t pad0; [>*< Padding <] //uint16_t sequence; [>*< Sequence number <] //uint32_t length; [>*< Length of the response <] //} xcb_generic_reply_t; type GenericReply struct { responseType uint8 sequence uint16 length uint32 } func NewGenericReply(buf []byte) *GenericReply { r := &GenericReply{} r.responseType = buf[0] // skip pad buf[1] r.sequence = Get16(buf[2:]) r.length = Get32(buf[4:]) return r } // go c.readLoop func (c *Conn) readLoop() { for { err := c.readPacket() if err != nil { c.Close() return } } } func (c *Conn) readPacket() error { length := 32 buf := make([]byte, length) _, err := io.ReadFull(c.bufReader, buf) if err != nil { return err } genReply := NewGenericReply(buf) logPrintf("genReply: %#v\n", genReply) if (genReply.responseType == ResponseTypeReply || genReply.responseType == GeGenericEventCode) && genReply.length > 0 { length += int(genReply.length) * 4 // grow buf biggerBuf := make([]byte, length) copy(biggerBuf[:32], buf) _, err = io.ReadFull(c.bufReader, biggerBuf[32:]) if err != nil { return err } buf = biggerBuf } c.ioMu.Lock() defer c.ioMu.Unlock() // update c.in.request* // KeymapNotifyEvent 没有 sequence if genReply.responseType != KeymapNotifyEventCode { lastRead := c.in.requestRead c.in.requestRead = (lastRead & 0xffffffffffff0000) | SeqNum(genReply.sequence) if c.in.requestRead < lastRead { c.in.requestRead += 0x10000 } if c.in.requestRead > c.in.requestExpected { c.in.requestExpected = c.in.requestRead } if c.in.requestRead != lastRead { // 这个 reply 是对一个新的请求的 reply curReply := c.in.currentReply if curReply != nil && curReply.Len() != 0 { c.in.replies[lastRead] = curReply c.in.currentReply = nil } c.in.requestCompleted = c.in.requestRead - 1 } c.in.removeFinishedPendingReplies() if genReply.responseType == ResponseTypeError { c.in.requestCompleted = c.in.requestRead } c.in.removeFinishedReaders() } var pend *PendingReply if genReply.responseType == ResponseTypeReply || genReply.responseType == ResponseTypeError { if prFront := c.in.pendingReplies.Front(); prFront != nil { pend = prFront.Value.(*PendingReply) if !(pend.firstRequest <= c.in.requestRead && c.in.requestRead <= pend.lastRequest) { pend = nil } } } logPrintf("pend %#v\n", pend) if pend != nil && pend.flags&RequestDiscardReply != 0 { // discard reply logPrintln("discard reply", c.in.requestRead) return nil } /* reply, or checked error */ if genReply.responseType == ResponseTypeReply || (genReply.responseType == ResponseTypeError && pend != nil && pend.flags&RequestChecked != 0) { if c.in.currentReply == nil { c.in.currentReply = list.New() } c.in.currentReply.PushBack(buf) logPrintf("pushBack buf %d len=%d\n", c.in.requestRead, len(buf)) front := c.in.readers.Front() if front != nil { reader := front.Value.(*ReplyReader) if reader.request == c.in.requestRead { logPrintf("readPacket reader %d signal\n", reader.request) reader.cond.Signal() } } return nil } /* event, or unchecked error */ // not special event if genReply.responseType == ResponseTypeError { // is unchecked error if c.errorCb != nil { c.errorCb(c.NewError(buf)) } else { c.in.addEvent(GenericEvent(buf)) } } else { // is event c.in.addEvent(GenericEvent(buf)) } return nil } func (c *Conn) pollForReply(request SeqNum) (replyBuf []byte, isErr, stop bool) { if c.isClosed() { stop = true return } logPrintln("pollForReply", request) var front *list.Element if request < c.in.requestRead { /* We've read requests past the one we want, so if it has replies we have * them all and they're in the replies map. */ l := c.in.replies[request] logPrintln("reply in replies map") if l != nil { // pop front front = l.Front() if front != nil { l.Remove(front) } if l.Len() == 0 { delete(c.in.replies, request) } } } else if request == c.in.requestRead && c.in.currentReply != nil && c.in.currentReply.Front() != nil { /* We're currently processing the responses to the request we want, and we * have a reply ready to return. So just return it without blocking. */ logPrintln("reply in currentReply") front = c.in.currentReply.Front() c.in.currentReply.Remove(front) } else if request == c.in.requestCompleted { /* We know this request can't have any more replies, and we've already * established it doesn't have a reply now. Don't bother blocking. */ logPrintln("request completed") stop = true return } else { /* We may have more replies on the way for this request: block until we're sure. */ // stop = false return } if front != nil { replyBuf = front.Value.([]byte) respType := replyBuf[0] if respType == ResponseTypeError { isErr = true } } stop = true return } func (c *Conn) waitForReply(request SeqNum) (replyBuf []byte, err error) { err = c.out.flushTo(request) if err != nil { c.Close() return nil, err } cond := sync.NewCond(&c.ioMu) r := c.in.insertNewReader(request, cond) var isErr bool var stop bool for { replyBuf, isErr, stop = c.pollForReply(request) if stop { break } logPrintf("waitForReply reader %d wait\n", request) cond.Wait() } if c.isClosed() { return nil, errConnClosed } c.in.removeReader(r) c.in.wakeUpNextReader() if isErr { return nil, c.NewError(replyBuf) } return replyBuf, nil } func (c *Conn) WaitForReply(request SeqNum) (replyBuf []byte, err error) { if c.isClosed() { return nil, errConnClosed } err = request.err() if err != nil { return nil, err } c.ioMu.Lock() replyBuf, err = c.waitForReply(request) c.ioMu.Unlock() return } type VoidCookie SeqNum func (cookie VoidCookie) Check(c *Conn) error { if c.isClosed() { return errConnClosed } err := SeqNum(cookie).err() if err != nil { return err } return c.requestCheck(SeqNum(cookie)) } func (c *Conn) requestCheck(request SeqNum) error { c.ioMu.Lock() if request >= c.in.requestExpected && request > c.in.requestCompleted { // send sync request c.sendSync() err := c.out.flushTo(c.out.request) if err != nil { c.ioMu.Unlock() return err } } replyBuf, err := c.waitForReply(request) c.ioMu.Unlock() if err != nil { return err } else { // if not err, replyBuf must be nil if replyBuf != nil { panic("replyBuf is not nil") } } return nil } func (c *Conn) pollForEvent() (ev GenericEvent) { f := c.in.events.Front() if f != nil { ev = f.Value.(GenericEvent) c.in.events.Remove(f) } return } func (c *Conn) waitForEvent() (ev GenericEvent) { for { if c.isClosed() { return nil } ev = c.pollForEvent() if ev != nil { break } c.in.eventsCond.Wait() } return ev } func (c *Conn) eventSendLoop() { for { c.ioMu.Lock() ev := c.waitForEvent() c.ioMu.Unlock() if ev == nil { c.in.closeEventChans() return } c.in.sendEvent(ev) } } go-x11-client-1.0.2/conn_out.go000066400000000000000000000131531460713373000161640ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "bufio" "errors" "io" "math" ) func (c *Conn) Flush() (err error) { c.ioMu.Lock() err = c.out.flushTo(c.out.request) c.ioMu.Unlock() if err != nil { c.Close() } return } func (c *Conn) sendSync() { header := RequestHeader{ Opcode: GetInputFocusOpcode, Length: 4, } logPrintln("sendSync") c.sendRequest(false, 0, RequestDiscardReply, header.toBytes(), nil) } func (c *Conn) SendSync() { c.ioMu.Lock() c.sendSync() c.ioMu.Unlock() } // sequence number type SeqNum uint64 const ( seqNumConnClosed SeqNum = 0 seqNumExtNotPresent SeqNum = math.MaxUint64 - iota seqNumQueryExtErr ) var errExtNotPresent = errors.New("extension not present") var errQueryExtErr = errors.New("query extension error") func (n SeqNum) err() error { switch n { case seqNumConnClosed: return errConnClosed case seqNumExtNotPresent: return errExtNotPresent case seqNumQueryExtErr: return errQueryExtErr default: return nil } } type out struct { request SeqNum requestWritten SeqNum bw *bufio.Writer } func (o *out) flushTo(request SeqNum) error { if !(request <= o.request) { panic("assert request < o.request failed") } if o.requestWritten >= request { return nil } logPrintln("flushTo", request) err := o.bw.Flush() if err != nil { return err } o.requestWritten = o.request return nil } func (c *Conn) writeRequest(header []byte, body RequestBody) error { _, err := c.out.bw.Write(header) if err != nil { return err } var emptyBuf [3]byte for _, data := range body { _, err = c.out.bw.Write(data) if err != nil { return err } pad := Pad(len(data)) if pad > 0 { _, err = c.out.bw.Write(emptyBuf[:pad]) if err != nil { return err } } } return nil } func (c *Conn) sendRequest(noReply bool, workaround uint, flags uint, header []byte, body RequestBody) { if c.isClosed() { return } c.out.request++ if !noReply { // has reply c.in.requestExpected = c.out.request } logPrintln("sendRequest seq:", c.out.request) if workaround != 0 || flags != 0 { c.in.expectReply(c.out.request, workaround, flags) } err := c.writeRequest(header, body) if err != nil { logPrintln("write error:", err) c.Close() return } if c.out.bw.Buffered() == 0 { // write all the data of request to c.conn c.out.requestWritten = c.out.request } } type ProtocolRequest struct { Ext *Extension NoReply bool Header RequestHeader Body RequestBody } // return sequence id func (c *Conn) SendRequest(flags uint, req *ProtocolRequest) SeqNum { if c.isClosed() { return seqNumConnClosed } // process data auto field // set the major opcode, and the minor opcode for extensions if req.Ext != nil { extension := c.GetExtensionData(req.Ext) if extension == nil { return seqNumQueryExtErr } if !extension.Present { return seqNumExtNotPresent } req.Header.Opcode = extension.MajorOpcode } var requestLen uint64 requestLen = 4 for _, data := range req.Body { requestLen += uint64(len(data)) requestLen += uint64(Pad(len(data))) } req.Header.Length = requestLen header := req.Header.toBytes() c.ioMu.Lock() c.sendRequest(req.NoReply, 0, flags, header, req.Body) request := c.out.request c.ioMu.Unlock() return request } type RequestHeader struct { Opcode uint8 // major opcode Data uint8 // data or minor opcode Length uint64 // unit is byte } func (rh RequestHeader) toBytes() []byte { b := make([]byte, 4) b[0] = rh.Opcode b[1] = rh.Data if rh.Length&3 != 0 { panic("length is not a multiple of 4") } length := uint16(rh.Length) length >>= 2 b[2] = byte(length) b[3] = byte(length >> 8) return b } type FixedSizeBuf struct { data []byte offset int } func (b *FixedSizeBuf) Write1b(v uint8) *FixedSizeBuf { b.data[b.offset] = v b.offset++ return b } // byte order: least significant byte first func (b *FixedSizeBuf) Write2b(v uint16) *FixedSizeBuf { b.data[b.offset] = byte(v) b.data[b.offset+1] = byte(v >> 8) b.offset += 2 return b } func (b *FixedSizeBuf) Write4b(v uint32) *FixedSizeBuf { b.data[b.offset] = byte(v) b.data[b.offset+1] = byte(v >> 8) b.data[b.offset+2] = byte(v >> 16) b.data[b.offset+3] = byte(v >> 24) b.offset += 4 return b } func (b *FixedSizeBuf) Write8b(v uint64) *FixedSizeBuf { b.data[b.offset] = byte(v) b.data[b.offset+1] = byte(v >> 8) b.data[b.offset+2] = byte(v >> 16) b.data[b.offset+3] = byte(v >> 24) b.data[b.offset+4] = byte(v >> 32) b.data[b.offset+5] = byte(v >> 40) b.data[b.offset+6] = byte(v >> 48) b.data[b.offset+7] = byte(v >> 56) b.offset += 8 return b } func (b *FixedSizeBuf) WritePad(n int) *FixedSizeBuf { b.offset += n return b } func (b *FixedSizeBuf) WriteString(s string) *FixedSizeBuf { n := copy(b.data[b.offset:], s) b.offset += n if n != len(s) { panic(io.ErrShortWrite) } return b } func (b *FixedSizeBuf) WriteBytes(p []byte) *FixedSizeBuf { n := copy(b.data[b.offset:], p) b.offset += n if n != len(p) { panic(io.ErrShortWrite) } return b } func (b *FixedSizeBuf) WriteBool(v bool) *FixedSizeBuf { return b.Write1b(BoolToUint8(v)) } func (b *FixedSizeBuf) End() { if len(b.data) != b.offset { panic("not end") } } func (b *FixedSizeBuf) Bytes() []byte { return b.data } func NewFixedSizeBuf(size int) *FixedSizeBuf { return &FixedSizeBuf{ data: make([]byte, size), } } type RequestBody [][]byte func (rb *RequestBody) AddBlock(n int) *FixedSizeBuf { b := NewFixedSizeBuf(n * 4) *rb = append(*rb, b.data) return b } func (rb *RequestBody) AddBytes(data []byte) { *rb = append(*rb, data) } go-x11-client-1.0.2/const.go000066400000000000000000000010001460713373000154520ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x const ( // None is the universal null resource or null atom parameter value for many core X requests None = 0 // CurrentTime can be used in most requests that take an Timestamp CurrentTime = 0 // NoSymbol fills in unused entries in Keysym tables NoSymbol = 0 // CopyFromParent can be used for many CreateWindow parameters */ CopyFromParent = 0 True = 1 False = 0 ) go-x11-client-1.0.2/debian/000077500000000000000000000000001460713373000152305ustar00rootroot00000000000000go-x11-client-1.0.2/debian/changelog000066400000000000000000000015341460713373000171050ustar00rootroot00000000000000golang-github-linuxdeepin-go-x11-client (1.0.2) unstable; urgency=medium * Add GrabCheckedV2 -- quezhiyong Fri, 12 Apr 2024 13:17:30 +0800 golang-github-linuxdeepin-go-x11-client (1.0.1) unstable; urgency=medium * modify changelog for V23 beta -- linxin Wed, 29 Mar 2023 11:46:38 +0800 golang-github-linuxdeepin-go-x11-client (1.0.0.0) unstable; urgency=medium * release 1.0.0.0 -- Tue, 14 June 2022 17:11:13 +0800 golang-github-linuxdeepin-go-x11-client (0.0.3) unstable; urgency=medium * adapt license and copyright -- dengbo Wed, 14 Sep 2022 16:27:01 +0000 golang-github-linuxdeepin-go-x11-client (0.0.2-1) unstable; urgency=medium * update -- Deepin Packages Builder Fri, 15 Dec 2017 17:12:00 +0800 go-x11-client-1.0.2/debian/compat000066400000000000000000000000031460713373000164270ustar00rootroot0000000000000010 go-x11-client-1.0.2/debian/control000066400000000000000000000015311460713373000166330ustar00rootroot00000000000000Source: golang-github-linuxdeepin-go-x11-client Section: devel Priority: extra Maintainer: Deepin Packages Builder Build-Depends: debhelper (>= 10), dh-golang, golang-any, golang-gopkg-check.v1-dev, golang-golang-x-text-dev (>=0.0~git20161013), golang-github-stretchr-testify-dev (>=1.1.4) Standards-Version: 4.0.0 Homepage: https://github.com/linuxdeepin/go-x11-client XS-Go-Import-Path: github.com/linuxdeepin/go-x11-client Testsuite: autopkgtest-pkg-go Package: golang-github-linuxdeepin-go-x11-client-dev Architecture: all Depends: ${shlibs:Depends}, ${misc:Depends}, golang-github-gavv-monotime-dev, golang-gopkg-check.v1-dev Description: deepin go x11 client mirrored from https://cr.deepin.io/#/admin/projects/go-x11-client go-x11-client-1.0.2/debian/copyright000066400000000000000000000016471460713373000171730ustar00rootroot00000000000000Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: go-x11-client Files: * Copyright: 2017 Deepin Technology Co., Ltd. License: GPL-3+ This package 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 package 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 . On Debian systems, the complete text of the GNU General Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". go-x11-client-1.0.2/debian/gbp.conf000066400000000000000000000000361460713373000166460ustar00rootroot00000000000000[DEFAULT] pristine-tar = True go-x11-client-1.0.2/debian/rules000077500000000000000000000004361460713373000163130ustar00rootroot00000000000000#!/usr/bin/make -f export GOCACHE := /tmp/gocache export DH_GOLANG_EXCLUDES := tools/gen util/tool/gen-keysymdef ifeq ($(DEB_BUILD_ARCH),sw_64) %: dh $@ else %: dh $@ --buildsystem=golang --with=golang endif override_dh_auto_clean: dh_auto_clean -- rm -fr obj-x86_64-linux-gnu go-x11-client-1.0.2/debian/source/000077500000000000000000000000001460713373000165305ustar00rootroot00000000000000go-x11-client-1.0.2/debian/source/format000066400000000000000000000000151460713373000177370ustar00rootroot000000000000003.0 (native) go-x11-client-1.0.2/debian/watch000066400000000000000000000004131460713373000162570ustar00rootroot00000000000000version=3 opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/golang-github-linuxdeepin-go-x11-client-\$1\.tar\.gz/,\ uversionmangle=s/(\d)[_\.\-\+]?(RC|rc|pre|dev|beta|alpha)[.]?(\d*)$/\$1~\$2\$3/ \ https://github.com/linuxdeepin/go-x11-client/tags .*/v?(\d\S*)\.tar\.gz go-x11-client-1.0.2/error.go000066400000000000000000000036211460713373000154700ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import "fmt" type Error struct { conn *Conn Code uint8 // ErrorCode Sequence uint16 // Sequence number ResourceID uint32 // Resource ID for requests with side effects only MinorCode uint16 // Minor opcode of the failed request MajorCode uint8 // Major opcode of the failed request } func (err *Error) Error() string { var errDesc string var errName string if 1 <= err.Code && err.Code <= 127 { // core error code in range [1,127] errName = errorCodeNameMap[err.Code] } else { // is ext error errName = err.conn.ext.getExtErrName(err.Code) } if errName != "" { errDesc = " (" + errName + ")" } var majorCodeDesc, minorCodeDesc string if 1 <= err.MajorCode && err.MajorCode <= 127 { // is core request reqName := requestOpcodeNameMap[uint(err.MajorCode)] if reqName != "" { majorCodeDesc = " (" + reqName + ")" } } else { // is ext request ext := err.conn.ext.getExtByMajorOpcode(err.MajorCode) if ext != nil { reqName := ext.reqOpcodeNameMap[uint(err.MinorCode)] if reqName != "" { minorCodeDesc = " (" + reqName + ")" } majorCodeDesc = " (" + ext.name + ")" } } return fmt.Sprintf("x.Error: %d%s, sequence: %d, resource id: %d,"+ " major code: %d%s, minor code: %d%s", err.Code, errDesc, err.Sequence, err.ResourceID, err.MajorCode, majorCodeDesc, err.MinorCode, minorCodeDesc) } func newError(data []byte) *Error { var v Error responseType := data[0] if responseType != ResponseTypeError { panic("not error") } b := 1 v.Code = data[b] b += 1 v.Sequence = Get16(data[b:]) b += 2 v.ResourceID = Get32(data[b:]) b += 4 v.MinorCode = Get16(data[b:]) b += 2 v.MajorCode = data[b] return &v } func (c *Conn) NewError(data []byte) *Error { err := newError(data) err.conn = c return err } go-x11-client-1.0.2/event.go000066400000000000000000000007001460713373000154530ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "fmt" ) type GenericEvent []byte func (ge GenericEvent) GetEventCode() uint8 { return ge[0] &^ 0x80 } func (ge GenericEvent) Real() bool { return ge[0]&0x80 == 0 } func (ge GenericEvent) String() string { return fmt.Sprintf("GenericEvent{ EventCode: %d, Real: %v }", ge.GetEventCode(), ge.Real()) } go-x11-client-1.0.2/ext/000077500000000000000000000000001460713373000146065ustar00rootroot00000000000000go-x11-client-1.0.2/ext/bigrequests/000077500000000000000000000000001460713373000171435ustar00rootroot00000000000000go-x11-client-1.0.2/ext/bigrequests/auto.go000066400000000000000000000010351460713373000204410ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package bigrequests import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: BigRequests const MajorVersion = 0 const MinorVersion = 0 var _ext *x.Extension func Ext() *x.Extension { return _ext } const EnableOpcode = 0 type EnableCookie x.SeqNum var requestOpcodeNameMap = map[uint]string{ EnableOpcode: "Enable", } func init() { _ext = x.NewExtension("BIG-REQUESTS", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/bigrequests/bigreq.go000066400000000000000000000007601460713373000207460ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package bigrequests import "github.com/linuxdeepin/go-x11-client" // #WREQ func encodeEnable() (b x.RequestBody) { return } type EnableReply struct { MaximumRequestLength uint32 } func readEnableReply(r *x.Reader, v *EnableReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.MaximumRequestLength = r.Read4b() // 3 return nil } go-x11-client-1.0.2/ext/bigrequests/bigreq_req_auto.go000066400000000000000000000013721460713373000226450ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package bigrequests import x "github.com/linuxdeepin/go-x11-client" func Enable(conn *x.Conn) EnableCookie { body := encodeEnable() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: EnableOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return EnableCookie(seq) } func (cookie EnableCookie) Reply(conn *x.Conn) (*EnableReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply EnableReply err = readEnableReply(r, &reply) if err != nil { return nil, err } return &reply, nil } go-x11-client-1.0.2/ext/composite/000077500000000000000000000000001460713373000166105ustar00rootroot00000000000000go-x11-client-1.0.2/ext/composite/auto.go000066400000000000000000000026221460713373000201110ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package composite import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Composite const MajorVersion = 0 const MinorVersion = 4 var _ext *x.Extension func Ext() *x.Extension { return _ext } // enum Redirect const ( RedirectAutomatic = 0 RedirectManual = 1 ) const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const RedirectWindowOpcode = 1 const RedirectSubwindowsOpcode = 2 const UnredirectWindowOpcode = 3 const UnredirectSubwindowsOpcode = 4 const CreateRegionFromBorderClipOpcode = 5 const NameWindowPixmapOpcode = 6 const GetOverlayWindowOpcode = 7 type GetOverlayWindowCookie x.SeqNum const ReleaseOverlayWindowOpcode = 8 var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", RedirectWindowOpcode: "RedirectWindow", RedirectSubwindowsOpcode: "RedirectSubwindows", UnredirectWindowOpcode: "UnredirectWindow", UnredirectSubwindowsOpcode: "UnredirectSubwindows", CreateRegionFromBorderClipOpcode: "CreateRegionFromBorderClip", NameWindowPixmapOpcode: "NameWindowPixmap", GetOverlayWindowOpcode: "GetOverlayWindow", ReleaseOverlayWindowOpcode: "ReleaseOverlayWindow", } func init() { _ext = x.NewExtension("Composite", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/composite/composite.go000066400000000000000000000027141460713373000211450ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package composite import "github.com/linuxdeepin/go-x11-client" // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(majorVersion). Write4b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion uint32 MinorVersion uint32 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read4b() v.MinorVersion = r.Read4b() // 4 return nil } // #WREQ func encodeRedirectWindow(window x.Window, update uint8) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write1b(update). WritePad(3). End() return } // #WREQ func encodeRedirectSubwindows(window x.Window, update uint8) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write1b(update). WritePad(3). End() return } // #WREQ func encodeUnredirectWindow(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeUnredirectSubwindows(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeNameWindowPixmap(window x.Window, pixmap x.Pixmap) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(uint32(pixmap)). End() return } go-x11-client-1.0.2/ext/composite/composite_req_auto.go000066400000000000000000000077311460713373000230500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package composite import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint32) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func RedirectWindow(conn *x.Conn, window x.Window, update uint8) { body := encodeRedirectWindow(window, update) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RedirectWindowOpcode, }, Body: body, } conn.SendRequest(0, req) } func RedirectWindowChecked(conn *x.Conn, window x.Window, update uint8) x.VoidCookie { body := encodeRedirectWindow(window, update) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RedirectWindowOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func RedirectSubwindows(conn *x.Conn, window x.Window, update uint8) { body := encodeRedirectSubwindows(window, update) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RedirectSubwindowsOpcode, }, Body: body, } conn.SendRequest(0, req) } func RedirectSubwindowsChecked(conn *x.Conn, window x.Window, update uint8) x.VoidCookie { body := encodeRedirectSubwindows(window, update) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RedirectSubwindowsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func UnredirectWindow(conn *x.Conn, window x.Window) { body := encodeUnredirectWindow(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnredirectWindowOpcode, }, Body: body, } conn.SendRequest(0, req) } func UnredirectWindowChecked(conn *x.Conn, window x.Window) x.VoidCookie { body := encodeUnredirectWindow(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnredirectWindowOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func UnredirectSubwindows(conn *x.Conn, window x.Window) { body := encodeUnredirectSubwindows(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnredirectSubwindowsOpcode, }, Body: body, } conn.SendRequest(0, req) } func UnredirectSubwindowsChecked(conn *x.Conn, window x.Window) x.VoidCookie { body := encodeUnredirectSubwindows(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnredirectSubwindowsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func NameWindowPixmap(conn *x.Conn, window x.Window, pixmap x.Pixmap) { body := encodeNameWindowPixmap(window, pixmap) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: NameWindowPixmapOpcode, }, Body: body, } conn.SendRequest(0, req) } func NameWindowPixmapChecked(conn *x.Conn, window x.Window, pixmap x.Pixmap) x.VoidCookie { body := encodeNameWindowPixmap(window, pixmap) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: NameWindowPixmapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/damage/000077500000000000000000000000001460713373000160245ustar00rootroot00000000000000go-x11-client-1.0.2/ext/damage/auto.go000066400000000000000000000024571460713373000173330ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package damage import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Damage const MajorVersion = 1 const MinorVersion = 1 var _ext *x.Extension func Ext() *x.Extension { return _ext } // simple ('xcb', 'Damage', 'DAMAGE') type Damage uint32 // enum ReportLevel const ( ReportLevelRawRectangles = 0 ReportLevelDeltaRectangles = 1 ReportLevelBoundingBox = 2 ReportLevelNonEmpty = 3 ) const BadDamageErrorCode = 0 const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const CreateOpcode = 1 const DestroyOpcode = 2 const SubtractOpcode = 3 const AddOpcode = 4 const NotifyEventCode = 0 func NewNotifyEvent(data []byte) (*NotifyEvent, error) { var ev NotifyEvent r := x.NewReaderFromData(data) err := readNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } var errorCodeNameMap = map[uint8]string{ BadDamageErrorCode: "BadDamage", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", CreateOpcode: "Create", DestroyOpcode: "Destroy", SubtractOpcode: "Subtract", AddOpcode: "Add", } func init() { _ext = x.NewExtension("DAMAGE", 0, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/damage/damage.go000066400000000000000000000030561460713373000175750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package damage import ( x "github.com/linuxdeepin/go-x11-client" ) type NotifyEvent struct { Level uint8 Sequence uint16 Drawable x.Drawable Damage Damage Timestamp x.Timestamp Area x.Rectangle Geometry x.Rectangle } func readNotifyEvent(r *x.Reader, v *NotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Level, v.Sequence = r.ReadEventHeader() v.Drawable = x.Drawable(r.Read4b()) v.Damage = Damage(r.Read4b()) v.Timestamp = x.Timestamp(r.Read4b()) // 4 v.Area = x.ReadRectangle(r) // 6 v.Geometry = x.ReadRectangle(r) // 8 return nil } // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(majorVersion). Write4b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion uint32 MinorVersion uint32 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read4b() v.MinorVersion = r.Read4b() // 4 return nil } // #WREQ func encodeCreate(damage Damage, drawable x.Drawable, level uint8) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(damage)). Write4b(uint32(drawable)). Write1b(level). WritePad(3). End() return } // #WREQ func encodeDestroy(damage Damage) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(damage)). End() return } // #WREQ //func Subtract() { // //} go-x11-client-1.0.2/ext/damage/damage_req_auto.go000066400000000000000000000040141460713373000214670ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package damage import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint32) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func Create(conn *x.Conn, damage Damage, drawable x.Drawable, level uint8) { body := encodeCreate(damage, drawable, level) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateChecked(conn *x.Conn, damage Damage, drawable x.Drawable, level uint8) x.VoidCookie { body := encodeCreate(damage, drawable, level) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Destroy(conn *x.Conn, damage Damage) { body := encodeDestroy(damage) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyOpcode, }, Body: body, } conn.SendRequest(0, req) } func DestroyChecked(conn *x.Conn, damage Damage) x.VoidCookie { body := encodeDestroy(damage) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/dpms/000077500000000000000000000000001460713373000155515ustar00rootroot00000000000000go-x11-client-1.0.2/ext/dpms/auto.go000066400000000000000000000021631460713373000170520ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package dpms import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: DPMS const MajorVersion = 0 const MinorVersion = 0 var _ext *x.Extension func Ext() *x.Extension { return _ext } const GetVersionOpcode = 0 type GetVersionCookie x.SeqNum const CapableOpcode = 1 type CapableCookie x.SeqNum const GetTimeoutsOpcode = 2 type GetTimeoutsCookie x.SeqNum const SetTimeoutsOpcode = 3 const EnableOpcode = 4 const DisableOpcode = 5 // enum DPMSMode const ( DPMSModeOn = 0 DPMSModeStandby = 1 DPMSModeSuspend = 2 DPMSModeOff = 3 ) const ForceLevelOpcode = 6 const InfoOpcode = 7 type InfoCookie x.SeqNum var requestOpcodeNameMap = map[uint]string{ GetVersionOpcode: "GetVersion", CapableOpcode: "Capable", GetTimeoutsOpcode: "GetTimeouts", SetTimeoutsOpcode: "SetTimeouts", EnableOpcode: "Enable", DisableOpcode: "Disable", ForceLevelOpcode: "ForceLevel", InfoOpcode: "Info", } func init() { _ext = x.NewExtension("DPMS", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/dpms/dpms.go000066400000000000000000000042451460713373000170500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package dpms import "github.com/linuxdeepin/go-x11-client" // #WREQ func encodeGetVersion(clientMajorVersion, clientMinorVersion uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(clientMajorVersion). Write2b(clientMinorVersion). End() return } type GetVersionReply struct { ServerMajorVersion uint16 ServerMinorVersion uint16 } func readGetVersionReply(r *x.Reader, v *GetVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.ServerMajorVersion = r.Read2b() v.ServerMinorVersion = r.Read2b() // 3 return nil } // #WREQ func encodeCapable() (b x.RequestBody) { return } type CapableReply struct { Capable bool } func readCapableReply(r *x.Reader, v *CapableReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.Capable = r.ReadBool() // 3 return nil } // #WREQ func encodeGetTimeouts() (b x.RequestBody) { return } type GetTimeoutsReply struct { StandbyTimeout uint16 SuspendTimeout uint16 OffTimeout uint16 } func readGetTimeoutsReply(r *x.Reader, v *GetTimeoutsReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.StandbyTimeout = r.Read2b() v.SuspendTimeout = r.Read2b() v.OffTimeout = r.Read2b() // 4 return nil } // #WREQ func encodeSetTimeouts(standbyTimeout, suspendTimeout, offTimeout uint16) (b x.RequestBody) { b.AddBlock(2). Write2b(standbyTimeout). Write2b(suspendTimeout). Write2b(offTimeout). WritePad(2). End() return } // #WREQ func encodeEnable() (b x.RequestBody) { return } // #WREQ func encodeDisable() (b x.RequestBody) { return } // #WREQ func encodeForceLevel(powerLevel uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(powerLevel). WritePad(2). End() return } // #WREQ func encodeInfo() (b x.RequestBody) { return } type InfoReply struct { PowerLevel uint16 State bool } func readInfoReply(r *x.Reader, v *InfoReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.PowerLevel = r.Read2b() v.State = r.ReadBool() // 3 return nil } go-x11-client-1.0.2/ext/dpms/dpms_req_auto.go000066400000000000000000000114741460713373000207510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package dpms import x "github.com/linuxdeepin/go-x11-client" func GetVersion(conn *x.Conn, clientMajorVersion, clientMinorVersion uint16) GetVersionCookie { body := encodeGetVersion(clientMajorVersion, clientMinorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetVersionCookie(seq) } func (cookie GetVersionCookie) Reply(conn *x.Conn) (*GetVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetVersionReply err = readGetVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func Capable(conn *x.Conn) CapableCookie { body := encodeCapable() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: CapableOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return CapableCookie(seq) } func (cookie CapableCookie) Reply(conn *x.Conn) (*CapableReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply CapableReply err = readCapableReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetTimeouts(conn *x.Conn) GetTimeoutsCookie { body := encodeGetTimeouts() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetTimeoutsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetTimeoutsCookie(seq) } func (cookie GetTimeoutsCookie) Reply(conn *x.Conn) (*GetTimeoutsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetTimeoutsReply err = readGetTimeoutsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetTimeouts(conn *x.Conn, standbyTimeout, suspendTimeout, offTimeout uint16) { body := encodeSetTimeouts(standbyTimeout, suspendTimeout, offTimeout) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetTimeoutsOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetTimeoutsChecked(conn *x.Conn, standbyTimeout, suspendTimeout, offTimeout uint16) x.VoidCookie { body := encodeSetTimeouts(standbyTimeout, suspendTimeout, offTimeout) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetTimeoutsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Enable(conn *x.Conn) { body := encodeEnable() req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: EnableOpcode, }, Body: body, } conn.SendRequest(0, req) } func EnableChecked(conn *x.Conn) x.VoidCookie { body := encodeEnable() req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: EnableOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Disable(conn *x.Conn) { body := encodeDisable() req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DisableOpcode, }, Body: body, } conn.SendRequest(0, req) } func DisableChecked(conn *x.Conn) x.VoidCookie { body := encodeDisable() req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DisableOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ForceLevel(conn *x.Conn, powerLevel uint16) { body := encodeForceLevel(powerLevel) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ForceLevelOpcode, }, Body: body, } conn.SendRequest(0, req) } func ForceLevelChecked(conn *x.Conn, powerLevel uint16) x.VoidCookie { body := encodeForceLevel(powerLevel) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ForceLevelOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Info(conn *x.Conn) InfoCookie { body := encodeInfo() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: InfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return InfoCookie(seq) } func (cookie InfoCookie) Reply(conn *x.Conn) (*InfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply InfoReply err = readInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } go-x11-client-1.0.2/ext/ge/000077500000000000000000000000001460713373000152015ustar00rootroot00000000000000go-x11-client-1.0.2/ext/ge/auto.go000066400000000000000000000010701460713373000164760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package ge import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: GenericEvent const MajorVersion = 1 const MinorVersion = 0 var _ext *x.Extension func Ext() *x.Extension { return _ext } const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", } func init() { _ext = x.NewExtension("Generic Event Extension", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/ge/ge.go000066400000000000000000000012141460713373000161210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package ge import "github.com/linuxdeepin/go-x11-client" // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(majorVersion). Write2b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion uint16 MinorVersion uint16 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read2b() v.MinorVersion = r.Read2b() // 3 return nil } go-x11-client-1.0.2/ext/ge/ge_req_auto.go000066400000000000000000000015441460713373000200260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package ge import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint16) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } go-x11-client-1.0.2/ext/input/000077500000000000000000000000001460713373000157455ustar00rootroot00000000000000go-x11-client-1.0.2/ext/input/auto.go000066400000000000000000000632451460713373000172560ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Input const MajorVersion = 2 const MinorVersion = 3 var _ext *x.Extension func Ext() *x.Extension { return _ext } // simple ('xcb', 'Input', 'EventClass') type EventClass uint32 // simple ('xcb', 'Input', 'KeyCode') type KeyCode uint8 // simple ('xcb', 'Input', 'DeviceId') type DeviceId uint16 // simple ('xcb', 'Input', 'FP1616') type Fp1616 int32 const GetExtensionVersionOpcode = 1 type GetExtensionVersionCookie x.SeqNum // enum DeviceUse const ( DeviceUseIsXPointer = 0 DeviceUseIsXKeyboard = 1 DeviceUseIsXExtensionDevice = 2 DeviceUseIsXExtensionKeyboard = 3 DeviceUseIsXExtensionPointer = 4 ) // enum InputClass const ( InputClassKey = 0 InputClassButton = 1 InputClassValuator = 2 InputClassFeedback = 3 InputClassProximity = 4 InputClassFocus = 5 InputClassOther = 6 ) // enum ValuatorMode const ( ValuatorModeRelative = 0 ValuatorModeAbsolute = 1 ) const ListInputDevicesOpcode = 2 type ListInputDevicesCookie x.SeqNum // simple ('xcb', 'Input', 'EventTypeBase') type EventTypeBase uint8 const OpenDeviceOpcode = 3 type OpenDeviceCookie x.SeqNum const CloseDeviceOpcode = 4 const SetDeviceModeOpcode = 5 type SetDeviceModeCookie x.SeqNum const SelectExtensionEventOpcode = 6 const GetSelectedExtensionEventsOpcode = 7 type GetSelectedExtensionEventsCookie x.SeqNum // enum PropagateMode const ( PropagateModeAddToList = 0 PropagateModeDeleteFromList = 1 ) const ChangeDeviceDontPropagateListOpcode = 8 const GetDeviceDontPropagateListOpcode = 9 type GetDeviceDontPropagateListCookie x.SeqNum const GetDeviceMotionEventsOpcode = 10 type GetDeviceMotionEventsCookie x.SeqNum const ChangeKeyboardDeviceOpcode = 11 type ChangeKeyboardDeviceCookie x.SeqNum const ChangePointerDeviceOpcode = 12 type ChangePointerDeviceCookie x.SeqNum const GrabDeviceOpcode = 13 type GrabDeviceCookie x.SeqNum const UngrabDeviceOpcode = 14 // enum ModifierDevice const ( ModifierDeviceUseXKeyboard = 255 ) const GrabDeviceKeyOpcode = 15 const UngrabDeviceKeyOpcode = 16 const GrabDeviceButtonOpcode = 17 const UngrabDeviceButtonOpcode = 18 // enum DeviceInputMode const ( DeviceInputModeAsyncThisDevice = 0 DeviceInputModeSyncThisDevice = 1 DeviceInputModeReplayThisDevice = 2 DeviceInputModeAsyncOtherDevices = 3 DeviceInputModeAsyncAll = 4 DeviceInputModeSyncAll = 5 ) const AllowDeviceEventsOpcode = 19 const GetDeviceFocusOpcode = 20 type GetDeviceFocusCookie x.SeqNum const SetDeviceFocusOpcode = 21 // enum FeedbackClass const ( FeedbackClassKeyboard = 0 FeedbackClassPointer = 1 FeedbackClassString = 2 FeedbackClassInteger = 3 FeedbackClassLed = 4 FeedbackClassBell = 5 ) const GetFeedbackControlOpcode = 22 type GetFeedbackControlCookie x.SeqNum // enum ChangeFeedbackControlMask const ( ChangeFeedbackControlMaskKeyClickPercent = 1 ChangeFeedbackControlMaskPercent = 2 ChangeFeedbackControlMaskPitch = 4 ChangeFeedbackControlMaskDuration = 8 ChangeFeedbackControlMaskLed = 16 ChangeFeedbackControlMaskLedMode = 32 ChangeFeedbackControlMaskKey = 64 ChangeFeedbackControlMaskAutoRepeatMode = 128 ChangeFeedbackControlMaskString = 1 ChangeFeedbackControlMaskInteger = 1 ChangeFeedbackControlMaskAccelNum = 1 ChangeFeedbackControlMaskAccelDenom = 2 ChangeFeedbackControlMaskThreshold = 4 ) const ChangeFeedbackControlOpcode = 23 const GetDeviceKeyMappingOpcode = 24 type GetDeviceKeyMappingCookie x.SeqNum const ChangeDeviceKeyMappingOpcode = 25 const GetDeviceModifierMappingOpcode = 26 type GetDeviceModifierMappingCookie x.SeqNum const SetDeviceModifierMappingOpcode = 27 type SetDeviceModifierMappingCookie x.SeqNum const GetDeviceButtonMappingOpcode = 28 type GetDeviceButtonMappingCookie x.SeqNum const SetDeviceButtonMappingOpcode = 29 type SetDeviceButtonMappingCookie x.SeqNum // enum ValuatorStateModeMask const ( ValuatorStateModeMaskDeviceModeAbsolute = 1 ValuatorStateModeMaskOutOfProximity = 2 ) const QueryDeviceStateOpcode = 30 type QueryDeviceStateCookie x.SeqNum const DeviceBellOpcode = 32 const SetDeviceValuatorsOpcode = 33 type SetDeviceValuatorsCookie x.SeqNum // enum DeviceControl const ( DeviceControlResolution = 1 DeviceControlAbsCalib = 2 DeviceControlCore = 3 DeviceControlEnable = 4 DeviceControlAbsArea = 5 ) const GetDeviceControlOpcode = 34 type GetDeviceControlCookie x.SeqNum const ChangeDeviceControlOpcode = 35 type ChangeDeviceControlCookie x.SeqNum const ListDevicePropertiesOpcode = 36 type ListDevicePropertiesCookie x.SeqNum // enum PropertyFormat const ( PropertyFormat8Bits = 8 PropertyFormat16Bits = 16 PropertyFormat32Bits = 32 ) const ChangeDevicePropertyOpcode = 37 const DeleteDevicePropertyOpcode = 38 const GetDevicePropertyOpcode = 39 type GetDevicePropertyCookie x.SeqNum // enum Device const ( DeviceAll = 0 DeviceAllMaster = 1 ) const XIQueryPointerOpcode = 40 type XIQueryPointerCookie x.SeqNum const XIWarpPointerOpcode = 41 const XIChangeCursorOpcode = 42 // enum HierarchyChangeType const ( HierarchyChangeTypeAddMaster = 1 HierarchyChangeTypeRemoveMaster = 2 HierarchyChangeTypeAttachSlave = 3 HierarchyChangeTypeDetachSlave = 4 ) // enum ChangeMode const ( ChangeModeAttach = 1 ChangeModeFloat = 2 ) const XIChangeHierarchyOpcode = 43 const XISetClientPointerOpcode = 44 const XIGetClientPointerOpcode = 45 type XIGetClientPointerCookie x.SeqNum // enum XIEventMask const ( XIEventMaskDeviceChanged = 2 XIEventMaskKeyPress = 4 XIEventMaskKeyRelease = 8 XIEventMaskButtonPress = 16 XIEventMaskButtonRelease = 32 XIEventMaskMotion = 64 XIEventMaskEnter = 128 XIEventMaskLeave = 256 XIEventMaskFocusIn = 512 XIEventMaskFocusOut = 1024 XIEventMaskHierarchy = 2048 XIEventMaskProperty = 4096 XIEventMaskRawKeyPress = 8192 XIEventMaskRawKeyRelease = 16384 XIEventMaskRawButtonPress = 32768 XIEventMaskRawButtonRelease = 65536 XIEventMaskRawMotion = 131072 XIEventMaskTouchBegin = 262144 XIEventMaskTouchUpdate = 524288 XIEventMaskTouchEnd = 1048576 XIEventMaskTouchOwnership = 2097152 XIEventMaskRawTouchBegin = 4194304 XIEventMaskRawTouchUpdate = 8388608 XIEventMaskRawTouchEnd = 16777216 XIEventMaskBarrierHit = 33554432 XIEventMaskBarrierLeave = 67108864 ) const XISelectEventsOpcode = 46 const XIQueryVersionOpcode = 47 type XIQueryVersionCookie x.SeqNum // enum DeviceClassType const ( DeviceClassTypeKey = 0 DeviceClassTypeButton = 1 DeviceClassTypeValuator = 2 DeviceClassTypeScroll = 3 DeviceClassTypeTouch = 8 ) // enum DeviceType const ( DeviceTypeMasterPointer = 1 DeviceTypeMasterKeyboard = 2 DeviceTypeSlavePointer = 3 DeviceTypeSlaveKeyboard = 4 DeviceTypeFloatingSlave = 5 ) // enum ScrollFlags const ( ScrollFlagsNoEmulation = 1 ScrollFlagsPreferred = 2 ) // enum ScrollType const ( ScrollTypeVertical = 1 ScrollTypeHorizontal = 2 ) // enum TouchMode const ( TouchModeDirect = 1 TouchModeDependent = 2 ) const XIQueryDeviceOpcode = 48 type XIQueryDeviceCookie x.SeqNum const XISetFocusOpcode = 49 const XIGetFocusOpcode = 50 type XIGetFocusCookie x.SeqNum // enum GrabOwner const ( GrabOwnerNoOwner = 0 GrabOwnerOwner = 1 ) const XIGrabDeviceOpcode = 51 type XIGrabDeviceCookie x.SeqNum const XIUngrabDeviceOpcode = 52 // enum EventMode const ( EventModeAsyncDevice = 0 EventModeSyncDevice = 1 EventModeReplayDevice = 2 EventModeAsyncPairedDevice = 3 EventModeAsyncPair = 4 EventModeSyncPair = 5 EventModeAcceptTouch = 6 EventModeRejectTouch = 7 ) const XIAllowEventsOpcode = 53 // enum GrabMode22 const ( GrabMode22Sync = 0 GrabMode22Async = 1 GrabMode22Touch = 2 ) // enum GrabType const ( GrabTypeButton = 0 GrabTypeKeycode = 1 GrabTypeEnter = 2 GrabTypeFocusIn = 3 GrabTypeTouchBegin = 4 ) // enum ModifierMask const ( ModifierMaskAny = 2147483648 ) const XIPassiveGrabDeviceOpcode = 54 type XIPassiveGrabDeviceCookie x.SeqNum const XIPassiveUngrabDeviceOpcode = 55 const XIListPropertiesOpcode = 56 type XIListPropertiesCookie x.SeqNum const XIChangePropertyOpcode = 57 const XIDeletePropertyOpcode = 58 const XIGetPropertyOpcode = 59 type XIGetPropertyCookie x.SeqNum const XIGetSelectedEventsOpcode = 60 type XIGetSelectedEventsCookie x.SeqNum const XIBarrierReleasePointerOpcode = 61 const DeviceValuatorEventCode = 0 func NewDeviceValuatorEvent(data []byte) (*DeviceValuatorEvent, error) { var ev DeviceValuatorEvent r := x.NewReaderFromData(data) err := readDeviceValuatorEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum MoreEventsMask const ( MoreEventsMaskMoreEvents = 128 ) const DeviceKeyPressEventCode = 1 func NewDeviceKeyPressEvent(data []byte) (*DeviceKeyPressEvent, error) { var ev DeviceKeyPressEvent r := x.NewReaderFromData(data) err := readDeviceKeyPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceKeyReleaseEventCode = 2 func NewDeviceKeyReleaseEvent(data []byte) (*DeviceKeyReleaseEvent, error) { var ev DeviceKeyReleaseEvent r := x.NewReaderFromData(data) err := readDeviceKeyReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceButtonPressEventCode = 3 func NewDeviceButtonPressEvent(data []byte) (*DeviceButtonPressEvent, error) { var ev DeviceButtonPressEvent r := x.NewReaderFromData(data) err := readDeviceButtonPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceButtonReleaseEventCode = 4 func NewDeviceButtonReleaseEvent(data []byte) (*DeviceButtonReleaseEvent, error) { var ev DeviceButtonReleaseEvent r := x.NewReaderFromData(data) err := readDeviceButtonReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceMotionNotifyEventCode = 5 func NewDeviceMotionNotifyEvent(data []byte) (*DeviceMotionNotifyEvent, error) { var ev DeviceMotionNotifyEvent r := x.NewReaderFromData(data) err := readDeviceMotionNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceFocusInEventCode = 6 func NewDeviceFocusInEvent(data []byte) (*DeviceFocusInEvent, error) { var ev DeviceFocusInEvent r := x.NewReaderFromData(data) err := readDeviceFocusInEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceFocusOutEventCode = 7 func NewDeviceFocusOutEvent(data []byte) (*DeviceFocusOutEvent, error) { var ev DeviceFocusOutEvent r := x.NewReaderFromData(data) err := readDeviceFocusOutEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ProximityInEventCode = 8 func NewProximityInEvent(data []byte) (*ProximityInEvent, error) { var ev ProximityInEvent r := x.NewReaderFromData(data) err := readProximityInEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ProximityOutEventCode = 9 func NewProximityOutEvent(data []byte) (*ProximityOutEvent, error) { var ev ProximityOutEvent r := x.NewReaderFromData(data) err := readProximityOutEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum ClassesReportedMask const ( ClassesReportedMaskOutOfProximity = 128 ClassesReportedMaskDeviceModeAbsolute = 64 ClassesReportedMaskReportingValuators = 4 ClassesReportedMaskReportingButtons = 2 ClassesReportedMaskReportingKeys = 1 ) const DeviceStateNotifyEventCode = 10 func NewDeviceStateNotifyEvent(data []byte) (*DeviceStateNotifyEvent, error) { var ev DeviceStateNotifyEvent r := x.NewReaderFromData(data) err := readDeviceStateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceMappingNotifyEventCode = 11 func NewDeviceMappingNotifyEvent(data []byte) (*DeviceMappingNotifyEvent, error) { var ev DeviceMappingNotifyEvent r := x.NewReaderFromData(data) err := readDeviceMappingNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum ChangeDevice const ( ChangeDeviceNewPointer = 0 ChangeDeviceNewKeyboard = 1 ) const ChangeDeviceNotifyEventCode = 12 func NewChangeDeviceNotifyEvent(data []byte) (*ChangeDeviceNotifyEvent, error) { var ev ChangeDeviceNotifyEvent r := x.NewReaderFromData(data) err := readChangeDeviceNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceKeyStateNotifyEventCode = 13 func NewDeviceKeyStateNotifyEvent(data []byte) (*DeviceKeyStateNotifyEvent, error) { var ev DeviceKeyStateNotifyEvent r := x.NewReaderFromData(data) err := readDeviceKeyStateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DeviceButtonStateNotifyEventCode = 14 func NewDeviceButtonStateNotifyEvent(data []byte) (*DeviceButtonStateNotifyEvent, error) { var ev DeviceButtonStateNotifyEvent r := x.NewReaderFromData(data) err := readDeviceButtonStateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum DeviceChange const ( DeviceChangeAdded = 0 DeviceChangeRemoved = 1 DeviceChangeEnabled = 2 DeviceChangeDisabled = 3 DeviceChangeUnrecoverable = 4 DeviceChangeControlChanged = 5 ) const DevicePresenceNotifyEventCode = 15 func NewDevicePresenceNotifyEvent(data []byte) (*DevicePresenceNotifyEvent, error) { var ev DevicePresenceNotifyEvent r := x.NewReaderFromData(data) err := readDevicePresenceNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DevicePropertyNotifyEventCode = 16 func NewDevicePropertyNotifyEvent(data []byte) (*DevicePropertyNotifyEvent, error) { var ev DevicePropertyNotifyEvent r := x.NewReaderFromData(data) err := readDevicePropertyNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum ChangeReason const ( ChangeReasonSlaveSwitch = 1 ChangeReasonDeviceChange = 2 ) const DeviceChangedEventCode = 1 func NewDeviceChangedEvent(data []byte) (*DeviceChangedEvent, error) { var ev DeviceChangedEvent r := x.NewReaderFromData(data) err := readDeviceChangedEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum KeyEventFlags const ( KeyEventFlagsKeyRepeat = 65536 ) const KeyPressEventCode = 2 func NewKeyPressEvent(data []byte) (*KeyPressEvent, error) { var ev KeyPressEvent r := x.NewReaderFromData(data) err := readKeyPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const KeyReleaseEventCode = 3 func NewKeyReleaseEvent(data []byte) (*KeyReleaseEvent, error) { var ev KeyReleaseEvent r := x.NewReaderFromData(data) err := readKeyReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum PointerEventFlags const ( PointerEventFlagsPointerEmulated = 65536 ) const ButtonPressEventCode = 4 func NewButtonPressEvent(data []byte) (*ButtonPressEvent, error) { var ev ButtonPressEvent r := x.NewReaderFromData(data) err := readButtonPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ButtonReleaseEventCode = 5 func NewButtonReleaseEvent(data []byte) (*ButtonReleaseEvent, error) { var ev ButtonReleaseEvent r := x.NewReaderFromData(data) err := readButtonReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const MotionEventCode = 6 func NewMotionEvent(data []byte) (*MotionEvent, error) { var ev MotionEvent r := x.NewReaderFromData(data) err := readMotionEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum NotifyMode const ( NotifyModeNormal = 0 NotifyModeGrab = 1 NotifyModeUngrab = 2 NotifyModeWhileGrabbed = 3 NotifyModePassiveGrab = 4 NotifyModePassiveUngrab = 5 ) // enum NotifyDetail const ( NotifyDetailAncestor = 0 NotifyDetailVirtual = 1 NotifyDetailInferior = 2 NotifyDetailNonlinear = 3 NotifyDetailNonlinearVirtual = 4 NotifyDetailPointer = 5 NotifyDetailPointerRoot = 6 NotifyDetailNone = 7 ) const EnterEventCode = 7 func NewEnterEvent(data []byte) (*EnterEvent, error) { var ev EnterEvent r := x.NewReaderFromData(data) err := readEnterEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const LeaveEventCode = 8 func NewLeaveEvent(data []byte) (*LeaveEvent, error) { var ev LeaveEvent r := x.NewReaderFromData(data) err := readLeaveEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const FocusInEventCode = 9 func NewFocusInEvent(data []byte) (*FocusInEvent, error) { var ev FocusInEvent r := x.NewReaderFromData(data) err := readFocusInEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const FocusOutEventCode = 10 func NewFocusOutEvent(data []byte) (*FocusOutEvent, error) { var ev FocusOutEvent r := x.NewReaderFromData(data) err := readFocusOutEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum HierarchyMask const ( HierarchyMaskMasterAdded = 1 HierarchyMaskMasterRemoved = 2 HierarchyMaskSlaveAdded = 4 HierarchyMaskSlaveRemoved = 8 HierarchyMaskSlaveAttached = 16 HierarchyMaskSlaveDetached = 32 HierarchyMaskDeviceEnabled = 64 HierarchyMaskDeviceDisabled = 128 ) const HierarchyEventCode = 11 func NewHierarchyEvent(data []byte) (*HierarchyEvent, error) { var ev HierarchyEvent r := x.NewReaderFromData(data) err := readHierarchyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum PropertyFlag const ( PropertyFlagDeleted = 0 PropertyFlagCreated = 1 PropertyFlagModified = 2 ) const PropertyEventCode = 12 func NewPropertyEvent(data []byte) (*PropertyEvent, error) { var ev PropertyEvent r := x.NewReaderFromData(data) err := readPropertyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawKeyPressEventCode = 13 func NewRawKeyPressEvent(data []byte) (*RawKeyPressEvent, error) { var ev RawKeyPressEvent r := x.NewReaderFromData(data) err := readRawKeyPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawKeyReleaseEventCode = 14 func NewRawKeyReleaseEvent(data []byte) (*RawKeyReleaseEvent, error) { var ev RawKeyReleaseEvent r := x.NewReaderFromData(data) err := readRawKeyReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawButtonPressEventCode = 15 func NewRawButtonPressEvent(data []byte) (*RawButtonPressEvent, error) { var ev RawButtonPressEvent r := x.NewReaderFromData(data) err := readRawButtonPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawButtonReleaseEventCode = 16 func NewRawButtonReleaseEvent(data []byte) (*RawButtonReleaseEvent, error) { var ev RawButtonReleaseEvent r := x.NewReaderFromData(data) err := readRawButtonReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawMotionEventCode = 17 func NewRawMotionEvent(data []byte) (*RawMotionEvent, error) { var ev RawMotionEvent r := x.NewReaderFromData(data) err := readRawMotionEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum TouchEventFlags const ( TouchEventFlagsTouchPendingEnd = 65536 TouchEventFlagsTouchEmulatingPointer = 131072 ) const TouchBeginEventCode = 18 func NewTouchBeginEvent(data []byte) (*TouchBeginEvent, error) { var ev TouchBeginEvent r := x.NewReaderFromData(data) err := readTouchBeginEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const TouchUpdateEventCode = 19 func NewTouchUpdateEvent(data []byte) (*TouchUpdateEvent, error) { var ev TouchUpdateEvent r := x.NewReaderFromData(data) err := readTouchUpdateEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const TouchEndEventCode = 20 func NewTouchEndEvent(data []byte) (*TouchEndEvent, error) { var ev TouchEndEvent r := x.NewReaderFromData(data) err := readTouchEndEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum TouchOwnershipFlags const ( TouchOwnershipFlagsNone = 0 ) const TouchOwnershipEventCode = 21 func NewTouchOwnershipEvent(data []byte) (*TouchOwnershipEvent, error) { var ev TouchOwnershipEvent r := x.NewReaderFromData(data) err := readTouchOwnershipEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawTouchBeginEventCode = 22 func NewRawTouchBeginEvent(data []byte) (*RawTouchBeginEvent, error) { var ev RawTouchBeginEvent r := x.NewReaderFromData(data) err := readRawTouchBeginEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawTouchUpdateEventCode = 23 func NewRawTouchUpdateEvent(data []byte) (*RawTouchUpdateEvent, error) { var ev RawTouchUpdateEvent r := x.NewReaderFromData(data) err := readRawTouchUpdateEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RawTouchEndEventCode = 24 func NewRawTouchEndEvent(data []byte) (*RawTouchEndEvent, error) { var ev RawTouchEndEvent r := x.NewReaderFromData(data) err := readRawTouchEndEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum BarrierFlags const ( BarrierFlagsPointerReleased = 1 BarrierFlagsDeviceIsGrabbed = 2 ) const BarrierHitEventCode = 25 func NewBarrierHitEvent(data []byte) (*BarrierHitEvent, error) { var ev BarrierHitEvent r := x.NewReaderFromData(data) err := readBarrierHitEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const BarrierLeaveEventCode = 26 func NewBarrierLeaveEvent(data []byte) (*BarrierLeaveEvent, error) { var ev BarrierLeaveEvent r := x.NewReaderFromData(data) err := readBarrierLeaveEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const SendExtensionEventOpcode = 31 const DeviceErrorCode = 0 const EventErrorCode = 1 const ModeErrorCode = 2 const DeviceBusyErrorCode = 3 const ClassErrorCode = 4 var errorCodeNameMap = map[uint8]string{ DeviceErrorCode: "BadDevice", EventErrorCode: "BadEvent", ModeErrorCode: "BadMode", DeviceBusyErrorCode: "DeviceBusy", ClassErrorCode: "BadClass", } var requestOpcodeNameMap = map[uint]string{ GetExtensionVersionOpcode: "GetExtensionVersion", ListInputDevicesOpcode: "ListInputDevices", OpenDeviceOpcode: "OpenDevice", CloseDeviceOpcode: "CloseDevice", SetDeviceModeOpcode: "SetDeviceMode", SelectExtensionEventOpcode: "SelectExtensionEvent", GetSelectedExtensionEventsOpcode: "GetSelectedExtensionEvents", ChangeDeviceDontPropagateListOpcode: "ChangeDeviceDontPropagateList", GetDeviceDontPropagateListOpcode: "GetDeviceDontPropagateList", GetDeviceMotionEventsOpcode: "GetDeviceMotionEvents", ChangeKeyboardDeviceOpcode: "ChangeKeyboardDevice", ChangePointerDeviceOpcode: "ChangePointerDevice", GrabDeviceOpcode: "GrabDevice", UngrabDeviceOpcode: "UngrabDevice", GrabDeviceKeyOpcode: "GrabDeviceKey", UngrabDeviceKeyOpcode: "UngrabDeviceKey", GrabDeviceButtonOpcode: "GrabDeviceButton", UngrabDeviceButtonOpcode: "UngrabDeviceButton", AllowDeviceEventsOpcode: "AllowDeviceEvents", GetDeviceFocusOpcode: "GetDeviceFocus", SetDeviceFocusOpcode: "SetDeviceFocus", GetFeedbackControlOpcode: "GetFeedbackControl", ChangeFeedbackControlOpcode: "ChangeFeedbackControl", GetDeviceKeyMappingOpcode: "GetDeviceKeyMapping", ChangeDeviceKeyMappingOpcode: "ChangeDeviceKeyMapping", GetDeviceModifierMappingOpcode: "GetDeviceModifierMapping", SetDeviceModifierMappingOpcode: "SetDeviceModifierMapping", GetDeviceButtonMappingOpcode: "GetDeviceButtonMapping", SetDeviceButtonMappingOpcode: "SetDeviceButtonMapping", QueryDeviceStateOpcode: "QueryDeviceState", DeviceBellOpcode: "DeviceBell", SetDeviceValuatorsOpcode: "SetDeviceValuators", GetDeviceControlOpcode: "GetDeviceControl", ChangeDeviceControlOpcode: "ChangeDeviceControl", ListDevicePropertiesOpcode: "ListDeviceProperties", ChangeDevicePropertyOpcode: "ChangeDeviceProperty", DeleteDevicePropertyOpcode: "DeleteDeviceProperty", GetDevicePropertyOpcode: "GetDeviceProperty", XIQueryPointerOpcode: "XIQueryPointer", XIWarpPointerOpcode: "XIWarpPointer", XIChangeCursorOpcode: "XIChangeCursor", XIChangeHierarchyOpcode: "XIChangeHierarchy", XISetClientPointerOpcode: "XISetClientPointer", XIGetClientPointerOpcode: "XIGetClientPointer", XISelectEventsOpcode: "XISelectEvents", XIQueryVersionOpcode: "XIQueryVersion", XIQueryDeviceOpcode: "XIQueryDevice", XISetFocusOpcode: "XISetFocus", XIGetFocusOpcode: "XIGetFocus", XIGrabDeviceOpcode: "XIGrabDevice", XIUngrabDeviceOpcode: "XIUngrabDevice", XIAllowEventsOpcode: "XIAllowEvents", XIPassiveGrabDeviceOpcode: "XIPassiveGrabDevice", XIPassiveUngrabDeviceOpcode: "XIPassiveUngrabDevice", XIListPropertiesOpcode: "XIListProperties", XIChangePropertyOpcode: "XIChangeProperty", XIDeletePropertyOpcode: "XIDeleteProperty", XIGetPropertyOpcode: "XIGetProperty", XIGetSelectedEventsOpcode: "XIGetSelectedEvents", XIBarrierReleasePointerOpcode: "XIBarrierReleasePointer", SendExtensionEventOpcode: "SendExtensionEvent", } func init() { _ext = x.NewExtension("XInputExtension", 4, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/input/input.go000066400000000000000000000500641460713373000174400ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import ( "github.com/linuxdeepin/go-x11-client" ) // FP1616 size: 1 * 4b func readFP1616(r *x.Reader) float32 { value := int32(r.Read4b()) ret := float32(value) / float32(1<<16) return ret } func writeFP1616(b *x.FixedSizeBuf, value float32) { b.Write4b(uint32(int32(value * float32(1<<16)))) } // FP3232 size: 2 * 4b func readFP3232(r *x.Reader) float64 { integral := int32(r.Read4b()) frac := r.Read4b() // 2 ret := float64(integral) + (float64(frac) * (1.0 / (1 << 32))) return ret } // #WREQ func encodeXIQueryVersion(majorVersion, minorVersion uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(majorVersion). Write2b(minorVersion). End() return } type XIQueryVersionReply struct { MajorVersion uint16 MinorVersion uint16 } func readXIQueryVersionReply(r *x.Reader, v *XIQueryVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read2b() v.MinorVersion = r.Read2b() // 3 return nil } // #WREQ func encodeXIQueryDevice(deviceId DeviceId) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceId)). WritePad(2). End() return } type XIQueryDeviceReply struct { Infos []XIDeviceInfo } func readXIQueryDeviceReply(r *x.Reader, v *XIQueryDeviceReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) infosLen := int(r.Read2b()) r.ReadPad(22) // 8 if infosLen > 0 { v.Infos = make([]XIDeviceInfo, infosLen) for i := 0; i < infosLen; i++ { err := readXIDeviceInfo(r, &v.Infos[i]) if err != nil { return err } } } return nil } type XIDeviceInfo struct { Id DeviceId Type uint16 Attachment DeviceId Enabled bool Name string Classes []DeviceClass } func readXIDeviceInfo(r *x.Reader, v *XIDeviceInfo) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.Id = DeviceId(r.Read2b()) v.Type = r.Read2b() v.Attachment = DeviceId(r.Read2b()) classesLen := int(r.Read2b()) nameLen := int(r.Read2b()) v.Enabled = r.ReadBool() r.ReadPad(1) // 3 var err error v.Name, err = r.ReadStrWithPad(nameLen) if err != nil { return err } // classes if classesLen > 0 { v.Classes = make([]DeviceClass, classesLen) for i := 0; i < classesLen; i++ { v.Classes[i], err = readDeviceClass(r) if err != nil { return err } } } return nil } type DeviceClass interface { GetDeviceClassType() uint16 GetSourceId() DeviceId } func readDeviceClass(r *x.Reader) (DeviceClass, error) { var gdc GenericDeviceClass err := readGenericDeviceClass(r, &gdc) if err != nil { return nil, err } dataReader := x.NewReaderFromData(gdc.Data) var ret DeviceClass = &gdc switch gdc.Type { case DeviceClassTypeKey: var c KeyClass c.SourceId = gdc.SourceId err := readKeyClass(dataReader, &c) if err != nil { return nil, err } ret = &c case DeviceClassTypeButton: var c ButtonClass c.SourceId = gdc.SourceId err := readButtonClass(dataReader, &c) if err != nil { return nil, err } ret = &c case DeviceClassTypeValuator: var c ValuatorClass c.SourceId = gdc.SourceId err := readValuatorClass(dataReader, &c) if err != nil { return nil, err } ret = &c case DeviceClassTypeScroll: var c ScrollClass c.SourceId = gdc.SourceId err := readScrollClass(dataReader, &c) if err != nil { return nil, err } ret = &c case DeviceClassTypeTouch: var c TouchClass c.SourceId = gdc.SourceId err := readTouchClass(dataReader, &c) if err != nil { return nil, err } ret = &c } return ret, nil } type GenericDeviceClass struct { Type uint16 Len uint16 SourceId DeviceId Data []byte } func (dc *GenericDeviceClass) GetDeviceClassType() uint16 { return dc.Type } func (dc *GenericDeviceClass) GetSourceId() DeviceId { return dc.SourceId } func readGenericDeviceClass(r *x.Reader, v *GenericDeviceClass) error { if !r.RemainAtLeast(6) { return x.ErrDataLenShort } v.Type = r.Read2b() v.Len = r.Read2b() v.SourceId = DeviceId(r.Read2b()) // TODO: 检查传入 ReadBytes 的值大于 0 var err error v.Data, err = r.ReadBytes((int(v.Len) * 4) - 6) if err != nil { return err } return nil } type KeyClass struct { SourceId DeviceId NumKeys uint16 Keys []uint32 } func (*KeyClass) GetDeviceClassType() uint16 { return DeviceClassTypeKey } func (kc *KeyClass) GetSourceId() DeviceId { return kc.SourceId } func readKeyClass(r *x.Reader, v *KeyClass) error { if !r.RemainAtLeast(2) { return x.ErrDataLenShort } v.NumKeys = r.Read2b() numKeys := int(v.NumKeys) if numKeys > 0 { if !r.RemainAtLeast4b(numKeys) { return x.ErrDataLenShort } v.Keys = make([]uint32, numKeys) for i := 0; i < numKeys; i++ { v.Keys[i] = r.Read4b() } } return nil } type ButtonClass struct { SourceId DeviceId NumButtons uint16 State []uint32 Labels []x.Atom } func (*ButtonClass) GetDeviceClassType() uint16 { return DeviceClassTypeButton } func (bc *ButtonClass) GetSourceId() DeviceId { return bc.SourceId } func readButtonClass(r *x.Reader, v *ButtonClass) error { if !r.RemainAtLeast(2) { return x.ErrDataLenShort } v.NumButtons = r.Read2b() numButtons := int(v.NumButtons) stateLen := (numButtons + 31) / 32 if stateLen > 0 { if !r.RemainAtLeast4b(stateLen) { return x.ErrDataLenShort } v.State = make([]uint32, stateLen) for i := 0; i < stateLen; i++ { v.State[i] = r.Read4b() } } if numButtons > 0 { if !r.RemainAtLeast4b(numButtons) { return x.ErrDataLenShort } v.Labels = make([]x.Atom, numButtons) for i := 0; i < numButtons; i++ { v.Labels[i] = x.Atom(r.Read4b()) } } return nil } // also called AxisClass type ValuatorClass struct { SourceId DeviceId Number uint16 Label x.Atom Min float64 Max float64 Value float64 Resolution uint32 Mode uint8 } func (*ValuatorClass) GetDeviceClassType() uint16 { return DeviceClassTypeValuator } func (vc *ValuatorClass) GetSourceId() DeviceId { return vc.SourceId } func readValuatorClass(r *x.Reader, v *ValuatorClass) error { if !r.RemainAtLeast(20) { return x.ErrDataLenShort } v.Number = r.Read2b() v.Label = x.Atom(r.Read4b()) v.Min = readFP3232(r) v.Max = readFP3232(r) v.Value = readFP3232(r) // 12b v.Resolution = r.Read4b() v.Mode = r.Read1b() r.ReadPad(3) // 20b return nil } type ScrollClass struct { SourceId DeviceId Number uint16 ScrollType uint16 Flags uint32 Increment float64 } func (*ScrollClass) GetDeviceClassType() uint16 { return DeviceClassTypeScroll } func (sc *ScrollClass) GetSourceId() DeviceId { return sc.SourceId } func readScrollClass(r *x.Reader, v *ScrollClass) error { if !r.RemainAtLeast(18) { return x.ErrDataLenShort } v.Number = r.Read2b() v.ScrollType = r.Read2b() r.ReadPad(2) v.Flags = r.Read4b() v.Increment = readFP3232(r) // 18b return nil } type TouchClass struct { SourceId DeviceId Mode uint8 NumTouches uint8 } func (*TouchClass) GetDeviceClassType() uint16 { return DeviceClassTypeTouch } func (tc *TouchClass) GetSourceId() DeviceId { return tc.SourceId } func readTouchClass(r *x.Reader, v *TouchClass) error { if !r.RemainAtLeast(2) { return x.ErrDataLenShort } v.Mode = r.Read1b() v.NumTouches = r.Read1b() return nil } // #WREQ func encodeXISelectEvents(window x.Window, masks []EventMask) (b x.RequestBody) { var masksSize int for _, mask := range masks { masksSize += mask.getSizeIn4b() } b0 := b.AddBlock(2 + masksSize). Write4b(uint32(window)). Write2b(uint16(len(masks))). WritePad(2) for _, mask := range masks { writeEventMask(b0, mask) } b0.End() return } type EventMask struct { DeviceId DeviceId Mask []uint32 } func (ev *EventMask) getSizeIn4b() int { return 1 + len(ev.Mask) } func writeEventMask(b *x.FixedSizeBuf, v EventMask) { maskLen := len(v.Mask) b.Write2b(uint16(v.DeviceId)). Write2b(uint16(maskLen)) for _, mask := range v.Mask { b.Write4b(mask) } } func readEventMask(r *x.Reader, v *EventMask) error { if !r.RemainAtLeast(4) { return x.ErrDataLenShort } v.DeviceId = DeviceId(r.Read2b()) maskLen := int(r.Read2b()) if maskLen > 0 { if !r.RemainAtLeast4b(maskLen) { return x.ErrDataLenShort } v.Mask = make([]uint32, maskLen) for i := 0; i < maskLen; i++ { v.Mask[i] = r.Read4b() } } return nil } // #WREQ func encodeXIGetSelectedEvents(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type XIGetSelectedEventsReply struct { Masks []EventMask } func readXIGetSelectedEventsReply(r *x.Reader, v *XIGetSelectedEventsReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) masksLen := int(r.Read2b()) r.ReadPad(22) // 8 if masksLen > 0 { v.Masks = make([]EventMask, masksLen) for i := 0; i < masksLen; i++ { err := readEventMask(r, &v.Masks[i]) if err != nil { return err } } } return nil } // #WREQ func encodeXIQueryPointer(window x.Window, deviceId DeviceId) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write2b(uint16(deviceId)). WritePad(2). End() return } type XIQueryPointerReply struct { Root x.Window Child x.Window RootX float32 RootY float32 WinX float32 WinY float32 SameScreen bool Buttons []uint32 Mods ModifierInfo Group GroupInfo } func readXIQueryPointerReply(r *x.Reader, v *XIQueryPointerReply) error { if !r.RemainAtLeast4b(14) { return x.ErrDataLenShort } r.ReadPad(8) v.Root = x.Window(r.Read4b()) v.Child = x.Window(r.Read4b()) // 4 v.RootX = readFP1616(r) v.RootY = readFP1616(r) v.WinX = readFP1616(r) v.WinY = readFP1616(r) // 8 v.SameScreen = r.ReadBool() r.ReadPad(1) buttonsLen := int(r.Read2b()) // 9 // mods readModifierInfo(r, &v.Mods) // 13 // group readGroupInfo(r, &v.Group) // 14 if buttonsLen > 0 { if !r.RemainAtLeast4b(buttonsLen) { return x.ErrDataLenShort } v.Buttons = make([]uint32, buttonsLen) for i := 0; i < buttonsLen; i++ { v.Buttons[i] = r.Read4b() } } return nil } // size: 4 * 4b type ModifierInfo struct { Base uint32 Latched uint32 Locked uint32 Effective uint32 } func readModifierInfo(r *x.Reader, v *ModifierInfo) { v.Base = r.Read4b() v.Latched = r.Read4b() v.Locked = r.Read4b() v.Effective = r.Read4b() } // size: 1 * 4b type GroupInfo struct { Base uint8 Latched uint8 Locked uint8 Effective uint8 } func readGroupInfo(r *x.Reader, v *GroupInfo) { v.Base = r.Read1b() v.Latched = r.Read1b() v.Locked = r.Read1b() v.Effective = r.Read1b() } // #WREQ func encodeXIWarpPointer(srcWin, dstWin x.Window, srcX, srcY float32, srcWidth, srcHeight uint16, dstX, dstY float32, deviceId DeviceId) (b x.RequestBody) { b0 := b.AddBlock(8). Write4b(uint32(srcWin)). Write4b(uint32(dstWin)) writeFP1616(b0, srcX) writeFP1616(b0, srcY) b0.Write2b(srcWidth). Write2b(srcHeight) writeFP1616(b0, dstX) writeFP1616(b0, dstY) b0.Write2b(uint16(deviceId)). WritePad(2). End() return } // #WREQ func encodeXIChangeCursor(window x.Window, cursor x.Cursor, deviceId DeviceId) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(window)). Write4b(uint32(cursor)). Write2b(uint16(deviceId)). WritePad(2). End() return } // #WREQ func encodeXIChangeHierarchy(changes []HierarchyChange) (b x.RequestBody) { var changesSize int for _, change := range changes { changesSize += int(change.getLen()) } b0 := b.AddBlock(1 + changesSize). Write1b(uint8(len(changes))). WritePad(3) for _, change := range changes { writeHierarchyChange(b0, change) } b0.End() return } func writeHierarchyChange(b *x.FixedSizeBuf, v HierarchyChange) { b.Write2b(v.getHierarchyType()) b.Write2b(v.getLen() + 1) v.writeTo(b) } type HierarchyChange interface { writeTo(b *x.FixedSizeBuf) getHierarchyType() uint16 getLen() uint16 // Length in 4 byte units. } // size (1 + (len(Name) + pad(len(name))) / 4) * 4 byte type AddMaster struct { SendCore bool Enable bool Name string } func (am *AddMaster) writeTo(b *x.FixedSizeBuf) { nameLen := len(am.Name) b.Write2b(uint16(nameLen)) b.WriteBool(am.SendCore) b.WriteBool(am.Enable) b.WriteString(am.Name) b.WritePad(x.Pad(nameLen)) } func (*AddMaster) getHierarchyType() uint16 { return HierarchyChangeTypeAddMaster } func (am *AddMaster) getLen() uint16 { nameLen := len(am.Name) return uint16(1 + (nameLen+x.Pad(nameLen))/4) } // size 2 * 4byte type RemoveMaster struct { DeviceId DeviceId ReturnMode uint8 ReturnPointer DeviceId ReturnKeyboard DeviceId } func (rm *RemoveMaster) writeTo(b *x.FixedSizeBuf) { b.Write2b(uint16(rm.DeviceId)) b.Write1b(rm.ReturnMode) b.WritePad(1) b.Write2b(uint16(rm.ReturnPointer)) b.Write2b(uint16(rm.ReturnKeyboard)) } func (*RemoveMaster) getHierarchyType() uint16 { return HierarchyChangeTypeRemoveMaster } func (rm *RemoveMaster) getLen() uint16 { return 2 } // size 1 * 4 byte type AttachSlave struct { DeviceId DeviceId Master DeviceId } func (as *AttachSlave) writeTo(b *x.FixedSizeBuf) { b.Write2b(uint16(as.DeviceId)) b.Write2b(uint16(as.Master)) } func (*AttachSlave) getHierarchyType() uint16 { return HierarchyChangeTypeAttachSlave } func (as *AttachSlave) getLen() uint16 { return 1 } // size 1 * 4 byte type DetachSlave struct { DeviceId DeviceId } func (ds *DetachSlave) writeTo(b *x.FixedSizeBuf) { b.Write2b(uint16(ds.DeviceId)) b.WritePad(2) } func (*DetachSlave) getHierarchyType() uint16 { return HierarchyChangeTypeDetachSlave } func (ds *DetachSlave) getLen() uint16 { return 1 } // #WREQ func encodeXISetClientPointer(window x.Window, deviceId DeviceId) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write2b(uint16(deviceId)). WritePad(2). End() return } // #WREQ func encodeXIGetClientPointer(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type XIGetClientPointerReply struct { Set bool DeviceId DeviceId } func readXIGetClientPointerReply(r *x.Reader, v *XIGetClientPointerReply) error { if r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.Set = r.ReadBool() r.ReadPad(1) v.DeviceId = DeviceId(r.Read2b()) // 3 return nil } // #WREQ func encodeXISetFocus(focus x.Window, time x.Timestamp, deviceId DeviceId) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(focus)). Write4b(uint32(time)). Write2b(uint16(deviceId)). WritePad(2). End() return } // #WREQ func encodeXIGetFocus(deviceId DeviceId) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceId)). WritePad(2). End() return } type XIGetFocusReply struct { Focus x.Window } func readXIGetFocusReply(r *x.Reader, v *XIGetFocusReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.Focus = x.Window(r.Read4b()) // 3 return nil } // #WREQ func encodeXIGrabDevice(window x.Window, time x.Timestamp, cursor x.Cursor, deviceId DeviceId, mode, pairedDeviceMode uint8, ownerEvents bool, masks []EventMask) (b x.RequestBody) { var masksSize int for _, mask := range masks { masksSize += mask.getSizeIn4b() } b0 := b.AddBlock(5 + masksSize). Write4b(uint32(window)). Write4b(uint32(time)). Write4b(uint32(cursor)). Write2b(uint16(deviceId)). Write1b(mode). Write1b(pairedDeviceMode). WriteBool(ownerEvents). WritePad(1). Write2b(uint16(len(masks))) for _, mask := range masks { writeEventMask(b0, mask) } b0.End() return } type XIGrabDeviceReply struct { Status uint8 } func readXIGrabDeviceReply(r *x.Reader, v *XIGrabDeviceReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.Status = r.Read1b() // 3 return nil } // #WREQ func encodeXIUngrabDevice(time x.Timestamp, deviceId DeviceId) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(time)). Write2b(uint16(deviceId)). WritePad(2). End() return } // #WREQ func encodeXIAllowEvents(time x.Timestamp, deviceId DeviceId, eventMode uint8, touchId uint32, grabWindow x.Window) (b x.RequestBody) { b.AddBlock(4). Write4b(uint32(time)). Write2b(uint16(deviceId)). Write1b(eventMode). WritePad(1). Write4b(touchId). Write4b(uint32(grabWindow)). End() return } // #WREQ func encodeXIPassiveGrabDevice(grabWindow x.Window, cursor x.Cursor, detail uint32, deviceId DeviceId, grabType, grabMode, pairedDeviceMode uint8, ownerEvents bool, masks []uint32, modifiers []uint32) (b x.RequestBody) { b0 := b.AddBlock(7 + len(masks) + len(modifiers)). WritePad(4). // unused time field Write4b(uint32(grabWindow)). Write4b(uint32(cursor)). Write4b(detail). // 4 Write2b(uint16(deviceId)). Write2b(uint16(len(modifiers))). Write2b(uint16(len(masks))). Write1b(grabType). Write1b(grabMode). // 6 Write1b(pairedDeviceMode). WriteBool(ownerEvents). WritePad(2) // 7 for _, mask := range masks { b0.Write4b(mask) } for _, mod := range modifiers { b0.Write4b(mod) } b0.End() return } type XIPassiveGrabDeviceReply struct { Modifiers []GrabModifierInfo } func readXIPassiveGrabDeviceReply(r *x.Reader, v *XIPassiveGrabDeviceReply) error { if r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) modifiersLen := int(r.Read2b()) r.ReadPad(22) // 8 if modifiersLen > 0 { if !r.RemainAtLeast4b(2 * modifiersLen) { return x.ErrDataLenShort } v.Modifiers = make([]GrabModifierInfo, modifiersLen) for i := 0; i < modifiersLen; i++ { readGrabModifierInfo(r, &v.Modifiers[i]) } } return nil } // size: 2 * 4b type GrabModifierInfo struct { Modifiers uint32 Status uint8 } func readGrabModifierInfo(r *x.Reader, v *GrabModifierInfo) { v.Modifiers = r.Read4b() v.Status = r.Read1b() r.ReadPad(3) } // #WREQ func encodeXIPassiveUngrabDevice(grabWindow x.Window, detail uint32, deviceId DeviceId, grabType uint8, modifiers []uint32) (b x.RequestBody) { b0 := b.AddBlock(4 + len(modifiers)). Write4b(uint32(grabWindow)). Write4b(detail). Write2b(uint16(deviceId)). Write2b(uint16(len(modifiers))). Write1b(grabType). WritePad(3) for _, mod := range modifiers { b0.Write4b(mod) } b0.End() return } // #WREQ func encodeXIListProperties(deviceId DeviceId) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceId)). WritePad(2). End() return } type XIListPropertiesReply struct { Properties []x.Atom } func readXIListPropertiesReply(r *x.Reader, v *XIListPropertiesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) propertiesLen := int(r.Read2b()) r.ReadPad(22) if propertiesLen > 0 { if !r.RemainAtLeast4b(propertiesLen) { return x.ErrDataLenShort } v.Properties = make([]x.Atom, propertiesLen) for i := 0; i < propertiesLen; i++ { v.Properties[i] = x.Atom(r.Read4b()) } } return nil } // #WREQ func encodeXIChangeProperty(deviceId DeviceId, mode uint8, format uint8, property x.Atom, Type x.Atom, data []byte) (b x.RequestBody) { dataLen := len(data) b.AddBlock(4). Write2b(uint16(deviceId)). Write1b(mode). Write1b(format). Write4b(uint32(property)). Write4b(uint32(Type)). Write4b(uint32(dataLen / (int(format) / 8))). End() b.AddBytes(data) return } // #WREQ func encodeXIDeleteProperty(deviceId DeviceId, property x.Atom) (b x.RequestBody) { b.AddBlock(2). Write2b(uint16(deviceId)). WritePad(2). Write4b(uint32(property)). End() return } // #WREQ func encodeXIGetProperty(deviceId DeviceId, delete bool, property x.Atom, Type x.Atom, offset, len uint32) (b x.RequestBody) { b.AddBlock(5). Write2b(uint16(deviceId)). WriteBool(delete). WritePad(1). Write4b(uint32(property)). Write4b(uint32(Type)). Write4b(offset). Write4b(len). End() return } type XIGetPropertyReply struct { Type x.Atom BytesAfter uint32 NumItems uint32 Format uint8 Data []byte } func readXIGetPropertyReply(r *x.Reader, v *XIGetPropertyReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) v.Type = x.Atom(r.Read4b()) v.BytesAfter = r.Read4b() v.NumItems = r.Read4b() // 5 v.Format = r.Read1b() // unused r.ReadPad(11) // 8 n := int(v.NumItems) * int(v.Format/8) var err error v.Data, err = r.ReadBytes(n) return err } go-x11-client-1.0.2/ext/input/input1.go000066400000000000000000000034641460713373000175230ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import ( "github.com/linuxdeepin/go-x11-client" ) // #WREQ func encodeOpenDevice(deviceId uint8) (b x.RequestBody) { b.AddBlock(1). Write1b(deviceId). WritePad(3). End() return } type OpenDeviceReply struct { XIReplyType uint8 ClassInfos []ClassInfo } func readOpenDeviceReply(r *x.Reader, v *OpenDeviceReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.XIReplyType, _ = r.ReadReplyHeader() classInfosLen := int(r.Read1b()) r.ReadPad(23) // 8 if classInfosLen > 0 { if !r.RemainAtLeast(2 * classInfosLen) { return x.ErrDataLenShort } v.ClassInfos = make([]ClassInfo, classInfosLen) for i := 0; i < classInfosLen; i++ { v.ClassInfos[i] = readClassInfo(r) } } return nil } func FindTypeAndClass(deviceId uint8, classInfos []ClassInfo, classId uint8, eventCode uint8) (Type uint8, class EventClass) { for _, classInfo := range classInfos { if classInfo.ClassId == classId { Type = classInfo.EventTypeBase + eventCode class = EventClass(uint32(deviceId)<<8 | uint32(Type)) } } return } // size: 2b type ClassInfo struct { ClassId uint8 EventTypeBase uint8 } func readClassInfo(r *x.Reader) ClassInfo { var v ClassInfo v.ClassId = r.Read1b() v.EventTypeBase = r.Read1b() return v } // #WREQ func encodeCloseDevice(deviceId uint8) (b x.RequestBody) { b.AddBlock(1). Write1b(deviceId). WritePad(3). End() return } // #WREQ func encodeSelectExtensionEvent(window x.Window, classes []EventClass) (b x.RequestBody) { b0 := b.AddBlock(2 + len(classes)). Write4b(uint32(window)). Write2b(uint16(len(classes))). WritePad(2) for _, class := range classes { b0.Write4b(uint32(class)) } b0.End() return } go-x11-client-1.0.2/ext/input/input1_req_auto.go000066400000000000000000000040421460713373000214130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import x "github.com/linuxdeepin/go-x11-client" func OpenDevice(conn *x.Conn, deviceId uint8) OpenDeviceCookie { body := encodeOpenDevice(deviceId) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: OpenDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return OpenDeviceCookie(seq) } func (cookie OpenDeviceCookie) Reply(conn *x.Conn) (*OpenDeviceReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply OpenDeviceReply err = readOpenDeviceReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CloseDevice(conn *x.Conn, deviceId uint8) { body := encodeCloseDevice(deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CloseDeviceOpcode, }, Body: body, } conn.SendRequest(0, req) } func CloseDeviceChecked(conn *x.Conn, deviceId uint8) x.VoidCookie { body := encodeCloseDevice(deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CloseDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SelectExtensionEvent(conn *x.Conn, window x.Window, classes []EventClass) { body := encodeSelectExtensionEvent(window, classes) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectExtensionEventOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectExtensionEventChecked(conn *x.Conn, window x.Window, classes []EventClass) x.VoidCookie { body := encodeSelectExtensionEvent(window, classes) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectExtensionEventOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/input/input_event.go000066400000000000000000000417641460713373000206500ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import ( "github.com/linuxdeepin/go-x11-client" "github.com/linuxdeepin/go-x11-client/ext/xfixes" ) type EventHeader struct { DeviceId DeviceId Time x.Timestamp } // ge event type HierarchyEvent struct { EventHeader Flags uint32 Infos []HierarchyInfo } // size: 3 * 4b type HierarchyInfo struct { DeviceId DeviceId Attachment DeviceId Type uint8 Enabled bool Flags uint32 } func readHierarchyInfo(r *x.Reader, v *HierarchyInfo) { v.DeviceId = DeviceId(r.Read2b()) v.Attachment = DeviceId(r.Read2b()) v.Type = r.Read1b() v.Enabled = r.ReadBool() r.ReadPad(2) v.Flags = r.Read4b() // 3 } // EventHeader size: 6b func readEventHeader(r *x.Reader) EventHeader { var v EventHeader v.DeviceId = DeviceId(r.Read2b()) v.Time = x.Timestamp(r.Read4b()) return v } func readHierarchyEvent(r *x.Reader, v *HierarchyEvent) error { if !r.RemainAtLeast(22) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.Flags = r.Read4b() infosLen := int(r.Read2b()) r.ReadPad(10) // 22b if infosLen > 0 { v.Infos = make([]HierarchyInfo, infosLen) for i := 0; i < infosLen; i++ { readHierarchyInfo(r, &v.Infos[i]) } } return nil } type DeviceChangedEvent struct { EventHeader SourceId DeviceId Reason uint8 Classes []DeviceClass } func readDeviceChangedEvent(r *x.Reader, v *DeviceChangedEvent) error { if !r.RemainAtLeast(22) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) classesLen := int(r.Read2b()) v.SourceId = DeviceId(r.Read2b()) v.Reason = r.Read1b() r.ReadPad(11) // 22b if classesLen > 0 { v.Classes = make([]DeviceClass, classesLen) for i := 0; i < classesLen; i++ { var err error v.Classes[i], err = readDeviceClass(r) if err != nil { return err } } } return nil } // ge event type DeviceEvent struct { EventHeader Detail uint32 Root x.Window Event x.Window Child x.Window RootX float32 RootY float32 EventX float32 EventY float32 SourceId DeviceId Flags uint32 Mods ModifierInfo Group GroupInfo ButtonMask []uint32 ValuatorMask []uint32 AxisValues []float32 } func readDeviceEvent(r *x.Reader, v *DeviceEvent) error { if !r.RemainAtLeast(70) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.Detail = r.Read4b() v.Root = x.Window(r.Read4b()) v.Event = x.Window(r.Read4b()) v.Child = x.Window(r.Read4b()) // 22b v.RootX = readFP1616(r) v.RootY = readFP1616(r) v.EventX = readFP1616(r) v.EventY = readFP1616(r) // 38b buttonsLen := int(r.Read2b()) valuatorsLen := int(r.Read2b()) v.SourceId = DeviceId(r.Read2b()) r.ReadPad(2) // 46b v.Flags = r.Read4b() readModifierInfo(r, &v.Mods) readGroupInfo(r, &v.Group) // 70b if buttonsLen > 0 { if !r.RemainAtLeast4b(buttonsLen) { return x.ErrDataLenShort } v.ButtonMask = make([]uint32, buttonsLen) for i := 0; i < buttonsLen; i++ { v.ButtonMask[i] = r.Read4b() } } if valuatorsLen > 0 { if !r.RemainAtLeast4b(valuatorsLen) { return x.ErrDataLenShort } v.ValuatorMask = make([]uint32, valuatorsLen) for i := 0; i < valuatorsLen; i++ { v.ValuatorMask[i] = r.Read4b() } } // TODO AxisValue return nil } type KeyPressEvent struct { DeviceEvent } func readKeyPressEvent(r *x.Reader, v *KeyPressEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type KeyReleaseEvent struct { DeviceEvent } func readKeyReleaseEvent(r *x.Reader, v *KeyReleaseEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type ButtonPressEvent struct { DeviceEvent } func readButtonPressEvent(r *x.Reader, v *ButtonPressEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type ButtonReleaseEvent struct { DeviceEvent } func readButtonReleaseEvent(r *x.Reader, v *ButtonReleaseEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type MotionEvent struct { DeviceEvent } func readMotionEvent(r *x.Reader, v *MotionEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } // ge event type EnterLeaveEvent struct { EventHeader SourceId DeviceId Mode uint8 Detail uint8 Root x.Window Event x.Window Child x.Window RootX float32 RootY float32 EventX float32 EventY float32 SameScreen bool Focus bool Mods ModifierInfo Group GroupInfo Buttons []uint32 } func readEnterLeaveEvent(r *x.Reader, v *EnterLeaveEvent) error { if !r.RemainAtLeast(62) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.SourceId = DeviceId(r.Read2b()) v.Mode = r.Read1b() v.Detail = r.Read1b() // 10b v.Root = x.Window(r.Read4b()) v.Event = x.Window(r.Read4b()) v.Child = x.Window(r.Read4b()) // 22b v.RootX = readFP1616(r) v.RootY = readFP1616(r) v.EventX = readFP1616(r) v.EventY = readFP1616(r) // 38b v.SameScreen = r.ReadBool() v.Focus = r.ReadBool() buttonsLen := int(r.Read2b()) // 42b readModifierInfo(r, &v.Mods) readGroupInfo(r, &v.Group) // 62b if buttonsLen > 0 { if !r.RemainAtLeast4b(buttonsLen) { return x.ErrDataLenShort } v.Buttons = make([]uint32, buttonsLen) for i := 0; i < buttonsLen; i++ { v.Buttons[i] = r.Read4b() } } return nil } type EnterEvent struct { EnterLeaveEvent } func readEnterEvent(r *x.Reader, v *EnterEvent) error { return readEnterLeaveEvent(r, &v.EnterLeaveEvent) } type LeaveEvent struct { EnterLeaveEvent } func readLeaveEvent(r *x.Reader, v *LeaveEvent) error { return readEnterLeaveEvent(r, &v.EnterLeaveEvent) } type FocusInEvent struct { EnterLeaveEvent } func readFocusInEvent(r *x.Reader, v *FocusInEvent) error { return readEnterLeaveEvent(r, &v.EnterLeaveEvent) } type FocusOutEvent struct { EnterLeaveEvent } func readFocusOutEvent(r *x.Reader, v *FocusOutEvent) error { return readEnterLeaveEvent(r, &v.EnterLeaveEvent) } // ge event type PropertyEvent struct { EventHeader Property x.Atom What uint8 } func readPropertyEvent(r *x.Reader, v *PropertyEvent) error { if !r.RemainAtLeast(11) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.Property = x.Atom(r.Read4b()) v.What = r.Read1b() // 11b return nil } // ge event type RawEvent struct { EventHeader Detail uint32 SourceId DeviceId Flags uint32 ValuatorMask []uint32 AxisValues []float32 AxisValuesRaw []float32 } func readRawEvent(r *x.Reader, v *RawEvent) error { if !r.RemainAtLeast(22) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.Detail = r.Read4b() v.SourceId = DeviceId(r.Read2b()) valuatorsLen := int(r.Read2b()) // 14b v.Flags = r.Read4b() r.ReadPad(4) // 22b if valuatorsLen > 0 { if !r.RemainAtLeast4b(valuatorsLen) { return x.ErrDataLenShort } v.ValuatorMask = make([]uint32, valuatorsLen) for i := 0; i < valuatorsLen; i++ { v.ValuatorMask[i] = r.Read4b() } } // TODO: axisValues // TODO: axisValuesRaw return nil } type RawKeyPressEvent struct { RawEvent } func readRawKeyPressEvent(r *x.Reader, v *RawKeyPressEvent) error { return readRawEvent(r, &v.RawEvent) } type RawKeyReleaseEvent struct { RawEvent } func readRawKeyReleaseEvent(r *x.Reader, v *RawKeyReleaseEvent) error { return readRawEvent(r, &v.RawEvent) } type RawButtonPressEvent struct { RawEvent } func readRawButtonPressEvent(r *x.Reader, v *RawButtonPressEvent) error { return readRawEvent(r, &v.RawEvent) } type RawButtonReleaseEvent struct { RawEvent } func readRawButtonReleaseEvent(r *x.Reader, v *RawButtonReleaseEvent) error { return readRawEvent(r, &v.RawEvent) } type RawMotionEvent struct { RawEvent } func readRawMotionEvent(r *x.Reader, v *RawMotionEvent) error { return readRawEvent(r, &v.RawEvent) } type TouchBeginEvent struct { DeviceEvent } func readTouchBeginEvent(r *x.Reader, v *TouchBeginEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type TouchUpdateEvent struct { DeviceEvent } func readTouchUpdateEvent(r *x.Reader, v *TouchUpdateEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type TouchEndEvent struct { DeviceEvent } func readTouchEndEvent(r *x.Reader, v *TouchEndEvent) error { return readDeviceEvent(r, &v.DeviceEvent) } type TouchOwnershipEvent struct { EventHeader TouchId uint32 Root x.Window Event x.Window Child x.Window SourceId DeviceId Flags uint32 } func readTouchOwnershipEvent(r *x.Reader, v *TouchOwnershipEvent) error { if !r.RemainAtLeast(30) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.TouchId = r.Read4b() // 10b v.Root = x.Window(r.Read4b()) v.Event = x.Window(r.Read4b()) v.Child = x.Window(r.Read4b()) v.SourceId = DeviceId(r.Read2b()) r.ReadPad(2) v.Flags = r.Read4b() // 30b return nil } type RawTouchBeginEvent struct { RawEvent } func readRawTouchBeginEvent(r *x.Reader, v *RawTouchBeginEvent) error { return readRawEvent(r, &v.RawEvent) } type RawTouchUpdateEvent struct { RawEvent } func readRawTouchUpdateEvent(r *x.Reader, v *RawTouchUpdateEvent) error { return readRawEvent(r, &v.RawEvent) } type RawTouchEndEvent struct { RawEvent } func readRawTouchEndEvent(r *x.Reader, v *RawTouchEndEvent) error { return readRawEvent(r, &v.RawEvent) } // ge event type BarrierEvent struct { EventHeader EventId uint32 Root x.Window Event x.Window Barrier xfixes.Barrier DTime uint32 Flags uint32 SourceId DeviceId RootX float32 RootY float32 DX float64 DY float64 } func readBarrierEvent(r *x.Reader, v *BarrierEvent) error { if !r.RemainAtLeast(58) { return x.ErrDataLenShort } v.EventHeader = readEventHeader(r) v.EventId = r.Read4b() // 10b v.Root = x.Window(r.Read4b()) v.Event = x.Window(r.Read4b()) v.Barrier = xfixes.Barrier(r.Read4b()) v.DTime = r.Read4b() v.Flags = r.Read4b() v.SourceId = DeviceId(r.Read2b()) r.ReadPad(2) // 34b v.RootX = readFP1616(r) v.RootY = readFP1616(r) v.DX = readFP3232(r) v.DY = readFP3232(r) //58b return nil } type BarrierHitEvent struct { BarrierEvent } func readBarrierHitEvent(r *x.Reader, v *BarrierHitEvent) error { return readBarrierEvent(r, &v.BarrierEvent) } type BarrierLeaveEvent struct { BarrierHitEvent } func readBarrierLeaveEvent(r *x.Reader, v *BarrierLeaveEvent) error { return readBarrierEvent(r, &v.BarrierEvent) } type DeviceValuatorEvent struct { DeviceId uint8 Sequence uint16 DeviceState uint16 FirstValuator uint8 Valuators []int32 } func readDeviceValuatorEvent(r *x.Reader, v *DeviceValuatorEvent) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.DeviceState = r.Read2b() valuatorsLen := int(r.Read1b()) v.FirstValuator = r.Read1b() // 2 if valuatorsLen > 0 { if !r.RemainAtLeast4b(valuatorsLen) { return x.ErrDataLenShort } v.Valuators = make([]int32, valuatorsLen) for i := 0; i < valuatorsLen; i++ { v.Valuators[i] = int32(r.Read4b()) } } return nil } type DeviceKeyEvent struct { Detail uint8 Sequence uint16 Time x.Timestamp Root x.Window Event x.Window Child x.Window RootX int16 RootY int16 EventX int16 EventY int16 State uint16 SameScreen bool DeviceId uint8 } func readDeviceKeyEvent(r *x.Reader, v *DeviceKeyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Detail, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.Root = x.Window(r.Read4b()) v.Event = x.Window(r.Read4b()) v.Child = x.Window(r.Read4b()) // 5 v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) v.EventX = int16(r.Read2b()) v.EventY = int16(r.Read2b()) v.State = r.Read2b() v.SameScreen = r.ReadBool() v.DeviceId = r.Read1b() // 8 return nil } type DeviceKeyPressEvent struct { DeviceKeyEvent } func readDeviceKeyPressEvent(r *x.Reader, v *DeviceKeyPressEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceKeyReleaseEvent struct { DeviceKeyEvent } func readDeviceKeyReleaseEvent(r *x.Reader, v *DeviceKeyReleaseEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceButtonPressEvent struct { DeviceKeyEvent } func readDeviceButtonPressEvent(r *x.Reader, v *DeviceButtonPressEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceButtonReleaseEvent struct { DeviceKeyEvent } func readDeviceButtonReleaseEvent(r *x.Reader, v *DeviceButtonReleaseEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceMotionNotifyEvent struct { DeviceKeyEvent } func readDeviceMotionNotifyEvent(r *x.Reader, v *DeviceMotionNotifyEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceFocusEvent struct { Detail uint8 Sequence uint16 Time x.Timestamp Window x.Window Mode uint8 DeviceId uint8 } func readDeviceFocusEvent(r *x.Reader, v *DeviceFocusEvent) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } v.Detail, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.Window = x.Window(r.Read4b()) v.Mode = r.Read1b() v.DeviceId = r.Read1b() // 4 return nil } type DeviceFocusInEvent struct { DeviceFocusEvent } func readDeviceFocusInEvent(r *x.Reader, v *DeviceFocusInEvent) error { return readDeviceFocusEvent(r, &v.DeviceFocusEvent) } type DeviceFocusOutEvent struct { DeviceFocusEvent } func readDeviceFocusOutEvent(r *x.Reader, v *DeviceFocusOutEvent) error { return readDeviceFocusEvent(r, &v.DeviceFocusEvent) } type ProximityInEvent struct { DeviceKeyEvent } func readProximityInEvent(r *x.Reader, v *ProximityInEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type ProximityOutEvent struct { DeviceKeyEvent } func readProximityOutEvent(r *x.Reader, v *ProximityOutEvent) error { return readDeviceKeyEvent(r, &v.DeviceKeyEvent) } type DeviceStateNotifyEvent struct { DeviceId uint8 Sequence uint16 Time x.Timestamp NumKeys uint8 NumButtons uint8 NumValuators uint8 ClassesReported uint8 Buttons []uint8 // len 4 Keys []uint8 // len 4 Valuators []uint32 // len 3 } func readDeviceStateNotifyEvent(r *x.Reader, v *DeviceStateNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.NumKeys = r.Read1b() v.NumButtons = r.Read1b() v.NumValuators = r.Read1b() v.ClassesReported = r.Read1b() // 3 v.Buttons = r.MustReadBytes(4) v.Keys = r.MustReadBytes(4) v.Valuators = make([]uint32, 3) // 8 for i := 0; i < 3; i++ { v.Valuators[i] = r.Read4b() } return nil } type DeviceMappingNotifyEvent struct { DeviceId uint8 Sequence uint16 Request uint8 FirstKeycode x.Keycode Count uint8 Time x.Timestamp } func readDeviceMappingNotifyEvent(r *x.Reader, v *DeviceMappingNotifyEvent) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.Request = r.Read1b() v.FirstKeycode = x.Keycode(r.Read1b()) v.Count = r.Read1b() r.ReadPad(1) v.Time = x.Timestamp(r.Read4b()) // 3 return nil } type ChangeDeviceNotifyEvent struct { DeviceId uint8 Sequence uint16 Time x.Timestamp Request uint8 } func readChangeDeviceNotifyEvent(r *x.Reader, v *ChangeDeviceNotifyEvent) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.Request = r.Read1b() // 3 return nil } type DeviceKeyStateNotifyEvent struct { DeviceId uint8 Sequence uint16 Keys []uint8 // len: 28 } func readDeviceKeyStateNotifyEvent(r *x.Reader, v *DeviceKeyStateNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.Keys = r.MustReadBytes(28) // 8 return nil } type DeviceButtonStateNotifyEvent struct { DeviceId uint8 Sequence uint16 Buttons []uint8 // len: 28 } func readDeviceButtonStateNotifyEvent(r *x.Reader, v *DeviceButtonStateNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceId, v.Sequence = r.ReadEventHeader() v.Buttons = r.MustReadBytes(28) // 8 return nil } type DevicePresenceNotifyEvent struct { Sequence uint16 Time x.Timestamp DevChange uint8 DeviceId uint8 Control uint16 } func readDevicePresenceNotifyEvent(r *x.Reader, v *DevicePresenceNotifyEvent) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.DevChange = r.Read1b() v.DeviceId = r.Read1b() v.Control = r.Read2b() // 3 return nil } type DevicePropertyNotifyEvent struct { State uint8 Sequence uint16 Time x.Timestamp Property x.Atom DeviceId uint8 } func readDevicePropertyNotifyEvent(r *x.Reader, v *DevicePropertyNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.State, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.Property = x.Atom(r.Read4b()) r.ReadPad(19) v.DeviceId = r.Read1b() // 8 return nil } go-x11-client-1.0.2/ext/input/input_req_auto.go000066400000000000000000000363461460713373000213460ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package input import x "github.com/linuxdeepin/go-x11-client" func XIQueryVersion(conn *x.Conn, majorVersion, minorVersion uint16) XIQueryVersionCookie { body := encodeXIQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIQueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIQueryVersionCookie(seq) } func (cookie XIQueryVersionCookie) Reply(conn *x.Conn) (*XIQueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIQueryVersionReply err = readXIQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIQueryDevice(conn *x.Conn, deviceId DeviceId) XIQueryDeviceCookie { body := encodeXIQueryDevice(deviceId) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIQueryDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIQueryDeviceCookie(seq) } func (cookie XIQueryDeviceCookie) Reply(conn *x.Conn) (*XIQueryDeviceReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIQueryDeviceReply err = readXIQueryDeviceReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XISelectEvents(conn *x.Conn, window x.Window, masks []EventMask) { body := encodeXISelectEvents(window, masks) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISelectEventsOpcode, }, Body: body, } conn.SendRequest(0, req) } func XISelectEventsChecked(conn *x.Conn, window x.Window, masks []EventMask) x.VoidCookie { body := encodeXISelectEvents(window, masks) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISelectEventsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIGetSelectedEvents(conn *x.Conn, window x.Window) XIGetSelectedEventsCookie { body := encodeXIGetSelectedEvents(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIGetSelectedEventsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIGetSelectedEventsCookie(seq) } func (cookie XIGetSelectedEventsCookie) Reply(conn *x.Conn) (*XIGetSelectedEventsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIGetSelectedEventsReply err = readXIGetSelectedEventsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIQueryPointer(conn *x.Conn, window x.Window, deviceId DeviceId) XIQueryPointerCookie { body := encodeXIQueryPointer(window, deviceId) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIQueryPointerOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIQueryPointerCookie(seq) } func (cookie XIQueryPointerCookie) Reply(conn *x.Conn) (*XIQueryPointerReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIQueryPointerReply err = readXIQueryPointerReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIWarpPointer(conn *x.Conn, srcWin, dstWin x.Window, srcX, srcY float32, srcWidth, srcHeight uint16, dstX, dstY float32, deviceId DeviceId) { body := encodeXIWarpPointer(srcWin, dstWin, srcX, srcY, srcWidth, srcHeight, dstX, dstY, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIWarpPointerOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIWarpPointerChecked(conn *x.Conn, srcWin, dstWin x.Window, srcX, srcY float32, srcWidth, srcHeight uint16, dstX, dstY float32, deviceId DeviceId) x.VoidCookie { body := encodeXIWarpPointer(srcWin, dstWin, srcX, srcY, srcWidth, srcHeight, dstX, dstY, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIWarpPointerOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIChangeCursor(conn *x.Conn, window x.Window, cursor x.Cursor, deviceId DeviceId) { body := encodeXIChangeCursor(window, cursor, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangeCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIChangeCursorChecked(conn *x.Conn, window x.Window, cursor x.Cursor, deviceId DeviceId) x.VoidCookie { body := encodeXIChangeCursor(window, cursor, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangeCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIChangeHierarchy(conn *x.Conn, changes []HierarchyChange) { body := encodeXIChangeHierarchy(changes) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangeHierarchyOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIChangeHierarchyChecked(conn *x.Conn, changes []HierarchyChange) x.VoidCookie { body := encodeXIChangeHierarchy(changes) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangeHierarchyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XISetClientPointer(conn *x.Conn, window x.Window, deviceId DeviceId) { body := encodeXISetClientPointer(window, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISetClientPointerOpcode, }, Body: body, } conn.SendRequest(0, req) } func XISetClientPointerChecked(conn *x.Conn, window x.Window, deviceId DeviceId) x.VoidCookie { body := encodeXISetClientPointer(window, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISetClientPointerOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIGetClientPointer(conn *x.Conn, window x.Window) XIGetClientPointerCookie { body := encodeXIGetClientPointer(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIGetClientPointerOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIGetClientPointerCookie(seq) } func (cookie XIGetClientPointerCookie) Reply(conn *x.Conn) (*XIGetClientPointerReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIGetClientPointerReply err = readXIGetClientPointerReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XISetFocus(conn *x.Conn, focus x.Window, time x.Timestamp, deviceId DeviceId) { body := encodeXISetFocus(focus, time, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISetFocusOpcode, }, Body: body, } conn.SendRequest(0, req) } func XISetFocusChecked(conn *x.Conn, focus x.Window, time x.Timestamp, deviceId DeviceId) x.VoidCookie { body := encodeXISetFocus(focus, time, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XISetFocusOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIGetFocus(conn *x.Conn, deviceId DeviceId) XIGetFocusCookie { body := encodeXIGetFocus(deviceId) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIGetFocusOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIGetFocusCookie(seq) } func (cookie XIGetFocusCookie) Reply(conn *x.Conn) (*XIGetFocusReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIGetFocusReply err = readXIGetFocusReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIGrabDevice(conn *x.Conn, window x.Window, time x.Timestamp, cursor x.Cursor, deviceId DeviceId, mode, pairedDeviceMode uint8, ownerEvents bool, masks []EventMask) XIGrabDeviceCookie { body := encodeXIGrabDevice(window, time, cursor, deviceId, mode, pairedDeviceMode, ownerEvents, masks) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIGrabDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIGrabDeviceCookie(seq) } func (cookie XIGrabDeviceCookie) Reply(conn *x.Conn) (*XIGrabDeviceReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIGrabDeviceReply err = readXIGrabDeviceReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIUngrabDevice(conn *x.Conn, time x.Timestamp, deviceId DeviceId) { body := encodeXIUngrabDevice(time, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIUngrabDeviceOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIUngrabDeviceChecked(conn *x.Conn, time x.Timestamp, deviceId DeviceId) x.VoidCookie { body := encodeXIUngrabDevice(time, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIUngrabDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIAllowEvents(conn *x.Conn, time x.Timestamp, deviceId DeviceId, eventMode uint8, touchId uint32, grabWindow x.Window) { body := encodeXIAllowEvents(time, deviceId, eventMode, touchId, grabWindow) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIAllowEventsOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIAllowEventsChecked(conn *x.Conn, time x.Timestamp, deviceId DeviceId, eventMode uint8, touchId uint32, grabWindow x.Window) x.VoidCookie { body := encodeXIAllowEvents(time, deviceId, eventMode, touchId, grabWindow) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIAllowEventsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIPassiveGrabDevice(conn *x.Conn, grabWindow x.Window, cursor x.Cursor, detail uint32, deviceId DeviceId, grabType, grabMode, pairedDeviceMode uint8, ownerEvents bool, masks []uint32, modifiers []uint32) XIPassiveGrabDeviceCookie { body := encodeXIPassiveGrabDevice(grabWindow, cursor, detail, deviceId, grabType, grabMode, pairedDeviceMode, ownerEvents, masks, modifiers) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIPassiveGrabDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIPassiveGrabDeviceCookie(seq) } func (cookie XIPassiveGrabDeviceCookie) Reply(conn *x.Conn) (*XIPassiveGrabDeviceReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIPassiveGrabDeviceReply err = readXIPassiveGrabDeviceReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIPassiveUngrabDevice(conn *x.Conn, grabWindow x.Window, detail uint32, deviceId DeviceId, grabType uint8, modifiers []uint32) { body := encodeXIPassiveUngrabDevice(grabWindow, detail, deviceId, grabType, modifiers) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIPassiveUngrabDeviceOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIPassiveUngrabDeviceChecked(conn *x.Conn, grabWindow x.Window, detail uint32, deviceId DeviceId, grabType uint8, modifiers []uint32) x.VoidCookie { body := encodeXIPassiveUngrabDevice(grabWindow, detail, deviceId, grabType, modifiers) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIPassiveUngrabDeviceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIListProperties(conn *x.Conn, deviceId DeviceId) XIListPropertiesCookie { body := encodeXIListProperties(deviceId) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIListPropertiesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIListPropertiesCookie(seq) } func (cookie XIListPropertiesCookie) Reply(conn *x.Conn) (*XIListPropertiesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIListPropertiesReply err = readXIListPropertiesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func XIChangeProperty(conn *x.Conn, deviceId DeviceId, mode uint8, format uint8, property x.Atom, Type x.Atom, data []byte) { body := encodeXIChangeProperty(deviceId, mode, format, property, Type, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangePropertyOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIChangePropertyChecked(conn *x.Conn, deviceId DeviceId, mode uint8, format uint8, property x.Atom, Type x.Atom, data []byte) x.VoidCookie { body := encodeXIChangeProperty(deviceId, mode, format, property, Type, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIChangePropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIDeleteProperty(conn *x.Conn, deviceId DeviceId, property x.Atom) { body := encodeXIDeleteProperty(deviceId, property) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIDeletePropertyOpcode, }, Body: body, } conn.SendRequest(0, req) } func XIDeletePropertyChecked(conn *x.Conn, deviceId DeviceId, property x.Atom) x.VoidCookie { body := encodeXIDeleteProperty(deviceId, property) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: XIDeletePropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func XIGetProperty(conn *x.Conn, deviceId DeviceId, delete bool, property x.Atom, Type x.Atom, offset, len uint32) XIGetPropertyCookie { body := encodeXIGetProperty(deviceId, delete, property, Type, offset, len) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: XIGetPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return XIGetPropertyCookie(seq) } func (cookie XIGetPropertyCookie) Reply(conn *x.Conn) (*XIGetPropertyReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply XIGetPropertyReply err = readXIGetPropertyReply(r, &reply) if err != nil { return nil, err } return &reply, nil } go-x11-client-1.0.2/ext/randr/000077500000000000000000000000001460713373000157145ustar00rootroot00000000000000go-x11-client-1.0.2/ext/randr/auto.go000066400000000000000000000177731460713373000172320ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package randr import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: RandR const MajorVersion = 1 const MinorVersion = 6 var _ext *x.Extension func Ext() *x.Extension { return _ext } // simple ('xcb', 'RandR', 'MODE') type Mode uint32 // simple ('xcb', 'RandR', 'CRTC') type Crtc uint32 // simple ('xcb', 'RandR', 'OUTPUT') type Output uint32 // simple ('xcb', 'RandR', 'PROVIDER') type Provider uint32 // simple ('xcb', 'RandR', 'LEASE') type Lease uint32 const BadOutputErrorCode = 0 const BadCrtcErrorCode = 1 const BadModeErrorCode = 2 const BadProviderErrorCode = 3 // enum Rotation const ( RotationRotate0 = 1 RotationRotate90 = 2 RotationRotate180 = 4 RotationRotate270 = 8 RotationReflectX = 16 RotationReflectY = 32 ) const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum // enum SetConfig const ( SetConfigSuccess = 0 SetConfigInvalidConfigTime = 1 SetConfigInvalidTime = 2 SetConfigFailed = 3 ) const SetScreenConfigOpcode = 2 type SetScreenConfigCookie x.SeqNum // enum NotifyMask const ( NotifyMaskScreenChange = 1 NotifyMaskCrtcChange = 2 NotifyMaskOutputChange = 4 NotifyMaskOutputProperty = 8 NotifyMaskProviderChange = 16 NotifyMaskProviderProperty = 32 NotifyMaskResourceChange = 64 NotifyMaskLease = 128 ) const SelectInputOpcode = 4 const GetScreenInfoOpcode = 5 type GetScreenInfoCookie x.SeqNum const GetScreenSizeRangeOpcode = 6 type GetScreenSizeRangeCookie x.SeqNum const SetScreenSizeOpcode = 7 // enum ModeFlag const ( ModeFlagHsyncPositive = 1 ModeFlagHsyncNegative = 2 ModeFlagVsyncPositive = 4 ModeFlagVsyncNegative = 8 ModeFlagInterlace = 16 ModeFlagDoubleScan = 32 ModeFlagCsync = 64 ModeFlagCsyncPositive = 128 ModeFlagCsyncNegative = 256 ModeFlagHskewPresent = 512 ModeFlagBcast = 1024 ModeFlagPixelMultiplex = 2048 ModeFlagDoubleClock = 4096 ModeFlagHalveClock = 8192 ) const GetScreenResourcesOpcode = 8 type GetScreenResourcesCookie x.SeqNum // enum Connection const ( ConnectionConnected = 0 ConnectionDisconnected = 1 ConnectionUnknown = 2 ) const GetOutputInfoOpcode = 9 type GetOutputInfoCookie x.SeqNum const ListOutputPropertiesOpcode = 10 type ListOutputPropertiesCookie x.SeqNum const QueryOutputPropertyOpcode = 11 type QueryOutputPropertyCookie x.SeqNum const ConfigureOutputPropertyOpcode = 12 const ChangeOutputPropertyOpcode = 13 const DeleteOutputPropertyOpcode = 14 const GetOutputPropertyOpcode = 15 type GetOutputPropertyCookie x.SeqNum const CreateModeOpcode = 16 type CreateModeCookie x.SeqNum const DestroyModeOpcode = 17 const AddOutputModeOpcode = 18 const DeleteOutputModeOpcode = 19 const GetCrtcInfoOpcode = 20 type GetCrtcInfoCookie x.SeqNum const SetCrtcConfigOpcode = 21 type SetCrtcConfigCookie x.SeqNum const GetCrtcGammaSizeOpcode = 22 type GetCrtcGammaSizeCookie x.SeqNum const GetCrtcGammaOpcode = 23 type GetCrtcGammaCookie x.SeqNum const SetCrtcGammaOpcode = 24 const GetScreenResourcesCurrentOpcode = 25 type GetScreenResourcesCurrentCookie x.SeqNum // enum Transform const ( TransformUnit = 1 TransformScaleUp = 2 TransformScaleDown = 4 TransformProjective = 8 ) const SetCrtcTransformOpcode = 26 const GetCrtcTransformOpcode = 27 type GetCrtcTransformCookie x.SeqNum const GetPanningOpcode = 28 type GetPanningCookie x.SeqNum const SetPanningOpcode = 29 type SetPanningCookie x.SeqNum const SetOutputPrimaryOpcode = 30 const GetOutputPrimaryOpcode = 31 type GetOutputPrimaryCookie x.SeqNum const GetProvidersOpcode = 32 type GetProvidersCookie x.SeqNum // enum ProviderCapability const ( ProviderCapabilitySourceOutput = 1 ProviderCapabilitySinkOutput = 2 ProviderCapabilitySourceOffload = 4 ProviderCapabilitySinkOffload = 8 ) const GetProviderInfoOpcode = 33 type GetProviderInfoCookie x.SeqNum const SetProviderOffloadSinkOpcode = 34 const SetProviderOutputSourceOpcode = 35 const ListProviderPropertiesOpcode = 36 type ListProviderPropertiesCookie x.SeqNum const QueryProviderPropertyOpcode = 37 type QueryProviderPropertyCookie x.SeqNum const ConfigureProviderPropertyOpcode = 38 const ChangeProviderPropertyOpcode = 39 const DeleteProviderPropertyOpcode = 40 const GetProviderPropertyOpcode = 41 type GetProviderPropertyCookie x.SeqNum const ScreenChangeNotifyEventCode = 0 func NewScreenChangeNotifyEvent(data []byte) (*ScreenChangeNotifyEvent, error) { var ev ScreenChangeNotifyEvent r := x.NewReaderFromData(data) err := readScreenChangeNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Notify const ( NotifyCrtcChange = 0 NotifyOutputChange = 1 NotifyOutputProperty = 2 NotifyProviderChange = 3 NotifyProviderProperty = 4 NotifyResourceChange = 5 NotifyLease = 6 ) const GetMonitorsOpcode = 42 type GetMonitorsCookie x.SeqNum const SetMonitorOpcode = 43 const DeleteMonitorOpcode = 44 const CreateLeaseOpcode = 45 type CreateLeaseCookie x.SeqNum const FreeLeaseOpcode = 46 const NotifyEventCode = 1 func NewNotifyEvent(data []byte) (*NotifyEvent, error) { var ev NotifyEvent r := x.NewReaderFromData(data) err := readNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } var errorCodeNameMap = map[uint8]string{ BadOutputErrorCode: "BadOutput", BadCrtcErrorCode: "BadCrtc", BadModeErrorCode: "BadMode", BadProviderErrorCode: "BadProvider", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", SetScreenConfigOpcode: "SetScreenConfig", SelectInputOpcode: "SelectInput", GetScreenInfoOpcode: "GetScreenInfo", GetScreenSizeRangeOpcode: "GetScreenSizeRange", SetScreenSizeOpcode: "SetScreenSize", GetScreenResourcesOpcode: "GetScreenResources", GetOutputInfoOpcode: "GetOutputInfo", ListOutputPropertiesOpcode: "ListOutputProperties", QueryOutputPropertyOpcode: "QueryOutputProperty", ConfigureOutputPropertyOpcode: "ConfigureOutputProperty", ChangeOutputPropertyOpcode: "ChangeOutputProperty", DeleteOutputPropertyOpcode: "DeleteOutputProperty", GetOutputPropertyOpcode: "GetOutputProperty", CreateModeOpcode: "CreateMode", DestroyModeOpcode: "DestroyMode", AddOutputModeOpcode: "AddOutputMode", DeleteOutputModeOpcode: "DeleteOutputMode", GetCrtcInfoOpcode: "GetCrtcInfo", SetCrtcConfigOpcode: "SetCrtcConfig", GetCrtcGammaSizeOpcode: "GetCrtcGammaSize", GetCrtcGammaOpcode: "GetCrtcGamma", SetCrtcGammaOpcode: "SetCrtcGamma", GetScreenResourcesCurrentOpcode: "GetScreenResourcesCurrent", SetCrtcTransformOpcode: "SetCrtcTransform", GetCrtcTransformOpcode: "GetCrtcTransform", GetPanningOpcode: "GetPanning", SetPanningOpcode: "SetPanning", SetOutputPrimaryOpcode: "SetOutputPrimary", GetOutputPrimaryOpcode: "GetOutputPrimary", GetProvidersOpcode: "GetProviders", GetProviderInfoOpcode: "GetProviderInfo", SetProviderOffloadSinkOpcode: "SetProviderOffloadSink", SetProviderOutputSourceOpcode: "SetProviderOutputSource", ListProviderPropertiesOpcode: "ListProviderProperties", QueryProviderPropertyOpcode: "QueryProviderProperty", ConfigureProviderPropertyOpcode: "ConfigureProviderProperty", ChangeProviderPropertyOpcode: "ChangeProviderProperty", DeleteProviderPropertyOpcode: "DeleteProviderProperty", GetProviderPropertyOpcode: "GetProviderProperty", GetMonitorsOpcode: "GetMonitors", SetMonitorOpcode: "SetMonitor", DeleteMonitorOpcode: "DeleteMonitor", CreateLeaseOpcode: "CreateLease", FreeLeaseOpcode: "FreeLease", } func init() { _ext = x.NewExtension("RANDR", 3, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/randr/randr.go000066400000000000000000000714121460713373000173560ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package randr import ( "errors" "math" "github.com/linuxdeepin/go-x11-client/ext/render" "github.com/linuxdeepin/go-x11-client" ) const ( StatusSuccess = 0 StatusInvalidConfigTime = 1 StatusInvalidTime = 2 StatusFailed = 3 ) // #WREQ func encodeQueryVersion(clientMajorVersion, clientMinorVersion uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(clientMajorVersion). Write4b(clientMinorVersion). End() return } type QueryVersionReply struct { ServerMajorVersion uint32 ServerMinorVersion uint32 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.ServerMajorVersion = r.Read4b() v.ServerMinorVersion = r.Read4b() // 4 return nil } // #WREQ func encodeSetScreenConfig(window x.Window, timestamp x.Timestamp, configTimestamp x.Timestamp, sizeID uint16, rotation uint16, rate uint16) (b x.RequestBody) { b.AddBlock(5). Write4b(uint32(window)). Write4b(uint32(timestamp)). Write4b(uint32(configTimestamp)). // 3 Write2b(uint16(sizeID)). Write2b(rotation). Write2b(rate). WritePad(2). // 5 End() return } type SetScreenConfigReply struct { Status uint8 NewTimestamp x.Timestamp ConfigTimestamp x.Timestamp Root x.Window SubpixelOrder uint16 } func readSetScreenConfigReply(r *x.Reader, v *SetScreenConfigReply) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.NewTimestamp = x.Timestamp(r.Read4b()) v.ConfigTimestamp = x.Timestamp(r.Read4b()) // 4 v.Root = x.Window(r.Read4b()) v.SubpixelOrder = r.Read2b() // 6 return nil } // #WREQ func encodeGetScreenInfo(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)) return } type GetScreenInfoReply struct { Rotations uint8 Root x.Window Timestamp x.Timestamp ConfigTimestamp x.Timestamp NSizes uint16 SizeID uint16 Rotation uint16 Rate uint16 NInfo uint16 // useless Sizes []ScreenSize Rates []RefreshRates } func readGetScreenInfoReply(r *x.Reader, v *GetScreenInfoReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Rotations, _ = r.ReadReplyHeader() v.Root = x.Window(r.Read4b()) v.Timestamp = x.Timestamp(r.Read4b()) v.ConfigTimestamp = x.Timestamp(r.Read4b()) // 5 v.NSizes = r.Read2b() v.SizeID = r.Read2b() v.Rotation = r.Read2b() v.Rate = r.Read2b() v.NInfo = r.Read2b() r.ReadPad(2) // 8 if v.NSizes > 0 { if !r.RemainAtLeast4b(2 * int(v.NSizes)) { return x.ErrDataLenShort } v.Sizes = make([]ScreenSize, v.NSizes) for i := 0; i < int(v.NSizes); i++ { v.Sizes[i] = readScreenSize(r) } } nRefreshRates := int(v.NSizes) if nRefreshRates > 0 { v.Rates = make([]RefreshRates, nRefreshRates) for i := 0; i < nRefreshRates; i++ { err := readRefreshRates(r, &v.Rates[i]) if err != nil { return err } } } return nil } // size: 2 * 4b type ScreenSize struct { Width uint16 // pixels Height uint16 MWidth uint16 // millimeters MHeight uint16 } func readScreenSize(r *x.Reader) (v ScreenSize) { v.Width = r.Read2b() v.Height = r.Read2b() v.MWidth = r.Read2b() v.MHeight = r.Read2b() return } // size: ? type RefreshRates struct { NRates uint16 Rates []uint16 } func readRefreshRates(r *x.Reader, v *RefreshRates) error { if !r.RemainAtLeast(2) { return x.ErrDataLenShort } v.NRates = r.Read2b() if v.NRates > 0 { if !r.RemainAtLeast(2 * int(v.NRates)) { return x.ErrDataLenShort } v.Rates = make([]uint16, v.NRates) for i := 0; i < int(v.NRates); i++ { v.Rates[i] = r.Read2b() } } return nil } // #WREQ func encodeGetScreenSizeRange(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetScreenSizeRangeReply struct { MinWidth uint16 MinHeight uint16 MaxWidth uint16 MaxHeight uint16 } func readGetScreenSizeRangeReply(r *x.Reader, v *GetScreenSizeRangeReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadReplyHeader() v.MinWidth = r.Read2b() v.MinHeight = r.Read2b() v.MaxWidth = r.Read2b() v.MaxHeight = r.Read2b() // 4 return nil } // #WREQ func encodeSetScreenSize(window x.Window, width, height uint16, mmWidth, mmHeight uint32) (b x.RequestBody) { b.AddBlock(4). Write4b(uint32(window)). Write2b(width). Write2b(height). Write4b(mmWidth). Write4b(mmHeight). End() return } // #WREQ func encodeGetCrtcInfo(crtc Crtc, configTimestamp x.Timestamp) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(crtc)). Write4b(uint32(configTimestamp)). End() return } type GetCrtcInfoReply struct { Status uint8 Timestamp x.Timestamp X int16 Y int16 Width uint16 Height uint16 Mode Mode Rotation uint16 Rotations uint16 Outputs []Output PossibleOutputs []Output } func readGetCrtcInfoReply(r *x.Reader, v *GetCrtcInfoReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() // 5 v.Mode = Mode(r.Read4b()) v.Rotation = r.Read2b() v.Rotations = r.Read2b() outputsLen := int(r.Read2b()) possibleOutputsLen := int(r.Read2b()) // 8 if outputsLen > 0 { if !r.RemainAtLeast4b(outputsLen) { return x.ErrDataLenShort } v.Outputs = make([]Output, outputsLen) for i := 0; i < outputsLen; i++ { v.Outputs[i] = Output(r.Read4b()) } } if possibleOutputsLen > 0 { if !r.RemainAtLeast4b(possibleOutputsLen) { return x.ErrDataLenShort } v.PossibleOutputs = make([]Output, possibleOutputsLen) for i := 0; i < possibleOutputsLen; i++ { v.PossibleOutputs[i] = Output(r.Read4b()) } } return nil } // #WREQ func encodeGetOutputInfo(output Output, configTimestamp x.Timestamp) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(output)). Write4b(uint32(configTimestamp)). End() return } type GetOutputInfoReply struct { Status uint8 Timestamp x.Timestamp Crtc Crtc MmWidth uint32 MmHeight uint32 Connection uint8 SubPixelOrder uint8 NumPreferred uint16 Crtcs []Crtc Modes []Mode Clones []Output Name string } func readGetOutputInfoReply(r *x.Reader, v *GetOutputInfoReply) error { if !r.RemainAtLeast4b(9) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) v.Crtc = Crtc(r.Read4b()) v.MmWidth = r.Read4b() // 5 v.MmHeight = r.Read4b() v.Connection = r.Read1b() v.SubPixelOrder = r.Read1b() crtcsLen := int(r.Read2b()) modesLen := int(r.Read2b()) v.NumPreferred = r.Read2b() // 8 if int(v.NumPreferred) > modesLen { return errors.New("numPreferred > modesLen") } clonesLen := int(r.Read2b()) nameLen := int(r.Read2b()) // 9 if crtcsLen > 0 { if !r.RemainAtLeast4b(crtcsLen) { return x.ErrDataLenShort } v.Crtcs = make([]Crtc, crtcsLen) for i := 0; i < crtcsLen; i++ { v.Crtcs[i] = Crtc(r.Read4b()) } } if modesLen > 0 { if !r.RemainAtLeast4b(modesLen) { return x.ErrDataLenShort } v.Modes = make([]Mode, modesLen) for i := 0; i < modesLen; i++ { v.Modes[i] = Mode(r.Read4b()) } } if clonesLen > 0 { if !r.RemainAtLeast4b(clonesLen) { return x.ErrDataLenShort } v.Clones = make([]Output, clonesLen) for i := 0; i < clonesLen; i++ { v.Clones[i] = Output(r.Read4b()) } } var err error v.Name, err = r.ReadString(nameLen) return err } func (r *GetOutputInfoReply) GetPreferredMode() Mode { if r.NumPreferred == 0 || len(r.Modes) == 0 { return 0 } return r.Modes[r.NumPreferred-1] } // #WREQ func encodeGetScreenResources(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetScreenResourcesReply struct { Timestamp x.Timestamp ConfigTimestamp x.Timestamp Crtcs []Crtc Outputs []Output // size: xgb.Pad((int(NumOutputs) * 4)) Modes []ModeInfo } // size: 8 * 4b type ModeInfo struct { Id uint32 Width uint16 Height uint16 DotClock uint32 HSyncStart uint16 HSyncEnd uint16 HTotal uint16 HSkew uint16 VSyncStart uint16 VSyncEnd uint16 VTotal uint16 nameLen uint16 Name string ModeFlags uint32 } func readModeInfo(r *x.Reader, v *ModeInfo) { v.Id = r.Read4b() v.Width = r.Read2b() v.Height = r.Read2b() v.DotClock = r.Read4b() v.HSyncStart = r.Read2b() v.HSyncEnd = r.Read2b() v.HTotal = r.Read2b() v.HSkew = r.Read2b() // 5 v.VSyncStart = r.Read2b() v.VSyncEnd = r.Read2b() v.VTotal = r.Read2b() v.nameLen = r.Read2b() v.ModeFlags = r.Read4b() // 8 } func writeModeInfo(b *x.FixedSizeBuf, v *ModeInfo) { b.Write4b(v.Id). Write2b(v.Width). Write2b(v.Height). Write4b(v.DotClock). Write2b(v.HSyncStart). Write2b(v.HSyncEnd). Write2b(v.HTotal). Write2b(v.HSkew). Write2b(v.VSyncStart). Write2b(v.VSyncEnd). Write2b(v.VTotal). Write2b(v.nameLen). Write4b(v.ModeFlags) } func readGetScreenResourcesReply(r *x.Reader, v *GetScreenResourcesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) v.Timestamp = x.Timestamp(r.Read4b()) v.ConfigTimestamp = x.Timestamp(r.Read4b()) crtcsLen := int(r.Read2b()) outputsLen := int(r.Read2b()) // 5 modesLen := int(r.Read2b()) // namesLen modeNamesLen := int(r.Read2b()) // unused r.ReadPad(8) // 8 if crtcsLen > 0 { if !r.RemainAtLeast4b(crtcsLen) { return x.ErrDataLenShort } v.Crtcs = make([]Crtc, crtcsLen) for i := 0; i < crtcsLen; i++ { v.Crtcs[i] = Crtc(r.Read4b()) } } if outputsLen > 0 { if !r.RemainAtLeast4b(outputsLen) { return x.ErrDataLenShort } v.Outputs = make([]Output, outputsLen) for i := 0; i < outputsLen; i++ { v.Outputs[i] = Output(r.Read4b()) } } if modesLen > 0 { if !r.RemainAtLeast4b(8 * modesLen) { return x.ErrDataLenShort } v.Modes = make([]ModeInfo, modesLen) for i := 0; i < modesLen; i++ { readModeInfo(r, &v.Modes[i]) } } var b int for i := 0; i < modesLen; i++ { modeNameLen := int(v.Modes[i].nameLen) b += modeNameLen var err error v.Modes[i].Name, err = r.ReadString(modeNameLen) if err != nil { return err } } if b != modeNamesLen { return errors.New("mode names len not equal") } return nil } // #WREQ func encodeGetScreenResourcesCurrent(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetScreenResourcesCurrentReply GetScreenResourcesReply func readGetScreenResourcesCurrentReply(r *x.Reader, v *GetScreenResourcesCurrentReply) error { return readGetScreenResourcesReply(r, (*GetScreenResourcesReply)(v)) } // #WREQ func encodeSetCrtcTransform(crtc Crtc, transform *render.Transform, filter string, filterParams []render.Fixed) (b x.RequestBody) { filter = x.TruncateStr(filter, math.MaxUint16) buf := b.AddBlock(11 + x.SizeIn4bWithPad(len(filter)) + len(filterParams)). Write4b(uint32(crtc)) render.WriteTransform(buf, transform) // 10 buf.Write2b(uint16(len(filter))). WritePad(2). // 11 WriteString(filter). WritePad(x.Pad(len(filter))) for _, value := range filterParams { buf.Write4b(uint32(value)) // +len(filterParams) } buf.End() return } // #WREQ func encodeGetCrtcTransform(crtc Crtc) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(crtc)). End() return } type GetCrtcTransformReply struct { PendingTransform render.Transform HasTransform bool CurrentTransform render.Transform PendingLen uint16 PendingNParams uint16 CurrentLen uint16 CurrentNParams uint16 PendingFilter string PendingParams []render.Fixed CurrentFilter string CurrentParams []render.Fixed } func readGetCrtcTransformReply(r *x.Reader, v *GetCrtcTransformReply) error { if !r.RemainAtLeast4b(24) { return x.ErrDataLenShort } r.ReadReplyHeader() render.ReadTransform(r, &v.PendingTransform) // 11 v.HasTransform = r.ReadBool() r.ReadPad(3) // 12 render.ReadTransform(r, &v.CurrentTransform) // 21 r.ReadPad(4) // 22 v.PendingLen = r.Read2b() v.PendingNParams = r.Read2b() // 23 v.CurrentLen = r.Read2b() v.CurrentNParams = r.Read2b() // 24 var err error v.PendingFilter, err = r.ReadStrWithPad(int(v.PendingLen)) if err != nil { return err } if v.PendingNParams > 0 { if !r.RemainAtLeast4b(int(v.PendingNParams)) { return x.ErrDataLenShort } v.PendingParams = make([]render.Fixed, v.PendingNParams) for i := 0; i < int(v.PendingNParams); i++ { v.PendingParams[i] = render.Fixed(r.Read4b()) } } v.CurrentFilter, err = r.ReadStrWithPad(int(v.CurrentLen)) if err != nil { return err } if v.CurrentNParams > 0 { if !r.RemainAtLeast4b(int(v.CurrentNParams)) { return x.ErrDataLenShort } v.CurrentParams = make([]render.Fixed, v.CurrentNParams) for i := 0; i < int(v.CurrentNParams); i++ { v.CurrentParams[i] = render.Fixed(r.Read4b()) } } return nil } // size: 6 * 4b type Panning struct { Left, Top, Width, Height uint16 TrackLeft, TrackTop, TrackWidth, TrackHeight uint16 BorderLeft, BorderTop, BorderRight, BorderBottom int16 } func readPanning(r *x.Reader, v *Panning) { v.Left = r.Read2b() v.Top = r.Read2b() v.Width = r.Read2b() v.Height = r.Read2b() v.TrackLeft = r.Read2b() v.TrackTop = r.Read2b() v.TrackWidth = r.Read2b() v.TrackHeight = r.Read2b() v.BorderLeft = int16(r.Read2b()) v.BorderTop = int16(r.Read2b()) v.BorderRight = int16(r.Read2b()) v.BorderBottom = int16(r.Read2b()) } func writePanning(b *x.FixedSizeBuf, v *Panning) { b.Write2b(v.Left) b.Write2b(v.Top) b.Write2b(v.Width) b.Write2b(v.Height) b.Write2b(v.TrackLeft) b.Write2b(v.TrackTop) b.Write2b(v.TrackWidth) b.Write2b(v.TrackHeight) b.Write2b(uint16(v.BorderLeft)) b.Write2b(uint16(v.TrackTop)) b.Write2b(uint16(v.BorderRight)) b.Write2b(uint16(v.BorderBottom)) } // #WREQ func encodeGetPanning(crtc Crtc) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(crtc)). End() return } type GetPanningReply struct { Status uint8 Timestamp x.Timestamp Panning } func readGetPanningReply(r *x.Reader, v *GetPanningReply) error { if !r.RemainAtLeast4b(9) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) // 3 readPanning(r, &v.Panning) // 9 return nil } // #WREQ func encodeSetPanning(crtc Crtc, timestamp x.Timestamp, panning *Panning) (b x.RequestBody) { buf := b.AddBlock(8). Write4b(uint32(crtc)). Write4b(uint32(timestamp)) writePanning(buf, panning) return } type SetPanningReply struct { Status uint8 Timestamp x.Timestamp } func readSetPanningReply(r *x.Reader, v *SetPanningReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) // 3 return nil } // #WREQ func encodeSetOutputPrimary(window x.Window, output Output) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(uint32(output)). End() return } // #WREQ func encodeGetOutputPrimary(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetOutputPrimaryReply struct { Output Output } func readGetOutputPrimaryReply(r *x.Reader, v *GetOutputPrimaryReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.Output = Output(r.Read4b()) // 3 return nil } // #WREQ func encodeListOutputProperties(output Output) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(output)). End() return } type ListOutputPropertiesReply struct { NumAtoms uint16 Atoms []x.Atom } func readListOutputPropertiesReply(r *x.Reader, v *ListOutputPropertiesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadReplyHeader() v.NumAtoms = r.Read2b() r.ReadPad(22) // 8 if v.NumAtoms > 0 { if !r.RemainAtLeast4b(int(v.NumAtoms)) { return x.ErrDataLenShort } v.Atoms = make([]x.Atom, v.NumAtoms) for i := 0; i < int(v.NumAtoms); i++ { v.Atoms[i] = x.Atom(r.Read4b()) } } return nil } // #WREQ func encodeQueryOutputProperty(output Output, property x.Atom) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(output)). Write4b(uint32(property)). End() return } type QueryOutputPropertyReply struct { Pending bool Range bool Immutable bool ValidValues []int32 } func readQueryOutputPropertyReply(r *x.Reader, v *QueryOutputPropertyReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } _, length := r.ReadReplyHeader() v.Pending = r.ReadBool() v.Range = r.ReadBool() v.Immutable = r.ReadBool() r.ReadPad(21) // 8 if length > 0 { if !r.RemainAtLeast4b(int(length)) { return x.ErrDataLenShort } v.ValidValues = make([]int32, length) for i := 0; i < int(length); i++ { v.ValidValues[i] = int32(r.Read4b()) } } return nil } // #WREQ func encodeConfigureOutputProperty(output Output, property x.Atom, pending, range0 bool, values []int32) (b x.RequestBody) { buf := b.AddBlock(3 + len(values)). Write4b(uint32(output)). Write4b(uint32(property)). WriteBool(pending). WriteBool(range0). WritePad(2) // 3 for _, value := range values { buf.Write4b(uint32(value)) } return } // #WREQ func encodeChangeOutputProperty(output Output, property x.Atom, type0 x.Atom, format, mode uint8, data []byte) (b x.RequestBody) { numUnits := uint32(len(data) / (int(format) / 8)) b.AddBlock(5). Write4b(uint32(output)). Write4b(uint32(property)). Write4b(uint32(type0)). // 3 Write1b(format). Write1b(mode). WritePad(2). Write4b(numUnits). // 5 End() b.AddBytes(data) return } // #WREQ func encodeDeleteOutputProperty(output Output, property x.Atom) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(output)). Write4b(uint32(property)). End() return } // #WREQ func encodeGetOutputProperty(output Output, property, Type x.Atom, longOffset, longLength uint32, delete, pending bool) (b x.RequestBody) { b.AddBlock(6). Write4b(uint32(output)). Write4b(uint32(property)). Write4b(uint32(Type)). Write4b(longOffset). Write4b(longLength). // 5 WriteBool(delete). WriteBool(pending). WritePad(2). // 6 End() return } type GetOutputPropertyReply struct { Format byte Type x.Atom BytesAfter uint32 ValueLen uint32 Value []byte } func readGetOutputPropertyReply(r *x.Reader, v *GetOutputPropertyReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Format, _ = r.ReadReplyHeader() v.Type = x.Atom(r.Read4b()) v.BytesAfter = r.Read4b() v.ValueLen = r.Read4b() // 5 // unused r.ReadPad(12) // 8 var err error n := int(v.ValueLen) * int(v.Format/8) v.Value, err = r.ReadBytes(n) return err } // #WREQ func encodeCreateMode(window x.Window, modeInfo *ModeInfo) (b x.RequestBody) { modeInfo.Name = x.TruncateStr(modeInfo.Name, math.MaxUint16) modeInfo.nameLen = uint16(len(modeInfo.Name)) buf := b.AddBlock(9). Write4b(uint32(window)) writeModeInfo(buf, modeInfo) buf.End() b.AddBytes([]byte(modeInfo.Name)) return } type CreateModeReply struct { Mode Mode } func readCreateModeReply(r *x.Reader, v *CreateModeReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadReplyHeader() v.Mode = Mode(r.Read4b()) return nil } // #WREQ func encodeDestroyMode(mode Mode) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(mode)). End() return } // #WREQ func encodeAddOutputMode(output Output, mode Mode) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(output)). Write4b(uint32(mode)). End() return } // #WREQ func encodeDeleteOutputMode(output Output, mode Mode) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(output)). Write4b(uint32(mode)). End() return } // #WREQ func encodeSetCrtcConfig(crtc Crtc, timestamp, configTimestamp x.Timestamp, X, y int16, mode Mode, rotation uint16, outputs []Output) (b x.RequestBody) { b0 := b.AddBlock(6 + len(outputs)). Write4b(uint32(crtc)). Write4b(uint32(timestamp)). Write4b(uint32(configTimestamp)). Write2b(uint16(X)). Write2b(uint16(y)). Write4b(uint32(mode)). Write2b(rotation). WritePad(2) for _, output := range outputs { b0.Write4b(uint32(output)) } b0.End() return } type SetCrtcConfigReply struct { Status uint8 Timestamp x.Timestamp } func readSetCrtcConfigReply(r *x.Reader, v *SetCrtcConfigReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) // 3 return nil } // #WREQ func encodeSelectInput(window x.Window, enable uint16) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write2b(enable). WritePad(2). End() return } // #WREQ func encodeGetCrtcGammaSize(crtc Crtc) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(crtc)). End() return } type GetCrtcGammaSizeReply struct { Size uint16 } func readGetCrtcGammaSizeReply(r *x.Reader, v *GetCrtcGammaSizeReply) error { r.Read1b() r.Read1b() // seq r.Read2b() // length r.Read4b() v.Size = r.Read2b() r.ReadPad(22) return nil } // #WREQ func encodeGetCrtcGamma(crtc Crtc) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(crtc)). End() return } type GetCrtcGammaReply struct { Size uint16 Red []uint16 Green []uint16 Blue []uint16 } func readGetCrtcGammaReply(r *x.Reader, v *GetCrtcGammaReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadReplyHeader() v.Size = r.Read2b() r.ReadPad(22) // 8 if v.Size > 0 { if !r.RemainAtLeast(3 * (2*int(v.Size) + x.Pad(2*int(v.Size)))) { return x.ErrDataLenShort } v.Red = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Red[i] = r.Read2b() } r.ReadPad(x.Pad(int(v.Size) * 2)) v.Green = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Green[i] = r.Read2b() } r.ReadPad(x.Pad(int(v.Size) * 2)) v.Blue = make([]uint16, v.Size) for i := 0; i < int(v.Size); i++ { v.Blue[i] = r.Read2b() } } return nil } // #WREQ func encodeSetCrtcGamma(crtc Crtc, red, green, blue []uint16) (b x.RequestBody) { size := len(red) if len(green) != size { panic("assert len(green) != size failed") } if len(blue) != size { panic("assert len(blue) != size failed") } b0 := b.AddBlock(2 + x.SizeIn4bWithPad(6*size)). Write4b(uint32(crtc)). Write2b(uint16(size)). WritePad(2) for _, value := range red { b0.Write2b(value) } for _, value := range green { b0.Write2b(value) } for _, value := range blue { b0.Write2b(value) } b0.WritePad(x.Pad(6 * size)) return } // #WREQ func encodeGetProviders(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetProvidersReply struct { Timestamp x.Timestamp NumProviders uint16 Providers []Provider } func readGetProvidersReply(r *x.Reader, v *GetProvidersReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) // 3 v.NumProviders = r.Read2b() r.ReadPad(18) // 8 if v.NumProviders > 0 { if !r.RemainAtLeast4b(int(v.NumProviders)) { return x.ErrDataLenShort } v.Providers = make([]Provider, v.NumProviders) for i := 0; i < int(v.NumProviders); i++ { v.Providers[i] = Provider(r.Read4b()) } } return nil } // #WREQ func encodeGetProviderInfo(provider Provider, configTimestamp x.Timestamp) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(provider)). Write4b(uint32(configTimestamp)). End() return } type GetProviderInfoReply struct { Status uint8 Timestamp x.Timestamp Capabilities uint32 NumCrtcs uint16 NumOutputs uint16 NumAssociatedProviders uint16 NameLen uint16 Crtcs []Crtc Outputs []Output AssociatedProviders []Provider AssociatedCapability []uint32 Name string } func readGetProviderInfoReply(r *x.Reader, v *GetProviderInfoReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) v.Capabilities = r.Read4b() v.NumCrtcs = r.Read2b() v.NumOutputs = r.Read2b() v.NumAssociatedProviders = r.Read2b() v.NameLen = r.Read2b() // 6 r.ReadPad(8) // 8 if v.NumCrtcs > 0 { if !r.RemainAtLeast4b(int(v.NumCrtcs)) { return x.ErrDataLenShort } v.Crtcs = make([]Crtc, v.NumCrtcs) for i := 0; i < int(v.NumCrtcs); i++ { v.Crtcs[i] = Crtc(r.Read4b()) } } if v.NumOutputs > 0 { if !r.RemainAtLeast4b(int(v.NumOutputs)) { return x.ErrDataLenShort } v.Outputs = make([]Output, v.NumOutputs) for i := 0; i < int(v.NumOutputs); i++ { v.Outputs[i] = Output(r.Read4b()) } } if v.NumAssociatedProviders > 0 { if !r.RemainAtLeast4b(2 * int(v.NumAssociatedProviders)) { return x.ErrDataLenShort } v.AssociatedProviders = make([]Provider, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedProviders[i] = Provider(r.Read4b()) } v.AssociatedCapability = make([]uint32, v.NumAssociatedProviders) for i := 0; i < int(v.NumAssociatedProviders); i++ { v.AssociatedCapability[i] = r.Read4b() } } if v.NameLen > 0 { var err error v.Name, err = r.ReadString(int(v.NameLen)) if err != nil { return err } } return nil } // #WREQ func encodeSetProviderOffloadSink(provider, sinkProvider Provider, configTimestamp x.Timestamp) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(provider)). Write4b(uint32(sinkProvider)). Write4b(uint32(configTimestamp)). End() return } // #WREQ func encodeSetProviderOutputSource(provider, sourceProvider Provider, configTimestamp x.Timestamp) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(provider)). Write4b(uint32(sourceProvider)). Write4b(uint32(configTimestamp)). End() return } // #WREQ func encodeListProviderProperties(provider Provider) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(provider)). End() return } type ListProviderPropertiesReply struct { NumAtoms uint16 Atoms []x.Atom } func readListProviderPropertiesReply(r *x.Reader, v *ListProviderPropertiesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadReplyHeader() v.NumAtoms = r.Read2b() r.ReadPad(22) // 8 if v.NumAtoms > 0 { if !r.RemainAtLeast4b(int(v.NumAtoms)) { return x.ErrDataLenShort } v.Atoms = make([]x.Atom, v.NumAtoms) for i := 0; i < int(v.NumAtoms); i++ { v.Atoms[i] = x.Atom(r.Read4b()) } } return nil } // #WREQ func encodeGetMonitors(window x.Window, getActive bool) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). WriteBool(getActive). WritePad(3). End() return } type GetMonitorsReply struct { Timestamp x.Timestamp NMonitors uint32 NOutputs uint32 Monitors []MonitorInfo } // size: (6 + NOutputs) * 4b type MonitorInfo struct { Name x.Atom Primary bool Automatic bool NOutputs uint16 X, Y int16 Width, Height uint16 // pixels MmWidth, MmHeight uint32 // in millimeters Outputs []Output } func readMonitorInfo(r *x.Reader, v *MonitorInfo) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } v.Name = x.Atom(r.Read4b()) v.Primary = r.ReadBool() v.Automatic = r.ReadBool() v.NOutputs = r.Read2b() v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() v.MmWidth = r.Read4b() v.MmHeight = r.Read4b() // 6 if v.NOutputs > 0 { v.Outputs = make([]Output, v.NOutputs) for i := 0; i < int(v.NOutputs); i++ { v.Outputs[i] = Output(r.Read4b()) } } return nil } func writeMonitorInfo(b *x.FixedSizeBuf, v *MonitorInfo) { v.NOutputs = uint16(len(v.Outputs)) b.Write4b(uint32(v.Name)). WriteBool(v.Primary). WriteBool(v.Automatic). Write2b(v.NOutputs). Write2b(uint16(v.X)). Write2b(uint16(v.Y)). Write2b(v.Width). Write2b(v.Height). Write4b(v.MmWidth). Write4b(v.MmHeight) // 6 for _, o := range v.Outputs { b.Write4b(uint32(o)) } } func readGetMonitorsReply(r *x.Reader, v *GetMonitorsReply) error { r.ReadReplyHeader() v.Timestamp = x.Timestamp(r.Read4b()) v.NMonitors = r.Read4b() v.NOutputs = r.Read4b() r.ReadPad(12) if v.NMonitors > 0 { v.Monitors = make([]MonitorInfo, v.NMonitors) for i := 0; i < int(v.NMonitors); i++ { err := readMonitorInfo(r, &v.Monitors[i]) if err != nil { return err } } } return nil } // #WREQ func encodeSetMonitor(window x.Window, monitorInfo *MonitorInfo) (b x.RequestBody) { sizeIn4b := 7 + len(monitorInfo.Outputs) buf := b.AddBlock(sizeIn4b). Write4b(uint32(window)) writeMonitorInfo(buf, monitorInfo) buf.End() return } // #WREQ func encodeDeleteMonitor(window x.Window, name x.Atom) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(uint32(name)). End() return } go-x11-client-1.0.2/ext/randr/randr_event.go000066400000000000000000000106111460713373000205510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package randr import "github.com/linuxdeepin/go-x11-client" type ScreenChangeNotifyEvent struct { Rotation uint8 Sequence uint16 Timestamp x.Timestamp ConfigTimestamp x.Timestamp Root x.Window RequestWindow x.Window SizeID uint16 SubpixelOrder uint16 Width uint16 Height uint16 MmWidth uint16 MmHeight uint16 } func readScreenChangeNotifyEvent(r *x.Reader, v *ScreenChangeNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.Rotation, v.Sequence = r.ReadEventHeader() v.Timestamp = x.Timestamp(r.Read4b()) v.ConfigTimestamp = x.Timestamp(r.Read4b()) v.Root = x.Window(r.Read4b()) v.RequestWindow = x.Window(r.Read4b()) // 5 v.SizeID = r.Read2b() v.SubpixelOrder = r.Read2b() v.Width = r.Read2b() v.Height = r.Read2b() v.MmWidth = r.Read2b() v.MmHeight = r.Read2b() // 8 return nil } type NotifyEvent struct { SubCode uint8 Sequence uint16 Data []byte } func readNotifyEvent(r *x.Reader, v *NotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.SubCode, v.Sequence = r.ReadEventHeader() v.Data = r.MustReadBytes(28) // 8 return nil } func (e *NotifyEvent) NewCrtcChangeNotifyEvent() (*CrtcChangeNotifyEvent, error) { var ev CrtcChangeNotifyEvent r := x.NewReaderFromData(e.Data) err := readCrtcChangeNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } func (e *NotifyEvent) NewOutputChangeNotifyEvent() (*OutputChangeNotifyEvent, error) { var ev OutputChangeNotifyEvent r := x.NewReaderFromData(e.Data) err := readOutputChangeNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } func (e *NotifyEvent) NewOutputPropertyNotifyEvent() (*OutputPropertyNotifyEvent, error) { var ev OutputPropertyNotifyEvent r := x.NewReaderFromData(e.Data) err := readOutputPropertyNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } func (e *NotifyEvent) NewResourceChangeNotifyEvent() (*ResourceChangeNotifyEvent, error) { var ev ResourceChangeNotifyEvent r := x.NewReaderFromData(e.Data) err := readResourceChangeNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } type CrtcChangeNotifyEvent struct { Timestamp x.Timestamp Window x.Window Crtc Crtc Mode Mode Rotation uint16 X, Y int16 Width, Height uint16 } func readCrtcChangeNotifyEvent(r *x.Reader, v *CrtcChangeNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } v.Timestamp = x.Timestamp(r.Read4b()) v.Window = x.Window(r.Read4b()) v.Crtc = Crtc(r.Read4b()) v.Mode = Mode(r.Read4b()) v.Rotation = r.Read2b() r.ReadPad(2) // 5 v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() // 7 return nil } type OutputChangeNotifyEvent struct { Timestamp x.Timestamp ConfigTimestamp x.Timestamp Window x.Window Output Output Crtc Crtc Mode Mode Rotation uint16 Connection uint8 SubPixelOrder uint8 } func readOutputChangeNotifyEvent(r *x.Reader, v *OutputChangeNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } v.Timestamp = x.Timestamp(r.Read4b()) v.ConfigTimestamp = x.Timestamp(r.Read4b()) v.Window = x.Window(r.Read4b()) v.Output = Output(r.Read4b()) v.Crtc = Crtc(r.Read4b()) // 5 v.Mode = Mode(r.Read4b()) v.Rotation = r.Read2b() v.Connection = r.Read1b() v.SubPixelOrder = r.Read1b() // 7 return nil } type OutputPropertyNotifyEvent struct { Window x.Window Output Output Atom x.Atom Timestamp x.Timestamp Status uint8 } func readOutputPropertyNotifyEvent(r *x.Reader, v *OutputPropertyNotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } v.Window = x.Window(r.Read4b()) v.Output = Output(r.Read4b()) v.Atom = x.Atom(r.Read4b()) v.Timestamp = x.Timestamp(r.Read4b()) v.Status = r.Read1b() // 5 return nil } type ResourceChangeNotifyEvent struct { Timestamp x.Timestamp Window x.Window } func readResourceChangeNotifyEvent(r *x.Reader, v *ResourceChangeNotifyEvent) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } v.Timestamp = x.Timestamp(r.Read4b()) v.Window = x.Window(r.Read4b()) return nil } go-x11-client-1.0.2/ext/randr/randr_req_auto.go000066400000000000000000000645601460713373000212630ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package randr import x "github.com/linuxdeepin/go-x11-client" import "github.com/linuxdeepin/go-x11-client/ext/render" func QueryVersion(conn *x.Conn, clientMajorVersion, clientMinorVersion uint32) QueryVersionCookie { body := encodeQueryVersion(clientMajorVersion, clientMinorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetScreenConfig(conn *x.Conn, window x.Window, timestamp x.Timestamp, configTimestamp x.Timestamp, sizeID uint16, rotation uint16, rate uint16) SetScreenConfigCookie { body := encodeSetScreenConfig(window, timestamp, configTimestamp, sizeID, rotation, rate) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: SetScreenConfigOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return SetScreenConfigCookie(seq) } func (cookie SetScreenConfigCookie) Reply(conn *x.Conn) (*SetScreenConfigReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply SetScreenConfigReply err = readSetScreenConfigReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetScreenInfo(conn *x.Conn, window x.Window) GetScreenInfoCookie { body := encodeGetScreenInfo(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetScreenInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetScreenInfoCookie(seq) } func (cookie GetScreenInfoCookie) Reply(conn *x.Conn) (*GetScreenInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetScreenInfoReply err = readGetScreenInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetScreenSizeRange(conn *x.Conn, window x.Window) GetScreenSizeRangeCookie { body := encodeGetScreenSizeRange(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetScreenSizeRangeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetScreenSizeRangeCookie(seq) } func (cookie GetScreenSizeRangeCookie) Reply(conn *x.Conn) (*GetScreenSizeRangeReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetScreenSizeRangeReply err = readGetScreenSizeRangeReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetScreenSize(conn *x.Conn, window x.Window, width, height uint16, mmWidth, mmHeight uint32) { body := encodeSetScreenSize(window, width, height, mmWidth, mmHeight) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetScreenSizeOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetScreenSizeChecked(conn *x.Conn, window x.Window, width, height uint16, mmWidth, mmHeight uint32) x.VoidCookie { body := encodeSetScreenSize(window, width, height, mmWidth, mmHeight) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetScreenSizeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCrtcInfo(conn *x.Conn, crtc Crtc, configTimestamp x.Timestamp) GetCrtcInfoCookie { body := encodeGetCrtcInfo(crtc, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCrtcInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCrtcInfoCookie(seq) } func (cookie GetCrtcInfoCookie) Reply(conn *x.Conn) (*GetCrtcInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCrtcInfoReply err = readGetCrtcInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetOutputInfo(conn *x.Conn, output Output, configTimestamp x.Timestamp) GetOutputInfoCookie { body := encodeGetOutputInfo(output, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetOutputInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetOutputInfoCookie(seq) } func (cookie GetOutputInfoCookie) Reply(conn *x.Conn) (*GetOutputInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetOutputInfoReply err = readGetOutputInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetScreenResources(conn *x.Conn, window x.Window) GetScreenResourcesCookie { body := encodeGetScreenResources(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetScreenResourcesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetScreenResourcesCookie(seq) } func (cookie GetScreenResourcesCookie) Reply(conn *x.Conn) (*GetScreenResourcesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetScreenResourcesReply err = readGetScreenResourcesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetScreenResourcesCurrent(conn *x.Conn, window x.Window) GetScreenResourcesCurrentCookie { body := encodeGetScreenResourcesCurrent(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetScreenResourcesCurrentOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetScreenResourcesCurrentCookie(seq) } func (cookie GetScreenResourcesCurrentCookie) Reply(conn *x.Conn) (*GetScreenResourcesCurrentReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetScreenResourcesCurrentReply err = readGetScreenResourcesCurrentReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetCrtcTransform(conn *x.Conn, crtc Crtc, transform *render.Transform, filter string, filterParams []render.Fixed) { body := encodeSetCrtcTransform(crtc, transform, filter, filterParams) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCrtcTransformOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetCrtcTransformChecked(conn *x.Conn, crtc Crtc, transform *render.Transform, filter string, filterParams []render.Fixed) x.VoidCookie { body := encodeSetCrtcTransform(crtc, transform, filter, filterParams) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCrtcTransformOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCrtcTransform(conn *x.Conn, crtc Crtc) GetCrtcTransformCookie { body := encodeGetCrtcTransform(crtc) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCrtcTransformOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCrtcTransformCookie(seq) } func (cookie GetCrtcTransformCookie) Reply(conn *x.Conn) (*GetCrtcTransformReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCrtcTransformReply err = readGetCrtcTransformReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetPanning(conn *x.Conn, crtc Crtc) GetPanningCookie { body := encodeGetPanning(crtc) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetPanningOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetPanningCookie(seq) } func (cookie GetPanningCookie) Reply(conn *x.Conn) (*GetPanningReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetPanningReply err = readGetPanningReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetPanning(conn *x.Conn, crtc Crtc, timestamp x.Timestamp, panning *Panning) SetPanningCookie { body := encodeSetPanning(crtc, timestamp, panning) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: SetPanningOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return SetPanningCookie(seq) } func (cookie SetPanningCookie) Reply(conn *x.Conn) (*SetPanningReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply SetPanningReply err = readSetPanningReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetOutputPrimary(conn *x.Conn, window x.Window, output Output) { body := encodeSetOutputPrimary(window, output) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetOutputPrimaryOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetOutputPrimaryChecked(conn *x.Conn, window x.Window, output Output) x.VoidCookie { body := encodeSetOutputPrimary(window, output) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetOutputPrimaryOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetOutputPrimary(conn *x.Conn, window x.Window) GetOutputPrimaryCookie { body := encodeGetOutputPrimary(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetOutputPrimaryOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetOutputPrimaryCookie(seq) } func (cookie GetOutputPrimaryCookie) Reply(conn *x.Conn) (*GetOutputPrimaryReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetOutputPrimaryReply err = readGetOutputPrimaryReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListOutputProperties(conn *x.Conn, output Output) ListOutputPropertiesCookie { body := encodeListOutputProperties(output) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: ListOutputPropertiesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return ListOutputPropertiesCookie(seq) } func (cookie ListOutputPropertiesCookie) Reply(conn *x.Conn) (*ListOutputPropertiesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply ListOutputPropertiesReply err = readListOutputPropertiesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryOutputProperty(conn *x.Conn, output Output, property x.Atom) QueryOutputPropertyCookie { body := encodeQueryOutputProperty(output, property) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryOutputPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryOutputPropertyCookie(seq) } func (cookie QueryOutputPropertyCookie) Reply(conn *x.Conn) (*QueryOutputPropertyReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryOutputPropertyReply err = readQueryOutputPropertyReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ConfigureOutputProperty(conn *x.Conn, output Output, property x.Atom, pending, range0 bool, values []int32) { body := encodeConfigureOutputProperty(output, property, pending, range0, values) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ConfigureOutputPropertyOpcode, }, Body: body, } conn.SendRequest(0, req) } func ConfigureOutputPropertyChecked(conn *x.Conn, output Output, property x.Atom, pending, range0 bool, values []int32) x.VoidCookie { body := encodeConfigureOutputProperty(output, property, pending, range0, values) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ConfigureOutputPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ChangeOutputProperty(conn *x.Conn, output Output, property x.Atom, type0 x.Atom, format, mode uint8, data []byte) { body := encodeChangeOutputProperty(output, property, type0, format, mode, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeOutputPropertyOpcode, }, Body: body, } conn.SendRequest(0, req) } func ChangeOutputPropertyChecked(conn *x.Conn, output Output, property x.Atom, type0 x.Atom, format, mode uint8, data []byte) x.VoidCookie { body := encodeChangeOutputProperty(output, property, type0, format, mode, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeOutputPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func DeleteOutputProperty(conn *x.Conn, output Output, property x.Atom) { body := encodeDeleteOutputProperty(output, property) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteOutputPropertyOpcode, }, Body: body, } conn.SendRequest(0, req) } func DeleteOutputPropertyChecked(conn *x.Conn, output Output, property x.Atom) x.VoidCookie { body := encodeDeleteOutputProperty(output, property) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteOutputPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetOutputProperty(conn *x.Conn, output Output, property, Type x.Atom, longOffset, longLength uint32, delete, pending bool) GetOutputPropertyCookie { body := encodeGetOutputProperty(output, property, Type, longOffset, longLength, delete, pending) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetOutputPropertyOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetOutputPropertyCookie(seq) } func (cookie GetOutputPropertyCookie) Reply(conn *x.Conn) (*GetOutputPropertyReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetOutputPropertyReply err = readGetOutputPropertyReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreateMode(conn *x.Conn, window x.Window, modeInfo *ModeInfo) CreateModeCookie { body := encodeCreateMode(window, modeInfo) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: CreateModeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return CreateModeCookie(seq) } func (cookie CreateModeCookie) Reply(conn *x.Conn) (*CreateModeReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply CreateModeReply err = readCreateModeReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func DestroyMode(conn *x.Conn, mode Mode) { body := encodeDestroyMode(mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyModeOpcode, }, Body: body, } conn.SendRequest(0, req) } func DestroyModeChecked(conn *x.Conn, mode Mode) x.VoidCookie { body := encodeDestroyMode(mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyModeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func AddOutputMode(conn *x.Conn, output Output, mode Mode) { body := encodeAddOutputMode(output, mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddOutputModeOpcode, }, Body: body, } conn.SendRequest(0, req) } func AddOutputModeChecked(conn *x.Conn, output Output, mode Mode) x.VoidCookie { body := encodeAddOutputMode(output, mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddOutputModeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func DeleteOutputMode(conn *x.Conn, output Output, mode Mode) { body := encodeDeleteOutputMode(output, mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteOutputModeOpcode, }, Body: body, } conn.SendRequest(0, req) } func DeleteOutputModeChecked(conn *x.Conn, output Output, mode Mode) x.VoidCookie { body := encodeDeleteOutputMode(output, mode) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteOutputModeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetCrtcConfig(conn *x.Conn, crtc Crtc, timestamp, configTimestamp x.Timestamp, X, y int16, mode Mode, rotation uint16, outputs []Output) SetCrtcConfigCookie { body := encodeSetCrtcConfig(crtc, timestamp, configTimestamp, X, y, mode, rotation, outputs) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: SetCrtcConfigOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return SetCrtcConfigCookie(seq) } func (cookie SetCrtcConfigCookie) Reply(conn *x.Conn) (*SetCrtcConfigReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply SetCrtcConfigReply err = readSetCrtcConfigReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SelectInput(conn *x.Conn, window x.Window, enable uint16) { body := encodeSelectInput(window, enable) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectInputOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectInputChecked(conn *x.Conn, window x.Window, enable uint16) x.VoidCookie { body := encodeSelectInput(window, enable) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectInputOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCrtcGammaSize(conn *x.Conn, crtc Crtc) GetCrtcGammaSizeCookie { body := encodeGetCrtcGammaSize(crtc) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCrtcGammaSizeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCrtcGammaSizeCookie(seq) } func (cookie GetCrtcGammaSizeCookie) Reply(conn *x.Conn) (*GetCrtcGammaSizeReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCrtcGammaSizeReply err = readGetCrtcGammaSizeReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetCrtcGamma(conn *x.Conn, crtc Crtc) GetCrtcGammaCookie { body := encodeGetCrtcGamma(crtc) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCrtcGammaOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCrtcGammaCookie(seq) } func (cookie GetCrtcGammaCookie) Reply(conn *x.Conn) (*GetCrtcGammaReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCrtcGammaReply err = readGetCrtcGammaReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetCrtcGamma(conn *x.Conn, crtc Crtc, red, green, blue []uint16) { body := encodeSetCrtcGamma(crtc, red, green, blue) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCrtcGammaOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetCrtcGammaChecked(conn *x.Conn, crtc Crtc, red, green, blue []uint16) x.VoidCookie { body := encodeSetCrtcGamma(crtc, red, green, blue) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCrtcGammaOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetProviders(conn *x.Conn, window x.Window) GetProvidersCookie { body := encodeGetProviders(window) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetProvidersOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetProvidersCookie(seq) } func (cookie GetProvidersCookie) Reply(conn *x.Conn) (*GetProvidersReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetProvidersReply err = readGetProvidersReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetProviderInfo(conn *x.Conn, provider Provider, configTimestamp x.Timestamp) GetProviderInfoCookie { body := encodeGetProviderInfo(provider, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetProviderInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetProviderInfoCookie(seq) } func (cookie GetProviderInfoCookie) Reply(conn *x.Conn) (*GetProviderInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetProviderInfoReply err = readGetProviderInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetProviderOffloadSink(conn *x.Conn, provider, sinkProvider Provider, configTimestamp x.Timestamp) { body := encodeSetProviderOffloadSink(provider, sinkProvider, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetProviderOffloadSinkOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetProviderOffloadSinkChecked(conn *x.Conn, provider, sinkProvider Provider, configTimestamp x.Timestamp) x.VoidCookie { body := encodeSetProviderOffloadSink(provider, sinkProvider, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetProviderOffloadSinkOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetProviderOutputSource(conn *x.Conn, provider, sourceProvider Provider, configTimestamp x.Timestamp) { body := encodeSetProviderOutputSource(provider, sourceProvider, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetProviderOutputSourceOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetProviderOutputSourceChecked(conn *x.Conn, provider, sourceProvider Provider, configTimestamp x.Timestamp) x.VoidCookie { body := encodeSetProviderOutputSource(provider, sourceProvider, configTimestamp) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetProviderOutputSourceOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ListProviderProperties(conn *x.Conn, provider Provider) ListProviderPropertiesCookie { body := encodeListProviderProperties(provider) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: ListProviderPropertiesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return ListProviderPropertiesCookie(seq) } func (cookie ListProviderPropertiesCookie) Reply(conn *x.Conn) (*ListProviderPropertiesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply ListProviderPropertiesReply err = readListProviderPropertiesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetMonitors(conn *x.Conn, window x.Window, getActive bool) GetMonitorsCookie { body := encodeGetMonitors(window, getActive) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetMonitorsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetMonitorsCookie(seq) } func (cookie GetMonitorsCookie) Reply(conn *x.Conn) (*GetMonitorsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetMonitorsReply err = readGetMonitorsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetMonitor(conn *x.Conn, window x.Window, monitorInfo *MonitorInfo) { body := encodeSetMonitor(window, monitorInfo) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetMonitorOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetMonitorChecked(conn *x.Conn, window x.Window, monitorInfo *MonitorInfo) x.VoidCookie { body := encodeSetMonitor(window, monitorInfo) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetMonitorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func DeleteMonitor(conn *x.Conn, window x.Window, name x.Atom) { body := encodeDeleteMonitor(window, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteMonitorOpcode, }, Body: body, } conn.SendRequest(0, req) } func DeleteMonitorChecked(conn *x.Conn, window x.Window, name x.Atom) x.VoidCookie { body := encodeDeleteMonitor(window, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeleteMonitorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/record/000077500000000000000000000000001460713373000160645ustar00rootroot00000000000000go-x11-client-1.0.2/ext/record/auto.go000066400000000000000000000031731460713373000173670ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package record import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Record const MajorVersion = 1 const MinorVersion = 13 var _ext *x.Extension func Ext() *x.Extension { return _ext } // simple ('xcb', 'Record', 'CONTEXT') type Context uint32 // simple ('xcb', 'Record', 'ElementHeader') type ElementHeader uint8 // enum HType const ( HTypeFromServerTime = 1 HTypeFromClientTime = 2 HTypeFromClientSequence = 4 ) // simple ('xcb', 'Record', 'ClientSpec') type ClientSpec uint32 // enum CS const ( CSCurrentClients = 1 CSFutureClients = 2 CSAllClients = 3 ) const BadContextErrorCode = 0 const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const CreateContextOpcode = 1 const RegisterClientsOpcode = 2 const UnregisterClientsOpcode = 3 const GetContextOpcode = 4 type GetContextCookie x.SeqNum const EnableContextOpcode = 5 type EnableContextCookie x.SeqNum const DisableContextOpcode = 6 const FreeContextOpcode = 7 var errorCodeNameMap = map[uint8]string{ BadContextErrorCode: "BadContext", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", CreateContextOpcode: "CreateContext", RegisterClientsOpcode: "RegisterClients", UnregisterClientsOpcode: "UnregisterClients", GetContextOpcode: "GetContext", EnableContextOpcode: "EnableContext", DisableContextOpcode: "DisableContext", FreeContextOpcode: "FreeContext", } func init() { _ext = x.NewExtension("RECORD", 0, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/record/record.go000066400000000000000000000144061460713373000176760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package record import ( "github.com/linuxdeepin/go-x11-client" ) // size: 2b type Range8 struct { First uint8 Last uint8 } func writeRange8(b *x.FixedSizeBuf, v Range8) { b.Write1b(v.First) b.Write1b(v.Last) } func readRange8(r *x.Reader) Range8 { var v Range8 v.First = r.Read1b() v.Last = r.Read1b() return v } // size: 4b type Range16 struct { First uint16 Last uint16 } func readRange16(r *x.Reader) Range16 { var v Range16 v.First = r.Read2b() v.Last = r.Read2b() return v } func writeRange16(b *x.FixedSizeBuf, v Range16) { b.Write2b(v.First) b.Write2b(v.Last) } // size: 6b type ExtRange struct { Major Range8 Minor Range16 } func readExtRange(r *x.Reader) (v ExtRange) { v.Major = readRange8(r) v.Minor = readRange16(r) return } func writeExtRange(b *x.FixedSizeBuf, v ExtRange) { writeRange8(b, v.Major) writeRange16(b, v.Minor) } // size: 6 * 4b type Range struct { CoreRequests Range8 CoreReplies Range8 ExtRequests ExtRange ExtReplies ExtRange DeliveredEvents Range8 DeviceEvents Range8 Errors Range8 ClientStarted bool ClientDied bool } func writeRange(b *x.FixedSizeBuf, v *Range) { writeRange8(b, v.CoreRequests) writeRange8(b, v.CoreReplies) writeExtRange(b, v.ExtRequests) writeExtRange(b, v.ExtReplies) writeRange8(b, v.DeliveredEvents) writeRange8(b, v.DeviceEvents) writeRange8(b, v.Errors) b.WriteBool(v.ClientStarted). WriteBool(v.ClientDied) } func readRange(r *x.Reader, v *Range) { v.CoreRequests = readRange8(r) v.CoreReplies = readRange8(r) v.ExtRequests = readExtRange(r) v.ExtRequests = readExtRange(r) v.DeliveredEvents = readRange8(r) v.DeviceEvents = readRange8(r) v.Errors = readRange8(r) v.ClientStarted = r.ReadBool() v.ClientDied = r.ReadBool() } type ClientInfo struct { ClientResource ClientSpec InterceptedProtocol []Range } func readClientInfo(r *x.Reader, v *ClientInfo) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } v.ClientResource = ClientSpec(r.Read4b()) interceptedProtocolLen := int(r.Read4b()) // 2 if interceptedProtocolLen > 0 { if !r.RemainAtLeast4b(6 * interceptedProtocolLen) { return x.ErrDataLenShort } v.InterceptedProtocol = make([]Range, interceptedProtocolLen) for i := 0; i < interceptedProtocolLen; i++ { readRange(r, &v.InterceptedProtocol[i]) } } return nil } // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(majorVersion). Write2b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion uint16 MinorVersion uint16 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read2b() v.MinorVersion = r.Read2b() // 3 return nil } // #WREQ func encodeCreateContext(context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) (b x.RequestBody) { clientSpecsLen := len(clientSpecs) rangesLen := len(ranges) b0 := b.AddBlock(4 + clientSpecsLen + rangesLen*6). Write4b(uint32(context)). Write1b(uint8(elementHeader)). WritePad(3). Write4b(uint32(clientSpecsLen)). Write4b(uint32(rangesLen)) for _, clientSpec := range clientSpecs { b0.Write4b(uint32(clientSpec)) } for i := 0; i < rangesLen; i++ { writeRange(b0, &ranges[i]) } b0.End() return } // #WREQ func encodeRegisterClients(context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) (b x.RequestBody) { clientSpecsLen := len(clientSpecs) rangesLen := len(ranges) b0 := b.AddBlock(4 + clientSpecsLen + rangesLen*6). Write4b(uint32(context)). Write1b(uint8(elementHeader)). WritePad(3). Write4b(uint32(clientSpecsLen)). Write4b(uint32(rangesLen)) for _, clientSpec := range clientSpecs { b0.Write4b(uint32(clientSpec)) } for i := 0; i < rangesLen; i++ { writeRange(b0, &ranges[i]) } b0.End() return } // #WREQ func encodeUnregisterClients(context Context, clientSpecs []ClientSpec) (b x.RequestBody) { clientSpecsLen := len(clientSpecs) b0 := b.AddBlock(2 + clientSpecsLen). Write4b(uint32(context)). Write4b(uint32(clientSpecsLen)) for _, clientSpec := range clientSpecs { b0.Write4b(uint32(clientSpec)) } b0.End() return } // #WREQ func encodeGetContext(context Context) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(context)). End() return } type GetContextReply struct { Enabled bool ElementHeader ElementHeader InterceptedClients []ClientInfo } func readGetContextReply(r *x.Reader, v *GetContextReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } enabled, _ := r.ReadReplyHeader() v.Enabled = x.Uint8ToBool(enabled) v.ElementHeader = ElementHeader(r.Read1b()) r.ReadPad(3) interceptedClientsLen := int(r.Read4b()) // 4 if interceptedClientsLen > 0 { v.InterceptedClients = make([]ClientInfo, interceptedClientsLen) for i := 0; i < interceptedClientsLen; i++ { err := readClientInfo(r, &v.InterceptedClients[i]) if err != nil { return err } } } return nil } // #WREQ func encodeEnableContext(context Context) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(context)). End() return } type EnableContextReply struct { Category uint8 ElementHeader ElementHeader ClientSwapped bool XidBase uint32 ServerTime x.Timestamp RecSequenceNum uint32 Data []uint8 } func readEnableContextReply(r *x.Reader, v *EnableContextReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } var replyLen uint32 v.Category, replyLen = r.ReadReplyHeader() // 2 v.ElementHeader = ElementHeader(r.Read1b()) v.ClientSwapped = r.ReadBool() r.ReadPad(2) // 3 v.XidBase = r.Read4b() v.ServerTime = x.Timestamp(r.Read4b()) v.RecSequenceNum = r.Read4b() // 6 // unused r.ReadPad(8) // 8 dataLen := 4 * int(replyLen) var err error v.Data, err = r.ReadBytes(dataLen) return err } // #WREQ func encodeDisableContext(context Context) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(context)). End() return } // #WREQ func encodeFreeContext(context Context) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(context)). End() return } go-x11-client-1.0.2/ext/record/record_req_auto.go000066400000000000000000000130071460713373000215710ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package record import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint16) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreateContext(conn *x.Conn, context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) { body := encodeCreateContext(context, elementHeader, clientSpecs, ranges) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateContextOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateContextChecked(conn *x.Conn, context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) x.VoidCookie { body := encodeCreateContext(context, elementHeader, clientSpecs, ranges) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateContextOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func RegisterClients(conn *x.Conn, context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) { body := encodeRegisterClients(context, elementHeader, clientSpecs, ranges) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RegisterClientsOpcode, }, Body: body, } conn.SendRequest(0, req) } func RegisterClientsChecked(conn *x.Conn, context Context, elementHeader ElementHeader, clientSpecs []ClientSpec, ranges []Range) x.VoidCookie { body := encodeRegisterClients(context, elementHeader, clientSpecs, ranges) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RegisterClientsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func UnregisterClients(conn *x.Conn, context Context, clientSpecs []ClientSpec) { body := encodeUnregisterClients(context, clientSpecs) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnregisterClientsOpcode, }, Body: body, } conn.SendRequest(0, req) } func UnregisterClientsChecked(conn *x.Conn, context Context, clientSpecs []ClientSpec) x.VoidCookie { body := encodeUnregisterClients(context, clientSpecs) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnregisterClientsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetContext(conn *x.Conn, context Context) GetContextCookie { body := encodeGetContext(context) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetContextOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetContextCookie(seq) } func (cookie GetContextCookie) Reply(conn *x.Conn) (*GetContextReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetContextReply err = readGetContextReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func EnableContext(conn *x.Conn, context Context) EnableContextCookie { body := encodeEnableContext(context) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: EnableContextOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return EnableContextCookie(seq) } func (cookie EnableContextCookie) Reply(conn *x.Conn) (*EnableContextReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply EnableContextReply err = readEnableContextReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func DisableContext(conn *x.Conn, context Context) { body := encodeDisableContext(context) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DisableContextOpcode, }, Body: body, } conn.SendRequest(0, req) } func DisableContextChecked(conn *x.Conn, context Context) x.VoidCookie { body := encodeDisableContext(context) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DisableContextOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FreeContext(conn *x.Conn, context Context) { body := encodeFreeContext(context) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeContextOpcode, }, Body: body, } conn.SendRequest(0, req) } func FreeContextChecked(conn *x.Conn, context Context) x.VoidCookie { body := encodeFreeContext(context) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeContextOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/render/000077500000000000000000000000001460713373000160655ustar00rootroot00000000000000go-x11-client-1.0.2/ext/render/auto.go000066400000000000000000000144671460713373000174000ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package render import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Render const MajorVersion = 0 const MinorVersion = 11 var _ext *x.Extension func Ext() *x.Extension { return _ext } // enum PictType const ( PictTypeIndexed = 0 PictTypeDirect = 1 ) // enum Picture const ( PictureNone = 0 ) // enum PictOp const ( PictOpClear = 0 PictOpSrc = 1 PictOpDst = 2 PictOpOver = 3 PictOpOverReverse = 4 PictOpIn = 5 PictOpInReverse = 6 PictOpOut = 7 PictOpOutReverse = 8 PictOpAtop = 9 PictOpAtopReverse = 10 PictOpXor = 11 PictOpAdd = 12 PictOpSaturate = 13 PictOpDisjointClear = 16 PictOpDisjointSrc = 17 PictOpDisjointDst = 18 PictOpDisjointOver = 19 PictOpDisjointOverReverse = 20 PictOpDisjointIn = 21 PictOpDisjointInReverse = 22 PictOpDisjointOut = 23 PictOpDisjointOutReverse = 24 PictOpDisjointAtop = 25 PictOpDisjointAtopReverse = 26 PictOpDisjointXor = 27 PictOpConjointClear = 32 PictOpConjointSrc = 33 PictOpConjointDst = 34 PictOpConjointOver = 35 PictOpConjointOverReverse = 36 PictOpConjointIn = 37 PictOpConjointInReverse = 38 PictOpConjointOut = 39 PictOpConjointOutReverse = 40 PictOpConjointAtop = 41 PictOpConjointAtopReverse = 42 PictOpConjointXor = 43 PictOpMultiply = 48 PictOpScreen = 49 PictOpOverlay = 50 PictOpDarken = 51 PictOpLighten = 52 PictOpColorDodge = 53 PictOpColorBurn = 54 PictOpHardLight = 55 PictOpSoftLight = 56 PictOpDifference = 57 PictOpExclusion = 58 PictOpHSLHue = 59 PictOpHSLSaturation = 60 PictOpHSLColor = 61 PictOpHSLLuminosity = 62 ) // enum PolyEdge const ( PolyEdgeSharp = 0 PolyEdgeSmooth = 1 ) // enum PolyMode const ( PolyModePrecise = 0 PolyModeImprecise = 1 ) // enum CP const ( CPRepeat = 1 CPAlphaMap = 2 CPAlphaXOrigin = 4 CPAlphaYOrigin = 8 CPClipXOrigin = 16 CPClipYOrigin = 32 CPClipMask = 64 CPGraphicsExposure = 128 CPSubwindowMode = 256 CPPolyEdge = 512 CPPolyMode = 1024 CPDither = 2048 CPComponentAlpha = 4096 ) // enum SubPixel const ( SubPixelUnknown = 0 SubPixelHorizontalRGB = 1 SubPixelHorizontalBGR = 2 SubPixelVerticalRGB = 3 SubPixelVerticalBGR = 4 SubPixelNone = 5 ) // enum Repeat const ( RepeatNone = 0 RepeatNormal = 1 RepeatPad = 2 RepeatReflect = 3 ) // simple ('xcb', 'Render', 'GLYPH') type Glyph uint32 // simple ('xcb', 'Render', 'GLYPHSET') type GlyphSet uint32 // simple ('xcb', 'Render', 'PICTURE') type Picture uint32 // simple ('xcb', 'Render', 'PICTFORMAT') type PictFormat uint32 // simple ('xcb', 'Render', 'FIXED') type Fixed int32 const PictFormatErrorCode = 0 const PictureErrorCode = 1 const PictOpErrorCode = 2 const GlyphSetErrorCode = 3 const GlyphErrorCode = 4 const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const QueryPictFormatsOpcode = 1 type QueryPictFormatsCookie x.SeqNum const QueryPictIndexValuesOpcode = 2 type QueryPictIndexValuesCookie x.SeqNum const CreatePictureOpcode = 4 const ChangePictureOpcode = 5 const SetPictureClipRectanglesOpcode = 6 const FreePictureOpcode = 7 const CompositeOpcode = 8 const TrapezoidsOpcode = 10 const TrianglesOpcode = 11 const TriStripOpcode = 12 const TriFanOpcode = 13 const CreateGlyphSetOpcode = 17 const ReferenceGlyphSetOpcode = 18 const FreeGlyphSetOpcode = 19 const AddGlyphsOpcode = 20 const FreeGlyphsOpcode = 22 const CompositeGlyphs8Opcode = 23 const CompositeGlyphs16Opcode = 24 const CompositeGlyphs32Opcode = 25 const FillRectanglesOpcode = 26 const CreateCursorOpcode = 27 const SetPictureTransformOpcode = 28 const QueryFiltersOpcode = 29 type QueryFiltersCookie x.SeqNum const SetPictureFilterOpcode = 30 const CreateAnimCursorOpcode = 31 const AddTrapsOpcode = 32 const CreateSolidFillOpcode = 33 const CreateLinearGradientOpcode = 34 const CreateRadialGradientOpcode = 35 const CreateConicalGradientOpcode = 36 var errorCodeNameMap = map[uint8]string{ PictFormatErrorCode: "BadPictFormat", PictureErrorCode: "BadPicture", PictOpErrorCode: "BadPictOp", GlyphSetErrorCode: "BadGlyphSet", GlyphErrorCode: "BadGlyph", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", QueryPictFormatsOpcode: "QueryPictFormats", QueryPictIndexValuesOpcode: "QueryPictIndexValues", CreatePictureOpcode: "CreatePicture", ChangePictureOpcode: "ChangePicture", SetPictureClipRectanglesOpcode: "SetPictureClipRectangles", FreePictureOpcode: "FreePicture", CompositeOpcode: "Composite", TrapezoidsOpcode: "Trapezoids", TrianglesOpcode: "Triangles", TriStripOpcode: "TriStrip", TriFanOpcode: "TriFan", CreateGlyphSetOpcode: "CreateGlyphSet", ReferenceGlyphSetOpcode: "ReferenceGlyphSet", FreeGlyphSetOpcode: "FreeGlyphSet", AddGlyphsOpcode: "AddGlyphs", FreeGlyphsOpcode: "FreeGlyphs", CompositeGlyphs8Opcode: "CompositeGlyphs8", CompositeGlyphs16Opcode: "CompositeGlyphs16", CompositeGlyphs32Opcode: "CompositeGlyphs32", FillRectanglesOpcode: "FillRectangles", CreateCursorOpcode: "CreateCursor", SetPictureTransformOpcode: "SetPictureTransform", QueryFiltersOpcode: "QueryFilters", SetPictureFilterOpcode: "SetPictureFilter", CreateAnimCursorOpcode: "CreateAnimCursor", AddTrapsOpcode: "AddTraps", CreateSolidFillOpcode: "CreateSolidFill", CreateLinearGradientOpcode: "CreateLinearGradient", CreateRadialGradientOpcode: "CreateRadialGradient", CreateConicalGradientOpcode: "CreateConicalGradient", } func init() { _ext = x.NewExtension("RENDER", 4, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/render/render.go000066400000000000000000000416731460713373000177060ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package render import ( "math" "github.com/linuxdeepin/go-x11-client" ) const fixedOne = 1 << 16 func ToFixed(v float64) Fixed { return Fixed(v * fixedOne) } func (f Fixed) ToFloat64() float64 { return float64(f) / fixedOne } // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(majorVersion). Write4b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion, MinorVersion uint32 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read4b() v.MinorVersion = r.Read4b() // 4 return nil } // #WREQ func encodeQueryPictFormats() (b x.RequestBody) { return } type QueryPictFormatsReply struct { Formats []PictFormatInfo Screens []PictScreen NumDepths uint32 NumVisuals uint32 SubPixels []uint32 } // size: 7 * 4b type PictFormatInfo struct { Id PictFormat Type uint8 Depth uint8 Direct DirectFormat Colormap x.Colormap } func readPictFormatInfo(r *x.Reader, v *PictFormatInfo) { v.Id = PictFormat(r.Read4b()) v.Type = r.Read1b() v.Depth = r.Read1b() r.ReadPad(2) // 2 readDirectFormat(r, &v.Direct) v.Colormap = x.Colormap(r.Read4b()) // 7 } // size: 4 * 4b type DirectFormat struct { RedShift uint16 RedMask uint16 GreenShift uint16 GreenMask uint16 BlueShift uint16 BlueMask uint16 AlphaShift uint16 AlphaMask uint16 } func readDirectFormat(r *x.Reader, v *DirectFormat) { v.RedShift = r.Read2b() v.RedMask = r.Read2b() v.GreenShift = r.Read2b() v.GreenMask = r.Read2b() v.BlueShift = r.Read2b() v.BlueMask = r.Read2b() v.AlphaShift = r.Read2b() v.AlphaMask = r.Read2b() } type PictScreen struct { Fallback PictFormat Depths []PictDepth } func readPictScreen(r *x.Reader, v *PictScreen) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } depthsLen := int(r.Read4b()) v.Fallback = PictFormat(r.Read4b()) // 2 if depthsLen > 0 { v.Depths = make([]PictDepth, depthsLen) for i := 0; i < depthsLen; i++ { err := readPictDepth(r, &v.Depths[i]) if err != nil { return err } } } return nil } type PictDepth struct { Depth uint8 Visuals []PictVisual } func readPictDepth(r *x.Reader, v *PictDepth) error { v.Depth = r.Read1b() r.ReadPad(1) visualsLen := int(r.Read2b()) r.ReadPad(4) // 2 if visualsLen > 0 { if !r.RemainAtLeast4b(2 * visualsLen) { return x.ErrDataLenShort } v.Visuals = make([]PictVisual, visualsLen) for i := 0; i < visualsLen; i++ { v.Visuals[i] = readPictVisual(r) } } return nil } // size: 2 * 4b type PictVisual struct { Visual x.VisualID Format PictFormat } func readPictVisual(r *x.Reader) PictVisual { var v PictVisual v.Visual = x.VisualID(r.Read4b()) v.Format = PictFormat(r.Read4b()) return v } func readQueryPictFormatsReply(r *x.Reader, v *QueryPictFormatsReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) formatsLen := int(r.Read4b()) screensLen := int(r.Read4b()) v.NumDepths = r.Read4b() // 5 v.NumVisuals = r.Read4b() subPixelsLen := int(r.Read4b()) r.ReadPad(4) // 8 if formatsLen > 0 { if !r.RemainAtLeast4b(7 * formatsLen) { return x.ErrDataLenShort } v.Formats = make([]PictFormatInfo, formatsLen) for i := 0; i < formatsLen; i++ { readPictFormatInfo(r, &v.Formats[i]) } } if screensLen > 0 { v.Screens = make([]PictScreen, screensLen) for i := 0; i < screensLen; i++ { err := readPictScreen(r, &v.Screens[i]) if err != nil { return err } } } if subPixelsLen > 0 { if !r.RemainAtLeast4b(subPixelsLen) { return x.ErrDataLenShort } v.SubPixels = make([]uint32, subPixelsLen) for i := 0; i < subPixelsLen; i++ { v.SubPixels[i] = r.Read4b() } } return nil } // #WREQ func encodeQueryPictIndexValues(format PictFormat) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(format)). End() return } // size: 3 * 4b type IndexValue struct { Pixel uint32 Red uint16 Green uint16 Blue uint16 Alpha uint16 } func readIndexValue(r *x.Reader, v *IndexValue) { v.Pixel = r.Read4b() v.Red = r.Read2b() v.Green = r.Read2b() v.Blue = r.Read2b() v.Alpha = r.Read2b() } type QueryPictIndexValuesReply struct { Values []IndexValue } func readQueryPictIndexValuesReply(r *x.Reader, v *QueryPictIndexValuesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) valuesLen := int(r.Read4b()) r.ReadPad(20) // 8 if valuesLen > 0 { if !r.RemainAtLeast4b(3 * valuesLen) { return x.ErrDataLenShort } v.Values = make([]IndexValue, valuesLen) for i := 0; i < valuesLen; i++ { readIndexValue(r, &v.Values[i]) } } return nil } // #WREQ func encodeQueryFilters(drawable x.Drawable) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(drawable)). End() return } type QueryFiltersReply struct { Aliases []uint16 Filters []string } func readQueryFiltersReply(r *x.Reader, v *QueryFiltersReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) aliasesLen := int(r.Read4b()) filtersLen := int(r.Read4b()) r.ReadPad(16) // 8 if aliasesLen > 0 { pad := x.Pad(2 * aliasesLen) if !r.RemainAtLeast(2*aliasesLen + pad) { return x.ErrDataLenShort } v.Aliases = make([]uint16, aliasesLen) for i := 0; i < aliasesLen; i++ { v.Aliases[i] = r.Read2b() } r.ReadPad(pad) } if filtersLen > 0 { v.Filters = make([]string, filtersLen) var err error for i := 0; i < filtersLen; i++ { v.Filters[i], err = x.ReadStr(r) if err != nil { return err } } } return nil } // #WREQ func encodeCreatePicture(pid Picture, drawable x.Drawable, format PictFormat, valueMask uint32, valueList []uint32) (b x.RequestBody) { b0 := b.AddBlock(4 + len(valueList)). Write4b(uint32(pid)). Write4b(uint32(drawable)). Write4b(uint32(format)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeChangePicture(picture Picture, valueMask uint32, valueList []uint32) (b x.RequestBody) { b0 := b.AddBlock(2 + len(valueList)). Write4b(uint32(picture)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeSetPictureClipRectangles(picture Picture, clipXOrigin, clipYOrigin int16, rectangles []x.Rectangle) (b x.RequestBody) { b0 := b.AddBlock(2 + 2*len(rectangles)). Write4b(uint32(picture)). Write2b(uint16(clipXOrigin)). Write2b(uint16(clipYOrigin)) for _, rect := range rectangles { x.WriteRectangle(b0, rect) } b0.End() return } // size: 9 * 4b type Transform struct { Matrix11 Fixed Matrix12 Fixed Matrix13 Fixed Matrix21 Fixed Matrix22 Fixed Matrix23 Fixed Matrix31 Fixed Matrix32 Fixed Matrix33 Fixed } func WriteTransform(b *x.FixedSizeBuf, v *Transform) { b.Write4b(uint32(v.Matrix11)) b.Write4b(uint32(v.Matrix12)) b.Write4b(uint32(v.Matrix13)) b.Write4b(uint32(v.Matrix21)) b.Write4b(uint32(v.Matrix22)) b.Write4b(uint32(v.Matrix23)) b.Write4b(uint32(v.Matrix31)) b.Write4b(uint32(v.Matrix32)) b.Write4b(uint32(v.Matrix33)) } func ReadTransform(r *x.Reader, v *Transform) { v.Matrix11 = Fixed(r.Read4b()) v.Matrix12 = Fixed(r.Read4b()) v.Matrix13 = Fixed(r.Read4b()) v.Matrix21 = Fixed(r.Read4b()) v.Matrix22 = Fixed(r.Read4b()) v.Matrix23 = Fixed(r.Read4b()) v.Matrix31 = Fixed(r.Read4b()) v.Matrix32 = Fixed(r.Read4b()) v.Matrix33 = Fixed(r.Read4b()) } // #WREQ func encodeSetPictureTransform(picture Picture, transform *Transform) (b x.RequestBody) { b0 := b.AddBlock(10). Write4b(uint32(picture)) WriteTransform(b0, transform) b0.End() return } // #WREQ func encodeSetPictureFilter(picture Picture, filter string, values []Fixed) (b x.RequestBody) { filter = x.TruncateStr(filter, math.MaxUint16) filterLen := len(filter) b0 := b.AddBlock(2 + x.SizeIn4bWithPad(filterLen) + len(values)). Write4b(uint32(picture)). Write2b(uint16(filterLen)). WritePad(2). WriteString(filter). WritePad(x.Pad(filterLen)) for _, value := range values { b0.Write4b(uint32(value)) } b0.End() return } // #WREQ func encodeFreePicture(picture Picture) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(picture)). End() return } // #WREQ func encodeComposite(op uint8, src, mask, dst Picture, srcX, srcY, maskX, maskY, dstX, dstY int16, width, height uint16) (b x.RequestBody) { b.AddBlock(8). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(mask)). Write4b(uint32(dst)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). Write2b(uint16(maskX)). Write2b(uint16(maskY)). Write2b(uint16(dstX)). Write2b(uint16(dstY)). Write2b(width). Write2b(height). End() return } // size: 2 * 4b type Color struct { Red, Green, Blue, Alpha uint16 } func writeColor(b *x.FixedSizeBuf, v Color) { b.Write2b(v.Red) b.Write2b(v.Green) b.Write2b(v.Blue) b.Write2b(v.Alpha) } // #WREQ func encodeFillRectangles(op uint8, dst Picture, color Color, rects []x.Rectangle) (b x.RequestBody) { b0 := b.AddBlock(4 + 2*len(rects)). Write1b(op). WritePad(3). Write4b(uint32(dst)) writeColor(b0, color) for _, rect := range rects { x.WriteRectangle(b0, rect) } b0.End() return } // size: 10 * 4b type Trapezoid struct { Top Fixed Bottom Fixed Left LineFixed Right LineFixed } func writeTrapezoid(b *x.FixedSizeBuf, v *Trapezoid) { b.Write4b(uint32(v.Top)) b.Write4b(uint32(v.Bottom)) writeLineFixed(b, v.Left) writeLineFixed(b, v.Right) } // size: 4 * 4b type LineFixed struct { P1 PointFixed P2 PointFixed } func writeLineFixed(b *x.FixedSizeBuf, v LineFixed) { writePointFixed(b, v.P1) writePointFixed(b, v.P2) } // size: 2 * 4b type PointFixed struct { X Fixed Y Fixed } func writePointFixed(b *x.FixedSizeBuf, v PointFixed) { b.Write4b(uint32(v.X)) b.Write4b(uint32(v.Y)) } // #WREQ func encodeTrapezoids(op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, traps []Trapezoid) (b x.RequestBody) { b0 := b.AddBlock(5 + 10*len(traps)). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(dst)). Write4b(uint32(maskFormat)). Write2b(uint16(srcX)). Write2b(uint16(srcY)) for _, trap := range traps { writeTrapezoid(b0, &trap) } b0.End() return } // size: 6 * 4b type Triangle struct { P1 PointFixed P2 PointFixed P3 PointFixed } func writeTriangle(b *x.FixedSizeBuf, v Triangle) { writePointFixed(b, v.P1) writePointFixed(b, v.P2) writePointFixed(b, v.P3) } // #WREQ func encodeTriangles(op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, triangles []Triangle) (b x.RequestBody) { b0 := b.AddBlock(5 + 6*len(triangles)). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(dst)). Write4b(uint32(maskFormat)). Write2b(uint16(srcX)). Write2b(uint16(srcY)) for _, triangle := range triangles { writeTriangle(b0, triangle) } b0.End() return } // #WREQ func encodeTriStrip(op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) (b x.RequestBody) { b0 := b.AddBlock(5 + len(points)*2). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(dst)). Write4b(uint32(maskFormat)). Write2b(uint16(srcX)). Write2b(uint16(srcY)) for _, p := range points { writePointFixed(b0, p) } b0.End() return } // #WREQ func encodeTriFan(op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) (b x.RequestBody) { b0 := b.AddBlock(5 + len(points)*2). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(dst)). Write4b(uint32(maskFormat)). Write2b(uint16(srcX)). Write2b(uint16(srcY)) for _, p := range points { writePointFixed(b0, p) } b0.End() return } // #WREQ func encodeCreateGlyphSet(gsId GlyphSet, format PictFormat) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(gsId)). Write4b(uint32(format)). End() return } // #WREQ func encodeReferenceGlyphSet(gsId, existing GlyphSet) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(gsId)). Write4b(uint32(existing)). End() return } // #WREQ func encodeFreeGlyphSet(glyphSet GlyphSet) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(glyphSet)). End() return } // size: 3 * 4b type GlyphInfo struct { Width uint16 Height uint16 X int16 Y int16 XOff int16 YOff int16 } func writeGlyphInfo(b *x.FixedSizeBuf, v GlyphInfo) { b.Write2b(v.Width) b.Write2b(v.Height) b.Write2b(uint16(v.X)) b.Write2b(uint16(v.Y)) b.Write2b(uint16(v.XOff)) b.Write2b(uint16(v.YOff)) } // #WREQ func encodeAddGlyphs(glyphSet GlyphSet, glyphIds []uint32, glyphs []GlyphInfo, data []byte) (b x.RequestBody) { b0 := b.AddBlock(2 + len(glyphs)*3). Write4b(uint32(glyphSet)). Write4b(uint32(len(glyphIds))) for _, gi := range glyphs { writeGlyphInfo(b0, gi) } b0.End() b.AddBytes(data) return } // #WREQ func encodeFreeGlyphs(glyphSet GlyphSet, glyphs []Glyph) (b x.RequestBody) { b0 := b.AddBlock(1 + len(glyphs)). Write4b(uint32(glyphSet)) for _, g := range glyphs { b0.Write4b(uint32(g)) } b0.End() return } func encodeCompositeGlyphsN(op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) (b x.RequestBody) { b.AddBlock(6). Write1b(op). WritePad(3). Write4b(uint32(src)). Write4b(uint32(dst)). Write4b(uint32(maskFormat)). Write4b(uint32(glyphSet)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). End() b.AddBytes(glyphCmds) return } // #WREQ func encodeCompositeGlyphs8(op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) (b x.RequestBody) { return encodeCompositeGlyphsN(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) } // #WREQ func encodeCompositeGlyphs16(op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) (b x.RequestBody) { return encodeCompositeGlyphsN(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) } // #WREQ func encodeCompositeGlyphs32(op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) (b x.RequestBody) { return encodeCompositeGlyphsN(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) } // #WREQ func encodeCreateCursor(cid x.Cursor, source Picture, X, y uint16) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(cid)). Write4b(uint32(source)). Write2b(X). Write2b(y). End() return } // size: 2 * 4b type AnimCursorElt struct { Cursor x.Cursor Delay uint32 } func writeAnimCursorElt(b *x.FixedSizeBuf, v AnimCursorElt) { b.Write4b(uint32(v.Cursor)) b.Write4b(v.Delay) } // #WREQ func encodeCreateAnimCursor(cid x.Cursor, cursors []AnimCursorElt) (b x.RequestBody) { b0 := b.AddBlock(1 + len(cursors)*2). Write4b(uint32(cid)) for _, c := range cursors { writeAnimCursorElt(b0, c) } b0.End() return } // size: 3 * 4b type SpanFixed struct { L, R, Y Fixed } // size: 6 * 4b type Trap struct { Top SpanFixed Bot SpanFixed } func writeSpanFixed(b *x.FixedSizeBuf, v SpanFixed) { b.Write4b(uint32(v.L)) b.Write4b(uint32(v.R)) b.Write4b(uint32(v.Y)) } func writeTrap(b *x.FixedSizeBuf, v *Trap) { writeSpanFixed(b, v.Top) writeSpanFixed(b, v.Bot) } // #WREQ func encodeAddTraps(picture Picture, xOff, yOff int16, traps []Trap) (b x.RequestBody) { b0 := b.AddBlock(2 + len(traps)*6). Write4b(uint32(picture)). Write2b(uint16(xOff)). Write2b(uint16(yOff)) for _, trap := range traps { writeTrap(b0, &trap) } b0.End() return } // #WREQ func encodeCreateSolidFill(pid Picture, color Color) (b x.RequestBody) { b0 := b.AddBlock(3). Write4b(uint32(pid)) writeColor(b0, color) b0.End() return } // #WREQ func encodeCreateLinearGradient(picture Picture, p1, p2 PointFixed, stops []Fixed, colors []Color) (b x.RequestBody) { b0 := b.AddBlock(6 + len(stops) + 2*len(colors)). Write4b(uint32(picture)) writePointFixed(b0, p1) writePointFixed(b0, p2) b0.Write4b(uint32(len(stops))) for _, s := range stops { b0.Write4b(uint32(s)) } for _, c := range colors { writeColor(b0, c) } b0.End() return } // #WREQ func encodeCreateRadialGradient(picture Picture, inner, outer PointFixed, innerRadius, outerRadius Fixed, stops []Fixed, colors []Color) (b x.RequestBody) { b0 := b.AddBlock(8 + len(stops) + 2*len(colors)). Write4b(uint32(picture)) writePointFixed(b0, inner) writePointFixed(b0, outer) b0.Write4b(uint32(innerRadius)). Write4b(uint32(outerRadius)). Write4b(uint32(len(stops))) for _, s := range stops { b0.Write4b(uint32(s)) } for _, c := range colors { writeColor(b0, c) } b0.End() return } // #WREQ func encodeCreateConicalGradient(picture Picture, center PointFixed, angle Fixed, stops []Fixed, colors []Color) (b x.RequestBody) { b0 := b.AddBlock(4 + len(stops) + 2*len(colors)). Write4b(uint32(picture)) writePointFixed(b0, center) b0.Write4b(uint32(angle)) for _, s := range stops { b0.Write4b(uint32(s)) } for _, c := range colors { writeColor(b0, c) } b0.End() return } go-x11-client-1.0.2/ext/render/render_req_auto.go000066400000000000000000000545761460713373000216130ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package render import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint32) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryPictFormats(conn *x.Conn) QueryPictFormatsCookie { body := encodeQueryPictFormats() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryPictFormatsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryPictFormatsCookie(seq) } func (cookie QueryPictFormatsCookie) Reply(conn *x.Conn) (*QueryPictFormatsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryPictFormatsReply err = readQueryPictFormatsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryPictIndexValues(conn *x.Conn, format PictFormat) QueryPictIndexValuesCookie { body := encodeQueryPictIndexValues(format) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryPictIndexValuesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryPictIndexValuesCookie(seq) } func (cookie QueryPictIndexValuesCookie) Reply(conn *x.Conn) (*QueryPictIndexValuesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryPictIndexValuesReply err = readQueryPictIndexValuesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryFilters(conn *x.Conn, drawable x.Drawable) QueryFiltersCookie { body := encodeQueryFilters(drawable) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryFiltersOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryFiltersCookie(seq) } func (cookie QueryFiltersCookie) Reply(conn *x.Conn) (*QueryFiltersReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryFiltersReply err = readQueryFiltersReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreatePicture(conn *x.Conn, pid Picture, drawable x.Drawable, format PictFormat, valueMask uint32, valueList []uint32) { body := encodeCreatePicture(pid, drawable, format, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePictureOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreatePictureChecked(conn *x.Conn, pid Picture, drawable x.Drawable, format PictFormat, valueMask uint32, valueList []uint32) x.VoidCookie { body := encodeCreatePicture(pid, drawable, format, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePictureOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ChangePicture(conn *x.Conn, picture Picture, valueMask uint32, valueList []uint32) { body := encodeChangePicture(picture, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangePictureOpcode, }, Body: body, } conn.SendRequest(0, req) } func ChangePictureChecked(conn *x.Conn, picture Picture, valueMask uint32, valueList []uint32) x.VoidCookie { body := encodeChangePicture(picture, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangePictureOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetPictureClipRectangles(conn *x.Conn, picture Picture, clipXOrigin, clipYOrigin int16, rectangles []x.Rectangle) { body := encodeSetPictureClipRectangles(picture, clipXOrigin, clipYOrigin, rectangles) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureClipRectanglesOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetPictureClipRectanglesChecked(conn *x.Conn, picture Picture, clipXOrigin, clipYOrigin int16, rectangles []x.Rectangle) x.VoidCookie { body := encodeSetPictureClipRectangles(picture, clipXOrigin, clipYOrigin, rectangles) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureClipRectanglesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetPictureTransform(conn *x.Conn, picture Picture, transform *Transform) { body := encodeSetPictureTransform(picture, transform) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureTransformOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetPictureTransformChecked(conn *x.Conn, picture Picture, transform *Transform) x.VoidCookie { body := encodeSetPictureTransform(picture, transform) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureTransformOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetPictureFilter(conn *x.Conn, picture Picture, filter string, values []Fixed) { body := encodeSetPictureFilter(picture, filter, values) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureFilterOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetPictureFilterChecked(conn *x.Conn, picture Picture, filter string, values []Fixed) x.VoidCookie { body := encodeSetPictureFilter(picture, filter, values) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetPictureFilterOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FreePicture(conn *x.Conn, picture Picture) { body := encodeFreePicture(picture) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreePictureOpcode, }, Body: body, } conn.SendRequest(0, req) } func FreePictureChecked(conn *x.Conn, picture Picture) x.VoidCookie { body := encodeFreePicture(picture) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreePictureOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Composite(conn *x.Conn, op uint8, src, mask, dst Picture, srcX, srcY, maskX, maskY, dstX, dstY int16, width, height uint16) { body := encodeComposite(op, src, mask, dst, srcX, srcY, maskX, maskY, dstX, dstY, width, height) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeOpcode, }, Body: body, } conn.SendRequest(0, req) } func CompositeChecked(conn *x.Conn, op uint8, src, mask, dst Picture, srcX, srcY, maskX, maskY, dstX, dstY int16, width, height uint16) x.VoidCookie { body := encodeComposite(op, src, mask, dst, srcX, srcY, maskX, maskY, dstX, dstY, width, height) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FillRectangles(conn *x.Conn, op uint8, dst Picture, color Color, rects []x.Rectangle) { body := encodeFillRectangles(op, dst, color, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FillRectanglesOpcode, }, Body: body, } conn.SendRequest(0, req) } func FillRectanglesChecked(conn *x.Conn, op uint8, dst Picture, color Color, rects []x.Rectangle) x.VoidCookie { body := encodeFillRectangles(op, dst, color, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FillRectanglesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Trapezoids(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, traps []Trapezoid) { body := encodeTrapezoids(op, src, dst, maskFormat, srcX, srcY, traps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TrapezoidsOpcode, }, Body: body, } conn.SendRequest(0, req) } func TrapezoidsChecked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, traps []Trapezoid) x.VoidCookie { body := encodeTrapezoids(op, src, dst, maskFormat, srcX, srcY, traps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TrapezoidsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Triangles(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, triangles []Triangle) { body := encodeTriangles(op, src, dst, maskFormat, srcX, srcY, triangles) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TrianglesOpcode, }, Body: body, } conn.SendRequest(0, req) } func TrianglesChecked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, triangles []Triangle) x.VoidCookie { body := encodeTriangles(op, src, dst, maskFormat, srcX, srcY, triangles) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TrianglesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func TriStrip(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) { body := encodeTriStrip(op, src, dst, maskFormat, srcX, srcY, points) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TriStripOpcode, }, Body: body, } conn.SendRequest(0, req) } func TriStripChecked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) x.VoidCookie { body := encodeTriStrip(op, src, dst, maskFormat, srcX, srcY, points) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TriStripOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func TriFan(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) { body := encodeTriFan(op, src, dst, maskFormat, srcX, srcY, points) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TriFanOpcode, }, Body: body, } conn.SendRequest(0, req) } func TriFanChecked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, srcX, srcY int16, points []PointFixed) x.VoidCookie { body := encodeTriFan(op, src, dst, maskFormat, srcX, srcY, points) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TriFanOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateGlyphSet(conn *x.Conn, gsId GlyphSet, format PictFormat) { body := encodeCreateGlyphSet(gsId, format) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateGlyphSetOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateGlyphSetChecked(conn *x.Conn, gsId GlyphSet, format PictFormat) x.VoidCookie { body := encodeCreateGlyphSet(gsId, format) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateGlyphSetOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ReferenceGlyphSet(conn *x.Conn, gsId, existing GlyphSet) { body := encodeReferenceGlyphSet(gsId, existing) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ReferenceGlyphSetOpcode, }, Body: body, } conn.SendRequest(0, req) } func ReferenceGlyphSetChecked(conn *x.Conn, gsId, existing GlyphSet) x.VoidCookie { body := encodeReferenceGlyphSet(gsId, existing) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ReferenceGlyphSetOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FreeGlyphSet(conn *x.Conn, glyphSet GlyphSet) { body := encodeFreeGlyphSet(glyphSet) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeGlyphSetOpcode, }, Body: body, } conn.SendRequest(0, req) } func FreeGlyphSetChecked(conn *x.Conn, glyphSet GlyphSet) x.VoidCookie { body := encodeFreeGlyphSet(glyphSet) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeGlyphSetOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func AddGlyphs(conn *x.Conn, glyphSet GlyphSet, glyphIds []uint32, glyphs []GlyphInfo, data []byte) { body := encodeAddGlyphs(glyphSet, glyphIds, glyphs, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddGlyphsOpcode, }, Body: body, } conn.SendRequest(0, req) } func AddGlyphsChecked(conn *x.Conn, glyphSet GlyphSet, glyphIds []uint32, glyphs []GlyphInfo, data []byte) x.VoidCookie { body := encodeAddGlyphs(glyphSet, glyphIds, glyphs, data) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddGlyphsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FreeGlyphs(conn *x.Conn, glyphSet GlyphSet, glyphs []Glyph) { body := encodeFreeGlyphs(glyphSet, glyphs) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeGlyphsOpcode, }, Body: body, } conn.SendRequest(0, req) } func FreeGlyphsChecked(conn *x.Conn, glyphSet GlyphSet, glyphs []Glyph) x.VoidCookie { body := encodeFreeGlyphs(glyphSet, glyphs) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FreeGlyphsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CompositeGlyphs8(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) { body := encodeCompositeGlyphs8(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs8Opcode, }, Body: body, } conn.SendRequest(0, req) } func CompositeGlyphs8Checked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) x.VoidCookie { body := encodeCompositeGlyphs8(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs8Opcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CompositeGlyphs16(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) { body := encodeCompositeGlyphs16(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs16Opcode, }, Body: body, } conn.SendRequest(0, req) } func CompositeGlyphs16Checked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) x.VoidCookie { body := encodeCompositeGlyphs16(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs16Opcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CompositeGlyphs32(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) { body := encodeCompositeGlyphs32(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs32Opcode, }, Body: body, } conn.SendRequest(0, req) } func CompositeGlyphs32Checked(conn *x.Conn, op uint8, src, dst Picture, maskFormat PictFormat, glyphSet GlyphSet, srcX, srcY int16, glyphCmds []byte) x.VoidCookie { body := encodeCompositeGlyphs32(op, src, dst, maskFormat, glyphSet, srcX, srcY, glyphCmds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CompositeGlyphs32Opcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateCursor(conn *x.Conn, cid x.Cursor, source Picture, X, y uint16) { body := encodeCreateCursor(cid, source, X, y) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateCursorChecked(conn *x.Conn, cid x.Cursor, source Picture, X, y uint16) x.VoidCookie { body := encodeCreateCursor(cid, source, X, y) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateAnimCursor(conn *x.Conn, cid x.Cursor, cursors []AnimCursorElt) { body := encodeCreateAnimCursor(cid, cursors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateAnimCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateAnimCursorChecked(conn *x.Conn, cid x.Cursor, cursors []AnimCursorElt) x.VoidCookie { body := encodeCreateAnimCursor(cid, cursors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateAnimCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func AddTraps(conn *x.Conn, picture Picture, xOff, yOff int16, traps []Trap) { body := encodeAddTraps(picture, xOff, yOff, traps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddTrapsOpcode, }, Body: body, } conn.SendRequest(0, req) } func AddTrapsChecked(conn *x.Conn, picture Picture, xOff, yOff int16, traps []Trap) x.VoidCookie { body := encodeAddTraps(picture, xOff, yOff, traps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AddTrapsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateSolidFill(conn *x.Conn, pid Picture, color Color) { body := encodeCreateSolidFill(pid, color) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateSolidFillOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateSolidFillChecked(conn *x.Conn, pid Picture, color Color) x.VoidCookie { body := encodeCreateSolidFill(pid, color) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateSolidFillOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateLinearGradient(conn *x.Conn, picture Picture, p1, p2 PointFixed, stops []Fixed, colors []Color) { body := encodeCreateLinearGradient(picture, p1, p2, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateLinearGradientOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateLinearGradientChecked(conn *x.Conn, picture Picture, p1, p2 PointFixed, stops []Fixed, colors []Color) x.VoidCookie { body := encodeCreateLinearGradient(picture, p1, p2, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateLinearGradientOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateRadialGradient(conn *x.Conn, picture Picture, inner, outer PointFixed, innerRadius, outerRadius Fixed, stops []Fixed, colors []Color) { body := encodeCreateRadialGradient(picture, inner, outer, innerRadius, outerRadius, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRadialGradientOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateRadialGradientChecked(conn *x.Conn, picture Picture, inner, outer PointFixed, innerRadius, outerRadius Fixed, stops []Fixed, colors []Color) x.VoidCookie { body := encodeCreateRadialGradient(picture, inner, outer, innerRadius, outerRadius, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRadialGradientOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateConicalGradient(conn *x.Conn, picture Picture, center PointFixed, angle Fixed, stops []Fixed, colors []Color) { body := encodeCreateConicalGradient(picture, center, angle, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateConicalGradientOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateConicalGradientChecked(conn *x.Conn, picture Picture, center PointFixed, angle Fixed, stops []Fixed, colors []Color) x.VoidCookie { body := encodeCreateConicalGradient(picture, center, angle, stops, colors) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateConicalGradientOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/screensaver/000077500000000000000000000000001460713373000171265ustar00rootroot00000000000000go-x11-client-1.0.2/ext/screensaver/auto.go000066400000000000000000000026031460713373000204260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package screensaver import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: ScreenSaver const MajorVersion = 1 const MinorVersion = 1 var _ext *x.Extension func Ext() *x.Extension { return _ext } // enum Kind const ( KindBlanked = 0 KindInternal = 1 KindExternal = 2 ) // enum Event const ( EventNotifyMask = 1 EventCycleMask = 2 ) // enum State const ( StateOff = 0 StateOn = 1 StateCycle = 2 StateDisabled = 3 ) const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const QueryInfoOpcode = 1 type QueryInfoCookie x.SeqNum const SelectInputOpcode = 2 const SetAttributesOpcode = 3 const UnsetAttributesOpcode = 4 const SuspendOpcode = 5 const NotifyEventCode = 0 func NewNotifyEvent(data []byte) (*NotifyEvent, error) { var ev NotifyEvent r := x.NewReaderFromData(data) err := readNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", QueryInfoOpcode: "QueryInfo", SelectInputOpcode: "SelectInput", SetAttributesOpcode: "SetAttributes", UnsetAttributesOpcode: "UnsetAttributes", SuspendOpcode: "Suspend", } func init() { _ext = x.NewExtension("MIT-SCREEN-SAVER", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/screensaver/screensaver.go000066400000000000000000000054341460713373000220030ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package screensaver import "github.com/linuxdeepin/go-x11-client" type NotifyEvent struct { State uint8 Sequence uint16 Time x.Timestamp Root x.Window Window x.Window Kind uint8 Forced bool } func readNotifyEvent(r *x.Reader, v *NotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } v.State, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.Root = x.Window(r.Read4b()) v.Window = x.Window(r.Read4b()) v.Kind = r.Read1b() v.Forced = r.ReadBool() // 5 return nil } // #WREQ func encodeQueryVersion(clientMajorVersion, clientMinorVersion uint8) (b x.RequestBody) { b.AddBlock(1). Write1b(clientMajorVersion). Write1b(clientMinorVersion). WritePad(2). End() return } type QueryVersionReply struct { ServerMajorVersion uint16 ServerMinorVersion uint16 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } r.ReadPad(8) v.ServerMajorVersion = r.Read2b() v.ServerMinorVersion = r.Read2b() // 3 return nil } // #WREQ func encodeQueryInfo(drawable x.Drawable) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(drawable)). End() return } type QueryInfoReply struct { State uint8 SaverWindow x.Window MsUntilServer uint32 MsSinceUserInput uint32 EventMask uint32 Kind uint8 } func readQueryInfoReply(r *x.Reader, v *QueryInfoReply) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } v.State, _ = r.ReadReplyHeader() v.SaverWindow = x.Window(r.Read4b()) v.MsUntilServer = r.Read4b() v.MsSinceUserInput = r.Read4b() v.EventMask = r.Read4b() // 6 v.Kind = r.Read1b() // 7 return nil } // #WREQ func encodeSelectInput(drawable x.Drawable, eventMask uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(drawable)). Write4b(eventMask). End() return } // #WREQ func encodeSetAttributes(drawable x.Drawable, X, y int16, width, height, boardWidth uint16, class, depth uint8, visual x.VisualID, valueMask uint32, valueList []uint32) (b x.RequestBody) { b0 := b.AddBlock(6 + len(valueList)). Write4b(uint32(drawable)). Write2b(uint16(X)). Write2b(uint16(y)). Write2b(width). Write2b(height). Write2b(boardWidth). Write1b(class). Write1b(depth). Write4b(uint32(visual)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeUnsetAttributes(drawable x.Drawable) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(drawable)). End() return } // #WREQ func encodeSuspend(suspend bool) (b x.RequestBody) { b.AddBlock(1). WriteBool(suspend). WritePad(3). End() return } go-x11-client-1.0.2/ext/screensaver/screensaver_req_auto.go000066400000000000000000000103461460713373000237000ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package screensaver import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, clientMajorVersion, clientMinorVersion uint8) QueryVersionCookie { body := encodeQueryVersion(clientMajorVersion, clientMinorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryInfo(conn *x.Conn, drawable x.Drawable) QueryInfoCookie { body := encodeQueryInfo(drawable) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryInfoCookie(seq) } func (cookie QueryInfoCookie) Reply(conn *x.Conn) (*QueryInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryInfoReply err = readQueryInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SelectInput(conn *x.Conn, drawable x.Drawable, eventMask uint32) { body := encodeSelectInput(drawable, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectInputOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectInputChecked(conn *x.Conn, drawable x.Drawable, eventMask uint32) x.VoidCookie { body := encodeSelectInput(drawable, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectInputOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetAttributes(conn *x.Conn, drawable x.Drawable, X, y int16, width, height, boardWidth uint16, class, depth uint8, visual x.VisualID, valueMask uint32, valueList []uint32) { body := encodeSetAttributes(drawable, X, y, width, height, boardWidth, class, depth, visual, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetAttributesOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetAttributesChecked(conn *x.Conn, drawable x.Drawable, X, y int16, width, height, boardWidth uint16, class, depth uint8, visual x.VisualID, valueMask uint32, valueList []uint32) x.VoidCookie { body := encodeSetAttributes(drawable, X, y, width, height, boardWidth, class, depth, visual, valueMask, valueList) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetAttributesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func UnsetAttributes(conn *x.Conn, drawable x.Drawable) { body := encodeUnsetAttributes(drawable) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnsetAttributesOpcode, }, Body: body, } conn.SendRequest(0, req) } func UnsetAttributesChecked(conn *x.Conn, drawable x.Drawable) x.VoidCookie { body := encodeUnsetAttributes(drawable) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnsetAttributesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Suspend(conn *x.Conn, suspend bool) { body := encodeSuspend(suspend) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SuspendOpcode, }, Body: body, } conn.SendRequest(0, req) } func SuspendChecked(conn *x.Conn, suspend bool) x.VoidCookie { body := encodeSuspend(suspend) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SuspendOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/shm/000077500000000000000000000000001460713373000153755ustar00rootroot00000000000000go-x11-client-1.0.2/ext/shm/auto.go000066400000000000000000000026401460713373000166760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package shm import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Shm const MajorVersion = 1 const MinorVersion = 2 var _ext *x.Extension func Ext() *x.Extension { return _ext } // simple ('xcb', 'Shm', 'SEG') type Seg uint32 const CompletionEventCode = 0 func NewCompletionEvent(data []byte) (*CompletionEvent, error) { var ev CompletionEvent r := x.NewReaderFromData(data) err := readCompletionEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const BadSegErrorCode = 0 const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum const AttachOpcode = 1 const DetachOpcode = 2 const PutImageOpcode = 3 const GetImageOpcode = 4 type GetImageCookie x.SeqNum const CreatePixmapOpcode = 5 const AttachFdOpcode = 6 const CreateSegmentOpcode = 7 type CreateSegmentCookie x.SeqNum var errorCodeNameMap = map[uint8]string{ BadSegErrorCode: "BadSeg", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", AttachOpcode: "Attach", DetachOpcode: "Detach", PutImageOpcode: "PutImage", GetImageOpcode: "GetImage", CreatePixmapOpcode: "CreatePixmap", AttachFdOpcode: "AttachFd", CreateSegmentOpcode: "CreateSegment", } func init() { _ext = x.NewExtension("MIT-SHM", 0, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/shm/shm.go000066400000000000000000000057231460713373000165220ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package shm import "github.com/linuxdeepin/go-x11-client" type CompletionEvent struct { Sequence uint16 } func readCompletionEvent(r *x.Reader, v *CompletionEvent) error { if !r.RemainAtLeast4b(1) { return x.ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() return nil } // #WREQ func encodeQueryVersion() (b x.RequestBody) { return } type QueryVersionReply struct { SharedPixmaps bool MajorVersion uint16 MinorVersion uint16 Uid uint16 Gid uint16 PixmapFormat uint8 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } sharedPixmaps, _ := r.ReadReplyHeader() v.SharedPixmaps = x.Uint8ToBool(sharedPixmaps) v.MajorVersion = r.Read2b() v.MinorVersion = r.Read2b() v.Uid = r.Read2b() v.Gid = r.Read2b() v.PixmapFormat = r.Read1b() // 5 return nil } // #WREQ func encodeAttach(shmSeg Seg, shmId uint32, readOnly bool) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(shmSeg)). Write4b(shmId). WriteBool(readOnly). WritePad(3). End() return } // #WREQ func encodeDetach(shmSeg Seg) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(shmSeg)). End() return } // #WREQ func encodePutImage(drawable x.Drawable, gc x.GContext, totalWidth, totalHeight, srcX, srcY, srcWidth, srcHeight uint16, dstX, dstY int16, depth, format uint8, sendEvent bool, shmSeg Seg, offset uint32) (b x.RequestBody) { b.AddBlock(9). Write4b(uint32(drawable)). Write4b(uint32(gc)). Write2b(totalWidth). Write2b(totalHeight). Write2b(srcX). Write2b(srcY). Write2b(srcWidth). Write2b(srcHeight). Write2b(uint16(dstX)). Write2b(uint16(dstY)). Write1b(depth). Write1b(format). WriteBool(sendEvent). WritePad(1). Write4b(uint32(shmSeg)). Write4b(offset). End() return } // #WREQ func encodeGetImage(drawable x.Drawable, X, y int16, width, height uint16, planeMask uint32, format uint8, shmSeg Seg, offset uint32) (b x.RequestBody) { b.AddBlock(7). Write4b(uint32(drawable)). Write2b(uint16(X)). Write2b(uint16(y)). Write2b(width). Write2b(height). Write4b(planeMask). Write1b(format). WritePad(3). Write4b(uint32(shmSeg)). Write4b(offset). End() return } type GetImageReply struct { Depth uint8 Visual x.VisualID Size uint32 } func readGetImageReply(r *x.Reader, v *GetImageReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } v.Depth, _ = r.ReadReplyHeader() v.Visual = x.VisualID(r.Read4b()) v.Size = r.Read4b() // 4 return nil } // #WREQ func encodeCreatePixmap(pid x.Pixmap, drawable x.Drawable, width, height uint16, depth uint8, shmSeg Seg, offset uint32) (b x.RequestBody) { b.AddBlock(6). Write4b(uint32(pid)). Write4b(uint32(drawable)). Write2b(width). Write2b(height). Write1b(depth). WritePad(3). Write4b(uint32(shmSeg)). Write4b(offset). End() return } go-x11-client-1.0.2/ext/shm/shm_req_auto.go000066400000000000000000000111221460713373000204070ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package shm import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn) QueryVersionCookie { body := encodeQueryVersion() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func Attach(conn *x.Conn, shmSeg Seg, shmId uint32, readOnly bool) { body := encodeAttach(shmSeg, shmId, readOnly) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AttachOpcode, }, Body: body, } conn.SendRequest(0, req) } func AttachChecked(conn *x.Conn, shmSeg Seg, shmId uint32, readOnly bool) x.VoidCookie { body := encodeAttach(shmSeg, shmId, readOnly) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: AttachOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Detach(conn *x.Conn, shmSeg Seg) { body := encodeDetach(shmSeg) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DetachOpcode, }, Body: body, } conn.SendRequest(0, req) } func DetachChecked(conn *x.Conn, shmSeg Seg) x.VoidCookie { body := encodeDetach(shmSeg) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DetachOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func PutImage(conn *x.Conn, drawable x.Drawable, gc x.GContext, totalWidth, totalHeight, srcX, srcY, srcWidth, srcHeight uint16, dstX, dstY int16, depth, format uint8, sendEvent bool, shmSeg Seg, offset uint32) { body := encodePutImage(drawable, gc, totalWidth, totalHeight, srcX, srcY, srcWidth, srcHeight, dstX, dstY, depth, format, sendEvent, shmSeg, offset) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: PutImageOpcode, }, Body: body, } conn.SendRequest(0, req) } func PutImageChecked(conn *x.Conn, drawable x.Drawable, gc x.GContext, totalWidth, totalHeight, srcX, srcY, srcWidth, srcHeight uint16, dstX, dstY int16, depth, format uint8, sendEvent bool, shmSeg Seg, offset uint32) x.VoidCookie { body := encodePutImage(drawable, gc, totalWidth, totalHeight, srcX, srcY, srcWidth, srcHeight, dstX, dstY, depth, format, sendEvent, shmSeg, offset) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: PutImageOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetImage(conn *x.Conn, drawable x.Drawable, X, y int16, width, height uint16, planeMask uint32, format uint8, shmSeg Seg, offset uint32) GetImageCookie { body := encodeGetImage(drawable, X, y, width, height, planeMask, format, shmSeg, offset) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetImageOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetImageCookie(seq) } func (cookie GetImageCookie) Reply(conn *x.Conn) (*GetImageReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetImageReply err = readGetImageReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreatePixmap(conn *x.Conn, pid x.Pixmap, drawable x.Drawable, width, height uint16, depth uint8, shmSeg Seg, offset uint32) { body := encodeCreatePixmap(pid, drawable, width, height, depth, shmSeg, offset) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePixmapOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreatePixmapChecked(conn *x.Conn, pid x.Pixmap, drawable x.Drawable, width, height uint16, depth uint8, shmSeg Seg, offset uint32) x.VoidCookie { body := encodeCreatePixmap(pid, drawable, width, height, depth, shmSeg, offset) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePixmapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/test/000077500000000000000000000000001460713373000155655ustar00rootroot00000000000000go-x11-client-1.0.2/ext/test/auto.go000066400000000000000000000015031460713373000170630ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package test import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: Test const MajorVersion = 2 const MinorVersion = 2 var _ext *x.Extension func Ext() *x.Extension { return _ext } const GetVersionOpcode = 0 type GetVersionCookie x.SeqNum // enum Cursor const ( CursorNone = 0 CursorCurrent = 1 ) const CompareCursorOpcode = 1 type CompareCursorCookie x.SeqNum const FakeInputOpcode = 2 const GrabControlOpcode = 3 var requestOpcodeNameMap = map[uint]string{ GetVersionOpcode: "GetVersion", CompareCursorOpcode: "CompareCursor", FakeInputOpcode: "FakeInput", GrabControlOpcode: "GrabControl", } func init() { _ext = x.NewExtension("XTEST", 0, nil, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/test/test.go000066400000000000000000000031511460713373000170730ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package test import ( x "github.com/linuxdeepin/go-x11-client" ) // #WREQ func encodeGetVersion(majorVersion uint8, minorVersion uint16) (b x.RequestBody) { b.AddBlock(1). Write1b(majorVersion). WritePad(1). Write2b(minorVersion). End() return } type GetVersionReply struct { MajorVersion uint8 MinorVersion uint16 } func readGetVersionReply(r *x.Reader, v *GetVersionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.MajorVersion, _ = r.ReadReplyHeader() v.MinorVersion = r.Read2b() // 3 return nil } // #WREQ func encodeCompareCursor(window x.Window, cursor x.Cursor) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(uint32(cursor)). End() return } type CompareCursorReply struct { Same bool } func readCompareCursorReply(r *x.Reader, v *CompareCursorReply) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } same, _ := r.ReadReplyHeader() // 2 v.Same = x.Uint8ToBool(same) return nil } // #WREQ func encodeFakeInput(evType uint8, detail uint8, time x.Timestamp, root x.Window, rootX, rootY int16, deviceId uint8) (b x.RequestBody) { b.AddBlock(8). Write1b(evType). Write1b(detail). WritePad(2). Write4b(uint32(time)). Write4b(uint32(root)). WritePad(8). Write2b(uint16(rootX)). Write2b(uint16(rootY)). WritePad(7). Write1b(deviceId). End() return } // #WREQ func encodeGrabControl(impervious bool) (b x.RequestBody) { b.AddBlock(1). WriteBool(impervious). WritePad(3). End() return } go-x11-client-1.0.2/ext/test/test_req_auto.go000066400000000000000000000055651460713373000210050ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package test import x "github.com/linuxdeepin/go-x11-client" func GetVersion(conn *x.Conn, majorVersion uint8, minorVersion uint16) GetVersionCookie { body := encodeGetVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetVersionCookie(seq) } func (cookie GetVersionCookie) Reply(conn *x.Conn) (*GetVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetVersionReply err = readGetVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CompareCursor(conn *x.Conn, window x.Window, cursor x.Cursor) CompareCursorCookie { body := encodeCompareCursor(window, cursor) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: CompareCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return CompareCursorCookie(seq) } func (cookie CompareCursorCookie) Reply(conn *x.Conn) (*CompareCursorReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply CompareCursorReply err = readCompareCursorReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func FakeInput(conn *x.Conn, evType uint8, detail uint8, time x.Timestamp, root x.Window, rootX, rootY int16, deviceId uint8) { body := encodeFakeInput(evType, detail, time, root, rootX, rootY, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FakeInputOpcode, }, Body: body, } conn.SendRequest(0, req) } func FakeInputChecked(conn *x.Conn, evType uint8, detail uint8, time x.Timestamp, root x.Window, rootX, rootY int16, deviceId uint8) x.VoidCookie { body := encodeFakeInput(evType, detail, time, root, rootX, rootY, deviceId) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: FakeInputOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GrabControl(conn *x.Conn, impervious bool) { body := encodeGrabControl(impervious) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: GrabControlOpcode, }, Body: body, } conn.SendRequest(0, req) } func GrabControlChecked(conn *x.Conn, impervious bool) x.VoidCookie { body := encodeGrabControl(impervious) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: GrabControlOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/xfixes/000077500000000000000000000000001460713373000161145ustar00rootroot00000000000000go-x11-client-1.0.2/ext/xfixes/auto.go000066400000000000000000000117521460713373000174210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xfixes import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: XFixes const MajorVersion = 5 const MinorVersion = 0 var _ext *x.Extension func Ext() *x.Extension { return _ext } const QueryVersionOpcode = 0 type QueryVersionCookie x.SeqNum // enum SaveSetMode const ( SaveSetModeInsert = 0 SaveSetModeDelete = 1 ) // enum SaveSetTarget const ( SaveSetTargetNearest = 0 SaveSetTargetRoot = 1 ) // enum SaveSetMapping const ( SaveSetMappingMap = 0 SaveSetMappingUnmap = 1 ) const ChangeSaveSetOpcode = 1 // enum SelectionEvent const ( SelectionEventSetSelectionOwner = 0 SelectionEventSelectionWindowDestroy = 1 SelectionEventSelectionClientClose = 2 ) // enum SelectionEventMask const ( SelectionEventMaskSetSelectionOwner = 1 SelectionEventMaskSelectionWindowDestroy = 2 SelectionEventMaskSelectionClientClose = 4 ) const SelectionNotifyEventCode = 0 func NewSelectionNotifyEvent(data []byte) (*SelectionNotifyEvent, error) { var ev SelectionNotifyEvent r := x.NewReaderFromData(data) err := readSelectionNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const SelectSelectionInputOpcode = 2 // enum CursorNotify const ( CursorNotifyDisplayCursor = 0 ) // enum CursorNotifyMask const ( CursorNotifyMaskDisplayCursor = 1 ) const CursorNotifyEventCode = 1 func NewCursorNotifyEvent(data []byte) (*CursorNotifyEvent, error) { var ev CursorNotifyEvent r := x.NewReaderFromData(data) err := readCursorNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const SelectCursorInputOpcode = 3 const GetCursorImageOpcode = 4 type GetCursorImageCookie x.SeqNum // simple ('xcb', 'XFixes', 'REGION') type Region uint32 const BadRegionErrorCode = 0 // enum Region const ( RegionNone = 0 ) const CreateRegionOpcode = 5 const CreateRegionFromBitmapOpcode = 6 const CreateRegionFromWindowOpcode = 7 const CreateRegionFromGCOpcode = 8 const CreateRegionFromPictureOpcode = 9 const DestroyRegionOpcode = 10 const SetRegionOpcode = 11 const CopyRegionOpcode = 12 const UnionRegionOpcode = 13 const IntersectRegionOpcode = 14 const SubtractRegionOpcode = 15 const InvertRegionOpcode = 16 const TranslateRegionOpcode = 17 const RegionExtentsOpcode = 18 const FetchRegionOpcode = 19 type FetchRegionCookie x.SeqNum const SetGCClipRegionOpcode = 20 const SetWindowShapeRegionOpcode = 21 const SetPictureClipRegionOpcode = 22 const SetCursorNameOpcode = 23 const GetCursorNameOpcode = 24 type GetCursorNameCookie x.SeqNum const GetCursorImageAndNameOpcode = 25 type GetCursorImageAndNameCookie x.SeqNum const ChangeCursorOpcode = 26 const ChangeCursorByNameOpcode = 27 const ExpandRegionOpcode = 28 const HideCursorOpcode = 29 const ShowCursorOpcode = 30 // simple ('xcb', 'XFixes', 'BARRIER') type Barrier uint32 // enum BarrierDirections const ( BarrierDirectionsPositiveX = 1 BarrierDirectionsPositiveY = 2 BarrierDirectionsNegativeX = 4 BarrierDirectionsNegativeY = 8 ) const CreatePointerBarrierOpcode = 31 const DeletePointerBarrierOpcode = 32 var errorCodeNameMap = map[uint8]string{ BadRegionErrorCode: "BadRegion", } var requestOpcodeNameMap = map[uint]string{ QueryVersionOpcode: "QueryVersion", ChangeSaveSetOpcode: "ChangeSaveSet", SelectSelectionInputOpcode: "SelectSelectionInput", SelectCursorInputOpcode: "SelectCursorInput", GetCursorImageOpcode: "GetCursorImage", CreateRegionOpcode: "CreateRegion", CreateRegionFromBitmapOpcode: "CreateRegionFromBitmap", CreateRegionFromWindowOpcode: "CreateRegionFromWindow", CreateRegionFromGCOpcode: "CreateRegionFromGC", CreateRegionFromPictureOpcode: "CreateRegionFromPicture", DestroyRegionOpcode: "DestroyRegion", SetRegionOpcode: "SetRegion", CopyRegionOpcode: "CopyRegion", UnionRegionOpcode: "UnionRegion", IntersectRegionOpcode: "IntersectRegion", SubtractRegionOpcode: "SubtractRegion", InvertRegionOpcode: "InvertRegion", TranslateRegionOpcode: "TranslateRegion", RegionExtentsOpcode: "RegionExtents", FetchRegionOpcode: "FetchRegion", SetGCClipRegionOpcode: "SetGCClipRegion", SetWindowShapeRegionOpcode: "SetWindowShapeRegion", SetPictureClipRegionOpcode: "SetPictureClipRegion", SetCursorNameOpcode: "SetCursorName", GetCursorNameOpcode: "GetCursorName", GetCursorImageAndNameOpcode: "GetCursorImageAndName", ChangeCursorOpcode: "ChangeCursor", ChangeCursorByNameOpcode: "ChangeCursorByName", ExpandRegionOpcode: "ExpandRegion", HideCursorOpcode: "HideCursor", ShowCursorOpcode: "ShowCursor", CreatePointerBarrierOpcode: "CreatePointerBarrier", DeletePointerBarrierOpcode: "DeletePointerBarrier", } func init() { _ext = x.NewExtension("XFIXES", 0, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/xfixes/xfixes.go000066400000000000000000000232211460713373000177510ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xfixes import ( "math" "github.com/linuxdeepin/go-x11-client" ) // #WREQ func encodeQueryVersion(majorVersion, minorVersion uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(majorVersion). Write4b(minorVersion). End() return } type QueryVersionReply struct { MajorVersion uint32 MinorVersion uint32 } func readQueryVersionReply(r *x.Reader, v *QueryVersionReply) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } r.ReadPad(8) v.MajorVersion = r.Read4b() v.MinorVersion = r.Read4b() // 4 return nil } // #WREQ func encodeChangeSaveSet(mode, target, map0 uint8, window x.Window) (b x.RequestBody) { b.AddBlock(2). Write1b(mode). Write1b(target). Write1b(map0). WritePad(1). Write4b(uint32(window)). End() return } type SelectionNotifyEvent struct { Subtype uint8 Sequence uint16 Window x.Window Owner x.Window Selection x.Atom Timestamp x.Timestamp SelectionTimestamp x.Timestamp } func readSelectionNotifyEvent(r *x.Reader, v *SelectionNotifyEvent) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } v.Subtype, v.Sequence = r.ReadEventHeader() v.Window = x.Window(r.Read4b()) v.Owner = x.Window(r.Read4b()) v.Selection = x.Atom(r.Read4b()) v.Timestamp = x.Timestamp(r.Read4b()) v.SelectionTimestamp = x.Timestamp(r.Read4b()) // 6 return nil } // #WREQ func encodeSelectSelectionInput(window x.Window, selection x.Atom, eventMask uint32) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(window)). Write4b(uint32(selection)). Write4b(eventMask). End() return } type CursorNotifyEvent struct { Subtype uint8 Sequence uint16 Window x.Window CursorSerial uint32 Timestamp x.Timestamp Name x.Atom } func readCursorNotifyEvent(r *x.Reader, v *CursorNotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } v.Subtype, v.Sequence = r.ReadEventHeader() v.Window = x.Window(r.Read4b()) v.CursorSerial = r.Read4b() v.Timestamp = x.Timestamp(r.Read4b()) v.Name = x.Atom(r.Read4b()) // 5 return nil } // #WREQ func encodeSelectCursorInput(window x.Window, eventMask uint32) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(eventMask). End() return } // #WREQ func encodeGetCursorImage() (b x.RequestBody) { return } type GetCursorImageReply struct { X int16 Y int16 Width uint16 Height uint16 XHot uint16 YHot uint16 CursorSerial uint32 CursorImage []uint32 } func readGetCursorImageReply(r *x.Reader, v *GetCursorImageReply) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } r.ReadPad(8) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() v.XHot = r.Read2b() v.YHot = r.Read2b() v.CursorSerial = r.Read4b() // 6 dataLen := int(v.Width) * int(v.Height) if dataLen > 0 { if !r.RemainAtLeast4b(dataLen) { return x.ErrDataLenShort } v.CursorImage = make([]uint32, dataLen) for i := 0; i < dataLen; i++ { v.CursorImage[i] = r.Read4b() } } return nil } // #WREQ func encodeCreateRegion(region Region, rects []x.Rectangle) (b x.RequestBody) { b0 := b.AddBlock(1 + 2*len(rects)). Write4b(uint32(region)) for _, rect := range rects { x.WriteRectangle(b0, rect) } b0.End() return } // #WREQ func encodeCreateRegionFromBitmap(region Region, bitmap x.Pixmap) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(region)). Write4b(uint32(bitmap)). End() return } // #WREQ //func encodeCreateRegionFromWindow // #WREQ func encodeCreateRegionFromGC(region Region, gc x.GContext) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(region)). Write4b(uint32(gc)). End() return } // #WREQ //func encodeCreateRegionFromPicture // #WREQ func encodeDestroyRegion(region Region) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(region)). End() return } // #WREQ func encodeSetRegion(region Region, rects []x.Rectangle) (b x.RequestBody) { b0 := b.AddBlock(1 + 2*len(rects)). Write4b(uint32(region)) for _, rect := range rects { x.WriteRectangle(b0, rect) } b0.End() return } // #WREQ func encodeCopyRegion(source, destination Region) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(source)). Write4b(uint32(destination)). End() return } // #WREQ func encodeUnionRegion(source1, source2, destination Region) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(source1)). Write4b(uint32(source2)). Write4b(uint32(destination)). End() return } // #WREQ func encodeIntersectRegion(source1, source2, destination Region) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(source1)). Write4b(uint32(source2)). Write4b(uint32(destination)). End() return } // #WREQ func encodeSubtractRegion(source1, source2, destination Region) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(source1)). Write4b(uint32(source2)). Write4b(uint32(destination)). End() return } // #WREQ func encodeInvertRegion(source Region, bounds x.Rectangle, destination Region) (b x.RequestBody) { b0 := b.AddBlock(4). Write4b(uint32(source)) x.WriteRectangle(b0, bounds) b0.Write4b(uint32(destination)). End() return } // #WREQ func encodeTranslateRegion(region Region, dx, dy int16) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(region)). Write2b(uint16(dx)). Write2b(uint16(dy)). End() return } // #WREQ func encodeRegionExtents(source, destination Region) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(source)). Write4b(uint32(destination)). End() return } // #WREQ func encodeFetchRegion(region Region) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(region)). End() return } type FetchRegionReply struct { Extents x.Rectangle Rectangles []x.Rectangle } func readFetchRegionReply(r *x.Reader, v *FetchRegionReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } _, replyLen := r.ReadReplyHeader() v.Extents = x.ReadRectangle(r) // 4 r.ReadPad(16) // 8 rectanglesLen := int(replyLen / 2) if rectanglesLen > 0 { if !r.RemainAtLeast4b(2 * rectanglesLen) { return x.ErrDataLenShort } v.Rectangles = make([]x.Rectangle, rectanglesLen) for i := 0; i < rectanglesLen; i++ { v.Rectangles[i] = x.ReadRectangle(r) } } return nil } // #WREQ func encodeSetGCClipRegion(gc x.GContext, clipXOrigin, clipYOrigin int16, region Region) (b x.RequestBody) { b.AddBlock(3). Write4b(uint32(gc)). Write4b(uint32(region)). Write2b(uint16(clipXOrigin)). Write2b(uint16(clipYOrigin)). End() return } // #WREQ func encodeSetCursorName(cursor x.Cursor, name string) (b x.RequestBody) { name = x.TruncateStr(name, math.MaxUint16) nameLen := len(name) b.AddBlock(2 + x.SizeIn4bWithPad(nameLen)). Write4b(uint32(cursor)). Write2b(uint16(nameLen)). WritePad(2). WriteString(name). WritePad(x.Pad(nameLen)). End() return } // #WREQ func encodeGetCursorImageAndName() (b x.RequestBody) { return } type GetCursorImageAndNameReply struct { X, Y int16 Width, Height uint16 XHot, YHot uint16 CursorSerial uint32 CursorAtom x.Atom CursorName string CursorImage []uint32 } func readGetCursorImageAndNameReply(r *x.Reader, v *GetCursorImageAndNameReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } r.ReadPad(8) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() v.XHot = r.Read2b() v.YHot = r.Read2b() // 5 v.CursorSerial = r.Read4b() v.CursorAtom = x.Atom(r.Read4b()) cursorNameLen := int(r.Read2b()) r.ReadPad(2) // 8 dataLen := int(v.Width) * int(v.Height) if dataLen > 0 { if !r.RemainAtLeast4b(dataLen) { return x.ErrDataLenShort } v.CursorImage = make([]uint32, dataLen) for i := 0; i < dataLen; i++ { v.CursorImage[i] = r.Read4b() } } var err error v.CursorName, err = r.ReadString(cursorNameLen) return err } // #WREQ func encodeChangeCursor(source, destination x.Cursor) (b x.RequestBody) { b.AddBlock(2). Write4b(uint32(source)). Write4b(uint32(destination)). End() return } // #WREQ func encodeChangeCursorByName(src x.Cursor, name string) (b x.RequestBody) { name = x.TruncateStr(name, math.MaxUint16) nameLen := len(name) b.AddBlock(2 + x.SizeIn4bWithPad(nameLen)). Write4b(uint32(src)). Write2b(uint16(nameLen)). WritePad(2). WriteString(name). WritePad(x.Pad(nameLen)). End() return } // #WREQ func encodeExpandRegion(source, destination Region, left, right, top, bottom uint16) (b x.RequestBody) { b.AddBlock(4). Write4b(uint32(source)). Write4b(uint32(destination)). Write2b(left). Write2b(right). Write2b(top). Write2b(bottom). End() return } // #WREQ func encodeHideCursor(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeShowCursor(window x.Window) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeCreatePointerBarrier(barrier Barrier, drawable x.Drawable, x1, y1, x2, y2 int16, directions uint32, devices []uint16) (b x.RequestBody) { devicesLen := len(devices) b0 := b.AddBlock(6 + x.SizeIn4bWithPad(devicesLen*2)). Write4b(uint32(barrier)). Write4b(uint32(drawable)). Write2b(uint16(x1)). Write2b(uint16(y1)). Write2b(uint16(x2)). Write2b(uint16(y2)). Write4b(directions). WritePad(2). Write2b(uint16(len(devices))) for _, device := range devices { b0.Write2b(device) } b0.WritePad(x.Pad(devicesLen * 2)) b0.End() return } // #WREQ func encodeDeletePointerBarrier(barrier Barrier) (b x.RequestBody) { b.AddBlock(1). Write4b(uint32(barrier)). End() return } go-x11-client-1.0.2/ext/xfixes/xfixes_req_auto.go000066400000000000000000000445231460713373000216600ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xfixes import x "github.com/linuxdeepin/go-x11-client" func QueryVersion(conn *x.Conn, majorVersion, minorVersion uint32) QueryVersionCookie { body := encodeQueryVersion(majorVersion, minorVersion) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: QueryVersionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return QueryVersionCookie(seq) } func (cookie QueryVersionCookie) Reply(conn *x.Conn) (*QueryVersionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply QueryVersionReply err = readQueryVersionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ChangeSaveSet(conn *x.Conn, mode, target, map0 uint8, window x.Window) { body := encodeChangeSaveSet(mode, target, map0, window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeSaveSetOpcode, }, Body: body, } conn.SendRequest(0, req) } func ChangeSaveSetChecked(conn *x.Conn, mode, target, map0 uint8, window x.Window) x.VoidCookie { body := encodeChangeSaveSet(mode, target, map0, window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeSaveSetOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SelectSelectionInput(conn *x.Conn, window x.Window, selection x.Atom, eventMask uint32) { body := encodeSelectSelectionInput(window, selection, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectSelectionInputOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectSelectionInputChecked(conn *x.Conn, window x.Window, selection x.Atom, eventMask uint32) x.VoidCookie { body := encodeSelectSelectionInput(window, selection, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectSelectionInputOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SelectCursorInput(conn *x.Conn, window x.Window, eventMask uint32) { body := encodeSelectCursorInput(window, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectCursorInputOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectCursorInputChecked(conn *x.Conn, window x.Window, eventMask uint32) x.VoidCookie { body := encodeSelectCursorInput(window, eventMask) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectCursorInputOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCursorImage(conn *x.Conn) GetCursorImageCookie { body := encodeGetCursorImage() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCursorImageOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCursorImageCookie(seq) } func (cookie GetCursorImageCookie) Reply(conn *x.Conn) (*GetCursorImageReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCursorImageReply err = readGetCursorImageReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreateRegion(conn *x.Conn, region Region, rects []x.Rectangle) { body := encodeCreateRegion(region, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateRegionChecked(conn *x.Conn, region Region, rects []x.Rectangle) x.VoidCookie { body := encodeCreateRegion(region, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateRegionFromBitmap(conn *x.Conn, region Region, bitmap x.Pixmap) { body := encodeCreateRegionFromBitmap(region, bitmap) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionFromBitmapOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateRegionFromBitmapChecked(conn *x.Conn, region Region, bitmap x.Pixmap) x.VoidCookie { body := encodeCreateRegionFromBitmap(region, bitmap) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionFromBitmapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreateRegionFromGC(conn *x.Conn, region Region, gc x.GContext) { body := encodeCreateRegionFromGC(region, gc) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionFromGCOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreateRegionFromGCChecked(conn *x.Conn, region Region, gc x.GContext) x.VoidCookie { body := encodeCreateRegionFromGC(region, gc) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreateRegionFromGCOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func DestroyRegion(conn *x.Conn, region Region) { body := encodeDestroyRegion(region) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func DestroyRegionChecked(conn *x.Conn, region Region) x.VoidCookie { body := encodeDestroyRegion(region) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DestroyRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetRegion(conn *x.Conn, region Region, rects []x.Rectangle) { body := encodeSetRegion(region, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetRegionChecked(conn *x.Conn, region Region, rects []x.Rectangle) x.VoidCookie { body := encodeSetRegion(region, rects) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CopyRegion(conn *x.Conn, source, destination Region) { body := encodeCopyRegion(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CopyRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func CopyRegionChecked(conn *x.Conn, source, destination Region) x.VoidCookie { body := encodeCopyRegion(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CopyRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func UnionRegion(conn *x.Conn, source1, source2, destination Region) { body := encodeUnionRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnionRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func UnionRegionChecked(conn *x.Conn, source1, source2, destination Region) x.VoidCookie { body := encodeUnionRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: UnionRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func IntersectRegion(conn *x.Conn, source1, source2, destination Region) { body := encodeIntersectRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: IntersectRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func IntersectRegionChecked(conn *x.Conn, source1, source2, destination Region) x.VoidCookie { body := encodeIntersectRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: IntersectRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SubtractRegion(conn *x.Conn, source1, source2, destination Region) { body := encodeSubtractRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SubtractRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func SubtractRegionChecked(conn *x.Conn, source1, source2, destination Region) x.VoidCookie { body := encodeSubtractRegion(source1, source2, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SubtractRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func InvertRegion(conn *x.Conn, source Region, bounds x.Rectangle, destination Region) { body := encodeInvertRegion(source, bounds, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: InvertRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func InvertRegionChecked(conn *x.Conn, source Region, bounds x.Rectangle, destination Region) x.VoidCookie { body := encodeInvertRegion(source, bounds, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: InvertRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func TranslateRegion(conn *x.Conn, region Region, dx, dy int16) { body := encodeTranslateRegion(region, dx, dy) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TranslateRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func TranslateRegionChecked(conn *x.Conn, region Region, dx, dy int16) x.VoidCookie { body := encodeTranslateRegion(region, dx, dy) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: TranslateRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func RegionExtents(conn *x.Conn, source, destination Region) { body := encodeRegionExtents(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RegionExtentsOpcode, }, Body: body, } conn.SendRequest(0, req) } func RegionExtentsChecked(conn *x.Conn, source, destination Region) x.VoidCookie { body := encodeRegionExtents(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: RegionExtentsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func FetchRegion(conn *x.Conn, region Region) FetchRegionCookie { body := encodeFetchRegion(region) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: FetchRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return FetchRegionCookie(seq) } func (cookie FetchRegionCookie) Reply(conn *x.Conn) (*FetchRegionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply FetchRegionReply err = readFetchRegionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetGCClipRegion(conn *x.Conn, gc x.GContext, clipXOrigin, clipYOrigin int16, region Region) { body := encodeSetGCClipRegion(gc, clipXOrigin, clipYOrigin, region) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetGCClipRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetGCClipRegionChecked(conn *x.Conn, gc x.GContext, clipXOrigin, clipYOrigin int16, region Region) x.VoidCookie { body := encodeSetGCClipRegion(gc, clipXOrigin, clipYOrigin, region) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetGCClipRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetCursorName(conn *x.Conn, cursor x.Cursor, name string) { body := encodeSetCursorName(cursor, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCursorNameOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetCursorNameChecked(conn *x.Conn, cursor x.Cursor, name string) x.VoidCookie { body := encodeSetCursorName(cursor, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCursorNameOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCursorImageAndName(conn *x.Conn) GetCursorImageAndNameCookie { body := encodeGetCursorImageAndName() req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCursorImageAndNameOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCursorImageAndNameCookie(seq) } func (cookie GetCursorImageAndNameCookie) Reply(conn *x.Conn) (*GetCursorImageAndNameReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCursorImageAndNameReply err = readGetCursorImageAndNameReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ChangeCursor(conn *x.Conn, source, destination x.Cursor) { body := encodeChangeCursor(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func ChangeCursorChecked(conn *x.Conn, source, destination x.Cursor) x.VoidCookie { body := encodeChangeCursor(source, destination) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ChangeCursorByName(conn *x.Conn, src x.Cursor, name string) { body := encodeChangeCursorByName(src, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeCursorByNameOpcode, }, Body: body, } conn.SendRequest(0, req) } func ChangeCursorByNameChecked(conn *x.Conn, src x.Cursor, name string) x.VoidCookie { body := encodeChangeCursorByName(src, name) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ChangeCursorByNameOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ExpandRegion(conn *x.Conn, source, destination Region, left, right, top, bottom uint16) { body := encodeExpandRegion(source, destination, left, right, top, bottom) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ExpandRegionOpcode, }, Body: body, } conn.SendRequest(0, req) } func ExpandRegionChecked(conn *x.Conn, source, destination Region, left, right, top, bottom uint16) x.VoidCookie { body := encodeExpandRegion(source, destination, left, right, top, bottom) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ExpandRegionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func HideCursor(conn *x.Conn, window x.Window) { body := encodeHideCursor(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: HideCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func HideCursorChecked(conn *x.Conn, window x.Window) x.VoidCookie { body := encodeHideCursor(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: HideCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func ShowCursor(conn *x.Conn, window x.Window) { body := encodeShowCursor(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ShowCursorOpcode, }, Body: body, } conn.SendRequest(0, req) } func ShowCursorChecked(conn *x.Conn, window x.Window) x.VoidCookie { body := encodeShowCursor(window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: ShowCursorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func CreatePointerBarrier(conn *x.Conn, barrier Barrier, drawable x.Drawable, x1, y1, x2, y2 int16, directions uint32, devices []uint16) { body := encodeCreatePointerBarrier(barrier, drawable, x1, y1, x2, y2, directions, devices) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePointerBarrierOpcode, }, Body: body, } conn.SendRequest(0, req) } func CreatePointerBarrierChecked(conn *x.Conn, barrier Barrier, drawable x.Drawable, x1, y1, x2, y2 int16, directions uint32, devices []uint16) x.VoidCookie { body := encodeCreatePointerBarrier(barrier, drawable, x1, y1, x2, y2, directions, devices) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: CreatePointerBarrierOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func DeletePointerBarrier(conn *x.Conn, barrier Barrier) { body := encodeDeletePointerBarrier(barrier) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeletePointerBarrierOpcode, }, Body: body, } conn.SendRequest(0, req) } func DeletePointerBarrierChecked(conn *x.Conn, barrier Barrier) x.VoidCookie { body := encodeDeletePointerBarrier(barrier) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: DeletePointerBarrierOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } go-x11-client-1.0.2/ext/xkb/000077500000000000000000000000001460713373000153725ustar00rootroot00000000000000go-x11-client-1.0.2/ext/xkb/auto.go000066400000000000000000000371131460713373000166760ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xkb import x "github.com/linuxdeepin/go-x11-client" // _ns.ext_name: xkb const MajorVersion = 1 const MinorVersion = 0 var _ext *x.Extension func Ext() *x.Extension { return _ext } // enum Const const ( ConstMaxLegalKeyCode = 255 ConstPerKeyBitArraySize = 32 ConstKeyNameLength = 4 ) // enum EventType const ( EventTypeNewKeyboardNotify = 1 EventTypeMapNotify = 2 EventTypeStateNotify = 4 EventTypeControlsNotify = 8 EventTypeIndicatorStateNotify = 16 EventTypeIndicatorMapNotify = 32 EventTypeNamesNotify = 64 EventTypeCompatMapNotify = 128 EventTypeBellNotify = 256 EventTypeActionMessage = 512 EventTypeAccessXNotify = 1024 EventTypeExtensionDeviceNotify = 2048 ) // enum NKNDetail const ( NKNDetailKeycodes = 1 NKNDetailGeometry = 2 NKNDetailDeviceId = 4 ) // enum AXNDetail const ( AXNDetailSkPress = 1 AXNDetailSkAccept = 2 AXNDetailSkReject = 4 AXNDetailSkRelease = 8 AXNDetailBkAccept = 16 AXNDetailBkReject = 32 AXNDetailAxkWarning = 64 ) // enum MapPart const ( MapPartKeyTypes = 1 MapPartKeySyms = 2 MapPartModifierMap = 4 MapPartExplicitComponents = 8 MapPartKeyActions = 16 MapPartKeyBehaviors = 32 MapPartVirtualMods = 64 MapPartVirtualModMap = 128 ) // enum SetMapFlags const ( SetMapFlagsResizeTypes = 1 SetMapFlagsRecomputeActions = 2 ) // enum StatePart const ( StatePartModifierState = 1 StatePartModifierBase = 2 StatePartModifierLatch = 4 StatePartModifierLock = 8 StatePartGroupState = 16 StatePartGroupBase = 32 StatePartGroupLatch = 64 StatePartGroupLock = 128 StatePartCompatState = 256 StatePartGrabMods = 512 StatePartCompatGrabMods = 1024 StatePartLookupMods = 2048 StatePartCompatLookupMods = 4096 StatePartPointerButtons = 8192 ) // enum BoolCtrl const ( BoolCtrlRepeatKeys = 1 BoolCtrlSlowKeys = 2 BoolCtrlBounceKeys = 4 BoolCtrlStickyKeys = 8 BoolCtrlMouseKeys = 16 BoolCtrlMouseKeysAccel = 32 BoolCtrlAccessXKeys = 64 BoolCtrlAccessXTimeoutMask = 128 BoolCtrlAccessXFeedbackMask = 256 BoolCtrlAudibleBellMask = 512 BoolCtrlOverlay1Mask = 1024 BoolCtrlOverlay2Mask = 2048 BoolCtrlIgnoreGroupLockMask = 4096 ) // enum Control const ( ControlGroupsWrap = 134217728 ControlInternalMods = 268435456 ControlIgnoreLockMods = 536870912 ControlPerKeyRepeat = 1073741824 ControlControlsEnabled = 2147483648 ) // enum AXOption const ( AXOptionSkPressFb = 1 AXOptionSkAcceptFb = 2 AXOptionFeatureFb = 4 AXOptionSlowWarnFb = 8 AXOptionIndicatorFb = 16 AXOptionStickyKeysFb = 32 AXOptionTwoKeys = 64 AXOptionLatchToLock = 128 AXOptionSkReleaseFb = 256 AXOptionSkRejectFb = 512 AXOptionBkRejectFb = 1024 AXOptionDumbBell = 2048 ) // simple ('xcb', 'xkb', 'DeviceSpec') type DeviceSpec uint16 // enum LedClassResult const ( LedClassResultKbdFeedbackClass = 0 LedClassResultLedFeedbackClass = 4 ) // enum LedClass const ( LedClassKbdFeedbackClass = 0 LedClassLedFeedbackClass = 4 LedClassDfltXiClass = 768 LedClassAllXiClasses = 1280 ) // simple ('xcb', 'xkb', 'LedClassSpec') type LedClassSpec uint16 // enum BellClassResult const ( BellClassResultKbdFeedbackClass = 0 BellClassResultBellFeedbackClass = 5 ) // enum BellClass const ( BellClassKbdFeedbackClass = 0 BellClassBellFeedbackClass = 5 BellClassDfltXiClass = 768 ) // simple ('xcb', 'xkb', 'BellClassSpec') type BellClassSpec uint16 // enum ID const ( IDUseCoreKbd = 256 IDUseCorePtr = 512 IDDfltXiClass = 768 IDDfltXiId = 1024 IDAllXiClass = 1280 IDAllXiId = 1536 IDXiNone = 65280 ) // simple ('xcb', 'xkb', 'IDSpec') type IdSpec uint16 // enum Group const ( Group1 = 0 Group2 = 1 Group3 = 2 Group4 = 3 ) // enum Groups const ( GroupsAny = 254 GroupsAll = 255 ) // enum SetOfGroup const ( SetOfGroupGroup1 = 1 SetOfGroupGroup2 = 2 SetOfGroupGroup3 = 4 SetOfGroupGroup4 = 8 ) // enum SetOfGroups const ( SetOfGroupsAny = 128 ) // enum GroupsWrap const ( GroupsWrapWrapIntoRange = 0 GroupsWrapClampIntoRange = 64 GroupsWrapRedirectIntoRange = 128 ) // enum VModsHigh const ( VModsHigh15 = 128 VModsHigh14 = 64 VModsHigh13 = 32 VModsHigh12 = 16 VModsHigh11 = 8 VModsHigh10 = 4 VModsHigh9 = 2 VModsHigh8 = 1 ) // enum VModsLow const ( VModsLow7 = 128 VModsLow6 = 64 VModsLow5 = 32 VModsLow4 = 16 VModsLow3 = 8 VModsLow2 = 4 VModsLow1 = 2 VModsLow0 = 1 ) // enum VMod const ( VMod15 = 32768 VMod14 = 16384 VMod13 = 8192 VMod12 = 4096 VMod11 = 2048 VMod10 = 1024 VMod9 = 512 VMod8 = 256 VMod7 = 128 VMod6 = 64 VMod5 = 32 VMod4 = 16 VMod3 = 8 VMod2 = 4 VMod1 = 2 VMod0 = 1 ) // enum Explicit const ( ExplicitVModMap = 128 ExplicitBehavior = 64 ExplicitAutoRepeat = 32 ExplicitInterpret = 16 ExplicitKeyType4 = 8 ExplicitKeyType3 = 4 ExplicitKeyType2 = 2 ExplicitKeyType1 = 1 ) // enum SymInterpretMatch const ( SymInterpretMatchNoneOf = 0 SymInterpretMatchAnyOfOrNone = 1 SymInterpretMatchAnyOf = 2 SymInterpretMatchAllOf = 3 SymInterpretMatchExactly = 4 ) // enum SymInterpMatch const ( SymInterpMatchLevelOneOnly = 128 SymInterpMatchOpMask = 127 ) // enum IMFlag const ( IMFlagNoExplicit = 128 IMFlagNoAutomatic = 64 IMFlagLedDrivesKb = 32 ) // enum IMModsWhich const ( IMModsWhichUseCompat = 16 IMModsWhichUseEffective = 8 IMModsWhichUseLocked = 4 IMModsWhichUseLatched = 2 IMModsWhichUseBase = 1 ) // enum IMGroupsWhich const ( IMGroupsWhichUseCompat = 16 IMGroupsWhichUseEffective = 8 IMGroupsWhichUseLocked = 4 IMGroupsWhichUseLatched = 2 IMGroupsWhichUseBase = 1 ) // enum CMDetail const ( CMDetailSymInterp = 1 CMDetailGroupCompat = 2 ) // enum NameDetail const ( NameDetailKeycodes = 1 NameDetailGeometry = 2 NameDetailSymbols = 4 NameDetailPhysSymbols = 8 NameDetailTypes = 16 NameDetailCompat = 32 NameDetailKeyTypeNames = 64 NameDetailKtLevelNames = 128 NameDetailIndicatorNames = 256 NameDetailKeyNames = 512 NameDetailKeyAliases = 1024 NameDetailVirtualModNames = 2048 NameDetailGroupNames = 4096 NameDetailRgNames = 8192 ) // enum GBNDetail const ( GBNDetailTypes = 1 GBNDetailCompatMap = 2 GBNDetailClientSymbols = 4 GBNDetailServerSymbols = 8 GBNDetailIndicatorMaps = 16 GBNDetailKeyNames = 32 GBNDetailGeometry = 64 GBNDetailOtherNames = 128 ) // enum XIFeature const ( XIFeatureKeyboards = 1 XIFeatureButtonActions = 2 XIFeatureIndicatorNames = 4 XIFeatureIndicatorMaps = 8 XIFeatureIndicatorState = 16 ) // enum PerClientFlag const ( PerClientFlagDetectableAutoRepeat = 1 PerClientFlagGrabsUseXkbState = 2 PerClientFlagAutoResetControls = 4 PerClientFlagLookupStateWhenGrabbed = 8 PerClientFlagSendEventUsesXkbState = 16 ) // enum BehaviorType const ( BehaviorTypeDefault = 0 BehaviorTypeLock = 1 BehaviorTypeRadioGroup = 2 BehaviorTypeOverlay1 = 3 BehaviorTypeOverlay2 = 4 BehaviorTypePermamentLock = 129 BehaviorTypePermamentRadioGroup = 130 BehaviorTypePermamentOverlay1 = 131 BehaviorTypePermamentOverlay2 = 132 ) // simple ('xcb', 'xkb', 'STRING8') type String8 byte // enum DoodadType const ( DoodadTypeOutline = 1 DoodadTypeSolid = 2 DoodadTypeText = 3 DoodadTypeIndicator = 4 DoodadTypeLogo = 5 ) // enum Error const ( ErrorBadDevice = 255 ErrorBadClass = 254 ErrorBadId = 253 ) const KeyboardErrorCode = 0 // enum SA const ( SAClearLocks = 1 SALatchToLock = 2 SAUseModMapMods = 4 SAGroupAbsolute = 4 ) // enum SAType const ( SATypeNoAction = 0 SATypeSetMods = 1 SATypeLatchMods = 2 SATypeLockMods = 3 SATypeSetGroup = 4 SATypeLatchGroup = 5 SATypeLockGroup = 6 SATypeMovePtr = 7 SATypePtrBtn = 8 SATypeLockPtrBtn = 9 SATypeSetPtrDflt = 10 SATypeIsoLock = 11 SATypeTerminate = 12 SATypeSwitchScreen = 13 SATypeSetControls = 14 SATypeLockControls = 15 SATypeActionMessage = 16 SATypeRedirectKey = 17 SATypeDeviceBtn = 18 SATypeLockDeviceBtn = 19 SATypeDeviceValuator = 20 ) // enum SAMovePtrFlag const ( SAMovePtrFlagNoAcceleration = 1 SAMovePtrFlagMoveAbsoluteX = 2 SAMovePtrFlagMoveAbsoluteY = 4 ) // enum SASetPtrDfltFlag const ( SASetPtrDfltFlagDfltBtnAbsolute = 4 SASetPtrDfltFlagAffectDfltButton = 1 ) // enum SAIsoLockFlag const ( SAIsoLockFlagNoLock = 1 SAIsoLockFlagNoUnlock = 2 SAIsoLockFlagUseModMapMods = 4 SAIsoLockFlagGroupAbsolute = 4 SAIsoLockFlagIsoDfltIsGroup = 8 ) // enum SAIsoLockNoAffect const ( SAIsoLockNoAffectCtrls = 8 SAIsoLockNoAffectPtr = 16 SAIsoLockNoAffectGroup = 32 SAIsoLockNoAffectMods = 64 ) // enum SwitchScreenFlag const ( SwitchScreenFlagApplication = 1 SwitchScreenFlagAbsolute = 4 ) // enum BoolCtrlsHigh const ( BoolCtrlsHighAccessXFeedback = 1 BoolCtrlsHighAudibleBell = 2 BoolCtrlsHighOverlay1 = 4 BoolCtrlsHighOverlay2 = 8 BoolCtrlsHighIgnoreGroupLock = 16 ) // enum BoolCtrlsLow const ( BoolCtrlsLowRepeatKeys = 1 BoolCtrlsLowSlowKeys = 2 BoolCtrlsLowBounceKeys = 4 BoolCtrlsLowStickyKeys = 8 BoolCtrlsLowMouseKeys = 16 BoolCtrlsLowMouseKeysAccel = 32 BoolCtrlsLowAccessXKeys = 64 BoolCtrlsLowAccessXTimeout = 128 ) // enum ActionMessageFlag const ( ActionMessageFlagOnPress = 1 ActionMessageFlagOnRelease = 2 ActionMessageFlagGenKeyEvent = 4 ) // enum LockDeviceFlags const ( LockDeviceFlagsNoLock = 1 LockDeviceFlagsNoUnlock = 2 ) // enum SAValWhat const ( SAValWhatIgnoreVal = 0 SAValWhatSetValMin = 1 SAValWhatSetValCenter = 2 SAValWhatSetValMax = 3 SAValWhatSetValRelative = 4 SAValWhatSetValAbsolute = 5 ) const UseExtensionOpcode = 0 type UseExtensionCookie x.SeqNum const SelectEventsOpcode = 1 const BellOpcode = 3 const GetStateOpcode = 4 type GetStateCookie x.SeqNum const LatchLockStateOpcode = 5 const GetControlsOpcode = 6 type GetControlsCookie x.SeqNum const SetControlsOpcode = 7 const GetMapOpcode = 8 type GetMapCookie x.SeqNum const SetMapOpcode = 9 const GetCompatMapOpcode = 10 type GetCompatMapCookie x.SeqNum const SetCompatMapOpcode = 11 const GetIndicatorStateOpcode = 12 type GetIndicatorStateCookie x.SeqNum const GetIndicatorMapOpcode = 13 type GetIndicatorMapCookie x.SeqNum const SetIndicatorMapOpcode = 14 const GetNamedIndicatorOpcode = 15 type GetNamedIndicatorCookie x.SeqNum const SetNamedIndicatorOpcode = 16 const GetNamesOpcode = 17 type GetNamesCookie x.SeqNum const SetNamesOpcode = 18 const PerClientFlagsOpcode = 21 type PerClientFlagsCookie x.SeqNum const ListComponentsOpcode = 22 type ListComponentsCookie x.SeqNum const GetKbdByNameOpcode = 23 type GetKbdByNameCookie x.SeqNum const GetDeviceInfoOpcode = 24 type GetDeviceInfoCookie x.SeqNum const SetDeviceInfoOpcode = 25 const SetDebuggingFlagsOpcode = 101 type SetDebuggingFlagsCookie x.SeqNum const NewKeyboardNotifyEventCode = 0 func NewNewKeyboardNotifyEvent(data []byte) (*NewKeyboardNotifyEvent, error) { var ev NewKeyboardNotifyEvent r := x.NewReaderFromData(data) err := readNewKeyboardNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const MapNotifyEventCode = 1 func NewMapNotifyEvent(data []byte) (*MapNotifyEvent, error) { var ev MapNotifyEvent r := x.NewReaderFromData(data) err := readMapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const StateNotifyEventCode = 2 func NewStateNotifyEvent(data []byte) (*StateNotifyEvent, error) { var ev StateNotifyEvent r := x.NewReaderFromData(data) err := readStateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ControlsNotifyEventCode = 3 func NewControlsNotifyEvent(data []byte) (*ControlsNotifyEvent, error) { var ev ControlsNotifyEvent r := x.NewReaderFromData(data) err := readControlsNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const IndicatorStateNotifyEventCode = 4 func NewIndicatorStateNotifyEvent(data []byte) (*IndicatorStateNotifyEvent, error) { var ev IndicatorStateNotifyEvent r := x.NewReaderFromData(data) err := readIndicatorStateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const IndicatorMapNotifyEventCode = 5 func NewIndicatorMapNotifyEvent(data []byte) (*IndicatorMapNotifyEvent, error) { var ev IndicatorMapNotifyEvent r := x.NewReaderFromData(data) err := readIndicatorMapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const NamesNotifyEventCode = 6 func NewNamesNotifyEvent(data []byte) (*NamesNotifyEvent, error) { var ev NamesNotifyEvent r := x.NewReaderFromData(data) err := readNamesNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const CompatMapNotifyEventCode = 7 func NewCompatMapNotifyEvent(data []byte) (*CompatMapNotifyEvent, error) { var ev CompatMapNotifyEvent r := x.NewReaderFromData(data) err := readCompatMapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const BellNotifyEventCode = 8 func NewBellNotifyEvent(data []byte) (*BellNotifyEvent, error) { var ev BellNotifyEvent r := x.NewReaderFromData(data) err := readBellNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ActionMessageEventCode = 9 func NewActionMessageEvent(data []byte) (*ActionMessageEvent, error) { var ev ActionMessageEvent r := x.NewReaderFromData(data) err := readActionMessageEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const AccessXNotifyEventCode = 10 func NewAccessXNotifyEvent(data []byte) (*AccessXNotifyEvent, error) { var ev AccessXNotifyEvent r := x.NewReaderFromData(data) err := readAccessXNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ExtensionDeviceNotifyEventCode = 11 func NewExtensionDeviceNotifyEvent(data []byte) (*ExtensionDeviceNotifyEvent, error) { var ev ExtensionDeviceNotifyEvent r := x.NewReaderFromData(data) err := readExtensionDeviceNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } var errorCodeNameMap = map[uint8]string{ KeyboardErrorCode: "BadKeyboard", } var requestOpcodeNameMap = map[uint]string{ UseExtensionOpcode: "UseExtension", SelectEventsOpcode: "SelectEvents", BellOpcode: "Bell", GetStateOpcode: "GetState", LatchLockStateOpcode: "LatchLockState", GetControlsOpcode: "GetControls", SetControlsOpcode: "SetControls", GetMapOpcode: "GetMap", SetMapOpcode: "SetMap", GetCompatMapOpcode: "GetCompatMap", SetCompatMapOpcode: "SetCompatMap", GetIndicatorStateOpcode: "GetIndicatorState", GetIndicatorMapOpcode: "GetIndicatorMap", SetIndicatorMapOpcode: "SetIndicatorMap", GetNamedIndicatorOpcode: "GetNamedIndicator", SetNamedIndicatorOpcode: "SetNamedIndicator", GetNamesOpcode: "GetNames", SetNamesOpcode: "SetNames", PerClientFlagsOpcode: "PerClientFlags", ListComponentsOpcode: "ListComponents", GetKbdByNameOpcode: "GetKbdByName", GetDeviceInfoOpcode: "GetDeviceInfo", SetDeviceInfoOpcode: "SetDeviceInfo", SetDebuggingFlagsOpcode: "SetDebuggingFlags", } func init() { _ext = x.NewExtension("XKEYBOARD", 0, errorCodeNameMap, requestOpcodeNameMap) } go-x11-client-1.0.2/ext/xkb/xkb.go000066400000000000000000001723531460713373000165200ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xkb import ( "bytes" "math" "sort" "github.com/linuxdeepin/go-x11-client" ) // #WREQ func encodeUseExtension(wantedMajor, wantedMinor uint16) (b x.RequestBody) { b.AddBlock(1). Write2b(wantedMajor). Write2b(wantedMinor). End() return } type UseExtensionReply struct { Supported bool ServerMajor uint16 ServerMinor uint16 } func readUseExtensionReply(r *x.Reader, v *UseExtensionReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } supported, _ := r.ReadReplyHeader() v.Supported = x.Uint8ToBool(supported) v.ServerMajor = r.Read2b() v.ServerMinor = r.Read2b() // 3 return nil } // #WREQ vararg:options func encodeSelectEvents(deviceSpec DeviceSpec, options ...SelectOption) (b x.RequestBody) { var affectWhich, clear, selectAll, affectMap, mapDetail uint16 w := x.NewWriter() sort.Sort(selectOptions(options)) for _, option := range options { affectWhich |= option.affectEvent() switch o := option.(type) { case selectOptionAll: selectAll |= o.eventType case selectOptionClear: clear |= o.eventType case selectOptionDetail: affect, detail := o.getAffectDetail() switch o.eventType { case EventTypeNewKeyboardNotify, EventTypeStateNotify, EventTypeNamesNotify, EventTypeAccessXNotify, EventTypeExtensionDeviceNotify: w.Write2b(uint16(affect)) w.Write2b(uint16(detail)) case EventTypeControlsNotify, EventTypeIndicatorStateNotify, EventTypeIndicatorMapNotify: w.Write4b(uint32(affect)) w.Write4b(uint32(detail)) case EventTypeCompatMapNotify, EventTypeBellNotify, EventTypeActionMessage: w.Write1b(uint8(affect)) w.Write1b(uint8(detail)) case EventTypeMapNotify: affectMap = uint16(affect) mapDetail = uint16(detail) } } } b.AddBlock(3). Write2b(uint16(deviceSpec)). Write2b(affectWhich). Write2b(clear). Write2b(selectAll). Write2b(affectMap). Write2b(mapDetail).End() b.AddBytes(w.Bytes()) return } type selectOptions []SelectOption func (v selectOptions) Len() int { return len(v) } func (v selectOptions) Less(i, j int) bool { return v[i].affectEvent() < v[j].affectEvent() } func (v selectOptions) Swap(i, j int) { v[i], v[j] = v[j], v[i] } type SelectOption interface { affectEvent() uint16 } type selectOptionClear struct { eventType uint16 } func (v selectOptionClear) affectEvent() uint16 { return v.eventType } type selectOptionAll struct { eventType uint16 } func (v selectOptionAll) affectEvent() uint16 { return v.eventType } type selectOptionDetail struct { eventType uint16 detail map[uint]bool } func (v selectOptionDetail) affectEvent() uint16 { return v.eventType } func (v selectOptionDetail) getAffectDetail() (affect, detail uint) { for key, value := range v.detail { affect |= key if value { detail |= key } } return } func SelectAll(eventType uint16) SelectOption { return selectOptionAll{eventType} } func SelectDetail(eventType uint16, detail map[uint]bool) SelectOption { return selectOptionDetail{eventType: eventType, detail: detail} } func SelectClear(eventType uint16) SelectOption { return selectOptionClear{eventType} } // #WREQ func encodeBell(deviceSpec DeviceSpec, bellClass BellClassSpec, bellID IdSpec, percent int8, forceSound, eventOnly bool, pitch, duration int16, name x.Atom, window x.Window) (b x.RequestBody) { b.AddBlock(6). Write2b(uint16(deviceSpec)). Write2b(uint16(bellClass)). // 1 Write2b(uint16(bellID)). Write1b(uint8(percent)). WriteBool(forceSound). // 2 WriteBool(eventOnly). WritePad(1). Write2b(uint16(pitch)). // 3 Write2b(uint16(duration)). WritePad(2). // 4 Write4b(uint32(name)). Write4b(uint32(window)). End() return } // #WREQ func encodeGetState(deviceSpec DeviceSpec) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceSpec)). WritePad(2). End() return } type GetStateReply struct { DeviceID uint8 Mods uint8 BaseMods uint8 LatchedMods uint8 LockedMods uint8 Group uint8 LockedGroup uint8 BaseGroup int16 LatchedGroup int16 CompatState uint8 GrabMods uint8 CompatGrabMods uint8 LookupMods uint8 CompatLookupMods uint8 PtrBtnState uint16 } func readGetStateReply(r *x.Reader, v *GetStateReply) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Mods = r.Read1b() v.BaseMods = r.Read1b() v.LatchedMods = r.Read1b() v.LockedMods = r.Read1b() // 3 v.Group = r.Read1b() v.LockedGroup = r.Read1b() v.BaseGroup = int16(r.Read2b()) v.LatchedGroup = int16(r.Read2b()) v.CompatState = r.Read1b() v.GrabMods = r.Read1b() // 5 v.CompatGrabMods = r.Read1b() v.LookupMods = r.Read1b() v.CompatLookupMods = r.Read1b() r.ReadPad(1) // 6 v.PtrBtnState = r.Read2b() // 7 return nil } // #WREQ func encodeLatchLockState(deviceSpec DeviceSpec, affectModLocks, modLocks uint8, lockGroup bool, groupLock, affectModLatches, modLatches uint8, latchGroup bool, groupLatch uint16) (b x.RequestBody) { b.AddBlock(3). Write2b(uint16(deviceSpec)). Write1b(affectModLocks). Write1b(modLocks). // 1 WriteBool(lockGroup). Write1b(groupLock). Write1b(affectModLatches). Write1b(modLatches). // 2 WritePad(1). WriteBool(latchGroup). Write2b(groupLatch). // 3 End() return } // #WREQ func encodeGetControls(deviceSpec DeviceSpec) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceSpec)). WritePad(2). End() return } type GetControlsReply struct { DeviceID uint8 Controls } func readGetControlsReply(r *x.Reader, v *GetControlsReply) error { if !r.RemainAtLeast4b(15) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.MouseKeysDefaultBtn = r.Read1b() v.NumGroups = r.Read1b() v.GroupsWrap = r.Read1b() v.Internal.Mask = r.Read1b() // 3 v.IgnoreLock.Mask = r.Read1b() v.Internal.RealMods = r.Read1b() v.IgnoreLock.RealMods = r.Read1b() r.ReadPad(1) // 4 v.Internal.VirtualMods = r.Read2b() v.IgnoreLock.VirtualMods = r.Read2b() // 5 v.RepeatDelay = r.Read2b() v.RepeatInterval = r.Read2b() v.SlowKeysDelay = r.Read2b() v.DebounceDelay = r.Read2b() v.MouseKeysDelay = r.Read2b() v.MouseKeysInterval = r.Read2b() // 8 v.MouseKeysTimeToMax = r.Read2b() v.MouseKeysMaxSpeed = r.Read2b() v.MouseKeysCurve = int16(r.Read2b()) v.AccessXOption = r.Read2b() // 10 v.AccessXTimeout = r.Read2b() v.AccessXTimeoutOptionsMask = r.Read2b() v.AccessXTimeoutOptionsValues = r.Read2b() r.ReadPad(2) // 12 v.AccessXTimeoutMask = r.Read4b() v.AccessXTimeoutValues = r.Read4b() v.EnabledControls = r.Read4b() // 15 var err error v.PerKeyRepeat, err = r.ReadBytes(ConstPerKeyBitArraySize) return err } // size: 1 * 4b type ModDef struct { // RealMods | VirtualMods mapped to real modifiers Mask uint8 // real modifier bits RealMods uint8 // virtual modifier bits VirtualMods uint16 } func readModDef(r *x.Reader) (v ModDef) { v.Mask = r.Read1b() v.RealMods = r.Read1b() v.VirtualMods = r.Read2b() return v } func writeModDef(b *x.FixedSizeBuf, v ModDef) { b.Write1b(v.Mask). Write1b(v.RealMods). Write2b(v.VirtualMods) } type Controls struct { MouseKeysDefaultBtn uint8 NumGroups uint8 GroupsWrap uint8 Internal ModDef IgnoreLock ModDef EnabledControls uint32 RepeatDelay uint16 RepeatInterval uint16 SlowKeysDelay uint16 DebounceDelay uint16 MouseKeysDelay uint16 MouseKeysInterval uint16 MouseKeysTimeToMax uint16 MouseKeysMaxSpeed uint16 MouseKeysCurve int16 AccessXOption uint16 AccessXTimeout uint16 AccessXTimeoutOptionsMask uint16 AccessXTimeoutOptionsValues uint16 AccessXTimeoutMask uint32 AccessXTimeoutValues uint32 PerKeyRepeat []byte // len 32 } // #WREQ func encodeSetControls(deviceSpec DeviceSpec, affectInternalRealMods, affectIgnoreLockRealMods uint8, affectInternalVirtualMods, affectIgnoreLockVirtualMods uint16, affectEnabledControls, changeControls uint32, c *Controls) (b x.RequestBody) { b.AddBlock(16). Write2b(uint16(deviceSpec)). Write1b(affectInternalRealMods). Write1b(c.Internal.RealMods). // 1 Write1b(affectIgnoreLockRealMods). Write1b(c.IgnoreLock.RealMods). Write2b(affectInternalVirtualMods). // 2 Write2b(c.Internal.VirtualMods). Write2b(affectIgnoreLockVirtualMods). // 3 Write2b(c.IgnoreLock.VirtualMods). Write1b(c.MouseKeysDefaultBtn). Write1b(c.GroupsWrap). // 4 Write2b(c.AccessXOption). WritePad(2). // 5 Write4b(affectEnabledControls). Write4b(c.EnabledControls). Write4b(changeControls). // 8 Write2b(c.RepeatDelay). Write2b(c.RepeatInterval). // 9 Write2b(c.SlowKeysDelay). Write2b(c.DebounceDelay). Write2b(c.MouseKeysDelay). Write2b(c.MouseKeysInterval). Write2b(c.MouseKeysTimeToMax). Write2b(c.MouseKeysMaxSpeed). Write2b(uint16(c.MouseKeysCurve)). Write2b(c.AccessXTimeout). // 13 Write4b(c.AccessXTimeoutMask). Write4b(c.AccessXTimeoutValues). Write2b(c.AccessXTimeoutOptionsMask). Write2b(c.AccessXTimeoutOptionsValues). // 16 End() b.AddBytes(c.PerKeyRepeat) return } type GetMapPartOptions struct { Partial uint16 FirstType uint8 NTypes uint8 FirstKeySym x.Keycode NKeySyms uint8 FirstKeyAction x.Keycode NKeyActions uint8 FirstKeyBehavior x.Keycode NKeyBehavior uint8 VirtualMods uint16 FirstKeyExplicit x.Keycode NKeyExplicit uint8 FirstModMapKey x.Keycode NModMapKeys uint8 FirstVModMapKey x.Keycode NVModMapKeys uint8 } // #WREQ func encodeGetMap(deviceSpec DeviceSpec, full uint16, opt *GetMapPartOptions) (b x.RequestBody) { if opt == nil { opt = &GetMapPartOptions{} } else { if opt.NTypes != 0 || opt.FirstType != 0 { opt.Partial |= MapPartKeyTypes } if opt.NKeySyms != 0 || opt.FirstKeySym != 0 { opt.Partial |= MapPartKeySyms } if opt.NKeyActions != 0 || opt.FirstKeyAction != 0 { opt.Partial |= MapPartKeyActions } if opt.NKeyBehavior != 0 || opt.FirstKeyBehavior != 0 { opt.Partial |= MapPartKeyBehaviors } if opt.NKeyExplicit != 0 || opt.FirstKeyExplicit != 0 { opt.Partial |= MapPartExplicitComponents } if opt.NModMapKeys != 0 || opt.FirstModMapKey != 0 { opt.Partial |= MapPartModifierMap } if opt.NVModMapKeys != 0 || opt.FirstVModMapKey != 0 { opt.Partial |= MapPartVirtualModMap } if opt.VirtualMods != 0 { opt.Partial |= MapPartVirtualMods } } b.AddBlock(6). Write2b(uint16(deviceSpec)). Write2b(full). Write2b(opt.Partial). Write1b(opt.FirstType). Write1b(opt.NTypes). // 2 Write1b(uint8(opt.FirstKeySym)). Write1b(opt.NKeySyms). Write1b(uint8(opt.FirstKeyAction)). Write1b(opt.NKeyActions). Write1b(uint8(opt.FirstKeyBehavior)). Write1b(opt.NKeyBehavior). Write2b(opt.VirtualMods). // 4 Write1b(uint8(opt.FirstKeyExplicit)). Write1b(opt.NKeyExplicit). Write1b(uint8(opt.FirstModMapKey)). Write1b(opt.NVModMapKeys). Write1b(uint8(opt.FirstVModMapKey)). Write1b(opt.NVModMapKeys). WritePad(2). // 6 End() return } type GetMapReply struct { DeviceID uint8 MinKeyCode x.Keycode MaxKeyCode x.Keycode Present uint16 FirstType uint8 NTypes uint8 TotalTypes uint8 FirstKeySym x.Keycode TotalSyms uint16 NKeySyms uint8 FirstKeyAction x.Keycode TotalActions uint16 NKeyActions uint8 FirstKeyBehavior x.Keycode NKeyBehaviors uint8 TotalKeyBehaviors uint8 FirstKeyExplicit x.Keycode NKeyExplicit uint8 TotalKeyExplicit uint8 FirstModMapKey x.Keycode NModMapKeys uint8 TotalModMapKeys uint8 FirstVModMapKey x.Keycode NVModMapKeys uint8 TotalVModMapKeys uint8 VirtualMods uint16 Types []KeyType Syms []KeySymMap ActionsCount []uint8 Actions []Action Behaviors []SetBehavior VMods []uint8 Explicit []SetExplicit ModMap []KeyModMap VModMap []KeyVModMap } type KeyType struct { ModsMask uint8 ModsMods uint8 ModsVMods uint16 NumLevels uint8 NMapEntries uint8 HasPreserve bool Map []KTMapEntry Preserve []ModDef } type SetKeyType struct { Mask uint8 RealMods uint8 VirtualMods uint16 NumLevels uint8 NMapEntries uint8 Preserve bool Entries []KTSetMapEntry PreserveEntries []KTSetMapEntry } func writeSetKeyType(w *x.FixedSizeBuf, v *SetKeyType) { w.Write1b(v.Mask). Write1b(v.RealMods). Write2b(v.VirtualMods). Write1b(v.NumLevels). Write1b(v.NMapEntries). WriteBool(v.Preserve). WritePad(1) // 2 for i := 0; i < int(v.NMapEntries); i++ { writeKTSetMapEntry(w, v.Entries[i]) // v.NMapEntries } if v.Preserve { for i := 0; i < int(v.NMapEntries); i++ { writeKTSetMapEntry(w, v.PreserveEntries[i]) } } } func (v *SetKeyType) sizeIn4b() int { n := 4 + int(v.NMapEntries) if v.Preserve { n += int(v.NMapEntries) } return n } func readKeyType(r *x.Reader, v *KeyType) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } v.ModsMask = r.Read1b() v.ModsMods = r.Read1b() v.ModsVMods = r.Read2b() v.NumLevels = r.Read1b() v.NMapEntries = r.Read1b() v.HasPreserve = r.ReadBool() r.ReadPad(1) // 2 if v.NMapEntries > 0 { if !r.RemainAtLeast4b(3 * int(v.NMapEntries)) { return x.ErrDataLenShort } v.Map = make([]KTMapEntry, v.NMapEntries) for i := 0; i < int(v.NMapEntries); i++ { readKTMapEntry(r, &v.Map[i]) } if v.HasPreserve { v.Preserve = make([]ModDef, v.NMapEntries) for i := 0; i < int(v.NMapEntries); i++ { v.Preserve[i] = readModDef(r) } } } return nil } // size: 1 * 4b type KTSetMapEntry struct { Level uint8 RealMods uint8 VirtualMods uint16 } func writeKTSetMapEntry(w *x.FixedSizeBuf, v KTSetMapEntry) { w.Write1b(v.Level). Write1b(v.RealMods). Write2b(v.VirtualMods) } // key type map entry, size: 2 * 4b type KTMapEntry struct { Active bool ModsMask uint8 Level uint8 ModsMods uint8 ModsVMods uint16 } func readKTMapEntry(r *x.Reader, v *KTMapEntry) { v.Active = r.ReadBool() v.ModsMask = r.Read1b() v.Level = r.Read1b() v.ModsMods = r.Read1b() v.ModsVMods = r.Read2b() r.ReadPad(2) // 2 } type KeySymMap struct { KtIndex []uint8 // length 4 GroupInfo uint8 Width uint8 NSyms uint16 Syms []x.Keysym } func readKeySymMap(r *x.Reader, v *KeySymMap) error { if !r.RemainAtLeast4b(2) { return x.ErrDataLenShort } v.KtIndex = r.MustReadBytes(4) v.GroupInfo = r.Read1b() v.Width = r.Read1b() v.NSyms = r.Read2b() // 2 if v.NSyms > 0 { if !r.RemainAtLeast4b(int(v.NSyms)) { return x.ErrDataLenShort } v.Syms = make([]x.Keysym, v.NSyms) for i := 0; i < int(v.NSyms); i++ { v.Syms[i] = x.Keysym(r.Read4b()) } } return nil } func writeKeySymMap(b *x.FixedSizeBuf, v *KeySymMap) { b.WriteBytes(v.KtIndex). Write1b(v.GroupInfo). Write1b(v.Width). Write2b(v.NSyms) for _, sym := range v.Syms { b.Write4b(uint32(sym)) } } func (v *KeySymMap) sizeIn4b() int { return 2 + len(v.Syms) } // size: 2 * 4b type Action interface { Type() uint8 // TODO: rename ActionType writeTo(b *x.FixedSizeBuf) } var readActionFuncArray = [...]func(r *x.Reader) Action{ readSANoAction, // 0 readSASetMods, readSALatchMods, readSALockMods, readSASetGroup, readSALatchGroup, readSALockGroup, // 6 readSAMovePtr, readSAPtrBtn, readSALockPtrBtn, readSASetPtrDflt, // 10 readSAIsoLock, readSATerminate, readSASwitchScreen, readSASetControls, readSALockControls, // 15 readSAActionMessage, readSARedirectKey, readSADeviceBtn, readSALockDeviceBtn, readSADeviceValuator, // 20 } func readAction(r *x.Reader) Action { type0 := r.Read1b() data := r.MustReadBytes(7) // 2 dataR := x.NewReaderFromData(data) if type0 <= SATypeDeviceValuator { action := readActionFuncArray[type0](dataR) return action } // out of range return UnknownAction{type0: type0, data: data} } func writeAction(b *x.FixedSizeBuf, act Action) { b.Write1b(act.Type()) act.writeTo(b) } // Action NoAction type SANoAction struct { } func (SANoAction) Type() uint8 { return SATypeNoAction } func (SANoAction) writeTo(b *x.FixedSizeBuf) { b.WritePad(7) } func readSANoAction(r *x.Reader) Action { return SANoAction{} } // Action SetMods type SASetMods struct { Flags uint8 Mask uint8 RealMods uint8 VMods uint16 } func (SASetMods) Type() uint8 { return SATypeSetMods } func readSASetMods(r *x.Reader) Action { var v SASetMods readSASetModsAux(r, &v) return v } func readSASetModsAux(r *x.Reader, v *SASetMods) { v.Flags = r.Read1b() v.Mask = r.Read1b() v.RealMods = r.Read1b() vModsHigh := r.Read1b() vModsLow := r.Read1b() v.VMods = uint16(vModsHigh)<<8 | uint16(vModsLow) } func (v SASetMods) writeTo(b *x.FixedSizeBuf) { vmodsHigh := uint8(v.VMods >> 8) vmodsLow := uint8(v.VMods) b.Write1b(v.Flags). Write1b(v.Mask). Write1b(v.RealMods). Write1b(vmodsHigh). Write1b(vmodsLow). // 5b WritePad(2) } // Action LatchMods type SALatchMods SASetMods func (SALatchMods) Type() uint8 { return SATypeLatchMods } func readSALatchMods(r *x.Reader) Action { var v SALatchMods readSASetModsAux(r, (*SASetMods)(&v)) return v } func (v SALatchMods) writeTo(b *x.FixedSizeBuf) { SASetMods(v).writeTo(b) } // Action LockMods type SALockMods SASetMods func (SALockMods) Type() uint8 { return SATypeLockMods } func readSALockMods(r *x.Reader) Action { var v SALockMods readSASetModsAux(r, (*SASetMods)(&v)) return v } func (v SALockMods) writeTo(b *x.FixedSizeBuf) { SASetMods(v).writeTo(b) } // Action SetGroup type SASetGroup struct { Flags uint8 Group int8 } func (SASetGroup) Type() uint8 { return SATypeSetGroup } func readSASetGroup(r *x.Reader) Action { var v SASetGroup readSASetGroupAux(r, &v) return v } func readSASetGroupAux(r *x.Reader, v *SASetGroup) { v.Flags = r.Read1b() v.Group = int8(r.Read1b()) } func (v SASetGroup) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(uint8(v.Group)). WritePad(5) } // Action LatchGroup type SALatchGroup SASetGroup func (SALatchGroup) Type() uint8 { return SATypeLatchGroup } func readSALatchGroup(r *x.Reader) Action { var v SALatchGroup readSASetGroupAux(r, (*SASetGroup)(&v)) return v } func (v SALatchGroup) writeTo(b *x.FixedSizeBuf) { SASetGroup(v).writeTo(b) } // Action LockGroup type SALockGroup SASetGroup func (SALockGroup) Type() uint8 { return SATypeLockGroup } func readSALockGroup(r *x.Reader) Action { var v SALockGroup readSASetGroupAux(r, (*SASetGroup)(&v)) return v } func (v SALockGroup) writeTo(b *x.FixedSizeBuf) { SASetGroup(v).writeTo(b) } // Action MovePtr type SAMovePtr struct { Flags uint8 X int16 Y int16 } func (SAMovePtr) Type() uint8 { return SATypeMovePtr } func readSAMovePtr(r *x.Reader) Action { var v SAMovePtr v.Flags = r.Read1b() xHigh := int8(r.Read1b()) xLow := r.Read1b() v.X = int16(xHigh)<<8 | int16(xLow) yHigh := int8(r.Read1b()) yLow := r.Read1b() v.Y = int16(yHigh)<<8 | int16(yLow) return v } func (v SAMovePtr) writeTo(b *x.FixedSizeBuf) { xHigh := int8(v.X >> 8) xLow := uint8(v.X) yHigh := int8(v.Y >> 8) yLow := uint8(v.Y) b.Write1b(v.Flags). Write1b(uint8(xHigh)). Write1b(xLow). Write1b(uint8(yHigh)). Write1b(yLow). // 5 WritePad(2) } // Action PtrBtn type SAPtrBtn struct { Flags uint8 Count uint8 Button uint8 } func (SAPtrBtn) Type() uint8 { return SATypePtrBtn } func readSAPtrBtn(r *x.Reader) Action { var v SAPtrBtn v.Flags = r.Read1b() v.Count = r.Read1b() v.Button = r.Read1b() return v } func (v SAPtrBtn) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(v.Count). Write1b(v.Button). WritePad(4) } // Action LockPtrBtn type SALockPtrBtn struct { Flags uint8 Button uint8 } func (SALockPtrBtn) Type() uint8 { return SATypeLockPtrBtn } func readSALockPtrBtn(r *x.Reader) Action { var v SALockPtrBtn v.Flags = r.Read1b() r.ReadPad(1) v.Button = r.Read1b() return v } func (v SALockPtrBtn) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(v.Button). WritePad(5) } // Action SetPtrDflt type SASetPtrDflt struct { Flags uint8 Affect uint8 Value int8 } func (SASetPtrDflt) Type() uint8 { return SATypeSetPtrDflt } func readSASetPtrDflt(r *x.Reader) Action { var v SASetPtrDflt v.Flags = r.Read1b() v.Affect = r.Read1b() v.Value = int8(r.Read1b()) return v } func (v SASetPtrDflt) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(v.Affect). Write1b(uint8(v.Value)). WritePad(4) } // Action Iso Lock type SAIsoLock struct { Flags uint8 Mask uint8 RealMods uint8 Group int8 Affect uint8 VMods uint16 } func (SAIsoLock) Type() uint8 { return SATypeIsoLock } func readSAIsoLock(r *x.Reader) Action { var v SAIsoLock v.Flags = r.Read1b() v.Mask = r.Read1b() v.RealMods = r.Read1b() v.Group = int8(r.Read1b()) v.Affect = r.Read1b() vModsHigh := r.Read1b() vModsLow := r.Read1b() v.VMods = uint16(vModsHigh)<<8 | uint16(vModsLow) return v } func (v SAIsoLock) writeTo(b *x.FixedSizeBuf) { vModsHigh := uint8(v.VMods >> 8) vModsLow := uint8(v.VMods) b.Write1b(v.Flags). Write1b(v.Mask). Write1b(v.RealMods). Write1b(uint8(v.Group)). Write1b(v.Affect). Write1b(vModsHigh). Write1b(vModsLow) // 7b } // Action Terminate type SATerminate struct { } func (SATerminate) Type() uint8 { return SATypeTerminate } func readSATerminate(r *x.Reader) Action { return SATerminate{} } func (SATerminate) writeTo(b *x.FixedSizeBuf) { b.WritePad(7) } // Action Switch Screen type SASwitchScreen struct { Flags uint8 NewScreen int8 } func (SASwitchScreen) Type() uint8 { return SATypeSwitchScreen } func readSASwitchScreen(r *x.Reader) Action { var v SASwitchScreen v.Flags = r.Read1b() v.NewScreen = int8(r.Read1b()) return v } func (v SASwitchScreen) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(uint8(v.NewScreen)). WritePad(5) } // Action SetControls type SASetControls struct { BoolCtrls uint16 } func (SASetControls) Type() uint8 { return SATypeSetControls } func readSASetControls(r *x.Reader) Action { var v SASetControls readSASetControlsAux(r, &v) return v } func readSASetControlsAux(r *x.Reader, v *SASetControls) { r.ReadPad(3) boolCtrlsHigh := r.Read1b() boolCtrlsLow := r.Read1b() v.BoolCtrls = uint16(boolCtrlsHigh)<<8 | uint16(boolCtrlsLow) } func (v SASetControls) writeTo(b *x.FixedSizeBuf) { boolCtrlsHigh := uint8(v.BoolCtrls >> 8) boolCtrlsLow := uint8(v.BoolCtrls) b.WritePad(3). Write1b(boolCtrlsHigh). Write1b(boolCtrlsLow). WritePad(2) } // Action LockControls type SALockControls SASetControls func (SALockControls) Type() uint8 { return SATypeLockControls } func readSALockControls(r *x.Reader) Action { var v SALockControls readSASetControlsAux(r, (*SASetControls)(&v)) return v } func (v SALockControls) writeTo(b *x.FixedSizeBuf) { SASetControls(v).writeTo(b) } // Action ActionMessage type SAActionMessage struct { Flags uint8 Message []byte // length 6 } func (SAActionMessage) Type() uint8 { return SATypeActionMessage } func readSAActionMessage(r *x.Reader) Action { var v SAActionMessage v.Flags = r.Read1b() v.Message = r.MustReadBytes(6) return v } func (v SAActionMessage) writeTo(b *x.FixedSizeBuf) { if len(v.Message) != 6 { panic("length of message is not 6") } b.Write1b(v.Flags). WriteBytes(v.Message) } // Action RedirectKey type SARedirectKey struct { NewKey x.Keycode Mask uint8 RealModifiers uint8 VModsMask uint16 VMods uint16 } func (SARedirectKey) Type() uint8 { return SATypeRedirectKey } func readSARedirectKey(r *x.Reader) Action { var v SARedirectKey v.NewKey = x.Keycode(r.Read1b()) v.Mask = r.Read1b() v.RealModifiers = r.Read1b() vModsMaskHigh := r.Read1b() vModsMaskLow := r.Read1b() v.VModsMask = uint16(vModsMaskHigh)<<8 | uint16(vModsMaskLow) vModsHigh := r.Read1b() vModsLow := r.Read1b() v.VMods = uint16(vModsHigh)<<8 | uint16(vModsLow) return v } func (v SARedirectKey) writeTo(b *x.FixedSizeBuf) { vModsMaskHigh := uint8(v.VModsMask >> 8) vModsMaskLow := uint8(v.VModsMask) vModsHigh := uint8(v.VMods >> 8) vModsLow := uint8(v.VMods) b.Write1b(uint8(v.NewKey)). Write1b(v.Mask). Write1b(v.RealModifiers). Write1b(vModsMaskHigh). Write1b(vModsMaskLow). Write1b(vModsHigh). Write1b(vModsLow) // 7b } // Action DeviceBtn type SADeviceBtn struct { Flags uint8 Count uint8 Button uint8 Device uint8 } func (SADeviceBtn) Type() uint8 { return SATypeDeviceBtn } func readSADeviceBtn(r *x.Reader) Action { var v SADeviceBtn v.Flags = r.Read1b() v.Count = r.Read1b() v.Button = r.Read1b() v.Device = r.Read1b() return v } func (v SADeviceBtn) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). Write1b(v.Count). Write1b(v.Button). Write1b(v.Device). WritePad(3) } // Action LockDeviceBtn type SALockDeviceBtn struct { Flags uint8 Button uint8 Device uint8 } func (SALockDeviceBtn) Type() uint8 { return SATypeLockDeviceBtn } func readSALockDeviceBtn(r *x.Reader) Action { var v SALockDeviceBtn v.Flags = r.Read1b() r.ReadPad(1) v.Button = r.Read1b() v.Device = r.Read1b() return v } func (v SALockDeviceBtn) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Flags). WritePad(1). Write1b(v.Button). Write1b(v.Device). // 4b WritePad(3) } // Action DeviceValuator type SADeviceValuator struct { Device uint8 Val1What uint8 Val1Index uint8 Val1Value uint8 Val2What uint8 Val2Index uint8 Val2Value uint8 } func (SADeviceValuator) Type() uint8 { return SATypeDeviceValuator } func readSADeviceValuator(r *x.Reader) Action { var v SADeviceValuator v.Device = r.Read1b() v.Val1What = r.Read1b() v.Val1Index = r.Read1b() v.Val1Value = r.Read1b() v.Val2What = r.Read1b() v.Val2Index = r.Read1b() v.Val2Value = r.Read1b() return v } func (v SADeviceValuator) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Device). Write1b(v.Val1What). Write1b(v.Val1Index). Write1b(v.Val1Value). Write1b(v.Val2What). Write1b(v.Val2Index). Write1b(v.Val2Value) // 7b } type UnknownAction struct { type0 uint8 data []byte // length 7 } func (v UnknownAction) Type() uint8 { return v.type0 } func (v UnknownAction) writeTo(b *x.FixedSizeBuf) { if len(v.data) != 7 { panic("length of data is not 7") } b.WriteBytes(v.data) } // size: 1 * 4b type SetBehavior struct { Keycode x.Keycode Behavior Behavior } func readSetBehavior(r *x.Reader, v *SetBehavior) { v.Keycode = x.Keycode(r.Read1b()) v.Behavior = readBehavior(r) r.ReadPad(1) // 1 } func writeSetBehavior(b *x.FixedSizeBuf, v SetBehavior) { b.Write1b(uint8(v.Keycode)) writeBehavior(b, v.Behavior) b.WritePad(1) } // size: 2b type Behavior interface { Type() uint8 writeTo(b *x.FixedSizeBuf) } func readBehavior(r *x.Reader) Behavior { type0 := r.Read1b() data := r.Read1b() switch type0 { case BehaviorTypeDefault: return DefaultBehavior{} case BehaviorTypeLock: return LockBehavior{} case BehaviorTypeRadioGroup: return RadioGroupBehavior{data} case BehaviorTypeOverlay1: return Overlay1Behavior{x.Keycode(data)} case BehaviorTypeOverlay2: return Overlay2Behavior{x.Keycode(data)} case BehaviorTypePermamentLock: return PermamentLockBehavior{} case BehaviorTypePermamentRadioGroup: return PermamentRadioGroupBehavior{data} case BehaviorTypePermamentOverlay1: return PermamentOverlay1Behavior{} case BehaviorTypePermamentOverlay2: return PermamentOverlay1Behavior{} default: return UnknownBehavior{type0, data} } } func writeBehavior(b *x.FixedSizeBuf, v Behavior) { b.Write1b(v.Type()) v.writeTo(b) } type UnknownBehavior struct { type0 uint8 Data uint8 } func (v UnknownBehavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Data) } func (v UnknownBehavior) Type() uint8 { return v.type0 } type DefaultBehavior struct { } func (DefaultBehavior) writeTo(b *x.FixedSizeBuf) { b.WritePad(1) } func (DefaultBehavior) Type() uint8 { return BehaviorTypeDefault } type LockBehavior struct { } func (LockBehavior) writeTo(b *x.FixedSizeBuf) { b.WritePad(1) } func (LockBehavior) Type() uint8 { return BehaviorTypeLock } type RadioGroupBehavior struct { Group uint8 } func (v RadioGroupBehavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Group) } func (RadioGroupBehavior) Type() uint8 { return BehaviorTypeRadioGroup } type Overlay1Behavior struct { Key x.Keycode } func (v Overlay1Behavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(uint8(v.Key)) } func (Overlay1Behavior) Type() uint8 { return BehaviorTypeOverlay1 } type Overlay2Behavior Overlay1Behavior func (v Overlay2Behavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(uint8(v.Key)) } func (Overlay2Behavior) Type() uint8 { return BehaviorTypeOverlay2 } type PermamentLockBehavior LockBehavior func (PermamentLockBehavior) writeTo(b *x.FixedSizeBuf) { b.WritePad(1) } func (PermamentLockBehavior) Type() uint8 { return BehaviorTypePermamentLock } type PermamentRadioGroupBehavior RadioGroupBehavior func (v PermamentRadioGroupBehavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(v.Group) } func (PermamentRadioGroupBehavior) Type() uint8 { return BehaviorTypePermamentRadioGroup } type PermamentOverlay1Behavior Overlay1Behavior func (v PermamentOverlay1Behavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(uint8(v.Key)) } func (PermamentOverlay1Behavior) Type() uint8 { return BehaviorTypePermamentOverlay1 } type PermamentOverlay2Behavior Overlay1Behavior func (v PermamentOverlay2Behavior) writeTo(b *x.FixedSizeBuf) { b.Write1b(uint8(v.Key)) } func (PermamentOverlay2Behavior) Type() uint8 { return BehaviorTypePermamentOverlay2 } // size: 2b type SetExplicit struct { Keycode x.Keycode Explicit uint8 } func readSetExplicit(r *x.Reader) SetExplicit { var v SetExplicit v.Keycode = x.Keycode(r.Read1b()) v.Explicit = r.Read1b() return v } func writeSetExplicit(b *x.FixedSizeBuf, v SetExplicit) { b.Write1b(uint8(v.Keycode)) b.Write1b(v.Explicit) } // size: 2b type KeyModMap struct { Keycode x.Keycode Mods uint8 } func readKeyModMap(r *x.Reader) KeyModMap { var v KeyModMap v.Keycode = x.Keycode(r.Read1b()) v.Mods = r.Read1b() return v } func writeKeyModMap(b *x.FixedSizeBuf, v KeyModMap) { b.Write1b(uint8(v.Keycode)). Write1b(v.Mods) } // size: 1 * 4b type KeyVModMap struct { Keycode x.Keycode VMods uint16 } func readKeyVModMap(r *x.Reader) KeyVModMap { var v KeyVModMap v.Keycode = x.Keycode(r.Read1b()) r.ReadPad(1) v.VMods = r.Read2b() return v } func writeKeyVModMap(b *x.FixedSizeBuf, v KeyVModMap) { b.Write1b(uint8(v.Keycode)). WritePad(1). Write2b(v.VMods) } func readGetMapReply(r *x.Reader, v *GetMapReply) error { if !r.RemainAtLeast4b(10) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() r.ReadPad(2) v.MinKeyCode = x.Keycode(r.Read1b()) v.MaxKeyCode = x.Keycode(r.Read1b()) // 3 v.Present = r.Read2b() v.FirstType = r.Read1b() v.NTypes = r.Read1b() v.TotalTypes = r.Read1b() v.FirstKeySym = x.Keycode(r.Read1b()) v.TotalSyms = r.Read2b() // 5 v.NKeySyms = r.Read1b() v.FirstKeyAction = x.Keycode(r.Read1b()) v.TotalActions = r.Read2b() v.NKeyActions = r.Read1b() v.FirstKeyBehavior = x.Keycode(r.Read1b()) v.NKeyBehaviors = r.Read1b() v.TotalKeyBehaviors = r.Read1b() v.FirstKeyExplicit = x.Keycode(r.Read1b()) v.NKeyExplicit = r.Read1b() v.TotalKeyBehaviors = r.Read1b() v.FirstModMapKey = x.Keycode(r.Read1b()) // 8 v.NModMapKeys = r.Read1b() v.TotalModMapKeys = r.Read1b() v.FirstVModMapKey = x.Keycode(r.Read1b()) v.NVModMapKeys = r.Read1b() v.TotalVModMapKeys = r.Read1b() r.ReadPad(1) v.VirtualMods = r.Read2b() // 10 if v.Present&MapPartKeyTypes != 0 && v.NTypes > 0 { v.Types = make([]KeyType, v.NTypes) for i := 0; i < int(v.NTypes); i++ { err := readKeyType(r, &v.Types[i]) if err != nil { return err } } } if v.Present&MapPartKeySyms != 0 && v.NKeySyms > 0 { v.Syms = make([]KeySymMap, v.NKeySyms) for i := 0; i < int(v.NKeySyms); i++ { err := readKeySymMap(r, &v.Syms[i]) if err != nil { return err } } } if v.Present&MapPartKeyActions != 0 { if v.NKeyActions > 0 { var err error v.ActionsCount, err = r.ReadBytesWithPad(int(v.NKeyActions)) if err != nil { return err } } if v.TotalActions > 0 { if !r.RemainAtLeast4b(2 * int(v.TotalActions)) { return x.ErrDataLenShort } v.Actions = make([]Action, v.TotalActions) for i := 0; i < int(v.TotalActions); i++ { v.Actions[i] = readAction(r) } } } if v.Present&MapPartKeyBehaviors != 0 && v.TotalKeyBehaviors > 0 { if !r.RemainAtLeast4b(int(v.TotalKeyBehaviors)) { return x.ErrDataLenShort } v.Behaviors = make([]SetBehavior, v.TotalKeyBehaviors) for i := 0; i < int(v.TotalKeyBehaviors); i++ { readSetBehavior(r, &v.Behaviors[i]) } } if v.Present&MapPartVirtualMods != 0 { length := x.PopCount(int(v.VirtualMods)) if length > 0 { var err error v.VMods, err = r.ReadBytesWithPad(length) if err != nil { return err } } } if v.Present&MapPartExplicitComponents != 0 && v.TotalKeyExplicit > 0 { n := int(v.TotalKeyExplicit) * 2 pad := x.Pad(n) if !r.RemainAtLeast(n + pad) { return x.ErrDataLenShort } v.Explicit = make([]SetExplicit, v.TotalKeyExplicit) for i := 0; i < int(v.TotalKeyExplicit); i++ { v.Explicit[i] = readSetExplicit(r) } r.ReadPad(pad) } if v.Present&MapPartModifierMap != 0 && v.TotalModMapKeys > 0 { n := int(v.TotalModMapKeys) * 2 pad := x.Pad(n) if !r.RemainAtLeast(n + pad) { return x.ErrDataLenShort } v.ModMap = make([]KeyModMap, v.TotalModMapKeys) for i := 0; i < int(v.TotalModMapKeys); i++ { v.ModMap[i] = readKeyModMap(r) } r.ReadPad(pad) } if v.Present&MapPartVirtualModMap != 0 && v.TotalVModMapKeys > 0 { if !r.RemainAtLeast4b(int(v.TotalVModMapKeys)) { return x.ErrDataLenShort } v.VModMap = make([]KeyVModMap, v.TotalVModMapKeys) for i := 0; i < int(v.TotalVModMapKeys); i++ { v.VModMap[i] = readKeyVModMap(r) } } return nil } type SetMapValue struct { MinKeyCode x.Keycode MaxKeyCode x.Keycode //Present uint16 FirstType uint8 NTypes uint8 // Types TotalTypes uint8 FirstKeySym x.Keycode TotalSyms uint16 NKeySyms uint8 // Syms FirstKeyAction x.Keycode TotalActions uint16 // Actions NKeyActions uint8 // ActionsCount FirstKeyBehavior x.Keycode NKeyBehaviors uint8 TotalKeyBehaviors uint8 // Behaviors FirstKeyExplicit x.Keycode NKeyExplicit uint8 TotalKeyExplicit uint8 // Explicit FirstModMapKey x.Keycode NModMapKeys uint8 TotalModMapKeys uint8 // modMap FirstVModMapKey x.Keycode NVModMapKeys uint8 TotalVModMapKeys uint8 // vModMap VirtualMods uint16 // VMods Types []SetKeyType Syms []KeySymMap ActionsCount []uint8 Actions []Action Behaviors []SetBehavior VMods []uint8 Explicit []SetExplicit ModMap []KeyModMap VModMap []KeyVModMap } // #WREQ func encodeSetMap(deviceSpec DeviceSpec, flags uint16, m *SetMapValue) (b x.RequestBody) { var present uint16 if m.NTypes > 0 { present |= MapPartKeyTypes } if m.NKeySyms > 0 { present |= MapPartKeySyms } if m.NKeyActions > 0 || m.TotalActions > 0 { present |= MapPartKeyActions } if m.TotalKeyBehaviors > 0 { present |= MapPartKeyBehaviors } if m.VirtualMods != 0 { present |= MapPartVirtualMods } if m.TotalKeyExplicit > 0 { present |= MapPartExplicitComponents } if m.TotalModMapKeys > 0 { present |= MapPartModifierMap } if m.TotalVModMapKeys > 0 { present |= MapPartVirtualModMap } // block size in 4b size := 8 for i := 0; i < int(m.NTypes); i++ { size += m.Types[i].sizeIn4b() } for i := 0; i < int(m.NKeySyms); i++ { size += m.Syms[i].sizeIn4b() } size += x.SizeIn4bWithPad(len(m.ActionsCount)) size += 2 * len(m.Actions) size += len(m.Behaviors) size += x.SizeIn4bWithPad(len(m.VMods)) size += x.SizeIn4bWithPad(len(m.Explicit) * 2) size += x.SizeIn4bWithPad(len(m.ModMap) * 2) size += len(m.VModMap) b0 := b.AddBlock(size). Write2b(uint16(deviceSpec)). Write2b(present). Write2b(flags). Write1b(uint8(m.MinKeyCode)). Write1b(uint8(m.MaxKeyCode)). // 2 Write1b(m.FirstType). Write1b(m.NTypes). Write1b(uint8(m.FirstKeySym)). Write1b(m.NKeySyms). // 3 Write2b(m.TotalSyms). Write1b(uint8(m.FirstKeyAction)). Write1b(m.NKeyActions). Write2b(m.TotalActions). Write1b(uint8(m.FirstKeyBehavior)). Write1b(m.NKeyBehaviors). // 5 Write1b(m.TotalKeyBehaviors). Write1b(uint8(m.FirstKeyExplicit)). Write1b(m.NKeyExplicit). Write1b(m.TotalKeyExplicit). Write1b(uint8(m.FirstModMapKey)). Write1b(m.NModMapKeys). Write1b(m.TotalModMapKeys). Write1b(uint8(m.FirstVModMapKey)). // 7 Write1b(m.NVModMapKeys). Write1b(m.TotalVModMapKeys). Write2b(m.VirtualMods) // 8 for i := 0; i < int(m.NTypes); i++ { writeSetKeyType(b0, &m.Types[i]) } for i := 0; i < int(m.NKeySyms); i++ { writeKeySymMap(b0, &m.Syms[i]) } b0.WriteBytes(m.ActionsCount) b0.WritePad(x.Pad(len(m.ActionsCount))) for _, act := range m.Actions { writeAction(b0, act) } for _, b := range m.Behaviors { writeSetBehavior(b0, b) } b0.WriteBytes(m.VMods) b0.WritePad(x.Pad(len(m.VMods))) for _, e := range m.Explicit { writeSetExplicit(b0, e) } b0.WritePad(x.Pad(len(m.Explicit) * 2)) for _, m := range m.ModMap { writeKeyModMap(b0, m) } b0.WritePad(x.Pad(len(m.ModMap) * 2)) for _, v := range m.VModMap { writeKeyVModMap(b0, v) } b0.End() return } // #WREQ func encodeGetCompatMap(deviceSpec DeviceSpec, groups uint8, getAllSI bool, firstSI, NSI uint16) (b x.RequestBody) { b.AddBlock(2). Write2b(uint16(deviceSpec)). Write1b(groups). WriteBool(getAllSI). Write2b(firstSI). Write2b(NSI). End() return } type GetCompatMapReply struct { DeviceID uint8 GroupsRtrn uint8 FirstSIRtrn uint16 NSIRtrn uint16 NTotalSI uint16 SIRtrn []SymInterpret GroupRtrn []ModDef } func readGetCompatMapReply(r *x.Reader, v *GetCompatMapReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.GroupsRtrn = r.Read1b() r.ReadPad(1) v.FirstSIRtrn = r.Read2b() v.NSIRtrn = r.Read2b() v.NTotalSI = r.Read2b() // 4 r.ReadPad(16) // 8 if v.NSIRtrn > 0 { if !r.RemainAtLeast4b(4 * int(v.NSIRtrn)) { return x.ErrDataLenShort } v.SIRtrn = make([]SymInterpret, v.NSIRtrn) for i := 0; i < int(v.NSIRtrn); i++ { readSymInterpret(r, &v.SIRtrn[i]) } } if v.GroupsRtrn > 0 { length := x.PopCount(int(v.GroupsRtrn)) if !r.RemainAtLeast4b(length) { return x.ErrDataLenShort } v.GroupRtrn = make([]ModDef, length) for i := 0; i < length; i++ { v.GroupRtrn[i] = readModDef(r) } } return nil } // size: 4 * 4b type SymInterpret struct { Sym x.Keysym Mods uint8 Match uint8 VirtualMod uint8 Flags uint8 Action Action } func readSymInterpret(r *x.Reader, v *SymInterpret) { v.Sym = x.Keysym(r.Read4b()) v.Mods = r.Read1b() v.Match = r.Read1b() v.VirtualMod = r.Read1b() v.Flags = r.Read1b() v.Action = readAction(r) } func writeSymInterpret(b *x.FixedSizeBuf, v *SymInterpret) { b.Write4b(uint32(v.Sym)). Write1b(v.Mods). Write1b(v.Match). Write1b(v.VirtualMod). Write1b(v.Flags) writeAction(b, v.Action) } type SetCompatMapValue struct { RecomputeActions bool TruncateSI bool Groups uint8 FirstSI uint16 NSI uint16 SI []SymInterpret GroupMaps []ModDef } // #WREQ func encodeSetCompatMap(deviceSpec DeviceSpec, v *SetCompatMapValue) (b x.RequestBody) { v.NSI = uint16(len(v.SI)) b0 := b.AddBlock(3 + 4*len(v.SI)). Write2b(uint16(deviceSpec)). WritePad(1). WriteBool(v.RecomputeActions). WriteBool(v.TruncateSI). Write1b(v.Groups). Write2b(v.FirstSI). Write2b(v.NSI). WritePad(2) // 3 for i := 0; i < len(v.SI); i++ { writeSymInterpret(b0, &v.SI[i]) } nGroup := x.PopCount(int(v.Groups)) for i := 0; i < nGroup; i++ { writeModDef(b0, v.GroupMaps[i]) } b0.End() return b } // #WREQ func encodeGetIndicatorState(deviceSpec DeviceSpec) (b x.RequestBody) { b.AddBlock(1). Write2b(uint16(deviceSpec)). WritePad(2). End() return } type GetIndicatorStateReply struct { DeviceID uint8 State uint32 } func readGetIndicatorStateReply(r *x.Reader, v *GetIndicatorStateReply) error { if !r.RemainAtLeast4b(3) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.State = r.Read4b() return nil } // #WREQ func encodeGetIndicatorMap(deviceSpec DeviceSpec, which uint32) (b x.RequestBody) { b.AddBlock(2). Write2b(uint16(deviceSpec)). WritePad(2). Write4b(which) return } type GetIndicatorMapReply struct { DeviceID uint8 Which uint32 RealIndicators uint32 NIndicators uint8 Maps []IndicatorMap } // size: 3 * 4b type IndicatorMap struct { Flags uint8 WhichGroups uint8 Groups uint8 WhichMods uint8 Mods uint8 RealMods uint8 VMods uint16 Ctrls uint32 } func readIndicatorMap(r *x.Reader, v *IndicatorMap) { v.Flags = r.Read1b() v.WhichGroups = r.Read1b() v.Groups = r.Read1b() v.WhichMods = r.Read1b() v.Mods = r.Read1b() v.RealMods = r.Read1b() v.VMods = r.Read2b() v.Ctrls = r.Read4b() } func writeIndicatorMap(b *x.FixedSizeBuf, v *IndicatorMap) { b.Write1b(v.Flags). Write1b(v.WhichGroups). Write1b(v.Groups). Write1b(v.WhichGroups). Write1b(v.Mods). Write1b(v.RealMods). Write2b(v.VMods). Write4b(v.Ctrls) } func readGetIndicatorMapReply(r *x.Reader, v *GetIndicatorMapReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Which = r.Read4b() v.RealIndicators = r.Read4b() // 4 v.NIndicators = r.Read1b() r.ReadPad(15) // 8 mapsLen := x.PopCount(int(v.Which)) if mapsLen > 0 { if !r.RemainAtLeast4b(3 * mapsLen) { return x.ErrDataLenShort } v.Maps = make([]IndicatorMap, mapsLen) for i := 0; i < mapsLen; i++ { readIndicatorMap(r, &v.Maps[i]) } } return nil } // #WREQ func encodeSetIndicatorMap(deviceSpec DeviceSpec, which uint32, maps []IndicatorMap) (b x.RequestBody) { mapsLen := x.PopCount(int(which)) b0 := b.AddBlock(2 + 3*mapsLen). Write2b(uint16(deviceSpec)). WritePad(2). Write4b(which) for i := 0; i < mapsLen; i++ { writeIndicatorMap(b0, &maps[i]) } b0.End() return } // #WREQ func encodeGetNamedIndicator(deviceSpec DeviceSpec, ledClass LedClassSpec, ledID IdSpec, indicator x.Atom) (b x.RequestBody) { b.AddBlock(3). Write2b(uint16(deviceSpec)). Write2b(uint16(ledClass)). Write2b(uint16(ledID)). WritePad(2). Write4b(uint32(indicator)). End() return } type GetNamedIndicatorReply struct { DeviceID uint8 Indicator x.Atom Found bool On bool RealIndicator bool Ndx uint8 Map IndicatorMap Supported bool } func readGetNamedIndicatorReply(r *x.Reader, v *GetNamedIndicatorReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Indicator = x.Atom(r.Read4b()) // 3 v.Found = r.ReadBool() v.On = r.ReadBool() v.RealIndicator = r.ReadBool() v.Ndx = r.Read1b() // 4 readIndicatorMap(r, &v.Map) // 7 v.Supported = r.ReadBool() // 8 return nil } // #WREQ func encodeSetNamedIndicator(deviceSpec DeviceSpec, ledClass LedClassSpec, ledID IdSpec, indicator x.Atom, setState, on, setMap, createMap bool, map0 *IndicatorMap) (b x.RequestBody) { b.AddBlock(7). Write2b(uint16(deviceSpec)). Write2b(uint16(ledClass)). Write2b(uint16(ledID)). WritePad(2). // 2 Write4b(uint32(indicator)). WriteBool(setState). WriteBool(on). WriteBool(setMap). WriteBool(createMap). // 4 WritePad(1). Write1b(map0.Flags). Write1b(map0.WhichGroups). Write1b(map0.Groups). // 5 Write1b(map0.WhichMods). Write1b(map0.RealMods). Write2b(map0.VMods). Write4b(map0.Ctrls). // 7 End() // NOTE: map0.Mods is not used return } // #WREQ func encodeGetNames(deviceSpec DeviceSpec, which uint32) (b x.RequestBody) { b.AddBlock(2). Write2b(uint16(deviceSpec)). WritePad(2). Write4b(which). End() return } type GetNamesReply struct { DeviceID uint8 Which uint32 MinKeyCode x.Keycode MaxKeyCode x.Keycode NTypes uint8 Groups uint8 VirtualMods uint16 FirstKey x.Keycode NKeys uint8 Indicators uint32 NRadioGroups uint8 NKeyAliases uint8 NKTLevels uint16 KeycodesName x.Atom GeometryName x.Atom SymbolsName x.Atom PhysSymbolsName x.Atom TypesName x.Atom CompatName x.Atom TypeNames []x.Atom NLevelsPerType []uint8 KTLevelNames []x.Atom IndicatorNames []x.Atom VirtualModNames []x.Atom GroupNames []x.Atom KeyNames []string KeyAliases []KeyAlias RadioGroupNames []x.Atom } // size: 1 * 4b //type KeyName struct { // Name []byte // length 4 //} func readKeyName(r *x.Reader) string { return bytesToStr(r.MustReadBytes(4)) } func writeKeyName(b *x.FixedSizeBuf, str string) { writeStr4b(b, str) } func writeStr4b(b *x.FixedSizeBuf, str string) { if len(str) >= 4 { b.WriteBytes([]byte(str[:4])) } else { b.WriteBytes([]byte(str)) b.WritePad(4 - len(str)) } } func bytesToStr(data []byte) string { idx := bytes.IndexByte(data, 0) if idx != -1 { return string(data[:idx]) } return string(data) } // size: 2 * 4b type KeyAlias struct { Real string Alias string } func readKeyAlias(r *x.Reader) KeyAlias { var v KeyAlias v.Real = bytesToStr(r.MustReadBytes(4)) v.Alias = bytesToStr(r.MustReadBytes(4)) return v } func writeKeyAlias(b *x.FixedSizeBuf, v KeyAlias) { writeStr4b(b, v.Real) writeStr4b(b, v.Alias) } //type KeyAlias struct { // Real []byte // length 4 // Alias []byte // length 4 //} func readGetNamesReply(r *x.Reader, v *GetNamesReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Which = r.Read4b() v.MinKeyCode = x.Keycode(r.Read1b()) v.MaxKeyCode = x.Keycode(r.Read1b()) v.NTypes = r.Read1b() v.Groups = r.Read1b() // 4 v.VirtualMods = r.Read2b() v.FirstKey = x.Keycode(r.Read1b()) v.NKeys = r.Read1b() v.Indicators = r.Read4b() v.NRadioGroups = r.Read1b() v.NKeyAliases = r.Read1b() v.NKTLevels = r.Read2b() r.ReadPad(4) // 8 // in 4b var valueListSize int if v.Which&NameDetailKeycodes != 0 { valueListSize++ } if v.Which&NameDetailGeometry != 0 { valueListSize++ } if v.Which&NameDetailSymbols != 0 { valueListSize++ } if v.Which&NameDetailPhysSymbols != 0 { valueListSize++ } if v.Which&NameDetailTypes != 0 { valueListSize++ } if v.Which&NameDetailCompat != 0 { valueListSize++ } if v.Which&NameDetailKeyTypeNames != 0 { valueListSize += int(v.NTypes) } if !r.RemainAtLeast4b(valueListSize) { return x.ErrDataLenShort } if v.Which&NameDetailKeycodes != 0 { v.KeycodesName = x.Atom(r.Read4b()) } if v.Which&NameDetailGeometry != 0 { v.GeometryName = x.Atom(r.Read4b()) } if v.Which&NameDetailSymbols != 0 { v.SymbolsName = x.Atom(r.Read4b()) } if v.Which&NameDetailPhysSymbols != 0 { v.PhysSymbolsName = x.Atom(r.Read4b()) } if v.Which&NameDetailTypes != 0 { v.TypesName = x.Atom(r.Read4b()) } if v.Which&NameDetailCompat != 0 { v.CompatName = x.Atom(r.Read4b()) } if v.Which&NameDetailKeyTypeNames != 0 && v.NTypes > 0 { v.TypeNames = make([]x.Atom, v.NTypes) for i := 0; i < int(v.NTypes); i++ { v.TypeNames[i] = x.Atom(r.Read4b()) } } if v.Which&NameDetailKtLevelNames != 0 { var err error v.NLevelsPerType, err = r.ReadBytesWithPad(int(v.NTypes)) if err != nil { return err } var sum int for _, value := range v.NLevelsPerType { sum += int(value) } if sum > 0 { if !r.RemainAtLeast4b(sum) { return x.ErrDataLenShort } v.KTLevelNames = make([]x.Atom, sum) for i := 0; i < sum; i++ { v.KTLevelNames[i] = x.Atom(r.Read4b()) } } } valueListSize = 0 if v.Which&NameDetailIndicatorNames != 0 { valueListSize += x.PopCount(int(v.Indicators)) } if v.Which&NameDetailVirtualModNames != 0 { valueListSize += x.PopCount(int(v.VirtualMods)) } if v.Which&NameDetailGroupNames != 0 { valueListSize += x.PopCount(int(v.Groups)) } if v.Which&NameDetailKeyNames != 0 { valueListSize += int(v.NKeys) } if v.Which&NameDetailKeyAliases != 0 { valueListSize += 2 * int(v.NKeyAliases) } if v.Which&NameDetailRgNames != 0 { valueListSize += int(v.NRadioGroups) } if !r.RemainAtLeast4b(valueListSize) { return x.ErrDataLenShort } if v.Which&NameDetailIndicatorNames != 0 { n := x.PopCount(int(v.Indicators)) if n > 0 { v.IndicatorNames = make([]x.Atom, n) for i := 0; i < n; i++ { v.IndicatorNames[i] = x.Atom(r.Read4b()) } } } if v.Which&NameDetailVirtualModNames != 0 { n := x.PopCount(int(v.VirtualMods)) if n > 0 { v.VirtualModNames = make([]x.Atom, n) for i := 0; i < n; i++ { v.VirtualModNames[i] = x.Atom(r.Read4b()) } } } if v.Which&NameDetailGroupNames != 0 { n := x.PopCount(int(v.Groups)) if n > 0 { v.GroupNames = make([]x.Atom, n) for i := 0; i < n; i++ { v.GroupNames[i] = x.Atom(r.Read4b()) } } } if v.Which&NameDetailKeyNames != 0 && v.NKeys > 0 { v.KeyNames = make([]string, v.NKeys) for i := 0; i < int(v.NKeys); i++ { v.KeyNames[i] = readKeyName(r) } } if v.Which&NameDetailKeyAliases != 0 && v.NKeyAliases > 0 { v.KeyAliases = make([]KeyAlias, v.NKeyAliases) for i := 0; i < int(v.NKeyAliases); i++ { v.KeyAliases[i] = readKeyAlias(r) } } if v.Which&NameDetailRgNames != 0 && v.NRadioGroups > 0 { v.RadioGroupNames = make([]x.Atom, v.NRadioGroups) for i := 0; i < int(v.NRadioGroups); i++ { v.RadioGroupNames[i] = x.Atom(r.Read4b()) } } return nil } type SetNamesRequest struct { DeviceSpec DeviceSpec VirtualMods uint16 Which uint32 FirstType uint8 NTypes uint8 FirstKTLevel uint8 NKTLevels uint8 Indicators uint32 Groups uint8 NRadioGroups uint8 FirstKey x.Keycode NKeys uint8 NKeyAliases uint8 TotalKTLevelNames uint16 KeycodesName x.Atom GeometryName x.Atom SymbolsName x.Atom PhysSymbolsName x.Atom TypesName x.Atom CompatName x.Atom TypeNames []x.Atom NLevelsPerType []uint8 KTLevelNames []x.Atom IndicatorNames []x.Atom VirtualModNames []x.Atom GroupNames []x.Atom KeyNames []string KeyAliases []KeyAlias RadioGroupNames []x.Atom } // #WREQ func encodeSetNames(r *SetNamesRequest) (b x.RequestBody) { // in 4b valueListSize := 0 if r.Which&NameDetailKeycodes != 0 { valueListSize++ } if r.Which&NameDetailGeometry != 0 { valueListSize++ } if r.Which&NameDetailSymbols != 0 { valueListSize++ } if r.Which&NameDetailPhysSymbols != 0 { valueListSize++ } if r.Which&NameDetailTypes != 0 { valueListSize++ } if r.Which&NameDetailCompat != 0 { valueListSize++ } if r.Which&NameDetailKeyTypeNames != 0 { valueListSize += int(r.NTypes) } if r.Which&NameDetailKtLevelNames != 0 { sum := 0 for _, value := range r.NLevelsPerType { sum += int(value) } valueListSize += x.SizeIn4bWithPad(len(r.NLevelsPerType)) + sum } if r.Which&NameDetailIndicatorNames != 0 { valueListSize += x.PopCount(int(r.Indicators)) } if r.Which&NameDetailVirtualModNames != 0 { valueListSize += x.PopCount(int(r.VirtualMods)) } if r.Which&NameDetailGroupNames != 0 { valueListSize += x.PopCount(int(r.Groups)) } if r.Which&NameDetailKeyNames != 0 { valueListSize += int(r.NKeys) } if r.Which&NameDetailKeyAliases != 0 { valueListSize += 3 * int(r.NKeyAliases) } if r.Which&NameDetailRgNames != 0 { valueListSize += int(r.NRadioGroups) } b0 := b.AddBlock(6 + valueListSize). Write2b(uint16(r.DeviceSpec)). Write2b(r.VirtualMods). Write4b(r.Which). // 2 Write1b(r.FirstType). Write1b(r.NTypes). Write1b(r.FirstKTLevel). Write1b(r.NKTLevels). // 3 Write4b(r.Indicators). Write1b(r.Groups). Write1b(r.NRadioGroups). Write1b(uint8(r.FirstKey)). Write1b(r.NKeys). // 5 Write1b(r.NKeyAliases). WritePad(1). Write2b(r.TotalKTLevelNames) // 6 if r.Which&NameDetailKeycodes != 0 { b0.Write4b(uint32(r.KeycodesName)) } if r.Which&NameDetailGeometry != 0 { b0.Write4b(uint32(r.GeometryName)) } if r.Which&NameDetailSymbols != 0 { b0.Write4b(uint32(r.SymbolsName)) } if r.Which&NameDetailPhysSymbols != 0 { b0.Write4b(uint32(r.PhysSymbolsName)) } if r.Which&NameDetailTypes != 0 { b0.Write4b(uint32(r.TypesName)) } if r.Which&NameDetailCompat != 0 { b0.Write4b(uint32(r.CompatName)) } if r.Which&NameDetailKeyTypeNames != 0 { for i := 0; i < int(r.NTypes); i++ { b0.Write4b(uint32(r.TypeNames[i])) } } if r.Which&NameDetailKtLevelNames != 0 { b0.WriteBytes(r.NLevelsPerType) b0.WritePad(x.Pad(len(r.NLevelsPerType))) sum := 0 for _, value := range r.NLevelsPerType { sum += int(value) } for i := 0; i < sum; i++ { b0.Write4b(uint32(r.KTLevelNames[i])) } } if r.Which&NameDetailIndicatorNames != 0 { n := x.PopCount(int(r.Indicators)) for i := 0; i < n; i++ { b0.Write4b(uint32(r.IndicatorNames[i])) } } if r.Which&NameDetailVirtualModNames != 0 { n := x.PopCount(int(r.VirtualMods)) for i := 0; i < n; i++ { b0.Write4b(uint32(r.VirtualModNames[i])) } } if r.Which&NameDetailGroupNames != 0 { n := x.PopCount(int(r.Groups)) for i := 0; i < n; i++ { b0.Write4b(uint32(r.GroupNames[i])) } } if r.Which&NameDetailKeyNames != 0 { for i := 0; i < int(r.NKeys); i++ { writeKeyName(b0, r.KeyNames[i]) } } if r.Which&NameDetailKeyAliases != 0 { for i := 0; i < int(r.NKeyAliases); i++ { writeKeyAlias(b0, r.KeyAliases[i]) } } if r.Which&NameDetailRgNames != 0 { for i := 0; i < int(r.NRadioGroups); i++ { b0.Write4b(uint32(r.RadioGroupNames[i])) } } return } // TODO: GetGeometry // TODO: SetGeometry // #WREQ func encodePerClientFlags(deviceSpec DeviceSpec, change, value, ctrlsToChange, autoCtrls, autoCtrlsValues uint32) (b x.RequestBody) { b.AddBlock(6). Write2b(uint16(deviceSpec)). WritePad(2). Write4b(change). Write4b(value). // 3 Write4b(ctrlsToChange). Write4b(autoCtrls). Write4b(autoCtrlsValues). // 6 End() return } type PerClientFlagsReply struct { DeviceID uint8 Supported uint32 Value uint32 AutoCtrls uint32 AutoCtrlsValues uint32 } func readPerClientFlagsReply(r *x.Reader, v *PerClientFlagsReply) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Supported = r.Read4b() v.Value = r.Read4b() // 4 v.AutoCtrls = r.Read4b() v.AutoCtrlsValues = r.Read4b() // 6 return nil } type ComponentNames struct { KeymapsSpec string KeycodesSpec string TypesSpec string CompatMapSpec string SymbolsSpec string GeometrySpec string } // #WREQ func encodeListComponents(deviceSpec DeviceSpec, maxNames uint16, cn *ComponentNames) (b x.RequestBody) { keymapsSpec := x.TruncateStr(cn.KeymapsSpec, math.MaxUint8) keycodesSpec := x.TruncateStr(cn.KeycodesSpec, math.MaxUint8) typesSpec := x.TruncateStr(cn.TypesSpec, math.MaxUint8) compatMapSpec := x.TruncateStr(cn.CompatMapSpec, math.MaxUint8) symbolsSpec := x.TruncateStr(cn.SymbolsSpec, math.MaxUint8) geometrySpec := x.TruncateStr(cn.GeometrySpec, math.MaxUint8) specsLen := 6 + len(keymapsSpec) + len(keycodesSpec) + len(typesSpec) + len(compatMapSpec) + len(symbolsSpec) + len(geometrySpec) b.AddBlock(1 + x.SizeIn4bWithPad(specsLen)). Write2b(uint16(deviceSpec)). Write2b(maxNames). Write1b(uint8(len(keymapsSpec))). WriteString(keymapsSpec). Write1b(uint8(len(keycodesSpec))). WriteString(keycodesSpec). Write1b(uint8(len(typesSpec))). WriteString(typesSpec). Write1b(uint8(len(compatMapSpec))). WriteString(compatMapSpec). Write1b(uint8(len(symbolsSpec))). WriteString(symbolsSpec). Write1b(uint8(len(geometrySpec))). WriteString(geometrySpec). WritePad(x.Pad(specsLen)). End() return } type ListComponentsReply struct { DeviceID uint8 NKeymaps uint16 NKeycodes uint16 NTypes uint16 NCompatMaps uint16 NSymbols uint16 NGeometries uint16 Extra uint16 Keymaps []int Keycodes []int Types []int CompatMaps []int Symbols []int Geometries []int } func readListComponentsReply(r *x.Reader, v *ListComponentsReply) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.NKeymaps = r.Read2b() v.NKeycodes = r.Read2b() v.NTypes = r.Read2b() v.NCompatMaps = r.Read2b() v.NSymbols = r.Read2b() v.NGeometries = r.Read2b() // 5 v.Extra = r.Read2b() r.ReadPad(10) // 8 // TODO: return nil } // TODO: GetKbdByName // #WREQ func encodeGetDeviceInfo(deviceSpec DeviceSpec, wanted uint16, allButtons bool, FirstButton, nButtons uint8, ledClass LedClassSpec, ledID IdSpec) (b x.RequestBody) { b.AddBlock(3). Write2b(uint16(deviceSpec)). Write2b(wanted). WriteBool(allButtons). Write1b(FirstButton). Write1b(nButtons). WritePad(1). // 2 Write2b(uint16(ledClass)). Write2b(uint16(ledID)). // 3 End() return } type GetDeviceInfoReply struct { DeviceID uint8 Present uint16 Supported uint16 Unsupported uint16 NDeviceLedFBs uint16 FirstBtnWanted uint8 NBtnsWanted uint8 FirstBtnRtrn uint8 NBtnsRtrn uint8 TotalBtns uint8 HasOwnState bool DfltKbdFB uint16 DfltLedFB uint16 DevType x.Atom NameLen uint16 Name string BtnActions []Action Leds []DeviceLedInfo } type DeviceLedInfo struct { LedClass LedClassSpec LedID IdSpec NamesPresent uint32 MapsPresent uint32 PhysIndicators uint32 State uint32 Names []x.Atom Maps []IndicatorMap } func readDeviceLedInfo(r *x.Reader, v *DeviceLedInfo) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } v.LedClass = LedClassSpec(r.Read2b()) v.LedID = IdSpec(r.Read2b()) v.NamesPresent = r.Read4b() v.MapsPresent = r.Read4b() v.PhysIndicators = r.Read4b() v.State = r.Read4b() // 5 if v.NamesPresent != 0 { n := x.PopCount(int(v.NamesPresent)) if !r.RemainAtLeast4b(n) { return x.ErrDataLenShort } v.Names = make([]x.Atom, n) for i := 0; i < n; i++ { v.Names[i] = x.Atom(r.Read4b()) } } if v.MapsPresent != 0 { n := x.PopCount(int(v.MapsPresent)) if !r.RemainAtLeast4b(3 * n) { return x.ErrDataLenShort } v.Maps = make([]IndicatorMap, n) for i := 0; i < n; i++ { readIndicatorMap(r, &v.Maps[i]) } } return nil } func (v *DeviceLedInfo) sizeIn4b() int { return 5 + x.PopCount(int(v.NamesPresent)) + 3*x.PopCount(int(v.MapsPresent)) } func writeDeviceLedInfo(b *x.FixedSizeBuf, v *DeviceLedInfo) { b.Write2b(uint16(v.LedClass)). Write2b(uint16(v.LedID)). // 1 Write4b(v.NamesPresent). Write4b(v.MapsPresent). Write4b(v.PhysIndicators). Write4b(v.State) // 5 if v.NamesPresent != 0 { n := x.PopCount(int(v.NamesPresent)) for i := 0; i < n; i++ { b.Write4b(uint32(v.Names[i])) } } if v.MapsPresent != 0 { n := x.PopCount(int(v.MapsPresent)) for i := 0; i < n; i++ { writeIndicatorMap(b, &v.Maps[i]) } } } func readGetDeviceInfoReply(r *x.Reader, v *GetDeviceInfoReply) error { if !r.RemainAtLeast(34) { return x.ErrDataLenShort } v.DeviceID, _ = r.ReadReplyHeader() v.Present = r.Read2b() v.Supported = r.Read2b() v.Unsupported = r.Read2b() v.NDeviceLedFBs = r.Read2b() // 4 v.FirstBtnWanted = r.Read1b() v.NBtnsWanted = r.Read1b() v.FirstBtnRtrn = r.Read1b() v.NBtnsRtrn = r.Read1b() v.TotalBtns = r.Read1b() v.HasOwnState = r.ReadBool() v.DfltKbdFB = r.Read2b() // 6 v.DfltLedFB = r.Read2b() r.ReadPad(2) v.DevType = x.Atom(r.Read4b()) // 8 v.NameLen = r.Read2b() // 34b var err error v.Name, err = r.ReadStrWithPad(int(v.NameLen)) if err != nil { return err } if v.NBtnsRtrn > 0 { if !r.RemainAtLeast4b(2 * int(v.NBtnsRtrn)) { return x.ErrDataLenShort } v.BtnActions = make([]Action, v.NBtnsRtrn) for i := 0; i < int(v.NBtnsRtrn); i++ { v.BtnActions[i] = readAction(r) } } if v.NDeviceLedFBs > 0 { v.Leds = make([]DeviceLedInfo, v.NDeviceLedFBs) for i := 0; i < int(v.NDeviceLedFBs); i++ { err = readDeviceLedInfo(r, &v.Leds[i]) if err != nil { return err } } } return nil } // #WREQ func encodeSetDeviceInfo(deviceSpec DeviceSpec, firstBtn uint8, change uint16, btnActions []Action, leds []DeviceLedInfo) (b x.RequestBody) { var nBtns uint8 if len(btnActions) > math.MaxUint8 { nBtns = math.MaxUint8 btnActions = btnActions[:math.MaxUint8] } var nDeviceLedFB uint16 if len(leds) > math.MaxUint16 { nDeviceLedFB = math.MaxUint16 leds = leds[:math.MaxUint16] } ledsSize := 0 for i := 0; i < len(leds); i++ { ledsSize += leds[i].sizeIn4b() } b0 := b.AddBlock(2 + 2*int(nBtns) + ledsSize). Write2b(uint16(deviceSpec)). Write1b(firstBtn). Write1b(nBtns). Write2b(change). Write2b(nDeviceLedFB) // 2 for _, a := range btnActions { writeAction(b0, a) } for i := 0; i < len(leds); i++ { writeDeviceLedInfo(b0, &leds[i]) } return } // #WREQ func encodeSetDebuggingFlags(affectFlags, flags, affectCtrls, ctrls uint32, message string) (b x.RequestBody) { message = x.TruncateStr(message, math.MaxUint16) msgLength := len(message) b.AddBlock(5 + x.SizeIn4bWithPad(msgLength)). Write2b(uint16(msgLength)). WritePad(2). Write4b(affectCtrls). // 2 Write4b(flags). Write4b(affectCtrls). Write4b(ctrls). // 5 WriteString(message). WritePad(x.Pad(msgLength)). End() return } type SetDebuggingFlagsReply struct { CurrentFlags uint32 CurrentCtrls uint32 SupportedFlags uint32 SupportedCtrls uint32 } func readSetDebuggingFlagsReply(r *x.Reader, v *SetDebuggingFlagsReply) error { if !r.RemainAtLeast4b(6) { return x.ErrDataLenShort } r.ReadPad(8) v.CurrentFlags = r.Read4b() // 3 v.CurrentCtrls = r.Read4b() v.SupportedFlags = r.Read4b() v.SupportedCtrls = r.Read4b() // 6 return nil } go-x11-client-1.0.2/ext/xkb/xkb_event.go000066400000000000000000000212541460713373000177120ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xkb import "github.com/linuxdeepin/go-x11-client" // size: 9b type eventHeader struct { XkbType uint8 Sequence uint16 Time x.Timestamp DeviceID uint8 } func readEventHeader(r *x.Reader, v *eventHeader) { v.XkbType, v.Sequence = r.ReadEventHeader() v.Time = x.Timestamp(r.Read4b()) v.DeviceID = r.Read1b() } type NewKeyboardNotifyEvent struct { eventHeader OldDeviceID uint8 MinKeyCode x.Keycode MaxKeyCode x.Keycode OldMinKeyCode x.Keycode OldMaxKeyCode x.Keycode RequestMajor uint8 RequestMinor uint8 Changed uint16 } func readNewKeyboardNotifyEvent(r *x.Reader, v *NewKeyboardNotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.OldDeviceID = r.Read1b() v.MinKeyCode = x.Keycode(r.Read1b()) v.MaxKeyCode = x.Keycode(r.Read1b()) // 3 v.OldMinKeyCode = x.Keycode(r.Read1b()) v.OldMaxKeyCode = x.Keycode(r.Read1b()) v.RequestMajor = r.Read1b() v.RequestMinor = r.Read1b() v.Changed = r.Read2b() // 5 return nil } type MapNotifyEvent struct { eventHeader PtrBtnActions uint8 Changed uint16 MinKeyCode x.Keycode MaxKeyCode x.Keycode FirstType uint8 NTypes uint8 FirstKeySym x.Keycode NKeySyms uint8 FirstKeyAct x.Keycode NKeyActs uint8 FirstKeyBehavior x.Keycode NKeyBehavior uint8 FirstKeyExplicit x.Keycode NKeyExplicit uint8 FirstModMapKey x.Keycode NModMapKeys uint8 FirstVModMapKey x.Keycode NVModMapKeys uint8 VirtualMods uint16 } func readMapNotifyEvent(r *x.Reader, v *MapNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.PtrBtnActions = r.Read1b() v.Changed = r.Read2b() v.MinKeyCode = x.Keycode(r.Read1b()) // 3 v.MaxKeyCode = x.Keycode(r.Read1b()) v.FirstType = r.Read1b() v.NTypes = r.Read1b() v.FirstKeySym = x.Keycode(r.Read1b()) v.NKeySyms = r.Read1b() v.FirstKeyAct = x.Keycode(r.Read1b()) v.NKeyActs = r.Read1b() v.FirstKeyBehavior = x.Keycode(r.Read1b()) v.NKeyBehavior = r.Read1b() v.FirstKeyExplicit = x.Keycode(r.Read1b()) v.NKeyExplicit = r.Read1b() v.FirstModMapKey = x.Keycode(r.Read1b()) v.NModMapKeys = r.Read1b() v.FirstVModMapKey = x.Keycode(r.Read1b()) v.NVModMapKeys = r.Read1b() v.VirtualMods = r.Read2b() // 7 return nil } type StateNotifyEvent struct { eventHeader Mods uint8 BaseMods uint8 LatchedMods uint8 LockedMods uint8 Group uint8 BaseGroup int16 LatchedGroup int16 LockedGroup uint8 CompatState uint8 GrabMods uint8 CompatGrabMods uint8 LookupMods uint8 CompatLookupMods uint8 PtrBtnState uint16 Changed uint16 Keycode x.Keycode EventType uint8 RequestMajor uint8 RequestMinor uint8 } func readStateNotifyEvent(r *x.Reader, v *StateNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.Mods = r.Read1b() v.BaseMods = r.Read1b() v.LatchedMods = r.Read1b() // 3 v.LockedMods = r.Read1b() v.Group = r.Read1b() v.BaseGroup = int16(r.Read2b()) v.LatchedGroup = int16(r.Read2b()) v.LockedGroup = r.Read1b() v.CompatState = r.Read1b() v.GrabMods = r.Read1b() v.CompatGrabMods = r.Read1b() v.LookupMods = r.Read1b() v.CompatLookupMods = r.Read1b() v.PtrBtnState = r.Read2b() v.Changed = r.Read2b() v.Keycode = x.Keycode(r.Read1b()) v.EventType = r.Read1b() v.RequestMajor = r.Read1b() v.RequestMinor = r.Read1b() // 8 return nil } type ControlsNotifyEvent struct { eventHeader NumGroups uint8 ChangedControls uint32 EnabledControls uint32 EnabledControlChanges uint32 Keycode x.Keycode EventType uint8 RequestMajor uint8 RequestMinor uint8 } func readControlsNotifyEvent(r *x.Reader, v *ControlsNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.NumGroups = r.Read1b() r.ReadPad(2) // 3 v.ChangedControls = r.Read4b() v.EnabledControls = r.Read4b() v.EnabledControlChanges = r.Read4b() v.Keycode = x.Keycode(r.Read1b()) v.EventType = r.Read1b() v.RequestMajor = r.Read1b() v.RequestMinor = r.Read1b() // 7 return nil } type IndicatorStateNotifyEvent struct { eventHeader State uint32 StateChanged uint32 } func readIndicatorStateNotifyEvent(r *x.Reader, v *IndicatorStateNotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) r.ReadPad(3) // 3 v.State = r.Read4b() v.StateChanged = r.Read4b() // 5 return nil } type IndicatorMapNotifyEvent struct { eventHeader State uint32 MapChanged uint32 } func readIndicatorMapNotifyEvent(r *x.Reader, v *IndicatorMapNotifyEvent) error { if !r.RemainAtLeast4b(5) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) r.ReadPad(3) // 3 v.State = r.Read4b() v.MapChanged = r.Read4b() // 5 return nil } type NamesNotifyEvent struct { eventHeader Changed uint16 FirstType uint8 NTypes uint8 FirstLevelName uint8 NLevelNames uint8 NRadioGroups uint8 NKeyAliases uint8 ChangedGroupNames uint8 ChangedVirtualMods uint16 FirstKey x.Keycode NKeys uint8 ChangedIndicators uint32 } func readNamesNotifyEvent(r *x.Reader, v *NamesNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) r.ReadPad(1) v.Changed = r.Read2b() // 3 v.FirstType = r.Read1b() v.NTypes = r.Read1b() v.FirstLevelName = r.Read1b() v.NLevelNames = r.Read1b() r.ReadPad(1) v.NRadioGroups = r.Read1b() v.NKeyAliases = r.Read1b() v.ChangedGroupNames = r.Read1b() v.ChangedVirtualMods = r.Read2b() v.FirstKey = x.Keycode(r.Read1b()) v.NKeys = r.Read1b() v.ChangedIndicators = r.Read4b() // 7 return nil } type CompatMapNotifyEvent struct { eventHeader ChangedGroup uint8 FirstSI uint16 NSI uint16 NTotalSI uint16 } func readCompatMapNotifyEvent(r *x.Reader, v *CompatMapNotifyEvent) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.ChangedGroup = r.Read1b() v.FirstSI = r.Read2b() // 3 v.NSI = r.Read2b() v.NTotalSI = r.Read2b() return nil } type BellNotifyEvent struct { eventHeader BellClass uint8 BellID uint8 Percent uint8 Pitch uint16 Duration uint16 Name x.Atom Window x.Window EventOnly bool } func readBellNotifyEvent(r *x.Reader, v *BellNotifyEvent) error { if !r.RemainAtLeast4b(7) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.BellClass = r.Read1b() v.BellID = r.Read1b() v.Percent = r.Read1b() // 3 v.Pitch = r.Read2b() v.Duration = r.Read2b() v.Name = x.Atom(r.Read4b()) v.Window = x.Window(r.Read4b()) v.EventOnly = r.ReadBool() // 7 return nil } type ActionMessageEvent struct { eventHeader Keycode x.Keycode Press bool KeyEventFollows bool Mods uint8 Group uint8 Message string } func readActionMessageEvent(r *x.Reader, v *ActionMessageEvent) error { if !r.RemainAtLeast(22) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.Keycode = x.Keycode(r.Read1b()) v.Press = r.ReadBool() v.KeyEventFollows = r.ReadBool() // 3 v.Mods = r.Read1b() v.Group = r.Read1b() msg := r.MustReadBytes(8) v.Message = bytesToStr(msg) // 22b return nil } type AccessXNotifyEvent struct { eventHeader Keycode x.Keycode Detail uint16 SlowKeysDelay uint16 DebounceDelay uint16 } func readAccessXNotifyEvent(r *x.Reader, v *AccessXNotifyEvent) error { if !r.RemainAtLeast4b(4) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) v.Keycode = x.Keycode(r.Read1b()) v.Detail = r.Read2b() // 3 v.SlowKeysDelay = r.Read2b() v.DebounceDelay = r.Read2b() // 4 return nil } type ExtensionDeviceNotifyEvent struct { eventHeader Reason uint16 LedClass uint16 LedID uint16 LedsDefined uint32 LedState uint32 FirstButton uint8 NButtons uint8 Supported uint16 Unsupported uint16 } func readExtensionDeviceNotifyEvent(r *x.Reader, v *ExtensionDeviceNotifyEvent) error { if !r.RemainAtLeast4b(8) { return x.ErrDataLenShort } readEventHeader(r, &v.eventHeader) r.ReadPad(1) v.Reason = r.Read2b() // 3 v.LedClass = r.Read2b() v.LedID = r.Read2b() v.LedsDefined = r.Read4b() v.LedState = r.Read4b() v.FirstButton = r.Read1b() v.NButtons = r.Read1b() v.Supported = r.Read2b() v.Unsupported = r.Read2b() // 8 return nil } go-x11-client-1.0.2/ext/xkb/xkb_req_auto.go000066400000000000000000000427151460713373000204150ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package xkb import x "github.com/linuxdeepin/go-x11-client" func UseExtension(conn *x.Conn, wantedMajor, wantedMinor uint16) UseExtensionCookie { body := encodeUseExtension(wantedMajor, wantedMinor) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: UseExtensionOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return UseExtensionCookie(seq) } func (cookie UseExtensionCookie) Reply(conn *x.Conn) (*UseExtensionReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply UseExtensionReply err = readUseExtensionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SelectEvents(conn *x.Conn, deviceSpec DeviceSpec, options ...SelectOption) { body := encodeSelectEvents(deviceSpec, options...) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectEventsOpcode, }, Body: body, } conn.SendRequest(0, req) } func SelectEventsChecked(conn *x.Conn, deviceSpec DeviceSpec, options ...SelectOption) x.VoidCookie { body := encodeSelectEvents(deviceSpec, options...) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SelectEventsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func Bell(conn *x.Conn, deviceSpec DeviceSpec, bellClass BellClassSpec, bellID IdSpec, percent int8, forceSound, eventOnly bool, pitch, duration int16, name x.Atom, window x.Window) { body := encodeBell(deviceSpec, bellClass, bellID, percent, forceSound, eventOnly, pitch, duration, name, window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: BellOpcode, }, Body: body, } conn.SendRequest(0, req) } func BellChecked(conn *x.Conn, deviceSpec DeviceSpec, bellClass BellClassSpec, bellID IdSpec, percent int8, forceSound, eventOnly bool, pitch, duration int16, name x.Atom, window x.Window) x.VoidCookie { body := encodeBell(deviceSpec, bellClass, bellID, percent, forceSound, eventOnly, pitch, duration, name, window) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: BellOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetState(conn *x.Conn, deviceSpec DeviceSpec) GetStateCookie { body := encodeGetState(deviceSpec) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetStateOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetStateCookie(seq) } func (cookie GetStateCookie) Reply(conn *x.Conn) (*GetStateReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetStateReply err = readGetStateReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func LatchLockState(conn *x.Conn, deviceSpec DeviceSpec, affectModLocks, modLocks uint8, lockGroup bool, groupLock, affectModLatches, modLatches uint8, latchGroup bool, groupLatch uint16) { body := encodeLatchLockState(deviceSpec, affectModLocks, modLocks, lockGroup, groupLock, affectModLatches, modLatches, latchGroup, groupLatch) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: LatchLockStateOpcode, }, Body: body, } conn.SendRequest(0, req) } func LatchLockStateChecked(conn *x.Conn, deviceSpec DeviceSpec, affectModLocks, modLocks uint8, lockGroup bool, groupLock, affectModLatches, modLatches uint8, latchGroup bool, groupLatch uint16) x.VoidCookie { body := encodeLatchLockState(deviceSpec, affectModLocks, modLocks, lockGroup, groupLock, affectModLatches, modLatches, latchGroup, groupLatch) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: LatchLockStateOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetControls(conn *x.Conn, deviceSpec DeviceSpec) GetControlsCookie { body := encodeGetControls(deviceSpec) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetControlsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetControlsCookie(seq) } func (cookie GetControlsCookie) Reply(conn *x.Conn) (*GetControlsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetControlsReply err = readGetControlsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetControls(conn *x.Conn, deviceSpec DeviceSpec, affectInternalRealMods, affectIgnoreLockRealMods uint8, affectInternalVirtualMods, affectIgnoreLockVirtualMods uint16, affectEnabledControls, changeControls uint32, c *Controls) { body := encodeSetControls(deviceSpec, affectInternalRealMods, affectIgnoreLockRealMods, affectInternalVirtualMods, affectIgnoreLockVirtualMods, affectEnabledControls, changeControls, c) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetControlsOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetControlsChecked(conn *x.Conn, deviceSpec DeviceSpec, affectInternalRealMods, affectIgnoreLockRealMods uint8, affectInternalVirtualMods, affectIgnoreLockVirtualMods uint16, affectEnabledControls, changeControls uint32, c *Controls) x.VoidCookie { body := encodeSetControls(deviceSpec, affectInternalRealMods, affectIgnoreLockRealMods, affectInternalVirtualMods, affectIgnoreLockVirtualMods, affectEnabledControls, changeControls, c) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetControlsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetMap(conn *x.Conn, deviceSpec DeviceSpec, full uint16, opt *GetMapPartOptions) GetMapCookie { body := encodeGetMap(deviceSpec, full, opt) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetMapCookie(seq) } func (cookie GetMapCookie) Reply(conn *x.Conn) (*GetMapReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetMapReply err = readGetMapReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetMap(conn *x.Conn, deviceSpec DeviceSpec, flags uint16, m *SetMapValue) { body := encodeSetMap(deviceSpec, flags, m) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetMapOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetMapChecked(conn *x.Conn, deviceSpec DeviceSpec, flags uint16, m *SetMapValue) x.VoidCookie { body := encodeSetMap(deviceSpec, flags, m) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetCompatMap(conn *x.Conn, deviceSpec DeviceSpec, groups uint8, getAllSI bool, firstSI, NSI uint16) GetCompatMapCookie { body := encodeGetCompatMap(deviceSpec, groups, getAllSI, firstSI, NSI) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetCompatMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetCompatMapCookie(seq) } func (cookie GetCompatMapCookie) Reply(conn *x.Conn) (*GetCompatMapReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetCompatMapReply err = readGetCompatMapReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetCompatMap(conn *x.Conn, deviceSpec DeviceSpec, v *SetCompatMapValue) { body := encodeSetCompatMap(deviceSpec, v) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCompatMapOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetCompatMapChecked(conn *x.Conn, deviceSpec DeviceSpec, v *SetCompatMapValue) x.VoidCookie { body := encodeSetCompatMap(deviceSpec, v) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetCompatMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetIndicatorState(conn *x.Conn, deviceSpec DeviceSpec) GetIndicatorStateCookie { body := encodeGetIndicatorState(deviceSpec) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetIndicatorStateOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetIndicatorStateCookie(seq) } func (cookie GetIndicatorStateCookie) Reply(conn *x.Conn) (*GetIndicatorStateReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetIndicatorStateReply err = readGetIndicatorStateReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetIndicatorMap(conn *x.Conn, deviceSpec DeviceSpec, which uint32) GetIndicatorMapCookie { body := encodeGetIndicatorMap(deviceSpec, which) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetIndicatorMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetIndicatorMapCookie(seq) } func (cookie GetIndicatorMapCookie) Reply(conn *x.Conn) (*GetIndicatorMapReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetIndicatorMapReply err = readGetIndicatorMapReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetIndicatorMap(conn *x.Conn, deviceSpec DeviceSpec, which uint32, maps []IndicatorMap) { body := encodeSetIndicatorMap(deviceSpec, which, maps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetIndicatorMapOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetIndicatorMapChecked(conn *x.Conn, deviceSpec DeviceSpec, which uint32, maps []IndicatorMap) x.VoidCookie { body := encodeSetIndicatorMap(deviceSpec, which, maps) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetIndicatorMapOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetNamedIndicator(conn *x.Conn, deviceSpec DeviceSpec, ledClass LedClassSpec, ledID IdSpec, indicator x.Atom) GetNamedIndicatorCookie { body := encodeGetNamedIndicator(deviceSpec, ledClass, ledID, indicator) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetNamedIndicatorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetNamedIndicatorCookie(seq) } func (cookie GetNamedIndicatorCookie) Reply(conn *x.Conn) (*GetNamedIndicatorReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetNamedIndicatorReply err = readGetNamedIndicatorReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetNamedIndicator(conn *x.Conn, deviceSpec DeviceSpec, ledClass LedClassSpec, ledID IdSpec, indicator x.Atom, setState, on, setMap, createMap bool, map0 *IndicatorMap) { body := encodeSetNamedIndicator(deviceSpec, ledClass, ledID, indicator, setState, on, setMap, createMap, map0) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetNamedIndicatorOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetNamedIndicatorChecked(conn *x.Conn, deviceSpec DeviceSpec, ledClass LedClassSpec, ledID IdSpec, indicator x.Atom, setState, on, setMap, createMap bool, map0 *IndicatorMap) x.VoidCookie { body := encodeSetNamedIndicator(deviceSpec, ledClass, ledID, indicator, setState, on, setMap, createMap, map0) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetNamedIndicatorOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func GetNames(conn *x.Conn, deviceSpec DeviceSpec, which uint32) GetNamesCookie { body := encodeGetNames(deviceSpec, which) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetNamesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetNamesCookie(seq) } func (cookie GetNamesCookie) Reply(conn *x.Conn) (*GetNamesReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetNamesReply err = readGetNamesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetNames(conn *x.Conn, r *SetNamesRequest) { body := encodeSetNames(r) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetNamesOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetNamesChecked(conn *x.Conn, r *SetNamesRequest) x.VoidCookie { body := encodeSetNames(r) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetNamesOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func PerClientFlags(conn *x.Conn, deviceSpec DeviceSpec, change, value, ctrlsToChange, autoCtrls, autoCtrlsValues uint32) PerClientFlagsCookie { body := encodePerClientFlags(deviceSpec, change, value, ctrlsToChange, autoCtrls, autoCtrlsValues) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: PerClientFlagsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return PerClientFlagsCookie(seq) } func (cookie PerClientFlagsCookie) Reply(conn *x.Conn) (*PerClientFlagsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply PerClientFlagsReply err = readPerClientFlagsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListComponents(conn *x.Conn, deviceSpec DeviceSpec, maxNames uint16, cn *ComponentNames) ListComponentsCookie { body := encodeListComponents(deviceSpec, maxNames, cn) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: ListComponentsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return ListComponentsCookie(seq) } func (cookie ListComponentsCookie) Reply(conn *x.Conn) (*ListComponentsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply ListComponentsReply err = readListComponentsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetDeviceInfo(conn *x.Conn, deviceSpec DeviceSpec, wanted uint16, allButtons bool, FirstButton, nButtons uint8, ledClass LedClassSpec, ledID IdSpec) GetDeviceInfoCookie { body := encodeGetDeviceInfo(deviceSpec, wanted, allButtons, FirstButton, nButtons, ledClass, ledID) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: GetDeviceInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return GetDeviceInfoCookie(seq) } func (cookie GetDeviceInfoCookie) Reply(conn *x.Conn) (*GetDeviceInfoReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply GetDeviceInfoReply err = readGetDeviceInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetDeviceInfo(conn *x.Conn, deviceSpec DeviceSpec, firstBtn uint8, change uint16, btnActions []Action, leds []DeviceLedInfo) { body := encodeSetDeviceInfo(deviceSpec, firstBtn, change, btnActions, leds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetDeviceInfoOpcode, }, Body: body, } conn.SendRequest(0, req) } func SetDeviceInfoChecked(conn *x.Conn, deviceSpec DeviceSpec, firstBtn uint8, change uint16, btnActions []Action, leds []DeviceLedInfo) x.VoidCookie { body := encodeSetDeviceInfo(deviceSpec, firstBtn, change, btnActions, leds) req := &x.ProtocolRequest{ Ext: _ext, NoReply: true, Header: x.RequestHeader{ Data: SetDeviceInfoOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return x.VoidCookie(seq) } func SetDebuggingFlags(conn *x.Conn, affectFlags, flags, affectCtrls, ctrls uint32, message string) SetDebuggingFlagsCookie { body := encodeSetDebuggingFlags(affectFlags, flags, affectCtrls, ctrls, message) req := &x.ProtocolRequest{ Ext: _ext, Header: x.RequestHeader{ Data: SetDebuggingFlagsOpcode, }, Body: body, } seq := conn.SendRequest(x.RequestChecked, req) return SetDebuggingFlagsCookie(seq) } func (cookie SetDebuggingFlagsCookie) Reply(conn *x.Conn) (*SetDebuggingFlagsReply, error) { replyBuf, err := conn.WaitForReply(x.SeqNum(cookie)) if err != nil { return nil, err } r := x.NewReaderFromData(replyBuf) var reply SetDebuggingFlagsReply err = readSetDebuggingFlagsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } go-x11-client-1.0.2/extension.go000066400000000000000000000060701460713373000163540ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "sync" ) type ReadErrorFunc func(*Reader) Error type lazyReplyTag uint const ( lazyNone lazyReplyTag = iota lazyCookie lazyForced ) type Extension struct { id int name string // extension-xname maxErrCode uint8 errCodeNameMap map[uint8]string reqOpcodeNameMap map[uint]string } func (ext *Extension) Name() string { return ext.name } var nextExtId = 1 // only call it in init() func func NewExtension(name string, maxErrCode uint8, errCodeNameMap map[uint8]string, reqOpcodeNameMap map[uint]string) *Extension { id := nextExtId nextExtId++ return &Extension{ id: id, name: name, maxErrCode: maxErrCode, errCodeNameMap: errCodeNameMap, reqOpcodeNameMap: reqOpcodeNameMap, } } type lazyReply struct { tag lazyReplyTag reply *QueryExtensionReply cookie QueryExtensionCookie } type extAndData struct { ext *Extension reply *lazyReply } type ext struct { mu sync.RWMutex extensions []extAndData } func (e *ext) grow(n int) { if n <= len(e.extensions) { return } logPrintf("ext grow %d -> %d\n", len(e.extensions), n) bigger := make([]extAndData, n) copy(bigger, e.extensions) e.extensions = bigger } func (e *ext) getById(id int) *extAndData { if id > len(e.extensions) { e.grow(id * 2) } return &e.extensions[id-1] } func (e *ext) getExtByMajorOpcode(majorOpcode uint8) *Extension { for _, extAndData := range e.extensions { ext := extAndData.ext lzr := extAndData.reply if ext != nil && lzr != nil && lzr.reply != nil { if majorOpcode == lzr.reply.MajorOpcode { return ext } } } return nil } func (e *ext) getExtErrName(errCode uint8) string { for _, extAndData := range e.extensions { ext := extAndData.ext lzr := extAndData.reply if ext != nil && lzr != nil && lzr.reply != nil { base := lzr.reply.FirstError max := lzr.reply.FirstError + ext.maxErrCode if base <= errCode && errCode <= max { return ext.errCodeNameMap[errCode-base] } } } return "" } func (e *ext) getLazyReply(conn *Conn, ext *Extension) (lzr *lazyReply) { extAndData := e.getById(ext.id) if extAndData.ext == nil { // init extAndData extAndData.ext = ext extAndData.reply = &lazyReply{tag: lazyNone} } lzr = extAndData.reply // lazyReply tag: lazyNone -> lazyCookie if lzr.tag == lazyNone { lzr.tag = lazyCookie lzr.cookie = QueryExtension(conn, ext.name) } return } func (e *ext) getExtData(c *Conn, ext *Extension) *QueryExtensionReply { lzr := e.getLazyReply(c, ext) // lazyReply tag: lazyCookie -> lazyForced if lzr.tag == lazyCookie { lzr.tag = lazyForced lzr.reply, _ = lzr.cookie.Reply(c) } return lzr.reply } func (c *Conn) GetExtensionData(ext *Extension) *QueryExtensionReply { c.ext.mu.Lock() data := c.ext.getExtData(c, ext) c.ext.mu.Unlock() return data } func (c *Conn) PrefetchExtensionData(ext *Extension) { c.ext.mu.Lock() c.ext.getLazyReply(c, ext) c.ext.mu.Unlock() } go-x11-client-1.0.2/gen.sh000077500000000000000000000044601460713373000151220ustar00rootroot00000000000000#!/bin/sh set -x set -e goClient='python2 tools/go_client.py' reqCodeGen=tools/gen/gen $goClient -o xproto_auto.go /usr/share/xcb/xproto.xml env GOPACKAGE=x $reqCodeGen xproto.go > xproto_auto_req.go $goClient -o ext/record/auto.go /usr/share/xcb/record.xml env GOPACKAGE=record $reqCodeGen -e ext/record/record.go > ext/record/record_req_auto.go $goClient -o ext/test/auto.go /usr/share/xcb/xtest.xml env GOPACKAGE=test $reqCodeGen -e ext/test/test.go > ext/test/test_req_auto.go $goClient -o ext/damage/auto.go /usr/share/xcb/damage.xml env GOPACKAGE=damage $reqCodeGen -e ext/damage/damage.go > ext/damage/damage_req_auto.go $goClient -o ext/composite/auto.go /usr/share/xcb/composite.xml env GOPACKAGE=composite $reqCodeGen -e ext/composite/composite.go > ext/composite/composite_req_auto.go $goClient -o ext/screensaver/auto.go /usr/share/xcb/screensaver.xml env GOPACKAGE=screensaver $reqCodeGen -e ext/screensaver/screensaver.go > ext/screensaver/screensaver_req_auto.go $goClient -o ext/dpms/auto.go /usr/share/xcb/dpms.xml env GOPACKAGE=dpms $reqCodeGen -e ext/dpms/dpms.go > ext/dpms/dpms_req_auto.go $goClient -o ext/randr/auto.go /usr/share/xcb/randr.xml env GOPACKAGE=randr $reqCodeGen -e -extra-exts render ext/randr/randr.go > ext/randr/randr_req_auto.go $goClient -o ext/xfixes/auto.go /usr/share/xcb/xfixes.xml env GOPACKAGE=xfixes $reqCodeGen -e ext/xfixes/xfixes.go > ext/xfixes/xfixes_req_auto.go $goClient -o ext/input/auto.go /usr/share/xcb/xinput.xml env GOPACKAGE=input $reqCodeGen -e ext/input/input.go > ext/input/input_req_auto.go env GOPACKAGE=input $reqCodeGen -e ext/input/input1.go > ext/input/input1_req_auto.go $goClient -p ge -o ext/ge/auto.go /usr/share/xcb/ge.xml env GOPACKAGE=ge $reqCodeGen -e ext/ge/ge.go > ext/ge/ge_req_auto.go $goClient -o ext/render/auto.go /usr/share/xcb/render.xml env GOPACKAGE=render $reqCodeGen -e ext/render/render.go > ext/render/render_req_auto.go $goClient -o ext/shm/auto.go /usr/share/xcb/shm.xml env GOPACKAGE=shm $reqCodeGen -e ext/shm/shm.go > ext/shm/shm_req_auto.go $goClient -o ext/bigrequests/auto.go /usr/share/xcb/bigreq.xml env GOPACKAGE=bigrequests $reqCodeGen -e ext/bigrequests/bigreq.go > ext/bigrequests/bigreq_req_auto.go $goClient -o ext/xkb/auto.go /usr/share/xcb/xkb.xml env GOPACKAGE=xkb $reqCodeGen -e ext/xkb/xkb.go > ext/xkb/xkb_req_auto.go go-x11-client-1.0.2/help.go000066400000000000000000000061651460713373000152750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x /* help.go is meant to contain a rough hodge podge of functions that are mainly used in the auto generated code. Indeed, several functions here are simple wrappers so that the sub-packages don't need to be smart about which stdlib packages to import. Also, the 'Get..' and 'Put..' functions are used through the core xgb package too. (xgbutil uses them too.) */ import ( "fmt" //"github.com/gavv/monotime" "strings" ) //func GetServerCurrentTime() Timestamp { // now := monotime.Now() // ns := now.Nanoseconds() // return Timestamp(ns / 1e6) //} // StringsJoin is an alias to strings.Join. It allows us to avoid having to // import 'strings' in each of the generated Go files. func StringsJoin(ss []string, sep string) string { return strings.Join(ss, sep) } // Sprintf is so we don't need to import 'fmt' in the generated Go files. func Sprintf(format string, v ...interface{}) string { return fmt.Sprintf(format, v...) } // Errorf is just a wrapper for fmt.Errorf. Exists for the same reason // that 'stringsJoin' and 'sprintf' exists. func Errorf(format string, v ...interface{}) error { return fmt.Errorf(format, v...) } func Pad(e int) int { // pad(E) = (4 - (E mod 4)) mod 4 return (4 - (e % 4)) % 4 } // PopCount counts the number of bits set in a value list mask. func PopCount(mask0 int) int { mask := uint32(mask0) n := 0 for i := uint32(0); i < 32; i++ { if mask&(1<> 8) } // Put32 takes a 32 bit integer and copies it into a byte slice. func Put32(buf []byte, v uint32) { buf[0] = byte(v) buf[1] = byte(v >> 8) buf[2] = byte(v >> 16) buf[3] = byte(v >> 24) } // Put64 takes a 64 bit integer and copies it into a byte slice. func Put64(buf []byte, v uint64) { buf[0] = byte(v) buf[1] = byte(v >> 8) buf[2] = byte(v >> 16) buf[3] = byte(v >> 24) buf[4] = byte(v >> 32) buf[5] = byte(v >> 40) buf[6] = byte(v >> 48) buf[7] = byte(v >> 56) } // Get16 constructs a 16 bit integer from the beginning of a byte slice. func Get16(buf []byte) uint16 { v := uint16(buf[0]) v |= uint16(buf[1]) << 8 return v } // Get32 constructs a 32 bit integer from the beginning of a byte slice. func Get32(buf []byte) uint32 { v := uint32(buf[0]) v |= uint32(buf[1]) << 8 v |= uint32(buf[2]) << 16 v |= uint32(buf[3]) << 24 return v } // Get64 constructs a 64 bit integer from the beginning of a byte slice. func Get64(buf []byte) uint64 { v := uint64(buf[0]) v |= uint64(buf[1]) << 8 v |= uint64(buf[2]) << 16 v |= uint64(buf[3]) << 24 v |= uint64(buf[4]) << 32 v |= uint64(buf[5]) << 40 v |= uint64(buf[6]) << 48 v |= uint64(buf[7]) << 56 return v } func BoolToUint8(b bool) uint8 { if b { return 1 } return 0 } func Uint8ToBool(v uint8) bool { return v != 0 } func TruncateStr(s string, n int) string { if len(s) > n { return s[:n] } return s } go-x11-client-1.0.2/in.go000066400000000000000000000104131460713373000147420ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "container/list" "fmt" "os" "sync" ) type in struct { requestExpected SeqNum requestRead SeqNum requestCompleted SeqNum currentReply *list.List replies map[SeqNum]*list.List pendingReplies *list.List readers *list.List events *list.List eventsCond *sync.Cond eventChans []chan<- GenericEvent chansMu sync.Mutex } func (in *in) init(ioMu *sync.Mutex) { in.replies = make(map[SeqNum]*list.List) in.pendingReplies = list.New() in.readers = list.New() in.events = list.New() in.eventsCond = sync.NewCond(ioMu) } func (in *in) addEventChan(eventChan chan<- GenericEvent) { in.chansMu.Lock() for _, ch := range in.eventChans { if ch == eventChan { // exist in.chansMu.Unlock() return } } // COW newEventChans := make([]chan<- GenericEvent, len(in.eventChans)+1) copy(newEventChans, in.eventChans) newEventChans[len(newEventChans)-1] = eventChan in.eventChans = newEventChans in.chansMu.Unlock() } func (in *in) removeEventChan(eventChan chan<- GenericEvent) { in.chansMu.Lock() chans := in.eventChans var found bool for _, ch := range chans { if ch == eventChan { found = true break } } if !found { // not found in.chansMu.Unlock() return } // COW newEventChans := make([]chan<- GenericEvent, 0, len(in.eventChans)-1) for _, ch := range chans { if ch != eventChan { newEventChans = append(newEventChans, ch) } } in.eventChans = newEventChans in.chansMu.Unlock() } func (in *in) addEvent(e GenericEvent) { logPrintln("add event", e) if in.events.Len() > 0xfff { _, _ = fmt.Fprintf(os.Stderr, " too many events are not processed, len: %d\n", in.events.Len()) } in.events.PushBack(e) in.eventsCond.Signal() } func (in *in) sendEvent(e GenericEvent) { in.chansMu.Lock() eventChans := in.eventChans in.chansMu.Unlock() for _, ch := range eventChans { ch <- e } } func (in *in) closeEventChans() { in.chansMu.Lock() for _, ch := range in.eventChans { close(ch) } in.chansMu.Unlock() } type ReplyReader struct { request SeqNum cond *sync.Cond } func (in *in) insertNewReader(request SeqNum, cond *sync.Cond) *ReplyReader { r := &ReplyReader{ request: request, cond: cond, } var mark *list.Element l := in.readers for e := l.Front(); e != nil; e = e.Next() { reader := e.Value.(*ReplyReader) if reader.request >= request { mark = e break } } if mark != nil { logPrintf("insertNewReader %d before %d\n", request, mark.Value.(*ReplyReader).request) l.InsertBefore(r, mark) } else { logPrintf("insertNewReader %d at end\n", request) l.PushBack(r) } return r } func (in *in) removeReader(r *ReplyReader) { l := in.readers for e := l.Front(); e != nil; e = e.Next() { reader := e.Value.(*ReplyReader) if reader.request == r.request { logPrintln("remove reader", reader.request) l.Remove(e) break } } } func (in *in) removeFinishedReaders() { l := in.readers e := l.Front() for e != nil { reader := e.Value.(*ReplyReader) if reader.request <= in.requestCompleted { reader.cond.Signal() logPrintln("remove finished reader", reader.request) tmp := e e = e.Next() l.Remove(tmp) } else { break } } } func (in *in) wakeUpAllReaders() { l := in.readers for e := l.Front(); e != nil; e = e.Next() { reader := e.Value.(*ReplyReader) reader.cond.Signal() } } func (in *in) wakeUpNextReader() { if in.readers.Front() != nil { reader := in.readers.Front().Value.(*ReplyReader) logPrintln("wake up next reader", reader.request) reader.cond.Signal() } } type PendingReply struct { firstRequest SeqNum lastRequest SeqNum workaround uint flags uint } func (in *in) expectReply(request SeqNum, workaround uint, flags uint) { pend := &PendingReply{ firstRequest: request, lastRequest: request, workaround: workaround, flags: flags, } in.pendingReplies.PushBack(pend) } func (in *in) removeFinishedPendingReplies() { l := in.pendingReplies e := l.Front() for e != nil { pend := e.Value.(*PendingReply) if pend.lastRequest <= in.requestCompleted { // remove pend from list tmp := e e = e.Next() l.Remove(tmp) } else { break } } } go-x11-client-1.0.2/reader.go000066400000000000000000000046761460713373000156140ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "bytes" "errors" ) var ErrDataLenShort = errors.New("data length is short") type Reader struct { pos int data []byte } func NewReaderFromData(data []byte) *Reader { return &Reader{ data: data, } } func (r *Reader) Pos() int { return r.pos } func (r *Reader) Read1b() uint8 { v := r.data[r.pos] r.pos++ return v } func (r *Reader) Read2b() uint16 { v := uint16(r.data[r.pos]) v |= uint16(r.data[r.pos+1]) << 8 r.pos += 2 return v } func (r *Reader) Read4b() uint32 { v := uint32(r.data[r.pos]) v |= uint32(r.data[r.pos+1]) << 8 v |= uint32(r.data[r.pos+2]) << 16 v |= uint32(r.data[r.pos+3]) << 24 r.pos += 4 return v } func (r *Reader) MustReadBytes(n int) []byte { v := r.data[r.pos : r.pos+n] r.pos += n return v } func (r *Reader) ReadBytes(n int) ([]byte, error) { if !r.RemainAtLeast(n) { return nil, ErrDataLenShort } v := r.data[r.pos : r.pos+n] r.pos += n return v, nil } func (r *Reader) ReadBytesWithPad(n int) ([]byte, error) { total := n + Pad(n) if !r.RemainAtLeast(total) { return nil, ErrDataLenShort } v := r.data[r.pos : r.pos+n] r.pos += total return v, nil } func (r *Reader) ReadString(n int) (string, error) { v, err := r.ReadBytes(n) if err != nil { return "", err } return string(v), nil } func (r *Reader) ReadStrWithPad(n int) (string, error) { v, err := r.ReadBytesWithPad(n) if err != nil { return "", err } return string(v), nil } func (r *Reader) ReadNulTermStr() string { idx := bytes.IndexByte(r.data[r.pos:], 0) var v []byte if idx == -1 { v = r.data[r.pos:] r.pos = len(r.data) } else { v = r.data[r.pos : r.pos+idx] r.pos += idx } return string(v) } func (r *Reader) ReadBool() bool { return Uint8ToBool(r.Read1b()) } func (r *Reader) ReadPad(n int) { if r.pos+n > len(r.data) { panic("index out of range") } r.pos += n } func (r *Reader) Reset() { r.pos = 0 } func (r *Reader) RemainAtLeast(n int) bool { return r.pos+n <= len(r.data) } func (r *Reader) RemainAtLeast4b(n int) bool { return r.RemainAtLeast(n << 2) } func (r *Reader) ReadReplyHeader() (data uint8, length uint32) { r.ReadPad(1) data = r.Read1b() // seq r.ReadPad(2) // length length = r.Read4b() // 2 return } func (r *Reader) ReadEventHeader() (data uint8, seq uint16) { r.ReadPad(1) data = r.Read1b() // seq seq = r.Read2b() // 1 return } go-x11-client-1.0.2/reader_test.go000066400000000000000000000040551460713373000166420ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "testing" . "gopkg.in/check.v1" ) // Hook up gocheck into the "go test" runner. func Test(t *testing.T) { TestingT(t) } type MySuite struct { r *Reader } var _ = Suite(&MySuite{}) func (s *MySuite) SetUpTest(c *C) { buf := []byte{1, 2, 3, 4, 5, 6, 7, 8} s.r = NewReaderFromData(buf) } func (s *MySuite) TestReaderReadBytes(c *C) { v, err := s.r.ReadBytes(4) c.Assert(v, DeepEquals, []byte{1, 2, 3, 4}) c.Assert(err, IsNil) v, err = s.r.ReadBytes(3) c.Assert(v, DeepEquals, []byte{5, 6, 7}) c.Assert(err, IsNil) } func (s *MySuite) TestReaderReadBytesWithPad(c *C) { v, err := s.r.ReadBytesWithPad(3) c.Assert(v, DeepEquals, []byte{1, 2, 3}) c.Assert(s.r.Pos(), Equals, 4) c.Assert(err, IsNil) } func (s *MySuite) TestReaderRead1b(c *C) { for i := 1; i <= 8; i++ { c.Assert(s.r.Read1b(), Equals, uint8(i)) } } func (s *MySuite) TestReaderRead2b(c *C) { results := []uint16{0x0201, 0x0403, 0x0605, 0x0807} for _, result := range results { c.Assert(s.r.Read2b(), Equals, result) } } func (s *MySuite) TestReaderRead4b(c *C) { results := []uint32{0x04030201, 0x08070605} for _, result := range results { c.Assert(s.r.Read4b(), Equals, result) } } func (s *MySuite) TestReaderReadNulTermStr(c *C) { data := []byte{'h', 'e', 'l', 'l', 'o'} r := NewReaderFromData(data) str := r.ReadNulTermStr() c.Assert(str, Equals, "hello") c.Assert(r.Pos(), Equals, 5) data = []byte{'h', 'e', 'l', 'l', 'o', 0, 'w', 'o', 'r', 'l', 'd'} r = NewReaderFromData(data) str = r.ReadNulTermStr() c.Assert(str, Equals, "hello") c.Assert(r.Pos(), Equals, 5) } func (s *MySuite) TestReaderRemainAtLeast(c *C) { s.r.ReadPad(3) c.Assert(s.r.RemainAtLeast(5), Equals, true) c.Assert(s.r.RemainAtLeast(6), Equals, false) s.r.Reset() c.Assert(s.r.RemainAtLeast4b(0), Equals, true) c.Assert(s.r.RemainAtLeast4b(1), Equals, true) c.Assert(s.r.RemainAtLeast4b(2), Equals, true) c.Assert(s.r.RemainAtLeast4b(3), Equals, false) } go-x11-client-1.0.2/resource_id.go000066400000000000000000000032661460713373000166470ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "errors" "math/big" "sync" ) func (c *Conn) AllocID() (uint32, error) { return c.ridAllocator.alloc() } func (c *Conn) FreeID(rid uint32) error { return c.ridAllocator.free(rid) } func (c *Conn) IDUsedCount() int { return c.ridAllocator.usedCount() } type resourceIdAllocator struct { mu sync.Mutex base uint32 mask uint32 last uint32 bitmap *big.Int allAllocated bool } func (ra *resourceIdAllocator) init(base, mask uint32) { ra.base = base ra.mask = mask ra.bitmap = big.NewInt(0) } var errOutOfResourceIds = errors.New("out of resource ids") func (ra *resourceIdAllocator) alloc() (uint32, error) { ra.mu.Lock() defer ra.mu.Unlock() if ra.allAllocated { return 0, errOutOfResourceIds } i := ra.last for ra.bitmap.Bit(int(i)) == 1 { i++ if i > ra.mask { i = 0 } if i == ra.last { ra.allAllocated = true return 0, errOutOfResourceIds } } ra.bitmap.SetBit(ra.bitmap, int(i), 1) ra.last = i return ra.base | i, nil } func (ra *resourceIdAllocator) free(rid uint32) error { ra.mu.Lock() defer ra.mu.Unlock() i := rid & ra.mask if rid-i != ra.base { return errors.New("resource id outside range") } if ra.bitmap.Bit(int(i)) == 0 { return errors.New("resource id not used") } ra.bitmap.SetBit(ra.bitmap, int(i), 0) ra.allAllocated = false return nil } func (ra *resourceIdAllocator) usedCount() int { ra.mu.Lock() count := 0 bitLen := ra.bitmap.BitLen() for i := 0; i < bitLen; i++ { if ra.bitmap.Bit(i) == 1 { count++ } } ra.mu.Unlock() return count } go-x11-client-1.0.2/rpm/000077500000000000000000000000001460713373000146045ustar00rootroot00000000000000go-x11-client-1.0.2/rpm/golang-github-linuxdeepin-go-x11-client.spec000066400000000000000000000025051460713373000250210ustar00rootroot00000000000000# Run tests in check section # disable for bootstrapping %bcond_with check %global with_debug 1 %if 0%{?with_debug} %global debug_package %{nil} %endif %global provider github %global provider_tld com %global project linuxdeepin %global repo go-x11-client %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo} %global import_path %{provider_prefix} Name: golang-github-linuxdeepin-go-x11-client Version: 0.6.7 Release: 1 Summary: A X11 client Go bindings for Deepin Desktop Environment License: GPLv3 URL: %{gourl} Source0: %{name}_%{version}.orig.tar.xz BuildRequires: compiler(go-compiler) %description %{summary}. %package devel Summary: %{summary} BuildArch: noarch BuildRequires: gocode %description devel %{summary}. %prep %forgeautosetup %install install -d -p %{buildroot}/%{gopath}/src/%{import_path}/ for file in $(find . -iname "*.go") ; do install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file) cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list done %files devel -f devel.file-list %doc README %license LICENSE %changelog * Thu Mar 19 2021 uoser - 0.6.7-1 - Update to 0.6.7 go-x11-client-1.0.2/tools/000077500000000000000000000000001460713373000151465ustar00rootroot00000000000000go-x11-client-1.0.2/tools/common.py000066400000000000000000000172101460713373000170110ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: GPL-3.0-or-later import re _no_import_x = True _ns = None _lines = [] _level = 0 _cname_re = re.compile('([A-Z0-9][a-z]+|[A-Z0-9]+(?![a-z])|[a-z]+)') _cname_special_cases = { # names in xproto.xml 'GCONTEXT': 'GContext', 'VISUALID': 'VisualID', 'VISUALTYPE': 'VisualType', 'RGB': 'RGB', 'FONTPROP': 'FontProp', 'CHARINFO': 'CharInfo', 'TIMECOORD': 'TimeCoord', 'COLORITEM': 'ColorItem', 'DECnet': 'DECnet', # in render.xml 'GLYPHSET': 'GlyphSet', 'PICTFORMAT': 'PictFormat', 'DIRECTFORMAT': 'DirectFormat', 'PICTFORMINFO': 'PictFormInfo', 'PICTVISUAL': 'PictVisual', 'PICTDEPTH': 'PictDepth', 'PICTSCREEN': 'PictScreen', 'INDEXVALUE': 'IndexValue', 'POINTFIX': 'PointFix', 'LINEFIX': 'LineFix', 'GLYPHINFO': 'GlyphInfo', 'ANIMCURSORELT': 'AnimCursorElt', 'SPANFIX': 'SpanFix', } _simple_type_map = { 'uint8_t': 'uint8', 'uint16_t': 'uint16', 'uint32_t': 'uint32', 'uint64_t': 'uint64', 'int8_t': 'int8', 'int16_t': 'int16', 'int32_t': 'int32', 'int64_t': 'int64', 'char': 'byte', # []byte => string 'float': 'float32', 'double': 'float64', } # readonly # ingore bigreq _ext_names = ['Shm', 'XF86Dri', 'RandR', 'Xv', 'DPMS', 'Xinerama', 'Test', 'XCMisc', 'Res', 'XvMC', 'Composite', 'ScreenSaver', 'SELinux', 'XF86VidMode', 'Present', 'DRI3', 'Input', 'GenericEvent', 'Render', 'Xevie', 'XFixes', 'Glx', 'Sync', 'XPrint', 'Shape', 'xkb', 'Damage', 'DRI2', 'Record' ] # xml filename => go pkg name # if the value is '-', it means that the value is equal to the key _ext_header_pkgname_map = { 'composite': '-', 'damage': '-', 'dpms': '-', 'dri2': '-', 'dri3': '-', 'ge': 'genericevent', 'glx': '-', 'present': '-', 'randr': '-', 'record': '-', 'render': '-', 'res': '-', 'screensaver': '-', 'shape': '-', 'shm': '-', 'sync': '-', 'xc_misc': 'xcmisc', 'xevie': '-', 'xf86dir': '-', 'xf86vidmode': '-', 'xfixes': '-', 'xinerama': '-', 'xinput': 'input', 'xkb': '-', 'xprint': '-', 'xselinux': 'selinux', 'xtest': 'test', 'xv': '-', 'xvmc': '-', } def is_int(x): try: int(x) return True except: return False def l(fmt, *args): _lines[_level].append(fmt % args) def todo(msg=''): l('// TODO %s', msg) def set_level(idx): global _level while len(_lines) <= idx: _lines.append([]) _level = idx def output_lines(fh): for list in _lines: for line in list: fh.write(line) fh.write('\n') fh.close() def set_namespace(val): global _ns _ns = val def get_namespace(): global _ns return _ns def set_no_import_x(val): global _no_import_x _no_import_x = val def lib_id(_id): global _no_import_x if _no_import_x: return _id else: return "x." + _id def get_type_name(name): # type of name is tuple of str if len(name) == 1: # uintX intX return _simple_type_map.get(name[0], name[0]) pkg_name, name = split_pkg_and_type(name) type_name = ''.join([n_item(x) for x in name]) # check result assert type_name[0].isupper() global _ns if _ns.is_ext and pkg_name != '' and pkg_name != get_go_pkg_name(_ns.ext_name): # add pkg ident type_name = pkg_name + '.' + type_name return type_name def split_pkg_and_type(name): assert len(name) >= 2 if len(name) == 2 : # ex. xcb COLORMAP assert name[0] == 'xcb' return ('x', name[1:]) elif len(name) >= 3: assert name[0] == 'xcb' global _ns global _ext_names if name[1] == _ns.ext_name or name[1] in _ext_names: # name[1] is ext name # ex. xcb RandR ScreenSize return (get_go_pkg_name(name[1]), name[2:]) else: # ex. xcb CreateWindow ValueList return ('x', name[1:]) # go pkg name is _ns.ext_name.lower() def get_go_pkg_name(ext_name): # TODO adjust package name return ext_name.lower() def header_to_go_pkg_name(header): global _ext_header_pkgname_map pkg_name = _ext_header_pkgname_map[header] if pkg_name == '-': pkg_name = header return pkg_name def remove_prefix(name): # remove xcb if name[0] == 'xcb': name = name[1:] # remove ext name if _ns.is_ext and name[0] == _ns.ext_name: name = name[1:] return name def split_name(str): split = _cname_re.finditer(str) name_parts = [match.group(0) for match in split] return name_parts # value_list => value, list => ValueList # CreateWindow => Create, Window => CreateWindow def n_item(str): ''' Does C-name conversion on a single string fragment. Uses a regexp with some hard-coded special cases. ''' if str in _cname_special_cases: return _cname_special_cases[str] else: split = _cname_re.finditer(str) name_parts = [match.group(0) for match in split] return ''.join([x.title() for x in name_parts]) def get_request_name(name): # print "get_request_name, name:", name name = remove_prefix(name) req_name = ''.join(name) if not req_name[0].isupper(): raise Exception('first char of request name is not upper case') return req_name # field_name_test => FieldNameTest def get_field_name(name): if name is None: return '' return ''.join([x.title() for x in name.split('_')]) class FieldClassifyModel(): def do(self, field): if field.type.is_pad: # pad if field.type.fixed_size(): return self.pad_FS(field) else: return self.pad_VS(field) elif field.type.is_simple: # simple return self.simple(field) elif field.type.is_container: # containter if field.type.fixed_size(): return self.container_FS(field) else: return self.container_VS(field) elif field.type.is_list: # list if field.type.nmemb is None: # VL if field.type.member.fixed_size(): # MFS return self.list_VL_MFS(field) else: # MVS return self.list_VL_MVS(field) else: # CL if field.type.member.fixed_size(): #MFS return self.list_CL_MFS(field) else: #MVS return self.list_CL_MVS(field) def pad_FS(self, field): raise Exception('abstract method not overridden!') def pad_VS(self, field): raise Exception('abstract method not overridden!') def simple(self, field): raise Exception('abstract method not overridden!') def container_FS(self, field): raise Exception('abstract method not overridden!') def container_VS(self, field): raise Exception('abstract method not overridden!') def list_CL_MFS(self, field): raise Exception('abstract method not overridden!') def list_CL_MVS(self, field): raise Exception('abstract method not overridden!') def list_VL_MFS(self, field): raise Exception('abstract method not overridden!') def list_VL_MVS(self, field): raise Exception('abstract method not overridden!') go-x11-client-1.0.2/tools/enum.py000066400000000000000000000060761460713373000164750ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: GPL-3.0-or-later from common import * _enum_to_str_list = [ # xproto.xml ('xcb', 'VisualClass'), ('xcb', 'EventMask'), ('xcb', 'BackingStore'), ('xcb', 'ImageOrder'), ('xcb', 'ModMask'), ('xcb', 'ButtonMask'), ('xcb', 'KeyButMask'), ('xcb', 'Motion'), ('xcb', 'NotifyDetail'), ('xcb', 'NotifyMode'), ('xcb', 'Visibility'), ('xcb', 'Place'), ('xcb', 'ColormapState'), ('xcb', 'Mapping'), ('xcb', 'WindowClass'), ('xcb', 'Gravity'), ('xcb', 'MapState'), ('xcb', 'ConfigWindow'), ('xcb', 'GrabStatus'), ('xcb', 'FontDraw'), ('xcb', 'StackMode'), ('xcb', 'Blanking'), ('xcb', 'Exposures'), ('xcb', 'MappingStatus'), # TODO # screensaver.xml ('xcb', 'ScreenSaver', 'Kind'), ('xcb', 'ScreenSaver', 'State'), ] def get_enum_prefix(name): pkg_name, name = split_pkg_and_type(name) # check result enum_prefix = ''.join(name) assert enum_prefix[0].isupper() _ns = get_namespace() if _ns.is_ext and pkg_name != '' and pkg_name != get_go_pkg_name(_ns.ext_name): # add pkg ident enum_prefix = pkg_name + '.' + enum_prefix return enum_prefix _cname_special_cases = { 'VISUALID': 'VisualID', } _item_name_special_list = [ # xproto.xml 'YX', 'XY', 'DE', 'RGB', 'LSB', 'MSB', 'WM', # render.xml 'BGR', 'HSL', ] def get_enum_item_name(name): if name in _cname_special_cases: return _cname_special_cases[name] name_parts = split_name(name) result = [] for x in name_parts: if x in _item_name_special_list: result.append(x) else: result.append(x.title()) return ''.join(result) def define_go_enum_to_string_func(prefix, self): if len(self.values) < 2: return if not self.name in _enum_to_str_list: return l('\nfunc %sEnumToStr(v int) string {', prefix) if len(self.bits) > 0: l('strv := []string{}') l('switch {') for (item_name, val) in self.values: val = int(val) if val == 0: continue l('case v & %s%s > 0:', prefix, item_name) l(' strv = append(strv, "%s")', item_name) l('}') # end switch l('return "[" + strings.Join(strv, "|") + "]"') else: items = dict() # key is val, value is list of item_name for (item_name, val) in self.values: val = int(val) if val in items: items[val].append(item_name) # items[val] = items[val].append(item_name) else: items[val] = [ item_name ] l('switch v {') for k in sorted(items.keys()): l('case %d:', k) l(' return "%s"', ' or '.join(items[k])) # case default l('default:') l('return ""') l('}') # end switch l('}') # end func go-x11-client-1.0.2/tools/gen/000077500000000000000000000000001460713373000157175ustar00rootroot00000000000000go-x11-client-1.0.2/tools/gen/main.go000066400000000000000000000134731460713373000172020ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package main import ( "bytes" "flag" "fmt" "go/ast" "go/format" "go/parser" "go/printer" "go/token" "log" "os" "strings" "github.com/linuxdeepin/go-lib/strv" ) var optIsExt bool var optExtraExts string func init() { flag.BoolVar(&optIsExt, "e", false, "is ext") flag.StringVar(&optExtraExts, "extra-exts", "", "") } var xPrefix string func astNodeToStr(fileSet *token.FileSet, node interface{}) (string, error) { var buf bytes.Buffer err := printer.Fprint(&buf, fileSet, node) if err != nil { return "", err } return buf.String(), nil } type Generator struct { buf bytes.Buffer } func (g *Generator) p(format string, args ...interface{}) { _, err := fmt.Fprintf(&g.buf, format, args...) if err != nil { log.Fatal(err) } } func (g *Generator) format() []byte { src, err := format.Source(g.buf.Bytes()) if err != nil { log.Println("warning: internal error: invalid Go generated:", err) return g.buf.Bytes() } return src } type requestFunc struct { name string encodeFuncName string encodeFuncArgs string args string noReply bool } func main() { log.SetFlags(log.Lshortfile) goPackage := os.Getenv("GOPACKAGE") log.Println(goPackage) // parse file if goPackage != "x" { xPrefix = "x." } fs := token.NewFileSet() flag.Parse() name := flag.Arg(0) f, err := parser.ParseFile(fs, name, nil, parser.ParseComments) if err != nil { log.Fatal(err) } var requestFuncs []*requestFunc var hasReplyRequests strv.Strv ast.Inspect(f, func(node ast.Node) bool { funcDel, ok := node.(*ast.FuncDecl) if !ok { return true } if funcDel.Recv != nil { // is method return false } funcName := funcDel.Name.Name if strings.HasPrefix(funcName, "encode") { docText := funcDel.Doc.Text() if !strings.Contains(docText, "#WREQ") { return false } wreqOption := strings.TrimSpace(strings.TrimPrefix(docText, "#WREQ")) wreqOptions := strings.Split(wreqOption, " ") var varargs []string for _, value := range wreqOptions { if strings.HasPrefix(value, "vararg:") { varargs = append(varargs, value[len("vararg:"):]) } } params := funcDel.Type.Params.List var args []string var encodeFuncArgs []string for _, param := range params { log.Println(param.Names) var paramNames []string for _, name := range param.Names { paramNames = append(paramNames, name.Name) } typeStr, err := astNodeToStr(fs, param.Type) if err != nil { log.Fatal(err) } argNamesType := strings.Join(paramNames, ",") + " " + typeStr args = append(args, argNamesType) for _, value := range paramNames { if strv.Strv(varargs).Contains(value) { value = "options..." } encodeFuncArgs = append(encodeFuncArgs, value) } } requestFuncs = append(requestFuncs, &requestFunc{ encodeFuncName: funcName, encodeFuncArgs: strings.Join(encodeFuncArgs, ","), name: strings.TrimPrefix(funcName, "encode"), args: strings.Join(args, ","), }) } else if strings.HasPrefix(funcName, "read") && strings.HasSuffix(funcName, "Reply") { reqName := strings.TrimPrefix(funcName, "read") reqName = strings.TrimSuffix(reqName, "Reply") hasReplyRequests = append(hasReplyRequests, reqName) } return false }) log.Println(hasReplyRequests) for _, reqFunc := range requestFuncs { if !hasReplyRequests.Contains(reqFunc.name) { reqFunc.noReply = true } } //spew.Dump(requestFuncs) g := &Generator{} g.p("package %s\n", goPackage) const pkgPathBase = "github.com/linuxdeepin/go-x11-client" if goPackage != "x" { g.p("import x \"%s\"\n", pkgPathBase) } extraExts := strings.Split(optExtraExts, ",") for _, e := range extraExts { if e == "" { continue } g.p("import \"%s/ext/%s\"\n", pkgPathBase, e) } for _, reqFunc := range requestFuncs { if reqFunc.noReply { g.pRequestFunc(reqFunc, false) g.pRequestFunc(reqFunc, true) } else { g.pRequestFunc(reqFunc, true) // cookie Reply method g.p("\nfunc (cookie %sCookie) Reply(conn *%sConn) (*%sReply, error) {\n", reqFunc.name, xPrefix, reqFunc.name) g.p(`replyBuf, err := conn.WaitForReply(%sSeqNum(cookie)) if err != nil { return nil, err } r := %sNewReaderFromData(replyBuf) var reply %sReply err = read%sReply(r, &reply) if err != nil { return nil, err } return &reply, nil } `, xPrefix, xPrefix, reqFunc.name, reqFunc.name) } } _, err = os.Stdout.Write(g.format()) if err != nil { log.Fatal(err) } } func (g *Generator) pRequestFunc(reqFunc *requestFunc, check bool) { returnType := xPrefix + "VoidCookie" if !reqFunc.noReply { // has reply returnType = reqFunc.name + "Cookie" } else if !check { // no reply + no check returnType = "" } funcName := reqFunc.name sendReqFlag := "0" if check { sendReqFlag = xPrefix + "RequestChecked" } if reqFunc.noReply && check { funcName += "Checked" } g.p("\nfunc %s(conn *%sConn, %s) %s {\n", funcName, xPrefix, reqFunc.args, returnType) if optIsExt { g.p("body := %s(%s)\n", reqFunc.encodeFuncName, reqFunc.encodeFuncArgs) } else { g.p("headerData, body := %s(%s)\n", reqFunc.encodeFuncName, reqFunc.encodeFuncArgs) } g.p("req := &%sProtocolRequest{\n", xPrefix) if optIsExt { g.p("Ext: _ext,\n") } if reqFunc.noReply { g.p("NoReply: true,\n") } g.p("Header: %sRequestHeader{\n", xPrefix) if optIsExt { g.p(" Data: %sOpcode,\n", reqFunc.name) } else { g.p(" Opcode: %sOpcode,\n", reqFunc.name) g.p(" Data: headerData,\n") } g.p("},\n") g.p("Body: body,\n") g.p("}\n") if returnType == "" { g.p("conn.SendRequest(%s, req)\n", sendReqFlag) } else { g.p("seq := conn.SendRequest(%s, req)\n", sendReqFlag) g.p("return %s(seq)", returnType) } g.p("}\n") } go-x11-client-1.0.2/tools/go_client.py000066400000000000000000000127111460713373000174650ustar00rootroot00000000000000# SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: GPL-3.0-or-later import sys from common import * from enum import * import argparse import subprocess error_names = [] request_names = [] max_error_code = 0 x_prefix = '' parser = argparse.ArgumentParser() parser.add_argument('xml_file') parser.add_argument('-o', '--output', dest='output', default='/dev/stdout') parser.add_argument('-F', '--no-fmt', dest='no_fmt', action='store_true') parser.add_argument('-p', '--package', dest='package') parser.add_argument( '-I', '--no-import-x', dest='no_import_x', action='store_true') args = parser.parse_args() def go_open(self): set_namespace(self.namespace) _ns = get_namespace() global args if args.package is not None: pkg = args.package else: # pkg = _ns.header if _ns.is_ext: pkg = get_go_pkg_name(_ns.ext_name) else: pkg = 'x' set_level(0) l('package %s', pkg) if pkg != 'x': l('import x "github.com/linuxdeepin/go-x11-client"') global x_prefix x_prefix = 'x.' if _ns.is_ext: l('// _ns.ext_name: %s', _ns.ext_name) l('const MajorVersion = %d', int(_ns.major_version)) l('const MinorVersion = %d', int(_ns.minor_version)) l('var _ext *%sExtension', x_prefix) l('func Ext() *x.Extension {') l(' return _ext') l('}') def go_close(self): # handle errors _ns = get_namespace() global error_names global request_names global x_prefix if len(error_names) > 0: l("var errorCodeNameMap = map[uint8]string{") for name in error_names: error_code = get_type_name(name) + "ErrorCode" error_name = get_type_name(name) if not error_name.startswith("Bad"): error_name = "Bad" + error_name if error_name == "BadDeviceBusy": error_name = "DeviceBusy" l("%s : \"%s\",", error_code, error_name) l("}") # end error code name map if len(request_names) > 0: l("var requestOpcodeNameMap = map[uint]string{") for name in request_names: l("%sOpcode : \"%s\",", name, name) l("}") # end request opcode name map if _ns.is_ext: l("func init() {") errMap = "nil" if len(error_names) > 0: errMap = "errorCodeNameMap" reqMap = "nil" if len(request_names) > 0: reqMap = "requestOpcodeNameMap" l('_ext = %sNewExtension("%s", %d, %s, %s)', x_prefix, _ns.ext_xname, max_error_code, errMap, reqMap) l("}") # end func init # write source file global args gofile = open(args.output, 'w') if args.no_fmt: output_lines(gofile) else: pipe = subprocess.Popen( 'gofmt', bufsize=4096, stdin=subprocess.PIPE, stdout=gofile) output_lines(pipe.stdin) pipe.wait() if pipe.returncode != 0: # write no formated code and raise exception. output_lines(gofile) raise Exception("gofmt exit with error code %d" % pipe.returncode) def go_simple(self, name): if self.name != name: type_name = get_type_name(name) source_type_name = get_type_name(self.name) set_level(0) l("// simple %s", name) l("type %s %s", type_name, source_type_name) def go_enum(self, name): prefix = get_enum_prefix(name) set_level(0) l("// enum %s", prefix) l('const (') for (item_name, val) in self.values: item_name = get_enum_item_name(item_name) l("%s%s = %s", prefix, item_name, val) # newline l(')\n') def go_struct(self, name): pass def go_union(self, name): pass def go_request(self, name): global request_names name_base = get_request_name(name) opcode_name = name_base + "Opcode" l("const %s = %s", opcode_name, self.opcode) request_names.append(name_base) if self.reply: l("type %s %sSeqNum", name_base + "Cookie", x_prefix) def go_event(self, name): type_name = get_type_name(name) + "Event" code_name = type_name + "Code" code = self.opcodes[name] l('const %s = %d', code_name, int(code)) define_go_event_new_func(type_name) def define_go_event_new_func(go_type): global x_prefix l('\nfunc New%s(data []byte) (*%s, error) {', go_type, go_type) l('var ev %s', go_type) l('r := %sNewReaderFromData(data)', x_prefix) l('err := read%s(r, &ev)', go_type) l('if err != nil {') l(' return nil, err') l('}') l('return &ev, nil') l('}') def go_error(self, name): global max_error_code global error_names type_name = get_type_name(name) + 'Error' code_name = type_name + "Code" code = int(self.opcodes[name]) l('const %s = %d', code_name, code) error_names.append(name) if code > max_error_code: max_error_code = code def go_eventstruct(self, name): pass output = { 'open': go_open, 'close': go_close, 'simple': go_simple, 'enum': go_enum, 'struct': go_struct, 'union': go_union, 'request': go_request, 'event': go_event, 'error': go_error, 'eventstruct': go_eventstruct, } # Import the module class from xcbgen.state import Module from xcbgen.xtypes import * # Parse the xml header module = Module(args.xml_file, output) # Build type-registry and resolve type dependencies module.register() module.resolve() # Output the code module.generate() go-x11-client-1.0.2/util/000077500000000000000000000000001460713373000147635ustar00rootroot00000000000000go-x11-client-1.0.2/util/atom/000077500000000000000000000000001460713373000157235ustar00rootroot00000000000000go-x11-client-1.0.2/util/atom/atom.go000066400000000000000000000013261460713373000172140ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package atom import ( x "github.com/linuxdeepin/go-x11-client" ) func GetVal(conn *x.Conn, name string) (x.Atom, error) { reply, err := x.InternAtom(conn, false, name).Reply(conn) if err != nil { return 0, err } return reply.Atom, nil } func GetExistingVal(conn *x.Conn, name string) (x.Atom, error) { reply, err := x.InternAtom(conn, true, name).Reply(conn) if err != nil { return 0, err } return reply.Atom, nil } func GetName(conn *x.Conn, val x.Atom) (string, error) { reply, err := x.GetAtomName(conn, val).Reply(conn) if err != nil { return "", err } return reply.Name, nil } go-x11-client-1.0.2/util/cursor/000077500000000000000000000000001460713373000163005ustar00rootroot00000000000000go-x11-client-1.0.2/util/cursor/cursor.go000066400000000000000000000145301460713373000201470ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package cursor import ( "errors" "image" "image/color" "image/color/palette" "image/draw" "image/gif" "os" "github.com/linuxdeepin/go-x11-client" "github.com/linuxdeepin/go-x11-client/ext/render" "github.com/linuxdeepin/go-x11-client/ext/xfixes" ) type Image struct { Size uint32 // nominal size for matching Width uint32 // actual width Height uint32 // actual height XHot uint32 // hot spot x YHot uint32 // hot spot y Delay uint32 // delay between animation frames in milliseconds Pixels []byte img *image.RGBA } func (img *Image) Img() *image.RGBA { if img.img != nil { return img.img } // parse img.pixels pixels := img.Pixels rgbaImg := image.NewRGBA(image.Rect(0, 0, int(img.Width), int(img.Height))) pixIdx := 0 for y := 0; y < int(img.Height); y++ { for X := 0; X < int(img.Width); X++ { blue := uint8(pixels[pixIdx]) green := uint8(pixels[pixIdx+1]) red := uint8(pixels[pixIdx+2]) alpha := uint8(pixels[pixIdx+3]) rgbaImg.SetRGBA(X, y, color.RGBA{R: red, G: green, B: blue, A: alpha}) pixIdx += 4 } } img.img = rgbaImg return rgbaImg } var errImageNotFound = errors.New("image not found") func LoadImageFromFile(filename string, size int) (*Image, error) { f, err := os.Open(filename) if err != nil { return nil, err } return loadImageFromFile(f, size) } func loadImageFromFile(f *os.File, size int) (*Image, error) { d, err := newDecoder(f) if err != nil { return nil, err } defer d.close() bestSize, _ := d.findBestSize(size) if bestSize == 0 { return nil, errImageNotFound } for _, toc := range d.tocs { if toc.Type == typeImage && int(toc.Subtype) == bestSize { img, err := d.readImage(toc) if err != nil { return nil, err } return img, nil } } return nil, errImageNotFound } func dist(a, b int) int { if a > b { return a - b } return b - a } func (d *decoder) findBestSize(size int) (bestSize, nSizes int) { for _, toc := range d.tocs { if toc.Type != typeImage { continue } thisSize := int(toc.Subtype) if bestSize == 0 || dist(thisSize, size) < dist(bestSize, size) { bestSize = thisSize nSizes = 1 } else if thisSize == bestSize { nSizes++ } } return } type Images []*Image func LoadImagesFromFile(filename string, size int) (Images, error) { f, err := os.Open(filename) if err != nil { return nil, err } return loadImagesFromFile(f, size) } func loadImagesFromFile(f *os.File, size int) (Images, error) { d, err := newDecoder(f) if err != nil { return nil, err } defer d.close() bestSize, nSizes := d.findBestSize(size) if bestSize == 0 { return nil, errImageNotFound } images := make(Images, nSizes) var idx int for _, toc := range d.tocs { if toc.Type == typeImage && int(toc.Subtype) == bestSize { img, err := d.readImage(toc) if err != nil { return nil, err } images[idx] = img idx++ } } return images, nil } func (images Images) ToGIF() *gif.GIF { p := append(palette.WebSafe, color.Transparent) result := &gif.GIF{} for _, img0 := range images { img := img0.Img() bounds := img.Bounds() pImg := image.NewPaletted(bounds, p) draw.Draw(pImg, bounds, img, image.Point{}, draw.Src) result.Image = append(result.Image, pImg) result.Delay = append(result.Delay, int(img0.Delay)/10) result.Disposal = append(result.Disposal, gif.DisposalBackground) } return result } func (img *Image) LoadCursor(conn *x.Conn, name string) (x.Cursor, error) { rootWin := conn.GetDefaultScreen().Root depth := uint8(32) xid, err := conn.AllocID() if err != nil { return 0, err } pixmapId := x.Pixmap(xid) x.CreatePixmap(conn, depth, pixmapId, x.Drawable(rootWin), uint16(img.Width), uint16(img.Height)) xid, err = conn.AllocID() if err != nil { return 0, err } cid := x.GContext(xid) x.CreateGC(conn, cid, x.Drawable(pixmapId), 0, nil) pictFormats, err := render.QueryPictFormats(conn).Reply(conn) if err != nil { return 0, err } var formatARGB32 render.PictFormat for _, f := range pictFormats.Formats { if f.Depth == 32 && f.Type == render.PictTypeDirect && f.Direct.BlueMask == 255 && f.Direct.GreenMask == 255 && f.Direct.RedMask == 255 && f.Direct.AlphaMask == 255 && f.Direct.AlphaShift == 24 && f.Direct.RedShift == 16 && f.Direct.GreenShift == 8 && f.Direct.BlueShift == 0 { formatARGB32 = f.Id break } } if formatARGB32 == 0 { return 0, errors.New("not found pic format ARGB32") } x.PutImage(conn, x.ImageFormatZPixmap, x.Drawable(pixmapId), cid, uint16(img.Width), uint16(img.Height), 0, 0, 0, depth, img.Pixels) x.FreeGC(conn, cid) err = conn.FreeID(uint32(cid)) if err != nil { return 0, err } xid, err = conn.AllocID() if err != nil { return 0, err } pictId := render.Picture(xid) render.CreatePicture(conn, pictId, x.Drawable(pixmapId), formatARGB32, 0, nil) x.FreePixmap(conn, pixmapId) err = conn.FreeID(uint32(pixmapId)) if err != nil { return 0, err } xid, err = conn.AllocID() if err != nil { return 0, err } cursorId := x.Cursor(xid) render.CreateCursor(conn, cursorId, pictId, uint16(img.XHot), uint16(img.YHot)) render.FreePicture(conn, pictId) err = conn.FreeID(uint32(pictId)) if err != nil { return 0, err } if name != "" { xfixes.SetCursorName(conn, cursorId, name) } return cursorId, nil } func (images Images) LoadCursor(conn *x.Conn, name string) (x.Cursor, error) { if len(images) == 0 { return 0, errImageNotFound } else if len(images) == 1 { return images[0].LoadCursor(conn, name) } cursors := make([]x.Cursor, 0, len(images)) defer func() { for _, cid := range cursors { x.FreeCursor(conn, cid) _ = conn.FreeID(uint32(cid)) } }() for _, img := range images { curId, err := img.LoadCursor(conn, "") if err != nil { return 0, err } cursors = append(cursors, curId) } xid, err := conn.AllocID() if err != nil { return 0, err } animCursorId := x.Cursor(xid) animCursorEltSlice := make([]render.AnimCursorElt, len(cursors)) for idx, cursorId := range cursors { animCursorEltSlice[idx] = render.AnimCursorElt{ Cursor: cursorId, Delay: images[idx].Delay, // unit is milliseconds } } render.CreateAnimCursor(conn, animCursorId, animCursorEltSlice) if name != "" { xfixes.SetCursorName(conn, animCursorId, name) } return animCursorId, nil } go-x11-client-1.0.2/util/cursor/cursor_test.go000066400000000000000000000041161460713373000212050ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package cursor import ( "image/gif" "io/ioutil" "os" "testing" "github.com/stretchr/testify/assert" ) func TestLoadImage(t *testing.T) { _, err := os.Stat("/usr/share/icons/deepin/cursors/left_ptr") if err == nil { _, err = LoadImage("deepin", "left_ptr", 24) assert.Nil(t, err) } else { t.Skip(err) } } func TestLoadImages(t *testing.T) { _, err := os.Stat("/usr/share/icons/deepin/cursors/watch") if err == nil { _, err = LoadImages("deepin", "watch", 24) assert.Nil(t, err) } else { t.Skip(err) } } func TestLoadImageFromFile(t *testing.T) { img, err := LoadImageFromFile("testdata/left_ptr", 24) if os.IsNotExist(err) { t.Skip(err) } assert.Nil(t, err) _ = img.Img() assert.EqualValues(t, 24, img.Size) assert.EqualValues(t, 24, img.Width) assert.EqualValues(t, 24, img.Height) assert.EqualValues(t, 7, img.XHot) assert.EqualValues(t, 4, img.YHot) assert.EqualValues(t, 50, img.Delay) } func TestLoadImagesFromFile(t *testing.T) { images, err := LoadImagesFromFile("testdata/watch", 24) if os.IsNotExist(err) { t.Skip(err) } assert.Nil(t, err) assert.Len(t, images, 16) for _, img := range images { _ = img.Img() assert.EqualValues(t, 24, img.Size) assert.EqualValues(t, 24, img.Width) assert.EqualValues(t, 24, img.Height) assert.EqualValues(t, 60, img.Delay) } } func BenchmarkLoadImageFromFile(b *testing.B) { for i := 0; i < b.N; i++ { img, err := LoadImageFromFile("testdata/left_ptr", 24) if err != nil { b.Fatal(err) } _ = img.Img() } } func BenchmarkLoadImagesFromFile(b *testing.B) { for i := 0; i < b.N; i++ { imgs, err := LoadImagesFromFile("testdata/watch", 24) if err != nil { b.Fatal(err) } for _, img := range imgs { _ = img.Img() } } } func TestImages_ToGIF(t *testing.T) { images, err := LoadImagesFromFile("testdata/watch", 24) if os.IsNotExist(err) { t.Skip(err) } assert.Nil(t, err) outGif := images.ToGIF() err = gif.EncodeAll(ioutil.Discard, outGif) assert.Nil(t, err) } go-x11-client-1.0.2/util/cursor/read.go000066400000000000000000000060111460713373000175400ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package cursor import ( "bufio" "encoding/binary" "errors" "io" "os" ) const ( typeImage = 0xfffd0002 ) type decoder struct { f *os.File br *bufio.Reader version uint32 tocs []tocEntry tmp [36]byte } func newDecoder(f *os.File) (*decoder, error) { var d decoder d.f = f d.br = bufio.NewReader(f) err := d.readHeader() if err != nil { return nil, err } return &d, nil } func (d *decoder) close() error { return d.f.Close() } // table of contents entry type tocEntry struct { Type uint32 // entry type Subtype uint32 // Position uint32 // absolute byte position of table in file } func readFull(r io.Reader, b []byte) error { _, err := io.ReadFull(r, b) if err == io.EOF { err = io.ErrUnexpectedEOF } return err } func (d *decoder) readHeader() error { err := readFull(d.br, d.tmp[:16]) if err != nil { return err } magic := string(d.tmp[:4]) if magic != "Xcur" { return errors.New("magic not match") } d.version = binary.LittleEndian.Uint32(d.tmp[8:12]) nToc := binary.LittleEndian.Uint32(d.tmp[12:16]) d.tocs = make([]tocEntry, nToc) for i := range d.tocs { d.tocs[i], err = d.readTocEntry() if err != nil { return err } } return nil } func (d *decoder) readTocEntry() (tocEntry, error) { err := readFull(d.br, d.tmp[:12]) if err != nil { return tocEntry{}, err } var e tocEntry e.Type = binary.LittleEndian.Uint32(d.tmp[:4]) e.Subtype = binary.LittleEndian.Uint32(d.tmp[4:8]) e.Position = binary.LittleEndian.Uint32(d.tmp[8:12]) return e, nil } func (d *decoder) setPos(pos uint32) error { _, err := d.f.Seek(int64(pos), io.SeekStart) if err != nil { return err } d.br.Reset(d.f) return nil } func (d *decoder) readImage(toc tocEntry) (*Image, error) { err := d.setPos(toc.Position) if err != nil { return nil, err } err = readFull(d.br, d.tmp[:36]) if err != nil { return nil, err } // chuck header headerLen := binary.LittleEndian.Uint32(d.tmp[:4]) if headerLen != 36 { return nil, errors.New("image type chunk head len is not 36") } type0 := binary.LittleEndian.Uint32(d.tmp[4:8]) if type0 != typeImage { return nil, errors.New("chunk type not match") } subtype := binary.LittleEndian.Uint32(d.tmp[8:12]) version := binary.LittleEndian.Uint32(d.tmp[12:16]) if version != 1 { return nil, errors.New("version not supported") } var img Image img.Size = subtype img.Width = binary.LittleEndian.Uint32(d.tmp[16:20]) img.Height = binary.LittleEndian.Uint32(d.tmp[20:24]) img.XHot = binary.LittleEndian.Uint32(d.tmp[24:28]) if img.XHot > img.Width { img.XHot = img.Width } img.YHot = binary.LittleEndian.Uint32(d.tmp[28:32]) if img.YHot > img.Height { img.YHot = img.Height } img.Delay = binary.LittleEndian.Uint32(d.tmp[32:36]) // read pixels img.Pixels = make([]byte, 4*int(img.Width)*int(img.Height)) err = readFull(d.br, img.Pixels) if err != nil { return nil, err } return &img, nil } go-x11-client-1.0.2/util/cursor/testdata/000077500000000000000000000000001460713373000201115ustar00rootroot00000000000000go-x11-client-1.0.2/util/cursor/testdata/left_ptr000066400000000000000000000366401460713373000216640ustar00rootroot00000000000000Xcur4 X 0|$2 % *  )  444( $000000' %---------& &))))))))))))$ &%%%%%%%%%%%%&&& " &"""""""""""""""### ! & &  & &&QQQ- & """FFFg & }}}(%4$KKKH# <<@@@?<3&  $%&%$"   $  2@@@E+++2 UUU^+++7 UUUb)));  UUUh(((=  UUUlBBB###9  UUUp333???!!!9 UUUr111111>>> 8 UUUt.........<<<7 UUUt++++++++++++<<<1 UUUt)))))))))))))));;;0 UUUu&&&&&&&&&&&&&&&&&&:::0 UUUu#####################777/ UUUu!!!!!!!!!!!!!!!!!!!!!!!!999+ UUUu888+UUUu666)UUUu444(UUUu777 # UUUu555  UUUu***> UUUuUUUaaa|UUUu '''* UUUu =$ UUUt)))[,UUUtWWW\\\0! UUUrUUUUUUUUUUUUUUUUUUUUUUUUUUU]]]4%  UUUo;' ,7>ACCCCB?:1& ',./00/.,(!    $0002bbbf ^^^e  \\\f  [[[i  XXXh  WWWi   666NNNc  $555555MMMb  '333333333KKK`  )111111111111JJJ_  *////////////000BBBX  +---------------...AAAW  ,,,,,,,,,,,,,,,,,,,---???V  ,*********************+++>>>U  ,((((((((((((((((((((((((+++666N  ,&&&&&&&&&&&&&&&&&&&&&&&&&&&)))555M  ,%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%(((444L  ,#################################&&&222J  ,!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%%%,,,D  ,$$$+++C  ,"""***B  ,""")))A  ,"""###<  ,!!!""":  ,!!!9  , 6  , /  ,EEE___o  ,  , 4  , kkk+++V(  , 555___0%  ,7+   , B0%  ,qqq'''\4)  +888SSS6,"  *8.$  '?0&  $ R0' (18>BDFFGGFFFEC@<6/'  !(.3689:::::98640*$  #')+,,,,,,,+)'$       go-x11-client-1.0.2/util/cursor/testdata/watch000066400000000000000000007544201460713373000211560ustar00rootroot00000000000000Xcur0Pt &0(9LBpKT]fp$yHl   ش   D h   % 5 F @V df v 0Ж000<0`'0K0o0̓00080\$0H0l0Ȑ0$ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrnL5&#!"""""""""""""""""""""$#"A,h7CL Q VXXXqttt\[M A|<r8>F O [^^^^^[rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^^^^^^^fr {!WWWuFԅ1#!!!$),,,,,,,ݎ1 F&߼,,,,,,,,,,,,,,߿& QQQwݍ.,,,,,,,,,,,,܋/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,ی.?$Bݼی/'**'ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrTH@"""""""""""""""""""""($!D,c6?H Q UYXXXqttt[QG D D F O W^^^^^^^[rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^^^^^^dm w #$#WWWuFڊ0'$$&&*,,,,,,,,ݎ1 F&߼,,,,,,,,,,,,,,߾& QQQw݌.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݼی/'**'ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF""""""""""""""""""2'N/i8?HO S VWXXXqtttLCAE J QZ^^^^^^^^Zrrrsss[^^^^^^^^^^^^^^[qqqYYYwce^^^^^^^`hs~WWWuFݍ0,+($##$(,,,,,,܎2 F&߼,,,,,,,,,,,,,,߿& QQQw݌.,,,,,,,,,,,,܋/NNNt  -&,,,,,,,,,,&, @܋.,,,,,,,,ی.?$Bݼی/'**&ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF"""""""""""""""'$!G-e6AJ Q TVTVXXXqtttKCAF J U]^^^^^^^^[rrrsss[^^^^^^^^^^^^^^[qqqYYYwlp l ga^^^^^^_n }WWWuFݍ0,,,,*%#!"$*,,,ݎ1 F&߽,,,,,,,,,,,,,,߿& QQQwݍ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,ی.?$Bݼی/'**&ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF""""""""""""7(e6DN XZZVP GQ-XXXqtttLK M RZ^^^^^^^^^^\rrrsss[^^^^^^^^^^^^^^[qqqYYYwx}uo ga^^^^^^bp }}WWWuFݍ0,,,,,*(%#%),,,܎2 F&޽,,,,,,,,,,,,,,߾& QQQw݌/,,,,,,,,,,,,܋/NNNt  -%,,,,,,,,,,&, @܋.,,,,,,,,ی.?$Bݼی/'**'ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF""""""($!M/t;FQ UUR N Fv<N0JHGXXXqtttJL S]^^^^^^^^^^^Yrrrsss[^^^^^^^^^^^^^^[qqqYYYw~{tk c^^^^^_j nWWWuFݍ0,,,,,,,*'$#&*,܎2 F&޽,,,,,,,,,,,,,,߾& QQQw݌/,,,,,,,,,,,,܌/NNNt  -%,,,,,,,,,,&, @܋.,,,,,,,,ۋ/?$Bݼی/'**&ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF"""/& a5AL S VZWQ Gs:9)"""HHHXXXqtttw>O ]^^^^^^^^^^^Pu>rrrsss[^^^^^^^^^^^^^^[qqqYYYw~~wo g_^^^^^^\WWWuFݍ0,,,,,,,,*(')+,܎2 F&޼,,,,,,,,,,,,,+߾& QQQw݌.,,,,,,,,,,,,܌/NNNt  -%,,,,,,,,,,&, @܋.,,,,,,,,܋.?$Bݼی/'**'ی/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrFFF2'k8FP VZWQ L AZ3.& """"""HHHXXXqtttQ ]^^^^^^^^^^]QC Crrrsss[^^^^^^^^^^^^^^[qqqYYYw~{p e^^^^^Y WWWuFݍ0,,,,,,,,,+'$#%؊2 F&޼,,,,,,,,,,,,,+߾& QQQw݌/,,,,,,,,,,,,܌/NNNt  -%,,,,,,,,,,&, @܋.,,,,,,,,܋.?$Bݼی/'**'ڋ/޼B$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrKGD]4CM UVVP H |=D,""""""""""""HHHXXXqtttZ^^^^^^^^^^YJ A=x?rrrsss[^^^^^^^^^^^^^^[qqqYYYwp}wp k d_^Y WWWuFݍ0,,,,,,,,,,,,,,ݎ1 F&߽,,,,,,,,,,,,,+߾& QQQwݍ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݼی/'**'ی/޼B$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrS"N SVVR M Ek8@+"""""""""""""""HHHXXXqttt[^^^^^^^^^ZL ?d4T/S5 rrrsss[^^^^^^^^^^^^^^[qqqYYYwl##"}r g^^^^Y WWWuFݍ0,,,,,,,,,,+&##և3 F&߼,,,,,,,,,,,,,+߾& QQQwݍ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܋.,,,,,,,,܋.?$Bݼی/'**'ی/޼B$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrO-I O Q L Gy<H-%#"""""""""""""""""""HHHXXXqttt\^^^^^^^[L @i6X1T/g5Grrrsss[^^^^^^^^^^^^^^[qqqYYYw]m {! r d^^^Y WWWuFݍ0,,,,,,,,,,,)')܎2 F&߼,,,,,,,,,,,,,+߾& QQQwݍ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݼی/'**'ی/޼B$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrXZVS K AZ3)$!"""""""""""""""""""""HHHXXXqtttZ^^^^^^[L =e5^2c4t9AO rrrsss[^^^^^^^^^^^^^^[qqqYYYwY `m }!###!zp l eWWWuFρ2),,,,,,,,,,,,,܎2 F&߼,,,,,,,,,,,,,,߾& QQQw݌.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @݌.,,,,,,,,܋.?$Bݻی/'**'ی/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrYVN Fr:H-$#"""""""""""""""""""""""""OIEXXXqttt[^^^^^YH v:a3a3o8=H R\rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^`j u}q aWWWuF|3"+,,,,,,,,,,,,ݎ1 F&߼,,,,,,,,,,,,,,߾& QQQwލ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݻی/'**'ی/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrVJ ?^45("""""""""""""""""""""""""""<*~O0XXXqtttZ^^^^WJ By:o8}<BK W^\rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^^^_i w"##"hWWWuFֆ1""%+,,,,,,,,,,܎2 F&߼,,,,,,,,,,,,,,߾& QQQwݍ.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݼی/'**'ی/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrUw<<*""""""""""""""""""""""""""""""+$ S1Q,XXXqtttZ^^WK B~=r9q8|<@I T]^\rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^^^^gt"$&$"xWWWuFԅ1#%'+,,,,,,,,,,܎2 F&߼,,,,,,,,,,,,,,߿& QQQw݌.,,,,,,,,,,,,܌/NNNt  -&,,,,,,,,,,&, @܋.,,,,,,,,ی.?$Bݼی/'**&ڋ/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $ < !!!1ZZZhqqq~qqq~ZZZh 0 RRRbQQQa !YYY@@@@@@YYY!  #666444444444444444444666# eee000000000000000000000000000000fffTTTi------------------------------------PPPe +++)))))))))))))))))))))))))))))))))))),,,  ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%!!!< YYYrS U1$#"""""""""""""""""""""""""&#!H-q:EU XXXqtttZ^YL A=|<|<BH Q\^^^[rrrsss[^^^^^^^^^^^^^^[qqqYYYwY ^^^^^do z!"!WWWuFي1&&&'*,,,,,,,,,܎2 F&߼,,,,,,,,,,,,,,߿& QQQw݌.,,,,,,,,,,,,܋/NNNt  -&,,,,,,,,,,&, @܌.,,,,,,,,܋.?$Bݼی/'**'ی/ݽB$ $4PPP}OOO}4$  ,7WYYYqqqqqqXXXW7, &,..,&  $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}#############################################&$#A,[4m9h8ddd|  wNCR0(# !!!!!!!!!!!!!!!!!!!!!$! E,l8DP [^^^^uG g-^^]SI E BC I R\^^^^^^^^^g.f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^^^^^^`i l p r w}Aeeeĕtc_^^^^^agr !',,,,,,՚^cccG+,,+))*,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,+*  %]]]˱+,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՕM,,,,,,,,,,,,,,,,ԓJ2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ӓJVVV. #2UUU˯)+,,,,,,+ߋ)̱\\\2# %2333eҘZ،4ߌ*ߌ)׌5јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}#############################################8)X3m9|=B¡ddd|  }_Y2*$ !!!!!!!!!!!!!!!!!!0%K.f6>H R [^^^^^sA f,^^WQQQR[^^^^^^^^^^^^f+f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^^^^^^em u{}Ȁ?eeeǖpp k fdgggm u}$+,,,,,,ԛ_cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˰+,,,,,,,,,,,,,,,,*ͳZZZ~% 2ՕM,,,,,,,,,,,,,,,,ԒJ2 (333aً2,,,,,,,,,,,,,,׊3111^' .WWWԑH*,,,,,,,,,,*ӒLVVV. #2UUU˯)+,,,,,,+ߋ)̲\\\2# %2333eҘZ،4ߌ*ߌ)׌5Ҙ[111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}#######################################'$"?+Y3o9x=?@ddd|  !!!!!!!!!!!!!!!!!!*$ F,b5~>FO V]^^^^^^sA f-RN M P TY^^^^^^^^^^^^^^f+f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^^^^^^^^_chn {Beee͗h{tl db^bdl t}%+,,,՚^cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯+,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՔM,,,,,,,,,,,,,,,,ԒJ2 (333aً2,,,,,,,,,,,,,,׊3111^' .WWWԒI*,,,,,,,,,,*ӒKVVV. #2UUUʮ)+,,,,,,+ߋ)̲\\\2# %2333eҘZ،5ߌ*ߌ)׌5јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}####################################6) V2h8t;?B?{=ddd|  !!!!!!!!!!!!!!!!!!4'V1x<EP Y^^^^^^^^vG g1QM M P UZ^^^^^^^^^^^^^^g.f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^^^^^^^^^_fl zBeeeЙb"!ysk ea^^`fr !),,՛^cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]ˮ+,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՕM,,,,,,,,,,,,,,,,ԓJ2 (333a׉2,,,,,,,,,,,,,,ڍ3111^' .WWWԒI*,,,,,,,,,,*ӒKVVV. #2UUUʮ)+,,,,,,+ߋ)̱\\\2# %2333eҘZ،4ߌ*ߌ)׌5јZ111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}###########################?+l9AFFFDy=b6H.'$"ddd|  !!!!!!!!!%" >*W1y<J X^^^^^^^^^^]wM h4UXZ^^^^^^^^^^^^^^^^^f,f-^^^^^^^^^^^^^^^^^^^^g.sA^^^^^^^^^^^^^^^^^^^awCeee՛]+'# {to hccdi o u &,՛^cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯*,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՕM,,,,,,,,,,,,,,,,ԓJ2 (333a׊3,,,,,,,,,,,,,,ڍ3111^' .WWWԑH*,,,,,,,,,,*ԒJVVV. #2UUUʮ)+,,,,,,+ߌ)̰\\\2# %2333eҘZ׋4ߌ)ߌ)׌5јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}#####################,%!Q1m9{=??z=i8N0,%!#########ddd|  !!!!!!-%S1z<I U]^^^^^^^^^UI q:} h8V[^^^^^^^^^^^^^^^^^^e*f-^^^^^^^^^^^^^^^^^^^^g.uAggga^^^^^^^^^^^^^^^^tEeee՛],,,,*%!|sl idchl s ҚbcccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯*,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՕM,,,,,,,,,,,,,,,,ӒK2 (333a׉2,,,,,,,,,,,,,,ٌ3111^' .WWWԑH*,,,,,,,,,,*ԒJVVV. #2UUUʮ)+,,,,,,+ߋ)̱\\\2# %2333eҘZ׋4ߌ)ߌ*׌5јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}###############,%!P0l9y=@DC~>m9I.'$"############ddd|  !!!0&f6G U]^^^^^^^^^\N y<:)!!! nUL ]^^^^^^^^^^^^^^^^^M nVf-^^^^^^^^^^^^^^^^^^^^g.uAm l j e_^^^^^^^^^^^^^^^tEeee՛],,,,,($ ytp l k l l o sxɗocccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯*,,,,,,,,,,,,,,,,+δZZZ~% 2ՕM,,,,,,,,,,,,,,,,ӒK2 (333a؊2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̲\\\2# %2333eҘZ׋4ߌ)ߌ*،4јZ111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}#########+%!L0n:?BEB?g7H.&#"##################ddd|  O/BR ]^^^^^^^^^\N AW1*$ !!!!!! g.^^^^^^^^^^^^^^^^^]PF kGf-^^^^^^^^^^^^^^^^^^^^g.uAk l n r q l k d^^^^^^^^^^^^tEeee՛],,,,,,,,*%{sm ggcfk ǖrcccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯*,,,,,,,,,,,,,,,,+ͳZZZ~% 2ՕM,,,,,,,,,,,,,,,,ԒJ2 (333a؊2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̲\\\2# %2333eҘZ׋4ߌ)ߌ*،4јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}######/'!M/n:???~>n:V21(!########################ddd|  ~~>P ]^^^^^^^^^R @T1*$ !!!!!!!!!!!! e*^^^^^^^^^^^^^^^]RJ D AlLf-^^^^^^^^^^^^^^^^^^^^g.rB^bhl l l l j c^^^^^^^^^^^tEeeeњb),,,,,,,,+($"zwwwǗpcccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯+,,,,,,,,,,,,,,,,+δZZZ~% 2ՕM,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԒI*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̲\\\2# %2333eҘZ،4ߌ*ߌ*،4јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}J/e7t;?@@u<d7S11(!##############################ddd|  sC^^^^^^^^^^UH t:D,"!!!!!!!!!!!!!!!!! f-^^^^^^^^^^^^^^YK Ar9^2T/q`f-^^^^^^^^^^^^^^^^^^^^g.rB^eo x{{{sk a^^^^^^^^^^tEeeeΘf&,,,,,,,,,)"un fcceƖscccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˯+,,,,,,,,,,,,,,,,+δZZZ~% 2ՔM,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԒI*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̲\\\2# %2333eҘZ،5ߌ*ߌ*،4јZ111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}+&"R1a5p:i8T2C,,%!####################################ddd|  wO\^^^^^^]TG i73&!!!!!!!!!!!!!!!!!!!!!!!! f,^^^^^^^^^^^^UJ ?o8h5e4z;F h4f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^em r twsn d^^^^^^^^tEeeeȖn$+,,,,,,,,&uj gj r ǗpcccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˰+,,,,,,,,,,,,,,,,+δZZZ~% 2ՔM,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̱\\\2# %2333eҘZ،4ߌ*ߌ*،4јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}BBAz=l9M//'!#######################################ddd|  s@^^^^^^^VCX2&# !!!!!!!!!!!!!!!!!!!!!!!!!!! f+^^^^^^^^^^[K @|<r9r9=DK We*f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^`i r |{sj c^^^^^tEeeeÔuau#+,,,,,,,,,,(!͘jcccG),,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˰+,,,,,,,,,,,,,,,,+ͳZZZ~% 2֕M,,,,,,,,,,,,,,,,ӒK2 (333aڌ2,,,,,,,,,,,,,,؋3111^' .WWWԒI*,,,,,,,,,,*ԓJVVV. #2UUU˯)+,,,,,,+ߌ)̱\\\2# %2333eҗZ،5ߌ*ߌ*،4Ҙ[111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}žF~>e7L0+%!#############################################ddd|  s@^^^^]TH j73&!!!!!!!!!!!!!!!!!!!!!!!!!!!.%Z3i f+^^^^^^^^^RD ~=v:|<?C M W^^f,f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^bgl q r r o i d_^^^tEeeeÔu^ct"),,,,,,,,,,& ʘncccG$,,,,,,,,,,,,,,,,,,+F *),,,,,,,,,,,,,,,,,,**  %]]]˯+,,,,,,,,,,,,,,,,+δZZZ~% 2֕M,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ԒJVVV. #2UUUʰ)+,,,,,,+ߋ)̲\\\2# %2333eҗZ،5ߌ*ߌ*،4јZ111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}d6G.(%"###################################################ddd|  tG^^]TG u;M/'# !!!!!!!!!!!!!!!!!!!!!!!!*$ N/|=N vH f.^^^^^^^]SH A@BF K T]^^^f-f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^co v{{{{tj a^tEeeeƕrd^^ej w ',,,,,,,,,+!̘jcccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˰+,,,,,,,,,,,,,,,,+ͳZZZ~% 2ՕM,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ԓJVVV. #2UUUʮ)+,,,,,,+ߌ)̱\\\2# %2333eҘZ،4ߌ*ߌ*؍5Ҙ[111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}K/#########################################################ddd|  s@^UCY21&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!(# I-t:H UtD f+^^^^^XN I E A@D G L U]^^^^f-f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^_hs{zum btEeeeĕtccfgo w$+,,,,,,,,,,Ԛ`cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˱+,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՕM,,,,,,,,,,,,,,,,ӒK2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԒI*,,,,,,,,,,*ԒJVVV. #2UUU˯)+,,,,,,+ߋ)̱\\\2# %2333eҘZ،5ߌ*ߌ*׌5јZ111d2%$0=\\\[[[=0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $  <  1fffteees1  ___n]]]l  555G333E  UUUg~~~;;;666666666666666666;;;\\\m  XXXj888333333333333333333333333333333999WWWi 555K111111111111111111111111111111111111111111222I................................................ ```u111++++++++++++++++++++++++++++++++++++++++++++++++000\\\q uuu))))))))))))))))))))))))))))))))))))))))))))))))))))))www<+++&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,, = fff}2' ###################################################4( J/ddd|  uG\FZ3*#!!!!!!!!!!!!!!!!!!!!!!!!!!!4'[3?L W^^vG f.^^^^UM H D D H L S[^^^^^^^g.f-^^^^^^^^^^^^^^^^^^^^g.rB^^^^^^^^^^^^em r wwtr n yBeeeƕql m gghl r z$*,,,,,,,,՛^cccG+,,,,,,,,,,,,,,,,,,+F **,,,,,,,,,,,,,,,,,,**  %]]]˰+,,,,,,,,,,,,,,,,*ͲZZZ~% 2ՔM,,,,,,,,,,,,,,,,ԓJ2 (333aً2,,,,,,,,,,,,,,؋3111^' .WWWԑH*,,,,,,,,,,*ӓJVVV. #2UUU˯)+,,,,,,+ߋ)̱\\\2# %2333eҘZ،5ߌ*ߌ)׌5јZ111d2%$0=\\\[[[<0$ *3;XdddcccW;3*  ")/478874/)"  !$%%$!   $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy#####################################################################'$"I.d6y=BDBrV  "X#w<6(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'# K.s:FR ]^^^^^^[" %X ^]PDi6A*# 2%R/u:G S]^^^^^^^^^^^Z%  '[^^^^^^^YUQRV[^^^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^^^^^^^^`hp uzx)  (f.^^^^^^^^^^^^^^_gs!&+,,,,,,,,܊-(  'rrr˖g{{w{~#*,,,,,,,,,,,,,,,Ӛ`nnn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ތ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۊ,/"  ,rrrŪ*,,,,,,,,,,,,,,,,,,,,,,,,,,+ʯqqq,   ( =؋3,,,,,,,,,,,,,,,,,,,,,,,,,,׊4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9),,,,,,,,,,,,,,,,,,,,,,(ѹ8*  $/$$$Wܺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&սKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzӻډ-*,,,,,,,,,,*ډ,ɰKKKy8.$  %.8&&&\З[ۉ,%'**'%ۊ,ϖ]%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy##################################################################+%!I.h8@FJ N S k;  "yS:%" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!6(T0s:DN W^^^^^^^^[" %YZI {<]2I,;(:(:(C+I-[2p9>G Q Z^^^^^^^^^^^^^^Z%  '\^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^^^^^^^_en v )  (f.^^^^^^^^^^^^^bj r | %+,,,,,,,,,ۊ.(  'rrrҘ^'$""%*,,,,,,,,,,,,,,,,,ԛ`nnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,)+++U% "/ߍ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۊ,/"  ,rrrƬ*,,,,,,,,,,,,,,,,,,,,,,,,,,+ɯqqq,   ( =ً3,,,,,,,,,,,,,,,,,,,,,,,,,,׊5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9վ),,,,,,,,,,,,,,,,,,,,,,(ѹ8*  $/$$$Wܺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&վKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+׊3[[[6,!  $.8LLLzԽډ-*,,,,,,,,,,*ډ,ɰKKKy8.$  %.8&&&\Ж[ډ,%&**'%ۊ,ϗ^%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy#########################################################&#"?+T2k8?EI L P R R l?  "OOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!3&P/l8AJ T]^^^^^^^^^^[" %}DQ/=(6&,#5&C+O.]2l7@H R[^^^^^^^^^^^^^^^^^[%  ']^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^^^^^^^^^^^^bj r wzp)  (s-vq m g`^^^^^^^^^^^^_en x#),,,,,܋-(  'rrrҘ],,,,,($ !&+,,,,,,,,,,,,ӛannn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ތ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۉ,/"  ,rrrƬ+,,,,,,,,,,,,,,,,,,,,,,,,,,+ʰqqq,   ( =ً2,,,,,,,,,,,,,,,,,,,,,,,,,,؋5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9վ),,,,,,,,,,,,,,,,,,,,,,(ѹ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&սKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzօ,),,,,,,,,,,*ۉ,ȰKKKy8.$  %.8&&&\Ж[ۉ,%'**'%ۊ,ϗ^%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy###################################################)%"C,^4y=BGM N P Q N L I pO  "OOO!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!6'Y2~>I U]^^^^^^^^^^^^[" %n@"L-:(:(,#4&C+Q/a4w:D P Z^^^^^^^^^^^^^^^^^^Z%  ']^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^^^^^^^^^^^^^_hn tn)  (~-|uo ha^^^^^^^^^^^^^ew$+,,,܋-(  'rrrҘ^,,,,,,,,,*%! %,,,,,,,,Ӛannn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/݋,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۉ,/"  ,rrrǭ+,,,,,,,,,,,,,,,,,,,,,,,,,,+ʰqqq,   ( =ً3,,,,,,,,,,,,,,,,,,,,,,,,,,؊5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9ս),,,,,,,,,,,,,,,,,,,,,,(Ѹ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&սKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzօ,),,,,,,,,,,*ۉ,ȰKKKy8.$  %.8&&&\ϖ\ۉ,%'**'%ډ,ϗ^%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy#######################################+%!W3AK R VZZZVQ K D{=c6=+###{{{  "OOO!!!!!!!!!!!!!!!!!!!!!!!!!!!2&Z2@O ]^^^^^^^^^^^^^^^ZY " %k?"b4b4h6p9}=BJ RZ^^^^^^^^^^^^^^^^^^^^^X%  ']^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^['  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^df)  (݌-+(# }uo g`^^^^^^^^^^^^am {!),܋-(  'rrrҘ^,,,,,,,,,,,*%""'+,,,,,,Қannn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/܊,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۉ,/"  ,rrrƬ+,,,,,,,,,,,,,,,,,,,,,,,,,,+ʯqqq,   ( =؋3,,,,,,,,,,,,,,,,,,,,,,,,,,؊5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9Ի),,,,,,,,,,,,,,,,,,,,,,(ѹ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&ԼKKKw3(  !,6\\\׌6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzօ,*,,,,,,,,,,*ۉ,ȰKKKy8.$  %.8&&&\ϖ\ۉ,%'**'%ډ,ϗ^%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy#################################8)^5?FJ N N N N ID{=[48)###############{{{  "OOO!!!!!!!!!!!!!!!!!!+$R0>K Y^^^^^^^^^^^^^^ZO C^4+$RRR" %S9(O._3v;BK V^^^^^^^^^^^^^^^^^^^^^^^]Q%  '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )dl l l l j d`^^^^^^^^^^^^^^^^^^^^^^^Y)  (݋-,,,,,,,(#~vm d^^^^^^^^^^^_gwՃ.(  'rrrҘ],,,,,,,,,,,,,,,*%#! $*,,,Ӛannn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/܊,,,,,,,,,,,,,,,,,,,,,,,,,,,,,܊-/"  ,rrrƬ+,,,,,,,,,,,,,,,,,,,,,,,,,,+ʲqqq,   ( =؋3,,,,,,,,,,,,,,,,,,,,,,,,,,؋5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9Ի),,,,,,,,,,,,,,,,,,,,,,)Ѹ8*  $/$$$Wۺ),,,,,,,,,,,,,,,,,,,,(ܻ(((Y/$  (3MMMx׿',,,,,,,,,,,,,,,,,,&սKKKw3(  !,6\\\׌6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLz؇,*,,,,,,,,,,*ۉ,ɯKKKy8.$  %.8&&&\ϖ\ۊ+%'**'%ډ,ϗ]%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy########################8)]5?FM Q SVVUQ K Be7=+#####################{{{  "OOO!!!!!!!!!$! P/@N Z^^^^^^^^^^^^^^^YK n82&!!!!!!!!!RRR" %111'"g6I Z^^^^^^^^^^^^^^^^^^^^^^]O p9)"222%  'HZ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ZF'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )gr r r to j e^^^^^^^^^^^^^^^^^^^^^^^Y)  (݋-,,,,,,,+&!|tk c^^^^^^^^^^^^^bj0(  'rrrҘ],,,,,,,,,,,,,,,,,)'$"!!###&)+,Ԛ`nnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,)+++U% "/܊,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ތ,/"  ,rrrƬ+,,,,,,,,,,,,,,,,,,,,,,,,,,*ʰqqq,   ( =؊2,,,,,,,,,,,,,,,,,,,,,,,,,,ٌ4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9Լ(,,,,,,,,,,,,,,,,,,,,,,)һ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ݻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'ԽKKKw3(  !,6\\\׌6+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzօ,*,,,,,,,,,,*ۉ,ȮKKKy8.$  %.8&&&\ϖ\ۊ+%'**'%ډ,З\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy###############7) Y3|=HL O S VTR N H?d69*##############################{{{  "OOO!!!5'k8G W^^^^^^^^^^^^^^^WJ z<N/$! !!!!!!!!!!!!!!!RRR" %{CO ]^^^^^^^^^^^^^^^^^^^^^^[L }=L-)"222%  ']^^^^^^^^^^^^^^^^^^^^^^^^^^^^^YU'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )gr wx{{{{wur n e^^^^^^^^^^^^^^^^^^Y)  (݊-,,,,,,,,,,,,+%!|q f^^^^^^^^^^^g0(  'rrrҘ^,,,,,,,,,,,,,,,,,,,+($!!$њdnnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,)+++U% "/܊,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ލ,/"  ,rrrƬ+,,,,,,,,,,,,,,,,,,,,,,,,,,*ʯqqq,   ( =؊2,,,,,,,,,,,,,,,,,,,,,,,,,,؋4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9Լ(,,,,,,,,,,,,,,,,,,,,,,)ѻ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ݺ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'վKKKw3(  !,6\\\׌6+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzԿډ-*,,,,,,,,,,*ډ,ȮKKKy8.$  %.8&&&\ϖ\ۊ+%'**&%ډ,З\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy#########+%!K/k8BJ N Q R P N IDv<T2/'!####################################{{{  "OOO:){<O ]^^^^^^^^^^^^^]P >H-"!!!!!!!!!!!!!!!!!!!!!!!!!!RRR" %O]^^^^^^^^^^^^^^^^^^^^YG v;O.5&" 222%  ']^^^^^^^^^^^^^^^^^^^^^^^^^^]WURQ '  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^`fk p uwwwtr m ga^^^^^^^^^^^^^^^^Y)  (Ӂ-&+,,,,,,,,,,,,*'# |tn i e_^^^^g0(  'rrrҘ^,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ԛ_nnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,)+++U% "/݌,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ތ,/"  ,rrrƮ*,,,,,,,,,,,,,,,,,,,,,,,,,,*ʰqqq,   ( =ً2,,,,,,,,,,,,,,,,,,,,,,,,,,؋4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9Լ),,,,,,,,,,,,,,,,,,,,,,)ѻ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ݻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'վKKKw3(  !,6\\\֋5+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzօ,),,,,,,,,,,*ۉ,ȮKKKy8.$  %.8&&&\Ж[ۉ,%'**&%ډ,З\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   vlX3r;BGK L N O N L IBt;Y37)#############################################{{{  "[^^^^^^^^^^^^^^^YM |=J.$"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RRR" %[^^^^^^^^^^^^^^^^^^^[K {<J,'"222%  ']^^^^^^^^^^^^^^^^^^^^^^^]UK C =s9n7r;'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^`j t~~xn c^^^^^^^^^^^^^^^Y)  (w.!*,,,,,,,,,,,,,)"ui `^^^^^^^^g0(  'rrrӘ],,,,,,,,,,,,,,,,,,,,,+'# Ιgnnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,)+++U% "/ތ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ތ-/"  ,rrrƭ*,,,,,,,,,,,,,,,,,,,,,,,,,,*ʯqqq,   ( =ً2,,,,,,,,,,,,,,,,,,,,,,,,,,؋4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9վ),,,,,,,,,,,,,,,,,,,,,,)Ҽ8*  $/$$$Wۺ(,,,,,,,,,,,,,,,,,,,,)ݺ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'տKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzӽډ-*,,,,,,,,,,*ڈ+ȮKKKy8.$  %.8&&&\Ж[ۉ,%'**&%ډ,З[%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   yyy*%"S1t;BFFFB}>d7I.*%"######################################################{{{  "W"\^^^^^^^^^^^SGm86'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RRR" %Y^^^^^^^^^^^^^^^^TCc4?)# '"e>%%  '[^^^^^^^^^^^^^^^^^^^^\RG D @?@H O\]'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^`go v{}}yo d^^^^^^^^^^^^Y)  (f.iu&,,,,,,,,,,,,,&}m `^^^^^^^g0(  'rrrԙ\,,,,,,,,,,,,,,,,,,,,,,+&"!!"%)ԛ_nnn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ߌ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ތ,/"  ,rrrǭ*,,,,,,,,,,,,,,,,,,,,,,,,,,*ʰqqq,   ( =ً3,,,,,,,,,,,,,,,,,,,,,,,,,,؋4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,)ѻ8*  $/$$$W۹(,,,,,,,,,,,,,,,,,,,,)ݻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'վKKKw3(  !,6\\\ԉ7+,,,,,,,,,,,,,,+؋3[[[6,!  $.8LLLzԽ؇,),,,,,,,,,,*ۉ,ȮKKKy8.$  %.8&&&\Ж[ډ,%&**'%ډ,З\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   k>R R R Q M I F{=[4<+$###########################################################{{{  "[^^^^^^^^^^[N ?G-!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!RRR" %Z^^^^^^^^^^^^^^T@N.# &!G,l7I%  '\^^^^^^^^^^^^^^^^^]RK F D D F K RW]^^]'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^_gq {!! xp h`^^^^^^^Y)  (f.^^bs!*,,,,,,,,,,,,,,,+$}ww{t/(  'rrrƓo~!+,,,,,,,,,,,,,,,,,,,,,,,,,,,Ӛ`nnn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/݌,,,,,,,,,,,,,,,,,,,,,,,,,,,,,݌-/"  ,rrrŨ+,,,,,,,,,,,,,,,,,,,,,,,,,,*ʱqqq,   ( =׉3,,,,,,,,,,,,,,,,,,,,,,,,,,ٌ4 >(  #/ppp',,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,)Һ8*  $/$$$Wܹ(,,,,,,,,,,,,,,,,,,,,(ܼ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&վKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzӺۊ,*,,,,,,,,,,*ڈ+ɮKKKy8.$  %.8&&&\Ж[ډ,%'**'%ډ,ϗ\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   i2ZQ J Bs;Y37) #####################################################################{{{  "[^^^^^^^XL @T0%" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!$! hSE" %Z^^^^^^^^^^^[K s9A* +#I-g6@O [Y%  '\^^^^^^^^^^^^^^^YP I D D F K P X^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^_gl p uy{wwwup j e`^^^^^Y)  (f.^^^^gt"',,,,,,,,,,,,,,,)"sl0(  'rrr’sgy&,,,,,,,,,,,,,,,,,,,,,,,,,,ԛ`nnn'  %...W*,,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/݋,,,,,,,,,,,,,,,,,,,,,,,,,,,,,ލ,/"  ,rrrŧ+,,,,,,,,,,,,,,,,,,,,,,,,,,*ʲqqq,   ( =׉3,,,,,,,,,,,,,,,,,,,,,,,,,,ٌ4 >(  #/ppp',,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,)һ8*  $/$$$Wݹ),,,,,,,,,,,,,,,,,,,,(ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,'ԽKKKw3(  !,6\\\ԉ7+,,,,,,,,,,,,,,+؋3[[[6,!  $.8LLLzӺۊ,*,,,,,,,,,,*ڈ+ȮKKKy8.$  %.8&&&\їZډ,%'**'%ډ,З\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   nHBo:O01(!##############################################################################{{{  "[^^^^XL @Z22&!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!7(o9J Z" %Z^^^^^^^^^WI }=V05&# 7&]3?K W^^^X %  '\^^^^^^^^^^^^^^ZTQMQRW]^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^j t} }r e^^Y)  (f.^^^^^^^^bo |"*,,,,,,,,,,,,,,%s/(  'rrr͗d!&,,,,,,,,,,,,,,,,,,,,,,Ӛ`nnn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ߌ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ތ-/"  ,rrrƬ*,,,,,,,,,,,,,,,,,,,,,,,,,,+ɱqqq,   ( =؊3,,,,,,,,,,,,,,,,,,,,,,,,,,ٌ4 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,'mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,)һ8*  $/$$$Wܺ(,,,,,,,,,,,,,,,,,,,,(ܼ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&վKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։4[[[6,!  $.8LLLzԼډ-*,,,,,,,,,,*ڈ+ɮKKKy8.$  %.8&&&\Ж[ډ,%&**'%ډ,ϗ\%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   mDt;/'!####################################################################################~{y  "[^[K r:7(!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!%" K.y<I U[" %Z^^^^^UI >]38'# 2%R/r9CO [^^^^Z%  '\^^^^^^^^^^^XUQQQQTX]^^^^^^^^^^]'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^bp {~xm bY)  (f.^^^^^^^^`i u&,,,,,,,,,,,,,,,,ډ.(  'rrrʕi $(,,,,,,,,,,,,,,,,,,,,,,Ӛannn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ތ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,܊-/"  ,rrrƬ*,,,,,,,,,,,,,,,,,,,,,,,,,,+ʲqqq,   ( =؋3,,,,,,,,,,,,,,,,,,,,,,,,,,؋5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,)ѹ8*  $/$$$Wܺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&ԼKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzӻۊ,*,,,,,,,,,,*ډ,ȰKKKy8.$  %.8&&&\З[ډ,%'**'%ډ,ϗ]%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      $000<    ///@rrrժqqq~///@   !sssrrr   qqqppp  (((>>666666666666666666666666666666>>>MMM_  ]]]o888555555555555555555555555555555555555555555999\\\n  NNNbVVV333333333333333333333333333333333333333333333333333333```LLL`  %%%=BBB111111111111111111111111111111111111111111111111111111111111HHH(((@  @@@//////////////////////////////////////////////////////////////////FFF  qqqTTT------------------------------------------------------------------------WWWooo   (,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, )  sss---******************************************************************************444rrr  {{{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((  ///L///&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&///,,,I  sss%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%ooo   pR<+##############################################################################5( R1a5t]  "Z^J ]3(# !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!2&Z2?K X^^^[" %Z^^^\M ?b4A*.$ &!=(T0j6>J W^^^^^^^^Z%  '\^^^^^^^^^^YWZZ\^^^^^^^^^^^^^^^\'  (]^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\(  )Z^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^Z)  )Y^^^^^^^^^^^^^^^^^_gq w{}yj)  (f.^^^^^^^^^^^ep {$*,,,,,,,,,,,,܋.(  'rrrϗb#!!$'*,,,,,,,,,,,,,,,,,,,Ӛannn'  %...W),,,,,,,,,,,,,,,,,,,,,,,,,,,,*+++U% "/ߌ+,,,,,,,,,,,,,,,,,,,,,,,,,,,,ۉ,/"  ,rrrƬ*,,,,,,,,,,,,,,,,,,,,,,,,,,+ʯqqq,   ( =ً3,,,,,,,,,,,,,,,,,,,,,,,,,,؊5 >(  #/ppp&,,,,,,,,,,,,,,,,,,,,,,,,&mmm/#  *9տ),,,,,,,,,,,,,,,,,,,,,,(ѹ8*  $/$$$Wܺ(,,,,,,,,,,,,,,,,,,,,)ܻ(((Y/$  (3MMMx',,,,,,,,,,,,,,,,,,&սKKKw3(  !,6\\\֋6+,,,,,,,,,,,,,,+։3[[[6,!  $.8LLLzԼډ-*,,,,,,,,,,*ڈ+ɱKKKy8.$  %.8&&&\Ж[ډ,%&**'%ډ,ϗ^%%%\8.% %.6Aooommm@6.%  $,3: Jrrrqqq J:3,$  !(/6;@+++doooݨooo***d@;6/(!  $*/48<?ABCCBA?<84/*$  #(,/24666642/,(#   "%'())('%"      go-x11-client-1.0.2/util/cursor/theme.go000066400000000000000000000046231460713373000177360ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package cursor import ( "bufio" "bytes" "errors" "os" "os/user" "path/filepath" "strings" ) func LoadImage(theme, name string, size int) (*Image, error) { f := scanTheme(theme, name, 0) if f == nil { f = scanTheme("default", name, 0) } if f == nil { return nil, errors.New("not found image file") } return loadImageFromFile(f, size) } func LoadImages(theme, name string, size int) (Images, error) { f := scanTheme(theme, name, 0) if f == nil { f = scanTheme("default", name, 0) } if f == nil { return nil, errors.New("not found image file") } return loadImagesFromFile(f, size) } func getLibraryPaths() []string { xcursorPath, ok := os.LookupEnv("XCURSOR_PATH") if ok { return strings.Split(xcursorPath, ":") } var paths []string home := getHome() // add ~/.icons if home != "" { paths = append(paths, filepath.Join(home, ".icons")) } paths = append(paths, "/usr/share/icons", "/usr/share/pixmaps") return paths } func getHome() string { home, ok := os.LookupEnv("HOME") if ok { return home } u, err := user.Current() if err != nil { return "" } return u.HomeDir } func scanTheme(theme, name string, depth int) *os.File { if depth > 50 { return nil } libPaths := getLibraryPaths() var inherits []string loop: for _, libPath := range libPaths { imgFile := filepath.Join(libPath, theme, "cursors", name) f, err := os.Open(imgFile) if err == nil { return f } for _, base := range []string{"cursor.theme", "index.theme"} { themeFile := filepath.Join(libPath, theme, base) inherits, _ = getThemeInherits(themeFile) if len(inherits) > 0 { break loop } } } for _, i := range inherits { if i == theme { continue } f := scanTheme(i, name, depth+1) if f != nil { return f } } // not found return nil } func getThemeInherits(themeFile string) ([]string, error) { f, err := os.Open(themeFile) if err != nil { return nil, err } scanner := bufio.NewScanner(f) for scanner.Scan() { fields := bytes.SplitN(scanner.Bytes(), []byte("="), 2) if len(fields) != 2 { continue } if "Inherits" == string(bytes.TrimSpace(fields[0])) { result := strings.Split(string(bytes.TrimSpace(fields[1])), ":") return result, nil } } if scanner.Err() != nil { return nil, scanner.Err() } return nil, nil } go-x11-client-1.0.2/util/keybind/000077500000000000000000000000001460713373000164105ustar00rootroot00000000000000go-x11-client-1.0.2/util/keybind/keybind.go000066400000000000000000000042101460713373000203610ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package keybind import ( x "github.com/linuxdeepin/go-x11-client" "github.com/linuxdeepin/go-x11-client/util/keysyms" ) var grabMods []uint16 func init() { grabMods = make([]uint16, len(keysyms.LockMods)+1) copy(grabMods, keysyms.LockMods) } func Grab(conn *x.Conn, win x.Window, mods uint16, key x.Keycode) { for _, m := range grabMods { x.GrabKey(conn, true, win, mods|m, key, x.GrabModeAsync, x.GrabModeAsync) } } func Ungrab(conn *x.Conn, win x.Window, mods uint16, key x.Keycode) { for _, m := range grabMods { _ = x.UngrabKeyChecked(conn, key, win, mods|m).Check(conn) } } func GrabChecked(conn *x.Conn, win x.Window, mods uint16, key x.Keycode) error { return GrabCheckedV2(conn, win, mods, key, x.GrabModeAsync, x.GrabModeAsync) } func GrabCheckedV2(conn *x.Conn, win x.Window, mods uint16, key x.Keycode, pointerMode uint8, keyboardMode uint8) error { for _, m := range grabMods { err := x.GrabKeyChecked(conn, true, win, mods|m, key, pointerMode, keyboardMode).Check(conn) if err != nil { return err } } return nil } // GrabKeyboard grabs the entire keyboard. func GrabKeyboard(conn *x.Conn, win x.Window) error { reply, err := x.GrabKeyboard(conn, true, win, x.CurrentTime, x.GrabModeAsync, x.GrabModeAsync).Reply(conn) if err != nil { return err } if reply.Status == x.GrabStatusSuccess { // successful return nil } return GrabKeyboardError{reply.Status} } type GrabKeyboardError struct { Status byte } func (err GrabKeyboardError) Error() string { const errMsgPrefix = "GrabKeyboard Failed status: " switch err.Status { case x.GrabStatusAlreadyGrabbed: return errMsgPrefix + "AlreadyGrabbed" case x.GrabStatusInvalidTime: return errMsgPrefix + "InvalidTime" case x.GrabStatusNotViewable: return errMsgPrefix + "NotViewable" case x.GrabStatusFrozen: return errMsgPrefix + "Frozen" default: return errMsgPrefix + "Unknown" } } // UngrabKeyboard undoes GrabKeyboard. func UngrabKeyboard(conn *x.Conn) error { return x.UngrabKeyboardChecked(conn, x.CurrentTime).Check(conn) } go-x11-client-1.0.2/util/keysyms/000077500000000000000000000000001460713373000164675ustar00rootroot00000000000000go-x11-client-1.0.2/util/keysyms/auto.go000066400000000000000000012727171460713373000200070ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package keysyms import x "github.com/linuxdeepin/go-x11-client" const ( // Void symbol XK_VoidSymbol = 0xffffff // Back space, back char XK_BackSpace = 0xff08 XK_Tab = 0xff09 // Linefeed, LF XK_Linefeed = 0xff0a XK_Clear = 0xff0b // Return, enter XK_Return = 0xff0d // Pause, hold XK_Pause = 0xff13 XK_Scroll_Lock = 0xff14 XK_Sys_Req = 0xff15 XK_Escape = 0xff1b // Delete, rubout XK_Delete = 0xffff // Multi-key character compose XK_Multi_key = 0xff20 XK_Codeinput = 0xff37 XK_SingleCandidate = 0xff3c XK_MultipleCandidate = 0xff3d XK_PreviousCandidate = 0xff3e // Kanji, Kanji convert XK_Kanji = 0xff21 // Cancel Conversion XK_Muhenkan = 0xff22 // Start/Stop Conversion XK_Henkan_Mode = 0xff23 // Alias for Henkan_Mode XK_Henkan = 0xff23 // to Romaji XK_Romaji = 0xff24 // to Hiragana XK_Hiragana = 0xff25 // to Katakana XK_Katakana = 0xff26 // Hiragana/Katakana toggle XK_Hiragana_Katakana = 0xff27 // to Zenkaku XK_Zenkaku = 0xff28 // to Hankaku XK_Hankaku = 0xff29 // Zenkaku/Hankaku toggle XK_Zenkaku_Hankaku = 0xff2a // Add to Dictionary XK_Touroku = 0xff2b // Delete from Dictionary XK_Massyo = 0xff2c // Kana Lock XK_Kana_Lock = 0xff2d // Kana Shift XK_Kana_Shift = 0xff2e // Alphanumeric Shift XK_Eisu_Shift = 0xff2f // Alphanumeric toggle XK_Eisu_toggle = 0xff30 // Codeinput XK_Kanji_Bangou = 0xff37 // Multiple/All Candidate(s) XK_Zen_Koho = 0xff3d // Previous Candidate XK_Mae_Koho = 0xff3e XK_Home = 0xff50 // Move left, left arrow XK_Left = 0xff51 // Move up, up arrow XK_Up = 0xff52 // Move right, right arrow XK_Right = 0xff53 // Move down, down arrow XK_Down = 0xff54 // Prior, previous XK_Prior = 0xff55 XK_Page_Up = 0xff55 // Next XK_Next = 0xff56 XK_Page_Down = 0xff56 // EOL XK_End = 0xff57 // BOL XK_Begin = 0xff58 // Select, mark XK_Select = 0xff60 XK_Print = 0xff61 // Execute, run, do XK_Execute = 0xff62 // Insert, insert here XK_Insert = 0xff63 XK_Undo = 0xff65 // Redo, again XK_Redo = 0xff66 XK_Menu = 0xff67 // Find, search XK_Find = 0xff68 // Cancel, stop, abort, exit XK_Cancel = 0xff69 // Help XK_Help = 0xff6a XK_Break = 0xff6b // Character set switch XK_Mode_switch = 0xff7e // Alias for mode_switch XK_script_switch = 0xff7e XK_Num_Lock = 0xff7f // Space XK_KP_Space = 0xff80 XK_KP_Tab = 0xff89 // Enter XK_KP_Enter = 0xff8d // PF1, KP_A, ... XK_KP_F1 = 0xff91 XK_KP_F2 = 0xff92 XK_KP_F3 = 0xff93 XK_KP_F4 = 0xff94 XK_KP_Home = 0xff95 XK_KP_Left = 0xff96 XK_KP_Up = 0xff97 XK_KP_Right = 0xff98 XK_KP_Down = 0xff99 XK_KP_Prior = 0xff9a XK_KP_Page_Up = 0xff9a XK_KP_Next = 0xff9b XK_KP_Page_Down = 0xff9b XK_KP_End = 0xff9c XK_KP_Begin = 0xff9d XK_KP_Insert = 0xff9e XK_KP_Delete = 0xff9f // Equals XK_KP_Equal = 0xffbd XK_KP_Multiply = 0xffaa XK_KP_Add = 0xffab // Separator, often comma XK_KP_Separator = 0xffac XK_KP_Subtract = 0xffad XK_KP_Decimal = 0xffae XK_KP_Divide = 0xffaf XK_KP_0 = 0xffb0 XK_KP_1 = 0xffb1 XK_KP_2 = 0xffb2 XK_KP_3 = 0xffb3 XK_KP_4 = 0xffb4 XK_KP_5 = 0xffb5 XK_KP_6 = 0xffb6 XK_KP_7 = 0xffb7 XK_KP_8 = 0xffb8 XK_KP_9 = 0xffb9 XK_F1 = 0xffbe XK_F2 = 0xffbf XK_F3 = 0xffc0 XK_F4 = 0xffc1 XK_F5 = 0xffc2 XK_F6 = 0xffc3 XK_F7 = 0xffc4 XK_F8 = 0xffc5 XK_F9 = 0xffc6 XK_F10 = 0xffc7 XK_F11 = 0xffc8 XK_L1 = 0xffc8 XK_F12 = 0xffc9 XK_L2 = 0xffc9 XK_F13 = 0xffca XK_L3 = 0xffca XK_F14 = 0xffcb XK_L4 = 0xffcb XK_F15 = 0xffcc XK_L5 = 0xffcc XK_F16 = 0xffcd XK_L6 = 0xffcd XK_F17 = 0xffce XK_L7 = 0xffce XK_F18 = 0xffcf XK_L8 = 0xffcf XK_F19 = 0xffd0 XK_L9 = 0xffd0 XK_F20 = 0xffd1 XK_L10 = 0xffd1 XK_F21 = 0xffd2 XK_R1 = 0xffd2 XK_F22 = 0xffd3 XK_R2 = 0xffd3 XK_F23 = 0xffd4 XK_R3 = 0xffd4 XK_F24 = 0xffd5 XK_R4 = 0xffd5 XK_F25 = 0xffd6 XK_R5 = 0xffd6 XK_F26 = 0xffd7 XK_R6 = 0xffd7 XK_F27 = 0xffd8 XK_R7 = 0xffd8 XK_F28 = 0xffd9 XK_R8 = 0xffd9 XK_F29 = 0xffda XK_R9 = 0xffda XK_F30 = 0xffdb XK_R10 = 0xffdb XK_F31 = 0xffdc XK_R11 = 0xffdc XK_F32 = 0xffdd XK_R12 = 0xffdd XK_F33 = 0xffde XK_R13 = 0xffde XK_F34 = 0xffdf XK_R14 = 0xffdf XK_F35 = 0xffe0 XK_R15 = 0xffe0 // Left shift XK_Shift_L = 0xffe1 // Right shift XK_Shift_R = 0xffe2 // Left control XK_Control_L = 0xffe3 // Right control XK_Control_R = 0xffe4 // Caps lock XK_Caps_Lock = 0xffe5 // Shift lock XK_Shift_Lock = 0xffe6 // Left meta XK_Meta_L = 0xffe7 // Right meta XK_Meta_R = 0xffe8 // Left alt XK_Alt_L = 0xffe9 // Right alt XK_Alt_R = 0xffea // Left super XK_Super_L = 0xffeb // Right super XK_Super_R = 0xffec // Left hyper XK_Hyper_L = 0xffed // Right hyper XK_Hyper_R = 0xffee XK_ISO_Lock = 0xfe01 XK_ISO_Level2_Latch = 0xfe02 XK_ISO_Level3_Shift = 0xfe03 XK_ISO_Level3_Latch = 0xfe04 XK_ISO_Level3_Lock = 0xfe05 XK_ISO_Level5_Shift = 0xfe11 XK_ISO_Level5_Latch = 0xfe12 XK_ISO_Level5_Lock = 0xfe13 // Alias for mode_switch XK_ISO_Group_Shift = 0xff7e XK_ISO_Group_Latch = 0xfe06 XK_ISO_Group_Lock = 0xfe07 XK_ISO_Next_Group = 0xfe08 XK_ISO_Next_Group_Lock = 0xfe09 XK_ISO_Prev_Group = 0xfe0a XK_ISO_Prev_Group_Lock = 0xfe0b XK_ISO_First_Group = 0xfe0c XK_ISO_First_Group_Lock = 0xfe0d XK_ISO_Last_Group = 0xfe0e XK_ISO_Last_Group_Lock = 0xfe0f XK_ISO_Left_Tab = 0xfe20 XK_ISO_Move_Line_Up = 0xfe21 XK_ISO_Move_Line_Down = 0xfe22 XK_ISO_Partial_Line_Up = 0xfe23 XK_ISO_Partial_Line_Down = 0xfe24 XK_ISO_Partial_Space_Left = 0xfe25 XK_ISO_Partial_Space_Right = 0xfe26 XK_ISO_Set_Margin_Left = 0xfe27 XK_ISO_Set_Margin_Right = 0xfe28 XK_ISO_Release_Margin_Left = 0xfe29 XK_ISO_Release_Margin_Right = 0xfe2a XK_ISO_Release_Both_Margins = 0xfe2b XK_ISO_Fast_Cursor_Left = 0xfe2c XK_ISO_Fast_Cursor_Right = 0xfe2d XK_ISO_Fast_Cursor_Up = 0xfe2e XK_ISO_Fast_Cursor_Down = 0xfe2f XK_ISO_Continuous_Underline = 0xfe30 XK_ISO_Discontinuous_Underline = 0xfe31 XK_ISO_Emphasize = 0xfe32 XK_ISO_Center_Object = 0xfe33 XK_ISO_Enter = 0xfe34 XK_dead_grave = 0xfe50 XK_dead_acute = 0xfe51 XK_dead_circumflex = 0xfe52 XK_dead_tilde = 0xfe53 // alias for dead_tilde XK_dead_perispomeni = 0xfe53 XK_dead_macron = 0xfe54 XK_dead_breve = 0xfe55 XK_dead_abovedot = 0xfe56 XK_dead_diaeresis = 0xfe57 XK_dead_abovering = 0xfe58 XK_dead_doubleacute = 0xfe59 XK_dead_caron = 0xfe5a XK_dead_cedilla = 0xfe5b XK_dead_ogonek = 0xfe5c XK_dead_iota = 0xfe5d XK_dead_voiced_sound = 0xfe5e XK_dead_semivoiced_sound = 0xfe5f XK_dead_belowdot = 0xfe60 XK_dead_hook = 0xfe61 XK_dead_horn = 0xfe62 XK_dead_stroke = 0xfe63 XK_dead_abovecomma = 0xfe64 // alias for dead_abovecomma XK_dead_psili = 0xfe64 XK_dead_abovereversedcomma = 0xfe65 // alias for dead_abovereversedcomma XK_dead_dasia = 0xfe65 XK_dead_doublegrave = 0xfe66 XK_dead_belowring = 0xfe67 XK_dead_belowmacron = 0xfe68 XK_dead_belowcircumflex = 0xfe69 XK_dead_belowtilde = 0xfe6a XK_dead_belowbreve = 0xfe6b XK_dead_belowdiaeresis = 0xfe6c XK_dead_invertedbreve = 0xfe6d XK_dead_belowcomma = 0xfe6e XK_dead_currency = 0xfe6f XK_dead_lowline = 0xfe90 XK_dead_aboveverticalline = 0xfe91 XK_dead_belowverticalline = 0xfe92 XK_dead_longsolidusoverlay = 0xfe93 XK_dead_a = 0xfe80 XK_dead_A = 0xfe81 XK_dead_e = 0xfe82 XK_dead_E = 0xfe83 XK_dead_i = 0xfe84 XK_dead_I = 0xfe85 XK_dead_o = 0xfe86 XK_dead_O = 0xfe87 XK_dead_u = 0xfe88 XK_dead_U = 0xfe89 XK_dead_small_schwa = 0xfe8a XK_dead_capital_schwa = 0xfe8b XK_dead_greek = 0xfe8c XK_First_Virtual_Screen = 0xfed0 XK_Prev_Virtual_Screen = 0xfed1 XK_Next_Virtual_Screen = 0xfed2 XK_Last_Virtual_Screen = 0xfed4 XK_Terminate_Server = 0xfed5 XK_AccessX_Enable = 0xfe70 XK_AccessX_Feedback_Enable = 0xfe71 XK_RepeatKeys_Enable = 0xfe72 XK_SlowKeys_Enable = 0xfe73 XK_BounceKeys_Enable = 0xfe74 XK_StickyKeys_Enable = 0xfe75 XK_MouseKeys_Enable = 0xfe76 XK_MouseKeys_Accel_Enable = 0xfe77 XK_Overlay1_Enable = 0xfe78 XK_Overlay2_Enable = 0xfe79 XK_AudibleBell_Enable = 0xfe7a XK_Pointer_Left = 0xfee0 XK_Pointer_Right = 0xfee1 XK_Pointer_Up = 0xfee2 XK_Pointer_Down = 0xfee3 XK_Pointer_UpLeft = 0xfee4 XK_Pointer_UpRight = 0xfee5 XK_Pointer_DownLeft = 0xfee6 XK_Pointer_DownRight = 0xfee7 XK_Pointer_Button_Dflt = 0xfee8 XK_Pointer_Button1 = 0xfee9 XK_Pointer_Button2 = 0xfeea XK_Pointer_Button3 = 0xfeeb XK_Pointer_Button4 = 0xfeec XK_Pointer_Button5 = 0xfeed XK_Pointer_DblClick_Dflt = 0xfeee XK_Pointer_DblClick1 = 0xfeef XK_Pointer_DblClick2 = 0xfef0 XK_Pointer_DblClick3 = 0xfef1 XK_Pointer_DblClick4 = 0xfef2 XK_Pointer_DblClick5 = 0xfef3 XK_Pointer_Drag_Dflt = 0xfef4 XK_Pointer_Drag1 = 0xfef5 XK_Pointer_Drag2 = 0xfef6 XK_Pointer_Drag3 = 0xfef7 XK_Pointer_Drag4 = 0xfef8 XK_Pointer_Drag5 = 0xfefd XK_Pointer_EnableKeys = 0xfef9 XK_Pointer_Accelerate = 0xfefa XK_Pointer_DfltBtnNext = 0xfefb XK_Pointer_DfltBtnPrev = 0xfefc XK_ch = 0xfea0 XK_Ch = 0xfea1 XK_CH = 0xfea2 XK_c_h = 0xfea3 XK_C_h = 0xfea4 XK_C_H = 0xfea5 // U+0020 SPACE XK_space = 0x0020 // U+0021 EXCLAMATION MARK XK_exclam = 0x0021 // U+0022 QUOTATION MARK XK_quotedbl = 0x0022 // U+0023 NUMBER SIGN XK_numbersign = 0x0023 // U+0024 DOLLAR SIGN XK_dollar = 0x0024 // U+0025 PERCENT SIGN XK_percent = 0x0025 // U+0026 AMPERSAND XK_ampersand = 0x0026 // U+0027 APOSTROPHE XK_apostrophe = 0x0027 // deprecated XK_quoteright = 0x0027 // U+0028 LEFT PARENTHESIS XK_parenleft = 0x0028 // U+0029 RIGHT PARENTHESIS XK_parenright = 0x0029 // U+002A ASTERISK XK_asterisk = 0x002a // U+002B PLUS SIGN XK_plus = 0x002b // U+002C COMMA XK_comma = 0x002c // U+002D HYPHEN-MINUS XK_minus = 0x002d // U+002E FULL STOP XK_period = 0x002e // U+002F SOLIDUS XK_slash = 0x002f // U+0030 DIGIT ZERO XK_0 = 0x0030 // U+0031 DIGIT ONE XK_1 = 0x0031 // U+0032 DIGIT TWO XK_2 = 0x0032 // U+0033 DIGIT THREE XK_3 = 0x0033 // U+0034 DIGIT FOUR XK_4 = 0x0034 // U+0035 DIGIT FIVE XK_5 = 0x0035 // U+0036 DIGIT SIX XK_6 = 0x0036 // U+0037 DIGIT SEVEN XK_7 = 0x0037 // U+0038 DIGIT EIGHT XK_8 = 0x0038 // U+0039 DIGIT NINE XK_9 = 0x0039 // U+003A COLON XK_colon = 0x003a // U+003B SEMICOLON XK_semicolon = 0x003b // U+003C LESS-THAN SIGN XK_less = 0x003c // U+003D EQUALS SIGN XK_equal = 0x003d // U+003E GREATER-THAN SIGN XK_greater = 0x003e // U+003F QUESTION MARK XK_question = 0x003f // U+0040 COMMERCIAL AT XK_at = 0x0040 // U+0041 LATIN CAPITAL LETTER A XK_A = 0x0041 // U+0042 LATIN CAPITAL LETTER B XK_B = 0x0042 // U+0043 LATIN CAPITAL LETTER C XK_C = 0x0043 // U+0044 LATIN CAPITAL LETTER D XK_D = 0x0044 // U+0045 LATIN CAPITAL LETTER E XK_E = 0x0045 // U+0046 LATIN CAPITAL LETTER F XK_F = 0x0046 // U+0047 LATIN CAPITAL LETTER G XK_G = 0x0047 // U+0048 LATIN CAPITAL LETTER H XK_H = 0x0048 // U+0049 LATIN CAPITAL LETTER I XK_I = 0x0049 // U+004A LATIN CAPITAL LETTER J XK_J = 0x004a // U+004B LATIN CAPITAL LETTER K XK_K = 0x004b // U+004C LATIN CAPITAL LETTER L XK_L = 0x004c // U+004D LATIN CAPITAL LETTER M XK_M = 0x004d // U+004E LATIN CAPITAL LETTER N XK_N = 0x004e // U+004F LATIN CAPITAL LETTER O XK_O = 0x004f // U+0050 LATIN CAPITAL LETTER P XK_P = 0x0050 // U+0051 LATIN CAPITAL LETTER Q XK_Q = 0x0051 // U+0052 LATIN CAPITAL LETTER R XK_R = 0x0052 // U+0053 LATIN CAPITAL LETTER S XK_S = 0x0053 // U+0054 LATIN CAPITAL LETTER T XK_T = 0x0054 // U+0055 LATIN CAPITAL LETTER U XK_U = 0x0055 // U+0056 LATIN CAPITAL LETTER V XK_V = 0x0056 // U+0057 LATIN CAPITAL LETTER W XK_W = 0x0057 // U+0058 LATIN CAPITAL LETTER X XK_X = 0x0058 // U+0059 LATIN CAPITAL LETTER Y XK_Y = 0x0059 // U+005A LATIN CAPITAL LETTER Z XK_Z = 0x005a // U+005B LEFT SQUARE BRACKET XK_bracketleft = 0x005b // U+005C REVERSE SOLIDUS XK_backslash = 0x005c // U+005D RIGHT SQUARE BRACKET XK_bracketright = 0x005d // U+005E CIRCUMFLEX ACCENT XK_asciicircum = 0x005e // U+005F LOW LINE XK_underscore = 0x005f // U+0060 GRAVE ACCENT XK_grave = 0x0060 // deprecated XK_quoteleft = 0x0060 // U+0061 LATIN SMALL LETTER A XK_a = 0x0061 // U+0062 LATIN SMALL LETTER B XK_b = 0x0062 // U+0063 LATIN SMALL LETTER C XK_c = 0x0063 // U+0064 LATIN SMALL LETTER D XK_d = 0x0064 // U+0065 LATIN SMALL LETTER E XK_e = 0x0065 // U+0066 LATIN SMALL LETTER F XK_f = 0x0066 // U+0067 LATIN SMALL LETTER G XK_g = 0x0067 // U+0068 LATIN SMALL LETTER H XK_h = 0x0068 // U+0069 LATIN SMALL LETTER I XK_i = 0x0069 // U+006A LATIN SMALL LETTER J XK_j = 0x006a // U+006B LATIN SMALL LETTER K XK_k = 0x006b // U+006C LATIN SMALL LETTER L XK_l = 0x006c // U+006D LATIN SMALL LETTER M XK_m = 0x006d // U+006E LATIN SMALL LETTER N XK_n = 0x006e // U+006F LATIN SMALL LETTER O XK_o = 0x006f // U+0070 LATIN SMALL LETTER P XK_p = 0x0070 // U+0071 LATIN SMALL LETTER Q XK_q = 0x0071 // U+0072 LATIN SMALL LETTER R XK_r = 0x0072 // U+0073 LATIN SMALL LETTER S XK_s = 0x0073 // U+0074 LATIN SMALL LETTER T XK_t = 0x0074 // U+0075 LATIN SMALL LETTER U XK_u = 0x0075 // U+0076 LATIN SMALL LETTER V XK_v = 0x0076 // U+0077 LATIN SMALL LETTER W XK_w = 0x0077 // U+0078 LATIN SMALL LETTER X XK_x = 0x0078 // U+0079 LATIN SMALL LETTER Y XK_y = 0x0079 // U+007A LATIN SMALL LETTER Z XK_z = 0x007a // U+007B LEFT CURLY BRACKET XK_braceleft = 0x007b // U+007C VERTICAL LINE XK_bar = 0x007c // U+007D RIGHT CURLY BRACKET XK_braceright = 0x007d // U+007E TILDE XK_asciitilde = 0x007e // U+00A0 NO-BREAK SPACE XK_nobreakspace = 0x00a0 // U+00A1 INVERTED EXCLAMATION MARK XK_exclamdown = 0x00a1 // U+00A2 CENT SIGN XK_cent = 0x00a2 // U+00A3 POUND SIGN XK_sterling = 0x00a3 // U+00A4 CURRENCY SIGN XK_currency = 0x00a4 // U+00A5 YEN SIGN XK_yen = 0x00a5 // U+00A6 BROKEN BAR XK_brokenbar = 0x00a6 // U+00A7 SECTION SIGN XK_section = 0x00a7 // U+00A8 DIAERESIS XK_diaeresis = 0x00a8 // U+00A9 COPYRIGHT SIGN XK_copyright = 0x00a9 // U+00AA FEMININE ORDINAL INDICATOR XK_ordfeminine = 0x00aa // U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK XK_guillemotleft = 0x00ab // U+00AC NOT SIGN XK_notsign = 0x00ac // U+00AD SOFT HYPHEN XK_hyphen = 0x00ad // U+00AE REGISTERED SIGN XK_registered = 0x00ae // U+00AF MACRON XK_macron = 0x00af // U+00B0 DEGREE SIGN XK_degree = 0x00b0 // U+00B1 PLUS-MINUS SIGN XK_plusminus = 0x00b1 // U+00B2 SUPERSCRIPT TWO XK_twosuperior = 0x00b2 // U+00B3 SUPERSCRIPT THREE XK_threesuperior = 0x00b3 // U+00B4 ACUTE ACCENT XK_acute = 0x00b4 // U+00B5 MICRO SIGN XK_mu = 0x00b5 // U+00B6 PILCROW SIGN XK_paragraph = 0x00b6 // U+00B7 MIDDLE DOT XK_periodcentered = 0x00b7 // U+00B8 CEDILLA XK_cedilla = 0x00b8 // U+00B9 SUPERSCRIPT ONE XK_onesuperior = 0x00b9 // U+00BA MASCULINE ORDINAL INDICATOR XK_masculine = 0x00ba // U+00BB RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK XK_guillemotright = 0x00bb // U+00BC VULGAR FRACTION ONE QUARTER XK_onequarter = 0x00bc // U+00BD VULGAR FRACTION ONE HALF XK_onehalf = 0x00bd // U+00BE VULGAR FRACTION THREE QUARTERS XK_threequarters = 0x00be // U+00BF INVERTED QUESTION MARK XK_questiondown = 0x00bf // U+00C0 LATIN CAPITAL LETTER A WITH GRAVE XK_Agrave = 0x00c0 // U+00C1 LATIN CAPITAL LETTER A WITH ACUTE XK_Aacute = 0x00c1 // U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX XK_Acircumflex = 0x00c2 // U+00C3 LATIN CAPITAL LETTER A WITH TILDE XK_Atilde = 0x00c3 // U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS XK_Adiaeresis = 0x00c4 // U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE XK_Aring = 0x00c5 // U+00C6 LATIN CAPITAL LETTER AE XK_AE = 0x00c6 // U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA XK_Ccedilla = 0x00c7 // U+00C8 LATIN CAPITAL LETTER E WITH GRAVE XK_Egrave = 0x00c8 // U+00C9 LATIN CAPITAL LETTER E WITH ACUTE XK_Eacute = 0x00c9 // U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX XK_Ecircumflex = 0x00ca // U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS XK_Ediaeresis = 0x00cb // U+00CC LATIN CAPITAL LETTER I WITH GRAVE XK_Igrave = 0x00cc // U+00CD LATIN CAPITAL LETTER I WITH ACUTE XK_Iacute = 0x00cd // U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX XK_Icircumflex = 0x00ce // U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS XK_Idiaeresis = 0x00cf // U+00D0 LATIN CAPITAL LETTER ETH XK_ETH = 0x00d0 // deprecated XK_Eth = 0x00d0 // U+00D1 LATIN CAPITAL LETTER N WITH TILDE XK_Ntilde = 0x00d1 // U+00D2 LATIN CAPITAL LETTER O WITH GRAVE XK_Ograve = 0x00d2 // U+00D3 LATIN CAPITAL LETTER O WITH ACUTE XK_Oacute = 0x00d3 // U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX XK_Ocircumflex = 0x00d4 // U+00D5 LATIN CAPITAL LETTER O WITH TILDE XK_Otilde = 0x00d5 // U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS XK_Odiaeresis = 0x00d6 // U+00D7 MULTIPLICATION SIGN XK_multiply = 0x00d7 // U+00D8 LATIN CAPITAL LETTER O WITH STROKE XK_Oslash = 0x00d8 // U+00D8 LATIN CAPITAL LETTER O WITH STROKE XK_Ooblique = 0x00d8 // U+00D9 LATIN CAPITAL LETTER U WITH GRAVE XK_Ugrave = 0x00d9 // U+00DA LATIN CAPITAL LETTER U WITH ACUTE XK_Uacute = 0x00da // U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX XK_Ucircumflex = 0x00db // U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS XK_Udiaeresis = 0x00dc // U+00DD LATIN CAPITAL LETTER Y WITH ACUTE XK_Yacute = 0x00dd // U+00DE LATIN CAPITAL LETTER THORN XK_THORN = 0x00de // deprecated XK_Thorn = 0x00de // U+00DF LATIN SMALL LETTER SHARP S XK_ssharp = 0x00df // U+00E0 LATIN SMALL LETTER A WITH GRAVE XK_agrave = 0x00e0 // U+00E1 LATIN SMALL LETTER A WITH ACUTE XK_aacute = 0x00e1 // U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX XK_acircumflex = 0x00e2 // U+00E3 LATIN SMALL LETTER A WITH TILDE XK_atilde = 0x00e3 // U+00E4 LATIN SMALL LETTER A WITH DIAERESIS XK_adiaeresis = 0x00e4 // U+00E5 LATIN SMALL LETTER A WITH RING ABOVE XK_aring = 0x00e5 // U+00E6 LATIN SMALL LETTER AE XK_ae = 0x00e6 // U+00E7 LATIN SMALL LETTER C WITH CEDILLA XK_ccedilla = 0x00e7 // U+00E8 LATIN SMALL LETTER E WITH GRAVE XK_egrave = 0x00e8 // U+00E9 LATIN SMALL LETTER E WITH ACUTE XK_eacute = 0x00e9 // U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX XK_ecircumflex = 0x00ea // U+00EB LATIN SMALL LETTER E WITH DIAERESIS XK_ediaeresis = 0x00eb // U+00EC LATIN SMALL LETTER I WITH GRAVE XK_igrave = 0x00ec // U+00ED LATIN SMALL LETTER I WITH ACUTE XK_iacute = 0x00ed // U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX XK_icircumflex = 0x00ee // U+00EF LATIN SMALL LETTER I WITH DIAERESIS XK_idiaeresis = 0x00ef // U+00F0 LATIN SMALL LETTER ETH XK_eth = 0x00f0 // U+00F1 LATIN SMALL LETTER N WITH TILDE XK_ntilde = 0x00f1 // U+00F2 LATIN SMALL LETTER O WITH GRAVE XK_ograve = 0x00f2 // U+00F3 LATIN SMALL LETTER O WITH ACUTE XK_oacute = 0x00f3 // U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX XK_ocircumflex = 0x00f4 // U+00F5 LATIN SMALL LETTER O WITH TILDE XK_otilde = 0x00f5 // U+00F6 LATIN SMALL LETTER O WITH DIAERESIS XK_odiaeresis = 0x00f6 // U+00F7 DIVISION SIGN XK_division = 0x00f7 // U+00F8 LATIN SMALL LETTER O WITH STROKE XK_oslash = 0x00f8 // U+00F8 LATIN SMALL LETTER O WITH STROKE XK_ooblique = 0x00f8 // U+00F9 LATIN SMALL LETTER U WITH GRAVE XK_ugrave = 0x00f9 // U+00FA LATIN SMALL LETTER U WITH ACUTE XK_uacute = 0x00fa // U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX XK_ucircumflex = 0x00fb // U+00FC LATIN SMALL LETTER U WITH DIAERESIS XK_udiaeresis = 0x00fc // U+00FD LATIN SMALL LETTER Y WITH ACUTE XK_yacute = 0x00fd // U+00FE LATIN SMALL LETTER THORN XK_thorn = 0x00fe // U+00FF LATIN SMALL LETTER Y WITH DIAERESIS XK_ydiaeresis = 0x00ff // U+0104 LATIN CAPITAL LETTER A WITH OGONEK XK_Aogonek = 0x01a1 // U+02D8 BREVE XK_breve = 0x01a2 // U+0141 LATIN CAPITAL LETTER L WITH STROKE XK_Lstroke = 0x01a3 // U+013D LATIN CAPITAL LETTER L WITH CARON XK_Lcaron = 0x01a5 // U+015A LATIN CAPITAL LETTER S WITH ACUTE XK_Sacute = 0x01a6 // U+0160 LATIN CAPITAL LETTER S WITH CARON XK_Scaron = 0x01a9 // U+015E LATIN CAPITAL LETTER S WITH CEDILLA XK_Scedilla = 0x01aa // U+0164 LATIN CAPITAL LETTER T WITH CARON XK_Tcaron = 0x01ab // U+0179 LATIN CAPITAL LETTER Z WITH ACUTE XK_Zacute = 0x01ac // U+017D LATIN CAPITAL LETTER Z WITH CARON XK_Zcaron = 0x01ae // U+017B LATIN CAPITAL LETTER Z WITH DOT ABOVE XK_Zabovedot = 0x01af // U+0105 LATIN SMALL LETTER A WITH OGONEK XK_aogonek = 0x01b1 // U+02DB OGONEK XK_ogonek = 0x01b2 // U+0142 LATIN SMALL LETTER L WITH STROKE XK_lstroke = 0x01b3 // U+013E LATIN SMALL LETTER L WITH CARON XK_lcaron = 0x01b5 // U+015B LATIN SMALL LETTER S WITH ACUTE XK_sacute = 0x01b6 // U+02C7 CARON XK_caron = 0x01b7 // U+0161 LATIN SMALL LETTER S WITH CARON XK_scaron = 0x01b9 // U+015F LATIN SMALL LETTER S WITH CEDILLA XK_scedilla = 0x01ba // U+0165 LATIN SMALL LETTER T WITH CARON XK_tcaron = 0x01bb // U+017A LATIN SMALL LETTER Z WITH ACUTE XK_zacute = 0x01bc // U+02DD DOUBLE ACUTE ACCENT XK_doubleacute = 0x01bd // U+017E LATIN SMALL LETTER Z WITH CARON XK_zcaron = 0x01be // U+017C LATIN SMALL LETTER Z WITH DOT ABOVE XK_zabovedot = 0x01bf // U+0154 LATIN CAPITAL LETTER R WITH ACUTE XK_Racute = 0x01c0 // U+0102 LATIN CAPITAL LETTER A WITH BREVE XK_Abreve = 0x01c3 // U+0139 LATIN CAPITAL LETTER L WITH ACUTE XK_Lacute = 0x01c5 // U+0106 LATIN CAPITAL LETTER C WITH ACUTE XK_Cacute = 0x01c6 // U+010C LATIN CAPITAL LETTER C WITH CARON XK_Ccaron = 0x01c8 // U+0118 LATIN CAPITAL LETTER E WITH OGONEK XK_Eogonek = 0x01ca // U+011A LATIN CAPITAL LETTER E WITH CARON XK_Ecaron = 0x01cc // U+010E LATIN CAPITAL LETTER D WITH CARON XK_Dcaron = 0x01cf // U+0110 LATIN CAPITAL LETTER D WITH STROKE XK_Dstroke = 0x01d0 // U+0143 LATIN CAPITAL LETTER N WITH ACUTE XK_Nacute = 0x01d1 // U+0147 LATIN CAPITAL LETTER N WITH CARON XK_Ncaron = 0x01d2 // U+0150 LATIN CAPITAL LETTER O WITH DOUBLE ACUTE XK_Odoubleacute = 0x01d5 // U+0158 LATIN CAPITAL LETTER R WITH CARON XK_Rcaron = 0x01d8 // U+016E LATIN CAPITAL LETTER U WITH RING ABOVE XK_Uring = 0x01d9 // U+0170 LATIN CAPITAL LETTER U WITH DOUBLE ACUTE XK_Udoubleacute = 0x01db // U+0162 LATIN CAPITAL LETTER T WITH CEDILLA XK_Tcedilla = 0x01de // U+0155 LATIN SMALL LETTER R WITH ACUTE XK_racute = 0x01e0 // U+0103 LATIN SMALL LETTER A WITH BREVE XK_abreve = 0x01e3 // U+013A LATIN SMALL LETTER L WITH ACUTE XK_lacute = 0x01e5 // U+0107 LATIN SMALL LETTER C WITH ACUTE XK_cacute = 0x01e6 // U+010D LATIN SMALL LETTER C WITH CARON XK_ccaron = 0x01e8 // U+0119 LATIN SMALL LETTER E WITH OGONEK XK_eogonek = 0x01ea // U+011B LATIN SMALL LETTER E WITH CARON XK_ecaron = 0x01ec // U+010F LATIN SMALL LETTER D WITH CARON XK_dcaron = 0x01ef // U+0111 LATIN SMALL LETTER D WITH STROKE XK_dstroke = 0x01f0 // U+0144 LATIN SMALL LETTER N WITH ACUTE XK_nacute = 0x01f1 // U+0148 LATIN SMALL LETTER N WITH CARON XK_ncaron = 0x01f2 // U+0151 LATIN SMALL LETTER O WITH DOUBLE ACUTE XK_odoubleacute = 0x01f5 // U+0159 LATIN SMALL LETTER R WITH CARON XK_rcaron = 0x01f8 // U+016F LATIN SMALL LETTER U WITH RING ABOVE XK_uring = 0x01f9 // U+0171 LATIN SMALL LETTER U WITH DOUBLE ACUTE XK_udoubleacute = 0x01fb // U+0163 LATIN SMALL LETTER T WITH CEDILLA XK_tcedilla = 0x01fe // U+02D9 DOT ABOVE XK_abovedot = 0x01ff // U+0126 LATIN CAPITAL LETTER H WITH STROKE XK_Hstroke = 0x02a1 // U+0124 LATIN CAPITAL LETTER H WITH CIRCUMFLEX XK_Hcircumflex = 0x02a6 // U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE XK_Iabovedot = 0x02a9 // U+011E LATIN CAPITAL LETTER G WITH BREVE XK_Gbreve = 0x02ab // U+0134 LATIN CAPITAL LETTER J WITH CIRCUMFLEX XK_Jcircumflex = 0x02ac // U+0127 LATIN SMALL LETTER H WITH STROKE XK_hstroke = 0x02b1 // U+0125 LATIN SMALL LETTER H WITH CIRCUMFLEX XK_hcircumflex = 0x02b6 // U+0131 LATIN SMALL LETTER DOTLESS I XK_idotless = 0x02b9 // U+011F LATIN SMALL LETTER G WITH BREVE XK_gbreve = 0x02bb // U+0135 LATIN SMALL LETTER J WITH CIRCUMFLEX XK_jcircumflex = 0x02bc // U+010A LATIN CAPITAL LETTER C WITH DOT ABOVE XK_Cabovedot = 0x02c5 // U+0108 LATIN CAPITAL LETTER C WITH CIRCUMFLEX XK_Ccircumflex = 0x02c6 // U+0120 LATIN CAPITAL LETTER G WITH DOT ABOVE XK_Gabovedot = 0x02d5 // U+011C LATIN CAPITAL LETTER G WITH CIRCUMFLEX XK_Gcircumflex = 0x02d8 // U+016C LATIN CAPITAL LETTER U WITH BREVE XK_Ubreve = 0x02dd // U+015C LATIN CAPITAL LETTER S WITH CIRCUMFLEX XK_Scircumflex = 0x02de // U+010B LATIN SMALL LETTER C WITH DOT ABOVE XK_cabovedot = 0x02e5 // U+0109 LATIN SMALL LETTER C WITH CIRCUMFLEX XK_ccircumflex = 0x02e6 // U+0121 LATIN SMALL LETTER G WITH DOT ABOVE XK_gabovedot = 0x02f5 // U+011D LATIN SMALL LETTER G WITH CIRCUMFLEX XK_gcircumflex = 0x02f8 // U+016D LATIN SMALL LETTER U WITH BREVE XK_ubreve = 0x02fd // U+015D LATIN SMALL LETTER S WITH CIRCUMFLEX XK_scircumflex = 0x02fe // U+0138 LATIN SMALL LETTER KRA XK_kra = 0x03a2 // deprecated XK_kappa = 0x03a2 // U+0156 LATIN CAPITAL LETTER R WITH CEDILLA XK_Rcedilla = 0x03a3 // U+0128 LATIN CAPITAL LETTER I WITH TILDE XK_Itilde = 0x03a5 // U+013B LATIN CAPITAL LETTER L WITH CEDILLA XK_Lcedilla = 0x03a6 // U+0112 LATIN CAPITAL LETTER E WITH MACRON XK_Emacron = 0x03aa // U+0122 LATIN CAPITAL LETTER G WITH CEDILLA XK_Gcedilla = 0x03ab // U+0166 LATIN CAPITAL LETTER T WITH STROKE XK_Tslash = 0x03ac // U+0157 LATIN SMALL LETTER R WITH CEDILLA XK_rcedilla = 0x03b3 // U+0129 LATIN SMALL LETTER I WITH TILDE XK_itilde = 0x03b5 // U+013C LATIN SMALL LETTER L WITH CEDILLA XK_lcedilla = 0x03b6 // U+0113 LATIN SMALL LETTER E WITH MACRON XK_emacron = 0x03ba // U+0123 LATIN SMALL LETTER G WITH CEDILLA XK_gcedilla = 0x03bb // U+0167 LATIN SMALL LETTER T WITH STROKE XK_tslash = 0x03bc // U+014A LATIN CAPITAL LETTER ENG XK_ENG = 0x03bd // U+014B LATIN SMALL LETTER ENG XK_eng = 0x03bf // U+0100 LATIN CAPITAL LETTER A WITH MACRON XK_Amacron = 0x03c0 // U+012E LATIN CAPITAL LETTER I WITH OGONEK XK_Iogonek = 0x03c7 // U+0116 LATIN CAPITAL LETTER E WITH DOT ABOVE XK_Eabovedot = 0x03cc // U+012A LATIN CAPITAL LETTER I WITH MACRON XK_Imacron = 0x03cf // U+0145 LATIN CAPITAL LETTER N WITH CEDILLA XK_Ncedilla = 0x03d1 // U+014C LATIN CAPITAL LETTER O WITH MACRON XK_Omacron = 0x03d2 // U+0136 LATIN CAPITAL LETTER K WITH CEDILLA XK_Kcedilla = 0x03d3 // U+0172 LATIN CAPITAL LETTER U WITH OGONEK XK_Uogonek = 0x03d9 // U+0168 LATIN CAPITAL LETTER U WITH TILDE XK_Utilde = 0x03dd // U+016A LATIN CAPITAL LETTER U WITH MACRON XK_Umacron = 0x03de // U+0101 LATIN SMALL LETTER A WITH MACRON XK_amacron = 0x03e0 // U+012F LATIN SMALL LETTER I WITH OGONEK XK_iogonek = 0x03e7 // U+0117 LATIN SMALL LETTER E WITH DOT ABOVE XK_eabovedot = 0x03ec // U+012B LATIN SMALL LETTER I WITH MACRON XK_imacron = 0x03ef // U+0146 LATIN SMALL LETTER N WITH CEDILLA XK_ncedilla = 0x03f1 // U+014D LATIN SMALL LETTER O WITH MACRON XK_omacron = 0x03f2 // U+0137 LATIN SMALL LETTER K WITH CEDILLA XK_kcedilla = 0x03f3 // U+0173 LATIN SMALL LETTER U WITH OGONEK XK_uogonek = 0x03f9 // U+0169 LATIN SMALL LETTER U WITH TILDE XK_utilde = 0x03fd // U+016B LATIN SMALL LETTER U WITH MACRON XK_umacron = 0x03fe // U+0174 LATIN CAPITAL LETTER W WITH CIRCUMFLEX XK_Wcircumflex = 0x1000174 // U+0175 LATIN SMALL LETTER W WITH CIRCUMFLEX XK_wcircumflex = 0x1000175 // U+0176 LATIN CAPITAL LETTER Y WITH CIRCUMFLEX XK_Ycircumflex = 0x1000176 // U+0177 LATIN SMALL LETTER Y WITH CIRCUMFLEX XK_ycircumflex = 0x1000177 // U+1E02 LATIN CAPITAL LETTER B WITH DOT ABOVE XK_Babovedot = 0x1001e02 // U+1E03 LATIN SMALL LETTER B WITH DOT ABOVE XK_babovedot = 0x1001e03 // U+1E0A LATIN CAPITAL LETTER D WITH DOT ABOVE XK_Dabovedot = 0x1001e0a // U+1E0B LATIN SMALL LETTER D WITH DOT ABOVE XK_dabovedot = 0x1001e0b // U+1E1E LATIN CAPITAL LETTER F WITH DOT ABOVE XK_Fabovedot = 0x1001e1e // U+1E1F LATIN SMALL LETTER F WITH DOT ABOVE XK_fabovedot = 0x1001e1f // U+1E40 LATIN CAPITAL LETTER M WITH DOT ABOVE XK_Mabovedot = 0x1001e40 // U+1E41 LATIN SMALL LETTER M WITH DOT ABOVE XK_mabovedot = 0x1001e41 // U+1E56 LATIN CAPITAL LETTER P WITH DOT ABOVE XK_Pabovedot = 0x1001e56 // U+1E57 LATIN SMALL LETTER P WITH DOT ABOVE XK_pabovedot = 0x1001e57 // U+1E60 LATIN CAPITAL LETTER S WITH DOT ABOVE XK_Sabovedot = 0x1001e60 // U+1E61 LATIN SMALL LETTER S WITH DOT ABOVE XK_sabovedot = 0x1001e61 // U+1E6A LATIN CAPITAL LETTER T WITH DOT ABOVE XK_Tabovedot = 0x1001e6a // U+1E6B LATIN SMALL LETTER T WITH DOT ABOVE XK_tabovedot = 0x1001e6b // U+1E80 LATIN CAPITAL LETTER W WITH GRAVE XK_Wgrave = 0x1001e80 // U+1E81 LATIN SMALL LETTER W WITH GRAVE XK_wgrave = 0x1001e81 // U+1E82 LATIN CAPITAL LETTER W WITH ACUTE XK_Wacute = 0x1001e82 // U+1E83 LATIN SMALL LETTER W WITH ACUTE XK_wacute = 0x1001e83 // U+1E84 LATIN CAPITAL LETTER W WITH DIAERESIS XK_Wdiaeresis = 0x1001e84 // U+1E85 LATIN SMALL LETTER W WITH DIAERESIS XK_wdiaeresis = 0x1001e85 // U+1EF2 LATIN CAPITAL LETTER Y WITH GRAVE XK_Ygrave = 0x1001ef2 // U+1EF3 LATIN SMALL LETTER Y WITH GRAVE XK_ygrave = 0x1001ef3 // U+0152 LATIN CAPITAL LIGATURE OE XK_OE = 0x13bc // U+0153 LATIN SMALL LIGATURE OE XK_oe = 0x13bd // U+0178 LATIN CAPITAL LETTER Y WITH DIAERESIS XK_Ydiaeresis = 0x13be // U+203E OVERLINE XK_overline = 0x047e // U+3002 IDEOGRAPHIC FULL STOP XK_kana_fullstop = 0x04a1 // U+300C LEFT CORNER BRACKET XK_kana_openingbracket = 0x04a2 // U+300D RIGHT CORNER BRACKET XK_kana_closingbracket = 0x04a3 // U+3001 IDEOGRAPHIC COMMA XK_kana_comma = 0x04a4 // U+30FB KATAKANA MIDDLE DOT XK_kana_conjunctive = 0x04a5 // deprecated XK_kana_middledot = 0x04a5 // U+30F2 KATAKANA LETTER WO XK_kana_WO = 0x04a6 // U+30A1 KATAKANA LETTER SMALL A XK_kana_a = 0x04a7 // U+30A3 KATAKANA LETTER SMALL I XK_kana_i = 0x04a8 // U+30A5 KATAKANA LETTER SMALL U XK_kana_u = 0x04a9 // U+30A7 KATAKANA LETTER SMALL E XK_kana_e = 0x04aa // U+30A9 KATAKANA LETTER SMALL O XK_kana_o = 0x04ab // U+30E3 KATAKANA LETTER SMALL YA XK_kana_ya = 0x04ac // U+30E5 KATAKANA LETTER SMALL YU XK_kana_yu = 0x04ad // U+30E7 KATAKANA LETTER SMALL YO XK_kana_yo = 0x04ae // U+30C3 KATAKANA LETTER SMALL TU XK_kana_tsu = 0x04af // deprecated XK_kana_tu = 0x04af // U+30FC KATAKANA-HIRAGANA PROLONGED SOUND MARK XK_prolongedsound = 0x04b0 // U+30A2 KATAKANA LETTER A XK_kana_A = 0x04b1 // U+30A4 KATAKANA LETTER I XK_kana_I = 0x04b2 // U+30A6 KATAKANA LETTER U XK_kana_U = 0x04b3 // U+30A8 KATAKANA LETTER E XK_kana_E = 0x04b4 // U+30AA KATAKANA LETTER O XK_kana_O = 0x04b5 // U+30AB KATAKANA LETTER KA XK_kana_KA = 0x04b6 // U+30AD KATAKANA LETTER KI XK_kana_KI = 0x04b7 // U+30AF KATAKANA LETTER KU XK_kana_KU = 0x04b8 // U+30B1 KATAKANA LETTER KE XK_kana_KE = 0x04b9 // U+30B3 KATAKANA LETTER KO XK_kana_KO = 0x04ba // U+30B5 KATAKANA LETTER SA XK_kana_SA = 0x04bb // U+30B7 KATAKANA LETTER SI XK_kana_SHI = 0x04bc // U+30B9 KATAKANA LETTER SU XK_kana_SU = 0x04bd // U+30BB KATAKANA LETTER SE XK_kana_SE = 0x04be // U+30BD KATAKANA LETTER SO XK_kana_SO = 0x04bf // U+30BF KATAKANA LETTER TA XK_kana_TA = 0x04c0 // U+30C1 KATAKANA LETTER TI XK_kana_CHI = 0x04c1 // deprecated XK_kana_TI = 0x04c1 // U+30C4 KATAKANA LETTER TU XK_kana_TSU = 0x04c2 // deprecated XK_kana_TU = 0x04c2 // U+30C6 KATAKANA LETTER TE XK_kana_TE = 0x04c3 // U+30C8 KATAKANA LETTER TO XK_kana_TO = 0x04c4 // U+30CA KATAKANA LETTER NA XK_kana_NA = 0x04c5 // U+30CB KATAKANA LETTER NI XK_kana_NI = 0x04c6 // U+30CC KATAKANA LETTER NU XK_kana_NU = 0x04c7 // U+30CD KATAKANA LETTER NE XK_kana_NE = 0x04c8 // U+30CE KATAKANA LETTER NO XK_kana_NO = 0x04c9 // U+30CF KATAKANA LETTER HA XK_kana_HA = 0x04ca // U+30D2 KATAKANA LETTER HI XK_kana_HI = 0x04cb // U+30D5 KATAKANA LETTER HU XK_kana_FU = 0x04cc // deprecated XK_kana_HU = 0x04cc // U+30D8 KATAKANA LETTER HE XK_kana_HE = 0x04cd // U+30DB KATAKANA LETTER HO XK_kana_HO = 0x04ce // U+30DE KATAKANA LETTER MA XK_kana_MA = 0x04cf // U+30DF KATAKANA LETTER MI XK_kana_MI = 0x04d0 // U+30E0 KATAKANA LETTER MU XK_kana_MU = 0x04d1 // U+30E1 KATAKANA LETTER ME XK_kana_ME = 0x04d2 // U+30E2 KATAKANA LETTER MO XK_kana_MO = 0x04d3 // U+30E4 KATAKANA LETTER YA XK_kana_YA = 0x04d4 // U+30E6 KATAKANA LETTER YU XK_kana_YU = 0x04d5 // U+30E8 KATAKANA LETTER YO XK_kana_YO = 0x04d6 // U+30E9 KATAKANA LETTER RA XK_kana_RA = 0x04d7 // U+30EA KATAKANA LETTER RI XK_kana_RI = 0x04d8 // U+30EB KATAKANA LETTER RU XK_kana_RU = 0x04d9 // U+30EC KATAKANA LETTER RE XK_kana_RE = 0x04da // U+30ED KATAKANA LETTER RO XK_kana_RO = 0x04db // U+30EF KATAKANA LETTER WA XK_kana_WA = 0x04dc // U+30F3 KATAKANA LETTER N XK_kana_N = 0x04dd // U+309B KATAKANA-HIRAGANA VOICED SOUND MARK XK_voicedsound = 0x04de // U+309C KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK XK_semivoicedsound = 0x04df // Alias for mode_switch XK_kana_switch = 0xff7e // U+06F0 EXTENDED ARABIC-INDIC DIGIT ZERO XK_Farsi_0 = 0x10006f0 // U+06F1 EXTENDED ARABIC-INDIC DIGIT ONE XK_Farsi_1 = 0x10006f1 // U+06F2 EXTENDED ARABIC-INDIC DIGIT TWO XK_Farsi_2 = 0x10006f2 // U+06F3 EXTENDED ARABIC-INDIC DIGIT THREE XK_Farsi_3 = 0x10006f3 // U+06F4 EXTENDED ARABIC-INDIC DIGIT FOUR XK_Farsi_4 = 0x10006f4 // U+06F5 EXTENDED ARABIC-INDIC DIGIT FIVE XK_Farsi_5 = 0x10006f5 // U+06F6 EXTENDED ARABIC-INDIC DIGIT SIX XK_Farsi_6 = 0x10006f6 // U+06F7 EXTENDED ARABIC-INDIC DIGIT SEVEN XK_Farsi_7 = 0x10006f7 // U+06F8 EXTENDED ARABIC-INDIC DIGIT EIGHT XK_Farsi_8 = 0x10006f8 // U+06F9 EXTENDED ARABIC-INDIC DIGIT NINE XK_Farsi_9 = 0x10006f9 // U+066A ARABIC PERCENT SIGN XK_Arabic_percent = 0x100066a // U+0670 ARABIC LETTER SUPERSCRIPT ALEF XK_Arabic_superscript_alef = 0x1000670 // U+0679 ARABIC LETTER TTEH XK_Arabic_tteh = 0x1000679 // U+067E ARABIC LETTER PEH XK_Arabic_peh = 0x100067e // U+0686 ARABIC LETTER TCHEH XK_Arabic_tcheh = 0x1000686 // U+0688 ARABIC LETTER DDAL XK_Arabic_ddal = 0x1000688 // U+0691 ARABIC LETTER RREH XK_Arabic_rreh = 0x1000691 // U+060C ARABIC COMMA XK_Arabic_comma = 0x05ac // U+06D4 ARABIC FULL STOP XK_Arabic_fullstop = 0x10006d4 // U+0660 ARABIC-INDIC DIGIT ZERO XK_Arabic_0 = 0x1000660 // U+0661 ARABIC-INDIC DIGIT ONE XK_Arabic_1 = 0x1000661 // U+0662 ARABIC-INDIC DIGIT TWO XK_Arabic_2 = 0x1000662 // U+0663 ARABIC-INDIC DIGIT THREE XK_Arabic_3 = 0x1000663 // U+0664 ARABIC-INDIC DIGIT FOUR XK_Arabic_4 = 0x1000664 // U+0665 ARABIC-INDIC DIGIT FIVE XK_Arabic_5 = 0x1000665 // U+0666 ARABIC-INDIC DIGIT SIX XK_Arabic_6 = 0x1000666 // U+0667 ARABIC-INDIC DIGIT SEVEN XK_Arabic_7 = 0x1000667 // U+0668 ARABIC-INDIC DIGIT EIGHT XK_Arabic_8 = 0x1000668 // U+0669 ARABIC-INDIC DIGIT NINE XK_Arabic_9 = 0x1000669 // U+061B ARABIC SEMICOLON XK_Arabic_semicolon = 0x05bb // U+061F ARABIC QUESTION MARK XK_Arabic_question_mark = 0x05bf // U+0621 ARABIC LETTER HAMZA XK_Arabic_hamza = 0x05c1 // U+0622 ARABIC LETTER ALEF WITH MADDA ABOVE XK_Arabic_maddaonalef = 0x05c2 // U+0623 ARABIC LETTER ALEF WITH HAMZA ABOVE XK_Arabic_hamzaonalef = 0x05c3 // U+0624 ARABIC LETTER WAW WITH HAMZA ABOVE XK_Arabic_hamzaonwaw = 0x05c4 // U+0625 ARABIC LETTER ALEF WITH HAMZA BELOW XK_Arabic_hamzaunderalef = 0x05c5 // U+0626 ARABIC LETTER YEH WITH HAMZA ABOVE XK_Arabic_hamzaonyeh = 0x05c6 // U+0627 ARABIC LETTER ALEF XK_Arabic_alef = 0x05c7 // U+0628 ARABIC LETTER BEH XK_Arabic_beh = 0x05c8 // U+0629 ARABIC LETTER TEH MARBUTA XK_Arabic_tehmarbuta = 0x05c9 // U+062A ARABIC LETTER TEH XK_Arabic_teh = 0x05ca // U+062B ARABIC LETTER THEH XK_Arabic_theh = 0x05cb // U+062C ARABIC LETTER JEEM XK_Arabic_jeem = 0x05cc // U+062D ARABIC LETTER HAH XK_Arabic_hah = 0x05cd // U+062E ARABIC LETTER KHAH XK_Arabic_khah = 0x05ce // U+062F ARABIC LETTER DAL XK_Arabic_dal = 0x05cf // U+0630 ARABIC LETTER THAL XK_Arabic_thal = 0x05d0 // U+0631 ARABIC LETTER REH XK_Arabic_ra = 0x05d1 // U+0632 ARABIC LETTER ZAIN XK_Arabic_zain = 0x05d2 // U+0633 ARABIC LETTER SEEN XK_Arabic_seen = 0x05d3 // U+0634 ARABIC LETTER SHEEN XK_Arabic_sheen = 0x05d4 // U+0635 ARABIC LETTER SAD XK_Arabic_sad = 0x05d5 // U+0636 ARABIC LETTER DAD XK_Arabic_dad = 0x05d6 // U+0637 ARABIC LETTER TAH XK_Arabic_tah = 0x05d7 // U+0638 ARABIC LETTER ZAH XK_Arabic_zah = 0x05d8 // U+0639 ARABIC LETTER AIN XK_Arabic_ain = 0x05d9 // U+063A ARABIC LETTER GHAIN XK_Arabic_ghain = 0x05da // U+0640 ARABIC TATWEEL XK_Arabic_tatweel = 0x05e0 // U+0641 ARABIC LETTER FEH XK_Arabic_feh = 0x05e1 // U+0642 ARABIC LETTER QAF XK_Arabic_qaf = 0x05e2 // U+0643 ARABIC LETTER KAF XK_Arabic_kaf = 0x05e3 // U+0644 ARABIC LETTER LAM XK_Arabic_lam = 0x05e4 // U+0645 ARABIC LETTER MEEM XK_Arabic_meem = 0x05e5 // U+0646 ARABIC LETTER NOON XK_Arabic_noon = 0x05e6 // U+0647 ARABIC LETTER HEH XK_Arabic_ha = 0x05e7 // deprecated XK_Arabic_heh = 0x05e7 // U+0648 ARABIC LETTER WAW XK_Arabic_waw = 0x05e8 // U+0649 ARABIC LETTER ALEF MAKSURA XK_Arabic_alefmaksura = 0x05e9 // U+064A ARABIC LETTER YEH XK_Arabic_yeh = 0x05ea // U+064B ARABIC FATHATAN XK_Arabic_fathatan = 0x05eb // U+064C ARABIC DAMMATAN XK_Arabic_dammatan = 0x05ec // U+064D ARABIC KASRATAN XK_Arabic_kasratan = 0x05ed // U+064E ARABIC FATHA XK_Arabic_fatha = 0x05ee // U+064F ARABIC DAMMA XK_Arabic_damma = 0x05ef // U+0650 ARABIC KASRA XK_Arabic_kasra = 0x05f0 // U+0651 ARABIC SHADDA XK_Arabic_shadda = 0x05f1 // U+0652 ARABIC SUKUN XK_Arabic_sukun = 0x05f2 // U+0653 ARABIC MADDAH ABOVE XK_Arabic_madda_above = 0x1000653 // U+0654 ARABIC HAMZA ABOVE XK_Arabic_hamza_above = 0x1000654 // U+0655 ARABIC HAMZA BELOW XK_Arabic_hamza_below = 0x1000655 // U+0698 ARABIC LETTER JEH XK_Arabic_jeh = 0x1000698 // U+06A4 ARABIC LETTER VEH XK_Arabic_veh = 0x10006a4 // U+06A9 ARABIC LETTER KEHEH XK_Arabic_keheh = 0x10006a9 // U+06AF ARABIC LETTER GAF XK_Arabic_gaf = 0x10006af // U+06BA ARABIC LETTER NOON GHUNNA XK_Arabic_noon_ghunna = 0x10006ba // U+06BE ARABIC LETTER HEH DOACHASHMEE XK_Arabic_heh_doachashmee = 0x10006be // U+06CC ARABIC LETTER FARSI YEH XK_Farsi_yeh = 0x10006cc // U+06CC ARABIC LETTER FARSI YEH XK_Arabic_farsi_yeh = 0x10006cc // U+06D2 ARABIC LETTER YEH BARREE XK_Arabic_yeh_baree = 0x10006d2 // U+06C1 ARABIC LETTER HEH GOAL XK_Arabic_heh_goal = 0x10006c1 // Alias for mode_switch XK_Arabic_switch = 0xff7e // U+0492 CYRILLIC CAPITAL LETTER GHE WITH STROKE XK_Cyrillic_GHE_bar = 0x1000492 // U+0493 CYRILLIC SMALL LETTER GHE WITH STROKE XK_Cyrillic_ghe_bar = 0x1000493 // U+0496 CYRILLIC CAPITAL LETTER ZHE WITH DESCENDER XK_Cyrillic_ZHE_descender = 0x1000496 // U+0497 CYRILLIC SMALL LETTER ZHE WITH DESCENDER XK_Cyrillic_zhe_descender = 0x1000497 // U+049A CYRILLIC CAPITAL LETTER KA WITH DESCENDER XK_Cyrillic_KA_descender = 0x100049a // U+049B CYRILLIC SMALL LETTER KA WITH DESCENDER XK_Cyrillic_ka_descender = 0x100049b // U+049C CYRILLIC CAPITAL LETTER KA WITH VERTICAL STROKE XK_Cyrillic_KA_vertstroke = 0x100049c // U+049D CYRILLIC SMALL LETTER KA WITH VERTICAL STROKE XK_Cyrillic_ka_vertstroke = 0x100049d // U+04A2 CYRILLIC CAPITAL LETTER EN WITH DESCENDER XK_Cyrillic_EN_descender = 0x10004a2 // U+04A3 CYRILLIC SMALL LETTER EN WITH DESCENDER XK_Cyrillic_en_descender = 0x10004a3 // U+04AE CYRILLIC CAPITAL LETTER STRAIGHT U XK_Cyrillic_U_straight = 0x10004ae // U+04AF CYRILLIC SMALL LETTER STRAIGHT U XK_Cyrillic_u_straight = 0x10004af // U+04B0 CYRILLIC CAPITAL LETTER STRAIGHT U WITH STROKE XK_Cyrillic_U_straight_bar = 0x10004b0 // U+04B1 CYRILLIC SMALL LETTER STRAIGHT U WITH STROKE XK_Cyrillic_u_straight_bar = 0x10004b1 // U+04B2 CYRILLIC CAPITAL LETTER HA WITH DESCENDER XK_Cyrillic_HA_descender = 0x10004b2 // U+04B3 CYRILLIC SMALL LETTER HA WITH DESCENDER XK_Cyrillic_ha_descender = 0x10004b3 // U+04B6 CYRILLIC CAPITAL LETTER CHE WITH DESCENDER XK_Cyrillic_CHE_descender = 0x10004b6 // U+04B7 CYRILLIC SMALL LETTER CHE WITH DESCENDER XK_Cyrillic_che_descender = 0x10004b7 // U+04B8 CYRILLIC CAPITAL LETTER CHE WITH VERTICAL STROKE XK_Cyrillic_CHE_vertstroke = 0x10004b8 // U+04B9 CYRILLIC SMALL LETTER CHE WITH VERTICAL STROKE XK_Cyrillic_che_vertstroke = 0x10004b9 // U+04BA CYRILLIC CAPITAL LETTER SHHA XK_Cyrillic_SHHA = 0x10004ba // U+04BB CYRILLIC SMALL LETTER SHHA XK_Cyrillic_shha = 0x10004bb // U+04D8 CYRILLIC CAPITAL LETTER SCHWA XK_Cyrillic_SCHWA = 0x10004d8 // U+04D9 CYRILLIC SMALL LETTER SCHWA XK_Cyrillic_schwa = 0x10004d9 // U+04E2 CYRILLIC CAPITAL LETTER I WITH MACRON XK_Cyrillic_I_macron = 0x10004e2 // U+04E3 CYRILLIC SMALL LETTER I WITH MACRON XK_Cyrillic_i_macron = 0x10004e3 // U+04E8 CYRILLIC CAPITAL LETTER BARRED O XK_Cyrillic_O_bar = 0x10004e8 // U+04E9 CYRILLIC SMALL LETTER BARRED O XK_Cyrillic_o_bar = 0x10004e9 // U+04EE CYRILLIC CAPITAL LETTER U WITH MACRON XK_Cyrillic_U_macron = 0x10004ee // U+04EF CYRILLIC SMALL LETTER U WITH MACRON XK_Cyrillic_u_macron = 0x10004ef // U+0452 CYRILLIC SMALL LETTER DJE XK_Serbian_dje = 0x06a1 // U+0453 CYRILLIC SMALL LETTER GJE XK_Macedonia_gje = 0x06a2 // U+0451 CYRILLIC SMALL LETTER IO XK_Cyrillic_io = 0x06a3 // U+0454 CYRILLIC SMALL LETTER UKRAINIAN IE XK_Ukrainian_ie = 0x06a4 // deprecated XK_Ukranian_je = 0x06a4 // U+0455 CYRILLIC SMALL LETTER DZE XK_Macedonia_dse = 0x06a5 // U+0456 CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I XK_Ukrainian_i = 0x06a6 // deprecated XK_Ukranian_i = 0x06a6 // U+0457 CYRILLIC SMALL LETTER YI XK_Ukrainian_yi = 0x06a7 // deprecated XK_Ukranian_yi = 0x06a7 // U+0458 CYRILLIC SMALL LETTER JE XK_Cyrillic_je = 0x06a8 // deprecated XK_Serbian_je = 0x06a8 // U+0459 CYRILLIC SMALL LETTER LJE XK_Cyrillic_lje = 0x06a9 // deprecated XK_Serbian_lje = 0x06a9 // U+045A CYRILLIC SMALL LETTER NJE XK_Cyrillic_nje = 0x06aa // deprecated XK_Serbian_nje = 0x06aa // U+045B CYRILLIC SMALL LETTER TSHE XK_Serbian_tshe = 0x06ab // U+045C CYRILLIC SMALL LETTER KJE XK_Macedonia_kje = 0x06ac // U+0491 CYRILLIC SMALL LETTER GHE WITH UPTURN XK_Ukrainian_ghe_with_upturn = 0x06ad // U+045E CYRILLIC SMALL LETTER SHORT U XK_Byelorussian_shortu = 0x06ae // U+045F CYRILLIC SMALL LETTER DZHE XK_Cyrillic_dzhe = 0x06af // deprecated XK_Serbian_dze = 0x06af // U+2116 NUMERO SIGN XK_numerosign = 0x06b0 // U+0402 CYRILLIC CAPITAL LETTER DJE XK_Serbian_DJE = 0x06b1 // U+0403 CYRILLIC CAPITAL LETTER GJE XK_Macedonia_GJE = 0x06b2 // U+0401 CYRILLIC CAPITAL LETTER IO XK_Cyrillic_IO = 0x06b3 // U+0404 CYRILLIC CAPITAL LETTER UKRAINIAN IE XK_Ukrainian_IE = 0x06b4 // deprecated XK_Ukranian_JE = 0x06b4 // U+0405 CYRILLIC CAPITAL LETTER DZE XK_Macedonia_DSE = 0x06b5 // U+0406 CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I XK_Ukrainian_I = 0x06b6 // deprecated XK_Ukranian_I = 0x06b6 // U+0407 CYRILLIC CAPITAL LETTER YI XK_Ukrainian_YI = 0x06b7 // deprecated XK_Ukranian_YI = 0x06b7 // U+0408 CYRILLIC CAPITAL LETTER JE XK_Cyrillic_JE = 0x06b8 // deprecated XK_Serbian_JE = 0x06b8 // U+0409 CYRILLIC CAPITAL LETTER LJE XK_Cyrillic_LJE = 0x06b9 // deprecated XK_Serbian_LJE = 0x06b9 // U+040A CYRILLIC CAPITAL LETTER NJE XK_Cyrillic_NJE = 0x06ba // deprecated XK_Serbian_NJE = 0x06ba // U+040B CYRILLIC CAPITAL LETTER TSHE XK_Serbian_TSHE = 0x06bb // U+040C CYRILLIC CAPITAL LETTER KJE XK_Macedonia_KJE = 0x06bc // U+0490 CYRILLIC CAPITAL LETTER GHE WITH UPTURN XK_Ukrainian_GHE_WITH_UPTURN = 0x06bd // U+040E CYRILLIC CAPITAL LETTER SHORT U XK_Byelorussian_SHORTU = 0x06be // U+040F CYRILLIC CAPITAL LETTER DZHE XK_Cyrillic_DZHE = 0x06bf // deprecated XK_Serbian_DZE = 0x06bf // U+044E CYRILLIC SMALL LETTER YU XK_Cyrillic_yu = 0x06c0 // U+0430 CYRILLIC SMALL LETTER A XK_Cyrillic_a = 0x06c1 // U+0431 CYRILLIC SMALL LETTER BE XK_Cyrillic_be = 0x06c2 // U+0446 CYRILLIC SMALL LETTER TSE XK_Cyrillic_tse = 0x06c3 // U+0434 CYRILLIC SMALL LETTER DE XK_Cyrillic_de = 0x06c4 // U+0435 CYRILLIC SMALL LETTER IE XK_Cyrillic_ie = 0x06c5 // U+0444 CYRILLIC SMALL LETTER EF XK_Cyrillic_ef = 0x06c6 // U+0433 CYRILLIC SMALL LETTER GHE XK_Cyrillic_ghe = 0x06c7 // U+0445 CYRILLIC SMALL LETTER HA XK_Cyrillic_ha = 0x06c8 // U+0438 CYRILLIC SMALL LETTER I XK_Cyrillic_i = 0x06c9 // U+0439 CYRILLIC SMALL LETTER SHORT I XK_Cyrillic_shorti = 0x06ca // U+043A CYRILLIC SMALL LETTER KA XK_Cyrillic_ka = 0x06cb // U+043B CYRILLIC SMALL LETTER EL XK_Cyrillic_el = 0x06cc // U+043C CYRILLIC SMALL LETTER EM XK_Cyrillic_em = 0x06cd // U+043D CYRILLIC SMALL LETTER EN XK_Cyrillic_en = 0x06ce // U+043E CYRILLIC SMALL LETTER O XK_Cyrillic_o = 0x06cf // U+043F CYRILLIC SMALL LETTER PE XK_Cyrillic_pe = 0x06d0 // U+044F CYRILLIC SMALL LETTER YA XK_Cyrillic_ya = 0x06d1 // U+0440 CYRILLIC SMALL LETTER ER XK_Cyrillic_er = 0x06d2 // U+0441 CYRILLIC SMALL LETTER ES XK_Cyrillic_es = 0x06d3 // U+0442 CYRILLIC SMALL LETTER TE XK_Cyrillic_te = 0x06d4 // U+0443 CYRILLIC SMALL LETTER U XK_Cyrillic_u = 0x06d5 // U+0436 CYRILLIC SMALL LETTER ZHE XK_Cyrillic_zhe = 0x06d6 // U+0432 CYRILLIC SMALL LETTER VE XK_Cyrillic_ve = 0x06d7 // U+044C CYRILLIC SMALL LETTER SOFT SIGN XK_Cyrillic_softsign = 0x06d8 // U+044B CYRILLIC SMALL LETTER YERU XK_Cyrillic_yeru = 0x06d9 // U+0437 CYRILLIC SMALL LETTER ZE XK_Cyrillic_ze = 0x06da // U+0448 CYRILLIC SMALL LETTER SHA XK_Cyrillic_sha = 0x06db // U+044D CYRILLIC SMALL LETTER E XK_Cyrillic_e = 0x06dc // U+0449 CYRILLIC SMALL LETTER SHCHA XK_Cyrillic_shcha = 0x06dd // U+0447 CYRILLIC SMALL LETTER CHE XK_Cyrillic_che = 0x06de // U+044A CYRILLIC SMALL LETTER HARD SIGN XK_Cyrillic_hardsign = 0x06df // U+042E CYRILLIC CAPITAL LETTER YU XK_Cyrillic_YU = 0x06e0 // U+0410 CYRILLIC CAPITAL LETTER A XK_Cyrillic_A = 0x06e1 // U+0411 CYRILLIC CAPITAL LETTER BE XK_Cyrillic_BE = 0x06e2 // U+0426 CYRILLIC CAPITAL LETTER TSE XK_Cyrillic_TSE = 0x06e3 // U+0414 CYRILLIC CAPITAL LETTER DE XK_Cyrillic_DE = 0x06e4 // U+0415 CYRILLIC CAPITAL LETTER IE XK_Cyrillic_IE = 0x06e5 // U+0424 CYRILLIC CAPITAL LETTER EF XK_Cyrillic_EF = 0x06e6 // U+0413 CYRILLIC CAPITAL LETTER GHE XK_Cyrillic_GHE = 0x06e7 // U+0425 CYRILLIC CAPITAL LETTER HA XK_Cyrillic_HA = 0x06e8 // U+0418 CYRILLIC CAPITAL LETTER I XK_Cyrillic_I = 0x06e9 // U+0419 CYRILLIC CAPITAL LETTER SHORT I XK_Cyrillic_SHORTI = 0x06ea // U+041A CYRILLIC CAPITAL LETTER KA XK_Cyrillic_KA = 0x06eb // U+041B CYRILLIC CAPITAL LETTER EL XK_Cyrillic_EL = 0x06ec // U+041C CYRILLIC CAPITAL LETTER EM XK_Cyrillic_EM = 0x06ed // U+041D CYRILLIC CAPITAL LETTER EN XK_Cyrillic_EN = 0x06ee // U+041E CYRILLIC CAPITAL LETTER O XK_Cyrillic_O = 0x06ef // U+041F CYRILLIC CAPITAL LETTER PE XK_Cyrillic_PE = 0x06f0 // U+042F CYRILLIC CAPITAL LETTER YA XK_Cyrillic_YA = 0x06f1 // U+0420 CYRILLIC CAPITAL LETTER ER XK_Cyrillic_ER = 0x06f2 // U+0421 CYRILLIC CAPITAL LETTER ES XK_Cyrillic_ES = 0x06f3 // U+0422 CYRILLIC CAPITAL LETTER TE XK_Cyrillic_TE = 0x06f4 // U+0423 CYRILLIC CAPITAL LETTER U XK_Cyrillic_U = 0x06f5 // U+0416 CYRILLIC CAPITAL LETTER ZHE XK_Cyrillic_ZHE = 0x06f6 // U+0412 CYRILLIC CAPITAL LETTER VE XK_Cyrillic_VE = 0x06f7 // U+042C CYRILLIC CAPITAL LETTER SOFT SIGN XK_Cyrillic_SOFTSIGN = 0x06f8 // U+042B CYRILLIC CAPITAL LETTER YERU XK_Cyrillic_YERU = 0x06f9 // U+0417 CYRILLIC CAPITAL LETTER ZE XK_Cyrillic_ZE = 0x06fa // U+0428 CYRILLIC CAPITAL LETTER SHA XK_Cyrillic_SHA = 0x06fb // U+042D CYRILLIC CAPITAL LETTER E XK_Cyrillic_E = 0x06fc // U+0429 CYRILLIC CAPITAL LETTER SHCHA XK_Cyrillic_SHCHA = 0x06fd // U+0427 CYRILLIC CAPITAL LETTER CHE XK_Cyrillic_CHE = 0x06fe // U+042A CYRILLIC CAPITAL LETTER HARD SIGN XK_Cyrillic_HARDSIGN = 0x06ff // U+0386 GREEK CAPITAL LETTER ALPHA WITH TONOS XK_Greek_ALPHAaccent = 0x07a1 // U+0388 GREEK CAPITAL LETTER EPSILON WITH TONOS XK_Greek_EPSILONaccent = 0x07a2 // U+0389 GREEK CAPITAL LETTER ETA WITH TONOS XK_Greek_ETAaccent = 0x07a3 // U+038A GREEK CAPITAL LETTER IOTA WITH TONOS XK_Greek_IOTAaccent = 0x07a4 // U+03AA GREEK CAPITAL LETTER IOTA WITH DIALYTIKA XK_Greek_IOTAdieresis = 0x07a5 // old typo XK_Greek_IOTAdiaeresis = 0x07a5 // U+038C GREEK CAPITAL LETTER OMICRON WITH TONOS XK_Greek_OMICRONaccent = 0x07a7 // U+038E GREEK CAPITAL LETTER UPSILON WITH TONOS XK_Greek_UPSILONaccent = 0x07a8 // U+03AB GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA XK_Greek_UPSILONdieresis = 0x07a9 // U+038F GREEK CAPITAL LETTER OMEGA WITH TONOS XK_Greek_OMEGAaccent = 0x07ab // U+0385 GREEK DIALYTIKA TONOS XK_Greek_accentdieresis = 0x07ae // U+2015 HORIZONTAL BAR XK_Greek_horizbar = 0x07af // U+03AC GREEK SMALL LETTER ALPHA WITH TONOS XK_Greek_alphaaccent = 0x07b1 // U+03AD GREEK SMALL LETTER EPSILON WITH TONOS XK_Greek_epsilonaccent = 0x07b2 // U+03AE GREEK SMALL LETTER ETA WITH TONOS XK_Greek_etaaccent = 0x07b3 // U+03AF GREEK SMALL LETTER IOTA WITH TONOS XK_Greek_iotaaccent = 0x07b4 // U+03CA GREEK SMALL LETTER IOTA WITH DIALYTIKA XK_Greek_iotadieresis = 0x07b5 // U+0390 GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS XK_Greek_iotaaccentdieresis = 0x07b6 // U+03CC GREEK SMALL LETTER OMICRON WITH TONOS XK_Greek_omicronaccent = 0x07b7 // U+03CD GREEK SMALL LETTER UPSILON WITH TONOS XK_Greek_upsilonaccent = 0x07b8 // U+03CB GREEK SMALL LETTER UPSILON WITH DIALYTIKA XK_Greek_upsilondieresis = 0x07b9 // U+03B0 GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS XK_Greek_upsilonaccentdieresis = 0x07ba // U+03CE GREEK SMALL LETTER OMEGA WITH TONOS XK_Greek_omegaaccent = 0x07bb // U+0391 GREEK CAPITAL LETTER ALPHA XK_Greek_ALPHA = 0x07c1 // U+0392 GREEK CAPITAL LETTER BETA XK_Greek_BETA = 0x07c2 // U+0393 GREEK CAPITAL LETTER GAMMA XK_Greek_GAMMA = 0x07c3 // U+0394 GREEK CAPITAL LETTER DELTA XK_Greek_DELTA = 0x07c4 // U+0395 GREEK CAPITAL LETTER EPSILON XK_Greek_EPSILON = 0x07c5 // U+0396 GREEK CAPITAL LETTER ZETA XK_Greek_ZETA = 0x07c6 // U+0397 GREEK CAPITAL LETTER ETA XK_Greek_ETA = 0x07c7 // U+0398 GREEK CAPITAL LETTER THETA XK_Greek_THETA = 0x07c8 // U+0399 GREEK CAPITAL LETTER IOTA XK_Greek_IOTA = 0x07c9 // U+039A GREEK CAPITAL LETTER KAPPA XK_Greek_KAPPA = 0x07ca // U+039B GREEK CAPITAL LETTER LAMDA XK_Greek_LAMDA = 0x07cb // U+039B GREEK CAPITAL LETTER LAMDA XK_Greek_LAMBDA = 0x07cb // U+039C GREEK CAPITAL LETTER MU XK_Greek_MU = 0x07cc // U+039D GREEK CAPITAL LETTER NU XK_Greek_NU = 0x07cd // U+039E GREEK CAPITAL LETTER XI XK_Greek_XI = 0x07ce // U+039F GREEK CAPITAL LETTER OMICRON XK_Greek_OMICRON = 0x07cf // U+03A0 GREEK CAPITAL LETTER PI XK_Greek_PI = 0x07d0 // U+03A1 GREEK CAPITAL LETTER RHO XK_Greek_RHO = 0x07d1 // U+03A3 GREEK CAPITAL LETTER SIGMA XK_Greek_SIGMA = 0x07d2 // U+03A4 GREEK CAPITAL LETTER TAU XK_Greek_TAU = 0x07d4 // U+03A5 GREEK CAPITAL LETTER UPSILON XK_Greek_UPSILON = 0x07d5 // U+03A6 GREEK CAPITAL LETTER PHI XK_Greek_PHI = 0x07d6 // U+03A7 GREEK CAPITAL LETTER CHI XK_Greek_CHI = 0x07d7 // U+03A8 GREEK CAPITAL LETTER PSI XK_Greek_PSI = 0x07d8 // U+03A9 GREEK CAPITAL LETTER OMEGA XK_Greek_OMEGA = 0x07d9 // U+03B1 GREEK SMALL LETTER ALPHA XK_Greek_alpha = 0x07e1 // U+03B2 GREEK SMALL LETTER BETA XK_Greek_beta = 0x07e2 // U+03B3 GREEK SMALL LETTER GAMMA XK_Greek_gamma = 0x07e3 // U+03B4 GREEK SMALL LETTER DELTA XK_Greek_delta = 0x07e4 // U+03B5 GREEK SMALL LETTER EPSILON XK_Greek_epsilon = 0x07e5 // U+03B6 GREEK SMALL LETTER ZETA XK_Greek_zeta = 0x07e6 // U+03B7 GREEK SMALL LETTER ETA XK_Greek_eta = 0x07e7 // U+03B8 GREEK SMALL LETTER THETA XK_Greek_theta = 0x07e8 // U+03B9 GREEK SMALL LETTER IOTA XK_Greek_iota = 0x07e9 // U+03BA GREEK SMALL LETTER KAPPA XK_Greek_kappa = 0x07ea // U+03BB GREEK SMALL LETTER LAMDA XK_Greek_lamda = 0x07eb // U+03BB GREEK SMALL LETTER LAMDA XK_Greek_lambda = 0x07eb // U+03BC GREEK SMALL LETTER MU XK_Greek_mu = 0x07ec // U+03BD GREEK SMALL LETTER NU XK_Greek_nu = 0x07ed // U+03BE GREEK SMALL LETTER XI XK_Greek_xi = 0x07ee // U+03BF GREEK SMALL LETTER OMICRON XK_Greek_omicron = 0x07ef // U+03C0 GREEK SMALL LETTER PI XK_Greek_pi = 0x07f0 // U+03C1 GREEK SMALL LETTER RHO XK_Greek_rho = 0x07f1 // U+03C3 GREEK SMALL LETTER SIGMA XK_Greek_sigma = 0x07f2 // U+03C2 GREEK SMALL LETTER FINAL SIGMA XK_Greek_finalsmallsigma = 0x07f3 // U+03C4 GREEK SMALL LETTER TAU XK_Greek_tau = 0x07f4 // U+03C5 GREEK SMALL LETTER UPSILON XK_Greek_upsilon = 0x07f5 // U+03C6 GREEK SMALL LETTER PHI XK_Greek_phi = 0x07f6 // U+03C7 GREEK SMALL LETTER CHI XK_Greek_chi = 0x07f7 // U+03C8 GREEK SMALL LETTER PSI XK_Greek_psi = 0x07f8 // U+03C9 GREEK SMALL LETTER OMEGA XK_Greek_omega = 0x07f9 // Alias for mode_switch XK_Greek_switch = 0xff7e // U+2017 DOUBLE LOW LINE XK_hebrew_doublelowline = 0x0cdf // U+05D0 HEBREW LETTER ALEF XK_hebrew_aleph = 0x0ce0 // U+05D1 HEBREW LETTER BET XK_hebrew_bet = 0x0ce1 // deprecated XK_hebrew_beth = 0x0ce1 // U+05D2 HEBREW LETTER GIMEL XK_hebrew_gimel = 0x0ce2 // deprecated XK_hebrew_gimmel = 0x0ce2 // U+05D3 HEBREW LETTER DALET XK_hebrew_dalet = 0x0ce3 // deprecated XK_hebrew_daleth = 0x0ce3 // U+05D4 HEBREW LETTER HE XK_hebrew_he = 0x0ce4 // U+05D5 HEBREW LETTER VAV XK_hebrew_waw = 0x0ce5 // U+05D6 HEBREW LETTER ZAYIN XK_hebrew_zain = 0x0ce6 // deprecated XK_hebrew_zayin = 0x0ce6 // U+05D7 HEBREW LETTER HET XK_hebrew_chet = 0x0ce7 // deprecated XK_hebrew_het = 0x0ce7 // U+05D8 HEBREW LETTER TET XK_hebrew_tet = 0x0ce8 // deprecated XK_hebrew_teth = 0x0ce8 // U+05D9 HEBREW LETTER YOD XK_hebrew_yod = 0x0ce9 // U+05DA HEBREW LETTER FINAL KAF XK_hebrew_finalkaph = 0x0cea // U+05DB HEBREW LETTER KAF XK_hebrew_kaph = 0x0ceb // U+05DC HEBREW LETTER LAMED XK_hebrew_lamed = 0x0cec // U+05DD HEBREW LETTER FINAL MEM XK_hebrew_finalmem = 0x0ced // U+05DE HEBREW LETTER MEM XK_hebrew_mem = 0x0cee // U+05DF HEBREW LETTER FINAL NUN XK_hebrew_finalnun = 0x0cef // U+05E0 HEBREW LETTER NUN XK_hebrew_nun = 0x0cf0 // U+05E1 HEBREW LETTER SAMEKH XK_hebrew_samech = 0x0cf1 // deprecated XK_hebrew_samekh = 0x0cf1 // U+05E2 HEBREW LETTER AYIN XK_hebrew_ayin = 0x0cf2 // U+05E3 HEBREW LETTER FINAL PE XK_hebrew_finalpe = 0x0cf3 // U+05E4 HEBREW LETTER PE XK_hebrew_pe = 0x0cf4 // U+05E5 HEBREW LETTER FINAL TSADI XK_hebrew_finalzade = 0x0cf5 // deprecated XK_hebrew_finalzadi = 0x0cf5 // U+05E6 HEBREW LETTER TSADI XK_hebrew_zade = 0x0cf6 // deprecated XK_hebrew_zadi = 0x0cf6 // U+05E7 HEBREW LETTER QOF XK_hebrew_qoph = 0x0cf7 // deprecated XK_hebrew_kuf = 0x0cf7 // U+05E8 HEBREW LETTER RESH XK_hebrew_resh = 0x0cf8 // U+05E9 HEBREW LETTER SHIN XK_hebrew_shin = 0x0cf9 // U+05EA HEBREW LETTER TAV XK_hebrew_taw = 0x0cfa // deprecated XK_hebrew_taf = 0x0cfa // Alias for mode_switch XK_Hebrew_switch = 0xff7e // U+0E01 THAI CHARACTER KO KAI XK_Thai_kokai = 0x0da1 // U+0E02 THAI CHARACTER KHO KHAI XK_Thai_khokhai = 0x0da2 // U+0E03 THAI CHARACTER KHO KHUAT XK_Thai_khokhuat = 0x0da3 // U+0E04 THAI CHARACTER KHO KHWAI XK_Thai_khokhwai = 0x0da4 // U+0E05 THAI CHARACTER KHO KHON XK_Thai_khokhon = 0x0da5 // U+0E06 THAI CHARACTER KHO RAKHANG XK_Thai_khorakhang = 0x0da6 // U+0E07 THAI CHARACTER NGO NGU XK_Thai_ngongu = 0x0da7 // U+0E08 THAI CHARACTER CHO CHAN XK_Thai_chochan = 0x0da8 // U+0E09 THAI CHARACTER CHO CHING XK_Thai_choching = 0x0da9 // U+0E0A THAI CHARACTER CHO CHANG XK_Thai_chochang = 0x0daa // U+0E0B THAI CHARACTER SO SO XK_Thai_soso = 0x0dab // U+0E0C THAI CHARACTER CHO CHOE XK_Thai_chochoe = 0x0dac // U+0E0D THAI CHARACTER YO YING XK_Thai_yoying = 0x0dad // U+0E0E THAI CHARACTER DO CHADA XK_Thai_dochada = 0x0dae // U+0E0F THAI CHARACTER TO PATAK XK_Thai_topatak = 0x0daf // U+0E10 THAI CHARACTER THO THAN XK_Thai_thothan = 0x0db0 // U+0E11 THAI CHARACTER THO NANGMONTHO XK_Thai_thonangmontho = 0x0db1 // U+0E12 THAI CHARACTER THO PHUTHAO XK_Thai_thophuthao = 0x0db2 // U+0E13 THAI CHARACTER NO NEN XK_Thai_nonen = 0x0db3 // U+0E14 THAI CHARACTER DO DEK XK_Thai_dodek = 0x0db4 // U+0E15 THAI CHARACTER TO TAO XK_Thai_totao = 0x0db5 // U+0E16 THAI CHARACTER THO THUNG XK_Thai_thothung = 0x0db6 // U+0E17 THAI CHARACTER THO THAHAN XK_Thai_thothahan = 0x0db7 // U+0E18 THAI CHARACTER THO THONG XK_Thai_thothong = 0x0db8 // U+0E19 THAI CHARACTER NO NU XK_Thai_nonu = 0x0db9 // U+0E1A THAI CHARACTER BO BAIMAI XK_Thai_bobaimai = 0x0dba // U+0E1B THAI CHARACTER PO PLA XK_Thai_popla = 0x0dbb // U+0E1C THAI CHARACTER PHO PHUNG XK_Thai_phophung = 0x0dbc // U+0E1D THAI CHARACTER FO FA XK_Thai_fofa = 0x0dbd // U+0E1E THAI CHARACTER PHO PHAN XK_Thai_phophan = 0x0dbe // U+0E1F THAI CHARACTER FO FAN XK_Thai_fofan = 0x0dbf // U+0E20 THAI CHARACTER PHO SAMPHAO XK_Thai_phosamphao = 0x0dc0 // U+0E21 THAI CHARACTER MO MA XK_Thai_moma = 0x0dc1 // U+0E22 THAI CHARACTER YO YAK XK_Thai_yoyak = 0x0dc2 // U+0E23 THAI CHARACTER RO RUA XK_Thai_rorua = 0x0dc3 // U+0E24 THAI CHARACTER RU XK_Thai_ru = 0x0dc4 // U+0E25 THAI CHARACTER LO LING XK_Thai_loling = 0x0dc5 // U+0E26 THAI CHARACTER LU XK_Thai_lu = 0x0dc6 // U+0E27 THAI CHARACTER WO WAEN XK_Thai_wowaen = 0x0dc7 // U+0E28 THAI CHARACTER SO SALA XK_Thai_sosala = 0x0dc8 // U+0E29 THAI CHARACTER SO RUSI XK_Thai_sorusi = 0x0dc9 // U+0E2A THAI CHARACTER SO SUA XK_Thai_sosua = 0x0dca // U+0E2B THAI CHARACTER HO HIP XK_Thai_hohip = 0x0dcb // U+0E2C THAI CHARACTER LO CHULA XK_Thai_lochula = 0x0dcc // U+0E2D THAI CHARACTER O ANG XK_Thai_oang = 0x0dcd // U+0E2E THAI CHARACTER HO NOKHUK XK_Thai_honokhuk = 0x0dce // U+0E2F THAI CHARACTER PAIYANNOI XK_Thai_paiyannoi = 0x0dcf // U+0E30 THAI CHARACTER SARA A XK_Thai_saraa = 0x0dd0 // U+0E31 THAI CHARACTER MAI HAN-AKAT XK_Thai_maihanakat = 0x0dd1 // U+0E32 THAI CHARACTER SARA AA XK_Thai_saraaa = 0x0dd2 // U+0E33 THAI CHARACTER SARA AM XK_Thai_saraam = 0x0dd3 // U+0E34 THAI CHARACTER SARA I XK_Thai_sarai = 0x0dd4 // U+0E35 THAI CHARACTER SARA II XK_Thai_saraii = 0x0dd5 // U+0E36 THAI CHARACTER SARA UE XK_Thai_saraue = 0x0dd6 // U+0E37 THAI CHARACTER SARA UEE XK_Thai_sarauee = 0x0dd7 // U+0E38 THAI CHARACTER SARA U XK_Thai_sarau = 0x0dd8 // U+0E39 THAI CHARACTER SARA UU XK_Thai_sarauu = 0x0dd9 // U+0E3A THAI CHARACTER PHINTHU XK_Thai_phinthu = 0x0dda XK_Thai_maihanakat_maitho = 0x0dde // U+0E3F THAI CURRENCY SYMBOL BAHT XK_Thai_baht = 0x0ddf // U+0E40 THAI CHARACTER SARA E XK_Thai_sarae = 0x0de0 // U+0E41 THAI CHARACTER SARA AE XK_Thai_saraae = 0x0de1 // U+0E42 THAI CHARACTER SARA O XK_Thai_sarao = 0x0de2 // U+0E43 THAI CHARACTER SARA AI MAIMUAN XK_Thai_saraaimaimuan = 0x0de3 // U+0E44 THAI CHARACTER SARA AI MAIMALAI XK_Thai_saraaimaimalai = 0x0de4 // U+0E45 THAI CHARACTER LAKKHANGYAO XK_Thai_lakkhangyao = 0x0de5 // U+0E46 THAI CHARACTER MAIYAMOK XK_Thai_maiyamok = 0x0de6 // U+0E47 THAI CHARACTER MAITAIKHU XK_Thai_maitaikhu = 0x0de7 // U+0E48 THAI CHARACTER MAI EK XK_Thai_maiek = 0x0de8 // U+0E49 THAI CHARACTER MAI THO XK_Thai_maitho = 0x0de9 // U+0E4A THAI CHARACTER MAI TRI XK_Thai_maitri = 0x0dea // U+0E4B THAI CHARACTER MAI CHATTAWA XK_Thai_maichattawa = 0x0deb // U+0E4C THAI CHARACTER THANTHAKHAT XK_Thai_thanthakhat = 0x0dec // U+0E4D THAI CHARACTER NIKHAHIT XK_Thai_nikhahit = 0x0ded // U+0E50 THAI DIGIT ZERO XK_Thai_leksun = 0x0df0 // U+0E51 THAI DIGIT ONE XK_Thai_leknung = 0x0df1 // U+0E52 THAI DIGIT TWO XK_Thai_leksong = 0x0df2 // U+0E53 THAI DIGIT THREE XK_Thai_leksam = 0x0df3 // U+0E54 THAI DIGIT FOUR XK_Thai_leksi = 0x0df4 // U+0E55 THAI DIGIT FIVE XK_Thai_lekha = 0x0df5 // U+0E56 THAI DIGIT SIX XK_Thai_lekhok = 0x0df6 // U+0E57 THAI DIGIT SEVEN XK_Thai_lekchet = 0x0df7 // U+0E58 THAI DIGIT EIGHT XK_Thai_lekpaet = 0x0df8 // U+0E59 THAI DIGIT NINE XK_Thai_lekkao = 0x0df9 // Hangul start/stop(toggle) XK_Hangul = 0xff31 // Hangul start XK_Hangul_Start = 0xff32 // Hangul end, English start XK_Hangul_End = 0xff33 // Start Hangul->Hanja Conversion XK_Hangul_Hanja = 0xff34 // Hangul Jamo mode XK_Hangul_Jamo = 0xff35 // Hangul Romaja mode XK_Hangul_Romaja = 0xff36 // Hangul code input mode XK_Hangul_Codeinput = 0xff37 // Jeonja mode XK_Hangul_Jeonja = 0xff38 // Banja mode XK_Hangul_Banja = 0xff39 // Pre Hanja conversion XK_Hangul_PreHanja = 0xff3a // Post Hanja conversion XK_Hangul_PostHanja = 0xff3b // Single candidate XK_Hangul_SingleCandidate = 0xff3c // Multiple candidate XK_Hangul_MultipleCandidate = 0xff3d // Previous candidate XK_Hangul_PreviousCandidate = 0xff3e // Special symbols XK_Hangul_Special = 0xff3f // Alias for mode_switch XK_Hangul_switch = 0xff7e XK_Hangul_Kiyeog = 0x0ea1 XK_Hangul_SsangKiyeog = 0x0ea2 XK_Hangul_KiyeogSios = 0x0ea3 XK_Hangul_Nieun = 0x0ea4 XK_Hangul_NieunJieuj = 0x0ea5 XK_Hangul_NieunHieuh = 0x0ea6 XK_Hangul_Dikeud = 0x0ea7 XK_Hangul_SsangDikeud = 0x0ea8 XK_Hangul_Rieul = 0x0ea9 XK_Hangul_RieulKiyeog = 0x0eaa XK_Hangul_RieulMieum = 0x0eab XK_Hangul_RieulPieub = 0x0eac XK_Hangul_RieulSios = 0x0ead XK_Hangul_RieulTieut = 0x0eae XK_Hangul_RieulPhieuf = 0x0eaf XK_Hangul_RieulHieuh = 0x0eb0 XK_Hangul_Mieum = 0x0eb1 XK_Hangul_Pieub = 0x0eb2 XK_Hangul_SsangPieub = 0x0eb3 XK_Hangul_PieubSios = 0x0eb4 XK_Hangul_Sios = 0x0eb5 XK_Hangul_SsangSios = 0x0eb6 XK_Hangul_Ieung = 0x0eb7 XK_Hangul_Jieuj = 0x0eb8 XK_Hangul_SsangJieuj = 0x0eb9 XK_Hangul_Cieuc = 0x0eba XK_Hangul_Khieuq = 0x0ebb XK_Hangul_Tieut = 0x0ebc XK_Hangul_Phieuf = 0x0ebd XK_Hangul_Hieuh = 0x0ebe XK_Hangul_A = 0x0ebf XK_Hangul_AE = 0x0ec0 XK_Hangul_YA = 0x0ec1 XK_Hangul_YAE = 0x0ec2 XK_Hangul_EO = 0x0ec3 XK_Hangul_E = 0x0ec4 XK_Hangul_YEO = 0x0ec5 XK_Hangul_YE = 0x0ec6 XK_Hangul_O = 0x0ec7 XK_Hangul_WA = 0x0ec8 XK_Hangul_WAE = 0x0ec9 XK_Hangul_OE = 0x0eca XK_Hangul_YO = 0x0ecb XK_Hangul_U = 0x0ecc XK_Hangul_WEO = 0x0ecd XK_Hangul_WE = 0x0ece XK_Hangul_WI = 0x0ecf XK_Hangul_YU = 0x0ed0 XK_Hangul_EU = 0x0ed1 XK_Hangul_YI = 0x0ed2 XK_Hangul_I = 0x0ed3 XK_Hangul_J_Kiyeog = 0x0ed4 XK_Hangul_J_SsangKiyeog = 0x0ed5 XK_Hangul_J_KiyeogSios = 0x0ed6 XK_Hangul_J_Nieun = 0x0ed7 XK_Hangul_J_NieunJieuj = 0x0ed8 XK_Hangul_J_NieunHieuh = 0x0ed9 XK_Hangul_J_Dikeud = 0x0eda XK_Hangul_J_Rieul = 0x0edb XK_Hangul_J_RieulKiyeog = 0x0edc XK_Hangul_J_RieulMieum = 0x0edd XK_Hangul_J_RieulPieub = 0x0ede XK_Hangul_J_RieulSios = 0x0edf XK_Hangul_J_RieulTieut = 0x0ee0 XK_Hangul_J_RieulPhieuf = 0x0ee1 XK_Hangul_J_RieulHieuh = 0x0ee2 XK_Hangul_J_Mieum = 0x0ee3 XK_Hangul_J_Pieub = 0x0ee4 XK_Hangul_J_PieubSios = 0x0ee5 XK_Hangul_J_Sios = 0x0ee6 XK_Hangul_J_SsangSios = 0x0ee7 XK_Hangul_J_Ieung = 0x0ee8 XK_Hangul_J_Jieuj = 0x0ee9 XK_Hangul_J_Cieuc = 0x0eea XK_Hangul_J_Khieuq = 0x0eeb XK_Hangul_J_Tieut = 0x0eec XK_Hangul_J_Phieuf = 0x0eed XK_Hangul_J_Hieuh = 0x0eee XK_Hangul_RieulYeorinHieuh = 0x0eef XK_Hangul_SunkyeongeumMieum = 0x0ef0 XK_Hangul_SunkyeongeumPieub = 0x0ef1 XK_Hangul_PanSios = 0x0ef2 XK_Hangul_KkogjiDalrinIeung = 0x0ef3 XK_Hangul_SunkyeongeumPhieuf = 0x0ef4 XK_Hangul_YeorinHieuh = 0x0ef5 XK_Hangul_AraeA = 0x0ef6 XK_Hangul_AraeAE = 0x0ef7 XK_Hangul_J_PanSios = 0x0ef8 XK_Hangul_J_KkogjiDalrinIeung = 0x0ef9 XK_Hangul_J_YeorinHieuh = 0x0efa // U+20A9 WON SIGN XK_Korean_Won = 0x0eff // U+0587 ARMENIAN SMALL LIGATURE ECH YIWN XK_Armenian_ligature_ew = 0x1000587 // U+0589 ARMENIAN FULL STOP XK_Armenian_full_stop = 0x1000589 // U+0589 ARMENIAN FULL STOP XK_Armenian_verjaket = 0x1000589 // U+055D ARMENIAN COMMA XK_Armenian_separation_mark = 0x100055d // U+055D ARMENIAN COMMA XK_Armenian_but = 0x100055d // U+058A ARMENIAN HYPHEN XK_Armenian_hyphen = 0x100058a // U+058A ARMENIAN HYPHEN XK_Armenian_yentamna = 0x100058a // U+055C ARMENIAN EXCLAMATION MARK XK_Armenian_exclam = 0x100055c // U+055C ARMENIAN EXCLAMATION MARK XK_Armenian_amanak = 0x100055c // U+055B ARMENIAN EMPHASIS MARK XK_Armenian_accent = 0x100055b // U+055B ARMENIAN EMPHASIS MARK XK_Armenian_shesht = 0x100055b // U+055E ARMENIAN QUESTION MARK XK_Armenian_question = 0x100055e // U+055E ARMENIAN QUESTION MARK XK_Armenian_paruyk = 0x100055e // U+0531 ARMENIAN CAPITAL LETTER AYB XK_Armenian_AYB = 0x1000531 // U+0561 ARMENIAN SMALL LETTER AYB XK_Armenian_ayb = 0x1000561 // U+0532 ARMENIAN CAPITAL LETTER BEN XK_Armenian_BEN = 0x1000532 // U+0562 ARMENIAN SMALL LETTER BEN XK_Armenian_ben = 0x1000562 // U+0533 ARMENIAN CAPITAL LETTER GIM XK_Armenian_GIM = 0x1000533 // U+0563 ARMENIAN SMALL LETTER GIM XK_Armenian_gim = 0x1000563 // U+0534 ARMENIAN CAPITAL LETTER DA XK_Armenian_DA = 0x1000534 // U+0564 ARMENIAN SMALL LETTER DA XK_Armenian_da = 0x1000564 // U+0535 ARMENIAN CAPITAL LETTER ECH XK_Armenian_YECH = 0x1000535 // U+0565 ARMENIAN SMALL LETTER ECH XK_Armenian_yech = 0x1000565 // U+0536 ARMENIAN CAPITAL LETTER ZA XK_Armenian_ZA = 0x1000536 // U+0566 ARMENIAN SMALL LETTER ZA XK_Armenian_za = 0x1000566 // U+0537 ARMENIAN CAPITAL LETTER EH XK_Armenian_E = 0x1000537 // U+0567 ARMENIAN SMALL LETTER EH XK_Armenian_e = 0x1000567 // U+0538 ARMENIAN CAPITAL LETTER ET XK_Armenian_AT = 0x1000538 // U+0568 ARMENIAN SMALL LETTER ET XK_Armenian_at = 0x1000568 // U+0539 ARMENIAN CAPITAL LETTER TO XK_Armenian_TO = 0x1000539 // U+0569 ARMENIAN SMALL LETTER TO XK_Armenian_to = 0x1000569 // U+053A ARMENIAN CAPITAL LETTER ZHE XK_Armenian_ZHE = 0x100053a // U+056A ARMENIAN SMALL LETTER ZHE XK_Armenian_zhe = 0x100056a // U+053B ARMENIAN CAPITAL LETTER INI XK_Armenian_INI = 0x100053b // U+056B ARMENIAN SMALL LETTER INI XK_Armenian_ini = 0x100056b // U+053C ARMENIAN CAPITAL LETTER LIWN XK_Armenian_LYUN = 0x100053c // U+056C ARMENIAN SMALL LETTER LIWN XK_Armenian_lyun = 0x100056c // U+053D ARMENIAN CAPITAL LETTER XEH XK_Armenian_KHE = 0x100053d // U+056D ARMENIAN SMALL LETTER XEH XK_Armenian_khe = 0x100056d // U+053E ARMENIAN CAPITAL LETTER CA XK_Armenian_TSA = 0x100053e // U+056E ARMENIAN SMALL LETTER CA XK_Armenian_tsa = 0x100056e // U+053F ARMENIAN CAPITAL LETTER KEN XK_Armenian_KEN = 0x100053f // U+056F ARMENIAN SMALL LETTER KEN XK_Armenian_ken = 0x100056f // U+0540 ARMENIAN CAPITAL LETTER HO XK_Armenian_HO = 0x1000540 // U+0570 ARMENIAN SMALL LETTER HO XK_Armenian_ho = 0x1000570 // U+0541 ARMENIAN CAPITAL LETTER JA XK_Armenian_DZA = 0x1000541 // U+0571 ARMENIAN SMALL LETTER JA XK_Armenian_dza = 0x1000571 // U+0542 ARMENIAN CAPITAL LETTER GHAD XK_Armenian_GHAT = 0x1000542 // U+0572 ARMENIAN SMALL LETTER GHAD XK_Armenian_ghat = 0x1000572 // U+0543 ARMENIAN CAPITAL LETTER CHEH XK_Armenian_TCHE = 0x1000543 // U+0573 ARMENIAN SMALL LETTER CHEH XK_Armenian_tche = 0x1000573 // U+0544 ARMENIAN CAPITAL LETTER MEN XK_Armenian_MEN = 0x1000544 // U+0574 ARMENIAN SMALL LETTER MEN XK_Armenian_men = 0x1000574 // U+0545 ARMENIAN CAPITAL LETTER YI XK_Armenian_HI = 0x1000545 // U+0575 ARMENIAN SMALL LETTER YI XK_Armenian_hi = 0x1000575 // U+0546 ARMENIAN CAPITAL LETTER NOW XK_Armenian_NU = 0x1000546 // U+0576 ARMENIAN SMALL LETTER NOW XK_Armenian_nu = 0x1000576 // U+0547 ARMENIAN CAPITAL LETTER SHA XK_Armenian_SHA = 0x1000547 // U+0577 ARMENIAN SMALL LETTER SHA XK_Armenian_sha = 0x1000577 // U+0548 ARMENIAN CAPITAL LETTER VO XK_Armenian_VO = 0x1000548 // U+0578 ARMENIAN SMALL LETTER VO XK_Armenian_vo = 0x1000578 // U+0549 ARMENIAN CAPITAL LETTER CHA XK_Armenian_CHA = 0x1000549 // U+0579 ARMENIAN SMALL LETTER CHA XK_Armenian_cha = 0x1000579 // U+054A ARMENIAN CAPITAL LETTER PEH XK_Armenian_PE = 0x100054a // U+057A ARMENIAN SMALL LETTER PEH XK_Armenian_pe = 0x100057a // U+054B ARMENIAN CAPITAL LETTER JHEH XK_Armenian_JE = 0x100054b // U+057B ARMENIAN SMALL LETTER JHEH XK_Armenian_je = 0x100057b // U+054C ARMENIAN CAPITAL LETTER RA XK_Armenian_RA = 0x100054c // U+057C ARMENIAN SMALL LETTER RA XK_Armenian_ra = 0x100057c // U+054D ARMENIAN CAPITAL LETTER SEH XK_Armenian_SE = 0x100054d // U+057D ARMENIAN SMALL LETTER SEH XK_Armenian_se = 0x100057d // U+054E ARMENIAN CAPITAL LETTER VEW XK_Armenian_VEV = 0x100054e // U+057E ARMENIAN SMALL LETTER VEW XK_Armenian_vev = 0x100057e // U+054F ARMENIAN CAPITAL LETTER TIWN XK_Armenian_TYUN = 0x100054f // U+057F ARMENIAN SMALL LETTER TIWN XK_Armenian_tyun = 0x100057f // U+0550 ARMENIAN CAPITAL LETTER REH XK_Armenian_RE = 0x1000550 // U+0580 ARMENIAN SMALL LETTER REH XK_Armenian_re = 0x1000580 // U+0551 ARMENIAN CAPITAL LETTER CO XK_Armenian_TSO = 0x1000551 // U+0581 ARMENIAN SMALL LETTER CO XK_Armenian_tso = 0x1000581 // U+0552 ARMENIAN CAPITAL LETTER YIWN XK_Armenian_VYUN = 0x1000552 // U+0582 ARMENIAN SMALL LETTER YIWN XK_Armenian_vyun = 0x1000582 // U+0553 ARMENIAN CAPITAL LETTER PIWR XK_Armenian_PYUR = 0x1000553 // U+0583 ARMENIAN SMALL LETTER PIWR XK_Armenian_pyur = 0x1000583 // U+0554 ARMENIAN CAPITAL LETTER KEH XK_Armenian_KE = 0x1000554 // U+0584 ARMENIAN SMALL LETTER KEH XK_Armenian_ke = 0x1000584 // U+0555 ARMENIAN CAPITAL LETTER OH XK_Armenian_O = 0x1000555 // U+0585 ARMENIAN SMALL LETTER OH XK_Armenian_o = 0x1000585 // U+0556 ARMENIAN CAPITAL LETTER FEH XK_Armenian_FE = 0x1000556 // U+0586 ARMENIAN SMALL LETTER FEH XK_Armenian_fe = 0x1000586 // U+055A ARMENIAN APOSTROPHE XK_Armenian_apostrophe = 0x100055a // U+10D0 GEORGIAN LETTER AN XK_Georgian_an = 0x10010d0 // U+10D1 GEORGIAN LETTER BAN XK_Georgian_ban = 0x10010d1 // U+10D2 GEORGIAN LETTER GAN XK_Georgian_gan = 0x10010d2 // U+10D3 GEORGIAN LETTER DON XK_Georgian_don = 0x10010d3 // U+10D4 GEORGIAN LETTER EN XK_Georgian_en = 0x10010d4 // U+10D5 GEORGIAN LETTER VIN XK_Georgian_vin = 0x10010d5 // U+10D6 GEORGIAN LETTER ZEN XK_Georgian_zen = 0x10010d6 // U+10D7 GEORGIAN LETTER TAN XK_Georgian_tan = 0x10010d7 // U+10D8 GEORGIAN LETTER IN XK_Georgian_in = 0x10010d8 // U+10D9 GEORGIAN LETTER KAN XK_Georgian_kan = 0x10010d9 // U+10DA GEORGIAN LETTER LAS XK_Georgian_las = 0x10010da // U+10DB GEORGIAN LETTER MAN XK_Georgian_man = 0x10010db // U+10DC GEORGIAN LETTER NAR XK_Georgian_nar = 0x10010dc // U+10DD GEORGIAN LETTER ON XK_Georgian_on = 0x10010dd // U+10DE GEORGIAN LETTER PAR XK_Georgian_par = 0x10010de // U+10DF GEORGIAN LETTER ZHAR XK_Georgian_zhar = 0x10010df // U+10E0 GEORGIAN LETTER RAE XK_Georgian_rae = 0x10010e0 // U+10E1 GEORGIAN LETTER SAN XK_Georgian_san = 0x10010e1 // U+10E2 GEORGIAN LETTER TAR XK_Georgian_tar = 0x10010e2 // U+10E3 GEORGIAN LETTER UN XK_Georgian_un = 0x10010e3 // U+10E4 GEORGIAN LETTER PHAR XK_Georgian_phar = 0x10010e4 // U+10E5 GEORGIAN LETTER KHAR XK_Georgian_khar = 0x10010e5 // U+10E6 GEORGIAN LETTER GHAN XK_Georgian_ghan = 0x10010e6 // U+10E7 GEORGIAN LETTER QAR XK_Georgian_qar = 0x10010e7 // U+10E8 GEORGIAN LETTER SHIN XK_Georgian_shin = 0x10010e8 // U+10E9 GEORGIAN LETTER CHIN XK_Georgian_chin = 0x10010e9 // U+10EA GEORGIAN LETTER CAN XK_Georgian_can = 0x10010ea // U+10EB GEORGIAN LETTER JIL XK_Georgian_jil = 0x10010eb // U+10EC GEORGIAN LETTER CIL XK_Georgian_cil = 0x10010ec // U+10ED GEORGIAN LETTER CHAR XK_Georgian_char = 0x10010ed // U+10EE GEORGIAN LETTER XAN XK_Georgian_xan = 0x10010ee // U+10EF GEORGIAN LETTER JHAN XK_Georgian_jhan = 0x10010ef // U+10F0 GEORGIAN LETTER HAE XK_Georgian_hae = 0x10010f0 // U+10F1 GEORGIAN LETTER HE XK_Georgian_he = 0x10010f1 // U+10F2 GEORGIAN LETTER HIE XK_Georgian_hie = 0x10010f2 // U+10F3 GEORGIAN LETTER WE XK_Georgian_we = 0x10010f3 // U+10F4 GEORGIAN LETTER HAR XK_Georgian_har = 0x10010f4 // U+10F5 GEORGIAN LETTER HOE XK_Georgian_hoe = 0x10010f5 // U+10F6 GEORGIAN LETTER FI XK_Georgian_fi = 0x10010f6 // U+1E8A LATIN CAPITAL LETTER X WITH DOT ABOVE XK_Xabovedot = 0x1001e8a // U+012C LATIN CAPITAL LETTER I WITH BREVE XK_Ibreve = 0x100012c // U+01B5 LATIN CAPITAL LETTER Z WITH STROKE XK_Zstroke = 0x10001b5 // U+01E6 LATIN CAPITAL LETTER G WITH CARON XK_Gcaron = 0x10001e6 // U+01D2 LATIN CAPITAL LETTER O WITH CARON XK_Ocaron = 0x10001d1 // U+019F LATIN CAPITAL LETTER O WITH MIDDLE TILDE XK_Obarred = 0x100019f // U+1E8B LATIN SMALL LETTER X WITH DOT ABOVE XK_xabovedot = 0x1001e8b // U+012D LATIN SMALL LETTER I WITH BREVE XK_ibreve = 0x100012d // U+01B6 LATIN SMALL LETTER Z WITH STROKE XK_zstroke = 0x10001b6 // U+01E7 LATIN SMALL LETTER G WITH CARON XK_gcaron = 0x10001e7 // U+01D2 LATIN SMALL LETTER O WITH CARON XK_ocaron = 0x10001d2 // U+0275 LATIN SMALL LETTER BARRED O XK_obarred = 0x1000275 // U+018F LATIN CAPITAL LETTER SCHWA XK_SCHWA = 0x100018f // U+0259 LATIN SMALL LETTER SCHWA XK_schwa = 0x1000259 // U+01B7 LATIN CAPITAL LETTER EZH XK_EZH = 0x10001b7 // U+0292 LATIN SMALL LETTER EZH XK_ezh = 0x1000292 // U+1E36 LATIN CAPITAL LETTER L WITH DOT BELOW XK_Lbelowdot = 0x1001e36 // U+1E37 LATIN SMALL LETTER L WITH DOT BELOW XK_lbelowdot = 0x1001e37 // U+1EA0 LATIN CAPITAL LETTER A WITH DOT BELOW XK_Abelowdot = 0x1001ea0 // U+1EA1 LATIN SMALL LETTER A WITH DOT BELOW XK_abelowdot = 0x1001ea1 // U+1EA2 LATIN CAPITAL LETTER A WITH HOOK ABOVE XK_Ahook = 0x1001ea2 // U+1EA3 LATIN SMALL LETTER A WITH HOOK ABOVE XK_ahook = 0x1001ea3 // U+1EA4 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND ACUTE XK_Acircumflexacute = 0x1001ea4 // U+1EA5 LATIN SMALL LETTER A WITH CIRCUMFLEX AND ACUTE XK_acircumflexacute = 0x1001ea5 // U+1EA6 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND GRAVE XK_Acircumflexgrave = 0x1001ea6 // U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE XK_acircumflexgrave = 0x1001ea7 // U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE XK_Acircumflexhook = 0x1001ea8 // U+1EA9 LATIN SMALL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE XK_acircumflexhook = 0x1001ea9 // U+1EAA LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND TILDE XK_Acircumflextilde = 0x1001eaa // U+1EAB LATIN SMALL LETTER A WITH CIRCUMFLEX AND TILDE XK_acircumflextilde = 0x1001eab // U+1EAC LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND DOT BELOW XK_Acircumflexbelowdot = 0x1001eac // U+1EAD LATIN SMALL LETTER A WITH CIRCUMFLEX AND DOT BELOW XK_acircumflexbelowdot = 0x1001ead // U+1EAE LATIN CAPITAL LETTER A WITH BREVE AND ACUTE XK_Abreveacute = 0x1001eae // U+1EAF LATIN SMALL LETTER A WITH BREVE AND ACUTE XK_abreveacute = 0x1001eaf // U+1EB0 LATIN CAPITAL LETTER A WITH BREVE AND GRAVE XK_Abrevegrave = 0x1001eb0 // U+1EB1 LATIN SMALL LETTER A WITH BREVE AND GRAVE XK_abrevegrave = 0x1001eb1 // U+1EB2 LATIN CAPITAL LETTER A WITH BREVE AND HOOK ABOVE XK_Abrevehook = 0x1001eb2 // U+1EB3 LATIN SMALL LETTER A WITH BREVE AND HOOK ABOVE XK_abrevehook = 0x1001eb3 // U+1EB4 LATIN CAPITAL LETTER A WITH BREVE AND TILDE XK_Abrevetilde = 0x1001eb4 // U+1EB5 LATIN SMALL LETTER A WITH BREVE AND TILDE XK_abrevetilde = 0x1001eb5 // U+1EB6 LATIN CAPITAL LETTER A WITH BREVE AND DOT BELOW XK_Abrevebelowdot = 0x1001eb6 // U+1EB7 LATIN SMALL LETTER A WITH BREVE AND DOT BELOW XK_abrevebelowdot = 0x1001eb7 // U+1EB8 LATIN CAPITAL LETTER E WITH DOT BELOW XK_Ebelowdot = 0x1001eb8 // U+1EB9 LATIN SMALL LETTER E WITH DOT BELOW XK_ebelowdot = 0x1001eb9 // U+1EBA LATIN CAPITAL LETTER E WITH HOOK ABOVE XK_Ehook = 0x1001eba // U+1EBB LATIN SMALL LETTER E WITH HOOK ABOVE XK_ehook = 0x1001ebb // U+1EBC LATIN CAPITAL LETTER E WITH TILDE XK_Etilde = 0x1001ebc // U+1EBD LATIN SMALL LETTER E WITH TILDE XK_etilde = 0x1001ebd // U+1EBE LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND ACUTE XK_Ecircumflexacute = 0x1001ebe // U+1EBF LATIN SMALL LETTER E WITH CIRCUMFLEX AND ACUTE XK_ecircumflexacute = 0x1001ebf // U+1EC0 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND GRAVE XK_Ecircumflexgrave = 0x1001ec0 // U+1EC1 LATIN SMALL LETTER E WITH CIRCUMFLEX AND GRAVE XK_ecircumflexgrave = 0x1001ec1 // U+1EC2 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE XK_Ecircumflexhook = 0x1001ec2 // U+1EC3 LATIN SMALL LETTER E WITH CIRCUMFLEX AND HOOK ABOVE XK_ecircumflexhook = 0x1001ec3 // U+1EC4 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND TILDE XK_Ecircumflextilde = 0x1001ec4 // U+1EC5 LATIN SMALL LETTER E WITH CIRCUMFLEX AND TILDE XK_ecircumflextilde = 0x1001ec5 // U+1EC6 LATIN CAPITAL LETTER E WITH CIRCUMFLEX AND DOT BELOW XK_Ecircumflexbelowdot = 0x1001ec6 // U+1EC7 LATIN SMALL LETTER E WITH CIRCUMFLEX AND DOT BELOW XK_ecircumflexbelowdot = 0x1001ec7 // U+1EC8 LATIN CAPITAL LETTER I WITH HOOK ABOVE XK_Ihook = 0x1001ec8 // U+1EC9 LATIN SMALL LETTER I WITH HOOK ABOVE XK_ihook = 0x1001ec9 // U+1ECA LATIN CAPITAL LETTER I WITH DOT BELOW XK_Ibelowdot = 0x1001eca // U+1ECB LATIN SMALL LETTER I WITH DOT BELOW XK_ibelowdot = 0x1001ecb // U+1ECC LATIN CAPITAL LETTER O WITH DOT BELOW XK_Obelowdot = 0x1001ecc // U+1ECD LATIN SMALL LETTER O WITH DOT BELOW XK_obelowdot = 0x1001ecd // U+1ECE LATIN CAPITAL LETTER O WITH HOOK ABOVE XK_Ohook = 0x1001ece // U+1ECF LATIN SMALL LETTER O WITH HOOK ABOVE XK_ohook = 0x1001ecf // U+1ED0 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND ACUTE XK_Ocircumflexacute = 0x1001ed0 // U+1ED1 LATIN SMALL LETTER O WITH CIRCUMFLEX AND ACUTE XK_ocircumflexacute = 0x1001ed1 // U+1ED2 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND GRAVE XK_Ocircumflexgrave = 0x1001ed2 // U+1ED3 LATIN SMALL LETTER O WITH CIRCUMFLEX AND GRAVE XK_ocircumflexgrave = 0x1001ed3 // U+1ED4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE XK_Ocircumflexhook = 0x1001ed4 // U+1ED5 LATIN SMALL LETTER O WITH CIRCUMFLEX AND HOOK ABOVE XK_ocircumflexhook = 0x1001ed5 // U+1ED6 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND TILDE XK_Ocircumflextilde = 0x1001ed6 // U+1ED7 LATIN SMALL LETTER O WITH CIRCUMFLEX AND TILDE XK_ocircumflextilde = 0x1001ed7 // U+1ED8 LATIN CAPITAL LETTER O WITH CIRCUMFLEX AND DOT BELOW XK_Ocircumflexbelowdot = 0x1001ed8 // U+1ED9 LATIN SMALL LETTER O WITH CIRCUMFLEX AND DOT BELOW XK_ocircumflexbelowdot = 0x1001ed9 // U+1EDA LATIN CAPITAL LETTER O WITH HORN AND ACUTE XK_Ohornacute = 0x1001eda // U+1EDB LATIN SMALL LETTER O WITH HORN AND ACUTE XK_ohornacute = 0x1001edb // U+1EDC LATIN CAPITAL LETTER O WITH HORN AND GRAVE XK_Ohorngrave = 0x1001edc // U+1EDD LATIN SMALL LETTER O WITH HORN AND GRAVE XK_ohorngrave = 0x1001edd // U+1EDE LATIN CAPITAL LETTER O WITH HORN AND HOOK ABOVE XK_Ohornhook = 0x1001ede // U+1EDF LATIN SMALL LETTER O WITH HORN AND HOOK ABOVE XK_ohornhook = 0x1001edf // U+1EE0 LATIN CAPITAL LETTER O WITH HORN AND TILDE XK_Ohorntilde = 0x1001ee0 // U+1EE1 LATIN SMALL LETTER O WITH HORN AND TILDE XK_ohorntilde = 0x1001ee1 // U+1EE2 LATIN CAPITAL LETTER O WITH HORN AND DOT BELOW XK_Ohornbelowdot = 0x1001ee2 // U+1EE3 LATIN SMALL LETTER O WITH HORN AND DOT BELOW XK_ohornbelowdot = 0x1001ee3 // U+1EE4 LATIN CAPITAL LETTER U WITH DOT BELOW XK_Ubelowdot = 0x1001ee4 // U+1EE5 LATIN SMALL LETTER U WITH DOT BELOW XK_ubelowdot = 0x1001ee5 // U+1EE6 LATIN CAPITAL LETTER U WITH HOOK ABOVE XK_Uhook = 0x1001ee6 // U+1EE7 LATIN SMALL LETTER U WITH HOOK ABOVE XK_uhook = 0x1001ee7 // U+1EE8 LATIN CAPITAL LETTER U WITH HORN AND ACUTE XK_Uhornacute = 0x1001ee8 // U+1EE9 LATIN SMALL LETTER U WITH HORN AND ACUTE XK_uhornacute = 0x1001ee9 // U+1EEA LATIN CAPITAL LETTER U WITH HORN AND GRAVE XK_Uhorngrave = 0x1001eea // U+1EEB LATIN SMALL LETTER U WITH HORN AND GRAVE XK_uhorngrave = 0x1001eeb // U+1EEC LATIN CAPITAL LETTER U WITH HORN AND HOOK ABOVE XK_Uhornhook = 0x1001eec // U+1EED LATIN SMALL LETTER U WITH HORN AND HOOK ABOVE XK_uhornhook = 0x1001eed // U+1EEE LATIN CAPITAL LETTER U WITH HORN AND TILDE XK_Uhorntilde = 0x1001eee // U+1EEF LATIN SMALL LETTER U WITH HORN AND TILDE XK_uhorntilde = 0x1001eef // U+1EF0 LATIN CAPITAL LETTER U WITH HORN AND DOT BELOW XK_Uhornbelowdot = 0x1001ef0 // U+1EF1 LATIN SMALL LETTER U WITH HORN AND DOT BELOW XK_uhornbelowdot = 0x1001ef1 // U+1EF4 LATIN CAPITAL LETTER Y WITH DOT BELOW XK_Ybelowdot = 0x1001ef4 // U+1EF5 LATIN SMALL LETTER Y WITH DOT BELOW XK_ybelowdot = 0x1001ef5 // U+1EF6 LATIN CAPITAL LETTER Y WITH HOOK ABOVE XK_Yhook = 0x1001ef6 // U+1EF7 LATIN SMALL LETTER Y WITH HOOK ABOVE XK_yhook = 0x1001ef7 // U+1EF8 LATIN CAPITAL LETTER Y WITH TILDE XK_Ytilde = 0x1001ef8 // U+1EF9 LATIN SMALL LETTER Y WITH TILDE XK_ytilde = 0x1001ef9 // U+01A0 LATIN CAPITAL LETTER O WITH HORN XK_Ohorn = 0x10001a0 // U+01A1 LATIN SMALL LETTER O WITH HORN XK_ohorn = 0x10001a1 // U+01AF LATIN CAPITAL LETTER U WITH HORN XK_Uhorn = 0x10001af // U+01B0 LATIN SMALL LETTER U WITH HORN XK_uhorn = 0x10001b0 // U+20A0 EURO-CURRENCY SIGN XK_EcuSign = 0x10020a0 // U+20A1 COLON SIGN XK_ColonSign = 0x10020a1 // U+20A2 CRUZEIRO SIGN XK_CruzeiroSign = 0x10020a2 // U+20A3 FRENCH FRANC SIGN XK_FFrancSign = 0x10020a3 // U+20A4 LIRA SIGN XK_LiraSign = 0x10020a4 // U+20A5 MILL SIGN XK_MillSign = 0x10020a5 // U+20A6 NAIRA SIGN XK_NairaSign = 0x10020a6 // U+20A7 PESETA SIGN XK_PesetaSign = 0x10020a7 // U+20A8 RUPEE SIGN XK_RupeeSign = 0x10020a8 // U+20A9 WON SIGN XK_WonSign = 0x10020a9 // U+20AA NEW SHEQEL SIGN XK_NewSheqelSign = 0x10020aa // U+20AB DONG SIGN XK_DongSign = 0x10020ab // U+20AC EURO SIGN XK_EuroSign = 0x20ac // U+2070 SUPERSCRIPT ZERO XK_zerosuperior = 0x1002070 // U+2074 SUPERSCRIPT FOUR XK_foursuperior = 0x1002074 // U+2075 SUPERSCRIPT FIVE XK_fivesuperior = 0x1002075 // U+2076 SUPERSCRIPT SIX XK_sixsuperior = 0x1002076 // U+2077 SUPERSCRIPT SEVEN XK_sevensuperior = 0x1002077 // U+2078 SUPERSCRIPT EIGHT XK_eightsuperior = 0x1002078 // U+2079 SUPERSCRIPT NINE XK_ninesuperior = 0x1002079 // U+2080 SUBSCRIPT ZERO XK_zerosubscript = 0x1002080 // U+2081 SUBSCRIPT ONE XK_onesubscript = 0x1002081 // U+2082 SUBSCRIPT TWO XK_twosubscript = 0x1002082 // U+2083 SUBSCRIPT THREE XK_threesubscript = 0x1002083 // U+2084 SUBSCRIPT FOUR XK_foursubscript = 0x1002084 // U+2085 SUBSCRIPT FIVE XK_fivesubscript = 0x1002085 // U+2086 SUBSCRIPT SIX XK_sixsubscript = 0x1002086 // U+2087 SUBSCRIPT SEVEN XK_sevensubscript = 0x1002087 // U+2088 SUBSCRIPT EIGHT XK_eightsubscript = 0x1002088 // U+2089 SUBSCRIPT NINE XK_ninesubscript = 0x1002089 // U+2202 PARTIAL DIFFERENTIAL XK_partdifferential = 0x1002202 // U+2205 NULL SET XK_emptyset = 0x1002205 // U+2208 ELEMENT OF XK_elementof = 0x1002208 // U+2209 NOT AN ELEMENT OF XK_notelementof = 0x1002209 XK_containsas = 0x100220 XK_squareroot = 0x100221 XK_cuberoot = 0x100221 XK_fourthroot = 0x100221 XK_dintegral = 0x100222 XK_tintegral = 0x100222 // U+2235 BECAUSE XK_because = 0x1002235 // U+2245 ALMOST EQUAL TO XK_approxeq = 0x1002248 // U+2247 NOT ALMOST EQUAL TO XK_notapproxeq = 0x1002247 // U+2262 NOT IDENTICAL TO XK_notidentical = 0x1002262 // U+2263 STRICTLY EQUIVALENT TO XK_stricteq = 0x1002263 XK_braille_dot_1 = 0xfff1 XK_braille_dot_2 = 0xfff2 XK_braille_dot_3 = 0xfff3 XK_braille_dot_4 = 0xfff4 XK_braille_dot_5 = 0xfff5 XK_braille_dot_6 = 0xfff6 XK_braille_dot_7 = 0xfff7 XK_braille_dot_8 = 0xfff8 XK_braille_dot_9 = 0xfff9 XK_braille_dot_10 = 0xfffa // U+2800 BRAILLE PATTERN BLANK XK_braille_blank = 0x1002800 // U+2801 BRAILLE PATTERN DOTS-1 XK_braille_dots_1 = 0x1002801 // U+2802 BRAILLE PATTERN DOTS-2 XK_braille_dots_2 = 0x1002802 // U+2803 BRAILLE PATTERN DOTS-12 XK_braille_dots_12 = 0x1002803 // U+2804 BRAILLE PATTERN DOTS-3 XK_braille_dots_3 = 0x1002804 // U+2805 BRAILLE PATTERN DOTS-13 XK_braille_dots_13 = 0x1002805 // U+2806 BRAILLE PATTERN DOTS-23 XK_braille_dots_23 = 0x1002806 // U+2807 BRAILLE PATTERN DOTS-123 XK_braille_dots_123 = 0x1002807 // U+2808 BRAILLE PATTERN DOTS-4 XK_braille_dots_4 = 0x1002808 // U+2809 BRAILLE PATTERN DOTS-14 XK_braille_dots_14 = 0x1002809 // U+280a BRAILLE PATTERN DOTS-24 XK_braille_dots_24 = 0x100280a // U+280b BRAILLE PATTERN DOTS-124 XK_braille_dots_124 = 0x100280b // U+280c BRAILLE PATTERN DOTS-34 XK_braille_dots_34 = 0x100280c // U+280d BRAILLE PATTERN DOTS-134 XK_braille_dots_134 = 0x100280d // U+280e BRAILLE PATTERN DOTS-234 XK_braille_dots_234 = 0x100280e // U+280f BRAILLE PATTERN DOTS-1234 XK_braille_dots_1234 = 0x100280f // U+2810 BRAILLE PATTERN DOTS-5 XK_braille_dots_5 = 0x1002810 // U+2811 BRAILLE PATTERN DOTS-15 XK_braille_dots_15 = 0x1002811 // U+2812 BRAILLE PATTERN DOTS-25 XK_braille_dots_25 = 0x1002812 // U+2813 BRAILLE PATTERN DOTS-125 XK_braille_dots_125 = 0x1002813 // U+2814 BRAILLE PATTERN DOTS-35 XK_braille_dots_35 = 0x1002814 // U+2815 BRAILLE PATTERN DOTS-135 XK_braille_dots_135 = 0x1002815 // U+2816 BRAILLE PATTERN DOTS-235 XK_braille_dots_235 = 0x1002816 // U+2817 BRAILLE PATTERN DOTS-1235 XK_braille_dots_1235 = 0x1002817 // U+2818 BRAILLE PATTERN DOTS-45 XK_braille_dots_45 = 0x1002818 // U+2819 BRAILLE PATTERN DOTS-145 XK_braille_dots_145 = 0x1002819 // U+281a BRAILLE PATTERN DOTS-245 XK_braille_dots_245 = 0x100281a // U+281b BRAILLE PATTERN DOTS-1245 XK_braille_dots_1245 = 0x100281b // U+281c BRAILLE PATTERN DOTS-345 XK_braille_dots_345 = 0x100281c // U+281d BRAILLE PATTERN DOTS-1345 XK_braille_dots_1345 = 0x100281d // U+281e BRAILLE PATTERN DOTS-2345 XK_braille_dots_2345 = 0x100281e // U+281f BRAILLE PATTERN DOTS-12345 XK_braille_dots_12345 = 0x100281f // U+2820 BRAILLE PATTERN DOTS-6 XK_braille_dots_6 = 0x1002820 // U+2821 BRAILLE PATTERN DOTS-16 XK_braille_dots_16 = 0x1002821 // U+2822 BRAILLE PATTERN DOTS-26 XK_braille_dots_26 = 0x1002822 // U+2823 BRAILLE PATTERN DOTS-126 XK_braille_dots_126 = 0x1002823 // U+2824 BRAILLE PATTERN DOTS-36 XK_braille_dots_36 = 0x1002824 // U+2825 BRAILLE PATTERN DOTS-136 XK_braille_dots_136 = 0x1002825 // U+2826 BRAILLE PATTERN DOTS-236 XK_braille_dots_236 = 0x1002826 // U+2827 BRAILLE PATTERN DOTS-1236 XK_braille_dots_1236 = 0x1002827 // U+2828 BRAILLE PATTERN DOTS-46 XK_braille_dots_46 = 0x1002828 // U+2829 BRAILLE PATTERN DOTS-146 XK_braille_dots_146 = 0x1002829 // U+282a BRAILLE PATTERN DOTS-246 XK_braille_dots_246 = 0x100282a // U+282b BRAILLE PATTERN DOTS-1246 XK_braille_dots_1246 = 0x100282b // U+282c BRAILLE PATTERN DOTS-346 XK_braille_dots_346 = 0x100282c // U+282d BRAILLE PATTERN DOTS-1346 XK_braille_dots_1346 = 0x100282d // U+282e BRAILLE PATTERN DOTS-2346 XK_braille_dots_2346 = 0x100282e // U+282f BRAILLE PATTERN DOTS-12346 XK_braille_dots_12346 = 0x100282f // U+2830 BRAILLE PATTERN DOTS-56 XK_braille_dots_56 = 0x1002830 // U+2831 BRAILLE PATTERN DOTS-156 XK_braille_dots_156 = 0x1002831 // U+2832 BRAILLE PATTERN DOTS-256 XK_braille_dots_256 = 0x1002832 // U+2833 BRAILLE PATTERN DOTS-1256 XK_braille_dots_1256 = 0x1002833 // U+2834 BRAILLE PATTERN DOTS-356 XK_braille_dots_356 = 0x1002834 // U+2835 BRAILLE PATTERN DOTS-1356 XK_braille_dots_1356 = 0x1002835 // U+2836 BRAILLE PATTERN DOTS-2356 XK_braille_dots_2356 = 0x1002836 // U+2837 BRAILLE PATTERN DOTS-12356 XK_braille_dots_12356 = 0x1002837 // U+2838 BRAILLE PATTERN DOTS-456 XK_braille_dots_456 = 0x1002838 // U+2839 BRAILLE PATTERN DOTS-1456 XK_braille_dots_1456 = 0x1002839 // U+283a BRAILLE PATTERN DOTS-2456 XK_braille_dots_2456 = 0x100283a // U+283b BRAILLE PATTERN DOTS-12456 XK_braille_dots_12456 = 0x100283b // U+283c BRAILLE PATTERN DOTS-3456 XK_braille_dots_3456 = 0x100283c // U+283d BRAILLE PATTERN DOTS-13456 XK_braille_dots_13456 = 0x100283d // U+283e BRAILLE PATTERN DOTS-23456 XK_braille_dots_23456 = 0x100283e // U+283f BRAILLE PATTERN DOTS-123456 XK_braille_dots_123456 = 0x100283f // U+2840 BRAILLE PATTERN DOTS-7 XK_braille_dots_7 = 0x1002840 // U+2841 BRAILLE PATTERN DOTS-17 XK_braille_dots_17 = 0x1002841 // U+2842 BRAILLE PATTERN DOTS-27 XK_braille_dots_27 = 0x1002842 // U+2843 BRAILLE PATTERN DOTS-127 XK_braille_dots_127 = 0x1002843 // U+2844 BRAILLE PATTERN DOTS-37 XK_braille_dots_37 = 0x1002844 // U+2845 BRAILLE PATTERN DOTS-137 XK_braille_dots_137 = 0x1002845 // U+2846 BRAILLE PATTERN DOTS-237 XK_braille_dots_237 = 0x1002846 // U+2847 BRAILLE PATTERN DOTS-1237 XK_braille_dots_1237 = 0x1002847 // U+2848 BRAILLE PATTERN DOTS-47 XK_braille_dots_47 = 0x1002848 // U+2849 BRAILLE PATTERN DOTS-147 XK_braille_dots_147 = 0x1002849 // U+284a BRAILLE PATTERN DOTS-247 XK_braille_dots_247 = 0x100284a // U+284b BRAILLE PATTERN DOTS-1247 XK_braille_dots_1247 = 0x100284b // U+284c BRAILLE PATTERN DOTS-347 XK_braille_dots_347 = 0x100284c // U+284d BRAILLE PATTERN DOTS-1347 XK_braille_dots_1347 = 0x100284d // U+284e BRAILLE PATTERN DOTS-2347 XK_braille_dots_2347 = 0x100284e // U+284f BRAILLE PATTERN DOTS-12347 XK_braille_dots_12347 = 0x100284f // U+2850 BRAILLE PATTERN DOTS-57 XK_braille_dots_57 = 0x1002850 // U+2851 BRAILLE PATTERN DOTS-157 XK_braille_dots_157 = 0x1002851 // U+2852 BRAILLE PATTERN DOTS-257 XK_braille_dots_257 = 0x1002852 // U+2853 BRAILLE PATTERN DOTS-1257 XK_braille_dots_1257 = 0x1002853 // U+2854 BRAILLE PATTERN DOTS-357 XK_braille_dots_357 = 0x1002854 // U+2855 BRAILLE PATTERN DOTS-1357 XK_braille_dots_1357 = 0x1002855 // U+2856 BRAILLE PATTERN DOTS-2357 XK_braille_dots_2357 = 0x1002856 // U+2857 BRAILLE PATTERN DOTS-12357 XK_braille_dots_12357 = 0x1002857 // U+2858 BRAILLE PATTERN DOTS-457 XK_braille_dots_457 = 0x1002858 // U+2859 BRAILLE PATTERN DOTS-1457 XK_braille_dots_1457 = 0x1002859 // U+285a BRAILLE PATTERN DOTS-2457 XK_braille_dots_2457 = 0x100285a // U+285b BRAILLE PATTERN DOTS-12457 XK_braille_dots_12457 = 0x100285b // U+285c BRAILLE PATTERN DOTS-3457 XK_braille_dots_3457 = 0x100285c // U+285d BRAILLE PATTERN DOTS-13457 XK_braille_dots_13457 = 0x100285d // U+285e BRAILLE PATTERN DOTS-23457 XK_braille_dots_23457 = 0x100285e // U+285f BRAILLE PATTERN DOTS-123457 XK_braille_dots_123457 = 0x100285f // U+2860 BRAILLE PATTERN DOTS-67 XK_braille_dots_67 = 0x1002860 // U+2861 BRAILLE PATTERN DOTS-167 XK_braille_dots_167 = 0x1002861 // U+2862 BRAILLE PATTERN DOTS-267 XK_braille_dots_267 = 0x1002862 // U+2863 BRAILLE PATTERN DOTS-1267 XK_braille_dots_1267 = 0x1002863 // U+2864 BRAILLE PATTERN DOTS-367 XK_braille_dots_367 = 0x1002864 // U+2865 BRAILLE PATTERN DOTS-1367 XK_braille_dots_1367 = 0x1002865 // U+2866 BRAILLE PATTERN DOTS-2367 XK_braille_dots_2367 = 0x1002866 // U+2867 BRAILLE PATTERN DOTS-12367 XK_braille_dots_12367 = 0x1002867 // U+2868 BRAILLE PATTERN DOTS-467 XK_braille_dots_467 = 0x1002868 // U+2869 BRAILLE PATTERN DOTS-1467 XK_braille_dots_1467 = 0x1002869 // U+286a BRAILLE PATTERN DOTS-2467 XK_braille_dots_2467 = 0x100286a // U+286b BRAILLE PATTERN DOTS-12467 XK_braille_dots_12467 = 0x100286b // U+286c BRAILLE PATTERN DOTS-3467 XK_braille_dots_3467 = 0x100286c // U+286d BRAILLE PATTERN DOTS-13467 XK_braille_dots_13467 = 0x100286d // U+286e BRAILLE PATTERN DOTS-23467 XK_braille_dots_23467 = 0x100286e // U+286f BRAILLE PATTERN DOTS-123467 XK_braille_dots_123467 = 0x100286f // U+2870 BRAILLE PATTERN DOTS-567 XK_braille_dots_567 = 0x1002870 // U+2871 BRAILLE PATTERN DOTS-1567 XK_braille_dots_1567 = 0x1002871 // U+2872 BRAILLE PATTERN DOTS-2567 XK_braille_dots_2567 = 0x1002872 // U+2873 BRAILLE PATTERN DOTS-12567 XK_braille_dots_12567 = 0x1002873 // U+2874 BRAILLE PATTERN DOTS-3567 XK_braille_dots_3567 = 0x1002874 // U+2875 BRAILLE PATTERN DOTS-13567 XK_braille_dots_13567 = 0x1002875 // U+2876 BRAILLE PATTERN DOTS-23567 XK_braille_dots_23567 = 0x1002876 // U+2877 BRAILLE PATTERN DOTS-123567 XK_braille_dots_123567 = 0x1002877 // U+2878 BRAILLE PATTERN DOTS-4567 XK_braille_dots_4567 = 0x1002878 // U+2879 BRAILLE PATTERN DOTS-14567 XK_braille_dots_14567 = 0x1002879 // U+287a BRAILLE PATTERN DOTS-24567 XK_braille_dots_24567 = 0x100287a // U+287b BRAILLE PATTERN DOTS-124567 XK_braille_dots_124567 = 0x100287b // U+287c BRAILLE PATTERN DOTS-34567 XK_braille_dots_34567 = 0x100287c // U+287d BRAILLE PATTERN DOTS-134567 XK_braille_dots_134567 = 0x100287d // U+287e BRAILLE PATTERN DOTS-234567 XK_braille_dots_234567 = 0x100287e // U+287f BRAILLE PATTERN DOTS-1234567 XK_braille_dots_1234567 = 0x100287f // U+2880 BRAILLE PATTERN DOTS-8 XK_braille_dots_8 = 0x1002880 // U+2881 BRAILLE PATTERN DOTS-18 XK_braille_dots_18 = 0x1002881 // U+2882 BRAILLE PATTERN DOTS-28 XK_braille_dots_28 = 0x1002882 // U+2883 BRAILLE PATTERN DOTS-128 XK_braille_dots_128 = 0x1002883 // U+2884 BRAILLE PATTERN DOTS-38 XK_braille_dots_38 = 0x1002884 // U+2885 BRAILLE PATTERN DOTS-138 XK_braille_dots_138 = 0x1002885 // U+2886 BRAILLE PATTERN DOTS-238 XK_braille_dots_238 = 0x1002886 // U+2887 BRAILLE PATTERN DOTS-1238 XK_braille_dots_1238 = 0x1002887 // U+2888 BRAILLE PATTERN DOTS-48 XK_braille_dots_48 = 0x1002888 // U+2889 BRAILLE PATTERN DOTS-148 XK_braille_dots_148 = 0x1002889 // U+288a BRAILLE PATTERN DOTS-248 XK_braille_dots_248 = 0x100288a // U+288b BRAILLE PATTERN DOTS-1248 XK_braille_dots_1248 = 0x100288b // U+288c BRAILLE PATTERN DOTS-348 XK_braille_dots_348 = 0x100288c // U+288d BRAILLE PATTERN DOTS-1348 XK_braille_dots_1348 = 0x100288d // U+288e BRAILLE PATTERN DOTS-2348 XK_braille_dots_2348 = 0x100288e // U+288f BRAILLE PATTERN DOTS-12348 XK_braille_dots_12348 = 0x100288f // U+2890 BRAILLE PATTERN DOTS-58 XK_braille_dots_58 = 0x1002890 // U+2891 BRAILLE PATTERN DOTS-158 XK_braille_dots_158 = 0x1002891 // U+2892 BRAILLE PATTERN DOTS-258 XK_braille_dots_258 = 0x1002892 // U+2893 BRAILLE PATTERN DOTS-1258 XK_braille_dots_1258 = 0x1002893 // U+2894 BRAILLE PATTERN DOTS-358 XK_braille_dots_358 = 0x1002894 // U+2895 BRAILLE PATTERN DOTS-1358 XK_braille_dots_1358 = 0x1002895 // U+2896 BRAILLE PATTERN DOTS-2358 XK_braille_dots_2358 = 0x1002896 // U+2897 BRAILLE PATTERN DOTS-12358 XK_braille_dots_12358 = 0x1002897 // U+2898 BRAILLE PATTERN DOTS-458 XK_braille_dots_458 = 0x1002898 // U+2899 BRAILLE PATTERN DOTS-1458 XK_braille_dots_1458 = 0x1002899 // U+289a BRAILLE PATTERN DOTS-2458 XK_braille_dots_2458 = 0x100289a // U+289b BRAILLE PATTERN DOTS-12458 XK_braille_dots_12458 = 0x100289b // U+289c BRAILLE PATTERN DOTS-3458 XK_braille_dots_3458 = 0x100289c // U+289d BRAILLE PATTERN DOTS-13458 XK_braille_dots_13458 = 0x100289d // U+289e BRAILLE PATTERN DOTS-23458 XK_braille_dots_23458 = 0x100289e // U+289f BRAILLE PATTERN DOTS-123458 XK_braille_dots_123458 = 0x100289f // U+28a0 BRAILLE PATTERN DOTS-68 XK_braille_dots_68 = 0x10028a0 // U+28a1 BRAILLE PATTERN DOTS-168 XK_braille_dots_168 = 0x10028a1 // U+28a2 BRAILLE PATTERN DOTS-268 XK_braille_dots_268 = 0x10028a2 // U+28a3 BRAILLE PATTERN DOTS-1268 XK_braille_dots_1268 = 0x10028a3 // U+28a4 BRAILLE PATTERN DOTS-368 XK_braille_dots_368 = 0x10028a4 // U+28a5 BRAILLE PATTERN DOTS-1368 XK_braille_dots_1368 = 0x10028a5 // U+28a6 BRAILLE PATTERN DOTS-2368 XK_braille_dots_2368 = 0x10028a6 // U+28a7 BRAILLE PATTERN DOTS-12368 XK_braille_dots_12368 = 0x10028a7 // U+28a8 BRAILLE PATTERN DOTS-468 XK_braille_dots_468 = 0x10028a8 // U+28a9 BRAILLE PATTERN DOTS-1468 XK_braille_dots_1468 = 0x10028a9 // U+28aa BRAILLE PATTERN DOTS-2468 XK_braille_dots_2468 = 0x10028aa // U+28ab BRAILLE PATTERN DOTS-12468 XK_braille_dots_12468 = 0x10028ab // U+28ac BRAILLE PATTERN DOTS-3468 XK_braille_dots_3468 = 0x10028ac // U+28ad BRAILLE PATTERN DOTS-13468 XK_braille_dots_13468 = 0x10028ad // U+28ae BRAILLE PATTERN DOTS-23468 XK_braille_dots_23468 = 0x10028ae // U+28af BRAILLE PATTERN DOTS-123468 XK_braille_dots_123468 = 0x10028af // U+28b0 BRAILLE PATTERN DOTS-568 XK_braille_dots_568 = 0x10028b0 // U+28b1 BRAILLE PATTERN DOTS-1568 XK_braille_dots_1568 = 0x10028b1 // U+28b2 BRAILLE PATTERN DOTS-2568 XK_braille_dots_2568 = 0x10028b2 // U+28b3 BRAILLE PATTERN DOTS-12568 XK_braille_dots_12568 = 0x10028b3 // U+28b4 BRAILLE PATTERN DOTS-3568 XK_braille_dots_3568 = 0x10028b4 // U+28b5 BRAILLE PATTERN DOTS-13568 XK_braille_dots_13568 = 0x10028b5 // U+28b6 BRAILLE PATTERN DOTS-23568 XK_braille_dots_23568 = 0x10028b6 // U+28b7 BRAILLE PATTERN DOTS-123568 XK_braille_dots_123568 = 0x10028b7 // U+28b8 BRAILLE PATTERN DOTS-4568 XK_braille_dots_4568 = 0x10028b8 // U+28b9 BRAILLE PATTERN DOTS-14568 XK_braille_dots_14568 = 0x10028b9 // U+28ba BRAILLE PATTERN DOTS-24568 XK_braille_dots_24568 = 0x10028ba // U+28bb BRAILLE PATTERN DOTS-124568 XK_braille_dots_124568 = 0x10028bb // U+28bc BRAILLE PATTERN DOTS-34568 XK_braille_dots_34568 = 0x10028bc // U+28bd BRAILLE PATTERN DOTS-134568 XK_braille_dots_134568 = 0x10028bd // U+28be BRAILLE PATTERN DOTS-234568 XK_braille_dots_234568 = 0x10028be // U+28bf BRAILLE PATTERN DOTS-1234568 XK_braille_dots_1234568 = 0x10028bf // U+28c0 BRAILLE PATTERN DOTS-78 XK_braille_dots_78 = 0x10028c0 // U+28c1 BRAILLE PATTERN DOTS-178 XK_braille_dots_178 = 0x10028c1 // U+28c2 BRAILLE PATTERN DOTS-278 XK_braille_dots_278 = 0x10028c2 // U+28c3 BRAILLE PATTERN DOTS-1278 XK_braille_dots_1278 = 0x10028c3 // U+28c4 BRAILLE PATTERN DOTS-378 XK_braille_dots_378 = 0x10028c4 // U+28c5 BRAILLE PATTERN DOTS-1378 XK_braille_dots_1378 = 0x10028c5 // U+28c6 BRAILLE PATTERN DOTS-2378 XK_braille_dots_2378 = 0x10028c6 // U+28c7 BRAILLE PATTERN DOTS-12378 XK_braille_dots_12378 = 0x10028c7 // U+28c8 BRAILLE PATTERN DOTS-478 XK_braille_dots_478 = 0x10028c8 // U+28c9 BRAILLE PATTERN DOTS-1478 XK_braille_dots_1478 = 0x10028c9 // U+28ca BRAILLE PATTERN DOTS-2478 XK_braille_dots_2478 = 0x10028ca // U+28cb BRAILLE PATTERN DOTS-12478 XK_braille_dots_12478 = 0x10028cb // U+28cc BRAILLE PATTERN DOTS-3478 XK_braille_dots_3478 = 0x10028cc // U+28cd BRAILLE PATTERN DOTS-13478 XK_braille_dots_13478 = 0x10028cd // U+28ce BRAILLE PATTERN DOTS-23478 XK_braille_dots_23478 = 0x10028ce // U+28cf BRAILLE PATTERN DOTS-123478 XK_braille_dots_123478 = 0x10028cf // U+28d0 BRAILLE PATTERN DOTS-578 XK_braille_dots_578 = 0x10028d0 // U+28d1 BRAILLE PATTERN DOTS-1578 XK_braille_dots_1578 = 0x10028d1 // U+28d2 BRAILLE PATTERN DOTS-2578 XK_braille_dots_2578 = 0x10028d2 // U+28d3 BRAILLE PATTERN DOTS-12578 XK_braille_dots_12578 = 0x10028d3 // U+28d4 BRAILLE PATTERN DOTS-3578 XK_braille_dots_3578 = 0x10028d4 // U+28d5 BRAILLE PATTERN DOTS-13578 XK_braille_dots_13578 = 0x10028d5 // U+28d6 BRAILLE PATTERN DOTS-23578 XK_braille_dots_23578 = 0x10028d6 // U+28d7 BRAILLE PATTERN DOTS-123578 XK_braille_dots_123578 = 0x10028d7 // U+28d8 BRAILLE PATTERN DOTS-4578 XK_braille_dots_4578 = 0x10028d8 // U+28d9 BRAILLE PATTERN DOTS-14578 XK_braille_dots_14578 = 0x10028d9 // U+28da BRAILLE PATTERN DOTS-24578 XK_braille_dots_24578 = 0x10028da // U+28db BRAILLE PATTERN DOTS-124578 XK_braille_dots_124578 = 0x10028db // U+28dc BRAILLE PATTERN DOTS-34578 XK_braille_dots_34578 = 0x10028dc // U+28dd BRAILLE PATTERN DOTS-134578 XK_braille_dots_134578 = 0x10028dd // U+28de BRAILLE PATTERN DOTS-234578 XK_braille_dots_234578 = 0x10028de // U+28df BRAILLE PATTERN DOTS-1234578 XK_braille_dots_1234578 = 0x10028df // U+28e0 BRAILLE PATTERN DOTS-678 XK_braille_dots_678 = 0x10028e0 // U+28e1 BRAILLE PATTERN DOTS-1678 XK_braille_dots_1678 = 0x10028e1 // U+28e2 BRAILLE PATTERN DOTS-2678 XK_braille_dots_2678 = 0x10028e2 // U+28e3 BRAILLE PATTERN DOTS-12678 XK_braille_dots_12678 = 0x10028e3 // U+28e4 BRAILLE PATTERN DOTS-3678 XK_braille_dots_3678 = 0x10028e4 // U+28e5 BRAILLE PATTERN DOTS-13678 XK_braille_dots_13678 = 0x10028e5 // U+28e6 BRAILLE PATTERN DOTS-23678 XK_braille_dots_23678 = 0x10028e6 // U+28e7 BRAILLE PATTERN DOTS-123678 XK_braille_dots_123678 = 0x10028e7 // U+28e8 BRAILLE PATTERN DOTS-4678 XK_braille_dots_4678 = 0x10028e8 // U+28e9 BRAILLE PATTERN DOTS-14678 XK_braille_dots_14678 = 0x10028e9 // U+28ea BRAILLE PATTERN DOTS-24678 XK_braille_dots_24678 = 0x10028ea // U+28eb BRAILLE PATTERN DOTS-124678 XK_braille_dots_124678 = 0x10028eb // U+28ec BRAILLE PATTERN DOTS-34678 XK_braille_dots_34678 = 0x10028ec // U+28ed BRAILLE PATTERN DOTS-134678 XK_braille_dots_134678 = 0x10028ed // U+28ee BRAILLE PATTERN DOTS-234678 XK_braille_dots_234678 = 0x10028ee // U+28ef BRAILLE PATTERN DOTS-1234678 XK_braille_dots_1234678 = 0x10028ef // U+28f0 BRAILLE PATTERN DOTS-5678 XK_braille_dots_5678 = 0x10028f0 // U+28f1 BRAILLE PATTERN DOTS-15678 XK_braille_dots_15678 = 0x10028f1 // U+28f2 BRAILLE PATTERN DOTS-25678 XK_braille_dots_25678 = 0x10028f2 // U+28f3 BRAILLE PATTERN DOTS-125678 XK_braille_dots_125678 = 0x10028f3 // U+28f4 BRAILLE PATTERN DOTS-35678 XK_braille_dots_35678 = 0x10028f4 // U+28f5 BRAILLE PATTERN DOTS-135678 XK_braille_dots_135678 = 0x10028f5 // U+28f6 BRAILLE PATTERN DOTS-235678 XK_braille_dots_235678 = 0x10028f6 // U+28f7 BRAILLE PATTERN DOTS-1235678 XK_braille_dots_1235678 = 0x10028f7 // U+28f8 BRAILLE PATTERN DOTS-45678 XK_braille_dots_45678 = 0x10028f8 // U+28f9 BRAILLE PATTERN DOTS-145678 XK_braille_dots_145678 = 0x10028f9 // U+28fa BRAILLE PATTERN DOTS-245678 XK_braille_dots_245678 = 0x10028fa // U+28fb BRAILLE PATTERN DOTS-1245678 XK_braille_dots_1245678 = 0x10028fb // U+28fc BRAILLE PATTERN DOTS-345678 XK_braille_dots_345678 = 0x10028fc // U+28fd BRAILLE PATTERN DOTS-1345678 XK_braille_dots_1345678 = 0x10028fd // U+28fe BRAILLE PATTERN DOTS-2345678 XK_braille_dots_2345678 = 0x10028fe // U+28ff BRAILLE PATTERN DOTS-12345678 XK_braille_dots_12345678 = 0x10028ff // U+0D82 SINHALA ANUSVARAYA XK_Sinh_ng = 0x1000d82 // U+0D83 SINHALA VISARGAYA XK_Sinh_h2 = 0x1000d83 // U+0D85 SINHALA AYANNA XK_Sinh_a = 0x1000d85 // U+0D86 SINHALA AAYANNA XK_Sinh_aa = 0x1000d86 // U+0D87 SINHALA AEYANNA XK_Sinh_ae = 0x1000d87 // U+0D88 SINHALA AEEYANNA XK_Sinh_aee = 0x1000d88 // U+0D89 SINHALA IYANNA XK_Sinh_i = 0x1000d89 // U+0D8A SINHALA IIYANNA XK_Sinh_ii = 0x1000d8a // U+0D8B SINHALA UYANNA XK_Sinh_u = 0x1000d8b // U+0D8C SINHALA UUYANNA XK_Sinh_uu = 0x1000d8c // U+0D8D SINHALA IRUYANNA XK_Sinh_ri = 0x1000d8d // U+0D8E SINHALA IRUUYANNA XK_Sinh_rii = 0x1000d8e // U+0D8F SINHALA ILUYANNA XK_Sinh_lu = 0x1000d8f // U+0D90 SINHALA ILUUYANNA XK_Sinh_luu = 0x1000d90 // U+0D91 SINHALA EYANNA XK_Sinh_e = 0x1000d91 // U+0D92 SINHALA EEYANNA XK_Sinh_ee = 0x1000d92 // U+0D93 SINHALA AIYANNA XK_Sinh_ai = 0x1000d93 // U+0D94 SINHALA OYANNA XK_Sinh_o = 0x1000d94 // U+0D95 SINHALA OOYANNA XK_Sinh_oo = 0x1000d95 // U+0D96 SINHALA AUYANNA XK_Sinh_au = 0x1000d96 // U+0D9A SINHALA KAYANNA XK_Sinh_ka = 0x1000d9a // U+0D9B SINHALA MAHA. KAYANNA XK_Sinh_kha = 0x1000d9b // U+0D9C SINHALA GAYANNA XK_Sinh_ga = 0x1000d9c // U+0D9D SINHALA MAHA. GAYANNA XK_Sinh_gha = 0x1000d9d // U+0D9E SINHALA KANTAJA NAASIKYAYA XK_Sinh_ng2 = 0x1000d9e // U+0D9F SINHALA SANYAKA GAYANNA XK_Sinh_nga = 0x1000d9f // U+0DA0 SINHALA CAYANNA XK_Sinh_ca = 0x1000da0 // U+0DA1 SINHALA MAHA. CAYANNA XK_Sinh_cha = 0x1000da1 // U+0DA2 SINHALA JAYANNA XK_Sinh_ja = 0x1000da2 // U+0DA3 SINHALA MAHA. JAYANNA XK_Sinh_jha = 0x1000da3 // U+0DA4 SINHALA TAALUJA NAASIKYAYA XK_Sinh_nya = 0x1000da4 // U+0DA5 SINHALA TAALUJA SANYOOGA NAASIKYAYA XK_Sinh_jnya = 0x1000da5 // U+0DA6 SINHALA SANYAKA JAYANNA XK_Sinh_nja = 0x1000da6 // U+0DA7 SINHALA TTAYANNA XK_Sinh_tta = 0x1000da7 // U+0DA8 SINHALA MAHA. TTAYANNA XK_Sinh_ttha = 0x1000da8 // U+0DA9 SINHALA DDAYANNA XK_Sinh_dda = 0x1000da9 // U+0DAA SINHALA MAHA. DDAYANNA XK_Sinh_ddha = 0x1000daa // U+0DAB SINHALA MUURDHAJA NAYANNA XK_Sinh_nna = 0x1000dab // U+0DAC SINHALA SANYAKA DDAYANNA XK_Sinh_ndda = 0x1000dac // U+0DAD SINHALA TAYANNA XK_Sinh_tha = 0x1000dad // U+0DAE SINHALA MAHA. TAYANNA XK_Sinh_thha = 0x1000dae // U+0DAF SINHALA DAYANNA XK_Sinh_dha = 0x1000daf // U+0DB0 SINHALA MAHA. DAYANNA XK_Sinh_dhha = 0x1000db0 // U+0DB1 SINHALA DANTAJA NAYANNA XK_Sinh_na = 0x1000db1 // U+0DB3 SINHALA SANYAKA DAYANNA XK_Sinh_ndha = 0x1000db3 // U+0DB4 SINHALA PAYANNA XK_Sinh_pa = 0x1000db4 // U+0DB5 SINHALA MAHA. PAYANNA XK_Sinh_pha = 0x1000db5 // U+0DB6 SINHALA BAYANNA XK_Sinh_ba = 0x1000db6 // U+0DB7 SINHALA MAHA. BAYANNA XK_Sinh_bha = 0x1000db7 // U+0DB8 SINHALA MAYANNA XK_Sinh_ma = 0x1000db8 // U+0DB9 SINHALA AMBA BAYANNA XK_Sinh_mba = 0x1000db9 // U+0DBA SINHALA YAYANNA XK_Sinh_ya = 0x1000dba // U+0DBB SINHALA RAYANNA XK_Sinh_ra = 0x1000dbb // U+0DBD SINHALA DANTAJA LAYANNA XK_Sinh_la = 0x1000dbd // U+0DC0 SINHALA VAYANNA XK_Sinh_va = 0x1000dc0 // U+0DC1 SINHALA TAALUJA SAYANNA XK_Sinh_sha = 0x1000dc1 // U+0DC2 SINHALA MUURDHAJA SAYANNA XK_Sinh_ssha = 0x1000dc2 // U+0DC3 SINHALA DANTAJA SAYANNA XK_Sinh_sa = 0x1000dc3 // U+0DC4 SINHALA HAYANNA XK_Sinh_ha = 0x1000dc4 // U+0DC5 SINHALA MUURDHAJA LAYANNA XK_Sinh_lla = 0x1000dc5 // U+0DC6 SINHALA FAYANNA XK_Sinh_fa = 0x1000dc6 // U+0DCA SINHALA AL-LAKUNA XK_Sinh_al = 0x1000dca // U+0DCF SINHALA AELA-PILLA XK_Sinh_aa2 = 0x1000dcf // U+0DD0 SINHALA AEDA-PILLA XK_Sinh_ae2 = 0x1000dd0 // U+0DD1 SINHALA DIGA AEDA-PILLA XK_Sinh_aee2 = 0x1000dd1 // U+0DD2 SINHALA IS-PILLA XK_Sinh_i2 = 0x1000dd2 // U+0DD3 SINHALA DIGA IS-PILLA XK_Sinh_ii2 = 0x1000dd3 // U+0DD4 SINHALA PAA-PILLA XK_Sinh_u2 = 0x1000dd4 // U+0DD6 SINHALA DIGA PAA-PILLA XK_Sinh_uu2 = 0x1000dd6 // U+0DD8 SINHALA GAETTA-PILLA XK_Sinh_ru2 = 0x1000dd8 // U+0DD9 SINHALA KOMBUVA XK_Sinh_e2 = 0x1000dd9 // U+0DDA SINHALA DIGA KOMBUVA XK_Sinh_ee2 = 0x1000dda // U+0DDB SINHALA KOMBU DEKA XK_Sinh_ai2 = 0x1000ddb // U+0DDC SINHALA KOMBUVA HAA AELA-PILLA XK_Sinh_o2 = 0x1000ddc // U+0DDD SINHALA KOMBUVA HAA DIGA AELA-PILLA XK_Sinh_oo2 = 0x1000ddd // U+0DDE SINHALA KOMBUVA HAA GAYANUKITTA XK_Sinh_au2 = 0x1000dde // U+0DDF SINHALA GAYANUKITTA XK_Sinh_lu2 = 0x1000ddf // U+0DF2 SINHALA DIGA GAETTA-PILLA XK_Sinh_ruu2 = 0x1000df2 // U+0DF3 SINHALA DIGA GAYANUKITTA XK_Sinh_luu2 = 0x1000df3 // U+0DF4 SINHALA KUNDDALIYA XK_Sinh_kunddaliya = 0x1000df4 // Mode Switch Lock XF86XK_ModeLock = 0x1008FF01 // Monitor/panel brightness XF86XK_MonBrightnessUp = 0x1008FF02 // Monitor/panel brightness XF86XK_MonBrightnessDown = 0x1008FF03 // Keyboards may be lit XF86XK_KbdLightOnOff = 0x1008FF04 // Keyboards may be lit XF86XK_KbdBrightnessUp = 0x1008FF05 // Keyboards may be lit XF86XK_KbdBrightnessDown = 0x1008FF06 // System into standby mode XF86XK_Standby = 0x1008FF10 // Volume control down XF86XK_AudioLowerVolume = 0x1008FF11 // Mute sound from the system XF86XK_AudioMute = 0x1008FF12 // Volume control up XF86XK_AudioRaiseVolume = 0x1008FF13 // Start playing of audio > XF86XK_AudioPlay = 0x1008FF14 // Stop playing audio XF86XK_AudioStop = 0x1008FF15 // Previous track XF86XK_AudioPrev = 0x1008FF16 // Next track XF86XK_AudioNext = 0x1008FF17 // Display user's home page XF86XK_HomePage = 0x1008FF18 // Invoke user's mail program XF86XK_Mail = 0x1008FF19 // Start application XF86XK_Start = 0x1008FF1A // Search XF86XK_Search = 0x1008FF1B // Record audio application XF86XK_AudioRecord = 0x1008FF1C // Invoke calculator program XF86XK_Calculator = 0x1008FF1D // Invoke Memo taking program XF86XK_Memo = 0x1008FF1E // Invoke To Do List program XF86XK_ToDoList = 0x1008FF1F // Invoke Calendar program XF86XK_Calendar = 0x1008FF20 // Deep sleep the system XF86XK_PowerDown = 0x1008FF21 // Adjust screen contrast XF86XK_ContrastAdjust = 0x1008FF22 // Rocker switches exist up XF86XK_RockerUp = 0x1008FF23 // and down XF86XK_RockerDown = 0x1008FF24 // and let you press them XF86XK_RockerEnter = 0x1008FF25 // Like back on a browser XF86XK_Back = 0x1008FF26 // Like forward on a browser XF86XK_Forward = 0x1008FF27 // Stop current operation XF86XK_Stop = 0x1008FF28 // Refresh the page XF86XK_Refresh = 0x1008FF29 // Power off system entirely XF86XK_PowerOff = 0x1008FF2A // Wake up system from sleep XF86XK_WakeUp = 0x1008FF2B // Eject device (e.g. DVD) XF86XK_Eject = 0x1008FF2C // Invoke screensaver XF86XK_ScreenSaver = 0x1008FF2D // Invoke web browser XF86XK_WWW = 0x1008FF2E // Put system to sleep XF86XK_Sleep = 0x1008FF2F // Show favorite locations XF86XK_Favorites = 0x1008FF30 // Pause audio playing XF86XK_AudioPause = 0x1008FF31 // Launch media collection app XF86XK_AudioMedia = 0x1008FF32 // Display "My Computer" window XF86XK_MyComputer = 0x1008FF33 // Display vendor home web site XF86XK_VendorHome = 0x1008FF34 // Light bulb keys exist XF86XK_LightBulb = 0x1008FF35 // Display shopping web site XF86XK_Shop = 0x1008FF36 // Show history of web surfing XF86XK_History = 0x1008FF37 // Open selected URL XF86XK_OpenURL = 0x1008FF38 // Add URL to favorites list XF86XK_AddFavorite = 0x1008FF39 // Show "hot" links XF86XK_HotLinks = 0x1008FF3A // Invoke brightness adj. UI XF86XK_BrightnessAdjust = 0x1008FF3B // Display financial site XF86XK_Finance = 0x1008FF3C // Display user's community XF86XK_Community = 0x1008FF3D // "rewind" audio track XF86XK_AudioRewind = 0x1008FF3E // ??? XF86XK_BackForward = 0x1008FF3F // Launch Application XF86XK_Launch0 = 0x1008FF40 // Launch Application XF86XK_Launch1 = 0x1008FF41 // Launch Application XF86XK_Launch2 = 0x1008FF42 // Launch Application XF86XK_Launch3 = 0x1008FF43 // Launch Application XF86XK_Launch4 = 0x1008FF44 // Launch Application XF86XK_Launch5 = 0x1008FF45 // Launch Application XF86XK_Launch6 = 0x1008FF46 // Launch Application XF86XK_Launch7 = 0x1008FF47 // Launch Application XF86XK_Launch8 = 0x1008FF48 // Launch Application XF86XK_Launch9 = 0x1008FF49 // Launch Application XF86XK_LaunchA = 0x1008FF4A // Launch Application XF86XK_LaunchB = 0x1008FF4B // Launch Application XF86XK_LaunchC = 0x1008FF4C // Launch Application XF86XK_LaunchD = 0x1008FF4D // Launch Application XF86XK_LaunchE = 0x1008FF4E // Launch Application XF86XK_LaunchF = 0x1008FF4F // switch to application, left XF86XK_ApplicationLeft = 0x1008FF50 // switch to application, right XF86XK_ApplicationRight = 0x1008FF51 // Launch bookreader XF86XK_Book = 0x1008FF52 // Launch CD/DVD player XF86XK_CD = 0x1008FF53 // Launch Calculater XF86XK_Calculater = 0x1008FF54 // Clear window, screen XF86XK_Clear = 0x1008FF55 // Close window XF86XK_Close = 0x1008FF56 // Copy selection XF86XK_Copy = 0x1008FF57 // Cut selection XF86XK_Cut = 0x1008FF58 // Output switch key XF86XK_Display = 0x1008FF59 // Launch DOS (emulation) XF86XK_DOS = 0x1008FF5A // Open documents window XF86XK_Documents = 0x1008FF5B // Launch spread sheet XF86XK_Excel = 0x1008FF5C // Launch file explorer XF86XK_Explorer = 0x1008FF5D // Launch game XF86XK_Game = 0x1008FF5E // Go to URL XF86XK_Go = 0x1008FF5F // Logitch iTouch- don't use XF86XK_iTouch = 0x1008FF60 // Log off system XF86XK_LogOff = 0x1008FF61 // ?? XF86XK_Market = 0x1008FF62 // enter meeting in calendar XF86XK_Meeting = 0x1008FF63 // distingush keyboard from PB XF86XK_MenuKB = 0x1008FF65 // distinuish PB from keyboard XF86XK_MenuPB = 0x1008FF66 // Favourites XF86XK_MySites = 0x1008FF67 // New (folder, document... XF86XK_New = 0x1008FF68 // News XF86XK_News = 0x1008FF69 // Office home (old Staroffice) XF86XK_OfficeHome = 0x1008FF6A // Open XF86XK_Open = 0x1008FF6B // ?? XF86XK_Option = 0x1008FF6C // Paste XF86XK_Paste = 0x1008FF6D // Launch phone; dial number XF86XK_Phone = 0x1008FF6E // Compaq's Q - don't use XF86XK_Q = 0x1008FF70 // Reply e.g., mail XF86XK_Reply = 0x1008FF72 // Reload web page, file, etc. XF86XK_Reload = 0x1008FF73 // Rotate windows e.g. xrandr XF86XK_RotateWindows = 0x1008FF74 // don't use XF86XK_RotationPB = 0x1008FF75 // don't use XF86XK_RotationKB = 0x1008FF76 // Save (file, document, state XF86XK_Save = 0x1008FF77 // Scroll window/contents up XF86XK_ScrollUp = 0x1008FF78 // Scrool window/contentd down XF86XK_ScrollDown = 0x1008FF79 // Use XKB mousekeys instead XF86XK_ScrollClick = 0x1008FF7A // Send mail, file, object XF86XK_Send = 0x1008FF7B // Spell checker XF86XK_Spell = 0x1008FF7C // Split window or screen XF86XK_SplitScreen = 0x1008FF7D // Get support (??) XF86XK_Support = 0x1008FF7E // Show tasks XF86XK_TaskPane = 0x1008FF7F // Launch terminal emulator XF86XK_Terminal = 0x1008FF80 // toolbox of desktop/app. XF86XK_Tools = 0x1008FF81 // ?? XF86XK_Travel = 0x1008FF82 // ?? XF86XK_UserPB = 0x1008FF84 // ?? XF86XK_User1KB = 0x1008FF85 // ?? XF86XK_User2KB = 0x1008FF86 // Launch video player XF86XK_Video = 0x1008FF87 // button from a mouse wheel XF86XK_WheelButton = 0x1008FF88 // Launch word processor XF86XK_Word = 0x1008FF89 XF86XK_Xfer = 0x1008FF8A // zoom in view, map, etc. XF86XK_ZoomIn = 0x1008FF8B // zoom out view, map, etc. XF86XK_ZoomOut = 0x1008FF8C // mark yourself as away XF86XK_Away = 0x1008FF8D // as in instant messaging XF86XK_Messenger = 0x1008FF8E // Launch web camera app. XF86XK_WebCam = 0x1008FF8F // Forward in mail XF86XK_MailForward = 0x1008FF90 // Show pictures XF86XK_Pictures = 0x1008FF91 // Launch music application XF86XK_Music = 0x1008FF92 // Display battery information XF86XK_Battery = 0x1008FF93 // Enable/disable Bluetooth XF86XK_Bluetooth = 0x1008FF94 // Enable/disable WLAN XF86XK_WLAN = 0x1008FF95 // Enable/disable UWB XF86XK_UWB = 0x1008FF96 // fast-forward audio track XF86XK_AudioForward = 0x1008FF97 // toggle repeat mode XF86XK_AudioRepeat = 0x1008FF98 // toggle shuffle mode XF86XK_AudioRandomPlay = 0x1008FF99 // cycle through subtitle XF86XK_Subtitle = 0x1008FF9A // cycle through audio tracks XF86XK_AudioCycleTrack = 0x1008FF9B // cycle through angles XF86XK_CycleAngle = 0x1008FF9C // video: go one frame back XF86XK_FrameBack = 0x1008FF9D // video: go one frame forward XF86XK_FrameForward = 0x1008FF9E // display, or shows an entry for time seeking XF86XK_Time = 0x1008FF9F // Select button on joypads and remotes XF86XK_Select = 0x1008FFA0 // Show a view options/properties XF86XK_View = 0x1008FFA1 // Go to a top-level menu in a video XF86XK_TopMenu = 0x1008FFA2 // Red button XF86XK_Red = 0x1008FFA3 // Green button XF86XK_Green = 0x1008FFA4 // Yellow button XF86XK_Yellow = 0x1008FFA5 // Blue button XF86XK_Blue = 0x1008FFA6 // Sleep to RAM XF86XK_Suspend = 0x1008FFA7 // Sleep to disk XF86XK_Hibernate = 0x1008FFA8 // Toggle between touchpad/trackstick XF86XK_TouchpadToggle = 0x1008FFA9 // The touchpad got switched on XF86XK_TouchpadOn = 0x1008FFB0 // The touchpad got switched off XF86XK_TouchpadOff = 0x1008FFB1 // Mute the Mic from the system XF86XK_AudioMicMute = 0x1008FFB2 // User defined keyboard related action XF86XK_Keyboard = 0x1008FFB3 // Toggle WWAN (LTE, UMTS, etc.) radio XF86XK_WWAN = 0x1008FFB4 // Toggle radios on/off XF86XK_RFKill = 0x1008FFB5 // Select equalizer preset, e.g. theatre-mode XF86XK_AudioPreset = 0x1008FFB6 XF86XK_Switch_VT_1 = 0x1008FE01 XF86XK_Switch_VT_2 = 0x1008FE02 XF86XK_Switch_VT_3 = 0x1008FE03 XF86XK_Switch_VT_4 = 0x1008FE04 XF86XK_Switch_VT_5 = 0x1008FE05 XF86XK_Switch_VT_6 = 0x1008FE06 XF86XK_Switch_VT_7 = 0x1008FE07 XF86XK_Switch_VT_8 = 0x1008FE08 XF86XK_Switch_VT_9 = 0x1008FE09 XF86XK_Switch_VT_10 = 0x1008FE0A XF86XK_Switch_VT_11 = 0x1008FE0B XF86XK_Switch_VT_12 = 0x1008FE0C // force ungrab XF86XK_Ungrab = 0x1008FE20 // kill application with grab XF86XK_ClearGrab = 0x1008FE21 // next video mode available XF86XK_Next_VMode = 0x1008FE22 // prev. video mode available XF86XK_Prev_VMode = 0x1008FE23 // print window tree to log XF86XK_LogWindowTree = 0x1008FE24 // print all active grabs to log XF86XK_LogGrabInfo = 0x1008FE25 ) var KeysymEngMap = map[x.Keysym]string{ XK_VoidSymbol: "VoidSymbol", XK_BackSpace: "BackSpace", XK_Tab: "Tab", XK_Linefeed: "Linefeed", XK_Clear: "Clear", XK_Return: "Return", XK_Pause: "Pause", XK_Scroll_Lock: "Scroll_Lock", XK_Sys_Req: "Sys_Req", XK_Escape: "Escape", XK_Delete: "Delete", XK_Multi_key: "Multi_key", XK_Codeinput: "Codeinput", XK_SingleCandidate: "SingleCandidate", XK_MultipleCandidate: "MultipleCandidate", XK_PreviousCandidate: "PreviousCandidate", XK_Kanji: "Kanji", XK_Muhenkan: "Muhenkan", XK_Henkan_Mode: "Henkan_Mode", // XK_Henkan == XK_Henkan_Mode # Alias for Henkan_Mode XK_Romaji: "Romaji", XK_Hiragana: "Hiragana", XK_Katakana: "Katakana", XK_Hiragana_Katakana: "Hiragana_Katakana", XK_Zenkaku: "Zenkaku", XK_Hankaku: "Hankaku", XK_Zenkaku_Hankaku: "Zenkaku_Hankaku", XK_Touroku: "Touroku", XK_Massyo: "Massyo", XK_Kana_Lock: "Kana_Lock", XK_Kana_Shift: "Kana_Shift", XK_Eisu_Shift: "Eisu_Shift", XK_Eisu_toggle: "Eisu_toggle", // XK_Kanji_Bangou == XK_Codeinput # Codeinput // XK_Zen_Koho == XK_MultipleCandidate # Multiple/All Candidate(s) // XK_Mae_Koho == XK_PreviousCandidate # Previous Candidate XK_Home: "Home", XK_Left: "Left", XK_Up: "Up", XK_Right: "Right", XK_Down: "Down", XK_Prior: "Prior", // XK_Page_Up == XK_Prior # XK_Next: "Next", // XK_Page_Down == XK_Next # XK_End: "End", XK_Begin: "Begin", XK_Select: "Select", XK_Print: "Print", XK_Execute: "Execute", XK_Insert: "Insert", XK_Undo: "Undo", XK_Redo: "Redo", XK_Menu: "Menu", XK_Find: "Find", XK_Cancel: "Cancel", XK_Help: "Help", XK_Break: "Break", XK_Mode_switch: "Mode_switch", // XK_script_switch == XK_Mode_switch # Alias for mode_switch XK_Num_Lock: "Num_Lock", XK_KP_Space: "KP_Space", XK_KP_Tab: "KP_Tab", XK_KP_Enter: "KP_Enter", XK_KP_F1: "KP_F1", XK_KP_F2: "KP_F2", XK_KP_F3: "KP_F3", XK_KP_F4: "KP_F4", XK_KP_Home: "KP_Home", XK_KP_Left: "KP_Left", XK_KP_Up: "KP_Up", XK_KP_Right: "KP_Right", XK_KP_Down: "KP_Down", XK_KP_Prior: "KP_Prior", // XK_KP_Page_Up == XK_KP_Prior # XK_KP_Next: "KP_Next", // XK_KP_Page_Down == XK_KP_Next # XK_KP_End: "KP_End", XK_KP_Begin: "KP_Begin", XK_KP_Insert: "KP_Insert", XK_KP_Delete: "KP_Delete", XK_KP_Equal: "KP_Equal", XK_KP_Multiply: "KP_Multiply", XK_KP_Add: "KP_Add", XK_KP_Separator: "KP_Separator", XK_KP_Subtract: "KP_Subtract", XK_KP_Decimal: "KP_Decimal", XK_KP_Divide: "KP_Divide", XK_KP_0: "KP_0", XK_KP_1: "KP_1", XK_KP_2: "KP_2", XK_KP_3: "KP_3", XK_KP_4: "KP_4", XK_KP_5: "KP_5", XK_KP_6: "KP_6", XK_KP_7: "KP_7", XK_KP_8: "KP_8", XK_KP_9: "KP_9", XK_F1: "F1", XK_F2: "F2", XK_F3: "F3", XK_F4: "F4", XK_F5: "F5", XK_F6: "F6", XK_F7: "F7", XK_F8: "F8", XK_F9: "F9", XK_F10: "F10", XK_F11: "F11", // XK_L1 == XK_F11 # XK_F12: "F12", // XK_L2 == XK_F12 # XK_F13: "F13", // XK_L3 == XK_F13 # XK_F14: "F14", // XK_L4 == XK_F14 # XK_F15: "F15", // XK_L5 == XK_F15 # XK_F16: "F16", // XK_L6 == XK_F16 # XK_F17: "F17", // XK_L7 == XK_F17 # XK_F18: "F18", // XK_L8 == XK_F18 # XK_F19: "F19", // XK_L9 == XK_F19 # XK_F20: "F20", // XK_L10 == XK_F20 # XK_F21: "F21", // XK_R1 == XK_F21 # XK_F22: "F22", // XK_R2 == XK_F22 # XK_F23: "F23", // XK_R3 == XK_F23 # XK_F24: "F24", // XK_R4 == XK_F24 # XK_F25: "F25", // XK_R5 == XK_F25 # XK_F26: "F26", // XK_R6 == XK_F26 # XK_F27: "F27", // XK_R7 == XK_F27 # XK_F28: "F28", // XK_R8 == XK_F28 # XK_F29: "F29", // XK_R9 == XK_F29 # XK_F30: "F30", // XK_R10 == XK_F30 # XK_F31: "F31", // XK_R11 == XK_F31 # XK_F32: "F32", // XK_R12 == XK_F32 # XK_F33: "F33", // XK_R13 == XK_F33 # XK_F34: "F34", // XK_R14 == XK_F34 # XK_F35: "F35", // XK_R15 == XK_F35 # XK_Shift_L: "Shift_L", XK_Shift_R: "Shift_R", XK_Control_L: "Control_L", XK_Control_R: "Control_R", XK_Caps_Lock: "Caps_Lock", XK_Shift_Lock: "Shift_Lock", XK_Meta_L: "Meta_L", XK_Meta_R: "Meta_R", XK_Alt_L: "Alt_L", XK_Alt_R: "Alt_R", XK_Super_L: "Super_L", XK_Super_R: "Super_R", XK_Hyper_L: "Hyper_L", XK_Hyper_R: "Hyper_R", XK_ISO_Lock: "ISO_Lock", XK_ISO_Level2_Latch: "ISO_Level2_Latch", XK_ISO_Level3_Shift: "ISO_Level3_Shift", XK_ISO_Level3_Latch: "ISO_Level3_Latch", XK_ISO_Level3_Lock: "ISO_Level3_Lock", XK_ISO_Level5_Shift: "ISO_Level5_Shift", XK_ISO_Level5_Latch: "ISO_Level5_Latch", XK_ISO_Level5_Lock: "ISO_Level5_Lock", // XK_ISO_Group_Shift == XK_Mode_switch # Alias for mode_switch XK_ISO_Group_Latch: "ISO_Group_Latch", XK_ISO_Group_Lock: "ISO_Group_Lock", XK_ISO_Next_Group: "ISO_Next_Group", XK_ISO_Next_Group_Lock: "ISO_Next_Group_Lock", XK_ISO_Prev_Group: "ISO_Prev_Group", XK_ISO_Prev_Group_Lock: "ISO_Prev_Group_Lock", XK_ISO_First_Group: "ISO_First_Group", XK_ISO_First_Group_Lock: "ISO_First_Group_Lock", XK_ISO_Last_Group: "ISO_Last_Group", XK_ISO_Last_Group_Lock: "ISO_Last_Group_Lock", XK_ISO_Left_Tab: "ISO_Left_Tab", XK_ISO_Move_Line_Up: "ISO_Move_Line_Up", XK_ISO_Move_Line_Down: "ISO_Move_Line_Down", XK_ISO_Partial_Line_Up: "ISO_Partial_Line_Up", XK_ISO_Partial_Line_Down: "ISO_Partial_Line_Down", XK_ISO_Partial_Space_Left: "ISO_Partial_Space_Left", XK_ISO_Partial_Space_Right: "ISO_Partial_Space_Right", XK_ISO_Set_Margin_Left: "ISO_Set_Margin_Left", XK_ISO_Set_Margin_Right: "ISO_Set_Margin_Right", XK_ISO_Release_Margin_Left: "ISO_Release_Margin_Left", XK_ISO_Release_Margin_Right: "ISO_Release_Margin_Right", XK_ISO_Release_Both_Margins: "ISO_Release_Both_Margins", XK_ISO_Fast_Cursor_Left: "ISO_Fast_Cursor_Left", XK_ISO_Fast_Cursor_Right: "ISO_Fast_Cursor_Right", XK_ISO_Fast_Cursor_Up: "ISO_Fast_Cursor_Up", XK_ISO_Fast_Cursor_Down: "ISO_Fast_Cursor_Down", XK_ISO_Continuous_Underline: "ISO_Continuous_Underline", XK_ISO_Discontinuous_Underline: "ISO_Discontinuous_Underline", XK_ISO_Emphasize: "ISO_Emphasize", XK_ISO_Center_Object: "ISO_Center_Object", XK_ISO_Enter: "ISO_Enter", XK_dead_grave: "dead_grave", XK_dead_acute: "dead_acute", XK_dead_circumflex: "dead_circumflex", XK_dead_tilde: "dead_tilde", // XK_dead_perispomeni == XK_dead_tilde # alias for dead_tilde XK_dead_macron: "dead_macron", XK_dead_breve: "dead_breve", XK_dead_abovedot: "dead_abovedot", XK_dead_diaeresis: "dead_diaeresis", XK_dead_abovering: "dead_abovering", XK_dead_doubleacute: "dead_doubleacute", XK_dead_caron: "dead_caron", XK_dead_cedilla: "dead_cedilla", XK_dead_ogonek: "dead_ogonek", XK_dead_iota: "dead_iota", XK_dead_voiced_sound: "dead_voiced_sound", XK_dead_semivoiced_sound: "dead_semivoiced_sound", XK_dead_belowdot: "dead_belowdot", XK_dead_hook: "dead_hook", XK_dead_horn: "dead_horn", XK_dead_stroke: "dead_stroke", XK_dead_abovecomma: "dead_abovecomma", // XK_dead_psili == XK_dead_abovecomma # alias for dead_abovecomma XK_dead_abovereversedcomma: "dead_abovereversedcomma", // XK_dead_dasia == XK_dead_abovereversedcomma # alias for dead_abovereversedcomma XK_dead_doublegrave: "dead_doublegrave", XK_dead_belowring: "dead_belowring", XK_dead_belowmacron: "dead_belowmacron", XK_dead_belowcircumflex: "dead_belowcircumflex", XK_dead_belowtilde: "dead_belowtilde", XK_dead_belowbreve: "dead_belowbreve", XK_dead_belowdiaeresis: "dead_belowdiaeresis", XK_dead_invertedbreve: "dead_invertedbreve", XK_dead_belowcomma: "dead_belowcomma", XK_dead_currency: "dead_currency", XK_dead_lowline: "dead_lowline", XK_dead_aboveverticalline: "dead_aboveverticalline", XK_dead_belowverticalline: "dead_belowverticalline", XK_dead_longsolidusoverlay: "dead_longsolidusoverlay", XK_dead_a: "dead_a", XK_dead_A: "dead_A", XK_dead_e: "dead_e", XK_dead_E: "dead_E", XK_dead_i: "dead_i", XK_dead_I: "dead_I", XK_dead_o: "dead_o", XK_dead_O: "dead_O", XK_dead_u: "dead_u", XK_dead_U: "dead_U", XK_dead_small_schwa: "dead_small_schwa", XK_dead_capital_schwa: "dead_capital_schwa", XK_dead_greek: "dead_greek", XK_First_Virtual_Screen: "First_Virtual_Screen", XK_Prev_Virtual_Screen: "Prev_Virtual_Screen", XK_Next_Virtual_Screen: "Next_Virtual_Screen", XK_Last_Virtual_Screen: "Last_Virtual_Screen", XK_Terminate_Server: "Terminate_Server", XK_AccessX_Enable: "AccessX_Enable", XK_AccessX_Feedback_Enable: "AccessX_Feedback_Enable", XK_RepeatKeys_Enable: "RepeatKeys_Enable", XK_SlowKeys_Enable: "SlowKeys_Enable", XK_BounceKeys_Enable: "BounceKeys_Enable", XK_StickyKeys_Enable: "StickyKeys_Enable", XK_MouseKeys_Enable: "MouseKeys_Enable", XK_MouseKeys_Accel_Enable: "MouseKeys_Accel_Enable", XK_Overlay1_Enable: "Overlay1_Enable", XK_Overlay2_Enable: "Overlay2_Enable", XK_AudibleBell_Enable: "AudibleBell_Enable", XK_Pointer_Left: "Pointer_Left", XK_Pointer_Right: "Pointer_Right", XK_Pointer_Up: "Pointer_Up", XK_Pointer_Down: "Pointer_Down", XK_Pointer_UpLeft: "Pointer_UpLeft", XK_Pointer_UpRight: "Pointer_UpRight", XK_Pointer_DownLeft: "Pointer_DownLeft", XK_Pointer_DownRight: "Pointer_DownRight", XK_Pointer_Button_Dflt: "Pointer_Button_Dflt", XK_Pointer_Button1: "Pointer_Button1", XK_Pointer_Button2: "Pointer_Button2", XK_Pointer_Button3: "Pointer_Button3", XK_Pointer_Button4: "Pointer_Button4", XK_Pointer_Button5: "Pointer_Button5", XK_Pointer_DblClick_Dflt: "Pointer_DblClick_Dflt", XK_Pointer_DblClick1: "Pointer_DblClick1", XK_Pointer_DblClick2: "Pointer_DblClick2", XK_Pointer_DblClick3: "Pointer_DblClick3", XK_Pointer_DblClick4: "Pointer_DblClick4", XK_Pointer_DblClick5: "Pointer_DblClick5", XK_Pointer_Drag_Dflt: "Pointer_Drag_Dflt", XK_Pointer_Drag1: "Pointer_Drag1", XK_Pointer_Drag2: "Pointer_Drag2", XK_Pointer_Drag3: "Pointer_Drag3", XK_Pointer_Drag4: "Pointer_Drag4", XK_Pointer_Drag5: "Pointer_Drag5", XK_Pointer_EnableKeys: "Pointer_EnableKeys", XK_Pointer_Accelerate: "Pointer_Accelerate", XK_Pointer_DfltBtnNext: "Pointer_DfltBtnNext", XK_Pointer_DfltBtnPrev: "Pointer_DfltBtnPrev", XK_ch: "ch", XK_Ch: "Ch", XK_CH: "CH", XK_c_h: "c_h", XK_C_h: "C_h", XK_C_H: "C_H", XK_space: "space", XK_exclam: "exclam", XK_quotedbl: "quotedbl", XK_numbersign: "numbersign", XK_dollar: "dollar", XK_percent: "percent", XK_ampersand: "ampersand", XK_apostrophe: "apostrophe", // XK_quoteright == XK_apostrophe # deprecated XK_parenleft: "parenleft", XK_parenright: "parenright", XK_asterisk: "asterisk", XK_plus: "plus", XK_comma: "comma", XK_minus: "minus", XK_period: "period", XK_slash: "slash", XK_0: "0", XK_1: "1", XK_2: "2", XK_3: "3", XK_4: "4", XK_5: "5", XK_6: "6", XK_7: "7", XK_8: "8", XK_9: "9", XK_colon: "colon", XK_semicolon: "semicolon", XK_less: "less", XK_equal: "equal", XK_greater: "greater", XK_question: "question", XK_at: "at", XK_A: "A", XK_B: "B", XK_C: "C", XK_D: "D", XK_E: "E", XK_F: "F", XK_G: "G", XK_H: "H", XK_I: "I", XK_J: "J", XK_K: "K", XK_L: "L", XK_M: "M", XK_N: "N", XK_O: "O", XK_P: "P", XK_Q: "Q", XK_R: "R", XK_S: "S", XK_T: "T", XK_U: "U", XK_V: "V", XK_W: "W", XK_X: "X", XK_Y: "Y", XK_Z: "Z", XK_bracketleft: "bracketleft", XK_backslash: "backslash", XK_bracketright: "bracketright", XK_asciicircum: "asciicircum", XK_underscore: "underscore", XK_grave: "grave", // XK_quoteleft == XK_grave # deprecated XK_a: "a", XK_b: "b", XK_c: "c", XK_d: "d", XK_e: "e", XK_f: "f", XK_g: "g", XK_h: "h", XK_i: "i", XK_j: "j", XK_k: "k", XK_l: "l", XK_m: "m", XK_n: "n", XK_o: "o", XK_p: "p", XK_q: "q", XK_r: "r", XK_s: "s", XK_t: "t", XK_u: "u", XK_v: "v", XK_w: "w", XK_x: "x", XK_y: "y", XK_z: "z", XK_braceleft: "braceleft", XK_bar: "bar", XK_braceright: "braceright", XK_asciitilde: "asciitilde", XK_nobreakspace: "nobreakspace", XK_exclamdown: "exclamdown", XK_cent: "cent", XK_sterling: "sterling", XK_currency: "currency", XK_yen: "yen", XK_brokenbar: "brokenbar", XK_section: "section", XK_diaeresis: "diaeresis", XK_copyright: "copyright", XK_ordfeminine: "ordfeminine", XK_guillemotleft: "guillemotleft", XK_notsign: "notsign", XK_hyphen: "hyphen", XK_registered: "registered", XK_macron: "macron", XK_degree: "degree", XK_plusminus: "plusminus", XK_twosuperior: "twosuperior", XK_threesuperior: "threesuperior", XK_acute: "acute", XK_mu: "mu", XK_paragraph: "paragraph", XK_periodcentered: "periodcentered", XK_cedilla: "cedilla", XK_onesuperior: "onesuperior", XK_masculine: "masculine", XK_guillemotright: "guillemotright", XK_onequarter: "onequarter", XK_onehalf: "onehalf", XK_threequarters: "threequarters", XK_questiondown: "questiondown", XK_Agrave: "Agrave", XK_Aacute: "Aacute", XK_Acircumflex: "Acircumflex", XK_Atilde: "Atilde", XK_Adiaeresis: "Adiaeresis", XK_Aring: "Aring", XK_AE: "AE", XK_Ccedilla: "Ccedilla", XK_Egrave: "Egrave", XK_Eacute: "Eacute", XK_Ecircumflex: "Ecircumflex", XK_Ediaeresis: "Ediaeresis", XK_Igrave: "Igrave", XK_Iacute: "Iacute", XK_Icircumflex: "Icircumflex", XK_Idiaeresis: "Idiaeresis", XK_ETH: "ETH", // XK_Eth == XK_ETH # deprecated XK_Ntilde: "Ntilde", XK_Ograve: "Ograve", XK_Oacute: "Oacute", XK_Ocircumflex: "Ocircumflex", XK_Otilde: "Otilde", XK_Odiaeresis: "Odiaeresis", XK_multiply: "multiply", XK_Oslash: "Oslash", // XK_Ooblique == XK_Oslash # U+00D8 LATIN CAPITAL LETTER O WITH STROKE XK_Ugrave: "Ugrave", XK_Uacute: "Uacute", XK_Ucircumflex: "Ucircumflex", XK_Udiaeresis: "Udiaeresis", XK_Yacute: "Yacute", XK_THORN: "THORN", // XK_Thorn == XK_THORN # deprecated XK_ssharp: "ssharp", XK_agrave: "agrave", XK_aacute: "aacute", XK_acircumflex: "acircumflex", XK_atilde: "atilde", XK_adiaeresis: "adiaeresis", XK_aring: "aring", XK_ae: "ae", XK_ccedilla: "ccedilla", XK_egrave: "egrave", XK_eacute: "eacute", XK_ecircumflex: "ecircumflex", XK_ediaeresis: "ediaeresis", XK_igrave: "igrave", XK_iacute: "iacute", XK_icircumflex: "icircumflex", XK_idiaeresis: "idiaeresis", XK_eth: "eth", XK_ntilde: "ntilde", XK_ograve: "ograve", XK_oacute: "oacute", XK_ocircumflex: "ocircumflex", XK_otilde: "otilde", XK_odiaeresis: "odiaeresis", XK_division: "division", XK_oslash: "oslash", // XK_ooblique == XK_oslash # U+00F8 LATIN SMALL LETTER O WITH STROKE XK_ugrave: "ugrave", XK_uacute: "uacute", XK_ucircumflex: "ucircumflex", XK_udiaeresis: "udiaeresis", XK_yacute: "yacute", XK_thorn: "thorn", XK_ydiaeresis: "ydiaeresis", XK_Aogonek: "Aogonek", XK_breve: "breve", XK_Lstroke: "Lstroke", XK_Lcaron: "Lcaron", XK_Sacute: "Sacute", XK_Scaron: "Scaron", XK_Scedilla: "Scedilla", XK_Tcaron: "Tcaron", XK_Zacute: "Zacute", XK_Zcaron: "Zcaron", XK_Zabovedot: "Zabovedot", XK_aogonek: "aogonek", XK_ogonek: "ogonek", XK_lstroke: "lstroke", XK_lcaron: "lcaron", XK_sacute: "sacute", XK_caron: "caron", XK_scaron: "scaron", XK_scedilla: "scedilla", XK_tcaron: "tcaron", XK_zacute: "zacute", XK_doubleacute: "doubleacute", XK_zcaron: "zcaron", XK_zabovedot: "zabovedot", XK_Racute: "Racute", XK_Abreve: "Abreve", XK_Lacute: "Lacute", XK_Cacute: "Cacute", XK_Ccaron: "Ccaron", XK_Eogonek: "Eogonek", XK_Ecaron: "Ecaron", XK_Dcaron: "Dcaron", XK_Dstroke: "Dstroke", XK_Nacute: "Nacute", XK_Ncaron: "Ncaron", XK_Odoubleacute: "Odoubleacute", XK_Rcaron: "Rcaron", XK_Uring: "Uring", XK_Udoubleacute: "Udoubleacute", XK_Tcedilla: "Tcedilla", XK_racute: "racute", XK_abreve: "abreve", XK_lacute: "lacute", XK_cacute: "cacute", XK_ccaron: "ccaron", XK_eogonek: "eogonek", XK_ecaron: "ecaron", XK_dcaron: "dcaron", XK_dstroke: "dstroke", XK_nacute: "nacute", XK_ncaron: "ncaron", XK_odoubleacute: "odoubleacute", XK_rcaron: "rcaron", XK_uring: "uring", XK_udoubleacute: "udoubleacute", XK_tcedilla: "tcedilla", XK_abovedot: "abovedot", XK_Hstroke: "Hstroke", XK_Hcircumflex: "Hcircumflex", XK_Iabovedot: "Iabovedot", XK_Gbreve: "Gbreve", XK_Jcircumflex: "Jcircumflex", XK_hstroke: "hstroke", XK_hcircumflex: "hcircumflex", XK_idotless: "idotless", XK_gbreve: "gbreve", XK_jcircumflex: "jcircumflex", XK_Cabovedot: "Cabovedot", XK_Ccircumflex: "Ccircumflex", XK_Gabovedot: "Gabovedot", XK_Gcircumflex: "Gcircumflex", XK_Ubreve: "Ubreve", XK_Scircumflex: "Scircumflex", XK_cabovedot: "cabovedot", XK_ccircumflex: "ccircumflex", XK_gabovedot: "gabovedot", XK_gcircumflex: "gcircumflex", XK_ubreve: "ubreve", XK_scircumflex: "scircumflex", XK_kra: "kra", // XK_kappa == XK_kra # deprecated XK_Rcedilla: "Rcedilla", XK_Itilde: "Itilde", XK_Lcedilla: "Lcedilla", XK_Emacron: "Emacron", XK_Gcedilla: "Gcedilla", XK_Tslash: "Tslash", XK_rcedilla: "rcedilla", XK_itilde: "itilde", XK_lcedilla: "lcedilla", XK_emacron: "emacron", XK_gcedilla: "gcedilla", XK_tslash: "tslash", XK_ENG: "ENG", XK_eng: "eng", XK_Amacron: "Amacron", XK_Iogonek: "Iogonek", XK_Eabovedot: "Eabovedot", XK_Imacron: "Imacron", XK_Ncedilla: "Ncedilla", XK_Omacron: "Omacron", XK_Kcedilla: "Kcedilla", XK_Uogonek: "Uogonek", XK_Utilde: "Utilde", XK_Umacron: "Umacron", XK_amacron: "amacron", XK_iogonek: "iogonek", XK_eabovedot: "eabovedot", XK_imacron: "imacron", XK_ncedilla: "ncedilla", XK_omacron: "omacron", XK_kcedilla: "kcedilla", XK_uogonek: "uogonek", XK_utilde: "utilde", XK_umacron: "umacron", XK_Wcircumflex: "Wcircumflex", XK_wcircumflex: "wcircumflex", XK_Ycircumflex: "Ycircumflex", XK_ycircumflex: "ycircumflex", XK_Babovedot: "Babovedot", XK_babovedot: "babovedot", XK_Dabovedot: "Dabovedot", XK_dabovedot: "dabovedot", XK_Fabovedot: "Fabovedot", XK_fabovedot: "fabovedot", XK_Mabovedot: "Mabovedot", XK_mabovedot: "mabovedot", XK_Pabovedot: "Pabovedot", XK_pabovedot: "pabovedot", XK_Sabovedot: "Sabovedot", XK_sabovedot: "sabovedot", XK_Tabovedot: "Tabovedot", XK_tabovedot: "tabovedot", XK_Wgrave: "Wgrave", XK_wgrave: "wgrave", XK_Wacute: "Wacute", XK_wacute: "wacute", XK_Wdiaeresis: "Wdiaeresis", XK_wdiaeresis: "wdiaeresis", XK_Ygrave: "Ygrave", XK_ygrave: "ygrave", XK_OE: "OE", XK_oe: "oe", XK_Ydiaeresis: "Ydiaeresis", XK_overline: "overline", XK_kana_fullstop: "kana_fullstop", XK_kana_openingbracket: "kana_openingbracket", XK_kana_closingbracket: "kana_closingbracket", XK_kana_comma: "kana_comma", XK_kana_conjunctive: "kana_conjunctive", // XK_kana_middledot == XK_kana_conjunctive # deprecated XK_kana_WO: "kana_WO", XK_kana_a: "kana_a", XK_kana_i: "kana_i", XK_kana_u: "kana_u", XK_kana_e: "kana_e", XK_kana_o: "kana_o", XK_kana_ya: "kana_ya", XK_kana_yu: "kana_yu", XK_kana_yo: "kana_yo", XK_kana_tsu: "kana_tsu", // XK_kana_tu == XK_kana_tsu # deprecated XK_prolongedsound: "prolongedsound", XK_kana_A: "kana_A", XK_kana_I: "kana_I", XK_kana_U: "kana_U", XK_kana_E: "kana_E", XK_kana_O: "kana_O", XK_kana_KA: "kana_KA", XK_kana_KI: "kana_KI", XK_kana_KU: "kana_KU", XK_kana_KE: "kana_KE", XK_kana_KO: "kana_KO", XK_kana_SA: "kana_SA", XK_kana_SHI: "kana_SHI", XK_kana_SU: "kana_SU", XK_kana_SE: "kana_SE", XK_kana_SO: "kana_SO", XK_kana_TA: "kana_TA", XK_kana_CHI: "kana_CHI", // XK_kana_TI == XK_kana_CHI # deprecated XK_kana_TSU: "kana_TSU", // XK_kana_TU == XK_kana_TSU # deprecated XK_kana_TE: "kana_TE", XK_kana_TO: "kana_TO", XK_kana_NA: "kana_NA", XK_kana_NI: "kana_NI", XK_kana_NU: "kana_NU", XK_kana_NE: "kana_NE", XK_kana_NO: "kana_NO", XK_kana_HA: "kana_HA", XK_kana_HI: "kana_HI", XK_kana_FU: "kana_FU", // XK_kana_HU == XK_kana_FU # deprecated XK_kana_HE: "kana_HE", XK_kana_HO: "kana_HO", XK_kana_MA: "kana_MA", XK_kana_MI: "kana_MI", XK_kana_MU: "kana_MU", XK_kana_ME: "kana_ME", XK_kana_MO: "kana_MO", XK_kana_YA: "kana_YA", XK_kana_YU: "kana_YU", XK_kana_YO: "kana_YO", XK_kana_RA: "kana_RA", XK_kana_RI: "kana_RI", XK_kana_RU: "kana_RU", XK_kana_RE: "kana_RE", XK_kana_RO: "kana_RO", XK_kana_WA: "kana_WA", XK_kana_N: "kana_N", XK_voicedsound: "voicedsound", XK_semivoicedsound: "semivoicedsound", // XK_kana_switch == XK_Mode_switch # Alias for mode_switch XK_Farsi_0: "Farsi_0", XK_Farsi_1: "Farsi_1", XK_Farsi_2: "Farsi_2", XK_Farsi_3: "Farsi_3", XK_Farsi_4: "Farsi_4", XK_Farsi_5: "Farsi_5", XK_Farsi_6: "Farsi_6", XK_Farsi_7: "Farsi_7", XK_Farsi_8: "Farsi_8", XK_Farsi_9: "Farsi_9", XK_Arabic_percent: "Arabic_percent", XK_Arabic_superscript_alef: "Arabic_superscript_alef", XK_Arabic_tteh: "Arabic_tteh", XK_Arabic_peh: "Arabic_peh", XK_Arabic_tcheh: "Arabic_tcheh", XK_Arabic_ddal: "Arabic_ddal", XK_Arabic_rreh: "Arabic_rreh", XK_Arabic_comma: "Arabic_comma", XK_Arabic_fullstop: "Arabic_fullstop", XK_Arabic_0: "Arabic_0", XK_Arabic_1: "Arabic_1", XK_Arabic_2: "Arabic_2", XK_Arabic_3: "Arabic_3", XK_Arabic_4: "Arabic_4", XK_Arabic_5: "Arabic_5", XK_Arabic_6: "Arabic_6", XK_Arabic_7: "Arabic_7", XK_Arabic_8: "Arabic_8", XK_Arabic_9: "Arabic_9", XK_Arabic_semicolon: "Arabic_semicolon", XK_Arabic_question_mark: "Arabic_question_mark", XK_Arabic_hamza: "Arabic_hamza", XK_Arabic_maddaonalef: "Arabic_maddaonalef", XK_Arabic_hamzaonalef: "Arabic_hamzaonalef", XK_Arabic_hamzaonwaw: "Arabic_hamzaonwaw", XK_Arabic_hamzaunderalef: "Arabic_hamzaunderalef", XK_Arabic_hamzaonyeh: "Arabic_hamzaonyeh", XK_Arabic_alef: "Arabic_alef", XK_Arabic_beh: "Arabic_beh", XK_Arabic_tehmarbuta: "Arabic_tehmarbuta", XK_Arabic_teh: "Arabic_teh", XK_Arabic_theh: "Arabic_theh", XK_Arabic_jeem: "Arabic_jeem", XK_Arabic_hah: "Arabic_hah", XK_Arabic_khah: "Arabic_khah", XK_Arabic_dal: "Arabic_dal", XK_Arabic_thal: "Arabic_thal", XK_Arabic_ra: "Arabic_ra", XK_Arabic_zain: "Arabic_zain", XK_Arabic_seen: "Arabic_seen", XK_Arabic_sheen: "Arabic_sheen", XK_Arabic_sad: "Arabic_sad", XK_Arabic_dad: "Arabic_dad", XK_Arabic_tah: "Arabic_tah", XK_Arabic_zah: "Arabic_zah", XK_Arabic_ain: "Arabic_ain", XK_Arabic_ghain: "Arabic_ghain", XK_Arabic_tatweel: "Arabic_tatweel", XK_Arabic_feh: "Arabic_feh", XK_Arabic_qaf: "Arabic_qaf", XK_Arabic_kaf: "Arabic_kaf", XK_Arabic_lam: "Arabic_lam", XK_Arabic_meem: "Arabic_meem", XK_Arabic_noon: "Arabic_noon", XK_Arabic_ha: "Arabic_ha", // XK_Arabic_heh == XK_Arabic_ha # deprecated XK_Arabic_waw: "Arabic_waw", XK_Arabic_alefmaksura: "Arabic_alefmaksura", XK_Arabic_yeh: "Arabic_yeh", XK_Arabic_fathatan: "Arabic_fathatan", XK_Arabic_dammatan: "Arabic_dammatan", XK_Arabic_kasratan: "Arabic_kasratan", XK_Arabic_fatha: "Arabic_fatha", XK_Arabic_damma: "Arabic_damma", XK_Arabic_kasra: "Arabic_kasra", XK_Arabic_shadda: "Arabic_shadda", XK_Arabic_sukun: "Arabic_sukun", XK_Arabic_madda_above: "Arabic_madda_above", XK_Arabic_hamza_above: "Arabic_hamza_above", XK_Arabic_hamza_below: "Arabic_hamza_below", XK_Arabic_jeh: "Arabic_jeh", XK_Arabic_veh: "Arabic_veh", XK_Arabic_keheh: "Arabic_keheh", XK_Arabic_gaf: "Arabic_gaf", XK_Arabic_noon_ghunna: "Arabic_noon_ghunna", XK_Arabic_heh_doachashmee: "Arabic_heh_doachashmee", XK_Farsi_yeh: "Farsi_yeh", // XK_Arabic_farsi_yeh == XK_Farsi_yeh # U+06CC ARABIC LETTER FARSI YEH XK_Arabic_yeh_baree: "Arabic_yeh_baree", XK_Arabic_heh_goal: "Arabic_heh_goal", // XK_Arabic_switch == XK_Mode_switch # Alias for mode_switch XK_Cyrillic_GHE_bar: "Cyrillic_GHE_bar", XK_Cyrillic_ghe_bar: "Cyrillic_ghe_bar", XK_Cyrillic_ZHE_descender: "Cyrillic_ZHE_descender", XK_Cyrillic_zhe_descender: "Cyrillic_zhe_descender", XK_Cyrillic_KA_descender: "Cyrillic_KA_descender", XK_Cyrillic_ka_descender: "Cyrillic_ka_descender", XK_Cyrillic_KA_vertstroke: "Cyrillic_KA_vertstroke", XK_Cyrillic_ka_vertstroke: "Cyrillic_ka_vertstroke", XK_Cyrillic_EN_descender: "Cyrillic_EN_descender", XK_Cyrillic_en_descender: "Cyrillic_en_descender", XK_Cyrillic_U_straight: "Cyrillic_U_straight", XK_Cyrillic_u_straight: "Cyrillic_u_straight", XK_Cyrillic_U_straight_bar: "Cyrillic_U_straight_bar", XK_Cyrillic_u_straight_bar: "Cyrillic_u_straight_bar", XK_Cyrillic_HA_descender: "Cyrillic_HA_descender", XK_Cyrillic_ha_descender: "Cyrillic_ha_descender", XK_Cyrillic_CHE_descender: "Cyrillic_CHE_descender", XK_Cyrillic_che_descender: "Cyrillic_che_descender", XK_Cyrillic_CHE_vertstroke: "Cyrillic_CHE_vertstroke", XK_Cyrillic_che_vertstroke: "Cyrillic_che_vertstroke", XK_Cyrillic_SHHA: "Cyrillic_SHHA", XK_Cyrillic_shha: "Cyrillic_shha", XK_Cyrillic_SCHWA: "Cyrillic_SCHWA", XK_Cyrillic_schwa: "Cyrillic_schwa", XK_Cyrillic_I_macron: "Cyrillic_I_macron", XK_Cyrillic_i_macron: "Cyrillic_i_macron", XK_Cyrillic_O_bar: "Cyrillic_O_bar", XK_Cyrillic_o_bar: "Cyrillic_o_bar", XK_Cyrillic_U_macron: "Cyrillic_U_macron", XK_Cyrillic_u_macron: "Cyrillic_u_macron", XK_Serbian_dje: "Serbian_dje", XK_Macedonia_gje: "Macedonia_gje", XK_Cyrillic_io: "Cyrillic_io", XK_Ukrainian_ie: "Ukrainian_ie", // XK_Ukranian_je == XK_Ukrainian_ie # deprecated XK_Macedonia_dse: "Macedonia_dse", XK_Ukrainian_i: "Ukrainian_i", // XK_Ukranian_i == XK_Ukrainian_i # deprecated XK_Ukrainian_yi: "Ukrainian_yi", // XK_Ukranian_yi == XK_Ukrainian_yi # deprecated XK_Cyrillic_je: "Cyrillic_je", // XK_Serbian_je == XK_Cyrillic_je # deprecated XK_Cyrillic_lje: "Cyrillic_lje", // XK_Serbian_lje == XK_Cyrillic_lje # deprecated XK_Cyrillic_nje: "Cyrillic_nje", // XK_Serbian_nje == XK_Cyrillic_nje # deprecated XK_Serbian_tshe: "Serbian_tshe", XK_Macedonia_kje: "Macedonia_kje", XK_Ukrainian_ghe_with_upturn: "Ukrainian_ghe_with_upturn", XK_Byelorussian_shortu: "Byelorussian_shortu", XK_Cyrillic_dzhe: "Cyrillic_dzhe", // XK_Serbian_dze == XK_Cyrillic_dzhe # deprecated XK_numerosign: "numerosign", XK_Serbian_DJE: "Serbian_DJE", XK_Macedonia_GJE: "Macedonia_GJE", XK_Cyrillic_IO: "Cyrillic_IO", XK_Ukrainian_IE: "Ukrainian_IE", // XK_Ukranian_JE == XK_Ukrainian_IE # deprecated XK_Macedonia_DSE: "Macedonia_DSE", XK_Ukrainian_I: "Ukrainian_I", // XK_Ukranian_I == XK_Ukrainian_I # deprecated XK_Ukrainian_YI: "Ukrainian_YI", // XK_Ukranian_YI == XK_Ukrainian_YI # deprecated XK_Cyrillic_JE: "Cyrillic_JE", // XK_Serbian_JE == XK_Cyrillic_JE # deprecated XK_Cyrillic_LJE: "Cyrillic_LJE", // XK_Serbian_LJE == XK_Cyrillic_LJE # deprecated XK_Cyrillic_NJE: "Cyrillic_NJE", // XK_Serbian_NJE == XK_Cyrillic_NJE # deprecated XK_Serbian_TSHE: "Serbian_TSHE", XK_Macedonia_KJE: "Macedonia_KJE", XK_Ukrainian_GHE_WITH_UPTURN: "Ukrainian_GHE_WITH_UPTURN", XK_Byelorussian_SHORTU: "Byelorussian_SHORTU", XK_Cyrillic_DZHE: "Cyrillic_DZHE", // XK_Serbian_DZE == XK_Cyrillic_DZHE # deprecated XK_Cyrillic_yu: "Cyrillic_yu", XK_Cyrillic_a: "Cyrillic_a", XK_Cyrillic_be: "Cyrillic_be", XK_Cyrillic_tse: "Cyrillic_tse", XK_Cyrillic_de: "Cyrillic_de", XK_Cyrillic_ie: "Cyrillic_ie", XK_Cyrillic_ef: "Cyrillic_ef", XK_Cyrillic_ghe: "Cyrillic_ghe", XK_Cyrillic_ha: "Cyrillic_ha", XK_Cyrillic_i: "Cyrillic_i", XK_Cyrillic_shorti: "Cyrillic_shorti", XK_Cyrillic_ka: "Cyrillic_ka", XK_Cyrillic_el: "Cyrillic_el", XK_Cyrillic_em: "Cyrillic_em", XK_Cyrillic_en: "Cyrillic_en", XK_Cyrillic_o: "Cyrillic_o", XK_Cyrillic_pe: "Cyrillic_pe", XK_Cyrillic_ya: "Cyrillic_ya", XK_Cyrillic_er: "Cyrillic_er", XK_Cyrillic_es: "Cyrillic_es", XK_Cyrillic_te: "Cyrillic_te", XK_Cyrillic_u: "Cyrillic_u", XK_Cyrillic_zhe: "Cyrillic_zhe", XK_Cyrillic_ve: "Cyrillic_ve", XK_Cyrillic_softsign: "Cyrillic_softsign", XK_Cyrillic_yeru: "Cyrillic_yeru", XK_Cyrillic_ze: "Cyrillic_ze", XK_Cyrillic_sha: "Cyrillic_sha", XK_Cyrillic_e: "Cyrillic_e", XK_Cyrillic_shcha: "Cyrillic_shcha", XK_Cyrillic_che: "Cyrillic_che", XK_Cyrillic_hardsign: "Cyrillic_hardsign", XK_Cyrillic_YU: "Cyrillic_YU", XK_Cyrillic_A: "Cyrillic_A", XK_Cyrillic_BE: "Cyrillic_BE", XK_Cyrillic_TSE: "Cyrillic_TSE", XK_Cyrillic_DE: "Cyrillic_DE", XK_Cyrillic_IE: "Cyrillic_IE", XK_Cyrillic_EF: "Cyrillic_EF", XK_Cyrillic_GHE: "Cyrillic_GHE", XK_Cyrillic_HA: "Cyrillic_HA", XK_Cyrillic_I: "Cyrillic_I", XK_Cyrillic_SHORTI: "Cyrillic_SHORTI", XK_Cyrillic_KA: "Cyrillic_KA", XK_Cyrillic_EL: "Cyrillic_EL", XK_Cyrillic_EM: "Cyrillic_EM", XK_Cyrillic_EN: "Cyrillic_EN", XK_Cyrillic_O: "Cyrillic_O", XK_Cyrillic_PE: "Cyrillic_PE", XK_Cyrillic_YA: "Cyrillic_YA", XK_Cyrillic_ER: "Cyrillic_ER", XK_Cyrillic_ES: "Cyrillic_ES", XK_Cyrillic_TE: "Cyrillic_TE", XK_Cyrillic_U: "Cyrillic_U", XK_Cyrillic_ZHE: "Cyrillic_ZHE", XK_Cyrillic_VE: "Cyrillic_VE", XK_Cyrillic_SOFTSIGN: "Cyrillic_SOFTSIGN", XK_Cyrillic_YERU: "Cyrillic_YERU", XK_Cyrillic_ZE: "Cyrillic_ZE", XK_Cyrillic_SHA: "Cyrillic_SHA", XK_Cyrillic_E: "Cyrillic_E", XK_Cyrillic_SHCHA: "Cyrillic_SHCHA", XK_Cyrillic_CHE: "Cyrillic_CHE", XK_Cyrillic_HARDSIGN: "Cyrillic_HARDSIGN", XK_Greek_ALPHAaccent: "Greek_ALPHAaccent", XK_Greek_EPSILONaccent: "Greek_EPSILONaccent", XK_Greek_ETAaccent: "Greek_ETAaccent", XK_Greek_IOTAaccent: "Greek_IOTAaccent", XK_Greek_IOTAdieresis: "Greek_IOTAdieresis", // XK_Greek_IOTAdiaeresis == XK_Greek_IOTAdieresis # old typo XK_Greek_OMICRONaccent: "Greek_OMICRONaccent", XK_Greek_UPSILONaccent: "Greek_UPSILONaccent", XK_Greek_UPSILONdieresis: "Greek_UPSILONdieresis", XK_Greek_OMEGAaccent: "Greek_OMEGAaccent", XK_Greek_accentdieresis: "Greek_accentdieresis", XK_Greek_horizbar: "Greek_horizbar", XK_Greek_alphaaccent: "Greek_alphaaccent", XK_Greek_epsilonaccent: "Greek_epsilonaccent", XK_Greek_etaaccent: "Greek_etaaccent", XK_Greek_iotaaccent: "Greek_iotaaccent", XK_Greek_iotadieresis: "Greek_iotadieresis", XK_Greek_iotaaccentdieresis: "Greek_iotaaccentdieresis", XK_Greek_omicronaccent: "Greek_omicronaccent", XK_Greek_upsilonaccent: "Greek_upsilonaccent", XK_Greek_upsilondieresis: "Greek_upsilondieresis", XK_Greek_upsilonaccentdieresis: "Greek_upsilonaccentdieresis", XK_Greek_omegaaccent: "Greek_omegaaccent", XK_Greek_ALPHA: "Greek_ALPHA", XK_Greek_BETA: "Greek_BETA", XK_Greek_GAMMA: "Greek_GAMMA", XK_Greek_DELTA: "Greek_DELTA", XK_Greek_EPSILON: "Greek_EPSILON", XK_Greek_ZETA: "Greek_ZETA", XK_Greek_ETA: "Greek_ETA", XK_Greek_THETA: "Greek_THETA", XK_Greek_IOTA: "Greek_IOTA", XK_Greek_KAPPA: "Greek_KAPPA", XK_Greek_LAMDA: "Greek_LAMDA", // XK_Greek_LAMBDA == XK_Greek_LAMDA # U+039B GREEK CAPITAL LETTER LAMDA XK_Greek_MU: "Greek_MU", XK_Greek_NU: "Greek_NU", XK_Greek_XI: "Greek_XI", XK_Greek_OMICRON: "Greek_OMICRON", XK_Greek_PI: "Greek_PI", XK_Greek_RHO: "Greek_RHO", XK_Greek_SIGMA: "Greek_SIGMA", XK_Greek_TAU: "Greek_TAU", XK_Greek_UPSILON: "Greek_UPSILON", XK_Greek_PHI: "Greek_PHI", XK_Greek_CHI: "Greek_CHI", XK_Greek_PSI: "Greek_PSI", XK_Greek_OMEGA: "Greek_OMEGA", XK_Greek_alpha: "Greek_alpha", XK_Greek_beta: "Greek_beta", XK_Greek_gamma: "Greek_gamma", XK_Greek_delta: "Greek_delta", XK_Greek_epsilon: "Greek_epsilon", XK_Greek_zeta: "Greek_zeta", XK_Greek_eta: "Greek_eta", XK_Greek_theta: "Greek_theta", XK_Greek_iota: "Greek_iota", XK_Greek_kappa: "Greek_kappa", XK_Greek_lamda: "Greek_lamda", // XK_Greek_lambda == XK_Greek_lamda # U+03BB GREEK SMALL LETTER LAMDA XK_Greek_mu: "Greek_mu", XK_Greek_nu: "Greek_nu", XK_Greek_xi: "Greek_xi", XK_Greek_omicron: "Greek_omicron", XK_Greek_pi: "Greek_pi", XK_Greek_rho: "Greek_rho", XK_Greek_sigma: "Greek_sigma", XK_Greek_finalsmallsigma: "Greek_finalsmallsigma", XK_Greek_tau: "Greek_tau", XK_Greek_upsilon: "Greek_upsilon", XK_Greek_phi: "Greek_phi", XK_Greek_chi: "Greek_chi", XK_Greek_psi: "Greek_psi", XK_Greek_omega: "Greek_omega", // XK_Greek_switch == XK_Mode_switch # Alias for mode_switch XK_hebrew_doublelowline: "hebrew_doublelowline", XK_hebrew_aleph: "hebrew_aleph", XK_hebrew_bet: "hebrew_bet", // XK_hebrew_beth == XK_hebrew_bet # deprecated XK_hebrew_gimel: "hebrew_gimel", // XK_hebrew_gimmel == XK_hebrew_gimel # deprecated XK_hebrew_dalet: "hebrew_dalet", // XK_hebrew_daleth == XK_hebrew_dalet # deprecated XK_hebrew_he: "hebrew_he", XK_hebrew_waw: "hebrew_waw", XK_hebrew_zain: "hebrew_zain", // XK_hebrew_zayin == XK_hebrew_zain # deprecated XK_hebrew_chet: "hebrew_chet", // XK_hebrew_het == XK_hebrew_chet # deprecated XK_hebrew_tet: "hebrew_tet", // XK_hebrew_teth == XK_hebrew_tet # deprecated XK_hebrew_yod: "hebrew_yod", XK_hebrew_finalkaph: "hebrew_finalkaph", XK_hebrew_kaph: "hebrew_kaph", XK_hebrew_lamed: "hebrew_lamed", XK_hebrew_finalmem: "hebrew_finalmem", XK_hebrew_mem: "hebrew_mem", XK_hebrew_finalnun: "hebrew_finalnun", XK_hebrew_nun: "hebrew_nun", XK_hebrew_samech: "hebrew_samech", // XK_hebrew_samekh == XK_hebrew_samech # deprecated XK_hebrew_ayin: "hebrew_ayin", XK_hebrew_finalpe: "hebrew_finalpe", XK_hebrew_pe: "hebrew_pe", XK_hebrew_finalzade: "hebrew_finalzade", // XK_hebrew_finalzadi == XK_hebrew_finalzade # deprecated XK_hebrew_zade: "hebrew_zade", // XK_hebrew_zadi == XK_hebrew_zade # deprecated XK_hebrew_qoph: "hebrew_qoph", // XK_hebrew_kuf == XK_hebrew_qoph # deprecated XK_hebrew_resh: "hebrew_resh", XK_hebrew_shin: "hebrew_shin", XK_hebrew_taw: "hebrew_taw", // XK_hebrew_taf == XK_hebrew_taw # deprecated // XK_Hebrew_switch == XK_Mode_switch # Alias for mode_switch XK_Thai_kokai: "Thai_kokai", XK_Thai_khokhai: "Thai_khokhai", XK_Thai_khokhuat: "Thai_khokhuat", XK_Thai_khokhwai: "Thai_khokhwai", XK_Thai_khokhon: "Thai_khokhon", XK_Thai_khorakhang: "Thai_khorakhang", XK_Thai_ngongu: "Thai_ngongu", XK_Thai_chochan: "Thai_chochan", XK_Thai_choching: "Thai_choching", XK_Thai_chochang: "Thai_chochang", XK_Thai_soso: "Thai_soso", XK_Thai_chochoe: "Thai_chochoe", XK_Thai_yoying: "Thai_yoying", XK_Thai_dochada: "Thai_dochada", XK_Thai_topatak: "Thai_topatak", XK_Thai_thothan: "Thai_thothan", XK_Thai_thonangmontho: "Thai_thonangmontho", XK_Thai_thophuthao: "Thai_thophuthao", XK_Thai_nonen: "Thai_nonen", XK_Thai_dodek: "Thai_dodek", XK_Thai_totao: "Thai_totao", XK_Thai_thothung: "Thai_thothung", XK_Thai_thothahan: "Thai_thothahan", XK_Thai_thothong: "Thai_thothong", XK_Thai_nonu: "Thai_nonu", XK_Thai_bobaimai: "Thai_bobaimai", XK_Thai_popla: "Thai_popla", XK_Thai_phophung: "Thai_phophung", XK_Thai_fofa: "Thai_fofa", XK_Thai_phophan: "Thai_phophan", XK_Thai_fofan: "Thai_fofan", XK_Thai_phosamphao: "Thai_phosamphao", XK_Thai_moma: "Thai_moma", XK_Thai_yoyak: "Thai_yoyak", XK_Thai_rorua: "Thai_rorua", XK_Thai_ru: "Thai_ru", XK_Thai_loling: "Thai_loling", XK_Thai_lu: "Thai_lu", XK_Thai_wowaen: "Thai_wowaen", XK_Thai_sosala: "Thai_sosala", XK_Thai_sorusi: "Thai_sorusi", XK_Thai_sosua: "Thai_sosua", XK_Thai_hohip: "Thai_hohip", XK_Thai_lochula: "Thai_lochula", XK_Thai_oang: "Thai_oang", XK_Thai_honokhuk: "Thai_honokhuk", XK_Thai_paiyannoi: "Thai_paiyannoi", XK_Thai_saraa: "Thai_saraa", XK_Thai_maihanakat: "Thai_maihanakat", XK_Thai_saraaa: "Thai_saraaa", XK_Thai_saraam: "Thai_saraam", XK_Thai_sarai: "Thai_sarai", XK_Thai_saraii: "Thai_saraii", XK_Thai_saraue: "Thai_saraue", XK_Thai_sarauee: "Thai_sarauee", XK_Thai_sarau: "Thai_sarau", XK_Thai_sarauu: "Thai_sarauu", XK_Thai_phinthu: "Thai_phinthu", XK_Thai_maihanakat_maitho: "Thai_maihanakat_maitho", XK_Thai_baht: "Thai_baht", XK_Thai_sarae: "Thai_sarae", XK_Thai_saraae: "Thai_saraae", XK_Thai_sarao: "Thai_sarao", XK_Thai_saraaimaimuan: "Thai_saraaimaimuan", XK_Thai_saraaimaimalai: "Thai_saraaimaimalai", XK_Thai_lakkhangyao: "Thai_lakkhangyao", XK_Thai_maiyamok: "Thai_maiyamok", XK_Thai_maitaikhu: "Thai_maitaikhu", XK_Thai_maiek: "Thai_maiek", XK_Thai_maitho: "Thai_maitho", XK_Thai_maitri: "Thai_maitri", XK_Thai_maichattawa: "Thai_maichattawa", XK_Thai_thanthakhat: "Thai_thanthakhat", XK_Thai_nikhahit: "Thai_nikhahit", XK_Thai_leksun: "Thai_leksun", XK_Thai_leknung: "Thai_leknung", XK_Thai_leksong: "Thai_leksong", XK_Thai_leksam: "Thai_leksam", XK_Thai_leksi: "Thai_leksi", XK_Thai_lekha: "Thai_lekha", XK_Thai_lekhok: "Thai_lekhok", XK_Thai_lekchet: "Thai_lekchet", XK_Thai_lekpaet: "Thai_lekpaet", XK_Thai_lekkao: "Thai_lekkao", XK_Hangul: "Hangul", XK_Hangul_Start: "Hangul_Start", XK_Hangul_End: "Hangul_End", XK_Hangul_Hanja: "Hangul_Hanja", XK_Hangul_Jamo: "Hangul_Jamo", XK_Hangul_Romaja: "Hangul_Romaja", // XK_Hangul_Codeinput == XK_Codeinput # Hangul code input mode XK_Hangul_Jeonja: "Hangul_Jeonja", XK_Hangul_Banja: "Hangul_Banja", XK_Hangul_PreHanja: "Hangul_PreHanja", XK_Hangul_PostHanja: "Hangul_PostHanja", // XK_Hangul_SingleCandidate == XK_SingleCandidate # Single candidate // XK_Hangul_MultipleCandidate == XK_MultipleCandidate # Multiple candidate // XK_Hangul_PreviousCandidate == XK_PreviousCandidate # Previous candidate XK_Hangul_Special: "Hangul_Special", // XK_Hangul_switch == XK_Mode_switch # Alias for mode_switch XK_Hangul_Kiyeog: "Hangul_Kiyeog", XK_Hangul_SsangKiyeog: "Hangul_SsangKiyeog", XK_Hangul_KiyeogSios: "Hangul_KiyeogSios", XK_Hangul_Nieun: "Hangul_Nieun", XK_Hangul_NieunJieuj: "Hangul_NieunJieuj", XK_Hangul_NieunHieuh: "Hangul_NieunHieuh", XK_Hangul_Dikeud: "Hangul_Dikeud", XK_Hangul_SsangDikeud: "Hangul_SsangDikeud", XK_Hangul_Rieul: "Hangul_Rieul", XK_Hangul_RieulKiyeog: "Hangul_RieulKiyeog", XK_Hangul_RieulMieum: "Hangul_RieulMieum", XK_Hangul_RieulPieub: "Hangul_RieulPieub", XK_Hangul_RieulSios: "Hangul_RieulSios", XK_Hangul_RieulTieut: "Hangul_RieulTieut", XK_Hangul_RieulPhieuf: "Hangul_RieulPhieuf", XK_Hangul_RieulHieuh: "Hangul_RieulHieuh", XK_Hangul_Mieum: "Hangul_Mieum", XK_Hangul_Pieub: "Hangul_Pieub", XK_Hangul_SsangPieub: "Hangul_SsangPieub", XK_Hangul_PieubSios: "Hangul_PieubSios", XK_Hangul_Sios: "Hangul_Sios", XK_Hangul_SsangSios: "Hangul_SsangSios", XK_Hangul_Ieung: "Hangul_Ieung", XK_Hangul_Jieuj: "Hangul_Jieuj", XK_Hangul_SsangJieuj: "Hangul_SsangJieuj", XK_Hangul_Cieuc: "Hangul_Cieuc", XK_Hangul_Khieuq: "Hangul_Khieuq", XK_Hangul_Tieut: "Hangul_Tieut", XK_Hangul_Phieuf: "Hangul_Phieuf", XK_Hangul_Hieuh: "Hangul_Hieuh", XK_Hangul_A: "Hangul_A", XK_Hangul_AE: "Hangul_AE", XK_Hangul_YA: "Hangul_YA", XK_Hangul_YAE: "Hangul_YAE", XK_Hangul_EO: "Hangul_EO", XK_Hangul_E: "Hangul_E", XK_Hangul_YEO: "Hangul_YEO", XK_Hangul_YE: "Hangul_YE", XK_Hangul_O: "Hangul_O", XK_Hangul_WA: "Hangul_WA", XK_Hangul_WAE: "Hangul_WAE", XK_Hangul_OE: "Hangul_OE", XK_Hangul_YO: "Hangul_YO", XK_Hangul_U: "Hangul_U", XK_Hangul_WEO: "Hangul_WEO", XK_Hangul_WE: "Hangul_WE", XK_Hangul_WI: "Hangul_WI", XK_Hangul_YU: "Hangul_YU", XK_Hangul_EU: "Hangul_EU", XK_Hangul_YI: "Hangul_YI", XK_Hangul_I: "Hangul_I", XK_Hangul_J_Kiyeog: "Hangul_J_Kiyeog", XK_Hangul_J_SsangKiyeog: "Hangul_J_SsangKiyeog", XK_Hangul_J_KiyeogSios: "Hangul_J_KiyeogSios", XK_Hangul_J_Nieun: "Hangul_J_Nieun", XK_Hangul_J_NieunJieuj: "Hangul_J_NieunJieuj", XK_Hangul_J_NieunHieuh: "Hangul_J_NieunHieuh", XK_Hangul_J_Dikeud: "Hangul_J_Dikeud", XK_Hangul_J_Rieul: "Hangul_J_Rieul", XK_Hangul_J_RieulKiyeog: "Hangul_J_RieulKiyeog", XK_Hangul_J_RieulMieum: "Hangul_J_RieulMieum", XK_Hangul_J_RieulPieub: "Hangul_J_RieulPieub", XK_Hangul_J_RieulSios: "Hangul_J_RieulSios", XK_Hangul_J_RieulTieut: "Hangul_J_RieulTieut", XK_Hangul_J_RieulPhieuf: "Hangul_J_RieulPhieuf", XK_Hangul_J_RieulHieuh: "Hangul_J_RieulHieuh", XK_Hangul_J_Mieum: "Hangul_J_Mieum", XK_Hangul_J_Pieub: "Hangul_J_Pieub", XK_Hangul_J_PieubSios: "Hangul_J_PieubSios", XK_Hangul_J_Sios: "Hangul_J_Sios", XK_Hangul_J_SsangSios: "Hangul_J_SsangSios", XK_Hangul_J_Ieung: "Hangul_J_Ieung", XK_Hangul_J_Jieuj: "Hangul_J_Jieuj", XK_Hangul_J_Cieuc: "Hangul_J_Cieuc", XK_Hangul_J_Khieuq: "Hangul_J_Khieuq", XK_Hangul_J_Tieut: "Hangul_J_Tieut", XK_Hangul_J_Phieuf: "Hangul_J_Phieuf", XK_Hangul_J_Hieuh: "Hangul_J_Hieuh", XK_Hangul_RieulYeorinHieuh: "Hangul_RieulYeorinHieuh", XK_Hangul_SunkyeongeumMieum: "Hangul_SunkyeongeumMieum", XK_Hangul_SunkyeongeumPieub: "Hangul_SunkyeongeumPieub", XK_Hangul_PanSios: "Hangul_PanSios", XK_Hangul_KkogjiDalrinIeung: "Hangul_KkogjiDalrinIeung", XK_Hangul_SunkyeongeumPhieuf: "Hangul_SunkyeongeumPhieuf", XK_Hangul_YeorinHieuh: "Hangul_YeorinHieuh", XK_Hangul_AraeA: "Hangul_AraeA", XK_Hangul_AraeAE: "Hangul_AraeAE", XK_Hangul_J_PanSios: "Hangul_J_PanSios", XK_Hangul_J_KkogjiDalrinIeung: "Hangul_J_KkogjiDalrinIeung", XK_Hangul_J_YeorinHieuh: "Hangul_J_YeorinHieuh", XK_Korean_Won: "Korean_Won", XK_Armenian_ligature_ew: "Armenian_ligature_ew", XK_Armenian_full_stop: "Armenian_full_stop", // XK_Armenian_verjaket == XK_Armenian_full_stop # U+0589 ARMENIAN FULL STOP XK_Armenian_separation_mark: "Armenian_separation_mark", // XK_Armenian_but == XK_Armenian_separation_mark # U+055D ARMENIAN COMMA XK_Armenian_hyphen: "Armenian_hyphen", // XK_Armenian_yentamna == XK_Armenian_hyphen # U+058A ARMENIAN HYPHEN XK_Armenian_exclam: "Armenian_exclam", // XK_Armenian_amanak == XK_Armenian_exclam # U+055C ARMENIAN EXCLAMATION MARK XK_Armenian_accent: "Armenian_accent", // XK_Armenian_shesht == XK_Armenian_accent # U+055B ARMENIAN EMPHASIS MARK XK_Armenian_question: "Armenian_question", // XK_Armenian_paruyk == XK_Armenian_question # U+055E ARMENIAN QUESTION MARK XK_Armenian_AYB: "Armenian_AYB", XK_Armenian_ayb: "Armenian_ayb", XK_Armenian_BEN: "Armenian_BEN", XK_Armenian_ben: "Armenian_ben", XK_Armenian_GIM: "Armenian_GIM", XK_Armenian_gim: "Armenian_gim", XK_Armenian_DA: "Armenian_DA", XK_Armenian_da: "Armenian_da", XK_Armenian_YECH: "Armenian_YECH", XK_Armenian_yech: "Armenian_yech", XK_Armenian_ZA: "Armenian_ZA", XK_Armenian_za: "Armenian_za", XK_Armenian_E: "Armenian_E", XK_Armenian_e: "Armenian_e", XK_Armenian_AT: "Armenian_AT", XK_Armenian_at: "Armenian_at", XK_Armenian_TO: "Armenian_TO", XK_Armenian_to: "Armenian_to", XK_Armenian_ZHE: "Armenian_ZHE", XK_Armenian_zhe: "Armenian_zhe", XK_Armenian_INI: "Armenian_INI", XK_Armenian_ini: "Armenian_ini", XK_Armenian_LYUN: "Armenian_LYUN", XK_Armenian_lyun: "Armenian_lyun", XK_Armenian_KHE: "Armenian_KHE", XK_Armenian_khe: "Armenian_khe", XK_Armenian_TSA: "Armenian_TSA", XK_Armenian_tsa: "Armenian_tsa", XK_Armenian_KEN: "Armenian_KEN", XK_Armenian_ken: "Armenian_ken", XK_Armenian_HO: "Armenian_HO", XK_Armenian_ho: "Armenian_ho", XK_Armenian_DZA: "Armenian_DZA", XK_Armenian_dza: "Armenian_dza", XK_Armenian_GHAT: "Armenian_GHAT", XK_Armenian_ghat: "Armenian_ghat", XK_Armenian_TCHE: "Armenian_TCHE", XK_Armenian_tche: "Armenian_tche", XK_Armenian_MEN: "Armenian_MEN", XK_Armenian_men: "Armenian_men", XK_Armenian_HI: "Armenian_HI", XK_Armenian_hi: "Armenian_hi", XK_Armenian_NU: "Armenian_NU", XK_Armenian_nu: "Armenian_nu", XK_Armenian_SHA: "Armenian_SHA", XK_Armenian_sha: "Armenian_sha", XK_Armenian_VO: "Armenian_VO", XK_Armenian_vo: "Armenian_vo", XK_Armenian_CHA: "Armenian_CHA", XK_Armenian_cha: "Armenian_cha", XK_Armenian_PE: "Armenian_PE", XK_Armenian_pe: "Armenian_pe", XK_Armenian_JE: "Armenian_JE", XK_Armenian_je: "Armenian_je", XK_Armenian_RA: "Armenian_RA", XK_Armenian_ra: "Armenian_ra", XK_Armenian_SE: "Armenian_SE", XK_Armenian_se: "Armenian_se", XK_Armenian_VEV: "Armenian_VEV", XK_Armenian_vev: "Armenian_vev", XK_Armenian_TYUN: "Armenian_TYUN", XK_Armenian_tyun: "Armenian_tyun", XK_Armenian_RE: "Armenian_RE", XK_Armenian_re: "Armenian_re", XK_Armenian_TSO: "Armenian_TSO", XK_Armenian_tso: "Armenian_tso", XK_Armenian_VYUN: "Armenian_VYUN", XK_Armenian_vyun: "Armenian_vyun", XK_Armenian_PYUR: "Armenian_PYUR", XK_Armenian_pyur: "Armenian_pyur", XK_Armenian_KE: "Armenian_KE", XK_Armenian_ke: "Armenian_ke", XK_Armenian_O: "Armenian_O", XK_Armenian_o: "Armenian_o", XK_Armenian_FE: "Armenian_FE", XK_Armenian_fe: "Armenian_fe", XK_Armenian_apostrophe: "Armenian_apostrophe", XK_Georgian_an: "Georgian_an", XK_Georgian_ban: "Georgian_ban", XK_Georgian_gan: "Georgian_gan", XK_Georgian_don: "Georgian_don", XK_Georgian_en: "Georgian_en", XK_Georgian_vin: "Georgian_vin", XK_Georgian_zen: "Georgian_zen", XK_Georgian_tan: "Georgian_tan", XK_Georgian_in: "Georgian_in", XK_Georgian_kan: "Georgian_kan", XK_Georgian_las: "Georgian_las", XK_Georgian_man: "Georgian_man", XK_Georgian_nar: "Georgian_nar", XK_Georgian_on: "Georgian_on", XK_Georgian_par: "Georgian_par", XK_Georgian_zhar: "Georgian_zhar", XK_Georgian_rae: "Georgian_rae", XK_Georgian_san: "Georgian_san", XK_Georgian_tar: "Georgian_tar", XK_Georgian_un: "Georgian_un", XK_Georgian_phar: "Georgian_phar", XK_Georgian_khar: "Georgian_khar", XK_Georgian_ghan: "Georgian_ghan", XK_Georgian_qar: "Georgian_qar", XK_Georgian_shin: "Georgian_shin", XK_Georgian_chin: "Georgian_chin", XK_Georgian_can: "Georgian_can", XK_Georgian_jil: "Georgian_jil", XK_Georgian_cil: "Georgian_cil", XK_Georgian_char: "Georgian_char", XK_Georgian_xan: "Georgian_xan", XK_Georgian_jhan: "Georgian_jhan", XK_Georgian_hae: "Georgian_hae", XK_Georgian_he: "Georgian_he", XK_Georgian_hie: "Georgian_hie", XK_Georgian_we: "Georgian_we", XK_Georgian_har: "Georgian_har", XK_Georgian_hoe: "Georgian_hoe", XK_Georgian_fi: "Georgian_fi", XK_Xabovedot: "Xabovedot", XK_Ibreve: "Ibreve", XK_Zstroke: "Zstroke", XK_Gcaron: "Gcaron", XK_Ocaron: "Ocaron", XK_Obarred: "Obarred", XK_xabovedot: "xabovedot", XK_ibreve: "ibreve", XK_zstroke: "zstroke", XK_gcaron: "gcaron", XK_ocaron: "ocaron", XK_obarred: "obarred", XK_SCHWA: "SCHWA", XK_schwa: "schwa", XK_EZH: "EZH", XK_ezh: "ezh", XK_Lbelowdot: "Lbelowdot", XK_lbelowdot: "lbelowdot", XK_Abelowdot: "Abelowdot", XK_abelowdot: "abelowdot", XK_Ahook: "Ahook", XK_ahook: "ahook", XK_Acircumflexacute: "Acircumflexacute", XK_acircumflexacute: "acircumflexacute", XK_Acircumflexgrave: "Acircumflexgrave", XK_acircumflexgrave: "acircumflexgrave", XK_Acircumflexhook: "Acircumflexhook", XK_acircumflexhook: "acircumflexhook", XK_Acircumflextilde: "Acircumflextilde", XK_acircumflextilde: "acircumflextilde", XK_Acircumflexbelowdot: "Acircumflexbelowdot", XK_acircumflexbelowdot: "acircumflexbelowdot", XK_Abreveacute: "Abreveacute", XK_abreveacute: "abreveacute", XK_Abrevegrave: "Abrevegrave", XK_abrevegrave: "abrevegrave", XK_Abrevehook: "Abrevehook", XK_abrevehook: "abrevehook", XK_Abrevetilde: "Abrevetilde", XK_abrevetilde: "abrevetilde", XK_Abrevebelowdot: "Abrevebelowdot", XK_abrevebelowdot: "abrevebelowdot", XK_Ebelowdot: "Ebelowdot", XK_ebelowdot: "ebelowdot", XK_Ehook: "Ehook", XK_ehook: "ehook", XK_Etilde: "Etilde", XK_etilde: "etilde", XK_Ecircumflexacute: "Ecircumflexacute", XK_ecircumflexacute: "ecircumflexacute", XK_Ecircumflexgrave: "Ecircumflexgrave", XK_ecircumflexgrave: "ecircumflexgrave", XK_Ecircumflexhook: "Ecircumflexhook", XK_ecircumflexhook: "ecircumflexhook", XK_Ecircumflextilde: "Ecircumflextilde", XK_ecircumflextilde: "ecircumflextilde", XK_Ecircumflexbelowdot: "Ecircumflexbelowdot", XK_ecircumflexbelowdot: "ecircumflexbelowdot", XK_Ihook: "Ihook", XK_ihook: "ihook", XK_Ibelowdot: "Ibelowdot", XK_ibelowdot: "ibelowdot", XK_Obelowdot: "Obelowdot", XK_obelowdot: "obelowdot", XK_Ohook: "Ohook", XK_ohook: "ohook", XK_Ocircumflexacute: "Ocircumflexacute", XK_ocircumflexacute: "ocircumflexacute", XK_Ocircumflexgrave: "Ocircumflexgrave", XK_ocircumflexgrave: "ocircumflexgrave", XK_Ocircumflexhook: "Ocircumflexhook", XK_ocircumflexhook: "ocircumflexhook", XK_Ocircumflextilde: "Ocircumflextilde", XK_ocircumflextilde: "ocircumflextilde", XK_Ocircumflexbelowdot: "Ocircumflexbelowdot", XK_ocircumflexbelowdot: "ocircumflexbelowdot", XK_Ohornacute: "Ohornacute", XK_ohornacute: "ohornacute", XK_Ohorngrave: "Ohorngrave", XK_ohorngrave: "ohorngrave", XK_Ohornhook: "Ohornhook", XK_ohornhook: "ohornhook", XK_Ohorntilde: "Ohorntilde", XK_ohorntilde: "ohorntilde", XK_Ohornbelowdot: "Ohornbelowdot", XK_ohornbelowdot: "ohornbelowdot", XK_Ubelowdot: "Ubelowdot", XK_ubelowdot: "ubelowdot", XK_Uhook: "Uhook", XK_uhook: "uhook", XK_Uhornacute: "Uhornacute", XK_uhornacute: "uhornacute", XK_Uhorngrave: "Uhorngrave", XK_uhorngrave: "uhorngrave", XK_Uhornhook: "Uhornhook", XK_uhornhook: "uhornhook", XK_Uhorntilde: "Uhorntilde", XK_uhorntilde: "uhorntilde", XK_Uhornbelowdot: "Uhornbelowdot", XK_uhornbelowdot: "uhornbelowdot", XK_Ybelowdot: "Ybelowdot", XK_ybelowdot: "ybelowdot", XK_Yhook: "Yhook", XK_yhook: "yhook", XK_Ytilde: "Ytilde", XK_ytilde: "ytilde", XK_Ohorn: "Ohorn", XK_ohorn: "ohorn", XK_Uhorn: "Uhorn", XK_uhorn: "uhorn", XK_EcuSign: "EcuSign", XK_ColonSign: "ColonSign", XK_CruzeiroSign: "CruzeiroSign", XK_FFrancSign: "FFrancSign", XK_LiraSign: "LiraSign", XK_MillSign: "MillSign", XK_NairaSign: "NairaSign", XK_PesetaSign: "PesetaSign", XK_RupeeSign: "RupeeSign", XK_WonSign: "WonSign", XK_NewSheqelSign: "NewSheqelSign", XK_DongSign: "DongSign", XK_EuroSign: "EuroSign", XK_zerosuperior: "zerosuperior", XK_foursuperior: "foursuperior", XK_fivesuperior: "fivesuperior", XK_sixsuperior: "sixsuperior", XK_sevensuperior: "sevensuperior", XK_eightsuperior: "eightsuperior", XK_ninesuperior: "ninesuperior", XK_zerosubscript: "zerosubscript", XK_onesubscript: "onesubscript", XK_twosubscript: "twosubscript", XK_threesubscript: "threesubscript", XK_foursubscript: "foursubscript", XK_fivesubscript: "fivesubscript", XK_sixsubscript: "sixsubscript", XK_sevensubscript: "sevensubscript", XK_eightsubscript: "eightsubscript", XK_ninesubscript: "ninesubscript", XK_partdifferential: "partdifferential", XK_emptyset: "emptyset", XK_elementof: "elementof", XK_notelementof: "notelementof", XK_containsas: "containsas", XK_squareroot: "squareroot", // XK_cuberoot == XK_squareroot # // XK_fourthroot == XK_squareroot # XK_dintegral: "dintegral", // XK_tintegral == XK_dintegral # XK_because: "because", XK_approxeq: "approxeq", XK_notapproxeq: "notapproxeq", XK_notidentical: "notidentical", XK_stricteq: "stricteq", XK_braille_dot_1: "braille_dot_1", XK_braille_dot_2: "braille_dot_2", XK_braille_dot_3: "braille_dot_3", XK_braille_dot_4: "braille_dot_4", XK_braille_dot_5: "braille_dot_5", XK_braille_dot_6: "braille_dot_6", XK_braille_dot_7: "braille_dot_7", XK_braille_dot_8: "braille_dot_8", XK_braille_dot_9: "braille_dot_9", XK_braille_dot_10: "braille_dot_10", XK_braille_blank: "braille_blank", XK_braille_dots_1: "braille_dots_1", XK_braille_dots_2: "braille_dots_2", XK_braille_dots_12: "braille_dots_12", XK_braille_dots_3: "braille_dots_3", XK_braille_dots_13: "braille_dots_13", XK_braille_dots_23: "braille_dots_23", XK_braille_dots_123: "braille_dots_123", XK_braille_dots_4: "braille_dots_4", XK_braille_dots_14: "braille_dots_14", XK_braille_dots_24: "braille_dots_24", XK_braille_dots_124: "braille_dots_124", XK_braille_dots_34: "braille_dots_34", XK_braille_dots_134: "braille_dots_134", XK_braille_dots_234: "braille_dots_234", XK_braille_dots_1234: "braille_dots_1234", XK_braille_dots_5: "braille_dots_5", XK_braille_dots_15: "braille_dots_15", XK_braille_dots_25: "braille_dots_25", XK_braille_dots_125: "braille_dots_125", XK_braille_dots_35: "braille_dots_35", XK_braille_dots_135: "braille_dots_135", XK_braille_dots_235: "braille_dots_235", XK_braille_dots_1235: "braille_dots_1235", XK_braille_dots_45: "braille_dots_45", XK_braille_dots_145: "braille_dots_145", XK_braille_dots_245: "braille_dots_245", XK_braille_dots_1245: "braille_dots_1245", XK_braille_dots_345: "braille_dots_345", XK_braille_dots_1345: "braille_dots_1345", XK_braille_dots_2345: "braille_dots_2345", XK_braille_dots_12345: "braille_dots_12345", XK_braille_dots_6: "braille_dots_6", XK_braille_dots_16: "braille_dots_16", XK_braille_dots_26: "braille_dots_26", XK_braille_dots_126: "braille_dots_126", XK_braille_dots_36: "braille_dots_36", XK_braille_dots_136: "braille_dots_136", XK_braille_dots_236: "braille_dots_236", XK_braille_dots_1236: "braille_dots_1236", XK_braille_dots_46: "braille_dots_46", XK_braille_dots_146: "braille_dots_146", XK_braille_dots_246: "braille_dots_246", XK_braille_dots_1246: "braille_dots_1246", XK_braille_dots_346: "braille_dots_346", XK_braille_dots_1346: "braille_dots_1346", XK_braille_dots_2346: "braille_dots_2346", XK_braille_dots_12346: "braille_dots_12346", XK_braille_dots_56: "braille_dots_56", XK_braille_dots_156: "braille_dots_156", XK_braille_dots_256: "braille_dots_256", XK_braille_dots_1256: "braille_dots_1256", XK_braille_dots_356: "braille_dots_356", XK_braille_dots_1356: "braille_dots_1356", XK_braille_dots_2356: "braille_dots_2356", XK_braille_dots_12356: "braille_dots_12356", XK_braille_dots_456: "braille_dots_456", XK_braille_dots_1456: "braille_dots_1456", XK_braille_dots_2456: "braille_dots_2456", XK_braille_dots_12456: "braille_dots_12456", XK_braille_dots_3456: "braille_dots_3456", XK_braille_dots_13456: "braille_dots_13456", XK_braille_dots_23456: "braille_dots_23456", XK_braille_dots_123456: "braille_dots_123456", XK_braille_dots_7: "braille_dots_7", XK_braille_dots_17: "braille_dots_17", XK_braille_dots_27: "braille_dots_27", XK_braille_dots_127: "braille_dots_127", XK_braille_dots_37: "braille_dots_37", XK_braille_dots_137: "braille_dots_137", XK_braille_dots_237: "braille_dots_237", XK_braille_dots_1237: "braille_dots_1237", XK_braille_dots_47: "braille_dots_47", XK_braille_dots_147: "braille_dots_147", XK_braille_dots_247: "braille_dots_247", XK_braille_dots_1247: "braille_dots_1247", XK_braille_dots_347: "braille_dots_347", XK_braille_dots_1347: "braille_dots_1347", XK_braille_dots_2347: "braille_dots_2347", XK_braille_dots_12347: "braille_dots_12347", XK_braille_dots_57: "braille_dots_57", XK_braille_dots_157: "braille_dots_157", XK_braille_dots_257: "braille_dots_257", XK_braille_dots_1257: "braille_dots_1257", XK_braille_dots_357: "braille_dots_357", XK_braille_dots_1357: "braille_dots_1357", XK_braille_dots_2357: "braille_dots_2357", XK_braille_dots_12357: "braille_dots_12357", XK_braille_dots_457: "braille_dots_457", XK_braille_dots_1457: "braille_dots_1457", XK_braille_dots_2457: "braille_dots_2457", XK_braille_dots_12457: "braille_dots_12457", XK_braille_dots_3457: "braille_dots_3457", XK_braille_dots_13457: "braille_dots_13457", XK_braille_dots_23457: "braille_dots_23457", XK_braille_dots_123457: "braille_dots_123457", XK_braille_dots_67: "braille_dots_67", XK_braille_dots_167: "braille_dots_167", XK_braille_dots_267: "braille_dots_267", XK_braille_dots_1267: "braille_dots_1267", XK_braille_dots_367: "braille_dots_367", XK_braille_dots_1367: "braille_dots_1367", XK_braille_dots_2367: "braille_dots_2367", XK_braille_dots_12367: "braille_dots_12367", XK_braille_dots_467: "braille_dots_467", XK_braille_dots_1467: "braille_dots_1467", XK_braille_dots_2467: "braille_dots_2467", XK_braille_dots_12467: "braille_dots_12467", XK_braille_dots_3467: "braille_dots_3467", XK_braille_dots_13467: "braille_dots_13467", XK_braille_dots_23467: "braille_dots_23467", XK_braille_dots_123467: "braille_dots_123467", XK_braille_dots_567: "braille_dots_567", XK_braille_dots_1567: "braille_dots_1567", XK_braille_dots_2567: "braille_dots_2567", XK_braille_dots_12567: "braille_dots_12567", XK_braille_dots_3567: "braille_dots_3567", XK_braille_dots_13567: "braille_dots_13567", XK_braille_dots_23567: "braille_dots_23567", XK_braille_dots_123567: "braille_dots_123567", XK_braille_dots_4567: "braille_dots_4567", XK_braille_dots_14567: "braille_dots_14567", XK_braille_dots_24567: "braille_dots_24567", XK_braille_dots_124567: "braille_dots_124567", XK_braille_dots_34567: "braille_dots_34567", XK_braille_dots_134567: "braille_dots_134567", XK_braille_dots_234567: "braille_dots_234567", XK_braille_dots_1234567: "braille_dots_1234567", XK_braille_dots_8: "braille_dots_8", XK_braille_dots_18: "braille_dots_18", XK_braille_dots_28: "braille_dots_28", XK_braille_dots_128: "braille_dots_128", XK_braille_dots_38: "braille_dots_38", XK_braille_dots_138: "braille_dots_138", XK_braille_dots_238: "braille_dots_238", XK_braille_dots_1238: "braille_dots_1238", XK_braille_dots_48: "braille_dots_48", XK_braille_dots_148: "braille_dots_148", XK_braille_dots_248: "braille_dots_248", XK_braille_dots_1248: "braille_dots_1248", XK_braille_dots_348: "braille_dots_348", XK_braille_dots_1348: "braille_dots_1348", XK_braille_dots_2348: "braille_dots_2348", XK_braille_dots_12348: "braille_dots_12348", XK_braille_dots_58: "braille_dots_58", XK_braille_dots_158: "braille_dots_158", XK_braille_dots_258: "braille_dots_258", XK_braille_dots_1258: "braille_dots_1258", XK_braille_dots_358: "braille_dots_358", XK_braille_dots_1358: "braille_dots_1358", XK_braille_dots_2358: "braille_dots_2358", XK_braille_dots_12358: "braille_dots_12358", XK_braille_dots_458: "braille_dots_458", XK_braille_dots_1458: "braille_dots_1458", XK_braille_dots_2458: "braille_dots_2458", XK_braille_dots_12458: "braille_dots_12458", XK_braille_dots_3458: "braille_dots_3458", XK_braille_dots_13458: "braille_dots_13458", XK_braille_dots_23458: "braille_dots_23458", XK_braille_dots_123458: "braille_dots_123458", XK_braille_dots_68: "braille_dots_68", XK_braille_dots_168: "braille_dots_168", XK_braille_dots_268: "braille_dots_268", XK_braille_dots_1268: "braille_dots_1268", XK_braille_dots_368: "braille_dots_368", XK_braille_dots_1368: "braille_dots_1368", XK_braille_dots_2368: "braille_dots_2368", XK_braille_dots_12368: "braille_dots_12368", XK_braille_dots_468: "braille_dots_468", XK_braille_dots_1468: "braille_dots_1468", XK_braille_dots_2468: "braille_dots_2468", XK_braille_dots_12468: "braille_dots_12468", XK_braille_dots_3468: "braille_dots_3468", XK_braille_dots_13468: "braille_dots_13468", XK_braille_dots_23468: "braille_dots_23468", XK_braille_dots_123468: "braille_dots_123468", XK_braille_dots_568: "braille_dots_568", XK_braille_dots_1568: "braille_dots_1568", XK_braille_dots_2568: "braille_dots_2568", XK_braille_dots_12568: "braille_dots_12568", XK_braille_dots_3568: "braille_dots_3568", XK_braille_dots_13568: "braille_dots_13568", XK_braille_dots_23568: "braille_dots_23568", XK_braille_dots_123568: "braille_dots_123568", XK_braille_dots_4568: "braille_dots_4568", XK_braille_dots_14568: "braille_dots_14568", XK_braille_dots_24568: "braille_dots_24568", XK_braille_dots_124568: "braille_dots_124568", XK_braille_dots_34568: "braille_dots_34568", XK_braille_dots_134568: "braille_dots_134568", XK_braille_dots_234568: "braille_dots_234568", XK_braille_dots_1234568: "braille_dots_1234568", XK_braille_dots_78: "braille_dots_78", XK_braille_dots_178: "braille_dots_178", XK_braille_dots_278: "braille_dots_278", XK_braille_dots_1278: "braille_dots_1278", XK_braille_dots_378: "braille_dots_378", XK_braille_dots_1378: "braille_dots_1378", XK_braille_dots_2378: "braille_dots_2378", XK_braille_dots_12378: "braille_dots_12378", XK_braille_dots_478: "braille_dots_478", XK_braille_dots_1478: "braille_dots_1478", XK_braille_dots_2478: "braille_dots_2478", XK_braille_dots_12478: "braille_dots_12478", XK_braille_dots_3478: "braille_dots_3478", XK_braille_dots_13478: "braille_dots_13478", XK_braille_dots_23478: "braille_dots_23478", XK_braille_dots_123478: "braille_dots_123478", XK_braille_dots_578: "braille_dots_578", XK_braille_dots_1578: "braille_dots_1578", XK_braille_dots_2578: "braille_dots_2578", XK_braille_dots_12578: "braille_dots_12578", XK_braille_dots_3578: "braille_dots_3578", XK_braille_dots_13578: "braille_dots_13578", XK_braille_dots_23578: "braille_dots_23578", XK_braille_dots_123578: "braille_dots_123578", XK_braille_dots_4578: "braille_dots_4578", XK_braille_dots_14578: "braille_dots_14578", XK_braille_dots_24578: "braille_dots_24578", XK_braille_dots_124578: "braille_dots_124578", XK_braille_dots_34578: "braille_dots_34578", XK_braille_dots_134578: "braille_dots_134578", XK_braille_dots_234578: "braille_dots_234578", XK_braille_dots_1234578: "braille_dots_1234578", XK_braille_dots_678: "braille_dots_678", XK_braille_dots_1678: "braille_dots_1678", XK_braille_dots_2678: "braille_dots_2678", XK_braille_dots_12678: "braille_dots_12678", XK_braille_dots_3678: "braille_dots_3678", XK_braille_dots_13678: "braille_dots_13678", XK_braille_dots_23678: "braille_dots_23678", XK_braille_dots_123678: "braille_dots_123678", XK_braille_dots_4678: "braille_dots_4678", XK_braille_dots_14678: "braille_dots_14678", XK_braille_dots_24678: "braille_dots_24678", XK_braille_dots_124678: "braille_dots_124678", XK_braille_dots_34678: "braille_dots_34678", XK_braille_dots_134678: "braille_dots_134678", XK_braille_dots_234678: "braille_dots_234678", XK_braille_dots_1234678: "braille_dots_1234678", XK_braille_dots_5678: "braille_dots_5678", XK_braille_dots_15678: "braille_dots_15678", XK_braille_dots_25678: "braille_dots_25678", XK_braille_dots_125678: "braille_dots_125678", XK_braille_dots_35678: "braille_dots_35678", XK_braille_dots_135678: "braille_dots_135678", XK_braille_dots_235678: "braille_dots_235678", XK_braille_dots_1235678: "braille_dots_1235678", XK_braille_dots_45678: "braille_dots_45678", XK_braille_dots_145678: "braille_dots_145678", XK_braille_dots_245678: "braille_dots_245678", XK_braille_dots_1245678: "braille_dots_1245678", XK_braille_dots_345678: "braille_dots_345678", XK_braille_dots_1345678: "braille_dots_1345678", XK_braille_dots_2345678: "braille_dots_2345678", XK_braille_dots_12345678: "braille_dots_12345678", XK_Sinh_ng: "Sinh_ng", XK_Sinh_h2: "Sinh_h2", XK_Sinh_a: "Sinh_a", XK_Sinh_aa: "Sinh_aa", XK_Sinh_ae: "Sinh_ae", XK_Sinh_aee: "Sinh_aee", XK_Sinh_i: "Sinh_i", XK_Sinh_ii: "Sinh_ii", XK_Sinh_u: "Sinh_u", XK_Sinh_uu: "Sinh_uu", XK_Sinh_ri: "Sinh_ri", XK_Sinh_rii: "Sinh_rii", XK_Sinh_lu: "Sinh_lu", XK_Sinh_luu: "Sinh_luu", XK_Sinh_e: "Sinh_e", XK_Sinh_ee: "Sinh_ee", XK_Sinh_ai: "Sinh_ai", XK_Sinh_o: "Sinh_o", XK_Sinh_oo: "Sinh_oo", XK_Sinh_au: "Sinh_au", XK_Sinh_ka: "Sinh_ka", XK_Sinh_kha: "Sinh_kha", XK_Sinh_ga: "Sinh_ga", XK_Sinh_gha: "Sinh_gha", XK_Sinh_ng2: "Sinh_ng2", XK_Sinh_nga: "Sinh_nga", XK_Sinh_ca: "Sinh_ca", XK_Sinh_cha: "Sinh_cha", XK_Sinh_ja: "Sinh_ja", XK_Sinh_jha: "Sinh_jha", XK_Sinh_nya: "Sinh_nya", XK_Sinh_jnya: "Sinh_jnya", XK_Sinh_nja: "Sinh_nja", XK_Sinh_tta: "Sinh_tta", XK_Sinh_ttha: "Sinh_ttha", XK_Sinh_dda: "Sinh_dda", XK_Sinh_ddha: "Sinh_ddha", XK_Sinh_nna: "Sinh_nna", XK_Sinh_ndda: "Sinh_ndda", XK_Sinh_tha: "Sinh_tha", XK_Sinh_thha: "Sinh_thha", XK_Sinh_dha: "Sinh_dha", XK_Sinh_dhha: "Sinh_dhha", XK_Sinh_na: "Sinh_na", XK_Sinh_ndha: "Sinh_ndha", XK_Sinh_pa: "Sinh_pa", XK_Sinh_pha: "Sinh_pha", XK_Sinh_ba: "Sinh_ba", XK_Sinh_bha: "Sinh_bha", XK_Sinh_ma: "Sinh_ma", XK_Sinh_mba: "Sinh_mba", XK_Sinh_ya: "Sinh_ya", XK_Sinh_ra: "Sinh_ra", XK_Sinh_la: "Sinh_la", XK_Sinh_va: "Sinh_va", XK_Sinh_sha: "Sinh_sha", XK_Sinh_ssha: "Sinh_ssha", XK_Sinh_sa: "Sinh_sa", XK_Sinh_ha: "Sinh_ha", XK_Sinh_lla: "Sinh_lla", XK_Sinh_fa: "Sinh_fa", XK_Sinh_al: "Sinh_al", XK_Sinh_aa2: "Sinh_aa2", XK_Sinh_ae2: "Sinh_ae2", XK_Sinh_aee2: "Sinh_aee2", XK_Sinh_i2: "Sinh_i2", XK_Sinh_ii2: "Sinh_ii2", XK_Sinh_u2: "Sinh_u2", XK_Sinh_uu2: "Sinh_uu2", XK_Sinh_ru2: "Sinh_ru2", XK_Sinh_e2: "Sinh_e2", XK_Sinh_ee2: "Sinh_ee2", XK_Sinh_ai2: "Sinh_ai2", XK_Sinh_o2: "Sinh_o2", XK_Sinh_oo2: "Sinh_oo2", XK_Sinh_au2: "Sinh_au2", XK_Sinh_lu2: "Sinh_lu2", XK_Sinh_ruu2: "Sinh_ruu2", XK_Sinh_luu2: "Sinh_luu2", XK_Sinh_kunddaliya: "Sinh_kunddaliya", XF86XK_ModeLock: "XF86ModeLock", XF86XK_MonBrightnessUp: "XF86MonBrightnessUp", XF86XK_MonBrightnessDown: "XF86MonBrightnessDown", XF86XK_KbdLightOnOff: "XF86KbdLightOnOff", XF86XK_KbdBrightnessUp: "XF86KbdBrightnessUp", XF86XK_KbdBrightnessDown: "XF86KbdBrightnessDown", XF86XK_Standby: "XF86Standby", XF86XK_AudioLowerVolume: "XF86AudioLowerVolume", XF86XK_AudioMute: "XF86AudioMute", XF86XK_AudioRaiseVolume: "XF86AudioRaiseVolume", XF86XK_AudioPlay: "XF86AudioPlay", XF86XK_AudioStop: "XF86AudioStop", XF86XK_AudioPrev: "XF86AudioPrev", XF86XK_AudioNext: "XF86AudioNext", XF86XK_HomePage: "XF86HomePage", XF86XK_Mail: "XF86Mail", XF86XK_Start: "XF86Start", XF86XK_Search: "XF86Search", XF86XK_AudioRecord: "XF86AudioRecord", XF86XK_Calculator: "XF86Calculator", XF86XK_Memo: "XF86Memo", XF86XK_ToDoList: "XF86ToDoList", XF86XK_Calendar: "XF86Calendar", XF86XK_PowerDown: "XF86PowerDown", XF86XK_ContrastAdjust: "XF86ContrastAdjust", XF86XK_RockerUp: "XF86RockerUp", XF86XK_RockerDown: "XF86RockerDown", XF86XK_RockerEnter: "XF86RockerEnter", XF86XK_Back: "XF86Back", XF86XK_Forward: "XF86Forward", XF86XK_Stop: "XF86Stop", XF86XK_Refresh: "XF86Refresh", XF86XK_PowerOff: "XF86PowerOff", XF86XK_WakeUp: "XF86WakeUp", XF86XK_Eject: "XF86Eject", XF86XK_ScreenSaver: "XF86ScreenSaver", XF86XK_WWW: "XF86WWW", XF86XK_Sleep: "XF86Sleep", XF86XK_Favorites: "XF86Favorites", XF86XK_AudioPause: "XF86AudioPause", XF86XK_AudioMedia: "XF86AudioMedia", XF86XK_MyComputer: "XF86MyComputer", XF86XK_VendorHome: "XF86VendorHome", XF86XK_LightBulb: "XF86LightBulb", XF86XK_Shop: "XF86Shop", XF86XK_History: "XF86History", XF86XK_OpenURL: "XF86OpenURL", XF86XK_AddFavorite: "XF86AddFavorite", XF86XK_HotLinks: "XF86HotLinks", XF86XK_BrightnessAdjust: "XF86BrightnessAdjust", XF86XK_Finance: "XF86Finance", XF86XK_Community: "XF86Community", XF86XK_AudioRewind: "XF86AudioRewind", XF86XK_BackForward: "XF86BackForward", XF86XK_Launch0: "XF86Launch0", XF86XK_Launch1: "XF86Launch1", XF86XK_Launch2: "XF86Launch2", XF86XK_Launch3: "XF86Launch3", XF86XK_Launch4: "XF86Launch4", XF86XK_Launch5: "XF86Launch5", XF86XK_Launch6: "XF86Launch6", XF86XK_Launch7: "XF86Launch7", XF86XK_Launch8: "XF86Launch8", XF86XK_Launch9: "XF86Launch9", XF86XK_LaunchA: "XF86LaunchA", XF86XK_LaunchB: "XF86LaunchB", XF86XK_LaunchC: "XF86LaunchC", XF86XK_LaunchD: "XF86LaunchD", XF86XK_LaunchE: "XF86LaunchE", XF86XK_LaunchF: "XF86LaunchF", XF86XK_ApplicationLeft: "XF86ApplicationLeft", XF86XK_ApplicationRight: "XF86ApplicationRight", XF86XK_Book: "XF86Book", XF86XK_CD: "XF86CD", XF86XK_Calculater: "XF86Calculater", XF86XK_Clear: "XF86Clear", XF86XK_Close: "XF86Close", XF86XK_Copy: "XF86Copy", XF86XK_Cut: "XF86Cut", XF86XK_Display: "XF86Display", XF86XK_DOS: "XF86DOS", XF86XK_Documents: "XF86Documents", XF86XK_Excel: "XF86Excel", XF86XK_Explorer: "XF86Explorer", XF86XK_Game: "XF86Game", XF86XK_Go: "XF86Go", XF86XK_iTouch: "XF86iTouch", XF86XK_LogOff: "XF86LogOff", XF86XK_Market: "XF86Market", XF86XK_Meeting: "XF86Meeting", XF86XK_MenuKB: "XF86MenuKB", XF86XK_MenuPB: "XF86MenuPB", XF86XK_MySites: "XF86MySites", XF86XK_New: "XF86New", XF86XK_News: "XF86News", XF86XK_OfficeHome: "XF86OfficeHome", XF86XK_Open: "XF86Open", XF86XK_Option: "XF86Option", XF86XK_Paste: "XF86Paste", XF86XK_Phone: "XF86Phone", XF86XK_Q: "XF86Q", XF86XK_Reply: "XF86Reply", XF86XK_Reload: "XF86Reload", XF86XK_RotateWindows: "XF86RotateWindows", XF86XK_RotationPB: "XF86RotationPB", XF86XK_RotationKB: "XF86RotationKB", XF86XK_Save: "XF86Save", XF86XK_ScrollUp: "XF86ScrollUp", XF86XK_ScrollDown: "XF86ScrollDown", XF86XK_ScrollClick: "XF86ScrollClick", XF86XK_Send: "XF86Send", XF86XK_Spell: "XF86Spell", XF86XK_SplitScreen: "XF86SplitScreen", XF86XK_Support: "XF86Support", XF86XK_TaskPane: "XF86TaskPane", XF86XK_Terminal: "XF86Terminal", XF86XK_Tools: "XF86Tools", XF86XK_Travel: "XF86Travel", XF86XK_UserPB: "XF86UserPB", XF86XK_User1KB: "XF86User1KB", XF86XK_User2KB: "XF86User2KB", XF86XK_Video: "XF86Video", XF86XK_WheelButton: "XF86WheelButton", XF86XK_Word: "XF86Word", XF86XK_Xfer: "XF86Xfer", XF86XK_ZoomIn: "XF86ZoomIn", XF86XK_ZoomOut: "XF86ZoomOut", XF86XK_Away: "XF86Away", XF86XK_Messenger: "XF86Messenger", XF86XK_WebCam: "XF86WebCam", XF86XK_MailForward: "XF86MailForward", XF86XK_Pictures: "XF86Pictures", XF86XK_Music: "XF86Music", XF86XK_Battery: "XF86Battery", XF86XK_Bluetooth: "XF86Bluetooth", XF86XK_WLAN: "XF86WLAN", XF86XK_UWB: "XF86UWB", XF86XK_AudioForward: "XF86AudioForward", XF86XK_AudioRepeat: "XF86AudioRepeat", XF86XK_AudioRandomPlay: "XF86AudioRandomPlay", XF86XK_Subtitle: "XF86Subtitle", XF86XK_AudioCycleTrack: "XF86AudioCycleTrack", XF86XK_CycleAngle: "XF86CycleAngle", XF86XK_FrameBack: "XF86FrameBack", XF86XK_FrameForward: "XF86FrameForward", XF86XK_Time: "XF86Time", XF86XK_Select: "XF86Select", XF86XK_View: "XF86View", XF86XK_TopMenu: "XF86TopMenu", XF86XK_Red: "XF86Red", XF86XK_Green: "XF86Green", XF86XK_Yellow: "XF86Yellow", XF86XK_Blue: "XF86Blue", XF86XK_Suspend: "XF86Suspend", XF86XK_Hibernate: "XF86Hibernate", XF86XK_TouchpadToggle: "XF86TouchpadToggle", XF86XK_TouchpadOn: "XF86TouchpadOn", XF86XK_TouchpadOff: "XF86TouchpadOff", XF86XK_AudioMicMute: "XF86AudioMicMute", XF86XK_Keyboard: "XF86Keyboard", XF86XK_WWAN: "XF86WWAN", XF86XK_RFKill: "XF86RFKill", XF86XK_AudioPreset: "XF86AudioPreset", XF86XK_Switch_VT_1: "XF86Switch_VT_1", XF86XK_Switch_VT_2: "XF86Switch_VT_2", XF86XK_Switch_VT_3: "XF86Switch_VT_3", XF86XK_Switch_VT_4: "XF86Switch_VT_4", XF86XK_Switch_VT_5: "XF86Switch_VT_5", XF86XK_Switch_VT_6: "XF86Switch_VT_6", XF86XK_Switch_VT_7: "XF86Switch_VT_7", XF86XK_Switch_VT_8: "XF86Switch_VT_8", XF86XK_Switch_VT_9: "XF86Switch_VT_9", XF86XK_Switch_VT_10: "XF86Switch_VT_10", XF86XK_Switch_VT_11: "XF86Switch_VT_11", XF86XK_Switch_VT_12: "XF86Switch_VT_12", XF86XK_Ungrab: "XF86Ungrab", XF86XK_ClearGrab: "XF86ClearGrab", XF86XK_Next_VMode: "XF86Next_VMode", XF86XK_Prev_VMode: "XF86Prev_VMode", XF86XK_LogWindowTree: "XF86LogWindowTree", XF86XK_LogGrabInfo: "XF86LogGrabInfo", } var EngKeysymMap = map[string]x.Keysym{ "VoidSymbol": XK_VoidSymbol, "BackSpace": XK_BackSpace, "Tab": XK_Tab, "Linefeed": XK_Linefeed, "Clear": XK_Clear, "Return": XK_Return, "Pause": XK_Pause, "Scroll_Lock": XK_Scroll_Lock, "Sys_Req": XK_Sys_Req, "Escape": XK_Escape, "Delete": XK_Delete, "Multi_key": XK_Multi_key, "Codeinput": XK_Codeinput, "SingleCandidate": XK_SingleCandidate, "MultipleCandidate": XK_MultipleCandidate, "PreviousCandidate": XK_PreviousCandidate, "Kanji": XK_Kanji, "Muhenkan": XK_Muhenkan, "Henkan_Mode": XK_Henkan_Mode, "Henkan": XK_Henkan, "Romaji": XK_Romaji, "Hiragana": XK_Hiragana, "Katakana": XK_Katakana, "Hiragana_Katakana": XK_Hiragana_Katakana, "Zenkaku": XK_Zenkaku, "Hankaku": XK_Hankaku, "Zenkaku_Hankaku": XK_Zenkaku_Hankaku, "Touroku": XK_Touroku, "Massyo": XK_Massyo, "Kana_Lock": XK_Kana_Lock, "Kana_Shift": XK_Kana_Shift, "Eisu_Shift": XK_Eisu_Shift, "Eisu_toggle": XK_Eisu_toggle, "Kanji_Bangou": XK_Kanji_Bangou, "Zen_Koho": XK_Zen_Koho, "Mae_Koho": XK_Mae_Koho, "Home": XK_Home, "Left": XK_Left, "Up": XK_Up, "Right": XK_Right, "Down": XK_Down, "Prior": XK_Prior, "Page_Up": XK_Page_Up, "Next": XK_Next, "Page_Down": XK_Page_Down, "End": XK_End, "Begin": XK_Begin, "Select": XK_Select, "Print": XK_Print, "Execute": XK_Execute, "Insert": XK_Insert, "Undo": XK_Undo, "Redo": XK_Redo, "Menu": XK_Menu, "Find": XK_Find, "Cancel": XK_Cancel, "Help": XK_Help, "Break": XK_Break, "Mode_switch": XK_Mode_switch, "script_switch": XK_script_switch, "Num_Lock": XK_Num_Lock, "KP_Space": XK_KP_Space, "KP_Tab": XK_KP_Tab, "KP_Enter": XK_KP_Enter, "KP_F1": XK_KP_F1, "KP_F2": XK_KP_F2, "KP_F3": XK_KP_F3, "KP_F4": XK_KP_F4, "KP_Home": XK_KP_Home, "KP_Left": XK_KP_Left, "KP_Up": XK_KP_Up, "KP_Right": XK_KP_Right, "KP_Down": XK_KP_Down, "KP_Prior": XK_KP_Prior, "KP_Page_Up": XK_KP_Page_Up, "KP_Next": XK_KP_Next, "KP_Page_Down": XK_KP_Page_Down, "KP_End": XK_KP_End, "KP_Begin": XK_KP_Begin, "KP_Insert": XK_KP_Insert, "KP_Delete": XK_KP_Delete, "KP_Equal": XK_KP_Equal, "KP_Multiply": XK_KP_Multiply, "KP_Add": XK_KP_Add, "KP_Separator": XK_KP_Separator, "KP_Subtract": XK_KP_Subtract, "KP_Decimal": XK_KP_Decimal, "KP_Divide": XK_KP_Divide, "KP_0": XK_KP_0, "KP_1": XK_KP_1, "KP_2": XK_KP_2, "KP_3": XK_KP_3, "KP_4": XK_KP_4, "KP_5": XK_KP_5, "KP_6": XK_KP_6, "KP_7": XK_KP_7, "KP_8": XK_KP_8, "KP_9": XK_KP_9, "F1": XK_F1, "F2": XK_F2, "F3": XK_F3, "F4": XK_F4, "F5": XK_F5, "F6": XK_F6, "F7": XK_F7, "F8": XK_F8, "F9": XK_F9, "F10": XK_F10, "F11": XK_F11, "L1": XK_L1, "F12": XK_F12, "L2": XK_L2, "F13": XK_F13, "L3": XK_L3, "F14": XK_F14, "L4": XK_L4, "F15": XK_F15, "L5": XK_L5, "F16": XK_F16, "L6": XK_L6, "F17": XK_F17, "L7": XK_L7, "F18": XK_F18, "L8": XK_L8, "F19": XK_F19, "L9": XK_L9, "F20": XK_F20, "L10": XK_L10, "F21": XK_F21, "R1": XK_R1, "F22": XK_F22, "R2": XK_R2, "F23": XK_F23, "R3": XK_R3, "F24": XK_F24, "R4": XK_R4, "F25": XK_F25, "R5": XK_R5, "F26": XK_F26, "R6": XK_R6, "F27": XK_F27, "R7": XK_R7, "F28": XK_F28, "R8": XK_R8, "F29": XK_F29, "R9": XK_R9, "F30": XK_F30, "R10": XK_R10, "F31": XK_F31, "R11": XK_R11, "F32": XK_F32, "R12": XK_R12, "F33": XK_F33, "R13": XK_R13, "F34": XK_F34, "R14": XK_R14, "F35": XK_F35, "R15": XK_R15, "Shift_L": XK_Shift_L, "Shift_R": XK_Shift_R, "Control_L": XK_Control_L, "Control_R": XK_Control_R, "Caps_Lock": XK_Caps_Lock, "Shift_Lock": XK_Shift_Lock, "Meta_L": XK_Meta_L, "Meta_R": XK_Meta_R, "Alt_L": XK_Alt_L, "Alt_R": XK_Alt_R, "Super_L": XK_Super_L, "Super_R": XK_Super_R, "Hyper_L": XK_Hyper_L, "Hyper_R": XK_Hyper_R, "ISO_Lock": XK_ISO_Lock, "ISO_Level2_Latch": XK_ISO_Level2_Latch, "ISO_Level3_Shift": XK_ISO_Level3_Shift, "ISO_Level3_Latch": XK_ISO_Level3_Latch, "ISO_Level3_Lock": XK_ISO_Level3_Lock, "ISO_Level5_Shift": XK_ISO_Level5_Shift, "ISO_Level5_Latch": XK_ISO_Level5_Latch, "ISO_Level5_Lock": XK_ISO_Level5_Lock, "ISO_Group_Shift": XK_ISO_Group_Shift, "ISO_Group_Latch": XK_ISO_Group_Latch, "ISO_Group_Lock": XK_ISO_Group_Lock, "ISO_Next_Group": XK_ISO_Next_Group, "ISO_Next_Group_Lock": XK_ISO_Next_Group_Lock, "ISO_Prev_Group": XK_ISO_Prev_Group, "ISO_Prev_Group_Lock": XK_ISO_Prev_Group_Lock, "ISO_First_Group": XK_ISO_First_Group, "ISO_First_Group_Lock": XK_ISO_First_Group_Lock, "ISO_Last_Group": XK_ISO_Last_Group, "ISO_Last_Group_Lock": XK_ISO_Last_Group_Lock, "ISO_Left_Tab": XK_ISO_Left_Tab, "ISO_Move_Line_Up": XK_ISO_Move_Line_Up, "ISO_Move_Line_Down": XK_ISO_Move_Line_Down, "ISO_Partial_Line_Up": XK_ISO_Partial_Line_Up, "ISO_Partial_Line_Down": XK_ISO_Partial_Line_Down, "ISO_Partial_Space_Left": XK_ISO_Partial_Space_Left, "ISO_Partial_Space_Right": XK_ISO_Partial_Space_Right, "ISO_Set_Margin_Left": XK_ISO_Set_Margin_Left, "ISO_Set_Margin_Right": XK_ISO_Set_Margin_Right, "ISO_Release_Margin_Left": XK_ISO_Release_Margin_Left, "ISO_Release_Margin_Right": XK_ISO_Release_Margin_Right, "ISO_Release_Both_Margins": XK_ISO_Release_Both_Margins, "ISO_Fast_Cursor_Left": XK_ISO_Fast_Cursor_Left, "ISO_Fast_Cursor_Right": XK_ISO_Fast_Cursor_Right, "ISO_Fast_Cursor_Up": XK_ISO_Fast_Cursor_Up, "ISO_Fast_Cursor_Down": XK_ISO_Fast_Cursor_Down, "ISO_Continuous_Underline": XK_ISO_Continuous_Underline, "ISO_Discontinuous_Underline": XK_ISO_Discontinuous_Underline, "ISO_Emphasize": XK_ISO_Emphasize, "ISO_Center_Object": XK_ISO_Center_Object, "ISO_Enter": XK_ISO_Enter, "dead_grave": XK_dead_grave, "dead_acute": XK_dead_acute, "dead_circumflex": XK_dead_circumflex, "dead_tilde": XK_dead_tilde, "dead_perispomeni": XK_dead_perispomeni, "dead_macron": XK_dead_macron, "dead_breve": XK_dead_breve, "dead_abovedot": XK_dead_abovedot, "dead_diaeresis": XK_dead_diaeresis, "dead_abovering": XK_dead_abovering, "dead_doubleacute": XK_dead_doubleacute, "dead_caron": XK_dead_caron, "dead_cedilla": XK_dead_cedilla, "dead_ogonek": XK_dead_ogonek, "dead_iota": XK_dead_iota, "dead_voiced_sound": XK_dead_voiced_sound, "dead_semivoiced_sound": XK_dead_semivoiced_sound, "dead_belowdot": XK_dead_belowdot, "dead_hook": XK_dead_hook, "dead_horn": XK_dead_horn, "dead_stroke": XK_dead_stroke, "dead_abovecomma": XK_dead_abovecomma, "dead_psili": XK_dead_psili, "dead_abovereversedcomma": XK_dead_abovereversedcomma, "dead_dasia": XK_dead_dasia, "dead_doublegrave": XK_dead_doublegrave, "dead_belowring": XK_dead_belowring, "dead_belowmacron": XK_dead_belowmacron, "dead_belowcircumflex": XK_dead_belowcircumflex, "dead_belowtilde": XK_dead_belowtilde, "dead_belowbreve": XK_dead_belowbreve, "dead_belowdiaeresis": XK_dead_belowdiaeresis, "dead_invertedbreve": XK_dead_invertedbreve, "dead_belowcomma": XK_dead_belowcomma, "dead_currency": XK_dead_currency, "dead_lowline": XK_dead_lowline, "dead_aboveverticalline": XK_dead_aboveverticalline, "dead_belowverticalline": XK_dead_belowverticalline, "dead_longsolidusoverlay": XK_dead_longsolidusoverlay, "dead_a": XK_dead_a, "dead_A": XK_dead_A, "dead_e": XK_dead_e, "dead_E": XK_dead_E, "dead_i": XK_dead_i, "dead_I": XK_dead_I, "dead_o": XK_dead_o, "dead_O": XK_dead_O, "dead_u": XK_dead_u, "dead_U": XK_dead_U, "dead_small_schwa": XK_dead_small_schwa, "dead_capital_schwa": XK_dead_capital_schwa, "dead_greek": XK_dead_greek, "First_Virtual_Screen": XK_First_Virtual_Screen, "Prev_Virtual_Screen": XK_Prev_Virtual_Screen, "Next_Virtual_Screen": XK_Next_Virtual_Screen, "Last_Virtual_Screen": XK_Last_Virtual_Screen, "Terminate_Server": XK_Terminate_Server, "AccessX_Enable": XK_AccessX_Enable, "AccessX_Feedback_Enable": XK_AccessX_Feedback_Enable, "RepeatKeys_Enable": XK_RepeatKeys_Enable, "SlowKeys_Enable": XK_SlowKeys_Enable, "BounceKeys_Enable": XK_BounceKeys_Enable, "StickyKeys_Enable": XK_StickyKeys_Enable, "MouseKeys_Enable": XK_MouseKeys_Enable, "MouseKeys_Accel_Enable": XK_MouseKeys_Accel_Enable, "Overlay1_Enable": XK_Overlay1_Enable, "Overlay2_Enable": XK_Overlay2_Enable, "AudibleBell_Enable": XK_AudibleBell_Enable, "Pointer_Left": XK_Pointer_Left, "Pointer_Right": XK_Pointer_Right, "Pointer_Up": XK_Pointer_Up, "Pointer_Down": XK_Pointer_Down, "Pointer_UpLeft": XK_Pointer_UpLeft, "Pointer_UpRight": XK_Pointer_UpRight, "Pointer_DownLeft": XK_Pointer_DownLeft, "Pointer_DownRight": XK_Pointer_DownRight, "Pointer_Button_Dflt": XK_Pointer_Button_Dflt, "Pointer_Button1": XK_Pointer_Button1, "Pointer_Button2": XK_Pointer_Button2, "Pointer_Button3": XK_Pointer_Button3, "Pointer_Button4": XK_Pointer_Button4, "Pointer_Button5": XK_Pointer_Button5, "Pointer_DblClick_Dflt": XK_Pointer_DblClick_Dflt, "Pointer_DblClick1": XK_Pointer_DblClick1, "Pointer_DblClick2": XK_Pointer_DblClick2, "Pointer_DblClick3": XK_Pointer_DblClick3, "Pointer_DblClick4": XK_Pointer_DblClick4, "Pointer_DblClick5": XK_Pointer_DblClick5, "Pointer_Drag_Dflt": XK_Pointer_Drag_Dflt, "Pointer_Drag1": XK_Pointer_Drag1, "Pointer_Drag2": XK_Pointer_Drag2, "Pointer_Drag3": XK_Pointer_Drag3, "Pointer_Drag4": XK_Pointer_Drag4, "Pointer_Drag5": XK_Pointer_Drag5, "Pointer_EnableKeys": XK_Pointer_EnableKeys, "Pointer_Accelerate": XK_Pointer_Accelerate, "Pointer_DfltBtnNext": XK_Pointer_DfltBtnNext, "Pointer_DfltBtnPrev": XK_Pointer_DfltBtnPrev, "ch": XK_ch, "Ch": XK_Ch, "CH": XK_CH, "c_h": XK_c_h, "C_h": XK_C_h, "C_H": XK_C_H, "space": XK_space, "exclam": XK_exclam, "quotedbl": XK_quotedbl, "numbersign": XK_numbersign, "dollar": XK_dollar, "percent": XK_percent, "ampersand": XK_ampersand, "apostrophe": XK_apostrophe, "quoteright": XK_quoteright, "parenleft": XK_parenleft, "parenright": XK_parenright, "asterisk": XK_asterisk, "plus": XK_plus, "comma": XK_comma, "minus": XK_minus, "period": XK_period, "slash": XK_slash, "0": XK_0, "1": XK_1, "2": XK_2, "3": XK_3, "4": XK_4, "5": XK_5, "6": XK_6, "7": XK_7, "8": XK_8, "9": XK_9, "colon": XK_colon, "semicolon": XK_semicolon, "less": XK_less, "equal": XK_equal, "greater": XK_greater, "question": XK_question, "at": XK_at, "A": XK_A, "B": XK_B, "C": XK_C, "D": XK_D, "E": XK_E, "F": XK_F, "G": XK_G, "H": XK_H, "I": XK_I, "J": XK_J, "K": XK_K, "L": XK_L, "M": XK_M, "N": XK_N, "O": XK_O, "P": XK_P, "Q": XK_Q, "R": XK_R, "S": XK_S, "T": XK_T, "U": XK_U, "V": XK_V, "W": XK_W, "X": XK_X, "Y": XK_Y, "Z": XK_Z, "bracketleft": XK_bracketleft, "backslash": XK_backslash, "bracketright": XK_bracketright, "asciicircum": XK_asciicircum, "underscore": XK_underscore, "grave": XK_grave, "quoteleft": XK_quoteleft, "a": XK_a, "b": XK_b, "c": XK_c, "d": XK_d, "e": XK_e, "f": XK_f, "g": XK_g, "h": XK_h, "i": XK_i, "j": XK_j, "k": XK_k, "l": XK_l, "m": XK_m, "n": XK_n, "o": XK_o, "p": XK_p, "q": XK_q, "r": XK_r, "s": XK_s, "t": XK_t, "u": XK_u, "v": XK_v, "w": XK_w, "x": XK_x, "y": XK_y, "z": XK_z, "braceleft": XK_braceleft, "bar": XK_bar, "braceright": XK_braceright, "asciitilde": XK_asciitilde, "nobreakspace": XK_nobreakspace, "exclamdown": XK_exclamdown, "cent": XK_cent, "sterling": XK_sterling, "currency": XK_currency, "yen": XK_yen, "brokenbar": XK_brokenbar, "section": XK_section, "diaeresis": XK_diaeresis, "copyright": XK_copyright, "ordfeminine": XK_ordfeminine, "guillemotleft": XK_guillemotleft, "notsign": XK_notsign, "hyphen": XK_hyphen, "registered": XK_registered, "macron": XK_macron, "degree": XK_degree, "plusminus": XK_plusminus, "twosuperior": XK_twosuperior, "threesuperior": XK_threesuperior, "acute": XK_acute, "mu": XK_mu, "paragraph": XK_paragraph, "periodcentered": XK_periodcentered, "cedilla": XK_cedilla, "onesuperior": XK_onesuperior, "masculine": XK_masculine, "guillemotright": XK_guillemotright, "onequarter": XK_onequarter, "onehalf": XK_onehalf, "threequarters": XK_threequarters, "questiondown": XK_questiondown, "Agrave": XK_Agrave, "Aacute": XK_Aacute, "Acircumflex": XK_Acircumflex, "Atilde": XK_Atilde, "Adiaeresis": XK_Adiaeresis, "Aring": XK_Aring, "AE": XK_AE, "Ccedilla": XK_Ccedilla, "Egrave": XK_Egrave, "Eacute": XK_Eacute, "Ecircumflex": XK_Ecircumflex, "Ediaeresis": XK_Ediaeresis, "Igrave": XK_Igrave, "Iacute": XK_Iacute, "Icircumflex": XK_Icircumflex, "Idiaeresis": XK_Idiaeresis, "ETH": XK_ETH, "Eth": XK_Eth, "Ntilde": XK_Ntilde, "Ograve": XK_Ograve, "Oacute": XK_Oacute, "Ocircumflex": XK_Ocircumflex, "Otilde": XK_Otilde, "Odiaeresis": XK_Odiaeresis, "multiply": XK_multiply, "Oslash": XK_Oslash, "Ooblique": XK_Ooblique, "Ugrave": XK_Ugrave, "Uacute": XK_Uacute, "Ucircumflex": XK_Ucircumflex, "Udiaeresis": XK_Udiaeresis, "Yacute": XK_Yacute, "THORN": XK_THORN, "Thorn": XK_Thorn, "ssharp": XK_ssharp, "agrave": XK_agrave, "aacute": XK_aacute, "acircumflex": XK_acircumflex, "atilde": XK_atilde, "adiaeresis": XK_adiaeresis, "aring": XK_aring, "ae": XK_ae, "ccedilla": XK_ccedilla, "egrave": XK_egrave, "eacute": XK_eacute, "ecircumflex": XK_ecircumflex, "ediaeresis": XK_ediaeresis, "igrave": XK_igrave, "iacute": XK_iacute, "icircumflex": XK_icircumflex, "idiaeresis": XK_idiaeresis, "eth": XK_eth, "ntilde": XK_ntilde, "ograve": XK_ograve, "oacute": XK_oacute, "ocircumflex": XK_ocircumflex, "otilde": XK_otilde, "odiaeresis": XK_odiaeresis, "division": XK_division, "oslash": XK_oslash, "ooblique": XK_ooblique, "ugrave": XK_ugrave, "uacute": XK_uacute, "ucircumflex": XK_ucircumflex, "udiaeresis": XK_udiaeresis, "yacute": XK_yacute, "thorn": XK_thorn, "ydiaeresis": XK_ydiaeresis, "Aogonek": XK_Aogonek, "breve": XK_breve, "Lstroke": XK_Lstroke, "Lcaron": XK_Lcaron, "Sacute": XK_Sacute, "Scaron": XK_Scaron, "Scedilla": XK_Scedilla, "Tcaron": XK_Tcaron, "Zacute": XK_Zacute, "Zcaron": XK_Zcaron, "Zabovedot": XK_Zabovedot, "aogonek": XK_aogonek, "ogonek": XK_ogonek, "lstroke": XK_lstroke, "lcaron": XK_lcaron, "sacute": XK_sacute, "caron": XK_caron, "scaron": XK_scaron, "scedilla": XK_scedilla, "tcaron": XK_tcaron, "zacute": XK_zacute, "doubleacute": XK_doubleacute, "zcaron": XK_zcaron, "zabovedot": XK_zabovedot, "Racute": XK_Racute, "Abreve": XK_Abreve, "Lacute": XK_Lacute, "Cacute": XK_Cacute, "Ccaron": XK_Ccaron, "Eogonek": XK_Eogonek, "Ecaron": XK_Ecaron, "Dcaron": XK_Dcaron, "Dstroke": XK_Dstroke, "Nacute": XK_Nacute, "Ncaron": XK_Ncaron, "Odoubleacute": XK_Odoubleacute, "Rcaron": XK_Rcaron, "Uring": XK_Uring, "Udoubleacute": XK_Udoubleacute, "Tcedilla": XK_Tcedilla, "racute": XK_racute, "abreve": XK_abreve, "lacute": XK_lacute, "cacute": XK_cacute, "ccaron": XK_ccaron, "eogonek": XK_eogonek, "ecaron": XK_ecaron, "dcaron": XK_dcaron, "dstroke": XK_dstroke, "nacute": XK_nacute, "ncaron": XK_ncaron, "odoubleacute": XK_odoubleacute, "rcaron": XK_rcaron, "uring": XK_uring, "udoubleacute": XK_udoubleacute, "tcedilla": XK_tcedilla, "abovedot": XK_abovedot, "Hstroke": XK_Hstroke, "Hcircumflex": XK_Hcircumflex, "Iabovedot": XK_Iabovedot, "Gbreve": XK_Gbreve, "Jcircumflex": XK_Jcircumflex, "hstroke": XK_hstroke, "hcircumflex": XK_hcircumflex, "idotless": XK_idotless, "gbreve": XK_gbreve, "jcircumflex": XK_jcircumflex, "Cabovedot": XK_Cabovedot, "Ccircumflex": XK_Ccircumflex, "Gabovedot": XK_Gabovedot, "Gcircumflex": XK_Gcircumflex, "Ubreve": XK_Ubreve, "Scircumflex": XK_Scircumflex, "cabovedot": XK_cabovedot, "ccircumflex": XK_ccircumflex, "gabovedot": XK_gabovedot, "gcircumflex": XK_gcircumflex, "ubreve": XK_ubreve, "scircumflex": XK_scircumflex, "kra": XK_kra, "kappa": XK_kappa, "Rcedilla": XK_Rcedilla, "Itilde": XK_Itilde, "Lcedilla": XK_Lcedilla, "Emacron": XK_Emacron, "Gcedilla": XK_Gcedilla, "Tslash": XK_Tslash, "rcedilla": XK_rcedilla, "itilde": XK_itilde, "lcedilla": XK_lcedilla, "emacron": XK_emacron, "gcedilla": XK_gcedilla, "tslash": XK_tslash, "ENG": XK_ENG, "eng": XK_eng, "Amacron": XK_Amacron, "Iogonek": XK_Iogonek, "Eabovedot": XK_Eabovedot, "Imacron": XK_Imacron, "Ncedilla": XK_Ncedilla, "Omacron": XK_Omacron, "Kcedilla": XK_Kcedilla, "Uogonek": XK_Uogonek, "Utilde": XK_Utilde, "Umacron": XK_Umacron, "amacron": XK_amacron, "iogonek": XK_iogonek, "eabovedot": XK_eabovedot, "imacron": XK_imacron, "ncedilla": XK_ncedilla, "omacron": XK_omacron, "kcedilla": XK_kcedilla, "uogonek": XK_uogonek, "utilde": XK_utilde, "umacron": XK_umacron, "Wcircumflex": XK_Wcircumflex, "wcircumflex": XK_wcircumflex, "Ycircumflex": XK_Ycircumflex, "ycircumflex": XK_ycircumflex, "Babovedot": XK_Babovedot, "babovedot": XK_babovedot, "Dabovedot": XK_Dabovedot, "dabovedot": XK_dabovedot, "Fabovedot": XK_Fabovedot, "fabovedot": XK_fabovedot, "Mabovedot": XK_Mabovedot, "mabovedot": XK_mabovedot, "Pabovedot": XK_Pabovedot, "pabovedot": XK_pabovedot, "Sabovedot": XK_Sabovedot, "sabovedot": XK_sabovedot, "Tabovedot": XK_Tabovedot, "tabovedot": XK_tabovedot, "Wgrave": XK_Wgrave, "wgrave": XK_wgrave, "Wacute": XK_Wacute, "wacute": XK_wacute, "Wdiaeresis": XK_Wdiaeresis, "wdiaeresis": XK_wdiaeresis, "Ygrave": XK_Ygrave, "ygrave": XK_ygrave, "OE": XK_OE, "oe": XK_oe, "Ydiaeresis": XK_Ydiaeresis, "overline": XK_overline, "kana_fullstop": XK_kana_fullstop, "kana_openingbracket": XK_kana_openingbracket, "kana_closingbracket": XK_kana_closingbracket, "kana_comma": XK_kana_comma, "kana_conjunctive": XK_kana_conjunctive, "kana_middledot": XK_kana_middledot, "kana_WO": XK_kana_WO, "kana_a": XK_kana_a, "kana_i": XK_kana_i, "kana_u": XK_kana_u, "kana_e": XK_kana_e, "kana_o": XK_kana_o, "kana_ya": XK_kana_ya, "kana_yu": XK_kana_yu, "kana_yo": XK_kana_yo, "kana_tsu": XK_kana_tsu, "kana_tu": XK_kana_tu, "prolongedsound": XK_prolongedsound, "kana_A": XK_kana_A, "kana_I": XK_kana_I, "kana_U": XK_kana_U, "kana_E": XK_kana_E, "kana_O": XK_kana_O, "kana_KA": XK_kana_KA, "kana_KI": XK_kana_KI, "kana_KU": XK_kana_KU, "kana_KE": XK_kana_KE, "kana_KO": XK_kana_KO, "kana_SA": XK_kana_SA, "kana_SHI": XK_kana_SHI, "kana_SU": XK_kana_SU, "kana_SE": XK_kana_SE, "kana_SO": XK_kana_SO, "kana_TA": XK_kana_TA, "kana_CHI": XK_kana_CHI, "kana_TI": XK_kana_TI, "kana_TSU": XK_kana_TSU, "kana_TU": XK_kana_TU, "kana_TE": XK_kana_TE, "kana_TO": XK_kana_TO, "kana_NA": XK_kana_NA, "kana_NI": XK_kana_NI, "kana_NU": XK_kana_NU, "kana_NE": XK_kana_NE, "kana_NO": XK_kana_NO, "kana_HA": XK_kana_HA, "kana_HI": XK_kana_HI, "kana_FU": XK_kana_FU, "kana_HU": XK_kana_HU, "kana_HE": XK_kana_HE, "kana_HO": XK_kana_HO, "kana_MA": XK_kana_MA, "kana_MI": XK_kana_MI, "kana_MU": XK_kana_MU, "kana_ME": XK_kana_ME, "kana_MO": XK_kana_MO, "kana_YA": XK_kana_YA, "kana_YU": XK_kana_YU, "kana_YO": XK_kana_YO, "kana_RA": XK_kana_RA, "kana_RI": XK_kana_RI, "kana_RU": XK_kana_RU, "kana_RE": XK_kana_RE, "kana_RO": XK_kana_RO, "kana_WA": XK_kana_WA, "kana_N": XK_kana_N, "voicedsound": XK_voicedsound, "semivoicedsound": XK_semivoicedsound, "kana_switch": XK_kana_switch, "Farsi_0": XK_Farsi_0, "Farsi_1": XK_Farsi_1, "Farsi_2": XK_Farsi_2, "Farsi_3": XK_Farsi_3, "Farsi_4": XK_Farsi_4, "Farsi_5": XK_Farsi_5, "Farsi_6": XK_Farsi_6, "Farsi_7": XK_Farsi_7, "Farsi_8": XK_Farsi_8, "Farsi_9": XK_Farsi_9, "Arabic_percent": XK_Arabic_percent, "Arabic_superscript_alef": XK_Arabic_superscript_alef, "Arabic_tteh": XK_Arabic_tteh, "Arabic_peh": XK_Arabic_peh, "Arabic_tcheh": XK_Arabic_tcheh, "Arabic_ddal": XK_Arabic_ddal, "Arabic_rreh": XK_Arabic_rreh, "Arabic_comma": XK_Arabic_comma, "Arabic_fullstop": XK_Arabic_fullstop, "Arabic_0": XK_Arabic_0, "Arabic_1": XK_Arabic_1, "Arabic_2": XK_Arabic_2, "Arabic_3": XK_Arabic_3, "Arabic_4": XK_Arabic_4, "Arabic_5": XK_Arabic_5, "Arabic_6": XK_Arabic_6, "Arabic_7": XK_Arabic_7, "Arabic_8": XK_Arabic_8, "Arabic_9": XK_Arabic_9, "Arabic_semicolon": XK_Arabic_semicolon, "Arabic_question_mark": XK_Arabic_question_mark, "Arabic_hamza": XK_Arabic_hamza, "Arabic_maddaonalef": XK_Arabic_maddaonalef, "Arabic_hamzaonalef": XK_Arabic_hamzaonalef, "Arabic_hamzaonwaw": XK_Arabic_hamzaonwaw, "Arabic_hamzaunderalef": XK_Arabic_hamzaunderalef, "Arabic_hamzaonyeh": XK_Arabic_hamzaonyeh, "Arabic_alef": XK_Arabic_alef, "Arabic_beh": XK_Arabic_beh, "Arabic_tehmarbuta": XK_Arabic_tehmarbuta, "Arabic_teh": XK_Arabic_teh, "Arabic_theh": XK_Arabic_theh, "Arabic_jeem": XK_Arabic_jeem, "Arabic_hah": XK_Arabic_hah, "Arabic_khah": XK_Arabic_khah, "Arabic_dal": XK_Arabic_dal, "Arabic_thal": XK_Arabic_thal, "Arabic_ra": XK_Arabic_ra, "Arabic_zain": XK_Arabic_zain, "Arabic_seen": XK_Arabic_seen, "Arabic_sheen": XK_Arabic_sheen, "Arabic_sad": XK_Arabic_sad, "Arabic_dad": XK_Arabic_dad, "Arabic_tah": XK_Arabic_tah, "Arabic_zah": XK_Arabic_zah, "Arabic_ain": XK_Arabic_ain, "Arabic_ghain": XK_Arabic_ghain, "Arabic_tatweel": XK_Arabic_tatweel, "Arabic_feh": XK_Arabic_feh, "Arabic_qaf": XK_Arabic_qaf, "Arabic_kaf": XK_Arabic_kaf, "Arabic_lam": XK_Arabic_lam, "Arabic_meem": XK_Arabic_meem, "Arabic_noon": XK_Arabic_noon, "Arabic_ha": XK_Arabic_ha, "Arabic_heh": XK_Arabic_heh, "Arabic_waw": XK_Arabic_waw, "Arabic_alefmaksura": XK_Arabic_alefmaksura, "Arabic_yeh": XK_Arabic_yeh, "Arabic_fathatan": XK_Arabic_fathatan, "Arabic_dammatan": XK_Arabic_dammatan, "Arabic_kasratan": XK_Arabic_kasratan, "Arabic_fatha": XK_Arabic_fatha, "Arabic_damma": XK_Arabic_damma, "Arabic_kasra": XK_Arabic_kasra, "Arabic_shadda": XK_Arabic_shadda, "Arabic_sukun": XK_Arabic_sukun, "Arabic_madda_above": XK_Arabic_madda_above, "Arabic_hamza_above": XK_Arabic_hamza_above, "Arabic_hamza_below": XK_Arabic_hamza_below, "Arabic_jeh": XK_Arabic_jeh, "Arabic_veh": XK_Arabic_veh, "Arabic_keheh": XK_Arabic_keheh, "Arabic_gaf": XK_Arabic_gaf, "Arabic_noon_ghunna": XK_Arabic_noon_ghunna, "Arabic_heh_doachashmee": XK_Arabic_heh_doachashmee, "Farsi_yeh": XK_Farsi_yeh, "Arabic_farsi_yeh": XK_Arabic_farsi_yeh, "Arabic_yeh_baree": XK_Arabic_yeh_baree, "Arabic_heh_goal": XK_Arabic_heh_goal, "Arabic_switch": XK_Arabic_switch, "Cyrillic_GHE_bar": XK_Cyrillic_GHE_bar, "Cyrillic_ghe_bar": XK_Cyrillic_ghe_bar, "Cyrillic_ZHE_descender": XK_Cyrillic_ZHE_descender, "Cyrillic_zhe_descender": XK_Cyrillic_zhe_descender, "Cyrillic_KA_descender": XK_Cyrillic_KA_descender, "Cyrillic_ka_descender": XK_Cyrillic_ka_descender, "Cyrillic_KA_vertstroke": XK_Cyrillic_KA_vertstroke, "Cyrillic_ka_vertstroke": XK_Cyrillic_ka_vertstroke, "Cyrillic_EN_descender": XK_Cyrillic_EN_descender, "Cyrillic_en_descender": XK_Cyrillic_en_descender, "Cyrillic_U_straight": XK_Cyrillic_U_straight, "Cyrillic_u_straight": XK_Cyrillic_u_straight, "Cyrillic_U_straight_bar": XK_Cyrillic_U_straight_bar, "Cyrillic_u_straight_bar": XK_Cyrillic_u_straight_bar, "Cyrillic_HA_descender": XK_Cyrillic_HA_descender, "Cyrillic_ha_descender": XK_Cyrillic_ha_descender, "Cyrillic_CHE_descender": XK_Cyrillic_CHE_descender, "Cyrillic_che_descender": XK_Cyrillic_che_descender, "Cyrillic_CHE_vertstroke": XK_Cyrillic_CHE_vertstroke, "Cyrillic_che_vertstroke": XK_Cyrillic_che_vertstroke, "Cyrillic_SHHA": XK_Cyrillic_SHHA, "Cyrillic_shha": XK_Cyrillic_shha, "Cyrillic_SCHWA": XK_Cyrillic_SCHWA, "Cyrillic_schwa": XK_Cyrillic_schwa, "Cyrillic_I_macron": XK_Cyrillic_I_macron, "Cyrillic_i_macron": XK_Cyrillic_i_macron, "Cyrillic_O_bar": XK_Cyrillic_O_bar, "Cyrillic_o_bar": XK_Cyrillic_o_bar, "Cyrillic_U_macron": XK_Cyrillic_U_macron, "Cyrillic_u_macron": XK_Cyrillic_u_macron, "Serbian_dje": XK_Serbian_dje, "Macedonia_gje": XK_Macedonia_gje, "Cyrillic_io": XK_Cyrillic_io, "Ukrainian_ie": XK_Ukrainian_ie, "Ukranian_je": XK_Ukranian_je, "Macedonia_dse": XK_Macedonia_dse, "Ukrainian_i": XK_Ukrainian_i, "Ukranian_i": XK_Ukranian_i, "Ukrainian_yi": XK_Ukrainian_yi, "Ukranian_yi": XK_Ukranian_yi, "Cyrillic_je": XK_Cyrillic_je, "Serbian_je": XK_Serbian_je, "Cyrillic_lje": XK_Cyrillic_lje, "Serbian_lje": XK_Serbian_lje, "Cyrillic_nje": XK_Cyrillic_nje, "Serbian_nje": XK_Serbian_nje, "Serbian_tshe": XK_Serbian_tshe, "Macedonia_kje": XK_Macedonia_kje, "Ukrainian_ghe_with_upturn": XK_Ukrainian_ghe_with_upturn, "Byelorussian_shortu": XK_Byelorussian_shortu, "Cyrillic_dzhe": XK_Cyrillic_dzhe, "Serbian_dze": XK_Serbian_dze, "numerosign": XK_numerosign, "Serbian_DJE": XK_Serbian_DJE, "Macedonia_GJE": XK_Macedonia_GJE, "Cyrillic_IO": XK_Cyrillic_IO, "Ukrainian_IE": XK_Ukrainian_IE, "Ukranian_JE": XK_Ukranian_JE, "Macedonia_DSE": XK_Macedonia_DSE, "Ukrainian_I": XK_Ukrainian_I, "Ukranian_I": XK_Ukranian_I, "Ukrainian_YI": XK_Ukrainian_YI, "Ukranian_YI": XK_Ukranian_YI, "Cyrillic_JE": XK_Cyrillic_JE, "Serbian_JE": XK_Serbian_JE, "Cyrillic_LJE": XK_Cyrillic_LJE, "Serbian_LJE": XK_Serbian_LJE, "Cyrillic_NJE": XK_Cyrillic_NJE, "Serbian_NJE": XK_Serbian_NJE, "Serbian_TSHE": XK_Serbian_TSHE, "Macedonia_KJE": XK_Macedonia_KJE, "Ukrainian_GHE_WITH_UPTURN": XK_Ukrainian_GHE_WITH_UPTURN, "Byelorussian_SHORTU": XK_Byelorussian_SHORTU, "Cyrillic_DZHE": XK_Cyrillic_DZHE, "Serbian_DZE": XK_Serbian_DZE, "Cyrillic_yu": XK_Cyrillic_yu, "Cyrillic_a": XK_Cyrillic_a, "Cyrillic_be": XK_Cyrillic_be, "Cyrillic_tse": XK_Cyrillic_tse, "Cyrillic_de": XK_Cyrillic_de, "Cyrillic_ie": XK_Cyrillic_ie, "Cyrillic_ef": XK_Cyrillic_ef, "Cyrillic_ghe": XK_Cyrillic_ghe, "Cyrillic_ha": XK_Cyrillic_ha, "Cyrillic_i": XK_Cyrillic_i, "Cyrillic_shorti": XK_Cyrillic_shorti, "Cyrillic_ka": XK_Cyrillic_ka, "Cyrillic_el": XK_Cyrillic_el, "Cyrillic_em": XK_Cyrillic_em, "Cyrillic_en": XK_Cyrillic_en, "Cyrillic_o": XK_Cyrillic_o, "Cyrillic_pe": XK_Cyrillic_pe, "Cyrillic_ya": XK_Cyrillic_ya, "Cyrillic_er": XK_Cyrillic_er, "Cyrillic_es": XK_Cyrillic_es, "Cyrillic_te": XK_Cyrillic_te, "Cyrillic_u": XK_Cyrillic_u, "Cyrillic_zhe": XK_Cyrillic_zhe, "Cyrillic_ve": XK_Cyrillic_ve, "Cyrillic_softsign": XK_Cyrillic_softsign, "Cyrillic_yeru": XK_Cyrillic_yeru, "Cyrillic_ze": XK_Cyrillic_ze, "Cyrillic_sha": XK_Cyrillic_sha, "Cyrillic_e": XK_Cyrillic_e, "Cyrillic_shcha": XK_Cyrillic_shcha, "Cyrillic_che": XK_Cyrillic_che, "Cyrillic_hardsign": XK_Cyrillic_hardsign, "Cyrillic_YU": XK_Cyrillic_YU, "Cyrillic_A": XK_Cyrillic_A, "Cyrillic_BE": XK_Cyrillic_BE, "Cyrillic_TSE": XK_Cyrillic_TSE, "Cyrillic_DE": XK_Cyrillic_DE, "Cyrillic_IE": XK_Cyrillic_IE, "Cyrillic_EF": XK_Cyrillic_EF, "Cyrillic_GHE": XK_Cyrillic_GHE, "Cyrillic_HA": XK_Cyrillic_HA, "Cyrillic_I": XK_Cyrillic_I, "Cyrillic_SHORTI": XK_Cyrillic_SHORTI, "Cyrillic_KA": XK_Cyrillic_KA, "Cyrillic_EL": XK_Cyrillic_EL, "Cyrillic_EM": XK_Cyrillic_EM, "Cyrillic_EN": XK_Cyrillic_EN, "Cyrillic_O": XK_Cyrillic_O, "Cyrillic_PE": XK_Cyrillic_PE, "Cyrillic_YA": XK_Cyrillic_YA, "Cyrillic_ER": XK_Cyrillic_ER, "Cyrillic_ES": XK_Cyrillic_ES, "Cyrillic_TE": XK_Cyrillic_TE, "Cyrillic_U": XK_Cyrillic_U, "Cyrillic_ZHE": XK_Cyrillic_ZHE, "Cyrillic_VE": XK_Cyrillic_VE, "Cyrillic_SOFTSIGN": XK_Cyrillic_SOFTSIGN, "Cyrillic_YERU": XK_Cyrillic_YERU, "Cyrillic_ZE": XK_Cyrillic_ZE, "Cyrillic_SHA": XK_Cyrillic_SHA, "Cyrillic_E": XK_Cyrillic_E, "Cyrillic_SHCHA": XK_Cyrillic_SHCHA, "Cyrillic_CHE": XK_Cyrillic_CHE, "Cyrillic_HARDSIGN": XK_Cyrillic_HARDSIGN, "Greek_ALPHAaccent": XK_Greek_ALPHAaccent, "Greek_EPSILONaccent": XK_Greek_EPSILONaccent, "Greek_ETAaccent": XK_Greek_ETAaccent, "Greek_IOTAaccent": XK_Greek_IOTAaccent, "Greek_IOTAdieresis": XK_Greek_IOTAdieresis, "Greek_IOTAdiaeresis": XK_Greek_IOTAdiaeresis, "Greek_OMICRONaccent": XK_Greek_OMICRONaccent, "Greek_UPSILONaccent": XK_Greek_UPSILONaccent, "Greek_UPSILONdieresis": XK_Greek_UPSILONdieresis, "Greek_OMEGAaccent": XK_Greek_OMEGAaccent, "Greek_accentdieresis": XK_Greek_accentdieresis, "Greek_horizbar": XK_Greek_horizbar, "Greek_alphaaccent": XK_Greek_alphaaccent, "Greek_epsilonaccent": XK_Greek_epsilonaccent, "Greek_etaaccent": XK_Greek_etaaccent, "Greek_iotaaccent": XK_Greek_iotaaccent, "Greek_iotadieresis": XK_Greek_iotadieresis, "Greek_iotaaccentdieresis": XK_Greek_iotaaccentdieresis, "Greek_omicronaccent": XK_Greek_omicronaccent, "Greek_upsilonaccent": XK_Greek_upsilonaccent, "Greek_upsilondieresis": XK_Greek_upsilondieresis, "Greek_upsilonaccentdieresis": XK_Greek_upsilonaccentdieresis, "Greek_omegaaccent": XK_Greek_omegaaccent, "Greek_ALPHA": XK_Greek_ALPHA, "Greek_BETA": XK_Greek_BETA, "Greek_GAMMA": XK_Greek_GAMMA, "Greek_DELTA": XK_Greek_DELTA, "Greek_EPSILON": XK_Greek_EPSILON, "Greek_ZETA": XK_Greek_ZETA, "Greek_ETA": XK_Greek_ETA, "Greek_THETA": XK_Greek_THETA, "Greek_IOTA": XK_Greek_IOTA, "Greek_KAPPA": XK_Greek_KAPPA, "Greek_LAMDA": XK_Greek_LAMDA, "Greek_LAMBDA": XK_Greek_LAMBDA, "Greek_MU": XK_Greek_MU, "Greek_NU": XK_Greek_NU, "Greek_XI": XK_Greek_XI, "Greek_OMICRON": XK_Greek_OMICRON, "Greek_PI": XK_Greek_PI, "Greek_RHO": XK_Greek_RHO, "Greek_SIGMA": XK_Greek_SIGMA, "Greek_TAU": XK_Greek_TAU, "Greek_UPSILON": XK_Greek_UPSILON, "Greek_PHI": XK_Greek_PHI, "Greek_CHI": XK_Greek_CHI, "Greek_PSI": XK_Greek_PSI, "Greek_OMEGA": XK_Greek_OMEGA, "Greek_alpha": XK_Greek_alpha, "Greek_beta": XK_Greek_beta, "Greek_gamma": XK_Greek_gamma, "Greek_delta": XK_Greek_delta, "Greek_epsilon": XK_Greek_epsilon, "Greek_zeta": XK_Greek_zeta, "Greek_eta": XK_Greek_eta, "Greek_theta": XK_Greek_theta, "Greek_iota": XK_Greek_iota, "Greek_kappa": XK_Greek_kappa, "Greek_lamda": XK_Greek_lamda, "Greek_lambda": XK_Greek_lambda, "Greek_mu": XK_Greek_mu, "Greek_nu": XK_Greek_nu, "Greek_xi": XK_Greek_xi, "Greek_omicron": XK_Greek_omicron, "Greek_pi": XK_Greek_pi, "Greek_rho": XK_Greek_rho, "Greek_sigma": XK_Greek_sigma, "Greek_finalsmallsigma": XK_Greek_finalsmallsigma, "Greek_tau": XK_Greek_tau, "Greek_upsilon": XK_Greek_upsilon, "Greek_phi": XK_Greek_phi, "Greek_chi": XK_Greek_chi, "Greek_psi": XK_Greek_psi, "Greek_omega": XK_Greek_omega, "Greek_switch": XK_Greek_switch, "hebrew_doublelowline": XK_hebrew_doublelowline, "hebrew_aleph": XK_hebrew_aleph, "hebrew_bet": XK_hebrew_bet, "hebrew_beth": XK_hebrew_beth, "hebrew_gimel": XK_hebrew_gimel, "hebrew_gimmel": XK_hebrew_gimmel, "hebrew_dalet": XK_hebrew_dalet, "hebrew_daleth": XK_hebrew_daleth, "hebrew_he": XK_hebrew_he, "hebrew_waw": XK_hebrew_waw, "hebrew_zain": XK_hebrew_zain, "hebrew_zayin": XK_hebrew_zayin, "hebrew_chet": XK_hebrew_chet, "hebrew_het": XK_hebrew_het, "hebrew_tet": XK_hebrew_tet, "hebrew_teth": XK_hebrew_teth, "hebrew_yod": XK_hebrew_yod, "hebrew_finalkaph": XK_hebrew_finalkaph, "hebrew_kaph": XK_hebrew_kaph, "hebrew_lamed": XK_hebrew_lamed, "hebrew_finalmem": XK_hebrew_finalmem, "hebrew_mem": XK_hebrew_mem, "hebrew_finalnun": XK_hebrew_finalnun, "hebrew_nun": XK_hebrew_nun, "hebrew_samech": XK_hebrew_samech, "hebrew_samekh": XK_hebrew_samekh, "hebrew_ayin": XK_hebrew_ayin, "hebrew_finalpe": XK_hebrew_finalpe, "hebrew_pe": XK_hebrew_pe, "hebrew_finalzade": XK_hebrew_finalzade, "hebrew_finalzadi": XK_hebrew_finalzadi, "hebrew_zade": XK_hebrew_zade, "hebrew_zadi": XK_hebrew_zadi, "hebrew_qoph": XK_hebrew_qoph, "hebrew_kuf": XK_hebrew_kuf, "hebrew_resh": XK_hebrew_resh, "hebrew_shin": XK_hebrew_shin, "hebrew_taw": XK_hebrew_taw, "hebrew_taf": XK_hebrew_taf, "Hebrew_switch": XK_Hebrew_switch, "Thai_kokai": XK_Thai_kokai, "Thai_khokhai": XK_Thai_khokhai, "Thai_khokhuat": XK_Thai_khokhuat, "Thai_khokhwai": XK_Thai_khokhwai, "Thai_khokhon": XK_Thai_khokhon, "Thai_khorakhang": XK_Thai_khorakhang, "Thai_ngongu": XK_Thai_ngongu, "Thai_chochan": XK_Thai_chochan, "Thai_choching": XK_Thai_choching, "Thai_chochang": XK_Thai_chochang, "Thai_soso": XK_Thai_soso, "Thai_chochoe": XK_Thai_chochoe, "Thai_yoying": XK_Thai_yoying, "Thai_dochada": XK_Thai_dochada, "Thai_topatak": XK_Thai_topatak, "Thai_thothan": XK_Thai_thothan, "Thai_thonangmontho": XK_Thai_thonangmontho, "Thai_thophuthao": XK_Thai_thophuthao, "Thai_nonen": XK_Thai_nonen, "Thai_dodek": XK_Thai_dodek, "Thai_totao": XK_Thai_totao, "Thai_thothung": XK_Thai_thothung, "Thai_thothahan": XK_Thai_thothahan, "Thai_thothong": XK_Thai_thothong, "Thai_nonu": XK_Thai_nonu, "Thai_bobaimai": XK_Thai_bobaimai, "Thai_popla": XK_Thai_popla, "Thai_phophung": XK_Thai_phophung, "Thai_fofa": XK_Thai_fofa, "Thai_phophan": XK_Thai_phophan, "Thai_fofan": XK_Thai_fofan, "Thai_phosamphao": XK_Thai_phosamphao, "Thai_moma": XK_Thai_moma, "Thai_yoyak": XK_Thai_yoyak, "Thai_rorua": XK_Thai_rorua, "Thai_ru": XK_Thai_ru, "Thai_loling": XK_Thai_loling, "Thai_lu": XK_Thai_lu, "Thai_wowaen": XK_Thai_wowaen, "Thai_sosala": XK_Thai_sosala, "Thai_sorusi": XK_Thai_sorusi, "Thai_sosua": XK_Thai_sosua, "Thai_hohip": XK_Thai_hohip, "Thai_lochula": XK_Thai_lochula, "Thai_oang": XK_Thai_oang, "Thai_honokhuk": XK_Thai_honokhuk, "Thai_paiyannoi": XK_Thai_paiyannoi, "Thai_saraa": XK_Thai_saraa, "Thai_maihanakat": XK_Thai_maihanakat, "Thai_saraaa": XK_Thai_saraaa, "Thai_saraam": XK_Thai_saraam, "Thai_sarai": XK_Thai_sarai, "Thai_saraii": XK_Thai_saraii, "Thai_saraue": XK_Thai_saraue, "Thai_sarauee": XK_Thai_sarauee, "Thai_sarau": XK_Thai_sarau, "Thai_sarauu": XK_Thai_sarauu, "Thai_phinthu": XK_Thai_phinthu, "Thai_maihanakat_maitho": XK_Thai_maihanakat_maitho, "Thai_baht": XK_Thai_baht, "Thai_sarae": XK_Thai_sarae, "Thai_saraae": XK_Thai_saraae, "Thai_sarao": XK_Thai_sarao, "Thai_saraaimaimuan": XK_Thai_saraaimaimuan, "Thai_saraaimaimalai": XK_Thai_saraaimaimalai, "Thai_lakkhangyao": XK_Thai_lakkhangyao, "Thai_maiyamok": XK_Thai_maiyamok, "Thai_maitaikhu": XK_Thai_maitaikhu, "Thai_maiek": XK_Thai_maiek, "Thai_maitho": XK_Thai_maitho, "Thai_maitri": XK_Thai_maitri, "Thai_maichattawa": XK_Thai_maichattawa, "Thai_thanthakhat": XK_Thai_thanthakhat, "Thai_nikhahit": XK_Thai_nikhahit, "Thai_leksun": XK_Thai_leksun, "Thai_leknung": XK_Thai_leknung, "Thai_leksong": XK_Thai_leksong, "Thai_leksam": XK_Thai_leksam, "Thai_leksi": XK_Thai_leksi, "Thai_lekha": XK_Thai_lekha, "Thai_lekhok": XK_Thai_lekhok, "Thai_lekchet": XK_Thai_lekchet, "Thai_lekpaet": XK_Thai_lekpaet, "Thai_lekkao": XK_Thai_lekkao, "Hangul": XK_Hangul, "Hangul_Start": XK_Hangul_Start, "Hangul_End": XK_Hangul_End, "Hangul_Hanja": XK_Hangul_Hanja, "Hangul_Jamo": XK_Hangul_Jamo, "Hangul_Romaja": XK_Hangul_Romaja, "Hangul_Codeinput": XK_Hangul_Codeinput, "Hangul_Jeonja": XK_Hangul_Jeonja, "Hangul_Banja": XK_Hangul_Banja, "Hangul_PreHanja": XK_Hangul_PreHanja, "Hangul_PostHanja": XK_Hangul_PostHanja, "Hangul_SingleCandidate": XK_Hangul_SingleCandidate, "Hangul_MultipleCandidate": XK_Hangul_MultipleCandidate, "Hangul_PreviousCandidate": XK_Hangul_PreviousCandidate, "Hangul_Special": XK_Hangul_Special, "Hangul_switch": XK_Hangul_switch, "Hangul_Kiyeog": XK_Hangul_Kiyeog, "Hangul_SsangKiyeog": XK_Hangul_SsangKiyeog, "Hangul_KiyeogSios": XK_Hangul_KiyeogSios, "Hangul_Nieun": XK_Hangul_Nieun, "Hangul_NieunJieuj": XK_Hangul_NieunJieuj, "Hangul_NieunHieuh": XK_Hangul_NieunHieuh, "Hangul_Dikeud": XK_Hangul_Dikeud, "Hangul_SsangDikeud": XK_Hangul_SsangDikeud, "Hangul_Rieul": XK_Hangul_Rieul, "Hangul_RieulKiyeog": XK_Hangul_RieulKiyeog, "Hangul_RieulMieum": XK_Hangul_RieulMieum, "Hangul_RieulPieub": XK_Hangul_RieulPieub, "Hangul_RieulSios": XK_Hangul_RieulSios, "Hangul_RieulTieut": XK_Hangul_RieulTieut, "Hangul_RieulPhieuf": XK_Hangul_RieulPhieuf, "Hangul_RieulHieuh": XK_Hangul_RieulHieuh, "Hangul_Mieum": XK_Hangul_Mieum, "Hangul_Pieub": XK_Hangul_Pieub, "Hangul_SsangPieub": XK_Hangul_SsangPieub, "Hangul_PieubSios": XK_Hangul_PieubSios, "Hangul_Sios": XK_Hangul_Sios, "Hangul_SsangSios": XK_Hangul_SsangSios, "Hangul_Ieung": XK_Hangul_Ieung, "Hangul_Jieuj": XK_Hangul_Jieuj, "Hangul_SsangJieuj": XK_Hangul_SsangJieuj, "Hangul_Cieuc": XK_Hangul_Cieuc, "Hangul_Khieuq": XK_Hangul_Khieuq, "Hangul_Tieut": XK_Hangul_Tieut, "Hangul_Phieuf": XK_Hangul_Phieuf, "Hangul_Hieuh": XK_Hangul_Hieuh, "Hangul_A": XK_Hangul_A, "Hangul_AE": XK_Hangul_AE, "Hangul_YA": XK_Hangul_YA, "Hangul_YAE": XK_Hangul_YAE, "Hangul_EO": XK_Hangul_EO, "Hangul_E": XK_Hangul_E, "Hangul_YEO": XK_Hangul_YEO, "Hangul_YE": XK_Hangul_YE, "Hangul_O": XK_Hangul_O, "Hangul_WA": XK_Hangul_WA, "Hangul_WAE": XK_Hangul_WAE, "Hangul_OE": XK_Hangul_OE, "Hangul_YO": XK_Hangul_YO, "Hangul_U": XK_Hangul_U, "Hangul_WEO": XK_Hangul_WEO, "Hangul_WE": XK_Hangul_WE, "Hangul_WI": XK_Hangul_WI, "Hangul_YU": XK_Hangul_YU, "Hangul_EU": XK_Hangul_EU, "Hangul_YI": XK_Hangul_YI, "Hangul_I": XK_Hangul_I, "Hangul_J_Kiyeog": XK_Hangul_J_Kiyeog, "Hangul_J_SsangKiyeog": XK_Hangul_J_SsangKiyeog, "Hangul_J_KiyeogSios": XK_Hangul_J_KiyeogSios, "Hangul_J_Nieun": XK_Hangul_J_Nieun, "Hangul_J_NieunJieuj": XK_Hangul_J_NieunJieuj, "Hangul_J_NieunHieuh": XK_Hangul_J_NieunHieuh, "Hangul_J_Dikeud": XK_Hangul_J_Dikeud, "Hangul_J_Rieul": XK_Hangul_J_Rieul, "Hangul_J_RieulKiyeog": XK_Hangul_J_RieulKiyeog, "Hangul_J_RieulMieum": XK_Hangul_J_RieulMieum, "Hangul_J_RieulPieub": XK_Hangul_J_RieulPieub, "Hangul_J_RieulSios": XK_Hangul_J_RieulSios, "Hangul_J_RieulTieut": XK_Hangul_J_RieulTieut, "Hangul_J_RieulPhieuf": XK_Hangul_J_RieulPhieuf, "Hangul_J_RieulHieuh": XK_Hangul_J_RieulHieuh, "Hangul_J_Mieum": XK_Hangul_J_Mieum, "Hangul_J_Pieub": XK_Hangul_J_Pieub, "Hangul_J_PieubSios": XK_Hangul_J_PieubSios, "Hangul_J_Sios": XK_Hangul_J_Sios, "Hangul_J_SsangSios": XK_Hangul_J_SsangSios, "Hangul_J_Ieung": XK_Hangul_J_Ieung, "Hangul_J_Jieuj": XK_Hangul_J_Jieuj, "Hangul_J_Cieuc": XK_Hangul_J_Cieuc, "Hangul_J_Khieuq": XK_Hangul_J_Khieuq, "Hangul_J_Tieut": XK_Hangul_J_Tieut, "Hangul_J_Phieuf": XK_Hangul_J_Phieuf, "Hangul_J_Hieuh": XK_Hangul_J_Hieuh, "Hangul_RieulYeorinHieuh": XK_Hangul_RieulYeorinHieuh, "Hangul_SunkyeongeumMieum": XK_Hangul_SunkyeongeumMieum, "Hangul_SunkyeongeumPieub": XK_Hangul_SunkyeongeumPieub, "Hangul_PanSios": XK_Hangul_PanSios, "Hangul_KkogjiDalrinIeung": XK_Hangul_KkogjiDalrinIeung, "Hangul_SunkyeongeumPhieuf": XK_Hangul_SunkyeongeumPhieuf, "Hangul_YeorinHieuh": XK_Hangul_YeorinHieuh, "Hangul_AraeA": XK_Hangul_AraeA, "Hangul_AraeAE": XK_Hangul_AraeAE, "Hangul_J_PanSios": XK_Hangul_J_PanSios, "Hangul_J_KkogjiDalrinIeung": XK_Hangul_J_KkogjiDalrinIeung, "Hangul_J_YeorinHieuh": XK_Hangul_J_YeorinHieuh, "Korean_Won": XK_Korean_Won, "Armenian_ligature_ew": XK_Armenian_ligature_ew, "Armenian_full_stop": XK_Armenian_full_stop, "Armenian_verjaket": XK_Armenian_verjaket, "Armenian_separation_mark": XK_Armenian_separation_mark, "Armenian_but": XK_Armenian_but, "Armenian_hyphen": XK_Armenian_hyphen, "Armenian_yentamna": XK_Armenian_yentamna, "Armenian_exclam": XK_Armenian_exclam, "Armenian_amanak": XK_Armenian_amanak, "Armenian_accent": XK_Armenian_accent, "Armenian_shesht": XK_Armenian_shesht, "Armenian_question": XK_Armenian_question, "Armenian_paruyk": XK_Armenian_paruyk, "Armenian_AYB": XK_Armenian_AYB, "Armenian_ayb": XK_Armenian_ayb, "Armenian_BEN": XK_Armenian_BEN, "Armenian_ben": XK_Armenian_ben, "Armenian_GIM": XK_Armenian_GIM, "Armenian_gim": XK_Armenian_gim, "Armenian_DA": XK_Armenian_DA, "Armenian_da": XK_Armenian_da, "Armenian_YECH": XK_Armenian_YECH, "Armenian_yech": XK_Armenian_yech, "Armenian_ZA": XK_Armenian_ZA, "Armenian_za": XK_Armenian_za, "Armenian_E": XK_Armenian_E, "Armenian_e": XK_Armenian_e, "Armenian_AT": XK_Armenian_AT, "Armenian_at": XK_Armenian_at, "Armenian_TO": XK_Armenian_TO, "Armenian_to": XK_Armenian_to, "Armenian_ZHE": XK_Armenian_ZHE, "Armenian_zhe": XK_Armenian_zhe, "Armenian_INI": XK_Armenian_INI, "Armenian_ini": XK_Armenian_ini, "Armenian_LYUN": XK_Armenian_LYUN, "Armenian_lyun": XK_Armenian_lyun, "Armenian_KHE": XK_Armenian_KHE, "Armenian_khe": XK_Armenian_khe, "Armenian_TSA": XK_Armenian_TSA, "Armenian_tsa": XK_Armenian_tsa, "Armenian_KEN": XK_Armenian_KEN, "Armenian_ken": XK_Armenian_ken, "Armenian_HO": XK_Armenian_HO, "Armenian_ho": XK_Armenian_ho, "Armenian_DZA": XK_Armenian_DZA, "Armenian_dza": XK_Armenian_dza, "Armenian_GHAT": XK_Armenian_GHAT, "Armenian_ghat": XK_Armenian_ghat, "Armenian_TCHE": XK_Armenian_TCHE, "Armenian_tche": XK_Armenian_tche, "Armenian_MEN": XK_Armenian_MEN, "Armenian_men": XK_Armenian_men, "Armenian_HI": XK_Armenian_HI, "Armenian_hi": XK_Armenian_hi, "Armenian_NU": XK_Armenian_NU, "Armenian_nu": XK_Armenian_nu, "Armenian_SHA": XK_Armenian_SHA, "Armenian_sha": XK_Armenian_sha, "Armenian_VO": XK_Armenian_VO, "Armenian_vo": XK_Armenian_vo, "Armenian_CHA": XK_Armenian_CHA, "Armenian_cha": XK_Armenian_cha, "Armenian_PE": XK_Armenian_PE, "Armenian_pe": XK_Armenian_pe, "Armenian_JE": XK_Armenian_JE, "Armenian_je": XK_Armenian_je, "Armenian_RA": XK_Armenian_RA, "Armenian_ra": XK_Armenian_ra, "Armenian_SE": XK_Armenian_SE, "Armenian_se": XK_Armenian_se, "Armenian_VEV": XK_Armenian_VEV, "Armenian_vev": XK_Armenian_vev, "Armenian_TYUN": XK_Armenian_TYUN, "Armenian_tyun": XK_Armenian_tyun, "Armenian_RE": XK_Armenian_RE, "Armenian_re": XK_Armenian_re, "Armenian_TSO": XK_Armenian_TSO, "Armenian_tso": XK_Armenian_tso, "Armenian_VYUN": XK_Armenian_VYUN, "Armenian_vyun": XK_Armenian_vyun, "Armenian_PYUR": XK_Armenian_PYUR, "Armenian_pyur": XK_Armenian_pyur, "Armenian_KE": XK_Armenian_KE, "Armenian_ke": XK_Armenian_ke, "Armenian_O": XK_Armenian_O, "Armenian_o": XK_Armenian_o, "Armenian_FE": XK_Armenian_FE, "Armenian_fe": XK_Armenian_fe, "Armenian_apostrophe": XK_Armenian_apostrophe, "Georgian_an": XK_Georgian_an, "Georgian_ban": XK_Georgian_ban, "Georgian_gan": XK_Georgian_gan, "Georgian_don": XK_Georgian_don, "Georgian_en": XK_Georgian_en, "Georgian_vin": XK_Georgian_vin, "Georgian_zen": XK_Georgian_zen, "Georgian_tan": XK_Georgian_tan, "Georgian_in": XK_Georgian_in, "Georgian_kan": XK_Georgian_kan, "Georgian_las": XK_Georgian_las, "Georgian_man": XK_Georgian_man, "Georgian_nar": XK_Georgian_nar, "Georgian_on": XK_Georgian_on, "Georgian_par": XK_Georgian_par, "Georgian_zhar": XK_Georgian_zhar, "Georgian_rae": XK_Georgian_rae, "Georgian_san": XK_Georgian_san, "Georgian_tar": XK_Georgian_tar, "Georgian_un": XK_Georgian_un, "Georgian_phar": XK_Georgian_phar, "Georgian_khar": XK_Georgian_khar, "Georgian_ghan": XK_Georgian_ghan, "Georgian_qar": XK_Georgian_qar, "Georgian_shin": XK_Georgian_shin, "Georgian_chin": XK_Georgian_chin, "Georgian_can": XK_Georgian_can, "Georgian_jil": XK_Georgian_jil, "Georgian_cil": XK_Georgian_cil, "Georgian_char": XK_Georgian_char, "Georgian_xan": XK_Georgian_xan, "Georgian_jhan": XK_Georgian_jhan, "Georgian_hae": XK_Georgian_hae, "Georgian_he": XK_Georgian_he, "Georgian_hie": XK_Georgian_hie, "Georgian_we": XK_Georgian_we, "Georgian_har": XK_Georgian_har, "Georgian_hoe": XK_Georgian_hoe, "Georgian_fi": XK_Georgian_fi, "Xabovedot": XK_Xabovedot, "Ibreve": XK_Ibreve, "Zstroke": XK_Zstroke, "Gcaron": XK_Gcaron, "Ocaron": XK_Ocaron, "Obarred": XK_Obarred, "xabovedot": XK_xabovedot, "ibreve": XK_ibreve, "zstroke": XK_zstroke, "gcaron": XK_gcaron, "ocaron": XK_ocaron, "obarred": XK_obarred, "SCHWA": XK_SCHWA, "schwa": XK_schwa, "EZH": XK_EZH, "ezh": XK_ezh, "Lbelowdot": XK_Lbelowdot, "lbelowdot": XK_lbelowdot, "Abelowdot": XK_Abelowdot, "abelowdot": XK_abelowdot, "Ahook": XK_Ahook, "ahook": XK_ahook, "Acircumflexacute": XK_Acircumflexacute, "acircumflexacute": XK_acircumflexacute, "Acircumflexgrave": XK_Acircumflexgrave, "acircumflexgrave": XK_acircumflexgrave, "Acircumflexhook": XK_Acircumflexhook, "acircumflexhook": XK_acircumflexhook, "Acircumflextilde": XK_Acircumflextilde, "acircumflextilde": XK_acircumflextilde, "Acircumflexbelowdot": XK_Acircumflexbelowdot, "acircumflexbelowdot": XK_acircumflexbelowdot, "Abreveacute": XK_Abreveacute, "abreveacute": XK_abreveacute, "Abrevegrave": XK_Abrevegrave, "abrevegrave": XK_abrevegrave, "Abrevehook": XK_Abrevehook, "abrevehook": XK_abrevehook, "Abrevetilde": XK_Abrevetilde, "abrevetilde": XK_abrevetilde, "Abrevebelowdot": XK_Abrevebelowdot, "abrevebelowdot": XK_abrevebelowdot, "Ebelowdot": XK_Ebelowdot, "ebelowdot": XK_ebelowdot, "Ehook": XK_Ehook, "ehook": XK_ehook, "Etilde": XK_Etilde, "etilde": XK_etilde, "Ecircumflexacute": XK_Ecircumflexacute, "ecircumflexacute": XK_ecircumflexacute, "Ecircumflexgrave": XK_Ecircumflexgrave, "ecircumflexgrave": XK_ecircumflexgrave, "Ecircumflexhook": XK_Ecircumflexhook, "ecircumflexhook": XK_ecircumflexhook, "Ecircumflextilde": XK_Ecircumflextilde, "ecircumflextilde": XK_ecircumflextilde, "Ecircumflexbelowdot": XK_Ecircumflexbelowdot, "ecircumflexbelowdot": XK_ecircumflexbelowdot, "Ihook": XK_Ihook, "ihook": XK_ihook, "Ibelowdot": XK_Ibelowdot, "ibelowdot": XK_ibelowdot, "Obelowdot": XK_Obelowdot, "obelowdot": XK_obelowdot, "Ohook": XK_Ohook, "ohook": XK_ohook, "Ocircumflexacute": XK_Ocircumflexacute, "ocircumflexacute": XK_ocircumflexacute, "Ocircumflexgrave": XK_Ocircumflexgrave, "ocircumflexgrave": XK_ocircumflexgrave, "Ocircumflexhook": XK_Ocircumflexhook, "ocircumflexhook": XK_ocircumflexhook, "Ocircumflextilde": XK_Ocircumflextilde, "ocircumflextilde": XK_ocircumflextilde, "Ocircumflexbelowdot": XK_Ocircumflexbelowdot, "ocircumflexbelowdot": XK_ocircumflexbelowdot, "Ohornacute": XK_Ohornacute, "ohornacute": XK_ohornacute, "Ohorngrave": XK_Ohorngrave, "ohorngrave": XK_ohorngrave, "Ohornhook": XK_Ohornhook, "ohornhook": XK_ohornhook, "Ohorntilde": XK_Ohorntilde, "ohorntilde": XK_ohorntilde, "Ohornbelowdot": XK_Ohornbelowdot, "ohornbelowdot": XK_ohornbelowdot, "Ubelowdot": XK_Ubelowdot, "ubelowdot": XK_ubelowdot, "Uhook": XK_Uhook, "uhook": XK_uhook, "Uhornacute": XK_Uhornacute, "uhornacute": XK_uhornacute, "Uhorngrave": XK_Uhorngrave, "uhorngrave": XK_uhorngrave, "Uhornhook": XK_Uhornhook, "uhornhook": XK_uhornhook, "Uhorntilde": XK_Uhorntilde, "uhorntilde": XK_uhorntilde, "Uhornbelowdot": XK_Uhornbelowdot, "uhornbelowdot": XK_uhornbelowdot, "Ybelowdot": XK_Ybelowdot, "ybelowdot": XK_ybelowdot, "Yhook": XK_Yhook, "yhook": XK_yhook, "Ytilde": XK_Ytilde, "ytilde": XK_ytilde, "Ohorn": XK_Ohorn, "ohorn": XK_ohorn, "Uhorn": XK_Uhorn, "uhorn": XK_uhorn, "EcuSign": XK_EcuSign, "ColonSign": XK_ColonSign, "CruzeiroSign": XK_CruzeiroSign, "FFrancSign": XK_FFrancSign, "LiraSign": XK_LiraSign, "MillSign": XK_MillSign, "NairaSign": XK_NairaSign, "PesetaSign": XK_PesetaSign, "RupeeSign": XK_RupeeSign, "WonSign": XK_WonSign, "NewSheqelSign": XK_NewSheqelSign, "DongSign": XK_DongSign, "EuroSign": XK_EuroSign, "zerosuperior": XK_zerosuperior, "foursuperior": XK_foursuperior, "fivesuperior": XK_fivesuperior, "sixsuperior": XK_sixsuperior, "sevensuperior": XK_sevensuperior, "eightsuperior": XK_eightsuperior, "ninesuperior": XK_ninesuperior, "zerosubscript": XK_zerosubscript, "onesubscript": XK_onesubscript, "twosubscript": XK_twosubscript, "threesubscript": XK_threesubscript, "foursubscript": XK_foursubscript, "fivesubscript": XK_fivesubscript, "sixsubscript": XK_sixsubscript, "sevensubscript": XK_sevensubscript, "eightsubscript": XK_eightsubscript, "ninesubscript": XK_ninesubscript, "partdifferential": XK_partdifferential, "emptyset": XK_emptyset, "elementof": XK_elementof, "notelementof": XK_notelementof, "containsas": XK_containsas, "squareroot": XK_squareroot, "cuberoot": XK_cuberoot, "fourthroot": XK_fourthroot, "dintegral": XK_dintegral, "tintegral": XK_tintegral, "because": XK_because, "approxeq": XK_approxeq, "notapproxeq": XK_notapproxeq, "notidentical": XK_notidentical, "stricteq": XK_stricteq, "braille_dot_1": XK_braille_dot_1, "braille_dot_2": XK_braille_dot_2, "braille_dot_3": XK_braille_dot_3, "braille_dot_4": XK_braille_dot_4, "braille_dot_5": XK_braille_dot_5, "braille_dot_6": XK_braille_dot_6, "braille_dot_7": XK_braille_dot_7, "braille_dot_8": XK_braille_dot_8, "braille_dot_9": XK_braille_dot_9, "braille_dot_10": XK_braille_dot_10, "braille_blank": XK_braille_blank, "braille_dots_1": XK_braille_dots_1, "braille_dots_2": XK_braille_dots_2, "braille_dots_12": XK_braille_dots_12, "braille_dots_3": XK_braille_dots_3, "braille_dots_13": XK_braille_dots_13, "braille_dots_23": XK_braille_dots_23, "braille_dots_123": XK_braille_dots_123, "braille_dots_4": XK_braille_dots_4, "braille_dots_14": XK_braille_dots_14, "braille_dots_24": XK_braille_dots_24, "braille_dots_124": XK_braille_dots_124, "braille_dots_34": XK_braille_dots_34, "braille_dots_134": XK_braille_dots_134, "braille_dots_234": XK_braille_dots_234, "braille_dots_1234": XK_braille_dots_1234, "braille_dots_5": XK_braille_dots_5, "braille_dots_15": XK_braille_dots_15, "braille_dots_25": XK_braille_dots_25, "braille_dots_125": XK_braille_dots_125, "braille_dots_35": XK_braille_dots_35, "braille_dots_135": XK_braille_dots_135, "braille_dots_235": XK_braille_dots_235, "braille_dots_1235": XK_braille_dots_1235, "braille_dots_45": XK_braille_dots_45, "braille_dots_145": XK_braille_dots_145, "braille_dots_245": XK_braille_dots_245, "braille_dots_1245": XK_braille_dots_1245, "braille_dots_345": XK_braille_dots_345, "braille_dots_1345": XK_braille_dots_1345, "braille_dots_2345": XK_braille_dots_2345, "braille_dots_12345": XK_braille_dots_12345, "braille_dots_6": XK_braille_dots_6, "braille_dots_16": XK_braille_dots_16, "braille_dots_26": XK_braille_dots_26, "braille_dots_126": XK_braille_dots_126, "braille_dots_36": XK_braille_dots_36, "braille_dots_136": XK_braille_dots_136, "braille_dots_236": XK_braille_dots_236, "braille_dots_1236": XK_braille_dots_1236, "braille_dots_46": XK_braille_dots_46, "braille_dots_146": XK_braille_dots_146, "braille_dots_246": XK_braille_dots_246, "braille_dots_1246": XK_braille_dots_1246, "braille_dots_346": XK_braille_dots_346, "braille_dots_1346": XK_braille_dots_1346, "braille_dots_2346": XK_braille_dots_2346, "braille_dots_12346": XK_braille_dots_12346, "braille_dots_56": XK_braille_dots_56, "braille_dots_156": XK_braille_dots_156, "braille_dots_256": XK_braille_dots_256, "braille_dots_1256": XK_braille_dots_1256, "braille_dots_356": XK_braille_dots_356, "braille_dots_1356": XK_braille_dots_1356, "braille_dots_2356": XK_braille_dots_2356, "braille_dots_12356": XK_braille_dots_12356, "braille_dots_456": XK_braille_dots_456, "braille_dots_1456": XK_braille_dots_1456, "braille_dots_2456": XK_braille_dots_2456, "braille_dots_12456": XK_braille_dots_12456, "braille_dots_3456": XK_braille_dots_3456, "braille_dots_13456": XK_braille_dots_13456, "braille_dots_23456": XK_braille_dots_23456, "braille_dots_123456": XK_braille_dots_123456, "braille_dots_7": XK_braille_dots_7, "braille_dots_17": XK_braille_dots_17, "braille_dots_27": XK_braille_dots_27, "braille_dots_127": XK_braille_dots_127, "braille_dots_37": XK_braille_dots_37, "braille_dots_137": XK_braille_dots_137, "braille_dots_237": XK_braille_dots_237, "braille_dots_1237": XK_braille_dots_1237, "braille_dots_47": XK_braille_dots_47, "braille_dots_147": XK_braille_dots_147, "braille_dots_247": XK_braille_dots_247, "braille_dots_1247": XK_braille_dots_1247, "braille_dots_347": XK_braille_dots_347, "braille_dots_1347": XK_braille_dots_1347, "braille_dots_2347": XK_braille_dots_2347, "braille_dots_12347": XK_braille_dots_12347, "braille_dots_57": XK_braille_dots_57, "braille_dots_157": XK_braille_dots_157, "braille_dots_257": XK_braille_dots_257, "braille_dots_1257": XK_braille_dots_1257, "braille_dots_357": XK_braille_dots_357, "braille_dots_1357": XK_braille_dots_1357, "braille_dots_2357": XK_braille_dots_2357, "braille_dots_12357": XK_braille_dots_12357, "braille_dots_457": XK_braille_dots_457, "braille_dots_1457": XK_braille_dots_1457, "braille_dots_2457": XK_braille_dots_2457, "braille_dots_12457": XK_braille_dots_12457, "braille_dots_3457": XK_braille_dots_3457, "braille_dots_13457": XK_braille_dots_13457, "braille_dots_23457": XK_braille_dots_23457, "braille_dots_123457": XK_braille_dots_123457, "braille_dots_67": XK_braille_dots_67, "braille_dots_167": XK_braille_dots_167, "braille_dots_267": XK_braille_dots_267, "braille_dots_1267": XK_braille_dots_1267, "braille_dots_367": XK_braille_dots_367, "braille_dots_1367": XK_braille_dots_1367, "braille_dots_2367": XK_braille_dots_2367, "braille_dots_12367": XK_braille_dots_12367, "braille_dots_467": XK_braille_dots_467, "braille_dots_1467": XK_braille_dots_1467, "braille_dots_2467": XK_braille_dots_2467, "braille_dots_12467": XK_braille_dots_12467, "braille_dots_3467": XK_braille_dots_3467, "braille_dots_13467": XK_braille_dots_13467, "braille_dots_23467": XK_braille_dots_23467, "braille_dots_123467": XK_braille_dots_123467, "braille_dots_567": XK_braille_dots_567, "braille_dots_1567": XK_braille_dots_1567, "braille_dots_2567": XK_braille_dots_2567, "braille_dots_12567": XK_braille_dots_12567, "braille_dots_3567": XK_braille_dots_3567, "braille_dots_13567": XK_braille_dots_13567, "braille_dots_23567": XK_braille_dots_23567, "braille_dots_123567": XK_braille_dots_123567, "braille_dots_4567": XK_braille_dots_4567, "braille_dots_14567": XK_braille_dots_14567, "braille_dots_24567": XK_braille_dots_24567, "braille_dots_124567": XK_braille_dots_124567, "braille_dots_34567": XK_braille_dots_34567, "braille_dots_134567": XK_braille_dots_134567, "braille_dots_234567": XK_braille_dots_234567, "braille_dots_1234567": XK_braille_dots_1234567, "braille_dots_8": XK_braille_dots_8, "braille_dots_18": XK_braille_dots_18, "braille_dots_28": XK_braille_dots_28, "braille_dots_128": XK_braille_dots_128, "braille_dots_38": XK_braille_dots_38, "braille_dots_138": XK_braille_dots_138, "braille_dots_238": XK_braille_dots_238, "braille_dots_1238": XK_braille_dots_1238, "braille_dots_48": XK_braille_dots_48, "braille_dots_148": XK_braille_dots_148, "braille_dots_248": XK_braille_dots_248, "braille_dots_1248": XK_braille_dots_1248, "braille_dots_348": XK_braille_dots_348, "braille_dots_1348": XK_braille_dots_1348, "braille_dots_2348": XK_braille_dots_2348, "braille_dots_12348": XK_braille_dots_12348, "braille_dots_58": XK_braille_dots_58, "braille_dots_158": XK_braille_dots_158, "braille_dots_258": XK_braille_dots_258, "braille_dots_1258": XK_braille_dots_1258, "braille_dots_358": XK_braille_dots_358, "braille_dots_1358": XK_braille_dots_1358, "braille_dots_2358": XK_braille_dots_2358, "braille_dots_12358": XK_braille_dots_12358, "braille_dots_458": XK_braille_dots_458, "braille_dots_1458": XK_braille_dots_1458, "braille_dots_2458": XK_braille_dots_2458, "braille_dots_12458": XK_braille_dots_12458, "braille_dots_3458": XK_braille_dots_3458, "braille_dots_13458": XK_braille_dots_13458, "braille_dots_23458": XK_braille_dots_23458, "braille_dots_123458": XK_braille_dots_123458, "braille_dots_68": XK_braille_dots_68, "braille_dots_168": XK_braille_dots_168, "braille_dots_268": XK_braille_dots_268, "braille_dots_1268": XK_braille_dots_1268, "braille_dots_368": XK_braille_dots_368, "braille_dots_1368": XK_braille_dots_1368, "braille_dots_2368": XK_braille_dots_2368, "braille_dots_12368": XK_braille_dots_12368, "braille_dots_468": XK_braille_dots_468, "braille_dots_1468": XK_braille_dots_1468, "braille_dots_2468": XK_braille_dots_2468, "braille_dots_12468": XK_braille_dots_12468, "braille_dots_3468": XK_braille_dots_3468, "braille_dots_13468": XK_braille_dots_13468, "braille_dots_23468": XK_braille_dots_23468, "braille_dots_123468": XK_braille_dots_123468, "braille_dots_568": XK_braille_dots_568, "braille_dots_1568": XK_braille_dots_1568, "braille_dots_2568": XK_braille_dots_2568, "braille_dots_12568": XK_braille_dots_12568, "braille_dots_3568": XK_braille_dots_3568, "braille_dots_13568": XK_braille_dots_13568, "braille_dots_23568": XK_braille_dots_23568, "braille_dots_123568": XK_braille_dots_123568, "braille_dots_4568": XK_braille_dots_4568, "braille_dots_14568": XK_braille_dots_14568, "braille_dots_24568": XK_braille_dots_24568, "braille_dots_124568": XK_braille_dots_124568, "braille_dots_34568": XK_braille_dots_34568, "braille_dots_134568": XK_braille_dots_134568, "braille_dots_234568": XK_braille_dots_234568, "braille_dots_1234568": XK_braille_dots_1234568, "braille_dots_78": XK_braille_dots_78, "braille_dots_178": XK_braille_dots_178, "braille_dots_278": XK_braille_dots_278, "braille_dots_1278": XK_braille_dots_1278, "braille_dots_378": XK_braille_dots_378, "braille_dots_1378": XK_braille_dots_1378, "braille_dots_2378": XK_braille_dots_2378, "braille_dots_12378": XK_braille_dots_12378, "braille_dots_478": XK_braille_dots_478, "braille_dots_1478": XK_braille_dots_1478, "braille_dots_2478": XK_braille_dots_2478, "braille_dots_12478": XK_braille_dots_12478, "braille_dots_3478": XK_braille_dots_3478, "braille_dots_13478": XK_braille_dots_13478, "braille_dots_23478": XK_braille_dots_23478, "braille_dots_123478": XK_braille_dots_123478, "braille_dots_578": XK_braille_dots_578, "braille_dots_1578": XK_braille_dots_1578, "braille_dots_2578": XK_braille_dots_2578, "braille_dots_12578": XK_braille_dots_12578, "braille_dots_3578": XK_braille_dots_3578, "braille_dots_13578": XK_braille_dots_13578, "braille_dots_23578": XK_braille_dots_23578, "braille_dots_123578": XK_braille_dots_123578, "braille_dots_4578": XK_braille_dots_4578, "braille_dots_14578": XK_braille_dots_14578, "braille_dots_24578": XK_braille_dots_24578, "braille_dots_124578": XK_braille_dots_124578, "braille_dots_34578": XK_braille_dots_34578, "braille_dots_134578": XK_braille_dots_134578, "braille_dots_234578": XK_braille_dots_234578, "braille_dots_1234578": XK_braille_dots_1234578, "braille_dots_678": XK_braille_dots_678, "braille_dots_1678": XK_braille_dots_1678, "braille_dots_2678": XK_braille_dots_2678, "braille_dots_12678": XK_braille_dots_12678, "braille_dots_3678": XK_braille_dots_3678, "braille_dots_13678": XK_braille_dots_13678, "braille_dots_23678": XK_braille_dots_23678, "braille_dots_123678": XK_braille_dots_123678, "braille_dots_4678": XK_braille_dots_4678, "braille_dots_14678": XK_braille_dots_14678, "braille_dots_24678": XK_braille_dots_24678, "braille_dots_124678": XK_braille_dots_124678, "braille_dots_34678": XK_braille_dots_34678, "braille_dots_134678": XK_braille_dots_134678, "braille_dots_234678": XK_braille_dots_234678, "braille_dots_1234678": XK_braille_dots_1234678, "braille_dots_5678": XK_braille_dots_5678, "braille_dots_15678": XK_braille_dots_15678, "braille_dots_25678": XK_braille_dots_25678, "braille_dots_125678": XK_braille_dots_125678, "braille_dots_35678": XK_braille_dots_35678, "braille_dots_135678": XK_braille_dots_135678, "braille_dots_235678": XK_braille_dots_235678, "braille_dots_1235678": XK_braille_dots_1235678, "braille_dots_45678": XK_braille_dots_45678, "braille_dots_145678": XK_braille_dots_145678, "braille_dots_245678": XK_braille_dots_245678, "braille_dots_1245678": XK_braille_dots_1245678, "braille_dots_345678": XK_braille_dots_345678, "braille_dots_1345678": XK_braille_dots_1345678, "braille_dots_2345678": XK_braille_dots_2345678, "braille_dots_12345678": XK_braille_dots_12345678, "Sinh_ng": XK_Sinh_ng, "Sinh_h2": XK_Sinh_h2, "Sinh_a": XK_Sinh_a, "Sinh_aa": XK_Sinh_aa, "Sinh_ae": XK_Sinh_ae, "Sinh_aee": XK_Sinh_aee, "Sinh_i": XK_Sinh_i, "Sinh_ii": XK_Sinh_ii, "Sinh_u": XK_Sinh_u, "Sinh_uu": XK_Sinh_uu, "Sinh_ri": XK_Sinh_ri, "Sinh_rii": XK_Sinh_rii, "Sinh_lu": XK_Sinh_lu, "Sinh_luu": XK_Sinh_luu, "Sinh_e": XK_Sinh_e, "Sinh_ee": XK_Sinh_ee, "Sinh_ai": XK_Sinh_ai, "Sinh_o": XK_Sinh_o, "Sinh_oo": XK_Sinh_oo, "Sinh_au": XK_Sinh_au, "Sinh_ka": XK_Sinh_ka, "Sinh_kha": XK_Sinh_kha, "Sinh_ga": XK_Sinh_ga, "Sinh_gha": XK_Sinh_gha, "Sinh_ng2": XK_Sinh_ng2, "Sinh_nga": XK_Sinh_nga, "Sinh_ca": XK_Sinh_ca, "Sinh_cha": XK_Sinh_cha, "Sinh_ja": XK_Sinh_ja, "Sinh_jha": XK_Sinh_jha, "Sinh_nya": XK_Sinh_nya, "Sinh_jnya": XK_Sinh_jnya, "Sinh_nja": XK_Sinh_nja, "Sinh_tta": XK_Sinh_tta, "Sinh_ttha": XK_Sinh_ttha, "Sinh_dda": XK_Sinh_dda, "Sinh_ddha": XK_Sinh_ddha, "Sinh_nna": XK_Sinh_nna, "Sinh_ndda": XK_Sinh_ndda, "Sinh_tha": XK_Sinh_tha, "Sinh_thha": XK_Sinh_thha, "Sinh_dha": XK_Sinh_dha, "Sinh_dhha": XK_Sinh_dhha, "Sinh_na": XK_Sinh_na, "Sinh_ndha": XK_Sinh_ndha, "Sinh_pa": XK_Sinh_pa, "Sinh_pha": XK_Sinh_pha, "Sinh_ba": XK_Sinh_ba, "Sinh_bha": XK_Sinh_bha, "Sinh_ma": XK_Sinh_ma, "Sinh_mba": XK_Sinh_mba, "Sinh_ya": XK_Sinh_ya, "Sinh_ra": XK_Sinh_ra, "Sinh_la": XK_Sinh_la, "Sinh_va": XK_Sinh_va, "Sinh_sha": XK_Sinh_sha, "Sinh_ssha": XK_Sinh_ssha, "Sinh_sa": XK_Sinh_sa, "Sinh_ha": XK_Sinh_ha, "Sinh_lla": XK_Sinh_lla, "Sinh_fa": XK_Sinh_fa, "Sinh_al": XK_Sinh_al, "Sinh_aa2": XK_Sinh_aa2, "Sinh_ae2": XK_Sinh_ae2, "Sinh_aee2": XK_Sinh_aee2, "Sinh_i2": XK_Sinh_i2, "Sinh_ii2": XK_Sinh_ii2, "Sinh_u2": XK_Sinh_u2, "Sinh_uu2": XK_Sinh_uu2, "Sinh_ru2": XK_Sinh_ru2, "Sinh_e2": XK_Sinh_e2, "Sinh_ee2": XK_Sinh_ee2, "Sinh_ai2": XK_Sinh_ai2, "Sinh_o2": XK_Sinh_o2, "Sinh_oo2": XK_Sinh_oo2, "Sinh_au2": XK_Sinh_au2, "Sinh_lu2": XK_Sinh_lu2, "Sinh_ruu2": XK_Sinh_ruu2, "Sinh_luu2": XK_Sinh_luu2, "Sinh_kunddaliya": XK_Sinh_kunddaliya, "XF86ModeLock": XF86XK_ModeLock, "XF86MonBrightnessUp": XF86XK_MonBrightnessUp, "XF86MonBrightnessDown": XF86XK_MonBrightnessDown, "XF86KbdLightOnOff": XF86XK_KbdLightOnOff, "XF86KbdBrightnessUp": XF86XK_KbdBrightnessUp, "XF86KbdBrightnessDown": XF86XK_KbdBrightnessDown, "XF86Standby": XF86XK_Standby, "XF86AudioLowerVolume": XF86XK_AudioLowerVolume, "XF86AudioMute": XF86XK_AudioMute, "XF86AudioRaiseVolume": XF86XK_AudioRaiseVolume, "XF86AudioPlay": XF86XK_AudioPlay, "XF86AudioStop": XF86XK_AudioStop, "XF86AudioPrev": XF86XK_AudioPrev, "XF86AudioNext": XF86XK_AudioNext, "XF86HomePage": XF86XK_HomePage, "XF86Mail": XF86XK_Mail, "XF86Start": XF86XK_Start, "XF86Search": XF86XK_Search, "XF86AudioRecord": XF86XK_AudioRecord, "XF86Calculator": XF86XK_Calculator, "XF86Memo": XF86XK_Memo, "XF86ToDoList": XF86XK_ToDoList, "XF86Calendar": XF86XK_Calendar, "XF86PowerDown": XF86XK_PowerDown, "XF86ContrastAdjust": XF86XK_ContrastAdjust, "XF86RockerUp": XF86XK_RockerUp, "XF86RockerDown": XF86XK_RockerDown, "XF86RockerEnter": XF86XK_RockerEnter, "XF86Back": XF86XK_Back, "XF86Forward": XF86XK_Forward, "XF86Stop": XF86XK_Stop, "XF86Refresh": XF86XK_Refresh, "XF86PowerOff": XF86XK_PowerOff, "XF86WakeUp": XF86XK_WakeUp, "XF86Eject": XF86XK_Eject, "XF86ScreenSaver": XF86XK_ScreenSaver, "XF86WWW": XF86XK_WWW, "XF86Sleep": XF86XK_Sleep, "XF86Favorites": XF86XK_Favorites, "XF86AudioPause": XF86XK_AudioPause, "XF86AudioMedia": XF86XK_AudioMedia, "XF86MyComputer": XF86XK_MyComputer, "XF86VendorHome": XF86XK_VendorHome, "XF86LightBulb": XF86XK_LightBulb, "XF86Shop": XF86XK_Shop, "XF86History": XF86XK_History, "XF86OpenURL": XF86XK_OpenURL, "XF86AddFavorite": XF86XK_AddFavorite, "XF86HotLinks": XF86XK_HotLinks, "XF86BrightnessAdjust": XF86XK_BrightnessAdjust, "XF86Finance": XF86XK_Finance, "XF86Community": XF86XK_Community, "XF86AudioRewind": XF86XK_AudioRewind, "XF86BackForward": XF86XK_BackForward, "XF86Launch0": XF86XK_Launch0, "XF86Launch1": XF86XK_Launch1, "XF86Launch2": XF86XK_Launch2, "XF86Launch3": XF86XK_Launch3, "XF86Launch4": XF86XK_Launch4, "XF86Launch5": XF86XK_Launch5, "XF86Launch6": XF86XK_Launch6, "XF86Launch7": XF86XK_Launch7, "XF86Launch8": XF86XK_Launch8, "XF86Launch9": XF86XK_Launch9, "XF86LaunchA": XF86XK_LaunchA, "XF86LaunchB": XF86XK_LaunchB, "XF86LaunchC": XF86XK_LaunchC, "XF86LaunchD": XF86XK_LaunchD, "XF86LaunchE": XF86XK_LaunchE, "XF86LaunchF": XF86XK_LaunchF, "XF86ApplicationLeft": XF86XK_ApplicationLeft, "XF86ApplicationRight": XF86XK_ApplicationRight, "XF86Book": XF86XK_Book, "XF86CD": XF86XK_CD, "XF86Calculater": XF86XK_Calculater, "XF86Clear": XF86XK_Clear, "XF86Close": XF86XK_Close, "XF86Copy": XF86XK_Copy, "XF86Cut": XF86XK_Cut, "XF86Display": XF86XK_Display, "XF86DOS": XF86XK_DOS, "XF86Documents": XF86XK_Documents, "XF86Excel": XF86XK_Excel, "XF86Explorer": XF86XK_Explorer, "XF86Game": XF86XK_Game, "XF86Go": XF86XK_Go, "XF86iTouch": XF86XK_iTouch, "XF86LogOff": XF86XK_LogOff, "XF86Market": XF86XK_Market, "XF86Meeting": XF86XK_Meeting, "XF86MenuKB": XF86XK_MenuKB, "XF86MenuPB": XF86XK_MenuPB, "XF86MySites": XF86XK_MySites, "XF86New": XF86XK_New, "XF86News": XF86XK_News, "XF86OfficeHome": XF86XK_OfficeHome, "XF86Open": XF86XK_Open, "XF86Option": XF86XK_Option, "XF86Paste": XF86XK_Paste, "XF86Phone": XF86XK_Phone, "XF86Q": XF86XK_Q, "XF86Reply": XF86XK_Reply, "XF86Reload": XF86XK_Reload, "XF86RotateWindows": XF86XK_RotateWindows, "XF86RotationPB": XF86XK_RotationPB, "XF86RotationKB": XF86XK_RotationKB, "XF86Save": XF86XK_Save, "XF86ScrollUp": XF86XK_ScrollUp, "XF86ScrollDown": XF86XK_ScrollDown, "XF86ScrollClick": XF86XK_ScrollClick, "XF86Send": XF86XK_Send, "XF86Spell": XF86XK_Spell, "XF86SplitScreen": XF86XK_SplitScreen, "XF86Support": XF86XK_Support, "XF86TaskPane": XF86XK_TaskPane, "XF86Terminal": XF86XK_Terminal, "XF86Tools": XF86XK_Tools, "XF86Travel": XF86XK_Travel, "XF86UserPB": XF86XK_UserPB, "XF86User1KB": XF86XK_User1KB, "XF86User2KB": XF86XK_User2KB, "XF86Video": XF86XK_Video, "XF86WheelButton": XF86XK_WheelButton, "XF86Word": XF86XK_Word, "XF86Xfer": XF86XK_Xfer, "XF86ZoomIn": XF86XK_ZoomIn, "XF86ZoomOut": XF86XK_ZoomOut, "XF86Away": XF86XK_Away, "XF86Messenger": XF86XK_Messenger, "XF86WebCam": XF86XK_WebCam, "XF86MailForward": XF86XK_MailForward, "XF86Pictures": XF86XK_Pictures, "XF86Music": XF86XK_Music, "XF86Battery": XF86XK_Battery, "XF86Bluetooth": XF86XK_Bluetooth, "XF86WLAN": XF86XK_WLAN, "XF86UWB": XF86XK_UWB, "XF86AudioForward": XF86XK_AudioForward, "XF86AudioRepeat": XF86XK_AudioRepeat, "XF86AudioRandomPlay": XF86XK_AudioRandomPlay, "XF86Subtitle": XF86XK_Subtitle, "XF86AudioCycleTrack": XF86XK_AudioCycleTrack, "XF86CycleAngle": XF86XK_CycleAngle, "XF86FrameBack": XF86XK_FrameBack, "XF86FrameForward": XF86XK_FrameForward, "XF86Time": XF86XK_Time, "XF86Select": XF86XK_Select, "XF86View": XF86XK_View, "XF86TopMenu": XF86XK_TopMenu, "XF86Red": XF86XK_Red, "XF86Green": XF86XK_Green, "XF86Yellow": XF86XK_Yellow, "XF86Blue": XF86XK_Blue, "XF86Suspend": XF86XK_Suspend, "XF86Hibernate": XF86XK_Hibernate, "XF86TouchpadToggle": XF86XK_TouchpadToggle, "XF86TouchpadOn": XF86XK_TouchpadOn, "XF86TouchpadOff": XF86XK_TouchpadOff, "XF86AudioMicMute": XF86XK_AudioMicMute, "XF86Keyboard": XF86XK_Keyboard, "XF86WWAN": XF86XK_WWAN, "XF86RFKill": XF86XK_RFKill, "XF86AudioPreset": XF86XK_AudioPreset, "XF86Switch_VT_1": XF86XK_Switch_VT_1, "XF86Switch_VT_2": XF86XK_Switch_VT_2, "XF86Switch_VT_3": XF86XK_Switch_VT_3, "XF86Switch_VT_4": XF86XK_Switch_VT_4, "XF86Switch_VT_5": XF86XK_Switch_VT_5, "XF86Switch_VT_6": XF86XK_Switch_VT_6, "XF86Switch_VT_7": XF86XK_Switch_VT_7, "XF86Switch_VT_8": XF86XK_Switch_VT_8, "XF86Switch_VT_9": XF86XK_Switch_VT_9, "XF86Switch_VT_10": XF86XK_Switch_VT_10, "XF86Switch_VT_11": XF86XK_Switch_VT_11, "XF86Switch_VT_12": XF86XK_Switch_VT_12, "XF86Ungrab": XF86XK_Ungrab, "XF86ClearGrab": XF86XK_ClearGrab, "XF86Next_VMode": XF86XK_Next_VMode, "XF86Prev_VMode": XF86XK_Prev_VMode, "XF86LogWindowTree": XF86XK_LogWindowTree, "XF86LogGrabInfo": XF86XK_LogGrabInfo, } var KeysymVisibleCharMap = map[x.Keysym]rune{ XK_space: '\u0020', // XK_exclam: '\u0021', // ! XK_quotedbl: '\u0022', // " XK_numbersign: '\u0023', // # XK_dollar: '\u0024', // $ XK_percent: '\u0025', // % XK_ampersand: '\u0026', // & XK_apostrophe: '\u0027', // ' XK_parenleft: '\u0028', // ( XK_parenright: '\u0029', // ) XK_asterisk: '\u002a', // * XK_plus: '\u002b', // + XK_comma: '\u002c', // , XK_minus: '\u002d', // - XK_period: '\u002e', // . XK_slash: '\u002f', // / XK_0: '\u0030', // 0 XK_1: '\u0031', // 1 XK_2: '\u0032', // 2 XK_3: '\u0033', // 3 XK_4: '\u0034', // 4 XK_5: '\u0035', // 5 XK_6: '\u0036', // 6 XK_7: '\u0037', // 7 XK_8: '\u0038', // 8 XK_9: '\u0039', // 9 XK_colon: '\u003a', // : XK_semicolon: '\u003b', // ; XK_less: '\u003c', // < XK_equal: '\u003d', // = XK_greater: '\u003e', // > XK_question: '\u003f', // ? XK_at: '\u0040', // @ XK_A: '\u0041', // A XK_B: '\u0042', // B XK_C: '\u0043', // C XK_D: '\u0044', // D XK_E: '\u0045', // E XK_F: '\u0046', // F XK_G: '\u0047', // G XK_H: '\u0048', // H XK_I: '\u0049', // I XK_J: '\u004a', // J XK_K: '\u004b', // K XK_L: '\u004c', // L XK_M: '\u004d', // M XK_N: '\u004e', // N XK_O: '\u004f', // O XK_P: '\u0050', // P XK_Q: '\u0051', // Q XK_R: '\u0052', // R XK_S: '\u0053', // S XK_T: '\u0054', // T XK_U: '\u0055', // U XK_V: '\u0056', // V XK_W: '\u0057', // W XK_X: '\u0058', // X XK_Y: '\u0059', // Y XK_Z: '\u005a', // Z XK_bracketleft: '\u005b', // [ XK_backslash: '\u005c', // \ XK_bracketright: '\u005d', // ] XK_asciicircum: '\u005e', // ^ XK_underscore: '\u005f', // _ XK_grave: '\u0060', // ` XK_a: '\u0061', // a XK_b: '\u0062', // b XK_c: '\u0063', // c XK_d: '\u0064', // d XK_e: '\u0065', // e XK_f: '\u0066', // f XK_g: '\u0067', // g XK_h: '\u0068', // h XK_i: '\u0069', // i XK_j: '\u006a', // j XK_k: '\u006b', // k XK_l: '\u006c', // l XK_m: '\u006d', // m XK_n: '\u006e', // n XK_o: '\u006f', // o XK_p: '\u0070', // p XK_q: '\u0071', // q XK_r: '\u0072', // r XK_s: '\u0073', // s XK_t: '\u0074', // t XK_u: '\u0075', // u XK_v: '\u0076', // v XK_w: '\u0077', // w XK_x: '\u0078', // x XK_y: '\u0079', // y XK_z: '\u007a', // z XK_braceleft: '\u007b', // { XK_bar: '\u007c', // | XK_braceright: '\u007d', // } XK_asciitilde: '\u007e', // ~ XK_nobreakspace: '\u00a0', // XK_exclamdown: '\u00a1', // ¡ XK_cent: '\u00a2', // ¢ XK_sterling: '\u00a3', // £ XK_currency: '\u00a4', // ¤ XK_yen: '\u00a5', // ¥ XK_brokenbar: '\u00a6', // ¦ XK_section: '\u00a7', // § XK_diaeresis: '\u00a8', // ¨ XK_copyright: '\u00a9', // © XK_ordfeminine: '\u00aa', // ª XK_guillemotleft: '\u00ab', // « XK_notsign: '\u00ac', // ¬ XK_hyphen: '\u00ad', // ­ XK_registered: '\u00ae', // ® XK_macron: '\u00af', // ¯ XK_degree: '\u00b0', // ° XK_plusminus: '\u00b1', // ± XK_twosuperior: '\u00b2', // ² XK_threesuperior: '\u00b3', // ³ XK_acute: '\u00b4', // ´ XK_mu: '\u00b5', // µ XK_paragraph: '\u00b6', // ¶ XK_periodcentered: '\u00b7', // · XK_cedilla: '\u00b8', // ¸ XK_onesuperior: '\u00b9', // ¹ XK_masculine: '\u00ba', // º XK_guillemotright: '\u00bb', // » XK_onequarter: '\u00bc', // ¼ XK_onehalf: '\u00bd', // ½ XK_threequarters: '\u00be', // ¾ XK_questiondown: '\u00bf', // ¿ XK_Agrave: '\u00c0', // À XK_Aacute: '\u00c1', // Á XK_Acircumflex: '\u00c2', //  XK_Atilde: '\u00c3', // à XK_Adiaeresis: '\u00c4', // Ä XK_Aring: '\u00c5', // Å XK_AE: '\u00c6', // Æ XK_Ccedilla: '\u00c7', // Ç XK_Egrave: '\u00c8', // È XK_Eacute: '\u00c9', // É XK_Ecircumflex: '\u00ca', // Ê XK_Ediaeresis: '\u00cb', // Ë XK_Igrave: '\u00cc', // Ì XK_Iacute: '\u00cd', // Í XK_Icircumflex: '\u00ce', // Î XK_Idiaeresis: '\u00cf', // Ï XK_ETH: '\u00d0', // Ð XK_Ntilde: '\u00d1', // Ñ XK_Ograve: '\u00d2', // Ò XK_Oacute: '\u00d3', // Ó XK_Ocircumflex: '\u00d4', // Ô XK_Otilde: '\u00d5', // Õ XK_Odiaeresis: '\u00d6', // Ö XK_multiply: '\u00d7', // × XK_Oslash: '\u00d8', // Ø // XK_Ooblique == XK_Oslash # U+00D8 LATIN CAPITAL LETTER O WITH STROKE XK_Ugrave: '\u00d9', // Ù XK_Uacute: '\u00da', // Ú XK_Ucircumflex: '\u00db', // Û XK_Udiaeresis: '\u00dc', // Ü XK_Yacute: '\u00dd', // Ý XK_THORN: '\u00de', // Þ XK_ssharp: '\u00df', // ß XK_agrave: '\u00e0', // à XK_aacute: '\u00e1', // á XK_acircumflex: '\u00e2', // â XK_atilde: '\u00e3', // ã XK_adiaeresis: '\u00e4', // ä XK_aring: '\u00e5', // å XK_ae: '\u00e6', // æ XK_ccedilla: '\u00e7', // ç XK_egrave: '\u00e8', // è XK_eacute: '\u00e9', // é XK_ecircumflex: '\u00ea', // ê XK_ediaeresis: '\u00eb', // ë XK_igrave: '\u00ec', // ì XK_iacute: '\u00ed', // í XK_icircumflex: '\u00ee', // î XK_idiaeresis: '\u00ef', // ï XK_eth: '\u00f0', // ð XK_ntilde: '\u00f1', // ñ XK_ograve: '\u00f2', // ò XK_oacute: '\u00f3', // ó XK_ocircumflex: '\u00f4', // ô XK_otilde: '\u00f5', // õ XK_odiaeresis: '\u00f6', // ö XK_division: '\u00f7', // ÷ XK_oslash: '\u00f8', // ø // XK_ooblique == XK_oslash # U+00F8 LATIN SMALL LETTER O WITH STROKE XK_ugrave: '\u00f9', // ù XK_uacute: '\u00fa', // ú XK_ucircumflex: '\u00fb', // û XK_udiaeresis: '\u00fc', // ü XK_yacute: '\u00fd', // ý XK_thorn: '\u00fe', // þ XK_ydiaeresis: '\u00ff', // ÿ XK_Aogonek: '\u0104', // Ą XK_breve: '\u02d8', // ˘ XK_Lstroke: '\u0141', // Ł XK_Lcaron: '\u013d', // Ľ XK_Sacute: '\u015a', // Ś XK_Scaron: '\u0160', // Š XK_Scedilla: '\u015e', // Ş XK_Tcaron: '\u0164', // Ť XK_Zacute: '\u0179', // Ź XK_Zcaron: '\u017d', // Ž XK_Zabovedot: '\u017b', // Ż XK_aogonek: '\u0105', // ą XK_ogonek: '\u02db', // ˛ XK_lstroke: '\u0142', // ł XK_lcaron: '\u013e', // ľ XK_sacute: '\u015b', // ś XK_caron: '\u02c7', // ˇ XK_scaron: '\u0161', // š XK_scedilla: '\u015f', // ş XK_tcaron: '\u0165', // ť XK_zacute: '\u017a', // ź XK_doubleacute: '\u02dd', // ˝ XK_zcaron: '\u017e', // ž XK_zabovedot: '\u017c', // ż XK_Racute: '\u0154', // Ŕ XK_Abreve: '\u0102', // Ă XK_Lacute: '\u0139', // Ĺ XK_Cacute: '\u0106', // Ć XK_Ccaron: '\u010c', // Č XK_Eogonek: '\u0118', // Ę XK_Ecaron: '\u011a', // Ě XK_Dcaron: '\u010e', // Ď XK_Dstroke: '\u0110', // Đ XK_Nacute: '\u0143', // Ń XK_Ncaron: '\u0147', // Ň XK_Odoubleacute: '\u0150', // Ő XK_Rcaron: '\u0158', // Ř XK_Uring: '\u016e', // Ů XK_Udoubleacute: '\u0170', // Ű XK_Tcedilla: '\u0162', // Ţ XK_racute: '\u0155', // ŕ XK_abreve: '\u0103', // ă XK_lacute: '\u013a', // ĺ XK_cacute: '\u0107', // ć XK_ccaron: '\u010d', // č XK_eogonek: '\u0119', // ę XK_ecaron: '\u011b', // ě XK_dcaron: '\u010f', // ď XK_dstroke: '\u0111', // đ XK_nacute: '\u0144', // ń XK_ncaron: '\u0148', // ň XK_odoubleacute: '\u0151', // ő XK_rcaron: '\u0159', // ř XK_uring: '\u016f', // ů XK_udoubleacute: '\u0171', // ű XK_tcedilla: '\u0163', // ţ XK_abovedot: '\u02d9', // ˙ XK_Hstroke: '\u0126', // Ħ XK_Hcircumflex: '\u0124', // Ĥ XK_Iabovedot: '\u0130', // İ XK_Gbreve: '\u011e', // Ğ XK_Jcircumflex: '\u0134', // Ĵ XK_hstroke: '\u0127', // ħ XK_hcircumflex: '\u0125', // ĥ XK_idotless: '\u0131', // ı XK_gbreve: '\u011f', // ğ XK_jcircumflex: '\u0135', // ĵ XK_Cabovedot: '\u010a', // Ċ XK_Ccircumflex: '\u0108', // Ĉ XK_Gabovedot: '\u0120', // Ġ XK_Gcircumflex: '\u011c', // Ĝ XK_Ubreve: '\u016c', // Ŭ XK_Scircumflex: '\u015c', // Ŝ XK_cabovedot: '\u010b', // ċ XK_ccircumflex: '\u0109', // ĉ XK_gabovedot: '\u0121', // ġ XK_gcircumflex: '\u011d', // ĝ XK_ubreve: '\u016d', // ŭ XK_scircumflex: '\u015d', // ŝ XK_kra: '\u0138', // ĸ XK_Rcedilla: '\u0156', // Ŗ XK_Itilde: '\u0128', // Ĩ XK_Lcedilla: '\u013b', // Ļ XK_Emacron: '\u0112', // Ē XK_Gcedilla: '\u0122', // Ģ XK_Tslash: '\u0166', // Ŧ XK_rcedilla: '\u0157', // ŗ XK_itilde: '\u0129', // ĩ XK_lcedilla: '\u013c', // ļ XK_emacron: '\u0113', // ē XK_gcedilla: '\u0123', // ģ XK_tslash: '\u0167', // ŧ XK_ENG: '\u014a', // Ŋ XK_eng: '\u014b', // ŋ XK_Amacron: '\u0100', // Ā XK_Iogonek: '\u012e', // Į XK_Eabovedot: '\u0116', // Ė XK_Imacron: '\u012a', // Ī XK_Ncedilla: '\u0145', // Ņ XK_Omacron: '\u014c', // Ō XK_Kcedilla: '\u0136', // Ķ XK_Uogonek: '\u0172', // Ų XK_Utilde: '\u0168', // Ũ XK_Umacron: '\u016a', // Ū XK_amacron: '\u0101', // ā XK_iogonek: '\u012f', // į XK_eabovedot: '\u0117', // ė XK_imacron: '\u012b', // ī XK_ncedilla: '\u0146', // ņ XK_omacron: '\u014d', // ō XK_kcedilla: '\u0137', // ķ XK_uogonek: '\u0173', // ų XK_utilde: '\u0169', // ũ XK_umacron: '\u016b', // ū XK_Wcircumflex: '\u0174', // Ŵ XK_wcircumflex: '\u0175', // ŵ XK_Ycircumflex: '\u0176', // Ŷ XK_ycircumflex: '\u0177', // ŷ XK_Babovedot: '\u1e02', // Ḃ XK_babovedot: '\u1e03', // ḃ XK_Dabovedot: '\u1e0a', // Ḋ XK_dabovedot: '\u1e0b', // ḋ XK_Fabovedot: '\u1e1e', // Ḟ XK_fabovedot: '\u1e1f', // ḟ XK_Mabovedot: '\u1e40', // Ṁ XK_mabovedot: '\u1e41', // ṁ XK_Pabovedot: '\u1e56', // Ṗ XK_pabovedot: '\u1e57', // ṗ XK_Sabovedot: '\u1e60', // Ṡ XK_sabovedot: '\u1e61', // ṡ XK_Tabovedot: '\u1e6a', // Ṫ XK_tabovedot: '\u1e6b', // ṫ XK_Wgrave: '\u1e80', // Ẁ XK_wgrave: '\u1e81', // ẁ XK_Wacute: '\u1e82', // Ẃ XK_wacute: '\u1e83', // ẃ XK_Wdiaeresis: '\u1e84', // Ẅ XK_wdiaeresis: '\u1e85', // ẅ XK_Ygrave: '\u1ef2', // Ỳ XK_ygrave: '\u1ef3', // ỳ XK_OE: '\u0152', // Œ XK_oe: '\u0153', // œ XK_Ydiaeresis: '\u0178', // Ÿ XK_overline: '\u203e', // ‾ XK_kana_fullstop: '\u3002', // 。 XK_kana_openingbracket: '\u300c', // 「 XK_kana_closingbracket: '\u300d', // 」 XK_kana_comma: '\u3001', // 、 XK_kana_conjunctive: '\u30fb', // ・ XK_kana_WO: '\u30f2', // ヲ XK_kana_a: '\u30a1', // ァ XK_kana_i: '\u30a3', // ィ XK_kana_u: '\u30a5', // ゥ XK_kana_e: '\u30a7', // ェ XK_kana_o: '\u30a9', // ォ XK_kana_ya: '\u30e3', // ャ XK_kana_yu: '\u30e5', // ュ XK_kana_yo: '\u30e7', // ョ XK_kana_tsu: '\u30c3', // ッ XK_prolongedsound: '\u30fc', // ー XK_kana_A: '\u30a2', // ア XK_kana_I: '\u30a4', // イ XK_kana_U: '\u30a6', // ウ XK_kana_E: '\u30a8', // エ XK_kana_O: '\u30aa', // オ XK_kana_KA: '\u30ab', // カ XK_kana_KI: '\u30ad', // キ XK_kana_KU: '\u30af', // ク XK_kana_KE: '\u30b1', // ケ XK_kana_KO: '\u30b3', // コ XK_kana_SA: '\u30b5', // サ XK_kana_SHI: '\u30b7', // シ XK_kana_SU: '\u30b9', // ス XK_kana_SE: '\u30bb', // セ XK_kana_SO: '\u30bd', // ソ XK_kana_TA: '\u30bf', // タ XK_kana_CHI: '\u30c1', // チ XK_kana_TSU: '\u30c4', // ツ XK_kana_TE: '\u30c6', // テ XK_kana_TO: '\u30c8', // ト XK_kana_NA: '\u30ca', // ナ XK_kana_NI: '\u30cb', // ニ XK_kana_NU: '\u30cc', // ヌ XK_kana_NE: '\u30cd', // ネ XK_kana_NO: '\u30ce', // ノ XK_kana_HA: '\u30cf', // ハ XK_kana_HI: '\u30d2', // ヒ XK_kana_FU: '\u30d5', // フ XK_kana_HE: '\u30d8', // ヘ XK_kana_HO: '\u30db', // ホ XK_kana_MA: '\u30de', // マ XK_kana_MI: '\u30df', // ミ XK_kana_MU: '\u30e0', // ム XK_kana_ME: '\u30e1', // メ XK_kana_MO: '\u30e2', // モ XK_kana_YA: '\u30e4', // ヤ XK_kana_YU: '\u30e6', // ユ XK_kana_YO: '\u30e8', // ヨ XK_kana_RA: '\u30e9', // ラ XK_kana_RI: '\u30ea', // リ XK_kana_RU: '\u30eb', // ル XK_kana_RE: '\u30ec', // レ XK_kana_RO: '\u30ed', // ロ XK_kana_WA: '\u30ef', // ワ XK_kana_N: '\u30f3', // ン XK_voicedsound: '\u309b', // ゛ XK_semivoicedsound: '\u309c', // ゜ XK_Farsi_0: '\u06f0', // ۰ XK_Farsi_1: '\u06f1', // ۱ XK_Farsi_2: '\u06f2', // ۲ XK_Farsi_3: '\u06f3', // ۳ XK_Farsi_4: '\u06f4', // ۴ XK_Farsi_5: '\u06f5', // ۵ XK_Farsi_6: '\u06f6', // ۶ XK_Farsi_7: '\u06f7', // ۷ XK_Farsi_8: '\u06f8', // ۸ XK_Farsi_9: '\u06f9', // ۹ XK_Arabic_percent: '\u066a', // ٪ XK_Arabic_superscript_alef: '\u0670', // ٰ XK_Arabic_tteh: '\u0679', // ٹ XK_Arabic_peh: '\u067e', // پ XK_Arabic_tcheh: '\u0686', // چ XK_Arabic_ddal: '\u0688', // ڈ XK_Arabic_rreh: '\u0691', // ڑ XK_Arabic_comma: '\u060c', // ، XK_Arabic_fullstop: '\u06d4', // ۔ XK_Arabic_0: '\u0660', // ٠ XK_Arabic_1: '\u0661', // ١ XK_Arabic_2: '\u0662', // ٢ XK_Arabic_3: '\u0663', // ٣ XK_Arabic_4: '\u0664', // ٤ XK_Arabic_5: '\u0665', // ٥ XK_Arabic_6: '\u0666', // ٦ XK_Arabic_7: '\u0667', // ٧ XK_Arabic_8: '\u0668', // ٨ XK_Arabic_9: '\u0669', // ٩ XK_Arabic_semicolon: '\u061b', // ؛ XK_Arabic_question_mark: '\u061f', // ؟ XK_Arabic_hamza: '\u0621', // ء XK_Arabic_maddaonalef: '\u0622', // آ XK_Arabic_hamzaonalef: '\u0623', // أ XK_Arabic_hamzaonwaw: '\u0624', // ؤ XK_Arabic_hamzaunderalef: '\u0625', // إ XK_Arabic_hamzaonyeh: '\u0626', // ئ XK_Arabic_alef: '\u0627', // ا XK_Arabic_beh: '\u0628', // ب XK_Arabic_tehmarbuta: '\u0629', // ة XK_Arabic_teh: '\u062a', // ت XK_Arabic_theh: '\u062b', // ث XK_Arabic_jeem: '\u062c', // ج XK_Arabic_hah: '\u062d', // ح XK_Arabic_khah: '\u062e', // خ XK_Arabic_dal: '\u062f', // د XK_Arabic_thal: '\u0630', // ذ XK_Arabic_ra: '\u0631', // ر XK_Arabic_zain: '\u0632', // ز XK_Arabic_seen: '\u0633', // س XK_Arabic_sheen: '\u0634', // ش XK_Arabic_sad: '\u0635', // ص XK_Arabic_dad: '\u0636', // ض XK_Arabic_tah: '\u0637', // ط XK_Arabic_zah: '\u0638', // ظ XK_Arabic_ain: '\u0639', // ع XK_Arabic_ghain: '\u063a', // غ XK_Arabic_tatweel: '\u0640', // ـ XK_Arabic_feh: '\u0641', // ف XK_Arabic_qaf: '\u0642', // ق XK_Arabic_kaf: '\u0643', // ك XK_Arabic_lam: '\u0644', // ل XK_Arabic_meem: '\u0645', // م XK_Arabic_noon: '\u0646', // ن XK_Arabic_ha: '\u0647', // ه XK_Arabic_waw: '\u0648', // و XK_Arabic_alefmaksura: '\u0649', // ى XK_Arabic_yeh: '\u064a', // ي XK_Arabic_fathatan: '\u064b', // ً XK_Arabic_dammatan: '\u064c', // ٌ XK_Arabic_kasratan: '\u064d', // ٍ XK_Arabic_fatha: '\u064e', // َ XK_Arabic_damma: '\u064f', // ُ XK_Arabic_kasra: '\u0650', // ِ XK_Arabic_shadda: '\u0651', // ّ XK_Arabic_sukun: '\u0652', // ْ XK_Arabic_madda_above: '\u0653', // ٓ XK_Arabic_hamza_above: '\u0654', // ٔ XK_Arabic_hamza_below: '\u0655', // ٕ XK_Arabic_jeh: '\u0698', // ژ XK_Arabic_veh: '\u06a4', // ڤ XK_Arabic_keheh: '\u06a9', // ک XK_Arabic_gaf: '\u06af', // گ XK_Arabic_noon_ghunna: '\u06ba', // ں XK_Arabic_heh_doachashmee: '\u06be', // ھ XK_Farsi_yeh: '\u06cc', // ی // XK_Arabic_farsi_yeh == XK_Farsi_yeh # U+06CC ARABIC LETTER FARSI YEH XK_Arabic_yeh_baree: '\u06d2', // ے XK_Arabic_heh_goal: '\u06c1', // ہ XK_Cyrillic_GHE_bar: '\u0492', // Ғ XK_Cyrillic_ghe_bar: '\u0493', // ғ XK_Cyrillic_ZHE_descender: '\u0496', // Җ XK_Cyrillic_zhe_descender: '\u0497', // җ XK_Cyrillic_KA_descender: '\u049a', // Қ XK_Cyrillic_ka_descender: '\u049b', // қ XK_Cyrillic_KA_vertstroke: '\u049c', // Ҝ XK_Cyrillic_ka_vertstroke: '\u049d', // ҝ XK_Cyrillic_EN_descender: '\u04a2', // Ң XK_Cyrillic_en_descender: '\u04a3', // ң XK_Cyrillic_U_straight: '\u04ae', // Ү XK_Cyrillic_u_straight: '\u04af', // ү XK_Cyrillic_U_straight_bar: '\u04b0', // Ұ XK_Cyrillic_u_straight_bar: '\u04b1', // ұ XK_Cyrillic_HA_descender: '\u04b2', // Ҳ XK_Cyrillic_ha_descender: '\u04b3', // ҳ XK_Cyrillic_CHE_descender: '\u04b6', // Ҷ XK_Cyrillic_che_descender: '\u04b7', // ҷ XK_Cyrillic_CHE_vertstroke: '\u04b8', // Ҹ XK_Cyrillic_che_vertstroke: '\u04b9', // ҹ XK_Cyrillic_SHHA: '\u04ba', // Һ XK_Cyrillic_shha: '\u04bb', // һ XK_Cyrillic_SCHWA: '\u04d8', // Ә XK_Cyrillic_schwa: '\u04d9', // ә XK_Cyrillic_I_macron: '\u04e2', // Ӣ XK_Cyrillic_i_macron: '\u04e3', // ӣ XK_Cyrillic_O_bar: '\u04e8', // Ө XK_Cyrillic_o_bar: '\u04e9', // ө XK_Cyrillic_U_macron: '\u04ee', // Ӯ XK_Cyrillic_u_macron: '\u04ef', // ӯ XK_Serbian_dje: '\u0452', // ђ XK_Macedonia_gje: '\u0453', // ѓ XK_Cyrillic_io: '\u0451', // ё XK_Ukrainian_ie: '\u0454', // є XK_Macedonia_dse: '\u0455', // ѕ XK_Ukrainian_i: '\u0456', // і XK_Ukrainian_yi: '\u0457', // ї XK_Cyrillic_je: '\u0458', // ј XK_Cyrillic_lje: '\u0459', // љ XK_Cyrillic_nje: '\u045a', // њ XK_Serbian_tshe: '\u045b', // ћ XK_Macedonia_kje: '\u045c', // ќ XK_Ukrainian_ghe_with_upturn: '\u0491', // ґ XK_Byelorussian_shortu: '\u045e', // ў XK_Cyrillic_dzhe: '\u045f', // џ XK_numerosign: '\u2116', // № XK_Serbian_DJE: '\u0402', // Ђ XK_Macedonia_GJE: '\u0403', // Ѓ XK_Cyrillic_IO: '\u0401', // Ё XK_Ukrainian_IE: '\u0404', // Є XK_Macedonia_DSE: '\u0405', // Ѕ XK_Ukrainian_I: '\u0406', // І XK_Ukrainian_YI: '\u0407', // Ї XK_Cyrillic_JE: '\u0408', // Ј XK_Cyrillic_LJE: '\u0409', // Љ XK_Cyrillic_NJE: '\u040a', // Њ XK_Serbian_TSHE: '\u040b', // Ћ XK_Macedonia_KJE: '\u040c', // Ќ XK_Ukrainian_GHE_WITH_UPTURN: '\u0490', // Ґ XK_Byelorussian_SHORTU: '\u040e', // Ў XK_Cyrillic_DZHE: '\u040f', // Џ XK_Cyrillic_yu: '\u044e', // ю XK_Cyrillic_a: '\u0430', // а XK_Cyrillic_be: '\u0431', // б XK_Cyrillic_tse: '\u0446', // ц XK_Cyrillic_de: '\u0434', // д XK_Cyrillic_ie: '\u0435', // е XK_Cyrillic_ef: '\u0444', // ф XK_Cyrillic_ghe: '\u0433', // г XK_Cyrillic_ha: '\u0445', // х XK_Cyrillic_i: '\u0438', // и XK_Cyrillic_shorti: '\u0439', // й XK_Cyrillic_ka: '\u043a', // к XK_Cyrillic_el: '\u043b', // л XK_Cyrillic_em: '\u043c', // м XK_Cyrillic_en: '\u043d', // н XK_Cyrillic_o: '\u043e', // о XK_Cyrillic_pe: '\u043f', // п XK_Cyrillic_ya: '\u044f', // я XK_Cyrillic_er: '\u0440', // р XK_Cyrillic_es: '\u0441', // с XK_Cyrillic_te: '\u0442', // т XK_Cyrillic_u: '\u0443', // у XK_Cyrillic_zhe: '\u0436', // ж XK_Cyrillic_ve: '\u0432', // в XK_Cyrillic_softsign: '\u044c', // ь XK_Cyrillic_yeru: '\u044b', // ы XK_Cyrillic_ze: '\u0437', // з XK_Cyrillic_sha: '\u0448', // ш XK_Cyrillic_e: '\u044d', // э XK_Cyrillic_shcha: '\u0449', // щ XK_Cyrillic_che: '\u0447', // ч XK_Cyrillic_hardsign: '\u044a', // ъ XK_Cyrillic_YU: '\u042e', // Ю XK_Cyrillic_A: '\u0410', // А XK_Cyrillic_BE: '\u0411', // Б XK_Cyrillic_TSE: '\u0426', // Ц XK_Cyrillic_DE: '\u0414', // Д XK_Cyrillic_IE: '\u0415', // Е XK_Cyrillic_EF: '\u0424', // Ф XK_Cyrillic_GHE: '\u0413', // Г XK_Cyrillic_HA: '\u0425', // Х XK_Cyrillic_I: '\u0418', // И XK_Cyrillic_SHORTI: '\u0419', // Й XK_Cyrillic_KA: '\u041a', // К XK_Cyrillic_EL: '\u041b', // Л XK_Cyrillic_EM: '\u041c', // М XK_Cyrillic_EN: '\u041d', // Н XK_Cyrillic_O: '\u041e', // О XK_Cyrillic_PE: '\u041f', // П XK_Cyrillic_YA: '\u042f', // Я XK_Cyrillic_ER: '\u0420', // Р XK_Cyrillic_ES: '\u0421', // С XK_Cyrillic_TE: '\u0422', // Т XK_Cyrillic_U: '\u0423', // У XK_Cyrillic_ZHE: '\u0416', // Ж XK_Cyrillic_VE: '\u0412', // В XK_Cyrillic_SOFTSIGN: '\u042c', // Ь XK_Cyrillic_YERU: '\u042b', // Ы XK_Cyrillic_ZE: '\u0417', // З XK_Cyrillic_SHA: '\u0428', // Ш XK_Cyrillic_E: '\u042d', // Э XK_Cyrillic_SHCHA: '\u0429', // Щ XK_Cyrillic_CHE: '\u0427', // Ч XK_Cyrillic_HARDSIGN: '\u042a', // Ъ XK_Greek_ALPHAaccent: '\u0386', // Ά XK_Greek_EPSILONaccent: '\u0388', // Έ XK_Greek_ETAaccent: '\u0389', // Ή XK_Greek_IOTAaccent: '\u038a', // Ί XK_Greek_IOTAdieresis: '\u03aa', // Ϊ XK_Greek_OMICRONaccent: '\u038c', // Ό XK_Greek_UPSILONaccent: '\u038e', // Ύ XK_Greek_UPSILONdieresis: '\u03ab', // Ϋ XK_Greek_OMEGAaccent: '\u038f', // Ώ XK_Greek_accentdieresis: '\u0385', // ΅ XK_Greek_horizbar: '\u2015', // ― XK_Greek_alphaaccent: '\u03ac', // ά XK_Greek_epsilonaccent: '\u03ad', // έ XK_Greek_etaaccent: '\u03ae', // ή XK_Greek_iotaaccent: '\u03af', // ί XK_Greek_iotadieresis: '\u03ca', // ϊ XK_Greek_iotaaccentdieresis: '\u0390', // ΐ XK_Greek_omicronaccent: '\u03cc', // ό XK_Greek_upsilonaccent: '\u03cd', // ύ XK_Greek_upsilondieresis: '\u03cb', // ϋ XK_Greek_upsilonaccentdieresis: '\u03b0', // ΰ XK_Greek_omegaaccent: '\u03ce', // ώ XK_Greek_ALPHA: '\u0391', // Α XK_Greek_BETA: '\u0392', // Β XK_Greek_GAMMA: '\u0393', // Γ XK_Greek_DELTA: '\u0394', // Δ XK_Greek_EPSILON: '\u0395', // Ε XK_Greek_ZETA: '\u0396', // Ζ XK_Greek_ETA: '\u0397', // Η XK_Greek_THETA: '\u0398', // Θ XK_Greek_IOTA: '\u0399', // Ι XK_Greek_KAPPA: '\u039a', // Κ XK_Greek_LAMDA: '\u039b', // Λ // XK_Greek_LAMBDA == XK_Greek_LAMDA # U+039B GREEK CAPITAL LETTER LAMDA XK_Greek_MU: '\u039c', // Μ XK_Greek_NU: '\u039d', // Ν XK_Greek_XI: '\u039e', // Ξ XK_Greek_OMICRON: '\u039f', // Ο XK_Greek_PI: '\u03a0', // Π XK_Greek_RHO: '\u03a1', // Ρ XK_Greek_SIGMA: '\u03a3', // Σ XK_Greek_TAU: '\u03a4', // Τ XK_Greek_UPSILON: '\u03a5', // Υ XK_Greek_PHI: '\u03a6', // Φ XK_Greek_CHI: '\u03a7', // Χ XK_Greek_PSI: '\u03a8', // Ψ XK_Greek_OMEGA: '\u03a9', // Ω XK_Greek_alpha: '\u03b1', // α XK_Greek_beta: '\u03b2', // β XK_Greek_gamma: '\u03b3', // γ XK_Greek_delta: '\u03b4', // δ XK_Greek_epsilon: '\u03b5', // ε XK_Greek_zeta: '\u03b6', // ζ XK_Greek_eta: '\u03b7', // η XK_Greek_theta: '\u03b8', // θ XK_Greek_iota: '\u03b9', // ι XK_Greek_kappa: '\u03ba', // κ XK_Greek_lamda: '\u03bb', // λ // XK_Greek_lambda == XK_Greek_lamda # U+03BB GREEK SMALL LETTER LAMDA XK_Greek_mu: '\u03bc', // μ XK_Greek_nu: '\u03bd', // ν XK_Greek_xi: '\u03be', // ξ XK_Greek_omicron: '\u03bf', // ο XK_Greek_pi: '\u03c0', // π XK_Greek_rho: '\u03c1', // ρ XK_Greek_sigma: '\u03c3', // σ XK_Greek_finalsmallsigma: '\u03c2', // ς XK_Greek_tau: '\u03c4', // τ XK_Greek_upsilon: '\u03c5', // υ XK_Greek_phi: '\u03c6', // φ XK_Greek_chi: '\u03c7', // χ XK_Greek_psi: '\u03c8', // ψ XK_Greek_omega: '\u03c9', // ω XK_hebrew_doublelowline: '\u2017', // ‗ XK_hebrew_aleph: '\u05d0', // א XK_hebrew_bet: '\u05d1', // ב XK_hebrew_gimel: '\u05d2', // ג XK_hebrew_dalet: '\u05d3', // ד XK_hebrew_he: '\u05d4', // ה XK_hebrew_waw: '\u05d5', // ו XK_hebrew_zain: '\u05d6', // ז XK_hebrew_chet: '\u05d7', // ח XK_hebrew_tet: '\u05d8', // ט XK_hebrew_yod: '\u05d9', // י XK_hebrew_finalkaph: '\u05da', // ך XK_hebrew_kaph: '\u05db', // כ XK_hebrew_lamed: '\u05dc', // ל XK_hebrew_finalmem: '\u05dd', // ם XK_hebrew_mem: '\u05de', // מ XK_hebrew_finalnun: '\u05df', // ן XK_hebrew_nun: '\u05e0', // נ XK_hebrew_samech: '\u05e1', // ס XK_hebrew_ayin: '\u05e2', // ע XK_hebrew_finalpe: '\u05e3', // ף XK_hebrew_pe: '\u05e4', // פ XK_hebrew_finalzade: '\u05e5', // ץ XK_hebrew_zade: '\u05e6', // צ XK_hebrew_qoph: '\u05e7', // ק XK_hebrew_resh: '\u05e8', // ר XK_hebrew_shin: '\u05e9', // ש XK_hebrew_taw: '\u05ea', // ת XK_Thai_kokai: '\u0e01', // ก XK_Thai_khokhai: '\u0e02', // ข XK_Thai_khokhuat: '\u0e03', // ฃ XK_Thai_khokhwai: '\u0e04', // ค XK_Thai_khokhon: '\u0e05', // ฅ XK_Thai_khorakhang: '\u0e06', // ฆ XK_Thai_ngongu: '\u0e07', // ง XK_Thai_chochan: '\u0e08', // จ XK_Thai_choching: '\u0e09', // ฉ XK_Thai_chochang: '\u0e0a', // ช XK_Thai_soso: '\u0e0b', // ซ XK_Thai_chochoe: '\u0e0c', // ฌ XK_Thai_yoying: '\u0e0d', // ญ XK_Thai_dochada: '\u0e0e', // ฎ XK_Thai_topatak: '\u0e0f', // ฏ XK_Thai_thothan: '\u0e10', // ฐ XK_Thai_thonangmontho: '\u0e11', // ฑ XK_Thai_thophuthao: '\u0e12', // ฒ XK_Thai_nonen: '\u0e13', // ณ XK_Thai_dodek: '\u0e14', // ด XK_Thai_totao: '\u0e15', // ต XK_Thai_thothung: '\u0e16', // ถ XK_Thai_thothahan: '\u0e17', // ท XK_Thai_thothong: '\u0e18', // ธ XK_Thai_nonu: '\u0e19', // น XK_Thai_bobaimai: '\u0e1a', // บ XK_Thai_popla: '\u0e1b', // ป XK_Thai_phophung: '\u0e1c', // ผ XK_Thai_fofa: '\u0e1d', // ฝ XK_Thai_phophan: '\u0e1e', // พ XK_Thai_fofan: '\u0e1f', // ฟ XK_Thai_phosamphao: '\u0e20', // ภ XK_Thai_moma: '\u0e21', // ม XK_Thai_yoyak: '\u0e22', // ย XK_Thai_rorua: '\u0e23', // ร XK_Thai_ru: '\u0e24', // ฤ XK_Thai_loling: '\u0e25', // ล XK_Thai_lu: '\u0e26', // ฦ XK_Thai_wowaen: '\u0e27', // ว XK_Thai_sosala: '\u0e28', // ศ XK_Thai_sorusi: '\u0e29', // ษ XK_Thai_sosua: '\u0e2a', // ส XK_Thai_hohip: '\u0e2b', // ห XK_Thai_lochula: '\u0e2c', // ฬ XK_Thai_oang: '\u0e2d', // อ XK_Thai_honokhuk: '\u0e2e', // ฮ XK_Thai_paiyannoi: '\u0e2f', // ฯ XK_Thai_saraa: '\u0e30', // ะ XK_Thai_maihanakat: '\u0e31', // ั XK_Thai_saraaa: '\u0e32', // า XK_Thai_saraam: '\u0e33', // ำ XK_Thai_sarai: '\u0e34', // ิ XK_Thai_saraii: '\u0e35', // ี XK_Thai_saraue: '\u0e36', // ึ XK_Thai_sarauee: '\u0e37', // ื XK_Thai_sarau: '\u0e38', // ุ XK_Thai_sarauu: '\u0e39', // ู XK_Thai_phinthu: '\u0e3a', // ฺ XK_Thai_baht: '\u0e3f', // ฿ XK_Thai_sarae: '\u0e40', // เ XK_Thai_saraae: '\u0e41', // แ XK_Thai_sarao: '\u0e42', // โ XK_Thai_saraaimaimuan: '\u0e43', // ใ XK_Thai_saraaimaimalai: '\u0e44', // ไ XK_Thai_lakkhangyao: '\u0e45', // ๅ XK_Thai_maiyamok: '\u0e46', // ๆ XK_Thai_maitaikhu: '\u0e47', // ็ XK_Thai_maiek: '\u0e48', // ่ XK_Thai_maitho: '\u0e49', // ้ XK_Thai_maitri: '\u0e4a', // ๊ XK_Thai_maichattawa: '\u0e4b', // ๋ XK_Thai_thanthakhat: '\u0e4c', // ์ XK_Thai_nikhahit: '\u0e4d', // ํ XK_Thai_leksun: '\u0e50', // ๐ XK_Thai_leknung: '\u0e51', // ๑ XK_Thai_leksong: '\u0e52', // ๒ XK_Thai_leksam: '\u0e53', // ๓ XK_Thai_leksi: '\u0e54', // ๔ XK_Thai_lekha: '\u0e55', // ๕ XK_Thai_lekhok: '\u0e56', // ๖ XK_Thai_lekchet: '\u0e57', // ๗ XK_Thai_lekpaet: '\u0e58', // ๘ XK_Thai_lekkao: '\u0e59', // ๙ XK_Korean_Won: '\u20a9', // ₩ XK_Armenian_ligature_ew: '\u0587', // և XK_Armenian_full_stop: '\u0589', // ։ // XK_Armenian_verjaket == XK_Armenian_full_stop # U+0589 ARMENIAN FULL STOP XK_Armenian_separation_mark: '\u055d', // ՝ // XK_Armenian_but == XK_Armenian_separation_mark # U+055D ARMENIAN COMMA XK_Armenian_hyphen: '\u058a', // ֊ // XK_Armenian_yentamna == XK_Armenian_hyphen # U+058A ARMENIAN HYPHEN XK_Armenian_exclam: '\u055c', // ՜ // XK_Armenian_amanak == XK_Armenian_exclam # U+055C ARMENIAN EXCLAMATION MARK XK_Armenian_accent: '\u055b', // ՛ // XK_Armenian_shesht == XK_Armenian_accent # U+055B ARMENIAN EMPHASIS MARK XK_Armenian_question: '\u055e', // ՞ // XK_Armenian_paruyk == XK_Armenian_question # U+055E ARMENIAN QUESTION MARK XK_Armenian_AYB: '\u0531', // Ա XK_Armenian_ayb: '\u0561', // ա XK_Armenian_BEN: '\u0532', // Բ XK_Armenian_ben: '\u0562', // բ XK_Armenian_GIM: '\u0533', // Գ XK_Armenian_gim: '\u0563', // գ XK_Armenian_DA: '\u0534', // Դ XK_Armenian_da: '\u0564', // դ XK_Armenian_YECH: '\u0535', // Ե XK_Armenian_yech: '\u0565', // ե XK_Armenian_ZA: '\u0536', // Զ XK_Armenian_za: '\u0566', // զ XK_Armenian_E: '\u0537', // Է XK_Armenian_e: '\u0567', // է XK_Armenian_AT: '\u0538', // Ը XK_Armenian_at: '\u0568', // ը XK_Armenian_TO: '\u0539', // Թ XK_Armenian_to: '\u0569', // թ XK_Armenian_ZHE: '\u053a', // Ժ XK_Armenian_zhe: '\u056a', // ժ XK_Armenian_INI: '\u053b', // Ի XK_Armenian_ini: '\u056b', // ի XK_Armenian_LYUN: '\u053c', // Լ XK_Armenian_lyun: '\u056c', // լ XK_Armenian_KHE: '\u053d', // Խ XK_Armenian_khe: '\u056d', // խ XK_Armenian_TSA: '\u053e', // Ծ XK_Armenian_tsa: '\u056e', // ծ XK_Armenian_KEN: '\u053f', // Կ XK_Armenian_ken: '\u056f', // կ XK_Armenian_HO: '\u0540', // Հ XK_Armenian_ho: '\u0570', // հ XK_Armenian_DZA: '\u0541', // Ձ XK_Armenian_dza: '\u0571', // ձ XK_Armenian_GHAT: '\u0542', // Ղ XK_Armenian_ghat: '\u0572', // ղ XK_Armenian_TCHE: '\u0543', // Ճ XK_Armenian_tche: '\u0573', // ճ XK_Armenian_MEN: '\u0544', // Մ XK_Armenian_men: '\u0574', // մ XK_Armenian_HI: '\u0545', // Յ XK_Armenian_hi: '\u0575', // յ XK_Armenian_NU: '\u0546', // Ն XK_Armenian_nu: '\u0576', // ն XK_Armenian_SHA: '\u0547', // Շ XK_Armenian_sha: '\u0577', // շ XK_Armenian_VO: '\u0548', // Ո XK_Armenian_vo: '\u0578', // ո XK_Armenian_CHA: '\u0549', // Չ XK_Armenian_cha: '\u0579', // չ XK_Armenian_PE: '\u054a', // Պ XK_Armenian_pe: '\u057a', // պ XK_Armenian_JE: '\u054b', // Ջ XK_Armenian_je: '\u057b', // ջ XK_Armenian_RA: '\u054c', // Ռ XK_Armenian_ra: '\u057c', // ռ XK_Armenian_SE: '\u054d', // Ս XK_Armenian_se: '\u057d', // ս XK_Armenian_VEV: '\u054e', // Վ XK_Armenian_vev: '\u057e', // վ XK_Armenian_TYUN: '\u054f', // Տ XK_Armenian_tyun: '\u057f', // տ XK_Armenian_RE: '\u0550', // Ր XK_Armenian_re: '\u0580', // ր XK_Armenian_TSO: '\u0551', // Ց XK_Armenian_tso: '\u0581', // ց XK_Armenian_VYUN: '\u0552', // Ւ XK_Armenian_vyun: '\u0582', // ւ XK_Armenian_PYUR: '\u0553', // Փ XK_Armenian_pyur: '\u0583', // փ XK_Armenian_KE: '\u0554', // Ք XK_Armenian_ke: '\u0584', // ք XK_Armenian_O: '\u0555', // Օ XK_Armenian_o: '\u0585', // օ XK_Armenian_FE: '\u0556', // Ֆ XK_Armenian_fe: '\u0586', // ֆ XK_Armenian_apostrophe: '\u055a', // ՚ XK_Georgian_an: '\u10d0', // ა XK_Georgian_ban: '\u10d1', // ბ XK_Georgian_gan: '\u10d2', // გ XK_Georgian_don: '\u10d3', // დ XK_Georgian_en: '\u10d4', // ე XK_Georgian_vin: '\u10d5', // ვ XK_Georgian_zen: '\u10d6', // ზ XK_Georgian_tan: '\u10d7', // თ XK_Georgian_in: '\u10d8', // ი XK_Georgian_kan: '\u10d9', // კ XK_Georgian_las: '\u10da', // ლ XK_Georgian_man: '\u10db', // მ XK_Georgian_nar: '\u10dc', // ნ XK_Georgian_on: '\u10dd', // ო XK_Georgian_par: '\u10de', // პ XK_Georgian_zhar: '\u10df', // ჟ XK_Georgian_rae: '\u10e0', // რ XK_Georgian_san: '\u10e1', // ს XK_Georgian_tar: '\u10e2', // ტ XK_Georgian_un: '\u10e3', // უ XK_Georgian_phar: '\u10e4', // ფ XK_Georgian_khar: '\u10e5', // ქ XK_Georgian_ghan: '\u10e6', // ღ XK_Georgian_qar: '\u10e7', // ყ XK_Georgian_shin: '\u10e8', // შ XK_Georgian_chin: '\u10e9', // ჩ XK_Georgian_can: '\u10ea', // ც XK_Georgian_jil: '\u10eb', // ძ XK_Georgian_cil: '\u10ec', // წ XK_Georgian_char: '\u10ed', // ჭ XK_Georgian_xan: '\u10ee', // ხ XK_Georgian_jhan: '\u10ef', // ჯ XK_Georgian_hae: '\u10f0', // ჰ XK_Georgian_he: '\u10f1', // ჱ XK_Georgian_hie: '\u10f2', // ჲ XK_Georgian_we: '\u10f3', // ჳ XK_Georgian_har: '\u10f4', // ჴ XK_Georgian_hoe: '\u10f5', // ჵ XK_Georgian_fi: '\u10f6', // ჶ XK_Xabovedot: '\u1e8a', // Ẋ XK_Ibreve: '\u012c', // Ĭ XK_Zstroke: '\u01b5', // Ƶ XK_Gcaron: '\u01e6', // Ǧ XK_Ocaron: '\u01d2', // ǒ XK_Obarred: '\u019f', // Ɵ XK_xabovedot: '\u1e8b', // ẋ XK_ibreve: '\u012d', // ĭ XK_zstroke: '\u01b6', // ƶ XK_gcaron: '\u01e7', // ǧ XK_ocaron: '\u01d2', // ǒ XK_obarred: '\u0275', // ɵ XK_SCHWA: '\u018f', // Ə XK_schwa: '\u0259', // ə XK_EZH: '\u01b7', // Ʒ XK_ezh: '\u0292', // ʒ XK_Lbelowdot: '\u1e36', // Ḷ XK_lbelowdot: '\u1e37', // ḷ XK_Abelowdot: '\u1ea0', // Ạ XK_abelowdot: '\u1ea1', // ạ XK_Ahook: '\u1ea2', // Ả XK_ahook: '\u1ea3', // ả XK_Acircumflexacute: '\u1ea4', // Ấ XK_acircumflexacute: '\u1ea5', // ấ XK_Acircumflexgrave: '\u1ea6', // Ầ XK_acircumflexgrave: '\u1ea7', // ầ XK_Acircumflexhook: '\u1ea8', // Ẩ XK_acircumflexhook: '\u1ea9', // ẩ XK_Acircumflextilde: '\u1eaa', // Ẫ XK_acircumflextilde: '\u1eab', // ẫ XK_Acircumflexbelowdot: '\u1eac', // Ậ XK_acircumflexbelowdot: '\u1ead', // ậ XK_Abreveacute: '\u1eae', // Ắ XK_abreveacute: '\u1eaf', // ắ XK_Abrevegrave: '\u1eb0', // Ằ XK_abrevegrave: '\u1eb1', // ằ XK_Abrevehook: '\u1eb2', // Ẳ XK_abrevehook: '\u1eb3', // ẳ XK_Abrevetilde: '\u1eb4', // Ẵ XK_abrevetilde: '\u1eb5', // ẵ XK_Abrevebelowdot: '\u1eb6', // Ặ XK_abrevebelowdot: '\u1eb7', // ặ XK_Ebelowdot: '\u1eb8', // Ẹ XK_ebelowdot: '\u1eb9', // ẹ XK_Ehook: '\u1eba', // Ẻ XK_ehook: '\u1ebb', // ẻ XK_Etilde: '\u1ebc', // Ẽ XK_etilde: '\u1ebd', // ẽ XK_Ecircumflexacute: '\u1ebe', // Ế XK_ecircumflexacute: '\u1ebf', // ế XK_Ecircumflexgrave: '\u1ec0', // Ề XK_ecircumflexgrave: '\u1ec1', // ề XK_Ecircumflexhook: '\u1ec2', // Ể XK_ecircumflexhook: '\u1ec3', // ể XK_Ecircumflextilde: '\u1ec4', // Ễ XK_ecircumflextilde: '\u1ec5', // ễ XK_Ecircumflexbelowdot: '\u1ec6', // Ệ XK_ecircumflexbelowdot: '\u1ec7', // ệ XK_Ihook: '\u1ec8', // Ỉ XK_ihook: '\u1ec9', // ỉ XK_Ibelowdot: '\u1eca', // Ị XK_ibelowdot: '\u1ecb', // ị XK_Obelowdot: '\u1ecc', // Ọ XK_obelowdot: '\u1ecd', // ọ XK_Ohook: '\u1ece', // Ỏ XK_ohook: '\u1ecf', // ỏ XK_Ocircumflexacute: '\u1ed0', // Ố XK_ocircumflexacute: '\u1ed1', // ố XK_Ocircumflexgrave: '\u1ed2', // Ồ XK_ocircumflexgrave: '\u1ed3', // ồ XK_Ocircumflexhook: '\u1ed4', // Ổ XK_ocircumflexhook: '\u1ed5', // ổ XK_Ocircumflextilde: '\u1ed6', // Ỗ XK_ocircumflextilde: '\u1ed7', // ỗ XK_Ocircumflexbelowdot: '\u1ed8', // Ộ XK_ocircumflexbelowdot: '\u1ed9', // ộ XK_Ohornacute: '\u1eda', // Ớ XK_ohornacute: '\u1edb', // ớ XK_Ohorngrave: '\u1edc', // Ờ XK_ohorngrave: '\u1edd', // ờ XK_Ohornhook: '\u1ede', // Ở XK_ohornhook: '\u1edf', // ở XK_Ohorntilde: '\u1ee0', // Ỡ XK_ohorntilde: '\u1ee1', // ỡ XK_Ohornbelowdot: '\u1ee2', // Ợ XK_ohornbelowdot: '\u1ee3', // ợ XK_Ubelowdot: '\u1ee4', // Ụ XK_ubelowdot: '\u1ee5', // ụ XK_Uhook: '\u1ee6', // Ủ XK_uhook: '\u1ee7', // ủ XK_Uhornacute: '\u1ee8', // Ứ XK_uhornacute: '\u1ee9', // ứ XK_Uhorngrave: '\u1eea', // Ừ XK_uhorngrave: '\u1eeb', // ừ XK_Uhornhook: '\u1eec', // Ử XK_uhornhook: '\u1eed', // ử XK_Uhorntilde: '\u1eee', // Ữ XK_uhorntilde: '\u1eef', // ữ XK_Uhornbelowdot: '\u1ef0', // Ự XK_uhornbelowdot: '\u1ef1', // ự XK_Ybelowdot: '\u1ef4', // Ỵ XK_ybelowdot: '\u1ef5', // ỵ XK_Yhook: '\u1ef6', // Ỷ XK_yhook: '\u1ef7', // ỷ XK_Ytilde: '\u1ef8', // Ỹ XK_ytilde: '\u1ef9', // ỹ XK_Ohorn: '\u01a0', // Ơ XK_ohorn: '\u01a1', // ơ XK_Uhorn: '\u01af', // Ư XK_uhorn: '\u01b0', // ư XK_EcuSign: '\u20a0', // ₠ XK_ColonSign: '\u20a1', // ₡ XK_CruzeiroSign: '\u20a2', // ₢ XK_FFrancSign: '\u20a3', // ₣ XK_LiraSign: '\u20a4', // ₤ XK_MillSign: '\u20a5', // ₥ XK_NairaSign: '\u20a6', // ₦ XK_PesetaSign: '\u20a7', // ₧ XK_RupeeSign: '\u20a8', // ₨ XK_WonSign: '\u20a9', // ₩ XK_NewSheqelSign: '\u20aa', // ₪ XK_DongSign: '\u20ab', // ₫ XK_EuroSign: '\u20ac', // € XK_zerosuperior: '\u2070', // ⁰ XK_foursuperior: '\u2074', // ⁴ XK_fivesuperior: '\u2075', // ⁵ XK_sixsuperior: '\u2076', // ⁶ XK_sevensuperior: '\u2077', // ⁷ XK_eightsuperior: '\u2078', // ⁸ XK_ninesuperior: '\u2079', // ⁹ XK_zerosubscript: '\u2080', // ₀ XK_onesubscript: '\u2081', // ₁ XK_twosubscript: '\u2082', // ₂ XK_threesubscript: '\u2083', // ₃ XK_foursubscript: '\u2084', // ₄ XK_fivesubscript: '\u2085', // ₅ XK_sixsubscript: '\u2086', // ₆ XK_sevensubscript: '\u2087', // ₇ XK_eightsubscript: '\u2088', // ₈ XK_ninesubscript: '\u2089', // ₉ XK_partdifferential: '\u2202', // ∂ XK_emptyset: '\u2205', // ∅ XK_elementof: '\u2208', // ∈ XK_notelementof: '\u2209', // ∉ XK_because: '\u2235', // ∵ XK_approxeq: '\u2245', // ≅ XK_notapproxeq: '\u2247', // ≇ XK_notidentical: '\u2262', // ≢ XK_stricteq: '\u2263', // ≣ XK_braille_blank: '\u2800', // ⠀ XK_braille_dots_1: '\u2801', // ⠁ XK_braille_dots_2: '\u2802', // ⠂ XK_braille_dots_12: '\u2803', // ⠃ XK_braille_dots_3: '\u2804', // ⠄ XK_braille_dots_13: '\u2805', // ⠅ XK_braille_dots_23: '\u2806', // ⠆ XK_braille_dots_123: '\u2807', // ⠇ XK_braille_dots_4: '\u2808', // ⠈ XK_braille_dots_14: '\u2809', // ⠉ XK_braille_dots_5: '\u2810', // ⠐ XK_braille_dots_15: '\u2811', // ⠑ XK_braille_dots_25: '\u2812', // ⠒ XK_braille_dots_125: '\u2813', // ⠓ XK_braille_dots_35: '\u2814', // ⠔ XK_braille_dots_135: '\u2815', // ⠕ XK_braille_dots_235: '\u2816', // ⠖ XK_braille_dots_1235: '\u2817', // ⠗ XK_braille_dots_45: '\u2818', // ⠘ XK_braille_dots_145: '\u2819', // ⠙ XK_braille_dots_6: '\u2820', // ⠠ XK_braille_dots_16: '\u2821', // ⠡ XK_braille_dots_26: '\u2822', // ⠢ XK_braille_dots_126: '\u2823', // ⠣ XK_braille_dots_36: '\u2824', // ⠤ XK_braille_dots_136: '\u2825', // ⠥ XK_braille_dots_236: '\u2826', // ⠦ XK_braille_dots_1236: '\u2827', // ⠧ XK_braille_dots_46: '\u2828', // ⠨ XK_braille_dots_146: '\u2829', // ⠩ XK_braille_dots_56: '\u2830', // ⠰ XK_braille_dots_156: '\u2831', // ⠱ XK_braille_dots_256: '\u2832', // ⠲ XK_braille_dots_1256: '\u2833', // ⠳ XK_braille_dots_356: '\u2834', // ⠴ XK_braille_dots_1356: '\u2835', // ⠵ XK_braille_dots_2356: '\u2836', // ⠶ XK_braille_dots_12356: '\u2837', // ⠷ XK_braille_dots_456: '\u2838', // ⠸ XK_braille_dots_1456: '\u2839', // ⠹ XK_braille_dots_7: '\u2840', // ⡀ XK_braille_dots_17: '\u2841', // ⡁ XK_braille_dots_27: '\u2842', // ⡂ XK_braille_dots_127: '\u2843', // ⡃ XK_braille_dots_37: '\u2844', // ⡄ XK_braille_dots_137: '\u2845', // ⡅ XK_braille_dots_237: '\u2846', // ⡆ XK_braille_dots_1237: '\u2847', // ⡇ XK_braille_dots_47: '\u2848', // ⡈ XK_braille_dots_147: '\u2849', // ⡉ XK_braille_dots_57: '\u2850', // ⡐ XK_braille_dots_157: '\u2851', // ⡑ XK_braille_dots_257: '\u2852', // ⡒ XK_braille_dots_1257: '\u2853', // ⡓ XK_braille_dots_357: '\u2854', // ⡔ XK_braille_dots_1357: '\u2855', // ⡕ XK_braille_dots_2357: '\u2856', // ⡖ XK_braille_dots_12357: '\u2857', // ⡗ XK_braille_dots_457: '\u2858', // ⡘ XK_braille_dots_1457: '\u2859', // ⡙ XK_braille_dots_67: '\u2860', // ⡠ XK_braille_dots_167: '\u2861', // ⡡ XK_braille_dots_267: '\u2862', // ⡢ XK_braille_dots_1267: '\u2863', // ⡣ XK_braille_dots_367: '\u2864', // ⡤ XK_braille_dots_1367: '\u2865', // ⡥ XK_braille_dots_2367: '\u2866', // ⡦ XK_braille_dots_12367: '\u2867', // ⡧ XK_braille_dots_467: '\u2868', // ⡨ XK_braille_dots_1467: '\u2869', // ⡩ XK_braille_dots_567: '\u2870', // ⡰ XK_braille_dots_1567: '\u2871', // ⡱ XK_braille_dots_2567: '\u2872', // ⡲ XK_braille_dots_12567: '\u2873', // ⡳ XK_braille_dots_3567: '\u2874', // ⡴ XK_braille_dots_13567: '\u2875', // ⡵ XK_braille_dots_23567: '\u2876', // ⡶ XK_braille_dots_123567: '\u2877', // ⡷ XK_braille_dots_4567: '\u2878', // ⡸ XK_braille_dots_14567: '\u2879', // ⡹ XK_braille_dots_8: '\u2880', // ⢀ XK_braille_dots_18: '\u2881', // ⢁ XK_braille_dots_28: '\u2882', // ⢂ XK_braille_dots_128: '\u2883', // ⢃ XK_braille_dots_38: '\u2884', // ⢄ XK_braille_dots_138: '\u2885', // ⢅ XK_braille_dots_238: '\u2886', // ⢆ XK_braille_dots_1238: '\u2887', // ⢇ XK_braille_dots_48: '\u2888', // ⢈ XK_braille_dots_148: '\u2889', // ⢉ XK_braille_dots_58: '\u2890', // ⢐ XK_braille_dots_158: '\u2891', // ⢑ XK_braille_dots_258: '\u2892', // ⢒ XK_braille_dots_1258: '\u2893', // ⢓ XK_braille_dots_358: '\u2894', // ⢔ XK_braille_dots_1358: '\u2895', // ⢕ XK_braille_dots_2358: '\u2896', // ⢖ XK_braille_dots_12358: '\u2897', // ⢗ XK_braille_dots_458: '\u2898', // ⢘ XK_braille_dots_1458: '\u2899', // ⢙ XK_Sinh_ng: '\u0d82', // ං XK_Sinh_h2: '\u0d83', // ඃ XK_Sinh_a: '\u0d85', // අ XK_Sinh_aa: '\u0d86', // ආ XK_Sinh_ae: '\u0d87', // ඇ XK_Sinh_aee: '\u0d88', // ඈ XK_Sinh_i: '\u0d89', // ඉ XK_Sinh_ii: '\u0d8a', // ඊ XK_Sinh_u: '\u0d8b', // උ XK_Sinh_uu: '\u0d8c', // ඌ XK_Sinh_ri: '\u0d8d', // ඍ XK_Sinh_rii: '\u0d8e', // ඎ XK_Sinh_lu: '\u0d8f', // ඏ XK_Sinh_luu: '\u0d90', // ඐ XK_Sinh_e: '\u0d91', // එ XK_Sinh_ee: '\u0d92', // ඒ XK_Sinh_ai: '\u0d93', // ඓ XK_Sinh_o: '\u0d94', // ඔ XK_Sinh_oo: '\u0d95', // ඕ XK_Sinh_au: '\u0d96', // ඖ XK_Sinh_ka: '\u0d9a', // ක XK_Sinh_kha: '\u0d9b', // ඛ XK_Sinh_ga: '\u0d9c', // ග XK_Sinh_gha: '\u0d9d', // ඝ XK_Sinh_ng2: '\u0d9e', // ඞ XK_Sinh_nga: '\u0d9f', // ඟ XK_Sinh_ca: '\u0da0', // ච XK_Sinh_cha: '\u0da1', // ඡ XK_Sinh_ja: '\u0da2', // ජ XK_Sinh_jha: '\u0da3', // ඣ XK_Sinh_nya: '\u0da4', // ඤ XK_Sinh_jnya: '\u0da5', // ඥ XK_Sinh_nja: '\u0da6', // ඦ XK_Sinh_tta: '\u0da7', // ට XK_Sinh_ttha: '\u0da8', // ඨ XK_Sinh_dda: '\u0da9', // ඩ XK_Sinh_ddha: '\u0daa', // ඪ XK_Sinh_nna: '\u0dab', // ණ XK_Sinh_ndda: '\u0dac', // ඬ XK_Sinh_tha: '\u0dad', // ත XK_Sinh_thha: '\u0dae', // ථ XK_Sinh_dha: '\u0daf', // ද XK_Sinh_dhha: '\u0db0', // ධ XK_Sinh_na: '\u0db1', // න XK_Sinh_ndha: '\u0db3', // ඳ XK_Sinh_pa: '\u0db4', // ප XK_Sinh_pha: '\u0db5', // ඵ XK_Sinh_ba: '\u0db6', // බ XK_Sinh_bha: '\u0db7', // භ XK_Sinh_ma: '\u0db8', // ම XK_Sinh_mba: '\u0db9', // ඹ XK_Sinh_ya: '\u0dba', // ය XK_Sinh_ra: '\u0dbb', // ර XK_Sinh_la: '\u0dbd', // ල XK_Sinh_va: '\u0dc0', // ව XK_Sinh_sha: '\u0dc1', // ශ XK_Sinh_ssha: '\u0dc2', // ෂ XK_Sinh_sa: '\u0dc3', // ස XK_Sinh_ha: '\u0dc4', // හ XK_Sinh_lla: '\u0dc5', // ළ XK_Sinh_fa: '\u0dc6', // ෆ XK_Sinh_al: '\u0dca', // ් XK_Sinh_aa2: '\u0dcf', // ා XK_Sinh_ae2: '\u0dd0', // ැ XK_Sinh_aee2: '\u0dd1', // ෑ XK_Sinh_i2: '\u0dd2', // ි XK_Sinh_ii2: '\u0dd3', // ී XK_Sinh_u2: '\u0dd4', // ු XK_Sinh_uu2: '\u0dd6', // ූ XK_Sinh_ru2: '\u0dd8', // ෘ XK_Sinh_e2: '\u0dd9', // ෙ XK_Sinh_ee2: '\u0dda', // ේ XK_Sinh_ai2: '\u0ddb', // ෛ XK_Sinh_o2: '\u0ddc', // ො XK_Sinh_oo2: '\u0ddd', // ෝ XK_Sinh_au2: '\u0dde', // ෞ XK_Sinh_lu2: '\u0ddf', // ෟ XK_Sinh_ruu2: '\u0df2', // ෲ XK_Sinh_luu2: '\u0df3', // ෳ XK_Sinh_kunddaliya: '\u0df4', // ෴ } go-x11-client-1.0.2/util/keysyms/keysyms.go000066400000000000000000000250731460713373000205310ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package keysyms // The algorithm is copied from xcb-util-keysyms import ( "errors" "sync" x "github.com/linuxdeepin/go-x11-client" ) func StringToKeysym(str string) (x.Keysym, bool) { sym, ok := EngKeysymMap[str] if !ok { return XK_VoidSymbol, false } return sym, true } func StringToVisibleChar(str string) (rune, bool) { sym, ok := EngKeysymMap[str] if !ok { return 0, false } char, ok := KeysymVisibleCharMap[sym] return char, ok } func KeysymToString(sym x.Keysym) (string, bool) { if sym == x.NoSymbol { return "NoSymbol", true } eng, ok := KeysymEngMap[sym] return eng, ok } const ( ModMaskAlt = x.ModMask1 ModMaskNumLock = x.ModMask2 ModMaskSuper = x.ModMask4 ModMaskModeSwitch = x.ModMask5 ModMaskShift = x.ModMaskShift ModMaskCapsLock = x.ModMaskLock ModMaskControl = x.ModMaskControl ) var LockMods = []uint16{ ModMaskCapsLock, ModMaskNumLock, ModMaskCapsLock | ModMaskNumLock, } type KeySymbols struct { mu sync.Mutex conn *x.Conn minKeycode, maxKeycode x.Keycode cookie x.GetKeyboardMappingCookie oldCookies []x.GetKeyboardMappingCookie kbdMap *x.GetKeyboardMappingReply tag int } const ( tagCookie = 0 tagReply = 1 ) func NewKeySymbols(conn *x.Conn) *KeySymbols { setup := conn.GetSetup() minKeycode := setup.MinKeycode maxKeycode := setup.MaxKeycode ks := &KeySymbols{ conn: conn, minKeycode: minKeycode, maxKeycode: maxKeycode, } ks.cookie = x.GetKeyboardMapping(conn, minKeycode, uint8(maxKeycode-minKeycode+1)) ks.tag = tagCookie return ks } func (ks *KeySymbols) getKbdMap() *x.GetKeyboardMappingReply { ks.mu.Lock() defer ks.mu.Unlock() if ks.tag == tagReply { return ks.kbdMap } // no reply, but cookie is 0 if ks.cookie == 0 { return nil } reply, err := ks.cookie.Reply(ks.conn) //println("cookie reply", ks.cookie) // use cookie once ks.cookie = 0 // discard old replies for _, ck := range ks.oldCookies { _, _ = ck.Reply(ks.conn) } ks.oldCookies = nil if err != nil { return nil } ks.tag = tagReply ks.kbdMap = reply return reply } func (ks *KeySymbols) RefreshKeyboardMapping(event *x.MappingNotifyEvent) bool { if event.Request == x.MappingKeyboard { ks.mu.Lock() if ks.cookie > 0 { ks.oldCookies = append(ks.oldCookies, ks.cookie) } ks.cookie = x.GetKeyboardMapping(ks.conn, ks.minKeycode, uint8(ks.maxKeycode-ks.minKeycode+1)) //println("send GetKeyboardMapping request", ks.cookie) ks.tag = tagCookie ks.mu.Unlock() return true } return false } func (ks *KeySymbols) GetKeycodes(sym x.Keysym) []x.Keycode { kbdMap := ks.getKbdMap() if kbdMap == nil { return nil } return getKeycodes(kbdMap, ks.minKeycode, ks.maxKeycode, sym) } func (ks *KeySymbols) GetKeysym(code x.Keycode, col int) x.Keysym { kbdMap := ks.getKbdMap() if kbdMap == nil { return x.NoSymbol } return getKeysym(kbdMap, ks.minKeycode, ks.maxKeycode, code, col) } func (ks *KeySymbols) StringToKeycodes(str string) ([]x.Keycode, error) { sym, ok := EngKeysymMap[str] if !ok { return nil, errors.New("failed to get keysym") } return ks.GetKeycodes(sym), nil } func getKeycodes(kbdMapping *x.GetKeyboardMappingReply, minKeycode, maxKeycode x.Keycode, sym x.Keysym) (result []x.Keycode) { per := kbdMapping.KeysymsPerKeycode // i keycode // j col for i := minKeycode; i > 0 && i <= maxKeycode; i++ { //fmt.Println("i is ", i) for j := 0; j < int(per); j++ { ks := getKeysym(kbdMapping, minKeycode, maxKeycode, i, j) if ks == sym { result = append(result, i) break } } } return } func (ks *KeySymbols) LookupString(keycode x.Keycode, modifier uint16) (string, bool) { sym := ks.translateKey(keycode, modifier) return KeysymToString(sym) } func (ks *KeySymbols) translateKey(keycode x.Keycode, modifiers uint16) (result x.Keysym) { if (keycode < ks.minKeycode) || (keycode > ks.maxKeycode) { return x.NoSymbol } kbdMap := ks.getKbdMap() if kbdMap == nil { return x.NoSymbol } syms := kbdMap.Keysyms per := int(kbdMap.KeysymsPerKeycode) syms = syms[int(keycode-ks.minKeycode)*per:] for per > 2 && syms[per-1] == x.NoSymbol { per-- } if (per > 2) && (modifiers&ModMaskModeSwitch) != 0 { syms = syms[2:] per -= 2 } shiftOn := (modifiers & ModMaskShift) != 0 capsLockOn := (modifiers & ModMaskCapsLock) != 0 if (modifiers&ModMaskNumLock) != 0 && (per > 1 && (IsKeypadKey(syms[1]) || IsPrivateKeypadKey(syms[1]))) { // num_lock is on and key is keypad key if shiftOn { result = syms[0] } else { // shift is off // syms[1] is number result = syms[1] } } else { symArr := [2]x.Keysym{syms[0]} if per == 1 || syms[1] == x.NoSymbol { _, usym := ConvertCase(syms[0]) symArr[1] = usym } else { symArr[1] = syms[1] } idx := 0 onlyCaseDiff := false _, upperSym := ConvertCase(symArr[0]) if upperSym == symArr[1] { onlyCaseDiff = true } if capsLockOn && onlyCaseDiff { idx = 1 } if shiftOn { if idx == 0 { idx = 1 } else { idx = 0 } } result = symArr[idx] } if result == XK_VoidSymbol { result = x.NoSymbol } return result } func getKeysym(kbdMapping *x.GetKeyboardMappingReply, minKeycode, maxKeycode, keycode x.Keycode, col int) x.Keysym { syms := kbdMapping.Keysyms per := kbdMapping.KeysymsPerKeycode if col < 0 || (col >= int(per) && col > 3) || keycode < minKeycode || keycode > maxKeycode { return x.NoSymbol } syms = syms[int(keycode-minKeycode)*int(per):] if col < 4 { // col is in 0,1,2,3 if col > 1 { for per > 2 && syms[per-1] == x.NoSymbol { per-- } if per < 3 { col -= 2 } } if (int(per) <= (col | 1)) || (syms[col|1] == x.NoSymbol) { lsym, usym := ConvertCase(syms[col&^1]) if (col & 1) == 0 { return lsym } else if usym == lsym { return x.NoSymbol } else { return usym } } } return syms[col] } func ConvertCase(sym x.Keysym) (lower, upper x.Keysym) { lower = sym upper = sym switch sym >> 8 { case 0: /* Latin 1 */ if sym >= XK_A && sym <= XK_Z { lower += XK_a - XK_A } else if sym >= XK_a && sym <= XK_z { upper -= XK_a - XK_A } else if sym >= XK_Agrave && sym <= XK_Odiaeresis { lower += XK_agrave - XK_Agrave } else if sym >= XK_agrave && sym <= XK_odiaeresis { upper -= XK_agrave - XK_Agrave } else if sym >= XK_Ooblique && sym <= XK_THORN { lower += XK_oslash - XK_Ooblique } else if sym >= XK_oslash && sym <= XK_thorn { upper -= XK_oslash - XK_Ooblique } case 1: /* Latin 2 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if sym == XK_Aogonek { lower = XK_aogonek } else if sym >= XK_Lstroke && sym <= XK_Sacute { lower += XK_lstroke - XK_Lstroke } else if sym >= XK_Scaron && sym <= XK_Zacute { lower += XK_scaron - XK_Scaron } else if sym >= XK_Zcaron && sym <= XK_Zabovedot { lower += XK_zcaron - XK_Zcaron } else if sym == XK_aogonek { upper = XK_Aogonek } else if sym >= XK_lstroke && sym <= XK_sacute { upper -= XK_lstroke - XK_Lstroke } else if sym >= XK_scaron && sym <= XK_zacute { upper -= XK_scaron - XK_Scaron } else if sym >= XK_zcaron && sym <= XK_zabovedot { upper -= XK_zcaron - XK_Zcaron } else if sym >= XK_Racute && sym <= XK_Tcedilla { lower += XK_racute - XK_Racute } else if sym >= XK_racute && sym <= XK_tcedilla { upper -= XK_racute - XK_Racute } case 2: /* Latin 3 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if sym >= XK_Hstroke && sym <= XK_Hcircumflex { lower += XK_hstroke - XK_Hstroke } else if sym >= XK_Gbreve && sym <= XK_Jcircumflex { lower += XK_gbreve - XK_Gbreve } else if sym >= XK_hstroke && sym <= XK_hcircumflex { upper -= XK_hstroke - XK_Hstroke } else if sym >= XK_gbreve && sym <= XK_jcircumflex { upper -= XK_gbreve - XK_Gbreve } else if sym >= XK_Cabovedot && sym <= XK_Scircumflex { lower += XK_cabovedot - XK_Cabovedot } else if sym >= XK_cabovedot && sym <= XK_scircumflex { upper -= XK_cabovedot - XK_Cabovedot } case 3: /* Latin 4 */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if sym >= XK_Rcedilla && sym <= XK_Tslash { lower += XK_rcedilla - XK_Rcedilla } else if sym >= XK_rcedilla && sym <= XK_tslash { upper -= XK_rcedilla - XK_Rcedilla } else if sym == XK_ENG { lower = XK_eng } else if sym == XK_eng { upper = XK_ENG } else if sym >= XK_Amacron && sym <= XK_Umacron { lower += XK_amacron - XK_Amacron } else if sym >= XK_amacron && sym <= XK_umacron { upper -= XK_amacron - XK_Amacron } case 6: /* Cyrillic */ /* Assume the KeySym is a legal value (ignore discontinuities) */ if sym >= XK_Serbian_DJE && sym <= XK_Serbian_DZE { lower -= XK_Serbian_DJE - XK_Serbian_dje } else if sym >= XK_Serbian_dje && sym <= XK_Serbian_dze { upper += XK_Serbian_DJE - XK_Serbian_dje } else if sym >= XK_Cyrillic_YU && sym <= XK_Cyrillic_HARDSIGN { lower -= XK_Cyrillic_YU - XK_Cyrillic_yu } else if sym >= XK_Cyrillic_yu && sym <= XK_Cyrillic_hardsign { upper += XK_Cyrillic_YU - XK_Cyrillic_yu } case 7: /* Greek */ if sym >= XK_Greek_ALPHAaccent && sym <= XK_Greek_OMEGAaccent { lower += XK_Greek_alphaaccent - XK_Greek_ALPHAaccent } else if sym >= XK_Greek_alphaaccent && sym <= XK_Greek_omegaaccent && sym != XK_Greek_iotaaccentdieresis && sym != XK_Greek_upsilonaccentdieresis { upper -= XK_Greek_alphaaccent - XK_Greek_ALPHAaccent } else if sym >= XK_Greek_ALPHA && sym <= XK_Greek_OMEGA { lower += XK_Greek_alpha - XK_Greek_ALPHA } else if sym >= XK_Greek_alpha && sym <= XK_Greek_omega && sym != XK_Greek_finalsmallsigma { upper -= XK_Greek_alpha - XK_Greek_ALPHA } case 0x14: /* Armenian */ if sym >= XK_Armenian_AYB && sym <= XK_Armenian_fe { lower = sym | 1 upper = sym &^ 1 } } return } /* Tests for classes of symbols */ func IsKeypadKey(sym x.Keysym) bool { return sym >= XK_KP_Space && sym <= XK_KP_Equal } func IsPrivateKeypadKey(sym x.Keysym) bool { return (sym >= 0x11000000) && (sym <= 0x1100FFFF) } func IsCursorKey(sym x.Keysym) bool { return sym >= XK_Home && sym <= XK_Begin } func IsKeypadFuncationKey(sym x.Keysym) bool { return sym >= XK_KP_F1 && sym <= XK_KP_F4 } func IsFunctionKey(sym x.Keysym) bool { return sym >= XK_F1 && sym <= XK_F35 } func IsMiscFunctionKey(sym x.Keysym) bool { return sym >= XK_Select && sym <= XK_Break } func IsModifierKey(sym x.Keysym) bool { return ((sym >= XK_Shift_L) && (sym <= XK_Hyper_R)) || ((sym >= XK_ISO_Lock) && (sym <= XK_ISO_Level5_Lock)) || (sym == XK_Mode_switch) || (sym == XK_Num_Lock) } go-x11-client-1.0.2/util/mousebind/000077500000000000000000000000001460713373000167505ustar00rootroot00000000000000go-x11-client-1.0.2/util/mousebind/mousebind.go000066400000000000000000000022231460713373000212630ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package mousebind import ( x "github.com/linuxdeepin/go-x11-client" ) func GrabPointer(conn *x.Conn, win x.Window, eventMask uint16, confineTo x.Window, cursor x.Cursor) error { reply, err := x.GrabPointer(conn, true, win, eventMask, x.GrabModeAsync, x.GrabModeAsync, confineTo, cursor, x.CurrentTime).Reply(conn) if err != nil { return err } if reply.Status == x.GrabStatusSuccess { return nil } return GrabPointerError{reply.Status} } type GrabPointerError struct { Status byte } func (err GrabPointerError) Error() string { const errMsgPrefix = "GrabPointer Failed status: " switch err.Status { case x.GrabStatusAlreadyGrabbed: return errMsgPrefix + "AlreadyGrabbed" case x.GrabStatusInvalidTime: return errMsgPrefix + "InvalidTime" case x.GrabStatusNotViewable: return errMsgPrefix + "NotViewable" case x.GrabStatusFrozen: return errMsgPrefix + "Frozen" default: return errMsgPrefix + "Unknown" } } func UngrabPointer(conn *x.Conn) error { return x.UngrabPointerChecked(conn, x.CurrentTime).Check(conn) } go-x11-client-1.0.2/util/tool/000077500000000000000000000000001460713373000157405ustar00rootroot00000000000000go-x11-client-1.0.2/util/tool/gen-keysymdef/000077500000000000000000000000001460713373000205075ustar00rootroot00000000000000go-x11-client-1.0.2/util/tool/gen-keysymdef/gen.sh000077500000000000000000000003041460713373000216140ustar00rootroot00000000000000#!/bin/sh gopath=`go env GOPATH` ./gen-keysymdef 2>log |gofmt > $gopath/src/github.com/linuxdeepin/go-x11-client/util/keysyms/auto.go go build -v github.com/linuxdeepin/go-x11-client/util/keysyms go-x11-client-1.0.2/util/tool/gen-keysymdef/main.go000066400000000000000000000153521460713373000217700ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package main import ( "bufio" "fmt" "log" "os" "regexp" "strconv" "strings" ) const ( goPkgName = "keysyms" keysymdefFile = "/usr/include/X11/keysymdef.h" xf86keysymFile = "/usr/include/X11/XF86keysym.h" ) type Keysym struct { Name string Value string Unicode string Comment string } func (ks *Keysym) getVisibleChar() string { if ks.Unicode == "" { return "" } if len(ks.Unicode) <= 4 { zeroCount := 4 - len(ks.Unicode) return "\\u" + strings.Repeat("0", zeroCount) + strings.ToLower(ks.Unicode) } else if len(ks.Unicode) <= 8 { zeroCount := 8 - len(ks.Unicode) return "\\U" + strings.Repeat("0", zeroCount) + strings.ToLower(ks.Unicode) } else { panic(fmt.Errorf("keysym %s invalid unicode %q", ks.Name, ks.Unicode)) } } var reIfDef = regexp.MustCompile(`^#ifdef\s+(\w+)`) var reDef0 = regexp.MustCompile(`^#define (XK_[a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*/\* U\+([0-9A-F]{4,6}) (.*)\s*\*/`) var reDef1 = regexp.MustCompile(`^#define (XK_[a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*/\*\(U\+([0-9A-F]{4,6}) (.*)\)\*/`) var reDef2 = regexp.MustCompile(`^#define (XK_[a-zA-Z_0-9]+)\s+0x([0-9a-f]+)\s*(/\*\s*(.*)\s*\*/)?`) // for xf86keys var reDef3 = regexp.MustCompile(`^#define (XF86XK_[a-zA-Z_0-9]+)\s+0x([0-9a-fA-F]+)\s*(/\*\s*(.*)\s*\*/)?`) var sections = []string{ "XK_MISCELLANY", "XK_XKB_KEYS", "XK_LATIN1", "XK_LATIN2", "XK_LATIN3", "XK_LATIN4", "XK_LATIN8", "XK_LATIN9", "XK_CAUCASUS", "XK_GREEK", "XK_KATAKANA", "XK_ARABIC", "XK_CYRILLIC", "XK_HEBREW", "XK_THAI", "XK_KOREAN", "XK_ARMENIAN", "XK_GEORGIAN", "XK_VIETNAMESE", "XK_CURRENCY", "XK_MATHEMATICAL", "XK_BRAILLE", "XK_SINHALA", } func definedSection(section string) bool { for _, value := range sections { if value == section { return true } } return false } func processKeysymdef() []Keysym { fh, err := os.Open(keysymdefFile) if err != nil { log.Fatal(err) } defer fh.Close() var currentSection string var currentSectionOk bool = true scanner := bufio.NewScanner(fh) // stat vars var ( def0Count int def1Count int def2Count int defOtherCount int ) var symbols []Keysym for scanner.Scan() { line := scanner.Text() result := reIfDef.FindStringSubmatch(line) if len(result) > 0 { currentSection = result[1] currentSectionOk = definedSection(currentSection) continue } if strings.HasPrefix(line, "#endif") { if currentSection != "" { currentSection = "" } currentSectionOk = false continue } // ignore some section if !currentSectionOk { log.Println("ignore ", line) continue } result = reDef0.FindStringSubmatch(line) if len(result) > 0 { def0Count++ log.Printf("def0 result: %#v\n", result[1:]) symbols = append(symbols, Keysym{ Name: result[1], Value: result[2], Unicode: result[3], Comment: getComment(result[3], result[4]), }) continue } result = reDef1.FindStringSubmatch(line) if len(result) > 0 { def1Count++ log.Printf("def1 result: %#v\n", result[1:]) symbols = append(symbols, Keysym{ Name: result[1], Value: result[2], Unicode: result[3], Comment: getComment(result[3], result[4]), }) continue } result = reDef2.FindStringSubmatch(line) if len(result) > 0 { def2Count++ log.Printf("def2 result: %#v\n", result[1:]) // no unicode symbols = append(symbols, Keysym{ Name: result[1], Value: result[2], Comment: result[4], }) continue } if strings.HasPrefix(line, "#define") { defOtherCount++ log.Println("warn line: ", line) continue } } if err := scanner.Err(); err != nil { log.Fatal(err) } log.Printf("stat:\ndef0: %d\ndef1: %d\ndef2: %d\ndef other: %d\n", def0Count, def1Count, def2Count, defOtherCount) return symbols } func processXF86Keysymdef() []Keysym { fh, err := os.Open(xf86keysymFile) if err != nil { log.Fatal(err) } defer fh.Close() scanner := bufio.NewScanner(fh) var defOtherCount int var def3Count int var symbols []Keysym for scanner.Scan() { line := scanner.Text() result := reDef3.FindStringSubmatch(line) if len(result) > 0 { def3Count++ log.Printf("def3 result: %#v\n", result[1:]) // no unicode symbols = append(symbols, Keysym{ Name: result[1], Value: result[2], Comment: result[4], }) continue } if strings.HasPrefix(line, "#define") { defOtherCount++ log.Println("warn line: ", line) continue } } log.Printf("stat:\ndef3: %d\ndef other: %d\n", def3Count, defOtherCount) if err := scanner.Err(); err != nil { log.Fatal(err) } return symbols } func getComment(unicode_, comment string) string { if unicode_ != "" { return fmt.Sprintf("U+%s %s", unicode_, comment) } return comment } func main() { log.SetFlags(log.Lshortfile) fmt.Println("package", goPkgName) fmt.Printf("import x %q\n", "github.com/linuxdeepin/go-x11-client") symbols := processKeysymdef() xf86Symbols := processXF86Keysymdef() symbols = append(symbols, xf86Symbols...) // define constants fmt.Println("const (") for _, sym := range symbols { if sym.Comment != "" { fmt.Println("// ", sym.Comment) } fmt.Printf("%s = 0x%s\n", sym.Name, sym.Value) } fmt.Println(")") // map keysym => english str var tempMap = make(map[string]string, len(symbols)) fmt.Println("var KeysymEngMap = map[x.Keysym]string{") for _, sym := range symbols { dupSym, ok := tempMap[sym.Value] if ok { fmt.Printf("// %s == %s # %s\n", sym.Name, dupSym, sym.Comment) } else { tempMap[sym.Value] = sym.Name fmt.Printf("%s:%q,\n", sym.Name, getEnglish(sym.Name)) } } fmt.Println("}") // map english str => keysym fmt.Println("var EngKeysymMap = map[string]x.Keysym{") for _, sym := range symbols { fmt.Printf("%q:%s,\n", getEnglish(sym.Name), sym.Name) } fmt.Println("}") // map keysym => visible character tempMap = make(map[string]string, len(symbols)) fmt.Println("var KeysymVisibleCharMap = map[x.Keysym]rune{") for _, sym := range symbols { visibleChar := sym.getVisibleChar() if visibleChar == "" { continue } dupSym, ok := tempMap[sym.Value] if ok { fmt.Printf("// %s == %s # %s\n", sym.Name, dupSym, sym.Comment) } else { tempMap[sym.Value] = sym.Name str, err := strconv.Unquote("'" + visibleChar + "'") if err != nil { panic(fmt.Errorf("failed to unquote %q", visibleChar)) } fmt.Printf("%s:'%s', // %s\n", sym.Name, visibleChar, str) } } fmt.Println("}") } func getEnglish(symName string) string { if strings.HasPrefix(symName, "XK_") { return symName[len("XK_"):] } else if strings.HasPrefix(symName, "XF86XK_") { return "XF86" + symName[len("XF86XK_"):] } else { panic("invalid symbol name:" + symName) } } go-x11-client-1.0.2/util/wm/000077500000000000000000000000001460713373000154065ustar00rootroot00000000000000go-x11-client-1.0.2/util/wm/ewmh/000077500000000000000000000000001460713373000163465ustar00rootroot00000000000000go-x11-client-1.0.2/util/wm/ewmh/a.py000077500000000000000000000542131460713373000171500ustar00rootroot00000000000000#!/usr/bin/env python3 # SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. # # SPDX-License-Identifier: GPL-3.0-or-later _lines = [] CHECKED = ['Checked', ''] UNCHECKED = ['', 'Unchecked'] def l(fmt, *arg): _lines.append(fmt % arg) def DO_GET_PROPERTY(sth, _property, atype, length, cookie_type): return_type = 'Get' + cookie_type + 'Cookie' l('\nfunc Get%s(c *x.Conn, window x.Window) %s{', sth, return_type) l(' atom, _ := c.GetAtom("%s")', _property) l(' cookie := x.GetProperty(c, false, window,\natom, %s, 0, %s)', atype, length) l(' return %s(cookie)', return_type) l('}') def DO_GET_ROOT_PROPERTY(sth, _property, atype, length, cookie_type): return_type = 'Get' + cookie_type + 'Cookie' l('\nfunc Get%s(c *x.Conn) %s{', sth, return_type) l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' cookie := x.GetProperty(c, false, rootWin,\natom,%s, 0, %s)', atype, length) l(' return %s(cookie)', return_type) l('}') def DO_REPLY_SINGLE_VALUE(sth, atype, go_type, cookie_type): # getXXXFromReply l('\nfunc get%sFromReply(r *x.GetPropertyReply) (%s, error) {', sth, go_type) l(' if r.Format != 32 || len(r.Value) != 4 {') l(' return 0, errors.New("bad reply")') l(' }') # end if l(' return %s(x.Get32(r.Value)), nil', go_type) l('}') # end func # define type GetYYYCookie DO_COOKIE_REPLY(cookie_type, atype, go_type, 0) def DO_SINGLE_VALUE(sth, _property, atype, go_type, cookie_type): DO_GET_PROPERTY(sth, _property, atype, '1', cookie_type) for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, window x.Window, val %s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') l(' w.Write4b(uint32(val))') l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, window,\natom, %s, 32, w.Bytes())', returnStr, checked, atype) l('}') def DO_ROOT_SINGLE_VALUE(sth, _property, atype, go_type, cookie_type): DO_GET_ROOT_PROPERTY(sth, _property, atype, '1', cookie_type) for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, val %s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') l(' w.Write4b(uint32(val))') l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\natom, %s, 32, w.Bytes())', returnStr, checked, atype) l('}') def DO_REPLY_LIST_VALUES(sth, atype, go_type): get_sth_from_reply = 'get' + sth + 'FromReply' l('\nfunc %s(r *x.GetPropertyReply) ([]%s, error) {', get_sth_from_reply, go_type) l(' if r.Format != 32 {') l(' return nil, errors.New("bad reply")') l(' }') # end if l(' count := len(r.Value) / 4') l(' ret := make([]%s, count)', go_type) l(' rdr := x.NewReaderFromData(r.Value)') l(' for i := 0; i < count; i++ {') l(' ret[i] = %s(rdr.Read4b())', go_type) l(' }') # end for l(' return ret, nil') l('}') # end func DO_COOKIE_REPLY(sth, atype, '[]' + go_type, 'nil') def DO_ROOT_LIST_VALUES(sth, _property, atype, go_type, cookie_type): DO_GET_ROOT_PROPERTY(sth, _property, atype, 'LENGTH_MAX', cookie_type) for checked in CHECKED: if checked == 'Checked': returnType = "x.VoidCookie" returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, vals []%s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') l(' for _, val := range vals {') l(' w.Write4b(uint32(val))') l(' }') # end for l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\n' + 'atom, %s, 32, w.Bytes())', returnStr, checked, atype) l('}') # end func def DO_LIST_VALUES(sth, _property, atype, go_type, cookie_type): DO_GET_PROPERTY(sth, _property, atype, 'LENGTH_MAX', cookie_type) for checked in CHECKED: if checked == 'Checked': returnType = "x.VoidCookie" returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, window x.Window,vals []%s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') l(' for _, val := range vals {') l(' w.Write4b(uint32(val))') l(' }') # end for l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, window,\n' + 'atom, %s, 32, w.Bytes())', returnStr, checked, atype) l('}') # end func def DO_REPLY_STRUCTURE(sth, fields): go_type = sth bad_go_value = go_type + '{}' DO_COOKIE_REPLY(sth, 'x.AtomCardinal', go_type, bad_go_value) # fields is str list # all field type is uint32 # property type is CARDINAL l('type %s struct {', go_type) l(' %s uint32', ', '.join(fields)) l('}') l('\nfunc get%sFromReply(reply *x.GetPropertyReply) (%s, error) {', sth, go_type) l(' list, err := getCardinalsFromReply(reply)') l(' if err != nil {') l(' return %s, err', bad_go_value) l(' }') # end if l('\n if len(list) != %d {', len(fields)) l(' return %s, errors.New("length of list is not %d")', bad_go_value, len(fields)) l(' }') # end if # return normal value l(' return %s{', go_type) for idx, field in enumerate(fields): l(' %s: list[%d],', field, idx) l(' }, nil') # end return l('}') # end func def DO_REPLY_STRUCTURES(sth, go_type, fields): n_fields = len(fields) DO_COOKIE_REPLY(sth, 'x.AtomCardinal', '[]' + go_type, 'nil') l('type %s struct {', go_type) l(' %s uint32', ', '.join(fields)) l('}') l('\nfunc get%sFromReply(reply *x.GetPropertyReply) ([]%s, error) {', sth, go_type) l(' list, err := getCardinalsFromReply(reply)') l(' if err != nil {') l(' return nil, err') l(' }') # end if l(' if len(list) %% %d != 0 {', n_fields) l(' return nil, errors.New("length of list is not a multiple of %d")', n_fields) l(' }') # end if l(' ret := make([]%s, len(list)/%d)', go_type, n_fields) l(' idx := 0') l(' for i := 0; i < len(list); i+=%d {', n_fields) l(' ret[idx] = %s{', go_type) for field_idx, field in enumerate(fields): if field_idx == 0: l(' %s: list[i],', field) else: l(' %s: list[i+%d],', field, field_idx) l(' }') # end struct new l(' idx++') l(' }') # end for l(' return ret, nil') l('}') # end func def DO_UTF8_STRING(sth, _property): DO_GET_PROPERTY(sth, _property, 'getAtom(c,"UTF8_STRING")', 'LENGTH_MAX', 'UTF8Str') for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, window x.Window, val string) %s {', sth, checked, returnType) l(' atom, _ := c.GetAtom("%s")', _property) l(' atomUTF8String, _ := c.GetAtom("UTF8_STRING")') l(' %s x.ChangeProperty%s(c, x.PropModeReplace, window,\natom,' + 'atomUTF8String, 8, []byte(val))', returnStr, checked) l('}') # end func def DO_ROOT_UTF8_STRING(sth, _property): DO_GET_ROOT_PROPERTY(sth, _property, 'getAtom(c,"UTF8_STRING")', 'LENGTH_MAX', 'UTF8Str') for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn,val string) %s {', sth, checked, returnType) l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' atomUTF8String, _ := c.GetAtom("UTF8_STRING")') l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\natom,' + 'atomUTF8String, 8, uint32(len(val)), []byte(val))', returnStr, checked) l('}') # end func def DO_ROOT_UTF8_STRINGS(sth, _property): DO_GET_ROOT_PROPERTY(sth, _property, 'getAtom(c,"UTF8_STRING")', 'LENGTH_MAX', 'UTF8Strs') for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, vals []string) %s {', sth, checked, returnType) l(' w := x.NewWriter()') l(' for _, val := range vals {') l(' w.WriteString(val)') l(' w.Write1b(0)') l(' }') # end for l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' atomUTF8String, _ := c.GetAtom("UTF8_STRING")') l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\natom,' + 'atomUTF8String, 8, w.Bytes())', returnStr, checked) l('}') # end func def DO_SET_ROOT_STRUCTURES(sth, _property, go_type, fields): n_fields = len(fields) for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, vals []%s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') l(' for _, val := range vals {') for field in fields: l(' w.Write4b(val.%s)', field) l(' }') # end for l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\n' + 'atom, x.AtomCardinal, 32, w.Bytes())', returnStr, checked) l('}') # end func # TODO # def DO_SET_STRUCTURES def DO_SET_ROOT_STRUCTURE(sth, _property, go_type, fields): for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, val %s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') for field in fields: l(' w.Write4b(val.%s)', field) l(' rootWin := c.GetDefaultScreen().Root') l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, rootWin,\natom,' + 'x.AtomCardinal, 32, w.Bytes())', returnStr, checked) l('}') # end func def DO_SET_STRUCTURE(sth, _property, go_type, fields): for checked in CHECKED: if checked == 'Checked': returnType = 'x.VoidCookie' returnStr = 'return' else: returnType = '' returnStr = '' l('\nfunc Set%s%s(c *x.Conn, window x.Window, val %s) %s {', sth, checked, go_type, returnType) l(' w := x.NewWriter()') for field in fields: l(' w.Write4b(val.%s)', field) l(' atom, _ := c.GetAtom("%s")', _property) l(' %s x.ChangeProperty%s(c, x.PropModeReplace, window,\natom,' + 'x.AtomCardinal, 32, w.Bytes())', returnStr, checked) l('}') # end func def DO_COOKIE_REPLY(sth, atype, go_type, bad_go_value): cookie_type = 'Get' + sth + 'Cookie' get_sth_from_reply = 'get' + sth + 'FromReply' l('type %s x.GetPropertyCookie', cookie_type) l('\nfunc (cookie %s) Reply(c *x.Conn) (%s, error) {', cookie_type, go_type) l(' reply, err := x.GetPropertyCookie(cookie).Reply(c)') l(' if err != nil {') l(' return %s, err', bad_go_value) l(' }') # end if # check reply type l(' if reply.Type != %s {', atype) l(' return %s, errors.New("bad reply")', bad_go_value) l(' }') # end if l(' return %s(reply)', get_sth_from_reply) # return good value l('}') # end func def begin(): l('package ewmh\n') l('import x "github.com/linuxdeepin/go-x11-client"') l('import "errors"') def end(): for l in _lines: print(l) def do_header(name): l('/**') l(' * %s', name) l('*/') def main(): begin() DO_COOKIE_REPLY('UTF8Str', 'getAtom(c,"UTF8_STRING")', 'string', '""') DO_COOKIE_REPLY('UTF8Strs', 'getAtom(c,"UTF8_STRING")', '[]string', 'nil') DO_COOKIE_REPLY('Boolean', 'x.AtomCardinal', 'bool', 'false') DO_REPLY_SINGLE_VALUE('Window', 'x.AtomWindow', 'x.Window', 'Window') DO_REPLY_SINGLE_VALUE('Cardinal', 'x.AtomCardinal', 'uint32', 'Cardinal') DO_REPLY_LIST_VALUES('Windows', 'x.AtomWindow', 'x.Window') DO_REPLY_LIST_VALUES('Atoms', 'x.AtomAtom', 'x.Atom') DO_REPLY_LIST_VALUES('Cardinals', 'x.AtomCardinal', 'uint32') #> _NET_SUPPORTED do_header('_NET_SUPPORTED') DO_ROOT_LIST_VALUES('Supported', '_NET_SUPPORTED', 'x.AtomAtom', 'x.Atom', 'Atoms') #> _NET_CLIENT_LIST do_header('_NET_CLIENT_LIST') DO_ROOT_LIST_VALUES('ClientList', '_NET_CLIENT_LIST', 'x.AtomWindow', 'x.Window', 'Windows') #> _NET_CLIENT_LIST_STACKING do_header('_NET_CLIENT_LIST_STACKING') DO_ROOT_LIST_VALUES('ClientListStacking', '_NET_CLIENT_LIST_STACKING', 'x.AtomWindow', 'x.Window', 'Windows') #> _NET_NUMBER_OF_DESKTOPS do_header('_NET_NUMBER_OF_DESKTOPS') DO_ROOT_SINGLE_VALUE('NumberOfDesktop', '_NET_NUMBER_OF_DESKTOPS', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_DESKTOP_GEOMETRY do_header('_NET_DESKTOP_GEOMETRY') DO_GET_ROOT_PROPERTY('DesktopGeometry', '_NET_DESKTOP_GEOMETRY', 'x.AtomCardinal', '2', 'DesktopGeometry') desktop_geometry_fields = ['Width', 'Height'] DO_REPLY_STRUCTURE('DesktopGeometry', desktop_geometry_fields) DO_SET_ROOT_STRUCTURE('DesktopGeometry', '_NET_DESKTOP_GEOMETRY', 'DesktopGeometry', desktop_geometry_fields) #> _NET_DESKTOP_VIEWPORT do_header('_NET_DESKTOP_VIEWPORT') DO_GET_ROOT_PROPERTY('DesktopViewport', '_NET_DESKTOP_VIEWPORT', 'x.AtomCardinal', 'LENGTH_MAX', 'DesktopViewport') viewport_fields = ['X', 'Y'] DO_REPLY_STRUCTURES('DesktopViewport', 'ViewportLeftTopCorner', viewport_fields) DO_SET_ROOT_STRUCTURES('DesktopViewport', '_NET_DESKTOP_VIEWPORT', 'ViewportLeftTopCorner', viewport_fields) #> _NET_CURRENT_DESKTOP do_header('_NET_CURRENT_DESKTOP') DO_ROOT_SINGLE_VALUE('CurrentDesktop', '_NET_CURRENT_DESKTOP', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_DESKTOP_NAMES do_header('_NET_DESKTOP_NAMES') DO_ROOT_UTF8_STRINGS('DesktopNames', '_NET_DESKTOP_NAMES') #> _NET_ACTIVE_WINDOW do_header('_NET_ACTIVE_WINDOW') DO_ROOT_SINGLE_VALUE('ActiveWindow', '_NET_ACTIVE_WINDOW', 'x.AtomWindow', 'x.Window', 'Window') #> _NET_WORKAREA do_header('_NET_WORKAREA') DO_GET_ROOT_PROPERTY('Workarea', '_NET_WORKAREA', 'x.AtomCardinal', 'LENGTH_MAX', 'Workarea') workarea_geo_fields = ['X', 'Y', 'Width', 'Height'] DO_REPLY_STRUCTURES('Workarea', 'WorkareaGeometry', workarea_geo_fields) DO_SET_ROOT_STRUCTURES('Workarea', '_NET_WORKAREA', 'WorkareaGeometry', workarea_geo_fields) #> _NET_SUPPORTING_WM_CHECK do_header('_NET_SUPPORTING_WM_CHECK') DO_ROOT_SINGLE_VALUE('SupportingWMCheck', '_NET_SUPPORTING_WM_CHECK', 'x.AtomWindow', 'x.Window', 'Window') #> _NET_VIRTUAL_ROOTS do_header('_NET_VIRTUAL_ROOTS') DO_ROOT_LIST_VALUES('VirtualRoots', '_NET_VIRTUAL_ROOTS', 'x.AtomWindow', 'x.Window', 'Windows') #> _NET_DESKTOP_LAYOUT do_header('_NET_DESKTOP_LAYOUT') DO_GET_ROOT_PROPERTY('DesktopLayout', '_NET_DESKTOP_LAYOUT', 'x.AtomCardinal', '4', 'DesktopLayout') desktop_layout_fields = [ 'Orientation', 'Columns', 'Rows', 'StartingCorner' ] DO_REPLY_STRUCTURE('DesktopLayout', desktop_layout_fields) DO_SET_ROOT_STRUCTURE('DesktopLayout', '_NET_DESKTOP_LAYOUT', 'DesktopLayout', desktop_layout_fields) #> _NET_SHOWING_DESKTOP do_header('_NET_SHOWING_DESKTOP') DO_GET_ROOT_PROPERTY('ShowingDesktop', '_NET_SHOWING_DESKTOP', 'x.AtomCardinal', '1', 'Boolean') #> _NET_WM_NAME do_header('_NET_WM_NAME') DO_UTF8_STRING('WMName', '_NET_WM_NAME') #> _NET_WM_VISIBLE_NAME do_header('_NET_WM_VISIBLE_NAME') DO_UTF8_STRING('WMVisibleName', '_NET_WM_VISIBLE_NAME') #> _NET_WM_ICON_NAME do_header('_NET_WM_ICON_NAME') DO_UTF8_STRING('WMIconName', '_NET_WM_ICON_NAME') #> _NET_WM_VISIBLE_ICON_NAME do_header('_NET_WM_VISIBLE_ICON_NAME') DO_UTF8_STRING('WMVisibleIconName', '_NET_WM_VISIBLE_ICON_NAME') #> _NET_WM_DESKTOP do_header('_NET_WM_DESKTOP') DO_SINGLE_VALUE('WMDesktop', '_NET_WM_DESKTOP', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_WM_WINDOW_TYPE do_header('_NET_WM_WINDOW_TYPE') DO_LIST_VALUES('WMWindowType', '_NET_WM_WINDOW_TYPE', 'x.AtomAtom', 'x.Atom', 'Atoms') #> _NET_WM_STATE do_header('_NET_WM_STATE') DO_LIST_VALUES('WMState', '_NET_WM_STATE', 'x.AtomAtom', 'x.Atom', 'Atoms') #> _NET_WM_ALLOWED_ACTIONS do_header('_NET_WM_ALLOWED_ACTIONS') DO_LIST_VALUES('WMAllowedActions', '_NET_WM_ALLOWED_ACTIONS', 'x.AtomAtom', 'x.Atom', 'Atoms') #> _NET_WM_STRUT do_header('_NET_WM_STRUT') DO_GET_PROPERTY('WMStrut', '_NET_WM_STRUT', 'x.AtomCardinal', '4', 'WMStrut') strut_fields = ['Left', 'Right', 'Top', 'Bottom'] DO_REPLY_STRUCTURE('WMStrut', strut_fields) DO_SET_STRUCTURE('WMStrut', '_NET_WM_STRUT', 'WMStrut', strut_fields) #> _NET_WM_STRUT_PARTIAL do_header('_NET_WM_STRUT_PARTIAL') DO_GET_PROPERTY('WMStrutPartial', '_NET_WM_STRUT_PARTIAL', 'x.AtomCardinal', '12', 'WMStrutPartial') strut_partial_fields = strut_fields + [ 'LeftStartY', 'LeftEndY', 'RightStartY', 'RightEndY', 'TopStartX', 'TopEndX', 'BottomStartX', 'BottomEndX' ] DO_REPLY_STRUCTURE('WMStrutPartial', strut_partial_fields) DO_SET_STRUCTURE('WMStrutPartial', '_NET_WM_STRUT_PARTIAL', 'WMStrutPartial', strut_partial_fields) #> _NET_WM_ICON_GEOMETRY do_header('_NET_WM_ICON_GEOMETRY') DO_GET_PROPERTY('WMIconGeometry', '_NET_WM_ICON_GEOMETRY', 'x.AtomCardinal', '4', 'WMIconGeometry') icon_geometry = ['X', 'Y', 'Width', 'Height'] DO_REPLY_STRUCTURE('WMIconGeometry', icon_geometry) DO_SET_STRUCTURE('WMIconGeometry', '_NET_WM_ICON_GEOMETRY', 'WMIconGeometry', icon_geometry) #> _NET_WM_ICON do_header('_NET_WM_ICON') DO_GET_PROPERTY('WMIcon', '_NET_WM_ICON', 'x.AtomCardinal', 'LENGTH_MAX', 'WMIcon') DO_COOKIE_REPLY('WMIcon', 'x.AtomCardinal', '[]WMIcon', 'nil') #> _NET_WM_PID do_header('_NET_WM_PID') DO_SINGLE_VALUE('WMPid', '_NET_WM_PID', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_WM_HANDLED_ICONS do_header('_NET_WM_HANDLED_ICONS') DO_SINGLE_VALUE('WMHandledIcons', '_NET_WM_HANDLED_ICONS', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_WM_USER_TIME do_header('_NET_WM_USER_TIME') DO_SINGLE_VALUE('WMUserTime', '_NET_WM_USER_TIME', 'x.AtomCardinal', 'uint32', 'Cardinal') #> _NET_WM_USER_TIME_WINDOW do_header('_NET_WM_USER_TIME_WINDOW') DO_SINGLE_VALUE('WMUserTimeWindow', '_NET_WM_USER_TIME_WINDOW', 'x.AtomWindow', 'x.Window', 'Window') #> _NET_FRAME_EXTENTS do_header('_NET_FRAME_EXTENTS') DO_GET_PROPERTY('FrameExtents', '_NET_FRAME_EXTENTS', 'x.AtomCardinal', '4', 'FrameExtents') frame_extents_fields = ['Left', 'Right', 'Top', 'Bottom'] DO_REPLY_STRUCTURE('FrameExtents', frame_extents_fields) DO_SET_STRUCTURE('FrameExtents', '_NET_FRAME_EXTENTS', 'FrameExtents', frame_extents_fields) #> _NET_WM_SYNC_REQUEST_COUNTER do_header('_NET_WM_SYNC_REQUEST_COUNTER') DO_GET_PROPERTY('WMSyncRequestCounter', '_NET_WM_SYNC_REQUEST_COUNTER', 'x.AtomCardinal', '2', 'WMSyncRequestCounter') request_counter_fields = ['Low', 'High'] DO_REPLY_STRUCTURE('WMSyncRequestCounter', request_counter_fields) DO_SET_STRUCTURE('WMSyncRequestCounter', '_NET_WM_SYNC_REQUEST_COUNTER', 'WMSyncRequestCounter', request_counter_fields) #> _NET_WM_FULLSCREEN_MONITORS do_header('_NET_WM_FULLSCREEN_MONITORS') DO_GET_PROPERTY('WMFullscreenMonitors', '_NET_WM_FULLSCREEN_MONITORS', 'x.AtomCardinal', '4', 'WMFullscreenMonitors') fullscreen_monitors_fields = ['Top', 'Bottom', 'Left', 'Right'] DO_REPLY_STRUCTURE('WMFullscreenMonitors', fullscreen_monitors_fields) DO_SET_STRUCTURE('WMFullscreenMonitors', '_NET_WM_FULLSCREEN_MONITORS', 'WMFullscreenMonitors', fullscreen_monitors_fields) end() if __name__ == '__main__': main() go-x11-client-1.0.2/util/wm/ewmh/auto.go000066400000000000000000001202201460713373000176420ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package ewmh import x "github.com/linuxdeepin/go-x11-client" import "errors" type GetUTF8StrCookie x.GetPropertyCookie func (cookie GetUTF8StrCookie) Reply(c *x.Conn) (string, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return "", err } if reply.Type != getAtom(c, "UTF8_STRING") { return "", errors.New("bad reply") } return getUTF8StrFromReply(reply) } type GetUTF8StrsCookie x.GetPropertyCookie func (cookie GetUTF8StrsCookie) Reply(c *x.Conn) ([]string, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != getAtom(c, "UTF8_STRING") { return nil, errors.New("bad reply") } return getUTF8StrsFromReply(reply) } type GetBooleanCookie x.GetPropertyCookie func (cookie GetBooleanCookie) Reply(c *x.Conn) (bool, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return false, err } if reply.Type != x.AtomCardinal { return false, errors.New("bad reply") } return getBooleanFromReply(reply) } func getWindowFromReply(r *x.GetPropertyReply) (x.Window, error) { if r.Format != 32 || len(r.Value) != 4 { return 0, errors.New("bad reply") } return x.Window(x.Get32(r.Value)), nil } type GetWindowCookie x.GetPropertyCookie func (cookie GetWindowCookie) Reply(c *x.Conn) (x.Window, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return 0, err } if reply.Type != x.AtomWindow { return 0, errors.New("bad reply") } return getWindowFromReply(reply) } func getCardinalFromReply(r *x.GetPropertyReply) (uint32, error) { if r.Format != 32 || len(r.Value) != 4 { return 0, errors.New("bad reply") } return uint32(x.Get32(r.Value)), nil } type GetCardinalCookie x.GetPropertyCookie func (cookie GetCardinalCookie) Reply(c *x.Conn) (uint32, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return 0, err } if reply.Type != x.AtomCardinal { return 0, errors.New("bad reply") } return getCardinalFromReply(reply) } func getWindowsFromReply(r *x.GetPropertyReply) ([]x.Window, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]x.Window, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = x.Window(rdr.Read4b()) } return ret, nil } type GetWindowsCookie x.GetPropertyCookie func (cookie GetWindowsCookie) Reply(c *x.Conn) ([]x.Window, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomWindow { return nil, errors.New("bad reply") } return getWindowsFromReply(reply) } func getAtomsFromReply(r *x.GetPropertyReply) ([]x.Atom, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]x.Atom, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = x.Atom(rdr.Read4b()) } return ret, nil } type GetAtomsCookie x.GetPropertyCookie func (cookie GetAtomsCookie) Reply(c *x.Conn) ([]x.Atom, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomAtom { return nil, errors.New("bad reply") } return getAtomsFromReply(reply) } func getCardinalsFromReply(r *x.GetPropertyReply) ([]uint32, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]uint32, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = uint32(rdr.Read4b()) } return ret, nil } type GetCardinalsCookie x.GetPropertyCookie func (cookie GetCardinalsCookie) Reply(c *x.Conn) ([]uint32, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomCardinal { return nil, errors.New("bad reply") } return getCardinalsFromReply(reply) } /** * _NET_SUPPORTED */ func GetSupported(c *x.Conn) GetAtomsCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTED") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomAtom, 0, LENGTH_MAX) return GetAtomsCookie(cookie) } func SetSupportedChecked(c *x.Conn, vals []x.Atom) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTED") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomAtom, 32, w.Bytes()) } func SetSupported(c *x.Conn, vals []x.Atom) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTED") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomAtom, 32, w.Bytes()) } /** * _NET_CLIENT_LIST */ func GetClientList(c *x.Conn) GetWindowsCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomWindow, 0, LENGTH_MAX) return GetWindowsCookie(cookie) } func SetClientListChecked(c *x.Conn, vals []x.Window) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } func SetClientList(c *x.Conn, vals []x.Window) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_CLIENT_LIST_STACKING */ func GetClientListStacking(c *x.Conn) GetWindowsCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST_STACKING") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomWindow, 0, LENGTH_MAX) return GetWindowsCookie(cookie) } func SetClientListStackingChecked(c *x.Conn, vals []x.Window) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST_STACKING") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } func SetClientListStacking(c *x.Conn, vals []x.Window) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CLIENT_LIST_STACKING") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_NUMBER_OF_DESKTOPS */ func GetNumberOfDesktop(c *x.Conn) GetCardinalCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_NUMBER_OF_DESKTOPS") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetNumberOfDesktopChecked(c *x.Conn, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_NUMBER_OF_DESKTOPS") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetNumberOfDesktop(c *x.Conn, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_NUMBER_OF_DESKTOPS") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_DESKTOP_GEOMETRY */ func GetDesktopGeometry(c *x.Conn) GetDesktopGeometryCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_GEOMETRY") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, 2) return GetDesktopGeometryCookie(cookie) } type GetDesktopGeometryCookie x.GetPropertyCookie func (cookie GetDesktopGeometryCookie) Reply(c *x.Conn) (DesktopGeometry, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return DesktopGeometry{}, err } if reply.Type != x.AtomCardinal { return DesktopGeometry{}, errors.New("bad reply") } return getDesktopGeometryFromReply(reply) } type DesktopGeometry struct { Width, Height uint32 } func getDesktopGeometryFromReply(reply *x.GetPropertyReply) (DesktopGeometry, error) { list, err := getCardinalsFromReply(reply) if err != nil { return DesktopGeometry{}, err } if len(list) != 2 { return DesktopGeometry{}, errors.New("length of list is not 2") } return DesktopGeometry{ Width: list[0], Height: list[1], }, nil } func SetDesktopGeometryChecked(c *x.Conn, val DesktopGeometry) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Width) w.Write4b(val.Height) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_GEOMETRY") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetDesktopGeometry(c *x.Conn, val DesktopGeometry) { w := x.NewWriter() w.Write4b(val.Width) w.Write4b(val.Height) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_GEOMETRY") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_DESKTOP_VIEWPORT */ func GetDesktopViewport(c *x.Conn) GetDesktopViewportCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_VIEWPORT") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, LENGTH_MAX) return GetDesktopViewportCookie(cookie) } type GetDesktopViewportCookie x.GetPropertyCookie func (cookie GetDesktopViewportCookie) Reply(c *x.Conn) ([]ViewportLeftTopCorner, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomCardinal { return nil, errors.New("bad reply") } return getDesktopViewportFromReply(reply) } type ViewportLeftTopCorner struct { X, Y uint32 } func getDesktopViewportFromReply(reply *x.GetPropertyReply) ([]ViewportLeftTopCorner, error) { list, err := getCardinalsFromReply(reply) if err != nil { return nil, err } if len(list)%2 != 0 { return nil, errors.New("length of list is not a multiple of 2") } ret := make([]ViewportLeftTopCorner, len(list)/2) idx := 0 for i := 0; i < len(list); i += 2 { ret[idx] = ViewportLeftTopCorner{ X: list[i], Y: list[i+1], } idx++ } return ret, nil } func SetDesktopViewportChecked(c *x.Conn, vals []ViewportLeftTopCorner) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(val.X) w.Write4b(val.Y) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_VIEWPORT") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetDesktopViewport(c *x.Conn, vals []ViewportLeftTopCorner) { w := x.NewWriter() for _, val := range vals { w.Write4b(val.X) w.Write4b(val.Y) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_VIEWPORT") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_CURRENT_DESKTOP */ func GetCurrentDesktop(c *x.Conn) GetCardinalCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CURRENT_DESKTOP") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetCurrentDesktopChecked(c *x.Conn, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CURRENT_DESKTOP") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetCurrentDesktop(c *x.Conn, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_CURRENT_DESKTOP") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_DESKTOP_NAMES */ func GetDesktopNames(c *x.Conn) GetUTF8StrsCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_NAMES") cookie := x.GetProperty(c, false, rootWin, atom, getAtom(c, "UTF8_STRING"), 0, LENGTH_MAX) return GetUTF8StrsCookie(cookie) } func SetDesktopNamesChecked(c *x.Conn, vals []string) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.WriteString(val) w.Write1b(0) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_NAMES") atomUTF8String, _ := c.GetAtom("UTF8_STRING") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, atomUTF8String, 8, w.Bytes()) } func SetDesktopNames(c *x.Conn, vals []string) { w := x.NewWriter() for _, val := range vals { w.WriteString(val) w.Write1b(0) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_NAMES") atomUTF8String, _ := c.GetAtom("UTF8_STRING") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, atomUTF8String, 8, w.Bytes()) } /** * _NET_ACTIVE_WINDOW */ func GetActiveWindow(c *x.Conn) GetWindowCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_ACTIVE_WINDOW") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomWindow, 0, 1) return GetWindowCookie(cookie) } func SetActiveWindowChecked(c *x.Conn, val x.Window) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_ACTIVE_WINDOW") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } func SetActiveWindow(c *x.Conn, val x.Window) { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_ACTIVE_WINDOW") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_WORKAREA */ func GetWorkarea(c *x.Conn) GetWorkareaCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_WORKAREA") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, LENGTH_MAX) return GetWorkareaCookie(cookie) } type GetWorkareaCookie x.GetPropertyCookie func (cookie GetWorkareaCookie) Reply(c *x.Conn) ([]WorkareaGeometry, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomCardinal { return nil, errors.New("bad reply") } return getWorkareaFromReply(reply) } type WorkareaGeometry struct { X, Y, Width, Height uint32 } func getWorkareaFromReply(reply *x.GetPropertyReply) ([]WorkareaGeometry, error) { list, err := getCardinalsFromReply(reply) if err != nil { return nil, err } if len(list)%4 != 0 { return nil, errors.New("length of list is not a multiple of 4") } ret := make([]WorkareaGeometry, len(list)/4) idx := 0 for i := 0; i < len(list); i += 4 { ret[idx] = WorkareaGeometry{ X: list[i], Y: list[i+1], Width: list[i+2], Height: list[i+3], } idx++ } return ret, nil } func SetWorkareaChecked(c *x.Conn, vals []WorkareaGeometry) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(val.X) w.Write4b(val.Y) w.Write4b(val.Width) w.Write4b(val.Height) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_WORKAREA") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWorkarea(c *x.Conn, vals []WorkareaGeometry) { w := x.NewWriter() for _, val := range vals { w.Write4b(val.X) w.Write4b(val.Y) w.Write4b(val.Width) w.Write4b(val.Height) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_WORKAREA") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_SUPPORTING_WM_CHECK */ func GetSupportingWMCheck(c *x.Conn) GetWindowCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTING_WM_CHECK") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomWindow, 0, 1) return GetWindowCookie(cookie) } func SetSupportingWMCheckChecked(c *x.Conn, val x.Window) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTING_WM_CHECK") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } func SetSupportingWMCheck(c *x.Conn, val x.Window) { w := x.NewWriter() w.Write4b(uint32(val)) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SUPPORTING_WM_CHECK") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_VIRTUAL_ROOTS */ func GetVirtualRoots(c *x.Conn) GetWindowsCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_VIRTUAL_ROOTS") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomWindow, 0, LENGTH_MAX) return GetWindowsCookie(cookie) } func SetVirtualRootsChecked(c *x.Conn, vals []x.Window) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_VIRTUAL_ROOTS") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } func SetVirtualRoots(c *x.Conn, vals []x.Window) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_VIRTUAL_ROOTS") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_DESKTOP_LAYOUT */ func GetDesktopLayout(c *x.Conn) GetDesktopLayoutCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_LAYOUT") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, 4) return GetDesktopLayoutCookie(cookie) } type GetDesktopLayoutCookie x.GetPropertyCookie func (cookie GetDesktopLayoutCookie) Reply(c *x.Conn) (DesktopLayout, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return DesktopLayout{}, err } if reply.Type != x.AtomCardinal { return DesktopLayout{}, errors.New("bad reply") } return getDesktopLayoutFromReply(reply) } type DesktopLayout struct { Orientation, Columns, Rows, StartingCorner uint32 } func getDesktopLayoutFromReply(reply *x.GetPropertyReply) (DesktopLayout, error) { list, err := getCardinalsFromReply(reply) if err != nil { return DesktopLayout{}, err } if len(list) != 4 { return DesktopLayout{}, errors.New("length of list is not 4") } return DesktopLayout{ Orientation: list[0], Columns: list[1], Rows: list[2], StartingCorner: list[3], }, nil } func SetDesktopLayoutChecked(c *x.Conn, val DesktopLayout) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Orientation) w.Write4b(val.Columns) w.Write4b(val.Rows) w.Write4b(val.StartingCorner) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_LAYOUT") return x.ChangePropertyChecked(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } func SetDesktopLayout(c *x.Conn, val DesktopLayout) { w := x.NewWriter() w.Write4b(val.Orientation) w.Write4b(val.Columns) w.Write4b(val.Rows) w.Write4b(val.StartingCorner) rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_DESKTOP_LAYOUT") x.ChangeProperty(c, x.PropModeReplace, rootWin, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_SHOWING_DESKTOP */ func GetShowingDesktop(c *x.Conn) GetBooleanCookie { rootWin := c.GetDefaultScreen().Root atom, _ := c.GetAtom("_NET_SHOWING_DESKTOP") cookie := x.GetProperty(c, false, rootWin, atom, x.AtomCardinal, 0, 1) return GetBooleanCookie(cookie) } /** * _NET_WM_NAME */ func GetWMName(c *x.Conn, window x.Window) GetUTF8StrCookie { atom, _ := c.GetAtom("_NET_WM_NAME") cookie := x.GetProperty(c, false, window, atom, getAtom(c, "UTF8_STRING"), 0, LENGTH_MAX) return GetUTF8StrCookie(cookie) } func SetWMNameChecked(c *x.Conn, window x.Window, val string) x.VoidCookie { atom, _ := c.GetAtom("_NET_WM_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } func SetWMName(c *x.Conn, window x.Window, val string) { atom, _ := c.GetAtom("_NET_WM_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") x.ChangeProperty(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } /** * _NET_WM_VISIBLE_NAME */ func GetWMVisibleName(c *x.Conn, window x.Window) GetUTF8StrCookie { atom, _ := c.GetAtom("_NET_WM_VISIBLE_NAME") cookie := x.GetProperty(c, false, window, atom, getAtom(c, "UTF8_STRING"), 0, LENGTH_MAX) return GetUTF8StrCookie(cookie) } func SetWMVisibleNameChecked(c *x.Conn, window x.Window, val string) x.VoidCookie { atom, _ := c.GetAtom("_NET_WM_VISIBLE_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } func SetWMVisibleName(c *x.Conn, window x.Window, val string) { atom, _ := c.GetAtom("_NET_WM_VISIBLE_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") x.ChangeProperty(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } /** * _NET_WM_ICON_NAME */ func GetWMIconName(c *x.Conn, window x.Window) GetUTF8StrCookie { atom, _ := c.GetAtom("_NET_WM_ICON_NAME") cookie := x.GetProperty(c, false, window, atom, getAtom(c, "UTF8_STRING"), 0, LENGTH_MAX) return GetUTF8StrCookie(cookie) } func SetWMIconNameChecked(c *x.Conn, window x.Window, val string) x.VoidCookie { atom, _ := c.GetAtom("_NET_WM_ICON_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } func SetWMIconName(c *x.Conn, window x.Window, val string) { atom, _ := c.GetAtom("_NET_WM_ICON_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") x.ChangeProperty(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } /** * _NET_WM_VISIBLE_ICON_NAME */ func GetWMVisibleIconName(c *x.Conn, window x.Window) GetUTF8StrCookie { atom, _ := c.GetAtom("_NET_WM_VISIBLE_ICON_NAME") cookie := x.GetProperty(c, false, window, atom, getAtom(c, "UTF8_STRING"), 0, LENGTH_MAX) return GetUTF8StrCookie(cookie) } func SetWMVisibleIconNameChecked(c *x.Conn, window x.Window, val string) x.VoidCookie { atom, _ := c.GetAtom("_NET_WM_VISIBLE_ICON_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } func SetWMVisibleIconName(c *x.Conn, window x.Window, val string) { atom, _ := c.GetAtom("_NET_WM_VISIBLE_ICON_NAME") atomUTF8String, _ := c.GetAtom("UTF8_STRING") x.ChangeProperty(c, x.PropModeReplace, window, atom, atomUTF8String, 8, []byte(val)) } /** * _NET_WM_DESKTOP */ func GetWMDesktop(c *x.Conn, window x.Window) GetCardinalCookie { atom, _ := c.GetAtom("_NET_WM_DESKTOP") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetWMDesktopChecked(c *x.Conn, window x.Window, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_DESKTOP") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMDesktop(c *x.Conn, window x.Window, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_DESKTOP") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_WINDOW_TYPE */ func GetWMWindowType(c *x.Conn, window x.Window) GetAtomsCookie { atom, _ := c.GetAtom("_NET_WM_WINDOW_TYPE") cookie := x.GetProperty(c, false, window, atom, x.AtomAtom, 0, LENGTH_MAX) return GetAtomsCookie(cookie) } func SetWMWindowTypeChecked(c *x.Conn, window x.Window, vals []x.Atom) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_WINDOW_TYPE") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } func SetWMWindowType(c *x.Conn, window x.Window, vals []x.Atom) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_WINDOW_TYPE") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } /** * _NET_WM_STATE */ func GetWMState(c *x.Conn, window x.Window) GetAtomsCookie { atom, _ := c.GetAtom("_NET_WM_STATE") cookie := x.GetProperty(c, false, window, atom, x.AtomAtom, 0, LENGTH_MAX) return GetAtomsCookie(cookie) } func SetWMStateChecked(c *x.Conn, window x.Window, vals []x.Atom) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_STATE") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } func SetWMState(c *x.Conn, window x.Window, vals []x.Atom) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_STATE") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } /** * _NET_WM_ALLOWED_ACTIONS */ func GetWMAllowedActions(c *x.Conn, window x.Window) GetAtomsCookie { atom, _ := c.GetAtom("_NET_WM_ALLOWED_ACTIONS") cookie := x.GetProperty(c, false, window, atom, x.AtomAtom, 0, LENGTH_MAX) return GetAtomsCookie(cookie) } func SetWMAllowedActionsChecked(c *x.Conn, window x.Window, vals []x.Atom) x.VoidCookie { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_ALLOWED_ACTIONS") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } func SetWMAllowedActions(c *x.Conn, window x.Window, vals []x.Atom) { w := x.NewWriter() for _, val := range vals { w.Write4b(uint32(val)) } atom, _ := c.GetAtom("_NET_WM_ALLOWED_ACTIONS") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomAtom, 32, w.Bytes()) } /** * _NET_WM_STRUT */ func GetWMStrut(c *x.Conn, window x.Window) GetWMStrutCookie { atom, _ := c.GetAtom("_NET_WM_STRUT") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 4) return GetWMStrutCookie(cookie) } type GetWMStrutCookie x.GetPropertyCookie func (cookie GetWMStrutCookie) Reply(c *x.Conn) (WMStrut, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMStrut{}, err } if reply.Type != x.AtomCardinal { return WMStrut{}, errors.New("bad reply") } return getWMStrutFromReply(reply) } type WMStrut struct { Left, Right, Top, Bottom uint32 } func getWMStrutFromReply(reply *x.GetPropertyReply) (WMStrut, error) { list, err := getCardinalsFromReply(reply) if err != nil { return WMStrut{}, err } if len(list) != 4 { return WMStrut{}, errors.New("length of list is not 4") } return WMStrut{ Left: list[0], Right: list[1], Top: list[2], Bottom: list[3], }, nil } func SetWMStrutChecked(c *x.Conn, window x.Window, val WMStrut) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) atom, _ := c.GetAtom("_NET_WM_STRUT") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMStrut(c *x.Conn, window x.Window, val WMStrut) { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) atom, _ := c.GetAtom("_NET_WM_STRUT") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_STRUT_PARTIAL */ func GetWMStrutPartial(c *x.Conn, window x.Window) GetWMStrutPartialCookie { atom, _ := c.GetAtom("_NET_WM_STRUT_PARTIAL") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 12) return GetWMStrutPartialCookie(cookie) } type GetWMStrutPartialCookie x.GetPropertyCookie func (cookie GetWMStrutPartialCookie) Reply(c *x.Conn) (WMStrutPartial, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMStrutPartial{}, err } if reply.Type != x.AtomCardinal { return WMStrutPartial{}, errors.New("bad reply") } return getWMStrutPartialFromReply(reply) } type WMStrutPartial struct { Left, Right, Top, Bottom, LeftStartY, LeftEndY, RightStartY, RightEndY, TopStartX, TopEndX, BottomStartX, BottomEndX uint32 } func getWMStrutPartialFromReply(reply *x.GetPropertyReply) (WMStrutPartial, error) { list, err := getCardinalsFromReply(reply) if err != nil { return WMStrutPartial{}, err } if len(list) != 12 { return WMStrutPartial{}, errors.New("length of list is not 12") } return WMStrutPartial{ Left: list[0], Right: list[1], Top: list[2], Bottom: list[3], LeftStartY: list[4], LeftEndY: list[5], RightStartY: list[6], RightEndY: list[7], TopStartX: list[8], TopEndX: list[9], BottomStartX: list[10], BottomEndX: list[11], }, nil } func SetWMStrutPartialChecked(c *x.Conn, window x.Window, val WMStrutPartial) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) w.Write4b(val.LeftStartY) w.Write4b(val.LeftEndY) w.Write4b(val.RightStartY) w.Write4b(val.RightEndY) w.Write4b(val.TopStartX) w.Write4b(val.TopEndX) w.Write4b(val.BottomStartX) w.Write4b(val.BottomEndX) atom, _ := c.GetAtom("_NET_WM_STRUT_PARTIAL") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMStrutPartial(c *x.Conn, window x.Window, val WMStrutPartial) { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) w.Write4b(val.LeftStartY) w.Write4b(val.LeftEndY) w.Write4b(val.RightStartY) w.Write4b(val.RightEndY) w.Write4b(val.TopStartX) w.Write4b(val.TopEndX) w.Write4b(val.BottomStartX) w.Write4b(val.BottomEndX) atom, _ := c.GetAtom("_NET_WM_STRUT_PARTIAL") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_ICON_GEOMETRY */ func GetWMIconGeometry(c *x.Conn, window x.Window) GetWMIconGeometryCookie { atom, _ := c.GetAtom("_NET_WM_ICON_GEOMETRY") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 4) return GetWMIconGeometryCookie(cookie) } type GetWMIconGeometryCookie x.GetPropertyCookie func (cookie GetWMIconGeometryCookie) Reply(c *x.Conn) (WMIconGeometry, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMIconGeometry{}, err } if reply.Type != x.AtomCardinal { return WMIconGeometry{}, errors.New("bad reply") } return getWMIconGeometryFromReply(reply) } type WMIconGeometry struct { X, Y, Width, Height uint32 } func getWMIconGeometryFromReply(reply *x.GetPropertyReply) (WMIconGeometry, error) { list, err := getCardinalsFromReply(reply) if err != nil { return WMIconGeometry{}, err } if len(list) != 4 { return WMIconGeometry{}, errors.New("length of list is not 4") } return WMIconGeometry{ X: list[0], Y: list[1], Width: list[2], Height: list[3], }, nil } func SetWMIconGeometryChecked(c *x.Conn, window x.Window, val WMIconGeometry) x.VoidCookie { w := x.NewWriter() w.Write4b(val.X) w.Write4b(val.Y) w.Write4b(val.Width) w.Write4b(val.Height) atom, _ := c.GetAtom("_NET_WM_ICON_GEOMETRY") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMIconGeometry(c *x.Conn, window x.Window, val WMIconGeometry) { w := x.NewWriter() w.Write4b(val.X) w.Write4b(val.Y) w.Write4b(val.Width) w.Write4b(val.Height) atom, _ := c.GetAtom("_NET_WM_ICON_GEOMETRY") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_ICON */ func GetWMIcon(c *x.Conn, window x.Window) GetWMIconCookie { atom, _ := c.GetAtom("_NET_WM_ICON") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, LENGTH_MAX) return GetWMIconCookie(cookie) } type GetWMIconCookie x.GetPropertyCookie func (cookie GetWMIconCookie) Reply(c *x.Conn) ([]WMIcon, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomCardinal { return nil, errors.New("bad reply") } return getWMIconFromReply(reply) } /** * _NET_WM_PID */ func GetWMPid(c *x.Conn, window x.Window) GetCardinalCookie { atom, _ := c.GetAtom("_NET_WM_PID") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetWMPidChecked(c *x.Conn, window x.Window, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_PID") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMPid(c *x.Conn, window x.Window, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_PID") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_HANDLED_ICONS */ func GetWMHandledIcons(c *x.Conn, window x.Window) GetCardinalCookie { atom, _ := c.GetAtom("_NET_WM_HANDLED_ICONS") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetWMHandledIconsChecked(c *x.Conn, window x.Window, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_HANDLED_ICONS") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMHandledIcons(c *x.Conn, window x.Window, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_HANDLED_ICONS") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_USER_TIME */ func GetWMUserTime(c *x.Conn, window x.Window) GetCardinalCookie { atom, _ := c.GetAtom("_NET_WM_USER_TIME") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 1) return GetCardinalCookie(cookie) } func SetWMUserTimeChecked(c *x.Conn, window x.Window, val uint32) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_USER_TIME") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMUserTime(c *x.Conn, window x.Window, val uint32) { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_USER_TIME") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_USER_TIME_WINDOW */ func GetWMUserTimeWindow(c *x.Conn, window x.Window) GetWindowCookie { atom, _ := c.GetAtom("_NET_WM_USER_TIME_WINDOW") cookie := x.GetProperty(c, false, window, atom, x.AtomWindow, 0, 1) return GetWindowCookie(cookie) } func SetWMUserTimeWindowChecked(c *x.Conn, window x.Window, val x.Window) x.VoidCookie { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_USER_TIME_WINDOW") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomWindow, 32, w.Bytes()) } func SetWMUserTimeWindow(c *x.Conn, window x.Window, val x.Window) { w := x.NewWriter() w.Write4b(uint32(val)) atom, _ := c.GetAtom("_NET_WM_USER_TIME_WINDOW") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomWindow, 32, w.Bytes()) } /** * _NET_FRAME_EXTENTS */ func GetFrameExtents(c *x.Conn, window x.Window) GetFrameExtentsCookie { atom, _ := c.GetAtom("_NET_FRAME_EXTENTS") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 4) return GetFrameExtentsCookie(cookie) } type GetFrameExtentsCookie x.GetPropertyCookie func (cookie GetFrameExtentsCookie) Reply(c *x.Conn) (FrameExtents, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return FrameExtents{}, err } if reply.Type != x.AtomCardinal { return FrameExtents{}, errors.New("bad reply") } return getFrameExtentsFromReply(reply) } type FrameExtents struct { Left, Right, Top, Bottom uint32 } func getFrameExtentsFromReply(reply *x.GetPropertyReply) (FrameExtents, error) { list, err := getCardinalsFromReply(reply) if err != nil { return FrameExtents{}, err } if len(list) != 4 { return FrameExtents{}, errors.New("length of list is not 4") } return FrameExtents{ Left: list[0], Right: list[1], Top: list[2], Bottom: list[3], }, nil } func SetFrameExtentsChecked(c *x.Conn, window x.Window, val FrameExtents) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) atom, _ := c.GetAtom("_NET_FRAME_EXTENTS") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetFrameExtents(c *x.Conn, window x.Window, val FrameExtents) { w := x.NewWriter() w.Write4b(val.Left) w.Write4b(val.Right) w.Write4b(val.Top) w.Write4b(val.Bottom) atom, _ := c.GetAtom("_NET_FRAME_EXTENTS") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_SYNC_REQUEST_COUNTER */ func GetWMSyncRequestCounter(c *x.Conn, window x.Window) GetWMSyncRequestCounterCookie { atom, _ := c.GetAtom("_NET_WM_SYNC_REQUEST_COUNTER") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 2) return GetWMSyncRequestCounterCookie(cookie) } type GetWMSyncRequestCounterCookie x.GetPropertyCookie func (cookie GetWMSyncRequestCounterCookie) Reply(c *x.Conn) (WMSyncRequestCounter, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMSyncRequestCounter{}, err } if reply.Type != x.AtomCardinal { return WMSyncRequestCounter{}, errors.New("bad reply") } return getWMSyncRequestCounterFromReply(reply) } type WMSyncRequestCounter struct { Low, High uint32 } func getWMSyncRequestCounterFromReply(reply *x.GetPropertyReply) (WMSyncRequestCounter, error) { list, err := getCardinalsFromReply(reply) if err != nil { return WMSyncRequestCounter{}, err } if len(list) != 2 { return WMSyncRequestCounter{}, errors.New("length of list is not 2") } return WMSyncRequestCounter{ Low: list[0], High: list[1], }, nil } func SetWMSyncRequestCounterChecked(c *x.Conn, window x.Window, val WMSyncRequestCounter) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Low) w.Write4b(val.High) atom, _ := c.GetAtom("_NET_WM_SYNC_REQUEST_COUNTER") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMSyncRequestCounter(c *x.Conn, window x.Window, val WMSyncRequestCounter) { w := x.NewWriter() w.Write4b(val.Low) w.Write4b(val.High) atom, _ := c.GetAtom("_NET_WM_SYNC_REQUEST_COUNTER") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } /** * _NET_WM_FULLSCREEN_MONITORS */ func GetWMFullscreenMonitors(c *x.Conn, window x.Window) GetWMFullscreenMonitorsCookie { atom, _ := c.GetAtom("_NET_WM_FULLSCREEN_MONITORS") cookie := x.GetProperty(c, false, window, atom, x.AtomCardinal, 0, 4) return GetWMFullscreenMonitorsCookie(cookie) } type GetWMFullscreenMonitorsCookie x.GetPropertyCookie func (cookie GetWMFullscreenMonitorsCookie) Reply(c *x.Conn) (WMFullscreenMonitors, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMFullscreenMonitors{}, err } if reply.Type != x.AtomCardinal { return WMFullscreenMonitors{}, errors.New("bad reply") } return getWMFullscreenMonitorsFromReply(reply) } type WMFullscreenMonitors struct { Top, Bottom, Left, Right uint32 } func getWMFullscreenMonitorsFromReply(reply *x.GetPropertyReply) (WMFullscreenMonitors, error) { list, err := getCardinalsFromReply(reply) if err != nil { return WMFullscreenMonitors{}, err } if len(list) != 4 { return WMFullscreenMonitors{}, errors.New("length of list is not 4") } return WMFullscreenMonitors{ Top: list[0], Bottom: list[1], Left: list[2], Right: list[3], }, nil } func SetWMFullscreenMonitorsChecked(c *x.Conn, window x.Window, val WMFullscreenMonitors) x.VoidCookie { w := x.NewWriter() w.Write4b(val.Top) w.Write4b(val.Bottom) w.Write4b(val.Left) w.Write4b(val.Right) atom, _ := c.GetAtom("_NET_WM_FULLSCREEN_MONITORS") return x.ChangePropertyChecked(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } func SetWMFullscreenMonitors(c *x.Conn, window x.Window, val WMFullscreenMonitors) { w := x.NewWriter() w.Write4b(val.Top) w.Write4b(val.Bottom) w.Write4b(val.Left) w.Write4b(val.Right) atom, _ := c.GetAtom("_NET_WM_FULLSCREEN_MONITORS") x.ChangeProperty(c, x.PropModeReplace, window, atom, x.AtomCardinal, 32, w.Bytes()) } go-x11-client-1.0.2/util/wm/ewmh/manual.go000066400000000000000000000235171460713373000201620ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package ewmh import ( "errors" "fmt" "math" "strconv" "github.com/linuxdeepin/go-x11-client" ) const LENGTH_MAX = math.MaxUint32 type ClientSource uint32 const ( // No source at all (for clients supporting an older version of EWMH specification) ClientSourceNone ClientSource = iota // normal application ClientSourceNormal // pagers and other clients that represent direct user actions ClientSourceOther ) func getAtom(c *x.Conn, name string) x.Atom { atom, _ := c.GetAtom(name) return atom } func getBooleanFromReply(r *x.GetPropertyReply) (bool, error) { num, err := getCardinalFromReply(r) return num != 0, err } func getUTF8StrFromReply(reply *x.GetPropertyReply) (string, error) { if reply.Format != 8 { return "", errors.New("bad reply") } return string(reply.Value), nil } func getUTF8StrsFromReply(reply *x.GetPropertyReply) ([]string, error) { if reply.Format != 8 { return nil, errors.New("bad reply") } data := reply.Value var strs []string sstart := 0 for i, c := range data { if c == 0 { strs = append(strs, string(data[sstart:i])) sstart = i + 1 } } if sstart < len(data) { strs = append(strs, string(data[sstart:])) } return strs, nil } func getWMIconFromReply(reply *x.GetPropertyReply) ([]WMIcon, error) { if reply.Format != 32 { return nil, errors.New("bad reply") } return getIcons(reply.Value) } type WMIcon struct { Width, Height uint32 Data []byte } func (icon *WMIcon) String() string { if icon == nil { return "nil" } return fmt.Sprintf("ewmh.WMIcon{ size: %dx%d, dataLength: %d }", icon.Width, icon.Height, len(icon.Data)) } func getIcons(p []byte) ([]WMIcon, error) { var icons []WMIcon for len(p) >= 2*4 { width := x.Get32(p) height := x.Get32(p[4:]) area := width * height if len(p) >= int(2+area)*4 { if area > 0 { icon := WMIcon{ Width: width, Height: height, Data: p[2*4 : (2+area)*4], } icons = append(icons, icon) } if len(p) > int(2+area)*4 { // next icon p = p[(2+area)*4:] continue } else { // end break } } else { break } } return icons, nil } func sendClientMessage(c *x.Conn, win, dest x.Window, msgType x.Atom, pArray *[5]uint32) x.VoidCookie { var data x.ClientMessageData data.SetData32(pArray) event := x.ClientMessageEvent{ Format: 32, Window: win, Type: msgType, Data: data, } w := x.NewWriter() x.WriteClientMessageEvent(w, &event) const evMask = x.EventMaskSubstructureNotify | x.EventMaskSubstructureRedirect return x.SendEventChecked(c, false, dest, evMask, w.Bytes()) } /** * _NET_DESKTOP_GEOMETRY */ func RequestChangeDesktopGeometry(c *x.Conn, geo DesktopGeometry) x.VoidCookie { array := [5]uint32{ geo.Width, geo.Height, } root := c.GetDefaultScreen().Root atomNetDesktopGeometry, _ := c.GetAtom("_NET_DESKTOP_GEOMETRY") return sendClientMessage(c, root, root, atomNetDesktopGeometry, &array) } /** * _NET_DESKTOP_VIEWPORT */ func RequestChangeDesktopViewport(c *x.Conn, corner ViewportLeftTopCorner) x.VoidCookie { array := [5]uint32{ corner.X, corner.Y, } root := c.GetDefaultScreen().Root atomNetDesktopViewport, _ := c.GetAtom("_NET_DESKTOP_VIEWPORT") return sendClientMessage(c, root, root, atomNetDesktopViewport, &array) } /** * _NET_CURRENT_DESKTOP */ func RequestChangeCurrentDesktop(c *x.Conn, desktop uint32, timestamp x.Timestamp) x.VoidCookie { array := [5]uint32{ desktop, uint32(timestamp), } root := c.GetDefaultScreen().Root atomNetCurrentDesktop, _ := c.GetAtom("_NET_CURRENT_DESKTOP") return sendClientMessage(c, root, root, atomNetCurrentDesktop, &array) } /** * _NET_ACTIVE_WINDOW */ func RequestChangeActiveWindow(c *x.Conn, windowToActivate x.Window, source ClientSource, timestamp x.Timestamp, currentActiveWindow x.Window) x.VoidCookie { array := [5]uint32{ uint32(source), uint32(timestamp), uint32(currentActiveWindow), } root := c.GetDefaultScreen().Root atomNetActivewindow, _ := c.GetAtom("_NET_ACTIVE_WINDOW") return sendClientMessage(c, windowToActivate, root, atomNetActivewindow, &array) } /** * _NET_SHOWING_DESKTOP */ func SetShowingDesktopChecked(c *x.Conn, show bool) x.VoidCookie { val := uint32(0) if show { val = 1 } w := x.NewWriter() w.Write4b(uint32(val)) root := c.GetDefaultScreen().Root atomNetShowingDesktop, _ := c.GetAtom("_NET_SHOWING_DESKTOP") return x.ChangePropertyChecked(c, x.PropModeReplace, root, atomNetShowingDesktop, x.AtomCardinal, 32, w.Bytes()) } func SetShowingDesktop(c *x.Conn, show bool) { val := uint32(0) if show { val = 1 } w := x.NewWriter() w.Write4b(uint32(val)) root := c.GetDefaultScreen().Root atomNetShowingDesktop, _ := c.GetAtom("_NET_SHOWING_DESKTOP") x.ChangeProperty(c, x.PropModeReplace, root, atomNetShowingDesktop, x.AtomCardinal, 32, w.Bytes()) } func RequestChangeShowingDesktop(c *x.Conn, show bool) x.VoidCookie { val := uint32(0) if show { val = 1 } array := [5]uint32{ val, } root := c.GetDefaultScreen().Root atomNetShowingDesktop, _ := c.GetAtom("_NET_SHOWING_DESKTOP") return sendClientMessage(c, root, root, atomNetShowingDesktop, &array) } /** * _NET_CLOSE_WINDOW */ func RequestCloseWindow(c *x.Conn, window x.Window, timestamp x.Timestamp, source ClientSource) x.VoidCookie { array := [5]uint32{ uint32(timestamp), uint32(source), } root := c.GetDefaultScreen().Root atomNetCloseWindow, _ := c.GetAtom("_NET_CLOSE_WINDOW") return sendClientMessage(c, window, root, atomNetCloseWindow, &array) } /** * _NET_MOVERESIZE_WINDOW */ type MoveResizeWindowFlags uint32 const ( MoveResizeWindowX MoveResizeWindowFlags = 1 << (8 + iota) MoveResizeWindowY MoveResizeWindowWidth MoveResizeWindowHeight ) func RequestMoveResizeWindow(c *x.Conn, window x.Window, gravity uint32, source ClientSource, flags MoveResizeWindowFlags, x, y, width, height uint32) x.VoidCookie { array := [5]uint32{ gravity | uint32(flags) | (uint32(source) << 12), x, y, width, height, } root := c.GetDefaultScreen().Root atomNetMoveResizeWindow, _ := c.GetAtom("_NET_MOVERESIZE_WINDOW") return sendClientMessage(c, window, root, atomNetMoveResizeWindow, &array) } /** * _NET_WM_MOVERESIZE */ type MoveResizeDirection uint32 const ( MoveResizeSizeTopLeft MoveResizeDirection = iota MoveResizeSizeTop MoveResizeSizeTopRight MoveResizeSizeRight MoveResizeSizeBottomRight MoveResizeSizeBottom // 5 MoveResizeSizeBottomLeft MoveResizeSizeLeft MoveResizeMove MoveResizeSizeKeyboard MoveResizeMoveKeyboard // 10 MoveResizeCancel ) func RequestWMMoveResize(c *x.Conn, window x.Window, xRoot, yRoot uint32, direction MoveResizeDirection, button uint32, source ClientSource) x.VoidCookie { array := [5]uint32{ xRoot, yRoot, uint32(direction), button, uint32(source), } root := c.GetDefaultScreen().Root atomNetWMMoveResize, _ := c.GetAtom("_NET_WM_MOVERESIZE") return sendClientMessage(c, window, root, atomNetWMMoveResize, &array) } /** * _NET_RESTACK_WINDOW */ func RequestRestackWindow(c *x.Conn, window, siblingWindow x.Window, stackMode uint32) x.VoidCookie { array := [5]uint32{ 2, uint32(siblingWindow), stackMode, } root := c.GetDefaultScreen().Root atomNetRestackWindow, _ := c.GetAtom("_NET_RESTACK_WINDOW") return sendClientMessage(c, window, root, atomNetRestackWindow, &array) } /** * _NET_WM_DESKTOP */ func RequestChangeWMDesktop(c *x.Conn, window x.Window, desktop uint32, source ClientSource) x.VoidCookie { array := [5]uint32{ desktop, uint32(source), } root := c.GetDefaultScreen().Root atomNetWMDesktop, _ := c.GetAtom("_NET_WM_DESKTOP") return sendClientMessage(c, window, root, atomNetWMDesktop, &array) } /** * _NET_WM_STATE */ type WMStateAction uint32 const ( WMStateRemove WMStateAction = iota WMStateAdd WMStateToggle ) func RequestChangeWMState(c *x.Conn, window x.Window, action WMStateAction, firstProperty, secondProperty x.Atom, source ClientSource) x.VoidCookie { array := [5]uint32{ uint32(action), uint32(firstProperty), uint32(secondProperty), uint32(source), } root := c.GetDefaultScreen().Root atomNetWMState, _ := c.GetAtom("_NET_WM_STATE") return sendClientMessage(c, window, root, atomNetWMState, &array) } /* * _NET_WM_PING */ func SendWMPing(c *x.Conn, window x.Window, timestamp x.Timestamp) x.VoidCookie { atomNetWMPing, _ := c.GetAtom("_NET_WM_PING") array := [5]uint32{ uint32(atomNetWMPing), uint32(timestamp), uint32(window), } atomWMProtocols, _ := c.GetAtom("WM_PROTOCOLS") return sendClientMessage(c, window, window, atomWMProtocols, &array) } /* * _NET_WM_SYNC_REQUEST */ func (counter WMSyncRequestCounter) ToUint64() uint64 { return uint64(counter.Low) | (uint64(counter.High) << 32) } func (counter WMSyncRequestCounter) String() string { return strconv.FormatUint(counter.ToUint64(), 10) } func NewWMSyncRequestCounter(val uint64) WMSyncRequestCounter { return WMSyncRequestCounter{ Low: uint32(val), High: uint32(val >> 32), } } func SendWMSyncRequest(c *x.Conn, window x.Window, timestamp x.Timestamp, counter WMSyncRequestCounter) x.VoidCookie { atomNetWMSyncRequest, _ := c.GetAtom("_NET_WM_SYNC_REQUEST") array := [5]uint32{ uint32(atomNetWMSyncRequest), uint32(timestamp), counter.Low, counter.High, } atomWMProtocols, _ := c.GetAtom("WM_PROTOCOLS") return sendClientMessage(c, window, window, atomWMProtocols, &array) } /* * _NET_WM_FULLSCREEN_MONITORS */ func RequestChangeWMFullscreenMonitors(c *x.Conn, window x.Window, edges WMFullscreenMonitors, source ClientSource) x.VoidCookie { array := [5]uint32{ edges.Top, edges.Bottom, edges.Left, edges.Right, uint32(source), } root := c.GetDefaultScreen().Root atomNetWMFullscreenMonitors, _ := c.GetAtom("_NET_WM_FULLSCREEN_MONITORS") return sendClientMessage(c, window, root, atomNetWMFullscreenMonitors, &array) } go-x11-client-1.0.2/util/wm/icccm/000077500000000000000000000000001460713373000164645ustar00rootroot00000000000000go-x11-client-1.0.2/util/wm/icccm/icccm.go000066400000000000000000000273011460713373000200740ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package icccm import ( "errors" "strings" x "github.com/linuxdeepin/go-x11-client" ) const getPropertyMaxLength = 0xffff func getCardinalsFromReply(r *x.GetPropertyReply) ([]uint32, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]uint32, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = uint32(rdr.Read4b()) } return ret, nil } func getWindowFromReply(r *x.GetPropertyReply) (x.Window, error) { if r.Format != 32 || len(r.Value) != 4 { return 0, errors.New("bad reply") } return x.Window(x.Get32(r.Value)), nil } type GetWindowCookie x.GetPropertyCookie func (cookie GetWindowCookie) Reply(c *x.Conn) (x.Window, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return 0, err } if reply.Type != x.AtomWindow { return 0, errors.New("bad reply") } return getWindowFromReply(reply) } func getWindowsFromReply(r *x.GetPropertyReply) ([]x.Window, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]x.Window, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = x.Window(rdr.Read4b()) } return ret, nil } type GetWindowsCookie x.GetPropertyCookie func (cookie GetWindowsCookie) Reply(c *x.Conn) ([]x.Window, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomWindow { return nil, errors.New("bad reply") } return getWindowsFromReply(reply) } func getAtomsFromReply(r *x.GetPropertyReply) ([]x.Atom, error) { if r.Format != 32 { return nil, errors.New("bad reply") } count := len(r.Value) / 4 ret := make([]x.Atom, count) rdr := x.NewReaderFromData(r.Value) for i := 0; i < count; i++ { ret[i] = x.Atom(rdr.Read4b()) } return ret, nil } type GetAtomsCookie x.GetPropertyCookie func (cookie GetAtomsCookie) Reply(c *x.Conn) ([]x.Atom, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return nil, err } if reply.Type != x.AtomAtom { return nil, errors.New("bad reply") } return getAtomsFromReply(reply) } /* WM_NAME */ func GetWMName(c *x.Conn, window x.Window) GetTextCookie { return getTextProperty(c, window, x.AtomWMName) } /* WM_ICON_NAME */ func GetWMIconName(c *x.Conn, window x.Window) GetTextCookie { return getTextProperty(c, window, x.AtomWMIconName) } /* WM_COLORMAP_WINDOWS */ func GetWMColormapWindows(c *x.Conn, window x.Window) GetWindowsCookie { atomWMColormapWindows, _ := c.GetAtom("WM_COLORMAP_WINDOWS") cookie := x.GetProperty(c, false, window, atomWMColormapWindows, x.AtomWindow, 0, getPropertyMaxLength) return GetWindowsCookie(cookie) } /* WM_CLIENT_MACHINE */ func GetWMClientMachine(c *x.Conn, window x.Window) GetTextCookie { return getTextProperty(c, window, x.AtomWMClientMachine) } /* WM_CLASS */ type GetWMClassCookie x.GetPropertyCookie func (cookie GetWMClassCookie) Reply(c *x.Conn) (WMClass, error) { reply, err := x.GetPropertyCookie(cookie).Reply(c) if err != nil { return WMClass{}, err } return getWMClassFromReply(reply) } func getWMClassFromReply(reply *x.GetPropertyReply) (WMClass, error) { if reply.Type != x.AtomString || reply.Format != 8 { return WMClass{}, errors.New("bad reply") } data := reply.Value var parts [][]byte sstart := 0 for i, c := range data { if c == 0 { parts = append(parts, data[sstart:i]) sstart = i + 1 } } if sstart < len(data) { parts = append(parts, data[sstart:]) } if len(parts) != 2 { return WMClass{}, errors.New("length of parts is not 2") } // convert parts to utf8str instance, err := convertLatin1ToUTF8(parts[0]) if err != nil { return WMClass{}, err } class, err := convertLatin1ToUTF8(parts[1]) if err != nil { return WMClass{}, err } return WMClass{ Instance: instance, Class: class, }, nil } type WMClass struct { Class, Instance string } func GetWMClass(c *x.Conn, window x.Window) GetWMClassCookie { cookie := x.GetProperty(c, false, window, x.AtomWMClass, x.AtomString, 0, 2048) return GetWMClassCookie(cookie) } /* WM_TRANSIENT_FOR */ func GetWMTransientFor(c *x.Conn, window x.Window) GetWindowCookie { cookie := x.GetProperty(c, false, window, x.AtomWMTransientFor, x.AtomWindow, 0, 1) return GetWindowCookie(cookie) } /* WM_SIZE_HINTS */ type WMSizeHints struct { Flags SizeHintsFlags X int32 Y int32 Width, Height uint32 MinWidth, MinHeight uint32 MaxWidth, MaxHeight uint32 WidthInc, HeightInc uint32 MinAspect AspectRatio MaxAspect AspectRatio BaseWidth, BaseHeight uint32 WinGravity uint32 } type AspectRatio struct { Numerator, Denominator uint32 } // WM_SIZE_HINTS.flags bit definitions const ( SizeHintsFlagUSPosition = 1 << iota SizeHintsFlagUSSize SizeHintsFlagPPosition SizeHintsFlagPSize SizeHintsFlagPMinSize SizeHintsFlagPMaxSize SizeHintsFlagPResizeInc SizeHintsFlagPAspect SizeHintsFlagPBaseSize SizeHintsFlagPWinGravity ) type SizeHintsFlags uint32 func (flags SizeHintsFlags) String() string { names := []string{ "USPosition", "USSize", "PPostion", "PSize", "PMinSize", "PMaxSize", "PResizeInc", "PAspect", "PBaseSize", "PWinGravity", } var ret []string for i, name := range names { if flags&(1<> 8)) } func (w *Writer) Write4b(v uint32) { w.buf.WriteByte(byte(v)) w.buf.WriteByte(byte(v >> 8)) w.buf.WriteByte(byte(v >> 16)) w.buf.WriteByte(byte(v >> 24)) } func (w *Writer) Write8b(v uint64) { w.buf.WriteByte(byte(v)) w.buf.WriteByte(byte(v >> 8)) w.buf.WriteByte(byte(v >> 16)) w.buf.WriteByte(byte(v >> 24)) w.buf.WriteByte(byte(v >> 32)) w.buf.WriteByte(byte(v >> 40)) w.buf.WriteByte(byte(v >> 48)) w.buf.WriteByte(byte(v >> 56)) } func (w *Writer) WriteBytes(p []byte) { w.buf.Write(p) } func (w *Writer) WriteNBytes(n int, p []byte) { if len(p) < n { w.buf.Write(p) w.WritePad(n - len(p)) } else { w.buf.Write(p[:n]) } } func (w *Writer) WriteString(s string) { w.buf.WriteString(s) } func (w *Writer) Bytes() []byte { return w.buf.Bytes() } go-x11-client-1.0.2/xproto.go000066400000000000000000001152571460713373000157030ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "bytes" "errors" "math" ) type Setup struct { ProtocolMajorVersion uint16 ProtocolMinorVersion uint16 ReleaseNumber uint32 ResourceIdBase uint32 ResourceIdMask uint32 MonitorBufferSize uint32 MaximumRequestLength uint16 ImageByteOrder uint8 BitmapFormatBitOrder uint8 BitmapFormatScanlineUint uint8 BitmapFormatScanlinePad uint8 MinKeycode Keycode MaxKeycode Keycode Vendor string PixmapFormats []Format Roots []Screen } func readSetup(r *Reader, v *Setup) error { if !r.RemainAtLeast4b(10) { return ErrDataLenShort } // status status := r.Read1b() if status != 1 { return errors.New("status != 1") } r.ReadPad(1) v.ProtocolMajorVersion = r.Read2b() // 1 v.ProtocolMinorVersion = r.Read2b() // length in 4-byte units of additional data r.ReadPad(2) // 2 v.ReleaseNumber = r.Read4b() // 3 v.ResourceIdBase = r.Read4b() v.ResourceIdMask = r.Read4b() v.MonitorBufferSize = r.Read4b() vendorLen := r.Read2b() v.MaximumRequestLength = r.Read2b() // 7 screensLen := r.Read1b() formatsLen := r.Read1b() v.ImageByteOrder = r.Read1b() v.BitmapFormatBitOrder = r.Read1b() // 8 v.BitmapFormatScanlineUint = r.Read1b() v.BitmapFormatScanlinePad = r.Read1b() v.MinKeycode = Keycode(r.Read1b()) v.MaxKeycode = Keycode(r.Read1b()) // 9 // unused r.Read4b() // 10 var err error v.Vendor, err = r.ReadStrWithPad(int(vendorLen)) if err != nil { return err } // formats if formatsLen > 0 { if !r.RemainAtLeast4b(int(formatsLen) * 2) { return ErrDataLenShort } v.PixmapFormats = make([]Format, int(formatsLen)) for i := 0; i < int(formatsLen); i++ { readFormat(r, &v.PixmapFormats[i]) } } // screens if screensLen > 0 { v.Roots = make([]Screen, int(screensLen)) for i := 0; i < int(screensLen); i++ { err := readScreen(r, &v.Roots[i]) if err != nil { return err } } } return nil } // size: 2 * 4b type Format struct { Depth uint8 BitsPerPixel uint8 ScanlinePad uint8 } func readFormat(r *Reader, v *Format) { v.Depth = r.Read1b() v.BitsPerPixel = r.Read1b() v.ScanlinePad = r.Read1b() // unused r.ReadPad(5) } type Screen struct { Root Window DefaultColorMap Colormap WhitePixel uint32 BlackPixel uint32 CurrentInputMask uint32 WidthInPixels uint16 HeightInPixels uint16 WidthInMillimeters uint16 HeightInMillimeters uint16 MinInstalledMaps uint16 MaxInstalledMaps uint16 RootVisual VisualID BackingStores uint8 SaveUnders bool RootDepth uint8 AllowedDepths []Depth } func readScreen(r *Reader, v *Screen) error { if !r.RemainAtLeast4b(10) { return ErrDataLenShort } v.Root = Window(r.Read4b()) v.DefaultColorMap = Colormap(r.Read4b()) v.WhitePixel = r.Read4b() v.BlackPixel = r.Read4b() v.CurrentInputMask = r.Read4b() // 5 v.WidthInPixels = r.Read2b() v.HeightInPixels = r.Read2b() v.WidthInMillimeters = r.Read2b() v.HeightInMillimeters = r.Read2b() v.MinInstalledMaps = r.Read2b() v.MaxInstalledMaps = r.Read2b() // 8 v.RootVisual = VisualID(r.Read4b()) // 9 v.BackingStores = r.Read1b() v.SaveUnders = r.ReadBool() v.RootDepth = r.Read1b() depthsLen := r.Read1b() // 10 // depths if depthsLen > 0 { v.AllowedDepths = make([]Depth, int(depthsLen)) for i := 0; i < int(depthsLen); i++ { err := readDepth(r, &v.AllowedDepths[i]) if err != nil { return err } } } return nil } type Depth struct { Depth uint8 Visuals []VisualType } func readDepth(r *Reader, v *Depth) error { if !r.RemainAtLeast4b(2) { return ErrDataLenShort } v.Depth = r.Read1b() r.ReadPad(1) visualsLen := r.Read2b() // unused r.ReadPad(4) // 2 // visuals if visualsLen > 0 { if !r.RemainAtLeast4b(int(visualsLen) * 6) { return ErrDataLenShort } v.Visuals = make([]VisualType, int(visualsLen)) for i := 0; i < int(visualsLen); i++ { readVisualType(r, &v.Visuals[i]) } } return nil } // size: 6 * 4b type VisualType struct { Id VisualID Class uint8 BitsPerRGBValue uint8 ColorMapEntries uint16 RedMask uint32 GreenMask uint32 BlueMask uint32 } func readVisualType(r *Reader, v *VisualType) { v.Id = VisualID(r.Read4b()) v.Class = r.Read1b() v.BitsPerRGBValue = r.Read1b() v.ColorMapEntries = r.Read2b() v.RedMask = r.Read4b() v.GreenMask = r.Read4b() v.BlueMask = r.Read4b() // unused r.ReadPad(4) } // size: 2 * 4b type Rectangle struct { X, Y int16 Width, Height uint16 } func ReadRectangle(r *Reader) Rectangle { var v Rectangle v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() // 2 return v } func WriteRectangle(b *FixedSizeBuf, v Rectangle) { b.Write2b(uint16(v.X)) b.Write2b(uint16(v.Y)) b.Write2b(v.Width) b.Write2b(v.Height) } // #WREQ func encodeCreateWindow(depth uint8, wid, parent Window, x, y int16, width, height, borderWidth uint16, class uint16, visual VisualID, valueMask uint32, valueList []uint32) (hd uint8, b RequestBody) { hd = depth b0 := b.AddBlock(7 + len(valueList)). Write4b(uint32(wid)). Write4b(uint32(parent)). Write2b(uint16(x)). Write2b(uint16(y)). Write2b(width). Write2b(height). Write2b(borderWidth). Write2b(class). Write4b(uint32(visual)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeChangeWindowAttributes(window Window, valueMask uint32, valueList []uint32) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + len(valueList)). Write4b(uint32(window)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeGetWindowAttributes(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type GetWindowAttributesReply struct { BackingStore uint8 Visual VisualID Class uint16 BitGravity uint8 WinGravity uint8 BackingPlanes uint32 BackingPixel uint32 SaveUnder bool MapIsInstalled bool MapState uint8 OverrideRedirect bool Colormap Colormap AllEventMasks uint32 YourEventMask uint32 DoNotPropagateMask uint16 } func readGetWindowAttributesReply(r *Reader, v *GetWindowAttributesReply) error { if !r.RemainAtLeast4b(11) { return ErrDataLenShort } v.BackingStore, _ = r.ReadReplyHeader() v.Visual = VisualID(r.Read4b()) v.Class = r.Read2b() v.BitGravity = r.Read1b() v.WinGravity = r.Read1b() // 4 v.BackingPlanes = r.Read4b() v.BackingPixel = r.Read4b() v.SaveUnder = r.ReadBool() v.MapIsInstalled = r.ReadBool() v.MapState = r.Read1b() v.OverrideRedirect = r.ReadBool() // 7 v.Colormap = Colormap(r.Read4b()) v.AllEventMasks = r.Read4b() v.YourEventMask = r.Read4b() v.DoNotPropagateMask = r.Read2b() // 11 return nil } // #WREQ func encodeDestroyWindow(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeDestroySubwindows(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeChangeSaveSet(mode uint8, window Window) (hd uint8, b RequestBody) { hd = mode b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeReparentWindow(window, parent Window, x, y int16) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(window)). Write4b(uint32(parent)). Write2b(uint16(x)). Write2b(uint16(y)). End() return } // #WREQ func encodeMapWindow(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeMapSubwindows(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeUnmapWindow(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeUnmapSubwindows(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeConfigureWindow(window Window, valueMask uint16, valueList []uint32) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + len(valueList)). Write4b(uint32(window)). Write2b(valueMask). WritePad(2) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeCirculateWindow(direction uint8, window Window) (hd uint8, b RequestBody) { hd = direction b.AddBlock(1). Write4b(uint32(window)). End() return } // #WREQ func encodeGetGeometry(drawable Drawable) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(drawable)). End() return } type GetGeometryReply struct { Depth uint8 Root Window X int16 Y int16 Width uint16 Height uint16 BorderWidth uint16 } func readGetGeometryReply(r *Reader, v *GetGeometryReply) error { if !r.RemainAtLeast4b(6) { return ErrDataLenShort } v.Depth, _ = r.ReadReplyHeader() // 2 v.Root = Window(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) // 4 v.Width = r.Read2b() v.Height = r.Read2b() // 5 v.BorderWidth = r.Read2b() // 6 return nil } // #WREQ func encodeQueryTree(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type QueryTreeReply struct { Root, Parent Window Children []Window } func readQueryTreeReply(r *Reader, v *QueryTreeReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 v.Root = Window(r.Read4b()) v.Parent = Window(r.Read4b()) // 4 childrenLen := int(r.Read2b()) // unused r.ReadPad(14) // 8 if childrenLen > 0 { if !r.RemainAtLeast4b(childrenLen) { return ErrDataLenShort } v.Children = make([]Window, childrenLen) for i := 0; i < childrenLen; i++ { v.Children[i] = Window(r.Read4b()) } } return nil } // #WREQ func encodeInternAtom(onlyIfExists bool, name string) (hd uint8, b RequestBody) { hd = BoolToUint8(onlyIfExists) name = TruncateStr(name, math.MaxUint16) nameLen := len(name) b.AddBlock(1 + SizeIn4bWithPad(nameLen)). Write2b(uint16(nameLen)). WritePad(2). WriteString(name). WritePad(Pad(nameLen)). End() return } type InternAtomReply struct { Atom Atom } func readInternAtomReply(r *Reader, v *InternAtomReply) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } r.ReadPad(8) // 2 v.Atom = Atom(r.Read4b()) // 3 return nil } // #WREQ func encodeGetAtomName(atom Atom) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(atom)). End() return } type GetAtomNameReply struct { Name string } func readGetAtomNameReply(r *Reader, v *GetAtomNameReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 // name len nameLen := r.Read2b() // unused r.ReadPad(22) // 8 var err error v.Name, err = r.ReadString(int(nameLen)) if err != nil { return err } return nil } // #WREQ func encodeChangeProperty(mode uint8, window Window, property, type0 Atom, format uint8, data []byte) (hd uint8, b RequestBody) { hd = mode dataLen := len(data) b.AddBlock(5). Write4b(uint32(window)). Write4b(uint32(property)). Write4b(uint32(type0)). Write1b(format). WritePad(3). Write4b(uint32(dataLen / (int(format) / 8))). End() b.AddBytes(data) return } // #WREQ func encodeDeleteProperty(window Window, property Atom) (hd uint8, b RequestBody) { b.AddBlock(2). Write4b(uint32(window)). Write4b(uint32(property)). End() return } // #WREQ func encodeGetProperty(delete bool, window Window, property, type0 Atom, longOffset, longLength uint32) (hd uint8, b RequestBody) { hd = BoolToUint8(delete) b.AddBlock(5). Write4b(uint32(window)). Write4b(uint32(property)). Write4b(uint32(type0)). Write4b(longOffset). Write4b(longLength). End() return } type GetPropertyReply struct { Format uint8 Type Atom BytesAfter uint32 ValueLen uint32 Value []byte } func readGetPropertyReply(r *Reader, v *GetPropertyReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } v.Format, _ = r.ReadReplyHeader() // 2 v.Type = Atom(r.Read4b()) v.BytesAfter = r.Read4b() v.ValueLen = r.Read4b() // 5 // unused r.ReadPad(12) // 8 n := int(v.ValueLen) * int(v.Format/8) var err error v.Value, err = r.ReadBytes(n) if err != nil { return err } return nil } // #WREQ func encodeListProperties(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type ListPropertiesReply struct { Atoms []Atom } func readListPropertiesReply(r *Reader, v *ListPropertiesReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 atomsLen := int(r.Read2b()) // unused r.ReadPad(22) // 8 if atomsLen > 0 { if !r.RemainAtLeast4b(atomsLen) { return ErrDataLenShort } v.Atoms = make([]Atom, atomsLen) for i := 0; i < atomsLen; i++ { v.Atoms[i] = Atom(r.Read4b()) } } return nil } // #WREQ func encodeSetSelectionOwner(owner Window, selection Atom, time Timestamp) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(owner)). Write4b(uint32(selection)). Write4b(uint32(time)). End() return } // #WREQ func encodeGetSelectionOwner(selection Atom) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(selection)). End() return } type GetSelectionOwnerReply struct { Owner Window } func readGetSelectionOwnerReply(r *Reader, v *GetSelectionOwnerReply) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } r.ReadPad(8) // 2 v.Owner = Window(r.Read4b()) // 3 return nil } // #WREQ func encodeConvertSelection(requestor Window, selection, target, property Atom, time Timestamp) (hd uint8, b RequestBody) { b.AddBlock(5). Write4b(uint32(requestor)). Write4b(uint32(selection)). Write4b(uint32(target)). Write4b(uint32(property)). Write4b(uint32(time)). End() return } // #WREQ func encodeSendEvent(propagate bool, destination Window, eventMask uint32, event []byte) (hd uint8, b RequestBody) { hd = BoolToUint8(propagate) b.AddBlock(2). Write4b(uint32(destination)). Write4b(eventMask) b.AddBytes(event) return } // #WREQ func encodeGrabPointer(ownerEvents bool, grabWindow Window, eventMask uint16, pointerMode, keyboardMode uint8, confineTo Window, cursor Cursor, time Timestamp) (hd uint8, b RequestBody) { hd = BoolToUint8(ownerEvents) b.AddBlock(5). Write4b(uint32(grabWindow)). Write2b(eventMask). Write1b(pointerMode). Write1b(keyboardMode). Write4b(uint32(confineTo)). Write4b(uint32(cursor)). Write4b(uint32(time)). End() return } type GrabPointerReply struct { Status uint8 } func readGrabPointerReply(r *Reader, v *GrabPointerReply) error { if !r.RemainAtLeast4b(2) { return ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() // 2 return nil } // #WREQ func encodeUngrabPointer(time Timestamp) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(time)). End() return } // #WREQ func encodeGrabButton(ownerEvents bool, grabWindow Window, eventMask uint16, pointerMode, keyboardMode uint8, confineTo Window, cursor Cursor, button uint8, modifiers uint16) (hd uint8, b RequestBody) { hd = BoolToUint8(ownerEvents) b.AddBlock(5). Write4b(uint32(grabWindow)). Write2b(eventMask). Write1b(pointerMode). Write1b(keyboardMode). Write4b(uint32(confineTo)). Write4b(uint32(cursor)). Write1b(button). WritePad(1). Write2b(modifiers). End() return } // #WREQ func encodeUngrabButton(button uint8, grabWindow Window, modifiers uint16) (hd uint8, b RequestBody) { hd = button b.AddBlock(2). Write4b(uint32(grabWindow)). Write2b(modifiers). WritePad(2). End() return } // #WREQ func encodeChangeActivePointerGrab(cursor Cursor, time Timestamp, eventMask uint16) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(cursor)). Write4b(uint32(time)). Write2b(eventMask). WritePad(2). End() return } // #WREQ func encodeGrabKeyboard(ownerEvents bool, grabWindow Window, time Timestamp, pointerMode, keyboardMode uint8) (hd uint8, b RequestBody) { hd = BoolToUint8(ownerEvents) b.AddBlock(3). Write4b(uint32(grabWindow)). Write4b(uint32(time)). Write1b(pointerMode). Write1b(keyboardMode). WritePad(2). End() return } type GrabKeyboardReply struct { Status uint8 } func readGrabKeyboardReply(r *Reader, v *GrabKeyboardReply) error { if !r.RemainAtLeast4b(2) { return ErrDataLenShort } v.Status, _ = r.ReadReplyHeader() // 2 return nil } // #WREQ func encodeUngrabKeyboard(time Timestamp) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(time)). End() return } // #WREQ func encodeGrabKey(ownerEvents bool, grabWindow Window, modifiers uint16, key Keycode, pointerMode, keyboardMode uint8) (hd uint8, b RequestBody) { hd = BoolToUint8(ownerEvents) b.AddBlock(3). Write4b(uint32(grabWindow)). Write2b(modifiers). Write1b(uint8(key)). Write1b(pointerMode). Write1b(keyboardMode). WritePad(3). End() return } // #WREQ func encodeUngrabKey(key Keycode, grabWindow Window, modifiers uint16) (hd uint8, b RequestBody) { hd = uint8(key) b.AddBlock(2). Write4b(uint32(grabWindow)). Write2b(modifiers). WritePad(2). End() return } // #WREQ func encodeAllowEvents(mode uint8, time Timestamp) (hd uint8, b RequestBody) { hd = mode b.AddBlock(1). Write4b(uint32(time)). End() return } // #WREQ func encodeGrabServer() (hd uint8, b RequestBody) { return } // #WREQ func encodeUngrabServer() (hd uint8, b RequestBody) { return } // #WREQ func encodeQueryPointer(window Window) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(window)). End() return } type QueryPointerReply struct { SameScreen bool Root Window Child Window RootX int16 RootY int16 WinX int16 WinY int16 Mask uint16 } func readQueryPointerReply(r *Reader, v *QueryPointerReply) error { if !r.RemainAtLeast4b(7) { return ErrDataLenShort } sameScreen, _ := r.ReadReplyHeader() // 2 v.SameScreen = Uint8ToBool(sameScreen) v.Root = Window(r.Read4b()) v.Child = Window(r.Read4b()) v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) // 5 v.WinX = int16(r.Read2b()) v.WinY = int16(r.Read2b()) // 6 v.Mask = r.Read2b() // 7 return nil } // #WREQ func encodeGetMotionEvents(window Window, start, stop Timestamp) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(window)). Write4b(uint32(start)). Write4b(uint32(stop)). End() return } type GetMotionEventsReply struct { Events []TimeCoord } // size: 2 * 4b type TimeCoord struct { Time Timestamp X, Y int16 } func readTimeCoord(r *Reader, v *TimeCoord) { v.Time = Timestamp(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) } func readGetMotionEventsReply(r *Reader, v *GetMotionEventsReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 eventsLen := int(r.Read4b()) // 3 // unused r.ReadPad(20) // 8 if eventsLen > 0 { if !r.RemainAtLeast4b(eventsLen * 2) { return ErrDataLenShort } v.Events = make([]TimeCoord, eventsLen) for i := 0; i < eventsLen; i++ { readTimeCoord(r, &v.Events[i]) } } return nil } // #WREQ func encodeTranslateCoordinates(srcWindow, dstWindow Window, srcX, srcY int16) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(srcWindow)). Write4b(uint32(dstWindow)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). End() return } type TranslateCoordinatesReply struct { SameScreen bool Child Window DstX int16 DstY int16 } func readTranslateCoordinatesReply(r *Reader, v *TranslateCoordinatesReply) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } sameScreen, _ := r.ReadReplyHeader() // 2 v.SameScreen = Uint8ToBool(sameScreen) v.Child = Window(r.Read4b()) v.DstX = int16(r.Read2b()) v.DstY = int16(r.Read2b()) // 4 return nil } // #WREQ func encodeWarpPointer(srcWindow, dstWindow Window, srcX, srcY int16, srcWidth, srcHeight uint16, dstX, dstY int16) (hd uint8, b RequestBody) { b.AddBlock(5). Write4b(uint32(srcWindow)). Write4b(uint32(dstWindow)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). Write2b(srcWidth). Write2b(srcHeight). Write2b(uint16(dstX)). Write2b(uint16(dstY)). End() return } // #WREQ func encodeSetInputFocus(revertTo uint8, focus Window, time Timestamp) (hd uint8, b RequestBody) { hd = revertTo b.AddBlock(2). Write4b(uint32(focus)). Write4b(uint32(time)). End() return } // #WREQ func encodeGetInputFocus() (hd uint8, b RequestBody) { return } type GetInputFocusReply struct { RevertTo uint8 Focus Window } func readGetInputFocusReply(r *Reader, v *GetInputFocusReply) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } v.RevertTo, _ = r.ReadReplyHeader() v.Focus = Window(r.Read4b()) // 3 return nil } // #WREQ func encodeQueryKeymap() (hd uint8, b RequestBody) { return } type QueryKeymapReply struct { Keys []byte } func readQueryKeymapReply(r *Reader, v *QueryKeymapReply) error { if !r.RemainAtLeast4b(10) { return ErrDataLenShort } r.ReadPad(8) // 2 // keys v.Keys = r.MustReadBytes(32) // 10 return nil } // #WREQ func encodeOpenFont(fid Font, name string) (hd uint8, b RequestBody) { name = TruncateStr(name, math.MaxUint16) nameLen := len(name) b.AddBlock(2 + SizeIn4bWithPad(nameLen)). Write4b(uint32(fid)). Write2b(uint16(nameLen)). WritePad(2). WriteString(name). WritePad(Pad(nameLen)). End() return } // #WREQ func encodeCloseFont(font Font) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(font)). End() return } // #WREQ func encodeQueryFont(font Fontable) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(font)). End() return } type QueryFontReply struct { MinBounds CharInfo MaxBounds CharInfo MinCharOrByte2 uint16 MaxCharOrByte2 uint16 DefaultChar uint16 PropertiesLen uint16 DrawDirection uint8 MinByte1 uint8 MaxByte1 uint8 AllCharsExist bool FontAscent int16 FontDescent int16 CharInfosLen uint32 Properties []FontProp CharInfos []CharInfo } func readQueryFontReply(r *Reader, v *QueryFontReply) error { if !r.RemainAtLeast4b(15) { return ErrDataLenShort } r.ReadPad(8) // 2 readCharInfo(r, &v.MinBounds) // 5 // unused r.ReadPad(4) // 6 readCharInfo(r, &v.MaxBounds) // 9 // unused r.ReadPad(4) // 10 v.MinCharOrByte2 = r.Read2b() v.MaxCharOrByte2 = r.Read2b() v.DefaultChar = r.Read2b() propsLen := int(r.Read2b()) // 12 v.DrawDirection = r.Read1b() v.MinByte1 = r.Read1b() v.MaxByte1 = r.Read1b() v.AllCharsExist = r.ReadBool() v.FontAscent = int16(r.Read2b()) v.FontDescent = int16(r.Read2b()) charInfosLen := int(r.Read4b()) // 15 if propsLen > 0 { if !r.RemainAtLeast4b(2 * propsLen) { return ErrDataLenShort } v.Properties = make([]FontProp, propsLen) for i := 0; i < propsLen; i++ { readFontProp(r, &v.Properties[i]) } } if charInfosLen > 0 { if !r.RemainAtLeast4b(3 * charInfosLen) { return ErrDataLenShort } v.CharInfos = make([]CharInfo, charInfosLen) for i := 0; i < charInfosLen; i++ { readCharInfo(r, &v.CharInfos[i]) } } return nil } // size: 3 * 4b type CharInfo struct { LeftSideBearing int16 RightSideBearing int16 CharacterWidth int16 Ascent int16 Descent int16 Attributes uint16 } func readCharInfo(r *Reader, v *CharInfo) { v.LeftSideBearing = int16(r.Read2b()) v.RightSideBearing = int16(r.Read2b()) v.CharacterWidth = int16(r.Read2b()) v.Ascent = int16(r.Read2b()) v.Descent = int16(r.Read2b()) v.Attributes = r.Read2b() } // size: 2 * 4b type FontProp struct { Name Atom Value uint32 } func readFontProp(r *Reader, v *FontProp) { v.Name = Atom(r.Read4b()) v.Value = r.Read4b() } // TODO: QueryTextExtents // #WREQ func encodeListFonts(maxNames uint16, pattern string) (hd uint8, b RequestBody) { pattern = TruncateStr(pattern, math.MaxUint16) patternLen := len(pattern) b.AddBlock(1 + SizeIn4bWithPad(patternLen)). Write2b(maxNames). Write2b(uint16(patternLen)). WriteString(pattern). WritePad(Pad(patternLen)). End() return } type ListFontsReply struct { Names []string } func readListFontsReply(r *Reader, v *ListFontsReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 namesLen := int(r.Read2b()) // unused r.ReadPad(22) // 8 // names if namesLen > 0 { v.Names = make([]string, namesLen) for i := 0; i < namesLen; i++ { var str Str _, err := readStr(r, &str) if err != nil { return err } v.Names[i] = str.Value } } return nil } // #WREQ func encodeListFontsWithInfo(maxNames uint16, pattern string) (hd uint8, b RequestBody) { pattern = TruncateStr(pattern, math.MaxUint16) patternLen := len(pattern) b.AddBlock(1 + SizeIn4bWithPad(patternLen)). Write2b(maxNames). Write2b(uint16(patternLen)). WriteString(pattern). WritePad(Pad(patternLen)). End() return } type ListFontsWithInfoReply struct { LastReply bool MinBounds CharInfo MaxBounds CharInfo MinCharOrByte2 uint16 MaxCharOrByte2 uint16 DefaultChar uint16 PropertiesLen uint16 DrawDirection uint8 MinByte1 uint8 MaxByte1 uint8 AllCharsExist bool FontAscent int16 FontDescent int16 RepliesHint uint32 Properties []FontProp Name string } func readListFontsWithInfoReply(r *Reader, v *ListFontsWithInfoReply) error { if !r.RemainAtLeast4b(15) { return ErrDataLenShort } lastReplyIndicator, replyLen := r.ReadReplyHeader() // 2 if lastReplyIndicator == 0 { v.LastReply = true return nil } else { v.LastReply = false } readCharInfo(r, &v.MinBounds) // 5 // unused r.ReadPad(4) // 6 readCharInfo(r, &v.MaxBounds) // 9 // unused r.ReadPad(4) v.MinCharOrByte2 = r.Read2b() v.MaxCharOrByte2 = r.Read2b() // 11 v.DefaultChar = r.Read2b() propsLen := int(r.Read2b()) v.DrawDirection = r.Read1b() v.MinByte1 = r.Read1b() v.MaxByte1 = r.Read1b() v.AllCharsExist = r.ReadBool() // 13 v.FontAscent = int16(r.Read2b()) v.FontDescent = int16(r.Read2b()) v.RepliesHint = r.Read4b() // 15 if propsLen > 0 { if !r.RemainAtLeast4b(2 * propsLen) { return ErrDataLenShort } v.Properties = make([]FontProp, propsLen) for i := 0; i < propsLen; i++ { readFontProp(r, &v.Properties[i]) } } // TODO: use r.ReadNulTermStr nameLen := (int(replyLen) - 7 - (2 * propsLen)) * 4 nameBytes, err := r.ReadBytes(nameLen) if err != nil { return err } zeroIdx := bytes.IndexByte(nameBytes, 0) if zeroIdx != -1 { nameBytes = nameBytes[:zeroIdx] } v.Name = string(nameBytes) return nil } // #WREQ func encodeSetFontPath(paths []string) (hd uint8, b RequestBody) { pathsLen := uint16(len(paths)) var n int for _, p := range paths { pLen := len(p) if pLen > math.MaxUint8 { pLen = math.MaxUint8 } n += 1 + pLen } b0 := b.AddBlock(1 + SizeIn4bWithPad(n)). Write2b(pathsLen). WritePad(2) for _, p := range paths { writeStr(b0, p) } b0.WritePad(Pad(n)).End() return } // #WREQ func encodeGetFontPath() (hd uint8, b RequestBody) { return } type GetFontPathReply struct { Paths []string } func readGetFontPathReply(r *Reader, v *GetFontPathReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(8) // 2 pathsLen := int(r.Read2b()) // unused r.ReadPad(22) // 8 if pathsLen > 0 { v.Paths = make([]string, pathsLen) for i := 0; i < pathsLen; i++ { var str Str _, err := readStr(r, &str) if err != nil { return err } v.Paths[i] = str.Value } } return nil } // #WREQ func encodeCreatePixmap(depth uint8, pid Pixmap, drawable Drawable, width, height uint16) (hd uint8, b RequestBody) { hd = depth b.AddBlock(3). Write4b(uint32(pid)). Write4b(uint32(drawable)). Write2b(width). Write2b(height). End() return } // #WREQ func encodeFreePixmap(pixmap Pixmap) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(pixmap)). End() return } // #WREQ func encodeCreateGC(cid GContext, drawable Drawable, valueMask uint32, valueList []uint32) (hd uint8, b RequestBody) { b0 := b.AddBlock(3 + len(valueList)). Write4b(uint32(cid)). Write4b(uint32(drawable)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeChangeGC(gc GContext, valueMask uint32, valueList []uint32) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + len(valueList)). Write4b(uint32(gc)). Write4b(valueMask) for _, value := range valueList { b0.Write4b(value) } b0.End() return } // #WREQ func encodeCopyGC(srcGC, dstGC GContext, valueMask uint32) (hd uint8, b RequestBody) { b.AddBlock(3). Write4b(uint32(srcGC)). Write4b(uint32(dstGC)). Write4b(valueMask). End() return } // #WREQ func encodeSetDashes(gc GContext, dashOffset uint16, dashes []uint8) (hd uint8, b RequestBody) { dashesLen := uint16(len(dashes)) b.AddBlock(2). Write4b(uint32(gc)). Write2b(dashOffset). Write2b(dashesLen). End() b.AddBytes(dashes) return } // #WREQ func encodeSetClipRectangles(ordering uint8, gc GContext, clipXOrigin, clipYOrigin int16, rectangles []Rectangle) (hd uint8, b RequestBody) { hd = ordering b0 := b.AddBlock(2 + 2*len(rectangles)). Write4b(uint32(gc)). Write2b(uint16(clipXOrigin)). Write2b(uint16(clipYOrigin)) for _, rect := range rectangles { WriteRectangle(b0, rect) } b0.End() return } // #WREQ func encodeFreeGC(gc GContext) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(gc)). End() return } // #WREQ func encodeClearArea(exposures bool, window Window, x, y int16, width, height uint16) (hd uint8, b RequestBody) { hd = BoolToUint8(exposures) b.AddBlock(3). Write4b(uint32(window)). Write2b(uint16(x)). Write2b(uint16(y)). Write2b(width). Write2b(height). End() return } // #WREQ func encodeCopyArea(srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16) (hd uint8, b RequestBody) { b.AddBlock(6). Write4b(uint32(srcDrawable)). Write4b(uint32(dstDrawable)). Write4b(uint32(gc)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). Write2b(uint16(dstX)). Write2b(uint16(dstY)). Write2b(width). Write2b(height). End() return } // #WREQ func encodeCopyPlane(srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16, bitPlane uint32) (hd uint8, b RequestBody) { b.AddBlock(7). Write4b(uint32(srcDrawable)). Write4b(uint32(dstDrawable)). Write4b(uint32(gc)). Write2b(uint16(srcX)). Write2b(uint16(srcY)). Write2b(uint16(dstX)). Write2b(uint16(dstY)). Write2b(width). Write2b(height). Write4b(bitPlane). End() return } type Point struct { X, Y int16 } func writePoint(b *FixedSizeBuf, v Point) { b.Write2b(uint16(v.X)) b.Write2b(uint16(v.Y)) } // #WREQ func encodePolyPoint(coordinateMode uint8, drawable Drawable, gc GContext, points []Point) (hd uint8, b RequestBody) { hd = coordinateMode b0 := b.AddBlock(2 + len(points)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, p := range points { writePoint(b0, p) } b0.End() return } // #WREQ func encodePolyLine(coordinateMode uint8, drawable Drawable, gc GContext, points []Point) (hd uint8, b RequestBody) { hd = coordinateMode b0 := b.AddBlock(2 + len(points)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, p := range points { writePoint(b0, p) } b0.End() return } // #WREQ func encodePolySegment(drawable Drawable, gc GContext, segments []Segment) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + 2*len(segments)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, seg := range segments { writeSegment(b0, seg) } b0.End() return } type Segment struct { X1, Y1, X2, Y2 int16 } func writeSegment(w *FixedSizeBuf, v Segment) { w.Write2b(uint16(v.X1)) w.Write2b(uint16(v.Y1)) w.Write2b(uint16(v.X2)) w.Write2b(uint16(v.Y2)) } // #WREQ func encodePolyRectangle(drawable Drawable, gc GContext, rectangles []Rectangle) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + 2*len(rectangles)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, rect := range rectangles { WriteRectangle(b0, rect) } b0.End() return } // #WREQ func encodePolyArc(drawable Drawable, gc GContext, arcs []Arc) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + 3*len(arcs)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, arc := range arcs { writeArc(b0, arc) } b0.End() return } type Arc struct { X, Y int16 Width, Height uint16 Angle1, Angle2 int16 } func writeArc(w *FixedSizeBuf, v Arc) { w.Write2b(uint16(v.X)) w.Write2b(uint16(v.Y)) w.Write2b(v.Width) w.Write2b(v.Height) w.Write2b(uint16(v.Angle1)) w.Write2b(uint16(v.Angle2)) } // #WREQ func encodeFillPoly(drawable Drawable, gc GContext, shape uint8, coordinateMode uint8, points []Point) (hd uint8, b RequestBody) { b0 := b.AddBlock(3 + len(points)). Write4b(uint32(drawable)). Write4b(uint32(gc)). Write1b(shape). Write1b(coordinateMode). WritePad(2) for _, p := range points { writePoint(b0, p) } b0.End() return } // #WREQ func encodePolyFillRectangle(drawable Drawable, gc GContext, rectangles []Rectangle) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + 2*len(rectangles)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, rect := range rectangles { WriteRectangle(b0, rect) } b0.End() return } // #WREQ func encodePolyFillArc(drawable Drawable, gc GContext, arcs []Arc) (hd uint8, b RequestBody) { b0 := b.AddBlock(2 + 3*len(arcs)). Write4b(uint32(drawable)). Write4b(uint32(gc)) for _, arc := range arcs { writeArc(b0, arc) } b0.End() return } // #WREQ func encodePutImage(format uint8, drawable Drawable, gc GContext, width, height uint16, dstX, dstY int16, leftPad, depth uint8, data []byte) (hd uint8, b RequestBody) { hd = format b.AddBlock(5). Write4b(uint32(drawable)). Write4b(uint32(gc)). Write2b(width). Write2b(height). Write2b(uint16(dstX)). Write2b(uint16(dstY)). Write1b(leftPad). Write1b(depth). WritePad(2). End() b.AddBytes(data) return } // #WREQ func encodeGetImage(format uint8, drawable Drawable, x, y int16, width, height uint16, planeMask uint32) (hd uint8, b RequestBody) { hd = format b.AddBlock(4). Write4b(uint32(drawable)). Write2b(uint16(x)). Write2b(uint16(y)). Write2b(width). Write2b(height). Write4b(planeMask). End() return } type GetImageReply struct { Depth uint8 Visual VisualID Data []byte } func readGetImageReply(r *Reader, v *GetImageReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } var replyLen uint32 v.Depth, replyLen = r.ReadReplyHeader() v.Visual = VisualID(r.Read4b()) // 3 // unused r.ReadPad(20) // 8 dataLen := int(replyLen) * 4 var err error v.Data, err = r.ReadBytes(dataLen) if err != nil { return err } return nil } // #WREQ func encodeQueryExtension(name string) (hd uint8, b RequestBody) { name = TruncateStr(name, math.MaxUint16) nameLen := len(name) b.AddBlock(1 + SizeIn4bWithPad(nameLen)). Write2b(uint16(nameLen)). WritePad(2). WriteString(name). WritePad(Pad(nameLen)). End() return } type QueryExtensionReply struct { Present bool MajorOpcode uint8 FirstEvent uint8 FirstError uint8 } func readQueryExtensionReply(r *Reader, v *QueryExtensionReply) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } r.ReadPad(8) // 2 v.Present = r.ReadBool() v.MajorOpcode = r.Read1b() v.FirstEvent = r.Read1b() v.FirstError = r.Read1b() // 3 return nil } // #WREQ func encodeListExtensions() (hd uint8, b RequestBody) { return } type ListExtensionsReply struct { Names []string } type Str struct { Value string } func ReadStr(r *Reader) (string, error) { var v Str _, err := readStr(r, &v) if err != nil { return "", err } return v.Value, nil } func readStr(r *Reader, v *Str) (int, error) { if !r.RemainAtLeast(1) { return 0, ErrDataLenShort } nameLen := int(r.Read1b()) var err error v.Value, err = r.ReadString(nameLen) if err != nil { return 0, err } return 1 + nameLen, nil } func writeStr(b *FixedSizeBuf, str string) { str = TruncateStr(str, math.MaxUint8) b.Write1b(uint8(len(str))) b.WriteString(str) } func readListExtensionsReply(r *Reader, v *ListExtensionsReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } strsLen, _ := r.ReadReplyHeader() // 2 // unused r.ReadPad(24) // 8 if strsLen > 0 { names := make([]string, strsLen) for i := 0; i < int(strsLen); i++ { var str Str _, err := readStr(r, &str) if err != nil { return err } names[i] = str.Value } v.Names = names } return nil } // #WREQ func encodeKillClient(resource uint32) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(resource). End() return } // #WREQ func encodeGetKeyboardMapping(firstKeycode Keycode, count uint8) (hd uint8, b RequestBody) { b.AddBlock(1). Write1b(uint8(firstKeycode)). Write1b(count). WritePad(2). End() return } type GetKeyboardMappingReply struct { KeysymsPerKeycode uint8 Keysyms []Keysym } func readGetKeyboardMappingReply(r *Reader, v *GetKeyboardMappingReply) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } var keysymsLen uint32 v.KeysymsPerKeycode, keysymsLen = r.ReadReplyHeader() // 2 // unused r.ReadPad(24) // 8 if !r.RemainAtLeast4b(int(keysymsLen)) { return ErrDataLenShort } v.Keysyms = make([]Keysym, keysymsLen) for i := 0; i < int(keysymsLen); i++ { v.Keysyms[i] = Keysym(r.Read4b()) } return nil } // #WREQ func encodeSetScreenSaver(timeout, interval int16, preferBlanking, allowExposures uint8) (hd uint8, b RequestBody) { b.AddBlock(2). Write2b(uint16(timeout)). Write2b(uint16(interval)). Write1b(preferBlanking). Write1b(allowExposures). WritePad(2). End() return } // #WREQ func encodeGetScreenSaver() (hd uint8, b RequestBody) { return } type GetScreenSaverReply struct { Timeout uint16 Interval uint16 PreferBlanking uint8 AllowExposures uint8 } func readGetScreenSaverReply(r *Reader, v *GetScreenSaverReply) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } r.ReadPad(8) // 2 v.Timeout = r.Read2b() v.Interval = r.Read2b() v.PreferBlanking = r.Read1b() v.AllowExposures = r.Read1b() // 4 return nil } // #WREQ func encodeForceScreenSaver(mode uint8) (hd uint8, b RequestBody) { hd = mode return } // #WREQ func encodeNoOperation(n int) (hd uint8, b RequestBody) { b.AddBlock(n) return } // #WREQ func encodeFreeCursor(cursor Cursor) (hd uint8, b RequestBody) { b.AddBlock(1). Write4b(uint32(cursor)). End() return } // #WREQ func encodeChangeHosts(mode, family uint8, address string) (hd uint8, b RequestBody) { address = TruncateStr(address, math.MaxUint16) hd = mode b.AddBlock(1). Write1b(family). Write1b(0). Write2b(uint16(len(address))). End() b.AddBytes([]byte(address)) return }go-x11-client-1.0.2/xproto_auto.go000066400000000000000000001020351460713373000167210ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x // simple ('xcb', 'WINDOW') type Window uint32 // simple ('xcb', 'PIXMAP') type Pixmap uint32 // simple ('xcb', 'CURSOR') type Cursor uint32 // simple ('xcb', 'FONT') type Font uint32 // simple ('xcb', 'GCONTEXT') type GContext uint32 // simple ('xcb', 'COLORMAP') type Colormap uint32 // simple ('xcb', 'ATOM') type Atom uint32 // simple ('xcb', 'DRAWABLE') type Drawable uint32 // simple ('xcb', 'FONTABLE') type Fontable uint32 // simple ('xcb', 'BOOL32') type Bool32 uint32 // simple ('xcb', 'VISUALID') type VisualID uint32 // simple ('xcb', 'TIMESTAMP') type Timestamp uint32 // simple ('xcb', 'KEYSYM') type Keysym uint32 // simple ('xcb', 'KEYCODE') type Keycode uint8 // simple ('xcb', 'KEYCODE32') type Keycode32 uint32 // simple ('xcb', 'BUTTON') type Button uint8 // enum VisualClass const ( VisualClassStaticGray = 0 VisualClassGrayScale = 1 VisualClassStaticColor = 2 VisualClassPseudoColor = 3 VisualClassTrueColor = 4 VisualClassDirectColor = 5 ) // enum EventMask const ( EventMaskNoEvent = 0 EventMaskKeyPress = 1 EventMaskKeyRelease = 2 EventMaskButtonPress = 4 EventMaskButtonRelease = 8 EventMaskEnterWindow = 16 EventMaskLeaveWindow = 32 EventMaskPointerMotion = 64 EventMaskPointerMotionHint = 128 EventMaskButton1Motion = 256 EventMaskButton2Motion = 512 EventMaskButton3Motion = 1024 EventMaskButton4Motion = 2048 EventMaskButton5Motion = 4096 EventMaskButtonMotion = 8192 EventMaskKeymapState = 16384 EventMaskExposure = 32768 EventMaskVisibilityChange = 65536 EventMaskStructureNotify = 131072 EventMaskResizeRedirect = 262144 EventMaskSubstructureNotify = 524288 EventMaskSubstructureRedirect = 1048576 EventMaskFocusChange = 2097152 EventMaskPropertyChange = 4194304 EventMaskColorMapChange = 8388608 EventMaskOwnerGrabButton = 16777216 ) // enum BackingStore const ( BackingStoreNotUseful = 0 BackingStoreWhenMapped = 1 BackingStoreAlways = 2 ) // enum ImageOrder const ( ImageOrderLSBFirst = 0 ImageOrderMSBFirst = 1 ) // enum ModMask const ( ModMaskShift = 1 ModMaskLock = 2 ModMaskControl = 4 ModMask1 = 8 ModMask2 = 16 ModMask3 = 32 ModMask4 = 64 ModMask5 = 128 ModMaskAny = 32768 ) // enum KeyButMask const ( KeyButMaskShift = 1 KeyButMaskLock = 2 KeyButMaskControl = 4 KeyButMaskMod1 = 8 KeyButMaskMod2 = 16 KeyButMaskMod3 = 32 KeyButMaskMod4 = 64 KeyButMaskMod5 = 128 KeyButMaskButton1 = 256 KeyButMaskButton2 = 512 KeyButMaskButton3 = 1024 KeyButMaskButton4 = 2048 KeyButMaskButton5 = 4096 ) // enum Window const ( WindowNone = 0 ) const KeyPressEventCode = 2 func NewKeyPressEvent(data []byte) (*KeyPressEvent, error) { var ev KeyPressEvent r := NewReaderFromData(data) err := readKeyPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const KeyReleaseEventCode = 3 func NewKeyReleaseEvent(data []byte) (*KeyReleaseEvent, error) { var ev KeyReleaseEvent r := NewReaderFromData(data) err := readKeyReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum ButtonMask const ( ButtonMask1 = 256 ButtonMask2 = 512 ButtonMask3 = 1024 ButtonMask4 = 2048 ButtonMask5 = 4096 ButtonMaskAny = 32768 ) const ButtonPressEventCode = 4 func NewButtonPressEvent(data []byte) (*ButtonPressEvent, error) { var ev ButtonPressEvent r := NewReaderFromData(data) err := readButtonPressEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ButtonReleaseEventCode = 5 func NewButtonReleaseEvent(data []byte) (*ButtonReleaseEvent, error) { var ev ButtonReleaseEvent r := NewReaderFromData(data) err := readButtonReleaseEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Motion const ( MotionNormal = 0 MotionHint = 1 ) const MotionNotifyEventCode = 6 func NewMotionNotifyEvent(data []byte) (*MotionNotifyEvent, error) { var ev MotionNotifyEvent r := NewReaderFromData(data) err := readMotionNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum NotifyDetail const ( NotifyDetailAncestor = 0 NotifyDetailVirtual = 1 NotifyDetailInferior = 2 NotifyDetailNonlinear = 3 NotifyDetailNonlinearVirtual = 4 NotifyDetailPointer = 5 NotifyDetailPointerRoot = 6 NotifyDetailNone = 7 ) // enum NotifyMode const ( NotifyModeNormal = 0 NotifyModeGrab = 1 NotifyModeUngrab = 2 NotifyModeWhileGrabbed = 3 ) const EnterNotifyEventCode = 7 func NewEnterNotifyEvent(data []byte) (*EnterNotifyEvent, error) { var ev EnterNotifyEvent r := NewReaderFromData(data) err := readEnterNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const LeaveNotifyEventCode = 8 func NewLeaveNotifyEvent(data []byte) (*LeaveNotifyEvent, error) { var ev LeaveNotifyEvent r := NewReaderFromData(data) err := readLeaveNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const FocusInEventCode = 9 func NewFocusInEvent(data []byte) (*FocusInEvent, error) { var ev FocusInEvent r := NewReaderFromData(data) err := readFocusInEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const FocusOutEventCode = 10 func NewFocusOutEvent(data []byte) (*FocusOutEvent, error) { var ev FocusOutEvent r := NewReaderFromData(data) err := readFocusOutEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const KeymapNotifyEventCode = 11 func NewKeymapNotifyEvent(data []byte) (*KeymapNotifyEvent, error) { var ev KeymapNotifyEvent r := NewReaderFromData(data) err := readKeymapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ExposeEventCode = 12 func NewExposeEvent(data []byte) (*ExposeEvent, error) { var ev ExposeEvent r := NewReaderFromData(data) err := readExposeEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const GraphicsExposureEventCode = 13 func NewGraphicsExposureEvent(data []byte) (*GraphicsExposureEvent, error) { var ev GraphicsExposureEvent r := NewReaderFromData(data) err := readGraphicsExposureEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const NoExposureEventCode = 14 func NewNoExposureEvent(data []byte) (*NoExposureEvent, error) { var ev NoExposureEvent r := NewReaderFromData(data) err := readNoExposureEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Visibility const ( VisibilityUnobscured = 0 VisibilityPartiallyObscured = 1 VisibilityFullyObscured = 2 ) const VisibilityNotifyEventCode = 15 func NewVisibilityNotifyEvent(data []byte) (*VisibilityNotifyEvent, error) { var ev VisibilityNotifyEvent r := NewReaderFromData(data) err := readVisibilityNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const CreateNotifyEventCode = 16 func NewCreateNotifyEvent(data []byte) (*CreateNotifyEvent, error) { var ev CreateNotifyEvent r := NewReaderFromData(data) err := readCreateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const DestroyNotifyEventCode = 17 func NewDestroyNotifyEvent(data []byte) (*DestroyNotifyEvent, error) { var ev DestroyNotifyEvent r := NewReaderFromData(data) err := readDestroyNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const UnmapNotifyEventCode = 18 func NewUnmapNotifyEvent(data []byte) (*UnmapNotifyEvent, error) { var ev UnmapNotifyEvent r := NewReaderFromData(data) err := readUnmapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const MapNotifyEventCode = 19 func NewMapNotifyEvent(data []byte) (*MapNotifyEvent, error) { var ev MapNotifyEvent r := NewReaderFromData(data) err := readMapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const MapRequestEventCode = 20 func NewMapRequestEvent(data []byte) (*MapRequestEvent, error) { var ev MapRequestEvent r := NewReaderFromData(data) err := readMapRequestEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ReparentNotifyEventCode = 21 func NewReparentNotifyEvent(data []byte) (*ReparentNotifyEvent, error) { var ev ReparentNotifyEvent r := NewReaderFromData(data) err := readReparentNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ConfigureNotifyEventCode = 22 func NewConfigureNotifyEvent(data []byte) (*ConfigureNotifyEvent, error) { var ev ConfigureNotifyEvent r := NewReaderFromData(data) err := readConfigureNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ConfigureRequestEventCode = 23 func NewConfigureRequestEvent(data []byte) (*ConfigureRequestEvent, error) { var ev ConfigureRequestEvent r := NewReaderFromData(data) err := readConfigureRequestEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const GravityNotifyEventCode = 24 func NewGravityNotifyEvent(data []byte) (*GravityNotifyEvent, error) { var ev GravityNotifyEvent r := NewReaderFromData(data) err := readGravityNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ResizeRequestEventCode = 25 func NewResizeRequestEvent(data []byte) (*ResizeRequestEvent, error) { var ev ResizeRequestEvent r := NewReaderFromData(data) err := readResizeRequestEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Place const ( PlaceOnTop = 0 PlaceOnBottom = 1 ) const CirculateNotifyEventCode = 26 func NewCirculateNotifyEvent(data []byte) (*CirculateNotifyEvent, error) { var ev CirculateNotifyEvent r := NewReaderFromData(data) err := readCirculateNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const CirculateRequestEventCode = 27 func NewCirculateRequestEvent(data []byte) (*CirculateRequestEvent, error) { var ev CirculateRequestEvent r := NewReaderFromData(data) err := readCirculateRequestEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Property const ( PropertyNewValue = 0 PropertyDelete = 1 ) const PropertyNotifyEventCode = 28 func NewPropertyNotifyEvent(data []byte) (*PropertyNotifyEvent, error) { var ev PropertyNotifyEvent r := NewReaderFromData(data) err := readPropertyNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const SelectionClearEventCode = 29 func NewSelectionClearEvent(data []byte) (*SelectionClearEvent, error) { var ev SelectionClearEvent r := NewReaderFromData(data) err := readSelectionClearEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Time const ( TimeCurrentTime = 0 ) // enum Atom const ( AtomNone = 0 AtomAny = 0 AtomPrimary = 1 AtomSecondary = 2 AtomArc = 3 AtomAtom = 4 AtomBitmap = 5 AtomCardinal = 6 AtomColormap = 7 AtomCursor = 8 AtomCutBuffer0 = 9 AtomCutBuffer1 = 10 AtomCutBuffer2 = 11 AtomCutBuffer3 = 12 AtomCutBuffer4 = 13 AtomCutBuffer5 = 14 AtomCutBuffer6 = 15 AtomCutBuffer7 = 16 AtomDrawable = 17 AtomFont = 18 AtomInteger = 19 AtomPixmap = 20 AtomPoint = 21 AtomRectangle = 22 AtomResourceManager = 23 AtomRGBColorMap = 24 AtomRGBBestMap = 25 AtomRGBBlueMap = 26 AtomRGBDefaultMap = 27 AtomRGBGrayMap = 28 AtomRGBGreenMap = 29 AtomRGBRedMap = 30 AtomString = 31 AtomVisualID = 32 AtomWindow = 33 AtomWMCommand = 34 AtomWMHints = 35 AtomWMClientMachine = 36 AtomWMIconName = 37 AtomWMIconSize = 38 AtomWMName = 39 AtomWMNormalHints = 40 AtomWMSizeHints = 41 AtomWMZoomHints = 42 AtomMinSpace = 43 AtomNormSpace = 44 AtomMaxSpace = 45 AtomEndSpace = 46 AtomSuperscriptX = 47 AtomSuperscriptY = 48 AtomSubscriptX = 49 AtomSubscriptY = 50 AtomUnderlinePosition = 51 AtomUnderlineThickness = 52 AtomStrikeoutAscent = 53 AtomStrikeoutDescent = 54 AtomItalicAngle = 55 AtomXHeight = 56 AtomQuadWidth = 57 AtomWeight = 58 AtomPointSize = 59 AtomResolution = 60 AtomCopyright = 61 AtomNotice = 62 AtomFontName = 63 AtomFamilyName = 64 AtomFullName = 65 AtomCapHeight = 66 AtomWMClass = 67 AtomWMTransientFor = 68 ) const SelectionRequestEventCode = 30 func NewSelectionRequestEvent(data []byte) (*SelectionRequestEvent, error) { var ev SelectionRequestEvent r := NewReaderFromData(data) err := readSelectionRequestEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const SelectionNotifyEventCode = 31 func NewSelectionNotifyEvent(data []byte) (*SelectionNotifyEvent, error) { var ev SelectionNotifyEvent r := NewReaderFromData(data) err := readSelectionNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum ColormapState const ( ColormapStateUninstalled = 0 ColormapStateInstalled = 1 ) // enum Colormap const ( ColormapNone = 0 ) const ColormapNotifyEventCode = 32 func NewColormapNotifyEvent(data []byte) (*ColormapNotifyEvent, error) { var ev ColormapNotifyEvent r := NewReaderFromData(data) err := readColormapNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const ClientMessageEventCode = 33 func NewClientMessageEvent(data []byte) (*ClientMessageEvent, error) { var ev ClientMessageEvent r := NewReaderFromData(data) err := readClientMessageEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } // enum Mapping const ( MappingModifier = 0 MappingKeyboard = 1 MappingPointer = 2 ) const MappingNotifyEventCode = 34 func NewMappingNotifyEvent(data []byte) (*MappingNotifyEvent, error) { var ev MappingNotifyEvent r := NewReaderFromData(data) err := readMappingNotifyEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const GeGenericEventCode = 35 func NewGeGenericEvent(data []byte) (*GeGenericEvent, error) { var ev GeGenericEvent r := NewReaderFromData(data) err := readGeGenericEvent(r, &ev) if err != nil { return nil, err } return &ev, nil } const RequestErrorCode = 1 const ValueErrorCode = 2 const WindowErrorCode = 3 const PixmapErrorCode = 4 const AtomErrorCode = 5 const CursorErrorCode = 6 const FontErrorCode = 7 const MatchErrorCode = 8 const DrawableErrorCode = 9 const AccessErrorCode = 10 const AllocErrorCode = 11 const ColormapErrorCode = 12 const GContextErrorCode = 13 const IdChoiceErrorCode = 14 const NameErrorCode = 15 const LengthErrorCode = 16 const ImplementationErrorCode = 17 // enum WindowClass const ( WindowClassCopyFromParent = 0 WindowClassInputOutput = 1 WindowClassInputOnly = 2 ) // enum CW const ( CWBackPixmap = 1 CWBackPixel = 2 CWBorderPixmap = 4 CWBorderPixel = 8 CWBitGravity = 16 CWWinGravity = 32 CWBackingStore = 64 CWBackingPlanes = 128 CWBackingPixel = 256 CWOverrideRedirect = 512 CWSaveUnder = 1024 CWEventMask = 2048 CWDontPropagate = 4096 CWColormap = 8192 CWCursor = 16384 ) // enum BackPixmap const ( BackPixmapNone = 0 BackPixmapParentRelative = 1 ) // enum Gravity const ( GravityBitForget = 0 GravityWinUnmap = 0 GravityNorthWest = 1 GravityNorth = 2 GravityNorthEast = 3 GravityWest = 4 GravityCenter = 5 GravityEast = 6 GravitySouthWest = 7 GravitySouth = 8 GravitySouthEast = 9 GravityStatic = 10 ) const CreateWindowOpcode = 1 const ChangeWindowAttributesOpcode = 2 // enum MapState const ( MapStateUnmapped = 0 MapStateUnviewable = 1 MapStateViewable = 2 ) const GetWindowAttributesOpcode = 3 type GetWindowAttributesCookie SeqNum const DestroyWindowOpcode = 4 const DestroySubwindowsOpcode = 5 // enum SetMode const ( SetModeInsert = 0 SetModeDelete = 1 ) const ChangeSaveSetOpcode = 6 const ReparentWindowOpcode = 7 const MapWindowOpcode = 8 const MapSubwindowsOpcode = 9 const UnmapWindowOpcode = 10 const UnmapSubwindowsOpcode = 11 // enum ConfigWindow const ( ConfigWindowX = 1 ConfigWindowY = 2 ConfigWindowWidth = 4 ConfigWindowHeight = 8 ConfigWindowBorderWidth = 16 ConfigWindowSibling = 32 ConfigWindowStackMode = 64 ) // enum StackMode const ( StackModeAbove = 0 StackModeBelow = 1 StackModeTopIf = 2 StackModeBottomIf = 3 StackModeOpposite = 4 ) const ConfigureWindowOpcode = 12 // enum Circulate const ( CirculateRaiseLowest = 0 CirculateLowerHighest = 1 ) const CirculateWindowOpcode = 13 const GetGeometryOpcode = 14 type GetGeometryCookie SeqNum const QueryTreeOpcode = 15 type QueryTreeCookie SeqNum const InternAtomOpcode = 16 type InternAtomCookie SeqNum const GetAtomNameOpcode = 17 type GetAtomNameCookie SeqNum // enum PropMode const ( PropModeReplace = 0 PropModePrepend = 1 PropModeAppend = 2 ) const ChangePropertyOpcode = 18 const DeletePropertyOpcode = 19 // enum GetPropertyType const ( GetPropertyTypeAny = 0 ) const GetPropertyOpcode = 20 type GetPropertyCookie SeqNum const ListPropertiesOpcode = 21 type ListPropertiesCookie SeqNum const SetSelectionOwnerOpcode = 22 const GetSelectionOwnerOpcode = 23 type GetSelectionOwnerCookie SeqNum const ConvertSelectionOpcode = 24 // enum SendEventDest const ( SendEventDestPointerWindow = 0 SendEventDestItemFocus = 1 ) const SendEventOpcode = 25 // enum GrabMode const ( GrabModeSync = 0 GrabModeAsync = 1 ) // enum GrabStatus const ( GrabStatusSuccess = 0 GrabStatusAlreadyGrabbed = 1 GrabStatusInvalidTime = 2 GrabStatusNotViewable = 3 GrabStatusFrozen = 4 ) // enum Cursor const ( CursorNone = 0 ) const GrabPointerOpcode = 26 type GrabPointerCookie SeqNum const UngrabPointerOpcode = 27 // enum ButtonIndex const ( ButtonIndexAny = 0 ButtonIndex1 = 1 ButtonIndex2 = 2 ButtonIndex3 = 3 ButtonIndex4 = 4 ButtonIndex5 = 5 ) const GrabButtonOpcode = 28 const UngrabButtonOpcode = 29 const ChangeActivePointerGrabOpcode = 30 const GrabKeyboardOpcode = 31 type GrabKeyboardCookie SeqNum const UngrabKeyboardOpcode = 32 // enum Grab const ( GrabAny = 0 ) const GrabKeyOpcode = 33 const UngrabKeyOpcode = 34 // enum Allow const ( AllowAsyncPointer = 0 AllowSyncPointer = 1 AllowReplayPointer = 2 AllowAsyncKeyboard = 3 AllowSyncKeyboard = 4 AllowReplayKeyboard = 5 AllowAsyncBoth = 6 AllowSyncBoth = 7 ) const AllowEventsOpcode = 35 const GrabServerOpcode = 36 const UngrabServerOpcode = 37 const QueryPointerOpcode = 38 type QueryPointerCookie SeqNum const GetMotionEventsOpcode = 39 type GetMotionEventsCookie SeqNum const TranslateCoordinatesOpcode = 40 type TranslateCoordinatesCookie SeqNum const WarpPointerOpcode = 41 // enum InputFocus const ( InputFocusNone = 0 InputFocusPointerRoot = 1 InputFocusParent = 2 InputFocusFollowKeyboard = 3 ) const SetInputFocusOpcode = 42 const GetInputFocusOpcode = 43 type GetInputFocusCookie SeqNum const QueryKeymapOpcode = 44 type QueryKeymapCookie SeqNum const OpenFontOpcode = 45 const CloseFontOpcode = 46 // enum FontDraw const ( FontDrawLeftToRight = 0 FontDrawRightToLeft = 1 ) const QueryFontOpcode = 47 type QueryFontCookie SeqNum const QueryTextExtentsOpcode = 48 type QueryTextExtentsCookie SeqNum const ListFontsOpcode = 49 type ListFontsCookie SeqNum const ListFontsWithInfoOpcode = 50 type ListFontsWithInfoCookie SeqNum const SetFontPathOpcode = 51 const GetFontPathOpcode = 52 type GetFontPathCookie SeqNum const CreatePixmapOpcode = 53 const FreePixmapOpcode = 54 // enum GC const ( GCFunction = 1 GCPlaneMask = 2 GCForeground = 4 GCBackground = 8 GCLineWidth = 16 GCLineStyle = 32 GCCapStyle = 64 GCJoinStyle = 128 GCFillStyle = 256 GCFillRule = 512 GCTile = 1024 GCStipple = 2048 GCTileStippleOriginX = 4096 GCTileStippleOriginY = 8192 GCFont = 16384 GCSubwindowMode = 32768 GCGraphicsExposures = 65536 GCClipOriginX = 131072 GCClipOriginY = 262144 GCClipMask = 524288 GCDashOffset = 1048576 GCDashList = 2097152 GCArcMode = 4194304 ) // enum GX const ( GXClear = 0 GXAnd = 1 GXAndReverse = 2 GXCopy = 3 GXAndInverted = 4 GXNoop = 5 GXXor = 6 GXOr = 7 GXNor = 8 GXEquiv = 9 GXInvert = 10 GXOrReverse = 11 GXCopyInverted = 12 GXOrInverted = 13 GXNand = 14 GXSet = 15 ) // enum LineStyle const ( LineStyleSolid = 0 LineStyleOnOffDash = 1 LineStyleDoubleDash = 2 ) // enum CapStyle const ( CapStyleNotLast = 0 CapStyleButt = 1 CapStyleRound = 2 CapStyleProjecting = 3 ) // enum JoinStyle const ( JoinStyleMiter = 0 JoinStyleRound = 1 JoinStyleBevel = 2 ) // enum FillStyle const ( FillStyleSolid = 0 FillStyleTiled = 1 FillStyleStippled = 2 FillStyleOpaqueStippled = 3 ) // enum FillRule const ( FillRuleEvenOdd = 0 FillRuleWinding = 1 ) // enum SubwindowMode const ( SubwindowModeClipByChildren = 0 SubwindowModeIncludeInferiors = 1 ) // enum ArcMode const ( ArcModeChord = 0 ArcModePieSlice = 1 ) const CreateGCOpcode = 55 const ChangeGCOpcode = 56 const CopyGCOpcode = 57 const SetDashesOpcode = 58 // enum ClipOrdering const ( ClipOrderingUnsorted = 0 ClipOrderingYSorted = 1 ClipOrderingYXSorted = 2 ClipOrderingYXBanded = 3 ) const SetClipRectanglesOpcode = 59 const FreeGCOpcode = 60 const ClearAreaOpcode = 61 const CopyAreaOpcode = 62 const CopyPlaneOpcode = 63 // enum CoordMode const ( CoordModeOrigin = 0 CoordModePrevious = 1 ) const PolyPointOpcode = 64 const PolyLineOpcode = 65 const PolySegmentOpcode = 66 const PolyRectangleOpcode = 67 const PolyArcOpcode = 68 // enum PolyShape const ( PolyShapeComplex = 0 PolyShapeNonconvex = 1 PolyShapeConvex = 2 ) const FillPolyOpcode = 69 const PolyFillRectangleOpcode = 70 const PolyFillArcOpcode = 71 // enum ImageFormat const ( ImageFormatXYBitmap = 0 ImageFormatXYPixmap = 1 ImageFormatZPixmap = 2 ) const PutImageOpcode = 72 const GetImageOpcode = 73 type GetImageCookie SeqNum const PolyText8Opcode = 74 const PolyText16Opcode = 75 const ImageText8Opcode = 76 const ImageText16Opcode = 77 // enum ColormapAlloc const ( ColormapAllocNone = 0 ColormapAllocAll = 1 ) const CreateColormapOpcode = 78 const FreeColormapOpcode = 79 const CopyColormapAndFreeOpcode = 80 const InstallColormapOpcode = 81 const UninstallColormapOpcode = 82 const ListInstalledColormapsOpcode = 83 type ListInstalledColormapsCookie SeqNum const AllocColorOpcode = 84 type AllocColorCookie SeqNum const AllocNamedColorOpcode = 85 type AllocNamedColorCookie SeqNum const AllocColorCellsOpcode = 86 type AllocColorCellsCookie SeqNum const AllocColorPlanesOpcode = 87 type AllocColorPlanesCookie SeqNum const FreeColorsOpcode = 88 // enum ColorFlag const ( ColorFlagRed = 1 ColorFlagGreen = 2 ColorFlagBlue = 4 ) const StoreColorsOpcode = 89 const StoreNamedColorOpcode = 90 const QueryColorsOpcode = 91 type QueryColorsCookie SeqNum const LookupColorOpcode = 92 type LookupColorCookie SeqNum // enum Pixmap const ( PixmapNone = 0 ) const CreateCursorOpcode = 93 // enum Font const ( FontNone = 0 ) const CreateGlyphCursorOpcode = 94 const FreeCursorOpcode = 95 const RecolorCursorOpcode = 96 // enum QueryShapeOf const ( QueryShapeOfLargestCursor = 0 QueryShapeOfFastestTile = 1 QueryShapeOfFastestStipple = 2 ) const QueryBestSizeOpcode = 97 type QueryBestSizeCookie SeqNum const QueryExtensionOpcode = 98 type QueryExtensionCookie SeqNum const ListExtensionsOpcode = 99 type ListExtensionsCookie SeqNum const ChangeKeyboardMappingOpcode = 100 const GetKeyboardMappingOpcode = 101 type GetKeyboardMappingCookie SeqNum // enum KB const ( KBKeyClickPercent = 1 KBBellPercent = 2 KBBellPitch = 4 KBBellDuration = 8 KBLed = 16 KBLedMode = 32 KBKey = 64 KBAutoRepeatMode = 128 ) // enum LedMode const ( LedModeOff = 0 LedModeOn = 1 ) // enum AutoRepeatMode const ( AutoRepeatModeOff = 0 AutoRepeatModeOn = 1 AutoRepeatModeDefault = 2 ) const ChangeKeyboardControlOpcode = 102 const GetKeyboardControlOpcode = 103 type GetKeyboardControlCookie SeqNum const BellOpcode = 104 const ChangePointerControlOpcode = 105 const GetPointerControlOpcode = 106 type GetPointerControlCookie SeqNum // enum Blanking const ( BlankingNotPreferred = 0 BlankingPreferred = 1 BlankingDefault = 2 ) // enum Exposures const ( ExposuresNotAllowed = 0 ExposuresAllowed = 1 ExposuresDefault = 2 ) const SetScreenSaverOpcode = 107 const GetScreenSaverOpcode = 108 type GetScreenSaverCookie SeqNum // enum HostMode const ( HostModeInsert = 0 HostModeDelete = 1 ) // enum Family const ( FamilyInternet = 0 FamilyDECnet = 1 FamilyChaos = 2 FamilyServerInterpreted = 5 FamilyInternet6 = 6 ) const ChangeHostsOpcode = 109 const ListHostsOpcode = 110 type ListHostsCookie SeqNum // enum AccessControl const ( AccessControlDisable = 0 AccessControlEnable = 1 ) const SetAccessControlOpcode = 111 // enum CloseDown const ( CloseDownDestroyAll = 0 CloseDownRetainPermanent = 1 CloseDownRetainTemporary = 2 ) const SetCloseDownModeOpcode = 112 // enum Kill const ( KillAllTemporary = 0 ) const KillClientOpcode = 113 const RotatePropertiesOpcode = 114 // enum ScreenSaver const ( ScreenSaverReset = 0 ScreenSaverActive = 1 ) const ForceScreenSaverOpcode = 115 // enum MappingStatus const ( MappingStatusSuccess = 0 MappingStatusBusy = 1 MappingStatusFailure = 2 ) const SetPointerMappingOpcode = 116 type SetPointerMappingCookie SeqNum const GetPointerMappingOpcode = 117 type GetPointerMappingCookie SeqNum // enum MapIndex const ( MapIndexShift = 0 MapIndexLock = 1 MapIndexControl = 2 MapIndex1 = 3 MapIndex2 = 4 MapIndex3 = 5 MapIndex4 = 6 MapIndex5 = 7 ) const SetModifierMappingOpcode = 118 type SetModifierMappingCookie SeqNum const GetModifierMappingOpcode = 119 type GetModifierMappingCookie SeqNum const NoOperationOpcode = 127 var errorCodeNameMap = map[uint8]string{ RequestErrorCode: "BadRequest", ValueErrorCode: "BadValue", WindowErrorCode: "BadWindow", PixmapErrorCode: "BadPixmap", AtomErrorCode: "BadAtom", CursorErrorCode: "BadCursor", FontErrorCode: "BadFont", MatchErrorCode: "BadMatch", DrawableErrorCode: "BadDrawable", AccessErrorCode: "BadAccess", AllocErrorCode: "BadAlloc", ColormapErrorCode: "BadColormap", GContextErrorCode: "BadGContext", IdChoiceErrorCode: "BadIdChoice", NameErrorCode: "BadName", LengthErrorCode: "BadLength", ImplementationErrorCode: "BadImplementation", } var requestOpcodeNameMap = map[uint]string{ CreateWindowOpcode: "CreateWindow", ChangeWindowAttributesOpcode: "ChangeWindowAttributes", GetWindowAttributesOpcode: "GetWindowAttributes", DestroyWindowOpcode: "DestroyWindow", DestroySubwindowsOpcode: "DestroySubwindows", ChangeSaveSetOpcode: "ChangeSaveSet", ReparentWindowOpcode: "ReparentWindow", MapWindowOpcode: "MapWindow", MapSubwindowsOpcode: "MapSubwindows", UnmapWindowOpcode: "UnmapWindow", UnmapSubwindowsOpcode: "UnmapSubwindows", ConfigureWindowOpcode: "ConfigureWindow", CirculateWindowOpcode: "CirculateWindow", GetGeometryOpcode: "GetGeometry", QueryTreeOpcode: "QueryTree", InternAtomOpcode: "InternAtom", GetAtomNameOpcode: "GetAtomName", ChangePropertyOpcode: "ChangeProperty", DeletePropertyOpcode: "DeleteProperty", GetPropertyOpcode: "GetProperty", ListPropertiesOpcode: "ListProperties", SetSelectionOwnerOpcode: "SetSelectionOwner", GetSelectionOwnerOpcode: "GetSelectionOwner", ConvertSelectionOpcode: "ConvertSelection", SendEventOpcode: "SendEvent", GrabPointerOpcode: "GrabPointer", UngrabPointerOpcode: "UngrabPointer", GrabButtonOpcode: "GrabButton", UngrabButtonOpcode: "UngrabButton", ChangeActivePointerGrabOpcode: "ChangeActivePointerGrab", GrabKeyboardOpcode: "GrabKeyboard", UngrabKeyboardOpcode: "UngrabKeyboard", GrabKeyOpcode: "GrabKey", UngrabKeyOpcode: "UngrabKey", AllowEventsOpcode: "AllowEvents", GrabServerOpcode: "GrabServer", UngrabServerOpcode: "UngrabServer", QueryPointerOpcode: "QueryPointer", GetMotionEventsOpcode: "GetMotionEvents", TranslateCoordinatesOpcode: "TranslateCoordinates", WarpPointerOpcode: "WarpPointer", SetInputFocusOpcode: "SetInputFocus", GetInputFocusOpcode: "GetInputFocus", QueryKeymapOpcode: "QueryKeymap", OpenFontOpcode: "OpenFont", CloseFontOpcode: "CloseFont", QueryFontOpcode: "QueryFont", QueryTextExtentsOpcode: "QueryTextExtents", ListFontsOpcode: "ListFonts", ListFontsWithInfoOpcode: "ListFontsWithInfo", SetFontPathOpcode: "SetFontPath", GetFontPathOpcode: "GetFontPath", CreatePixmapOpcode: "CreatePixmap", FreePixmapOpcode: "FreePixmap", CreateGCOpcode: "CreateGC", ChangeGCOpcode: "ChangeGC", CopyGCOpcode: "CopyGC", SetDashesOpcode: "SetDashes", SetClipRectanglesOpcode: "SetClipRectangles", FreeGCOpcode: "FreeGC", ClearAreaOpcode: "ClearArea", CopyAreaOpcode: "CopyArea", CopyPlaneOpcode: "CopyPlane", PolyPointOpcode: "PolyPoint", PolyLineOpcode: "PolyLine", PolySegmentOpcode: "PolySegment", PolyRectangleOpcode: "PolyRectangle", PolyArcOpcode: "PolyArc", FillPolyOpcode: "FillPoly", PolyFillRectangleOpcode: "PolyFillRectangle", PolyFillArcOpcode: "PolyFillArc", PutImageOpcode: "PutImage", GetImageOpcode: "GetImage", PolyText8Opcode: "PolyText8", PolyText16Opcode: "PolyText16", ImageText8Opcode: "ImageText8", ImageText16Opcode: "ImageText16", CreateColormapOpcode: "CreateColormap", FreeColormapOpcode: "FreeColormap", CopyColormapAndFreeOpcode: "CopyColormapAndFree", InstallColormapOpcode: "InstallColormap", UninstallColormapOpcode: "UninstallColormap", ListInstalledColormapsOpcode: "ListInstalledColormaps", AllocColorOpcode: "AllocColor", AllocNamedColorOpcode: "AllocNamedColor", AllocColorCellsOpcode: "AllocColorCells", AllocColorPlanesOpcode: "AllocColorPlanes", FreeColorsOpcode: "FreeColors", StoreColorsOpcode: "StoreColors", StoreNamedColorOpcode: "StoreNamedColor", QueryColorsOpcode: "QueryColors", LookupColorOpcode: "LookupColor", CreateCursorOpcode: "CreateCursor", CreateGlyphCursorOpcode: "CreateGlyphCursor", FreeCursorOpcode: "FreeCursor", RecolorCursorOpcode: "RecolorCursor", QueryBestSizeOpcode: "QueryBestSize", QueryExtensionOpcode: "QueryExtension", ListExtensionsOpcode: "ListExtensions", ChangeKeyboardMappingOpcode: "ChangeKeyboardMapping", GetKeyboardMappingOpcode: "GetKeyboardMapping", ChangeKeyboardControlOpcode: "ChangeKeyboardControl", GetKeyboardControlOpcode: "GetKeyboardControl", BellOpcode: "Bell", ChangePointerControlOpcode: "ChangePointerControl", GetPointerControlOpcode: "GetPointerControl", SetScreenSaverOpcode: "SetScreenSaver", GetScreenSaverOpcode: "GetScreenSaver", ChangeHostsOpcode: "ChangeHosts", ListHostsOpcode: "ListHosts", SetAccessControlOpcode: "SetAccessControl", SetCloseDownModeOpcode: "SetCloseDownMode", KillClientOpcode: "KillClient", RotatePropertiesOpcode: "RotateProperties", ForceScreenSaverOpcode: "ForceScreenSaver", SetPointerMappingOpcode: "SetPointerMapping", GetPointerMappingOpcode: "GetPointerMapping", SetModifierMappingOpcode: "SetModifierMapping", GetModifierMappingOpcode: "GetModifierMapping", NoOperationOpcode: "NoOperation", } go-x11-client-1.0.2/xproto_auto_req.go000066400000000000000000001602661460713373000176020ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x func CreateWindow(conn *Conn, depth uint8, wid, parent Window, x, y int16, width, height, borderWidth uint16, class uint16, visual VisualID, valueMask uint32, valueList []uint32) { headerData, body := encodeCreateWindow(depth, wid, parent, x, y, width, height, borderWidth, class, visual, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreateWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CreateWindowChecked(conn *Conn, depth uint8, wid, parent Window, x, y int16, width, height, borderWidth uint16, class uint16, visual VisualID, valueMask uint32, valueList []uint32) VoidCookie { headerData, body := encodeCreateWindow(depth, wid, parent, x, y, width, height, borderWidth, class, visual, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreateWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ChangeWindowAttributes(conn *Conn, window Window, valueMask uint32, valueList []uint32) { headerData, body := encodeChangeWindowAttributes(window, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeWindowAttributesOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangeWindowAttributesChecked(conn *Conn, window Window, valueMask uint32, valueList []uint32) VoidCookie { headerData, body := encodeChangeWindowAttributes(window, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeWindowAttributesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetWindowAttributes(conn *Conn, window Window) GetWindowAttributesCookie { headerData, body := encodeGetWindowAttributes(window) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetWindowAttributesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetWindowAttributesCookie(seq) } func (cookie GetWindowAttributesCookie) Reply(conn *Conn) (*GetWindowAttributesReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetWindowAttributesReply err = readGetWindowAttributesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func DestroyWindow(conn *Conn, window Window) { headerData, body := encodeDestroyWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DestroyWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func DestroyWindowChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeDestroyWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DestroyWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func DestroySubwindows(conn *Conn, window Window) { headerData, body := encodeDestroySubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DestroySubwindowsOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func DestroySubwindowsChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeDestroySubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DestroySubwindowsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ChangeSaveSet(conn *Conn, mode uint8, window Window) { headerData, body := encodeChangeSaveSet(mode, window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeSaveSetOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangeSaveSetChecked(conn *Conn, mode uint8, window Window) VoidCookie { headerData, body := encodeChangeSaveSet(mode, window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeSaveSetOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ReparentWindow(conn *Conn, window, parent Window, x, y int16) { headerData, body := encodeReparentWindow(window, parent, x, y) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ReparentWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ReparentWindowChecked(conn *Conn, window, parent Window, x, y int16) VoidCookie { headerData, body := encodeReparentWindow(window, parent, x, y) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ReparentWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func MapWindow(conn *Conn, window Window) { headerData, body := encodeMapWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: MapWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func MapWindowChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeMapWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: MapWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func MapSubwindows(conn *Conn, window Window) { headerData, body := encodeMapSubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: MapSubwindowsOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func MapSubwindowsChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeMapSubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: MapSubwindowsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func UnmapWindow(conn *Conn, window Window) { headerData, body := encodeUnmapWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UnmapWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UnmapWindowChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeUnmapWindow(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UnmapWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func UnmapSubwindows(conn *Conn, window Window) { headerData, body := encodeUnmapSubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UnmapSubwindowsOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UnmapSubwindowsChecked(conn *Conn, window Window) VoidCookie { headerData, body := encodeUnmapSubwindows(window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UnmapSubwindowsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ConfigureWindow(conn *Conn, window Window, valueMask uint16, valueList []uint32) { headerData, body := encodeConfigureWindow(window, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ConfigureWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ConfigureWindowChecked(conn *Conn, window Window, valueMask uint16, valueList []uint32) VoidCookie { headerData, body := encodeConfigureWindow(window, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ConfigureWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CirculateWindow(conn *Conn, direction uint8, window Window) { headerData, body := encodeCirculateWindow(direction, window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CirculateWindowOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CirculateWindowChecked(conn *Conn, direction uint8, window Window) VoidCookie { headerData, body := encodeCirculateWindow(direction, window) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CirculateWindowOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetGeometry(conn *Conn, drawable Drawable) GetGeometryCookie { headerData, body := encodeGetGeometry(drawable) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetGeometryOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetGeometryCookie(seq) } func (cookie GetGeometryCookie) Reply(conn *Conn) (*GetGeometryReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetGeometryReply err = readGetGeometryReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryTree(conn *Conn, window Window) QueryTreeCookie { headerData, body := encodeQueryTree(window) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: QueryTreeOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return QueryTreeCookie(seq) } func (cookie QueryTreeCookie) Reply(conn *Conn) (*QueryTreeReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply QueryTreeReply err = readQueryTreeReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func InternAtom(conn *Conn, onlyIfExists bool, name string) InternAtomCookie { headerData, body := encodeInternAtom(onlyIfExists, name) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: InternAtomOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return InternAtomCookie(seq) } func (cookie InternAtomCookie) Reply(conn *Conn) (*InternAtomReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply InternAtomReply err = readInternAtomReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetAtomName(conn *Conn, atom Atom) GetAtomNameCookie { headerData, body := encodeGetAtomName(atom) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetAtomNameOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetAtomNameCookie(seq) } func (cookie GetAtomNameCookie) Reply(conn *Conn) (*GetAtomNameReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetAtomNameReply err = readGetAtomNameReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ChangeProperty(conn *Conn, mode uint8, window Window, property, type0 Atom, format uint8, data []byte) { headerData, body := encodeChangeProperty(mode, window, property, type0, format, data) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangePropertyOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangePropertyChecked(conn *Conn, mode uint8, window Window, property, type0 Atom, format uint8, data []byte) VoidCookie { headerData, body := encodeChangeProperty(mode, window, property, type0, format, data) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangePropertyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func DeleteProperty(conn *Conn, window Window, property Atom) { headerData, body := encodeDeleteProperty(window, property) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DeletePropertyOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func DeletePropertyChecked(conn *Conn, window Window, property Atom) VoidCookie { headerData, body := encodeDeleteProperty(window, property) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: DeletePropertyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetProperty(conn *Conn, delete bool, window Window, property, type0 Atom, longOffset, longLength uint32) GetPropertyCookie { headerData, body := encodeGetProperty(delete, window, property, type0, longOffset, longLength) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetPropertyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetPropertyCookie(seq) } func (cookie GetPropertyCookie) Reply(conn *Conn) (*GetPropertyReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetPropertyReply err = readGetPropertyReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListProperties(conn *Conn, window Window) ListPropertiesCookie { headerData, body := encodeListProperties(window) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: ListPropertiesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return ListPropertiesCookie(seq) } func (cookie ListPropertiesCookie) Reply(conn *Conn) (*ListPropertiesReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply ListPropertiesReply err = readListPropertiesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetSelectionOwner(conn *Conn, owner Window, selection Atom, time Timestamp) { headerData, body := encodeSetSelectionOwner(owner, selection, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetSelectionOwnerOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetSelectionOwnerChecked(conn *Conn, owner Window, selection Atom, time Timestamp) VoidCookie { headerData, body := encodeSetSelectionOwner(owner, selection, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetSelectionOwnerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetSelectionOwner(conn *Conn, selection Atom) GetSelectionOwnerCookie { headerData, body := encodeGetSelectionOwner(selection) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetSelectionOwnerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetSelectionOwnerCookie(seq) } func (cookie GetSelectionOwnerCookie) Reply(conn *Conn) (*GetSelectionOwnerReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetSelectionOwnerReply err = readGetSelectionOwnerReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ConvertSelection(conn *Conn, requestor Window, selection, target, property Atom, time Timestamp) { headerData, body := encodeConvertSelection(requestor, selection, target, property, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ConvertSelectionOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ConvertSelectionChecked(conn *Conn, requestor Window, selection, target, property Atom, time Timestamp) VoidCookie { headerData, body := encodeConvertSelection(requestor, selection, target, property, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ConvertSelectionOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func SendEvent(conn *Conn, propagate bool, destination Window, eventMask uint32, event []byte) { headerData, body := encodeSendEvent(propagate, destination, eventMask, event) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SendEventOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SendEventChecked(conn *Conn, propagate bool, destination Window, eventMask uint32, event []byte) VoidCookie { headerData, body := encodeSendEvent(propagate, destination, eventMask, event) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SendEventOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GrabPointer(conn *Conn, ownerEvents bool, grabWindow Window, eventMask uint16, pointerMode, keyboardMode uint8, confineTo Window, cursor Cursor, time Timestamp) GrabPointerCookie { headerData, body := encodeGrabPointer(ownerEvents, grabWindow, eventMask, pointerMode, keyboardMode, confineTo, cursor, time) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GrabPointerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GrabPointerCookie(seq) } func (cookie GrabPointerCookie) Reply(conn *Conn) (*GrabPointerReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GrabPointerReply err = readGrabPointerReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func UngrabPointer(conn *Conn, time Timestamp) { headerData, body := encodeUngrabPointer(time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabPointerOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UngrabPointerChecked(conn *Conn, time Timestamp) VoidCookie { headerData, body := encodeUngrabPointer(time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabPointerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GrabButton(conn *Conn, ownerEvents bool, grabWindow Window, eventMask uint16, pointerMode, keyboardMode uint8, confineTo Window, cursor Cursor, button uint8, modifiers uint16) { headerData, body := encodeGrabButton(ownerEvents, grabWindow, eventMask, pointerMode, keyboardMode, confineTo, cursor, button, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabButtonOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func GrabButtonChecked(conn *Conn, ownerEvents bool, grabWindow Window, eventMask uint16, pointerMode, keyboardMode uint8, confineTo Window, cursor Cursor, button uint8, modifiers uint16) VoidCookie { headerData, body := encodeGrabButton(ownerEvents, grabWindow, eventMask, pointerMode, keyboardMode, confineTo, cursor, button, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabButtonOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func UngrabButton(conn *Conn, button uint8, grabWindow Window, modifiers uint16) { headerData, body := encodeUngrabButton(button, grabWindow, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabButtonOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UngrabButtonChecked(conn *Conn, button uint8, grabWindow Window, modifiers uint16) VoidCookie { headerData, body := encodeUngrabButton(button, grabWindow, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabButtonOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ChangeActivePointerGrab(conn *Conn, cursor Cursor, time Timestamp, eventMask uint16) { headerData, body := encodeChangeActivePointerGrab(cursor, time, eventMask) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeActivePointerGrabOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangeActivePointerGrabChecked(conn *Conn, cursor Cursor, time Timestamp, eventMask uint16) VoidCookie { headerData, body := encodeChangeActivePointerGrab(cursor, time, eventMask) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeActivePointerGrabOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GrabKeyboard(conn *Conn, ownerEvents bool, grabWindow Window, time Timestamp, pointerMode, keyboardMode uint8) GrabKeyboardCookie { headerData, body := encodeGrabKeyboard(ownerEvents, grabWindow, time, pointerMode, keyboardMode) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GrabKeyboardOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GrabKeyboardCookie(seq) } func (cookie GrabKeyboardCookie) Reply(conn *Conn) (*GrabKeyboardReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GrabKeyboardReply err = readGrabKeyboardReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func UngrabKeyboard(conn *Conn, time Timestamp) { headerData, body := encodeUngrabKeyboard(time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabKeyboardOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UngrabKeyboardChecked(conn *Conn, time Timestamp) VoidCookie { headerData, body := encodeUngrabKeyboard(time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabKeyboardOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GrabKey(conn *Conn, ownerEvents bool, grabWindow Window, modifiers uint16, key Keycode, pointerMode, keyboardMode uint8) { headerData, body := encodeGrabKey(ownerEvents, grabWindow, modifiers, key, pointerMode, keyboardMode) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabKeyOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func GrabKeyChecked(conn *Conn, ownerEvents bool, grabWindow Window, modifiers uint16, key Keycode, pointerMode, keyboardMode uint8) VoidCookie { headerData, body := encodeGrabKey(ownerEvents, grabWindow, modifiers, key, pointerMode, keyboardMode) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabKeyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func UngrabKey(conn *Conn, key Keycode, grabWindow Window, modifiers uint16) { headerData, body := encodeUngrabKey(key, grabWindow, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabKeyOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UngrabKeyChecked(conn *Conn, key Keycode, grabWindow Window, modifiers uint16) VoidCookie { headerData, body := encodeUngrabKey(key, grabWindow, modifiers) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabKeyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func AllowEvents(conn *Conn, mode uint8, time Timestamp) { headerData, body := encodeAllowEvents(mode, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: AllowEventsOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func AllowEventsChecked(conn *Conn, mode uint8, time Timestamp) VoidCookie { headerData, body := encodeAllowEvents(mode, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: AllowEventsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GrabServer(conn *Conn) { headerData, body := encodeGrabServer() req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabServerOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func GrabServerChecked(conn *Conn) VoidCookie { headerData, body := encodeGrabServer() req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: GrabServerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func UngrabServer(conn *Conn) { headerData, body := encodeUngrabServer() req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabServerOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func UngrabServerChecked(conn *Conn) VoidCookie { headerData, body := encodeUngrabServer() req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: UngrabServerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func QueryPointer(conn *Conn, window Window) QueryPointerCookie { headerData, body := encodeQueryPointer(window) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: QueryPointerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return QueryPointerCookie(seq) } func (cookie QueryPointerCookie) Reply(conn *Conn) (*QueryPointerReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply QueryPointerReply err = readQueryPointerReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func GetMotionEvents(conn *Conn, window Window, start, stop Timestamp) GetMotionEventsCookie { headerData, body := encodeGetMotionEvents(window, start, stop) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetMotionEventsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetMotionEventsCookie(seq) } func (cookie GetMotionEventsCookie) Reply(conn *Conn) (*GetMotionEventsReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetMotionEventsReply err = readGetMotionEventsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func TranslateCoordinates(conn *Conn, srcWindow, dstWindow Window, srcX, srcY int16) TranslateCoordinatesCookie { headerData, body := encodeTranslateCoordinates(srcWindow, dstWindow, srcX, srcY) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: TranslateCoordinatesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return TranslateCoordinatesCookie(seq) } func (cookie TranslateCoordinatesCookie) Reply(conn *Conn) (*TranslateCoordinatesReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply TranslateCoordinatesReply err = readTranslateCoordinatesReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func WarpPointer(conn *Conn, srcWindow, dstWindow Window, srcX, srcY int16, srcWidth, srcHeight uint16, dstX, dstY int16) { headerData, body := encodeWarpPointer(srcWindow, dstWindow, srcX, srcY, srcWidth, srcHeight, dstX, dstY) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: WarpPointerOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func WarpPointerChecked(conn *Conn, srcWindow, dstWindow Window, srcX, srcY int16, srcWidth, srcHeight uint16, dstX, dstY int16) VoidCookie { headerData, body := encodeWarpPointer(srcWindow, dstWindow, srcX, srcY, srcWidth, srcHeight, dstX, dstY) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: WarpPointerOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func SetInputFocus(conn *Conn, revertTo uint8, focus Window, time Timestamp) { headerData, body := encodeSetInputFocus(revertTo, focus, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetInputFocusOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetInputFocusChecked(conn *Conn, revertTo uint8, focus Window, time Timestamp) VoidCookie { headerData, body := encodeSetInputFocus(revertTo, focus, time) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetInputFocusOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetInputFocus(conn *Conn) GetInputFocusCookie { headerData, body := encodeGetInputFocus() req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetInputFocusOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetInputFocusCookie(seq) } func (cookie GetInputFocusCookie) Reply(conn *Conn) (*GetInputFocusReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetInputFocusReply err = readGetInputFocusReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryKeymap(conn *Conn) QueryKeymapCookie { headerData, body := encodeQueryKeymap() req := &ProtocolRequest{ Header: RequestHeader{ Opcode: QueryKeymapOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return QueryKeymapCookie(seq) } func (cookie QueryKeymapCookie) Reply(conn *Conn) (*QueryKeymapReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply QueryKeymapReply err = readQueryKeymapReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func OpenFont(conn *Conn, fid Font, name string) { headerData, body := encodeOpenFont(fid, name) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: OpenFontOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func OpenFontChecked(conn *Conn, fid Font, name string) VoidCookie { headerData, body := encodeOpenFont(fid, name) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: OpenFontOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CloseFont(conn *Conn, font Font) { headerData, body := encodeCloseFont(font) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CloseFontOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CloseFontChecked(conn *Conn, font Font) VoidCookie { headerData, body := encodeCloseFont(font) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CloseFontOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func QueryFont(conn *Conn, font Fontable) QueryFontCookie { headerData, body := encodeQueryFont(font) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: QueryFontOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return QueryFontCookie(seq) } func (cookie QueryFontCookie) Reply(conn *Conn) (*QueryFontReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply QueryFontReply err = readQueryFontReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListFonts(conn *Conn, maxNames uint16, pattern string) ListFontsCookie { headerData, body := encodeListFonts(maxNames, pattern) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: ListFontsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return ListFontsCookie(seq) } func (cookie ListFontsCookie) Reply(conn *Conn) (*ListFontsReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply ListFontsReply err = readListFontsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListFontsWithInfo(conn *Conn, maxNames uint16, pattern string) ListFontsWithInfoCookie { headerData, body := encodeListFontsWithInfo(maxNames, pattern) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: ListFontsWithInfoOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return ListFontsWithInfoCookie(seq) } func (cookie ListFontsWithInfoCookie) Reply(conn *Conn) (*ListFontsWithInfoReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply ListFontsWithInfoReply err = readListFontsWithInfoReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetFontPath(conn *Conn, paths []string) { headerData, body := encodeSetFontPath(paths) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetFontPathOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetFontPathChecked(conn *Conn, paths []string) VoidCookie { headerData, body := encodeSetFontPath(paths) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetFontPathOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetFontPath(conn *Conn) GetFontPathCookie { headerData, body := encodeGetFontPath() req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetFontPathOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetFontPathCookie(seq) } func (cookie GetFontPathCookie) Reply(conn *Conn) (*GetFontPathReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetFontPathReply err = readGetFontPathReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func CreatePixmap(conn *Conn, depth uint8, pid Pixmap, drawable Drawable, width, height uint16) { headerData, body := encodeCreatePixmap(depth, pid, drawable, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreatePixmapOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CreatePixmapChecked(conn *Conn, depth uint8, pid Pixmap, drawable Drawable, width, height uint16) VoidCookie { headerData, body := encodeCreatePixmap(depth, pid, drawable, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreatePixmapOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func FreePixmap(conn *Conn, pixmap Pixmap) { headerData, body := encodeFreePixmap(pixmap) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreePixmapOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func FreePixmapChecked(conn *Conn, pixmap Pixmap) VoidCookie { headerData, body := encodeFreePixmap(pixmap) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreePixmapOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CreateGC(conn *Conn, cid GContext, drawable Drawable, valueMask uint32, valueList []uint32) { headerData, body := encodeCreateGC(cid, drawable, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreateGCOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CreateGCChecked(conn *Conn, cid GContext, drawable Drawable, valueMask uint32, valueList []uint32) VoidCookie { headerData, body := encodeCreateGC(cid, drawable, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CreateGCOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ChangeGC(conn *Conn, gc GContext, valueMask uint32, valueList []uint32) { headerData, body := encodeChangeGC(gc, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeGCOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangeGCChecked(conn *Conn, gc GContext, valueMask uint32, valueList []uint32) VoidCookie { headerData, body := encodeChangeGC(gc, valueMask, valueList) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeGCOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CopyGC(conn *Conn, srcGC, dstGC GContext, valueMask uint32) { headerData, body := encodeCopyGC(srcGC, dstGC, valueMask) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyGCOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CopyGCChecked(conn *Conn, srcGC, dstGC GContext, valueMask uint32) VoidCookie { headerData, body := encodeCopyGC(srcGC, dstGC, valueMask) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyGCOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func SetDashes(conn *Conn, gc GContext, dashOffset uint16, dashes []uint8) { headerData, body := encodeSetDashes(gc, dashOffset, dashes) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetDashesOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetDashesChecked(conn *Conn, gc GContext, dashOffset uint16, dashes []uint8) VoidCookie { headerData, body := encodeSetDashes(gc, dashOffset, dashes) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetDashesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func SetClipRectangles(conn *Conn, ordering uint8, gc GContext, clipXOrigin, clipYOrigin int16, rectangles []Rectangle) { headerData, body := encodeSetClipRectangles(ordering, gc, clipXOrigin, clipYOrigin, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetClipRectanglesOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetClipRectanglesChecked(conn *Conn, ordering uint8, gc GContext, clipXOrigin, clipYOrigin int16, rectangles []Rectangle) VoidCookie { headerData, body := encodeSetClipRectangles(ordering, gc, clipXOrigin, clipYOrigin, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetClipRectanglesOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func FreeGC(conn *Conn, gc GContext) { headerData, body := encodeFreeGC(gc) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreeGCOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func FreeGCChecked(conn *Conn, gc GContext) VoidCookie { headerData, body := encodeFreeGC(gc) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreeGCOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ClearArea(conn *Conn, exposures bool, window Window, x, y int16, width, height uint16) { headerData, body := encodeClearArea(exposures, window, x, y, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ClearAreaOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ClearAreaChecked(conn *Conn, exposures bool, window Window, x, y int16, width, height uint16) VoidCookie { headerData, body := encodeClearArea(exposures, window, x, y, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ClearAreaOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CopyArea(conn *Conn, srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16) { headerData, body := encodeCopyArea(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyAreaOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CopyAreaChecked(conn *Conn, srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16) VoidCookie { headerData, body := encodeCopyArea(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyAreaOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func CopyPlane(conn *Conn, srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16, bitPlane uint32) { headerData, body := encodeCopyPlane(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height, bitPlane) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyPlaneOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func CopyPlaneChecked(conn *Conn, srcDrawable, dstDrawable Drawable, gc GContext, srcX, srcY, dstX, dstY int16, width, height uint16, bitPlane uint32) VoidCookie { headerData, body := encodeCopyPlane(srcDrawable, dstDrawable, gc, srcX, srcY, dstX, dstY, width, height, bitPlane) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: CopyPlaneOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyPoint(conn *Conn, coordinateMode uint8, drawable Drawable, gc GContext, points []Point) { headerData, body := encodePolyPoint(coordinateMode, drawable, gc, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyPointOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyPointChecked(conn *Conn, coordinateMode uint8, drawable Drawable, gc GContext, points []Point) VoidCookie { headerData, body := encodePolyPoint(coordinateMode, drawable, gc, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyPointOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyLine(conn *Conn, coordinateMode uint8, drawable Drawable, gc GContext, points []Point) { headerData, body := encodePolyLine(coordinateMode, drawable, gc, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyLineOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyLineChecked(conn *Conn, coordinateMode uint8, drawable Drawable, gc GContext, points []Point) VoidCookie { headerData, body := encodePolyLine(coordinateMode, drawable, gc, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyLineOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolySegment(conn *Conn, drawable Drawable, gc GContext, segments []Segment) { headerData, body := encodePolySegment(drawable, gc, segments) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolySegmentOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolySegmentChecked(conn *Conn, drawable Drawable, gc GContext, segments []Segment) VoidCookie { headerData, body := encodePolySegment(drawable, gc, segments) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolySegmentOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyRectangle(conn *Conn, drawable Drawable, gc GContext, rectangles []Rectangle) { headerData, body := encodePolyRectangle(drawable, gc, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyRectangleOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyRectangleChecked(conn *Conn, drawable Drawable, gc GContext, rectangles []Rectangle) VoidCookie { headerData, body := encodePolyRectangle(drawable, gc, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyRectangleOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyArc(conn *Conn, drawable Drawable, gc GContext, arcs []Arc) { headerData, body := encodePolyArc(drawable, gc, arcs) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyArcOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyArcChecked(conn *Conn, drawable Drawable, gc GContext, arcs []Arc) VoidCookie { headerData, body := encodePolyArc(drawable, gc, arcs) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyArcOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func FillPoly(conn *Conn, drawable Drawable, gc GContext, shape uint8, coordinateMode uint8, points []Point) { headerData, body := encodeFillPoly(drawable, gc, shape, coordinateMode, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FillPolyOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func FillPolyChecked(conn *Conn, drawable Drawable, gc GContext, shape uint8, coordinateMode uint8, points []Point) VoidCookie { headerData, body := encodeFillPoly(drawable, gc, shape, coordinateMode, points) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FillPolyOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyFillRectangle(conn *Conn, drawable Drawable, gc GContext, rectangles []Rectangle) { headerData, body := encodePolyFillRectangle(drawable, gc, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyFillRectangleOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyFillRectangleChecked(conn *Conn, drawable Drawable, gc GContext, rectangles []Rectangle) VoidCookie { headerData, body := encodePolyFillRectangle(drawable, gc, rectangles) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyFillRectangleOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PolyFillArc(conn *Conn, drawable Drawable, gc GContext, arcs []Arc) { headerData, body := encodePolyFillArc(drawable, gc, arcs) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyFillArcOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PolyFillArcChecked(conn *Conn, drawable Drawable, gc GContext, arcs []Arc) VoidCookie { headerData, body := encodePolyFillArc(drawable, gc, arcs) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PolyFillArcOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func PutImage(conn *Conn, format uint8, drawable Drawable, gc GContext, width, height uint16, dstX, dstY int16, leftPad, depth uint8, data []byte) { headerData, body := encodePutImage(format, drawable, gc, width, height, dstX, dstY, leftPad, depth, data) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PutImageOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func PutImageChecked(conn *Conn, format uint8, drawable Drawable, gc GContext, width, height uint16, dstX, dstY int16, leftPad, depth uint8, data []byte) VoidCookie { headerData, body := encodePutImage(format, drawable, gc, width, height, dstX, dstY, leftPad, depth, data) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: PutImageOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetImage(conn *Conn, format uint8, drawable Drawable, x, y int16, width, height uint16, planeMask uint32) GetImageCookie { headerData, body := encodeGetImage(format, drawable, x, y, width, height, planeMask) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetImageOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetImageCookie(seq) } func (cookie GetImageCookie) Reply(conn *Conn) (*GetImageReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetImageReply err = readGetImageReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func QueryExtension(conn *Conn, name string) QueryExtensionCookie { headerData, body := encodeQueryExtension(name) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: QueryExtensionOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return QueryExtensionCookie(seq) } func (cookie QueryExtensionCookie) Reply(conn *Conn) (*QueryExtensionReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply QueryExtensionReply err = readQueryExtensionReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ListExtensions(conn *Conn) ListExtensionsCookie { headerData, body := encodeListExtensions() req := &ProtocolRequest{ Header: RequestHeader{ Opcode: ListExtensionsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return ListExtensionsCookie(seq) } func (cookie ListExtensionsCookie) Reply(conn *Conn) (*ListExtensionsReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply ListExtensionsReply err = readListExtensionsReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func KillClient(conn *Conn, resource uint32) { headerData, body := encodeKillClient(resource) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: KillClientOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func KillClientChecked(conn *Conn, resource uint32) VoidCookie { headerData, body := encodeKillClient(resource) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: KillClientOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetKeyboardMapping(conn *Conn, firstKeycode Keycode, count uint8) GetKeyboardMappingCookie { headerData, body := encodeGetKeyboardMapping(firstKeycode, count) req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetKeyboardMappingOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetKeyboardMappingCookie(seq) } func (cookie GetKeyboardMappingCookie) Reply(conn *Conn) (*GetKeyboardMappingReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetKeyboardMappingReply err = readGetKeyboardMappingReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func SetScreenSaver(conn *Conn, timeout, interval int16, preferBlanking, allowExposures uint8) { headerData, body := encodeSetScreenSaver(timeout, interval, preferBlanking, allowExposures) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetScreenSaverOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func SetScreenSaverChecked(conn *Conn, timeout, interval int16, preferBlanking, allowExposures uint8) VoidCookie { headerData, body := encodeSetScreenSaver(timeout, interval, preferBlanking, allowExposures) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: SetScreenSaverOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func GetScreenSaver(conn *Conn) GetScreenSaverCookie { headerData, body := encodeGetScreenSaver() req := &ProtocolRequest{ Header: RequestHeader{ Opcode: GetScreenSaverOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return GetScreenSaverCookie(seq) } func (cookie GetScreenSaverCookie) Reply(conn *Conn) (*GetScreenSaverReply, error) { replyBuf, err := conn.WaitForReply(SeqNum(cookie)) if err != nil { return nil, err } r := NewReaderFromData(replyBuf) var reply GetScreenSaverReply err = readGetScreenSaverReply(r, &reply) if err != nil { return nil, err } return &reply, nil } func ForceScreenSaver(conn *Conn, mode uint8) { headerData, body := encodeForceScreenSaver(mode) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ForceScreenSaverOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ForceScreenSaverChecked(conn *Conn, mode uint8) VoidCookie { headerData, body := encodeForceScreenSaver(mode) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ForceScreenSaverOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func NoOperation(conn *Conn, n int) { headerData, body := encodeNoOperation(n) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: NoOperationOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func NoOperationChecked(conn *Conn, n int) VoidCookie { headerData, body := encodeNoOperation(n) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: NoOperationOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func FreeCursor(conn *Conn, cursor Cursor) { headerData, body := encodeFreeCursor(cursor) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreeCursorOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func FreeCursorChecked(conn *Conn, cursor Cursor) VoidCookie { headerData, body := encodeFreeCursor(cursor) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: FreeCursorOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } func ChangeHosts(conn *Conn, mode, family uint8, address string) { headerData, body := encodeChangeHosts(mode, family, address) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeHostsOpcode, Data: headerData, }, Body: body, } conn.SendRequest(0, req) } func ChangeHostsChecked(conn *Conn, mode, family uint8, address string) VoidCookie { headerData, body := encodeChangeHosts(mode, family, address) req := &ProtocolRequest{ NoReply: true, Header: RequestHeader{ Opcode: ChangeHostsOpcode, Data: headerData, }, Body: body, } seq := conn.SendRequest(RequestChecked, req) return VoidCookie(seq) } go-x11-client-1.0.2/xproto_event.go000066400000000000000000000404601460713373000170750ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x type KeyEvent struct { Detail Keycode Sequence uint16 Time Timestamp Root Window Event Window Child Window RootX int16 RootY int16 EventX int16 EventY int16 State uint16 SameScreen bool } func readKeyEvent(r *Reader, v *KeyEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } var detail uint8 detail, v.Sequence = r.ReadEventHeader() v.Detail = Keycode(detail) v.Time = Timestamp(r.Read4b()) v.Root = Window(r.Read4b()) v.Event = Window(r.Read4b()) v.Child = Window(r.Read4b()) // 5 v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) v.EventX = int16(r.Read2b()) v.EventY = int16(r.Read2b()) v.State = r.Read2b() v.SameScreen = r.ReadBool() // 8 return nil } type KeyPressEvent struct { KeyEvent } func readKeyPressEvent(r *Reader, v *KeyPressEvent) error { return readKeyEvent(r, &v.KeyEvent) } type KeyReleaseEvent struct { KeyEvent } func readKeyReleaseEvent(r *Reader, v *KeyReleaseEvent) error { return readKeyEvent(r, &v.KeyEvent) } type ButtonEvent struct { Detail Button Sequence uint16 Time Timestamp Root Window Event Window Child Window RootX int16 RootY int16 EventX int16 EventY int16 State uint16 SameScreen bool } func readButtonEvent(r *Reader, v *ButtonEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } var detail uint8 detail, v.Sequence = r.ReadEventHeader() v.Detail = Button(detail) v.Time = Timestamp(r.Read4b()) v.Root = Window(r.Read4b()) v.Event = Window(r.Read4b()) v.Child = Window(r.Read4b()) // 5 v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) v.EventX = int16(r.Read2b()) v.EventY = int16(r.Read2b()) // 7 v.State = r.Read2b() v.SameScreen = r.ReadBool() // 8 return nil } type ButtonPressEvent struct { ButtonEvent } func readButtonPressEvent(r *Reader, v *ButtonPressEvent) error { return readButtonEvent(r, &v.ButtonEvent) } type ButtonReleaseEvent struct { ButtonEvent } func readButtonReleaseEvent(r *Reader, v *ButtonReleaseEvent) error { return readButtonEvent(r, &v.ButtonEvent) } type MotionNotifyEvent struct { Detail uint8 Sequence uint16 Time Timestamp Root Window Event Window Child Window RootX int16 RootY int16 EventX int16 EventY int16 State uint16 SameScreen bool } func readMotionNotifyEvent(r *Reader, v *MotionNotifyEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } v.Detail, v.Sequence = r.ReadEventHeader() v.Time = Timestamp(r.Read4b()) v.Root = Window(r.Read4b()) v.Event = Window(r.Read4b()) v.Child = Window(r.Read4b()) // 5 v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) v.EventX = int16(r.Read2b()) v.EventY = int16(r.Read2b()) v.State = r.Read2b() v.SameScreen = r.ReadBool() // 8 return nil } type PointerWindowEvent struct { Detail uint8 Sequence uint16 Time Timestamp Root Window Event Window Child Window RootX int16 RootY int16 EventX int16 EventY int16 State uint16 Mode uint8 SameScreenFocus uint8 } func readPointerWindowEvent(r *Reader, v *PointerWindowEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } v.Detail, v.Sequence = r.ReadEventHeader() v.Time = Timestamp(r.Read4b()) v.Root = Window(r.Read4b()) v.Event = Window(r.Read4b()) v.Child = Window(r.Read4b()) // 5 v.RootX = int16(r.Read2b()) v.RootY = int16(r.Read2b()) v.EventX = int16(r.Read2b()) v.EventY = int16(r.Read2b()) v.State = r.Read2b() v.Mode = r.Read1b() v.SameScreenFocus = r.Read1b() // 8 return nil } type EnterNotifyEvent struct { PointerWindowEvent } func readEnterNotifyEvent(r *Reader, v *EnterNotifyEvent) error { return readPointerWindowEvent(r, &v.PointerWindowEvent) } type LeaveNotifyEvent struct { PointerWindowEvent } func readLeaveNotifyEvent(r *Reader, v *LeaveNotifyEvent) error { return readPointerWindowEvent(r, &v.PointerWindowEvent) } type FocusEvent struct { Detail uint8 Sequence uint16 Event Window Mode uint8 } func readFocusEvent(r *Reader, v *FocusEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } v.Detail, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Mode = r.Read1b() // 3 return nil } type FocusInEvent struct { FocusEvent } func readFocusInEvent(r *Reader, v *FocusInEvent) error { return readFocusEvent(r, &v.FocusEvent) } type FocusOutEvent struct { FocusEvent } func readFocusOutEvent(r *Reader, v *FocusOutEvent) error { return readFocusEvent(r, &v.FocusEvent) } type KeymapNotifyEvent struct { Keys []byte } func readKeymapNotifyEvent(r *Reader, v *KeymapNotifyEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } r.ReadPad(1) v.Keys = r.MustReadBytes(31) // 8 return nil } type ExposeEvent struct { Sequence uint16 Window Window X uint16 Y uint16 Width uint16 Height uint16 Count uint16 } func readExposeEvent(r *Reader, v *ExposeEvent) error { if !r.RemainAtLeast4b(5) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.X = r.Read2b() v.Y = r.Read2b() // 3 v.Width = r.Read2b() v.Height = r.Read2b() v.Count = r.Read2b() // 5 return nil } type GraphicsExposureEvent struct { Sequence uint16 Drawable Drawable X uint16 Y uint16 Width uint16 Height uint16 MinorOpcode uint16 Count uint16 MajorOpcode uint8 } func readGraphicsExposureEvent(r *Reader, v *GraphicsExposureEvent) error { if !r.RemainAtLeast4b(6) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Drawable = Drawable(r.Read4b()) v.X = r.Read2b() v.Y = r.Read2b() // 3 v.Width = r.Read2b() v.Height = r.Read2b() v.MinorOpcode = r.Read2b() v.Count = r.Read2b() v.MajorOpcode = r.Read1b() // 6 return nil } type NoExposureEvent struct { Sequence uint16 Drawable Drawable MinorOpcode uint16 MajorOpcode uint8 } func readNoExposureEvent(r *Reader, v *NoExposureEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Drawable = Drawable(r.Read4b()) v.MinorOpcode = r.Read2b() v.MajorOpcode = r.Read1b() // 3 return nil } type VisibilityNotifyEvent struct { Sequence uint16 Window Window State uint8 } func readVisibilityNotifyEvent(r *Reader, v *VisibilityNotifyEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.State = r.Read1b() // 3 return nil } type CreateNotifyEvent struct { Sequence uint16 Parent Window Window Window X int16 Y int16 Width uint16 Height uint16 BorderWidth uint16 OverrideRedirect bool } func readCreateNotifyEvent(r *Reader, v *CreateNotifyEvent) error { if !r.RemainAtLeast4b(5) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) // 3 v.Width = r.Read2b() v.Height = r.Read2b() v.BorderWidth = r.Read2b() v.OverrideRedirect = r.ReadBool() // 5 return nil } type DestroyNotifyEvent struct { Sequence uint16 Event Window Window Window } func readDestroyNotifyEvent(r *Reader, v *DestroyNotifyEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) // 3 return nil } type UnmapNotifyEvent struct { Sequence uint16 Event Window Window Window FromConfigure bool } func readUnmapNotifyEvent(r *Reader, v *UnmapNotifyEvent) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.FromConfigure = r.ReadBool() // 4 return nil } type MapNotifyEvent struct { Sequence uint16 Event Window Window Window OverrideRedirect bool } func readMapNotifyEvent(r *Reader, v *MapNotifyEvent) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.OverrideRedirect = r.ReadBool() // 4 return nil } type MapRequestEvent struct { Sequence uint16 Parent Window Window Window } func readMapRequestEvent(r *Reader, v *MapRequestEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Parent = Window(r.Read4b()) v.Window = Window(r.Read4b()) // 3 return nil } type ReparentNotifyEvent struct { Sequence uint16 Event Window Window Window Parent Window X int16 Y int16 OverrideRedirect bool } func readReparentNotifyEvent(r *Reader, v *ReparentNotifyEvent) error { if !r.RemainAtLeast4b(6) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.Parent = Window(r.Read4b()) // 4 v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.OverrideRedirect = r.ReadBool() // 6 return nil } type ConfigureNotifyEvent struct { Sequence uint16 Event Window Window Window AboveSibling Window X int16 Y int16 Width uint16 Height uint16 BorderWidth uint16 OverrideRedirect bool } func readConfigureNotifyEvent(r *Reader, v *ConfigureNotifyEvent) error { if !r.RemainAtLeast4b(7) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.AboveSibling = Window(r.Read4b()) // 4 v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) v.Width = r.Read2b() v.Height = r.Read2b() v.BorderWidth = r.Read2b() v.OverrideRedirect = r.ReadBool() // 7 return nil } type ConfigureRequestEvent struct { StackMode uint8 Sequence uint16 Parent Window Window Window Sibling Window X int16 Y int16 Width uint16 Height uint16 BorderWidth uint16 ValueMask uint16 } func readConfigureRequestEvent(r *Reader, v *ConfigureRequestEvent) error { if !r.RemainAtLeast4b(7) { return ErrDataLenShort } v.StackMode, v.Sequence = r.ReadEventHeader() v.Parent = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.Sibling = Window(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) // 5 v.Width = r.Read2b() v.Height = r.Read2b() v.BorderWidth = r.Read2b() v.ValueMask = r.Read2b() // 7 return nil } type GravityNotifyEvent struct { Sequence uint16 Event Window Window Window X int16 Y int16 } func readGravityNotifyEvent(r *Reader, v *GravityNotifyEvent) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) v.X = int16(r.Read2b()) v.Y = int16(r.Read2b()) // 4 return nil } type ResizeRequestEvent struct { Sequence uint16 Window Window Width uint16 Height uint16 } func readResizeRequestEvent(r *Reader, v *ResizeRequestEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.Width = r.Read2b() v.Height = r.Read2b() // 3 return nil } type CirculateEvent struct { Sequence uint16 Event Window Window Window Place uint8 } func readCirculateEvent(r *Reader, v *CirculateEvent) error { if !r.RemainAtLeast4b(5) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Event = Window(r.Read4b()) v.Window = Window(r.Read4b()) // unused r.ReadPad(4) v.Place = r.Read1b() // 5 return nil } type CirculateNotifyEvent struct { CirculateEvent } func readCirculateNotifyEvent(r *Reader, v *CirculateNotifyEvent) error { return readCirculateEvent(r, &v.CirculateEvent) } type CirculateRequestEvent struct { CirculateEvent } func readCirculateRequestEvent(r *Reader, v *CirculateRequestEvent) error { return readCirculateEvent(r, &v.CirculateEvent) } type PropertyNotifyEvent struct { Sequence uint16 Window Window Atom Atom Time Timestamp State uint8 } func readPropertyNotifyEvent(r *Reader, v *PropertyNotifyEvent) error { if !r.RemainAtLeast4b(5) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.Atom = Atom(r.Read4b()) v.Time = Timestamp(r.Read4b()) v.State = r.Read1b() // 5 return nil } type SelectionClearEvent struct { Sequence uint16 Time Timestamp Owner Window Selection Atom } func readSelectionClearEvent(r *Reader, v *SelectionClearEvent) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Time = Timestamp(r.Read4b()) v.Owner = Window(r.Read4b()) v.Selection = Atom(r.Read4b()) // 4 return nil } type SelectionRequestEvent struct { Sequence uint16 Time Timestamp Owner Window Requestor Window Selection Atom Target Atom Property Atom } func readSelectionRequestEvent(r *Reader, v *SelectionRequestEvent) error { if !r.RemainAtLeast4b(7) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Time = Timestamp(r.Read4b()) v.Owner = Window(r.Read4b()) v.Requestor = Window(r.Read4b()) v.Selection = Atom(r.Read4b()) // 5 v.Target = Atom(r.Read4b()) v.Property = Atom(r.Read4b()) // 7 return nil } type SelectionNotifyEvent struct { Sequence uint16 Time Timestamp Requestor Window Selection Atom Target Atom Property Atom } func readSelectionNotifyEvent(r *Reader, v *SelectionNotifyEvent) error { if !r.RemainAtLeast4b(6) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Time = Timestamp(r.Read4b()) v.Requestor = Window(r.Read4b()) v.Selection = Atom(r.Read4b()) v.Target = Atom(r.Read4b()) v.Property = Atom(r.Read4b()) // 6 return nil } func WriteSelectionNotifyEvent(w *Writer, v *SelectionNotifyEvent) { w.Write1b(SelectionNotifyEventCode) w.WritePad(1) w.Write2b(v.Sequence) w.Write4b(uint32(v.Time)) w.Write4b(uint32(v.Requestor)) w.Write4b(uint32(v.Selection)) w.Write4b(uint32(v.Target)) w.Write4b(uint32(v.Property)) w.WritePad(8) } type ColormapNotifyEvent struct { Sequence uint16 Window Window Colormap Colormap New bool State uint8 } func readColormapNotifyEvent(r *Reader, v *ColormapNotifyEvent) error { if !r.RemainAtLeast4b(4) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.Colormap = Colormap(r.Read4b()) // 3 v.New = r.ReadBool() v.State = r.Read1b() // 4 return nil } type ClientMessageEvent struct { Format uint8 Sequence uint16 Window Window Type Atom Data ClientMessageData } func readClientMessageEvent(r *Reader, v *ClientMessageEvent) error { if !r.RemainAtLeast4b(8) { return ErrDataLenShort } v.Format, v.Sequence = r.ReadEventHeader() v.Window = Window(r.Read4b()) v.Type = Atom(r.Read4b()) // 3 data := r.MustReadBytes(20) // 8 v.Data = ClientMessageData{ data: data, } return nil } func WriteClientMessageEvent(w *Writer, v *ClientMessageEvent) { w.Write1b(ClientMessageEventCode) w.Write1b(v.Format) w.Write2b(v.Sequence) w.Write4b(uint32(v.Window)) w.Write4b(uint32(v.Type)) writeClientMessageData(w, &v.Data) } type MappingNotifyEvent struct { Sequence uint16 Request uint8 FirstKeycode Keycode Count uint8 } func readMappingNotifyEvent(r *Reader, v *MappingNotifyEvent) error { if !r.RemainAtLeast4b(2) { return ErrDataLenShort } _, v.Sequence = r.ReadEventHeader() v.Request = r.Read1b() v.FirstKeycode = Keycode(r.Read1b()) v.Count = r.Read1b() // 2 return nil } type GeGenericEvent struct { Extension uint8 Sequence uint16 Length uint32 EventType uint16 Data []byte } func readGeGenericEvent(r *Reader, v *GeGenericEvent) error { if !r.RemainAtLeast4b(3) { return ErrDataLenShort } v.Extension, v.Sequence = r.ReadEventHeader() v.Length = r.Read4b() v.EventType = r.Read2b() // 3 var err error v.Data, err = r.ReadBytes(22 + (int(v.Length) * 4)) return err } go-x11-client-1.0.2/xproto_test.go000066400000000000000000000303031460713373000167260ustar00rootroot00000000000000// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later package x import ( "os" "sync" "testing" "github.com/stretchr/testify/assert" ) var globalConn *Conn var globalConnMu sync.Mutex func getConn(t *testing.T) *Conn { if os.Getenv("DISPLAY") == "" { t.Skip("no set DISPLAY env var") } globalConnMu.Lock() defer globalConnMu.Unlock() if globalConn == nil { conn, err := NewConn() if err != nil { t.Fatal(err) } globalConn = conn } return globalConn } // test CreateWindow + GetGeometry + ChangeWindowAttributes + GetWindowAttributes // + DestroyWindow func TestCreateWindow(t *testing.T) { c := getConn(t) xid, err := c.AllocID() if err != nil { t.Fatal(err) } win := Window(xid) t.Log("win:", win) root := c.GetDefaultScreen().Root err = CreateWindowChecked(c, 0, win, root, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } gem, err := GetGeometry(c, Drawable(win)).Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, root, gem.Root) assert.Equal(t, int16(0), gem.X) assert.Equal(t, int16(0), gem.Y) assert.Equal(t, uint16(1), gem.Width) assert.Equal(t, uint16(1), gem.Height) assert.Equal(t, uint16(0), gem.BorderWidth) err = ChangeWindowAttributesChecked(c, win, CWSaveUnder, []uint32{True}).Check(c) if err != nil { t.Fatal(err) } attrs, err := GetWindowAttributes(c, win).Reply(c) if err != nil { t.Fatal(err) } assert.True(t, attrs.SaveUnder) err = DestroyWindowChecked(c, win).Check(c) if err != nil { t.Fatal(err) } } func TestDestroySubwindows(t *testing.T) { c := getConn(t) xid, err := c.AllocID() if err != nil { t.Fatal(err) } win := Window(xid) t.Log("win:", win) root := c.GetDefaultScreen().Root err = CreateWindowChecked(c, 0, win, root, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } xid2, err := c.AllocID() if err != nil { t.Fatal(err) } win2 := Window(xid2) t.Log("win2:", win2) err = CreateWindowChecked(c, 0, win2, win, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } xid3, err := c.AllocID() if err != nil { t.Fatal(err) } win3 := Window(xid3) t.Log("win3:", win3) err = CreateWindowChecked(c, 0, win3, win, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } err = DestroySubwindowsChecked(c, win).Check(c) if err != nil { t.Fatal(err) } _, err = GetWindowAttributes(c, win).Reply(c) assert.Nil(t, err) _, err = GetWindowAttributes(c, win2).Reply(c) assert.NotNil(t, err) _, err = GetWindowAttributes(c, win3).Reply(c) assert.NotNil(t, err) } // test ReparentWindow + QueryTree func TestReparentWindow(t *testing.T) { c := getConn(t) xid, err := c.AllocID() if err != nil { t.Fatal(err) } win := Window(xid) t.Log("win:", win) root := c.GetDefaultScreen().Root err = CreateWindowChecked(c, 0, win, root, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } xid2, err := c.AllocID() if err != nil { t.Fatal(err) } win2 := Window(xid2) err = CreateWindowChecked(c, 0, win2, root, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } err = ReparentWindowChecked(c, win2, win, 0, 0).Check(c) if err != nil { t.Fatal(err) } tree, err := QueryTree(c, win2).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", tree) assert.Equal(t, root, tree.Root) assert.Equal(t, win, tree.Parent) assert.Equal(t, []Window(nil), tree.Children) tree, err = QueryTree(c, win).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", tree) assert.Equal(t, root, tree.Root) assert.Equal(t, root, tree.Parent) assert.Equal(t, []Window{win2}, tree.Children) } func TestInternAtom(t *testing.T) { c := getConn(t) ia, err := InternAtom(c, true, "CARDINAL").Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, Atom(AtomCardinal), ia.Atom) ia, err = InternAtom(c, true, "WM_CLASS").Reply(c) if err != nil { t.Log(err) } assert.Equal(t, Atom(AtomWMClass), ia.Atom) } func TestGetAtomName(t *testing.T) { c := getConn(t) an, err := GetAtomName(c, AtomCardinal).Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, "CARDINAL", an.Name) an, err = GetAtomName(c, AtomPrimary).Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, "PRIMARY", an.Name) } func TestGetProperty(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root ia, err := InternAtom(c, false, "Xorg_Seat").Reply(c) if err != nil { t.Fatal(err) } atomXorgSeat := ia.Atom p, err := GetProperty(c, false, root, atomXorgSeat, AtomString, 0, 0xffff).Reply(c) if err != nil { t.Fatal(err) } if p.Format != 0 { // has property assert.Equal(t, uint8(8), p.Format) assert.Equal(t, Atom(AtomString), p.Type) t.Logf("Xorg_Set: %s", p.Value) } ia, err = InternAtom(c, false, "_NET_CURRENT_DESKTOP").Reply(c) if err != nil { t.Fatal(err) } atomNetCurrentDesktop := ia.Atom p, err = GetProperty(c, false, root, atomNetCurrentDesktop, AtomCardinal, 0, 1).Reply(c) if err != nil { t.Fatal(err) } if p.Format != 0 { assert.Equal(t, Atom(AtomCardinal), p.Type) assert.Equal(t, 4, len(p.Value)) assert.Equal(t, uint32(1), p.ValueLen) t.Log("current desktop:", p.Value) } } func TestChangeProperty(t *testing.T) { c := getConn(t) xid, err := c.AllocID() if err != nil { t.Fatal(err) } win := Window(xid) t.Log("win:", win) root := c.GetDefaultScreen().Root err = CreateWindowChecked(c, 0, win, root, 0, 0, 1, 1, 0, WindowClassInputOutput, 0, 0, nil).Check(c) if err != nil { t.Fatal(err) } wmClass := []byte("test\x00test") err = ChangePropertyChecked(c, PropModeReplace, win, AtomWMClass, AtomString, 8, wmClass).Check(c) if err != nil { t.Fatal(err) } prop, err := GetProperty(c, false, win, AtomWMClass, AtomString, 0, 0xffff).Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, Atom(AtomString), prop.Type) assert.Equal(t, uint8(8), prop.Format) assert.Equal(t, wmClass, prop.Value) err = DestroyWindowChecked(c, win).Check(c) if err != nil { t.Fatal(err) } } func TestListProperties(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root props, err := ListProperties(c, root).Reply(c) if err != nil { t.Fatal(err) } t.Log(props.Atoms) } // GrabPointer + UngrabPointer func TestGrabPointer(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root grab, err := GrabPointer(c, false, root, 0, GrabModeSync, GrabModeSync, None, None, CurrentTime).Reply(c) if err != nil { t.Fatal(err) } if grab.Status == GrabStatusSuccess { err := UngrabPointerChecked(c, CurrentTime).Check(c) if err != nil { t.Fatal(err) } } } // GrabButton + UngrabButton func TestGrabButton(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root err := GrabButtonChecked(c, false, root, 0, GrabModeSync, GrabModeSync, None, None, ButtonIndex1, 0).Check(c) if err != nil { t.Fatal(err) } err = UngrabButtonChecked(c, ButtonIndex1, root, 0).Check(c) if err != nil { t.Fatal(err) } } func TestGrabKey(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root key := c.GetSetup().MinKeycode err := GrabKeyChecked(c, false, root, 0, key, GrabModeSync, GrabModeSync).Check(c) if err != nil { t.Fatal(err) } err = UngrabKeyChecked(c, key, root, 0).Check(c) if err != nil { t.Fatal(err) } } func TestGrabKeyboard(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root grab, err := GrabKeyboard(c, false, root, CurrentTime, GrabModeSync, GrabModeSync).Reply(c) if err != nil { t.Fatal(err) } if grab.Status == GrabStatusSuccess { err := UngrabKeyboardChecked(c, CurrentTime).Check(c) if err != nil { t.Fatal(err) } } } // ListExtension + QueryExtension func TestListExtensions(t *testing.T) { c := getConn(t) list, err := ListExtensions(c).Reply(c) if err != nil { t.Fatal(err) } t.Log(list.Names) for _, extName := range list.Names { extInfo, err := QueryExtension(c, extName).Reply(c) if err != nil { t.Error(err) } else { t.Logf("%s %#v\n", extName, extInfo) assert.True(t, extInfo.Present) assert.True(t, extInfo.MajorOpcode > 0) } } } // GrabServer + UngrabServer func TestGrabServer(t *testing.T) { c := getConn(t) err := GrabServerChecked(c).Check(c) if err != nil { t.Fatal(err) } err = UngrabServerChecked(c).Check(c) if err != nil { t.Fatal(err) } } func TestQueryPointer(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root p, err := QueryPointer(c, root).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", p) } func TestGetMotionEvents(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root events, err := GetMotionEvents(c, root, CurrentTime, CurrentTime).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", events.Events) } func TestTranslateCoordinates(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root coord, err := TranslateCoordinates(c, root, root, 10, 20).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", coord) assert.Equal(t, int16(10), coord.DstX) assert.Equal(t, int16(20), coord.DstY) assert.True(t, coord.SameScreen) coord, err = TranslateCoordinates(c, root, root, -10, -20).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", coord) assert.Equal(t, int16(-10), coord.DstX) assert.Equal(t, int16(-20), coord.DstY) assert.True(t, coord.SameScreen) } func TestWarpPointer(t *testing.T) { c := getConn(t) root := c.GetDefaultScreen().Root err := WarpPointerChecked(c, 0, root, 0, 0, 0, 0, 10, 20).Check(c) if err != nil { t.Fatal(err) } } func TestGetInputFocus(t *testing.T) { c := getConn(t) focus, err := GetInputFocus(c).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v", focus) } func TestQueryKeymap(t *testing.T) { c := getConn(t) keymap, err := QueryKeymap(c).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", keymap) } func TestGetKeyboardMapping(t *testing.T) { c := getConn(t) minKeycode := c.GetSetup().MinKeycode maxKeycode := c.GetSetup().MaxKeycode // keycodes count count := uint8(maxKeycode - minKeycode + 1) kbdMapping, err := GetKeyboardMapping(c, minKeycode, count).Reply(c) if err != nil { t.Fatal(err) } t.Logf("%#v\n", kbdMapping) assert.Len(t, kbdMapping.Keysyms, int(count)*int(kbdMapping.KeysymsPerKeycode)) } func TestForceScreenSaver(t *testing.T) { c := getConn(t) err := ForceScreenSaverChecked(c, ScreenSaverReset).Check(c) if err != nil { t.Fatal(err) } } // SetScreenSaver + GetScreenSaver func TestSetScreenSaver(t *testing.T) { c := getConn(t) err := SetScreenSaverChecked(c, 900, 0, BlankingNotPreferred, ExposuresNotAllowed).Check(c) if err != nil { t.Fatal(err) } reply, err := GetScreenSaver(c).Reply(c) if err != nil { t.Fatal(err) } assert.Equal(t, uint16(900), reply.Timeout) assert.Equal(t, uint16(0), reply.Interval) assert.Equal(t, uint8(BlankingNotPreferred), reply.PreferBlanking) assert.Equal(t, uint8(ExposuresNotAllowed), reply.AllowExposures) } func TestConn_AllocID(t *testing.T) { c := getConn(t) const length = 10000 xidList := make([]uint32, length) for i := 0; i < length; i++ { xid, err := c.AllocID() if err != nil { t.Fatal(err) } xidList[i] = xid } for _, xid := range xidList { err := c.FreeID(xid) if err != nil { t.Fatal(err) } } err := c.FreeID(0) assert.NotNil(t, err) root := c.GetDefaultScreen().Root err = c.FreeID(uint32(root)) assert.NotNil(t, err) setup := c.GetSetup() err = c.FreeID((setup.ResourceIdBase | setup.ResourceIdMask) + 1) assert.NotNil(t, err) xid, err := c.AllocID() if err != nil { t.Fatal(err) } err = c.FreeID(xid) if err != nil { t.Fatal(err) } // free xid again err = c.FreeID(xid) assert.NotNil(t, err) } // AddEventChan + RemoveEventChan func TestConn_AddRemoveEventChan(t *testing.T) { c := getConn(t) // add one ch := make(chan GenericEvent) c.AddEventChan(ch) assert.Len(t, c.in.eventChans, 1) // add one ch1 := make(chan GenericEvent) c.AddEventChan(ch1) assert.Len(t, c.in.eventChans, 2) // remove one c.RemoveEventChan(ch) assert.Len(t, c.in.eventChans, 1) // remove not added ch2 := make(chan GenericEvent) c.RemoveEventChan(ch2) assert.Len(t, c.in.eventChans, 1) }